binary_op_ Struct Template
Common base struct template for binary comparators. More...
Declaration
struct micro_os_plus::micro_test_plus::detail::binary_op_<Lhs_T, Rhs_T> { ... }
Included Headers
Base struct
| struct | op |
|
Empty base struct for all operator types. More... | |
Derived Structs
| struct | and_<Lhs_T, Rhs_T> |
|
Logical AND comparator struct template. More... | |
| struct | eq_<Lhs_T, Rhs_T> |
|
Equality comparator struct template. More... | |
| struct | ge_<Lhs_T, Rhs_T> |
|
Greater than or equal comparator struct template. More... | |
| struct | gt_<Lhs_T, Rhs_T> |
|
Greater than comparator struct template. More... | |
| struct | le_<Lhs_T, Rhs_T> |
|
Less than or equal comparator struct template. More... | |
| struct | lt_<Lhs_T, Rhs_T> |
|
Less than comparator struct template. More... | |
| struct | ne_<Lhs_T, Rhs_T> |
|
Non-equality comparator struct template. More... | |
| struct | or_<Lhs_T, Rhs_T> |
|
Logical OR comparator struct template. More... | |
Public Constructors Index
template <class Lhs_T, class Rhs_T> | |
| constexpr | binary_op_ (const Lhs_T &lhs, const Rhs_T &rhs, bool value) |
|
Constructs a binary comparator with the given operands and pre-computed result. More... | |
Public Operators Index
template <class Lhs_T, class Rhs_T> | |
| constexpr | operator bool () const |
|
Conversion operator to boolean. More... | |
Public Member Functions Index
template <class Lhs_T, class Rhs_T> | |
| constexpr auto | lhs (void) const |
|
Retrieves the left-hand operand. More... | |
template <class Lhs_T, class Rhs_T> | |
| constexpr auto | rhs (void) const |
|
Retrieves the right-hand operand. More... | |
Private Member Attributes Index
template <class Lhs_T, class Rhs_T> | |
| const Lhs_T | lhs_ {} |
|
Stores the left-hand operand. More... | |
template <class Lhs_T, class Rhs_T> | |
| const Rhs_T | rhs_ {} |
|
Stores the right-hand operand. More... | |
template <class Lhs_T, class Rhs_T> | |
| const bool | value_ {} |
|
Stores the result of the comparison. More... | |
Description
Common base struct template for binary comparators.
This base struct stores two operands (left-hand and right-hand) along with the pre-computed boolean result of a binary comparison. Derived structs such as eq_, lt_, and others inherit from this to provide relational and logical operations. The comparison result is computed at construction time and cached, enabling efficient reporting and composition of complex assertions without repeated computation.
- Template Parameters
-
Lhs_T The type of the left-hand operand.
Rhs_T The type of the right-hand operand.
Definition at line 223 of file detail.h.
Public Constructors
binary_op_()
| constexpr |
Constructs a binary comparator with the given operands and pre-computed result.
- Parameters
-
lhs The left-hand operand.
rhs The right-hand operand.
value The pre-computed boolean result of the comparison.
Stores the two operands and the pre-computed boolean result of the comparison in the corresponding private members.
Declaration at line 233 of file detail.h, definition at line 134 of file detail-inlines.h.
References micro_os_plus::micro_test_plus::detail::binary_op_< Lhs_T, Rhs_T >::lhs, micro_os_plus::micro_test_plus::detail::binary_op_< Lhs_T, Rhs_T >::lhs_, micro_os_plus::micro_test_plus::detail::binary_op_< Lhs_T, Rhs_T >::rhs, micro_os_plus::micro_test_plus::detail::binary_op_< Lhs_T, Rhs_T >::rhs_ and micro_os_plus::micro_test_plus::detail::binary_op_< Lhs_T, Rhs_T >::value_.
Referenced by micro_os_plus::micro_test_plus::detail::and_< Lhs_T, Rhs_T >::and_, micro_os_plus::micro_test_plus::detail::eq_< Lhs_T, Rhs_T >::eq_, micro_os_plus::micro_test_plus::detail::ge_< Lhs_T, Rhs_T >::ge_, micro_os_plus::micro_test_plus::detail::gt_< Lhs_T, Rhs_T >::gt_, micro_os_plus::micro_test_plus::detail::le_< Lhs_T, Rhs_T >::le_, micro_os_plus::micro_test_plus::detail::lt_< Lhs_T, Rhs_T >::lt_, micro_os_plus::micro_test_plus::detail::ne_< Lhs_T, Rhs_T >::ne_, micro_os_plus::micro_test_plus::detail::or_< Lhs_T, Rhs_T >::or_ and micro_os_plus::micro_test_plus::detail::binary_op_< Lhs_T, Rhs_T >::operator bool.
Public Operators
operator bool()
| nodiscard constexpr |
Conversion operator to boolean.
- Parameters
None.
- Returns
The result of the comparison.
Returns the pre-computed boolean result stored by the derived comparator's constructor.
Declaration at line 243 of file detail.h, definition at line 148 of file detail-inlines.h.
References micro_os_plus::micro_test_plus::detail::binary_op_< Lhs_T, Rhs_T >::binary_op_ and micro_os_plus::micro_test_plus::detail::binary_op_< Lhs_T, Rhs_T >::value_.
Public Member Functions
lhs()
| nodiscard constexpr |
Retrieves the left-hand operand.
- Parameters
None.
- Returns
The extracted left-hand operand.
Returns the value of the left-hand operand, applying the generic getter to ensure correct extraction for both custom and standard types.
Declaration at line 253 of file detail.h, definition at line 161 of file detail-inlines.h.
References micro_os_plus::micro_test_plus::detail::get and micro_os_plus::micro_test_plus::detail::binary_op_< Lhs_T, Rhs_T >::lhs_.
Referenced by micro_os_plus::micro_test_plus::detail::and_< Lhs_T, Rhs_T >::and_, micro_os_plus::micro_test_plus::detail::binary_op_< Lhs_T, Rhs_T >::binary_op_, micro_os_plus::micro_test_plus::detail::eq_< Lhs_T, Rhs_T >::eq_, micro_os_plus::micro_test_plus::detail::ge_< Lhs_T, Rhs_T >::ge_, micro_os_plus::micro_test_plus::detail::gt_< Lhs_T, Rhs_T >::gt_, micro_os_plus::micro_test_plus::detail::le_< Lhs_T, Rhs_T >::le_, micro_os_plus::micro_test_plus::detail::lt_< Lhs_T, Rhs_T >::lt_, micro_os_plus::micro_test_plus::detail::ne_< Lhs_T, Rhs_T >::ne_, micro_os_plus::micro_test_plus::detail::or_< Lhs_T, Rhs_T >::or_, micro_os_plus::micro_test_plus::detail::expression_formatter::operator<<, micro_os_plus::micro_test_plus::detail::expression_formatter::operator<<, micro_os_plus::micro_test_plus::detail::expression_formatter::operator<<, micro_os_plus::micro_test_plus::detail::expression_formatter::operator<<, micro_os_plus::micro_test_plus::detail::expression_formatter::operator<<, micro_os_plus::micro_test_plus::detail::expression_formatter::operator<<, micro_os_plus::micro_test_plus::detail::expression_formatter::operator<< and micro_os_plus::micro_test_plus::detail::expression_formatter::operator<<.
rhs()
| nodiscard constexpr |
Retrieves the right-hand operand.
- Parameters
None.
- Returns
The extracted right-hand operand.
Returns the value of the right-hand operand, applying the generic getter to ensure correct extraction for both custom and standard types.
Declaration at line 263 of file detail.h, definition at line 174 of file detail-inlines.h.
References micro_os_plus::micro_test_plus::detail::get and micro_os_plus::micro_test_plus::detail::binary_op_< Lhs_T, Rhs_T >::rhs_.
Referenced by micro_os_plus::micro_test_plus::detail::and_< Lhs_T, Rhs_T >::and_, micro_os_plus::micro_test_plus::detail::binary_op_< Lhs_T, Rhs_T >::binary_op_, micro_os_plus::micro_test_plus::detail::eq_< Lhs_T, Rhs_T >::eq_, micro_os_plus::micro_test_plus::detail::ge_< Lhs_T, Rhs_T >::ge_, micro_os_plus::micro_test_plus::detail::gt_< Lhs_T, Rhs_T >::gt_, micro_os_plus::micro_test_plus::detail::le_< Lhs_T, Rhs_T >::le_, micro_os_plus::micro_test_plus::detail::lt_< Lhs_T, Rhs_T >::lt_, micro_os_plus::micro_test_plus::detail::ne_< Lhs_T, Rhs_T >::ne_, micro_os_plus::micro_test_plus::detail::or_< Lhs_T, Rhs_T >::or_, micro_os_plus::micro_test_plus::detail::expression_formatter::operator<<, micro_os_plus::micro_test_plus::detail::expression_formatter::operator<<, micro_os_plus::micro_test_plus::detail::expression_formatter::operator<<, micro_os_plus::micro_test_plus::detail::expression_formatter::operator<<, micro_os_plus::micro_test_plus::detail::expression_formatter::operator<<, micro_os_plus::micro_test_plus::detail::expression_formatter::operator<<, micro_os_plus::micro_test_plus::detail::expression_formatter::operator<< and micro_os_plus::micro_test_plus::detail::expression_formatter::operator<<.
Private Member Attributes
lhs_
|
Stores the left-hand operand.
Operands are stored by value; passing a large container will copy it into this member.
Definition at line 272 of file detail.h.
Referenced by micro_os_plus::micro_test_plus::detail::binary_op_< Lhs_T, Rhs_T >::binary_op_ and micro_os_plus::micro_test_plus::detail::binary_op_< Lhs_T, Rhs_T >::lhs.
rhs_
|
Stores the right-hand operand.
Operands are stored by value; passing a large container will copy it into this member.
Definition at line 280 of file detail.h.
Referenced by micro_os_plus::micro_test_plus::detail::binary_op_< Lhs_T, Rhs_T >::binary_op_ and micro_os_plus::micro_test_plus::detail::binary_op_< Lhs_T, Rhs_T >::rhs.
value_
|
Stores the result of the comparison.
Definition at line 285 of file detail.h.
Referenced by micro_os_plus::micro_test_plus::detail::binary_op_< Lhs_T, Rhs_T >::binary_op_ and micro_os_plus::micro_test_plus::detail::binary_op_< Lhs_T, Rhs_T >::operator bool.
The documentation for this struct was generated from the following files:
Generated via doxygen2docusaurus 2.2.0 by Doxygen 1.17.0.