Operators
Deprecated overloaded operators for test comparisons. More...
Operators Index
template <class Lhs_T, class Rhs_T> | |
| constexpr auto | operator and (Lhs_T &&lhs, Rhs_T &&rhs) |
|
Deprecated logical && (and) operator. More... | |
template <class T> | |
| constexpr auto | operator not (T &&t) |
|
Deprecated logical ! (not) operator. More... | |
template <class Lhs_T, class Rhs_T> | |
| constexpr auto | operator or (Lhs_T &&lhs, Rhs_T &&rhs) |
|
Deprecated logical || (or) operator. More... | |
template <class Lhs_T, class Rhs_T> | |
| constexpr auto | operator!= (Lhs_T &&lhs, Rhs_T &&rhs) |
|
Deprecated non-equality operator. More... | |
template <class Lhs_T, class Rhs_T> | |
| constexpr auto | operator< (Lhs_T &&lhs, Rhs_T &&rhs) |
|
Deprecated less than operator. More... | |
template <class Lhs_T, class Rhs_T> | |
| constexpr auto | operator<= (Lhs_T &&lhs, Rhs_T &&rhs) |
|
Deprecated less than or equal operator. More... | |
template <class Lhs_T, class Rhs_T> | |
| constexpr auto | operator== (Lhs_T &&lhs, Rhs_T &&rhs) |
|
Deprecated equality operator. More... | |
template <class Lhs_T, class Rhs_T> | |
| constexpr auto | operator> (Lhs_T &&lhs, Rhs_T &&rhs) |
|
Deprecated greater than operator. More... | |
template <class Lhs_T, class Rhs_T> | |
| constexpr auto | operator>= (Lhs_T &&lhs, Rhs_T &&rhs) |
|
Deprecated greater than or equal operator. More... | |
Description
Deprecated overloaded operators for test comparisons.
The mt::operators namespace defines the comparison operators ==, !=, <, >, <=, and >=, and the logical operators and, or, and not, for the framework expression types. After using namespace mt::operators, a check such as t.expect (mt::to_i{ compute_answer () } == 42_i) reports the values of its operands, as the function comparators do.
- Deprecated
The operators are deprecated since 6.0.0, in favour of the function comparators mt::eq(), mt::ne(), mt::lt(), mt::le(), mt::gt(), and mt::ge(), and of the logical functions mt::all_of(), mt::any_of(), and mt::negate(), which check and report the plain values, without literal suffixes or wrappers.
- Limitations
-
- The operators apply only when at least one operand is a framework expression type (see extension::is_op): a deprecated literal, such as 1_i, or a deprecated wrapper, such as mt::to_i{ value }. When neither operand is, the standard operator is selected; it returns a plain bool, so a failed check cannot show the operands.
- The overloaded and and or operators evaluate both operands before the check, so they do not short-circuit like the built-in ones.
- Replacement
Operators
operator and()
| nodiscard constexpr |
Deprecated logical && (and) operator.
- Template Parameters
-
Lhs_T Type of the left hand side operand.
Rhs_T Type of the right hand side operand.
- Parameters
-
lhs Left hand side operand.
rhs Right hand side operand.
- Returns
A logical conjunction object that evaluates to true if both operands are true.
- Deprecated
-
use all_of() (since 6.0.0)
Constructs an and_op logical conjunction object from the two operands and returns it. The object evaluates to true if both operands are true. At least one operand must be a framework expression type (see extension::is_op).
Definition at line 854 of file deprecated-inlines.h.
operator not()
| nodiscard constexpr |
Deprecated logical ! (not) operator.
- Template Parameters
-
T Type of the operand, constrained to the framework expression types.
- Parameters
-
t Operand to be logically negated.
- Returns
A logical negator object that evaluates to true if the operand is false.
- Deprecated
-
use negate() (since 6.0.0)
Constructs a not_op logical negator object from the operand and returns it. The object evaluates to true if the operand is false. The operand must be a framework expression type (see extension::is_op).
Definition at line 886 of file deprecated-inlines.h.
operator or()
| nodiscard constexpr |
Deprecated logical || (or) operator.
- Template Parameters
-
Lhs_T Type of the left hand side operand.
Rhs_T Type of the right hand side operand.
- Parameters
-
lhs Left hand side operand.
rhs Right hand side operand.
- Returns
A logical disjunction object that evaluates to true if at least one operand is true.
- Deprecated
-
use any_of() (since 6.0.0)
Constructs an or_op logical disjunction object from the two operands and returns it. The object evaluates to true if at least one operand is true. At least one operand must be a framework expression type (see extension::is_op).
Definition at line 871 of file deprecated-inlines.h.
operator!=()
| nodiscard constexpr |
Deprecated non-equality operator.
- Template Parameters
-
Lhs_T Type of the left hand side operand.
Rhs_T Type of the right hand side operand.
- Parameters
-
lhs Left hand side operand.
rhs Right hand side operand.
- Returns
A comparator object that evaluates to true if the operands are not equal.
- Deprecated
-
use ne() (since 6.0.0)
Constructs a comparator object, with the not_equal_to tag, from the two operands and returns it. The comparator evaluates to true if the operands are not equal. At least one operand must be a framework expression type (see extension::is_op).
Definition at line 765 of file deprecated-inlines.h.
operator<()
| nodiscard constexpr |
Deprecated less than operator.
- Template Parameters
-
Lhs_T Type of the left hand side operand.
Rhs_T Type of the right hand side operand.
- Parameters
-
lhs Left hand side operand.
rhs Right hand side operand.
- Returns
A comparator object that evaluates to true if the left hand side operand is less than the right hand side operand.
- Deprecated
-
use lt() (since 6.0.0)
Constructs a comparator object, with the less tag, from the two operands and returns it. The comparator evaluates to true if lhs is less than rhs. At least one operand must be a framework expression type (see extension::is_op).
Definition at line 818 of file deprecated-inlines.h.
operator<=()
| nodiscard constexpr |
Deprecated less than or equal operator.
- Template Parameters
-
Lhs_T Type of the left hand side operand.
Rhs_T Type of the right hand side operand.
- Parameters
-
lhs Left hand side operand.
rhs Right hand side operand.
- Returns
A comparator object that evaluates to true if the left hand side operand is less than or equal to the right hand side operand.
- Deprecated
-
use le() (since 6.0.0)
Constructs a comparator object, with the less_equal tag, from the two operands and returns it. The comparator evaluates to true if lhs is less than or equal to rhs. At least one operand must be a framework type (see extension::is_op).
Definition at line 835 of file deprecated-inlines.h.
operator==()
| nodiscard constexpr |
Deprecated equality operator.
- Template Parameters
-
Lhs_T Type of the left hand side operand.
Rhs_T Type of the right hand side operand.
- Parameters
-
lhs Left hand side operand.
rhs Right hand side operand.
- Returns
A comparator object that evaluates to true if the operands are equal.
- Deprecated
-
use eq() (since 6.0.0)
Constructs a comparator object, with the equal_to tag, from the two operands and returns it. The comparator evaluates to true if the operands are equal. At least one operand must be a framework expression type (see extension::is_op).
Definition at line 747 of file deprecated-inlines.h.
operator>()
| nodiscard constexpr |
Deprecated greater than operator.
- Template Parameters
-
Lhs_T Type of the left hand side operand.
Rhs_T Type of the right hand side operand.
- Parameters
-
lhs Left hand side operand.
rhs Right hand side operand.
- Returns
A comparator object that evaluates to true if the left hand side operand is greater than the right hand side operand.
- Deprecated
-
use gt() (since 6.0.0)
Constructs a comparator object, with the greater tag, from the two operands and returns it. The comparator evaluates to true if lhs is greater than rhs. At least one operand must be a framework expression type (see extension::is_op).
Definition at line 783 of file deprecated-inlines.h.
operator>=()
| nodiscard constexpr |
Deprecated greater than or equal operator.
- Template Parameters
-
Lhs_T Type of the left hand side operand.
Rhs_T Type of the right hand side operand.
- Parameters
-
lhs Left hand side operand.
rhs Right hand side operand.
- Returns
A comparator object that evaluates to true if the left hand side operand is greater than or equal to the right hand side operand.
- Deprecated
-
use ge() (since 6.0.0)
Constructs a comparator object, with the greater_equal tag, from the two operands and returns it. The comparator evaluates to true if lhs is greater than or equal to rhs. At least one operand must be a framework expression type (see extension::is_op).
Definition at line 801 of file deprecated-inlines.h.
Generated via doxygen2docusaurus 2.2.8 by Doxygen 1.18.0.