Skip to main content

operators Namespace

Deprecated comparison and logical operators of the test checks. More...

Definition​

namespace micro_os_plus::micro_test_plus::operators { ... }

Operators Index​

template <class Lhs_T, class Rhs_T>
constexpr autooperator and (Lhs_T &&lhs, Rhs_T &&rhs)

Deprecated logical && (and) operator. More...

template <class T>
constexpr autooperator not (T &&t)

Deprecated logical ! (not) operator. More...

template <class Lhs_T, class Rhs_T>
constexpr autooperator or (Lhs_T &&lhs, Rhs_T &&rhs)

Deprecated logical || (or) operator. More...

template <class Lhs_T, class Rhs_T>
constexpr autooperator!= (Lhs_T &&lhs, Rhs_T &&rhs)

Deprecated non-equality operator. More...

template <class Lhs_T, class Rhs_T>
constexpr autooperator< (Lhs_T &&lhs, Rhs_T &&rhs)

Deprecated less than operator. More...

template <class Lhs_T, class Rhs_T>
constexpr autooperator<= (Lhs_T &&lhs, Rhs_T &&rhs)

Deprecated less than or equal operator. More...

template <class Lhs_T, class Rhs_T>
constexpr autooperator== (Lhs_T &&lhs, Rhs_T &&rhs)

Deprecated equality operator. More...

template <class Lhs_T, class Rhs_T>
constexpr autooperator> (Lhs_T &&lhs, Rhs_T &&rhs)

Deprecated greater than operator. More...

template <class Lhs_T, class Rhs_T>
constexpr autooperator>= (Lhs_T &&lhs, Rhs_T &&rhs)

Deprecated greater than or equal operator. More...

Description​

Deprecated comparison and logical operators of the test checks.

The micro_os_plus::micro_test_plus::operators namespace provides the deprecated overloaded operators of the test checks.

This namespace includes the equality, inequality, relational, and logical operators of the framework expression types, which apply to the strongly-typed constants (the user-defined literals) and to the dynamic values (the wrappers).

warning

These operators may conflict with other operators defined within the application under test.

To minimise conflicts with application-defined operators, these overloads are enabled only when an operand is a framework expression type (see extension::is_op). Constants typically require a literal suffix (e.g., 1_i), while dynamic values should be wrapped using the provided casting utilities (e.g., mt::to_i{...}). When neither operand is of such a type, the standard operators are selected; they return a plain bool, so a failed check cannot show the operands.

The operands are forwarded, as by the function comparators: the temporaries are moved into the returned expression, and the named operands are copied, unless they cannot be copied, when they are referred to.

There are no operators for strings and containers: the standard operators would be selected for std::string objects and for containers of the same type, and the framework operators for std::string_view objects would also replace the standard ones in the application code that follows the using directive. Use mt::eq() and mt::ne() to compare strings and containers.

Deprecated

Use the function comparators eq(), ne(), gt(), ge(), lt(), and le(), with the plain values, and all_of(), any_of(), and negate() for the logical combinations (since 6.0.0). The function comparators accept the same operands, compare them and report them in the same way, and do not need the literal suffixes or the type wrappers.

Since

3.2.0


Generated via doxygen2docusaurus 2.2.8 by Doxygen 1.18.0.