micro-test-plus 3.2.0
µTest++, a lightweight testing framework for embedded platforms
Loading...
Searching...
No Matches
micro_os_plus::micro_test_plus::operators Namespace Reference

Separate namespace with custom operators. More...

Functions

template<class Lhs_T , class Rhs_T , type_traits::requires_t< type_traits::is_op_v< Lhs_T > or type_traits::is_op_v< Rhs_T > > = 0>
constexpr auto operator and (const Lhs_T &lhs, const Rhs_T &rhs)
 Logical && (and) operator. It matches only if at least one operand is of local type (derived from local op).
 
template<class T , type_traits::requires_t< type_traits::is_op_v< T > > = 0>
constexpr auto operator not (const T &t)
 Logical ! (not) operator. It matches only if the operand is of local type (derived from local op).
 
template<class Lhs_T , class Rhs_T , type_traits::requires_t< type_traits::is_op_v< Lhs_T > or type_traits::is_op_v< Rhs_T > > = 0>
constexpr auto operator or (const Lhs_T &lhs, const Rhs_T &rhs)
 Logical || (or) operator. It matches only if at least one operand is of local type (derived from local op).
 
template<class Lhs_T , class Rhs_T , type_traits::requires_t< type_traits::is_op_v< Lhs_T > or type_traits::is_op_v< Rhs_T > > = 0>
constexpr auto operator!= (const Lhs_T &lhs, const Rhs_T &rhs)
 Non-equality operator. It matches only if at least one operand is of local type (derived from local op).
 
constexpr auto operator!= (std::string_view lhs, std::string_view rhs)
 Non-equality operator for string_view objects.
 
template<class T , type_traits::requires_t< type_traits::is_container_v< T > > = 0>
constexpr auto operator!= (T &&lhs, T &&rhs)
 Non-equality operator for containers.
 
template<class Lhs_T , class Rhs_T , type_traits::requires_t< type_traits::is_op_v< Lhs_T > or type_traits::is_op_v< Rhs_T > > = 0>
constexpr auto operator< (const Lhs_T &lhs, const Rhs_T &rhs)
 Less than operator. It matches only if at least one operand is of local type (derived from local op).
 
template<class Lhs_T , class Rhs_T , type_traits::requires_t< type_traits::is_op_v< Lhs_T > or type_traits::is_op_v< Rhs_T > > = 0>
constexpr auto operator<= (const Lhs_T &lhs, const Rhs_T &rhs)
 Less than or equal operator. It matches only if at least one operand is of local type (derived from local op).
 
template<class Lhs_T , class Rhs_T , type_traits::requires_t< type_traits::is_op_v< Lhs_T > or type_traits::is_op_v< Rhs_T > > = 0>
constexpr auto operator== (const Lhs_T &lhs, const Rhs_T &rhs)
 Equality operator. It matches only if at least one operand is of local type (derived from local op).
 
constexpr auto operator== (std::string_view lhs, std::string_view rhs)
 Equality operator for string_view objects.
 
template<class T , type_traits::requires_t< type_traits::is_container_v< T > > = 0>
constexpr auto operator== (T &&lhs, T &&rhs)
 Equality operator for containers.
 
template<class Lhs_T , class Rhs_T , type_traits::requires_t< type_traits::is_op_v< Lhs_T > or type_traits::is_op_v< Rhs_T > > = 0>
constexpr auto operator> (const Lhs_T &lhs, const Rhs_T &rhs)
 Greater than operator. It matches only if at least one operand is of local type (derived from local op).
 
template<class Lhs_T , class Rhs_T , type_traits::requires_t< type_traits::is_op_v< Lhs_T > or type_traits::is_op_v< Rhs_T > > = 0>
constexpr auto operator>= (const Lhs_T &lhs, const Rhs_T &rhs)
 Greater than or equal operator. It matches only if at least one operand is of local type (derived from local op).
 

Detailed Description

Separate namespace with custom operators.

Warning
Please note that they may interfere with other operators existing in the tested application.

To minimise the interferences, these operators are recognised only for specific types, and generally require constants to be suffixed with literals (like 1_i), and dynamic values to be casted to the custom types (like _i(...)).