and_op Struct Template
Logical AND comparator struct template. More...
Declaration
struct micro_os_plus::micro_test_plus::detail::and_op<Lhs_T, Rhs_T> { ... }
Included Headers
Base struct
| struct | binary_op<Lhs_T, Rhs_T> |
|
Common base struct template for binary comparators. More... | |
Public Member Typedefs Index
template <class Lhs_T, class Rhs_T> | |
| using | op_type = op |
|
Marker identifying the framework expression types. More... | |
Public Constructors Index
template <class L, class R> | |
| constexpr | and_op (L &&lhs, R &&rhs) |
|
Constructs a logical AND comparator for the given operands. 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 -> decltype(auto) |
|
Retrieves the left-hand operand. More... | |
template <class Lhs_T, class Rhs_T> | |
| constexpr auto | rhs (void) const -> decltype(auto) |
|
Retrieves the right-hand operand. More... | |
Private Member Attributes Index
template <class Lhs_T, class Rhs_T> | |
| Lhs_T | lhs_ |
|
Stores the left-hand operand. More... | |
template <class Lhs_T, class Rhs_T> | |
| 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
Logical AND comparator struct template.
Derived from binary_op, this struct combines two sub-expressions with a logical AND operation. It enables composition of complex checks by combining multiple conditions into a single logical whole, with reporting that shows the combined result and individual operand outcomes.
The temporaries are moved into the comparator, and the named sub-expressions are copied (see stored_operand_t).
- Template Parameters
-
Lhs_T The type of the stored left-hand sub-expression, either its type, or a const reference to it.
Rhs_T The type of the stored right-hand sub-expression, either its type, or a const reference to it.
Definition at line 1082 of file detail.h.
Public Member Typedefs
op_type
|
Marker identifying the framework expression types.
Detected by the extension::is_op concept, and inherited by all types derived from op.
Definition at line 128 of file extension.h.
Public Constructors
and_op()
| constexpr |
Constructs a logical AND comparator for the given operands.
The result is computed from the arguments, before they are forwarded to the base.
- Template Parameters
-
L The type of the left-hand operand argument.
R The type of the right-hand operand argument.
- Parameters
-
lhs The left-hand operand.
rhs The right-hand operand.
Evaluates the logical conjunction static_cast<bool>(lhs) and static_cast<bool>(rhs) and passes the result to the binary_op base class constructor.
Declaration at line 1098 of file detail.h, definition at line 1041 of file detail-inlines.h.
References micro_os_plus::micro_test_plus::detail::binary_op< Lhs_T, Rhs_T >::binary_op, micro_os_plus::micro_test_plus::detail::binary_op< Lhs_T, Rhs_T >::lhs and micro_os_plus::micro_test_plus::detail::binary_op< Lhs_T, Rhs_T >::rhs.
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 370 of file detail.h, definition at line 168 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.
The operand is unwrapped with detail::unwrap() and returned by reference, so that formatting it does not copy it.
- Parameters
None.
- Returns
The extracted left-hand operand.
Returns the value of the left-hand operand, unwrapped by detail::unwrap() if it is a framework wrapper type; the stored operand is not copied.
Declaration at line 384 of file detail.h, definition at line 181 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_ and micro_os_plus::micro_test_plus::detail::unwrap.
Referenced by micro_os_plus::micro_test_plus::detail::and_op< Lhs_T, Rhs_T >::and_op, micro_os_plus::micro_test_plus::detail::approx_op< Lhs_T, Rhs_T, Epsilon_T >::approx_op, micro_os_plus::micro_test_plus::detail::binary_op< Lhs_T, Rhs_T >::binary_op, micro_os_plus::micro_test_plus::detail::compare_op< Lhs_T, Rhs_T, Compare_T >::compare_op, micro_os_plus::micro_test_plus::detail::or_op< Lhs_T, Rhs_T >::or_op and micro_os_plus::micro_test_plus::detail::binary_op< Lhs_T, Rhs_T >::lhs.
rhs()
| nodiscard constexpr |
Retrieves the right-hand operand.
The operand is unwrapped with detail::unwrap() and returned by reference, so that formatting it does not copy it.
- Parameters
None.
- Returns
The extracted right-hand operand.
Returns the value of the right-hand operand, unwrapped by detail::unwrap() if it is a framework wrapper type; the stored operand is not copied.
Declaration at line 398 of file detail.h, definition at line 194 of file detail-inlines.h.
References 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::unwrap.
Referenced by micro_os_plus::micro_test_plus::detail::and_op< Lhs_T, Rhs_T >::and_op, micro_os_plus::micro_test_plus::detail::approx_op< Lhs_T, Rhs_T, Epsilon_T >::approx_op, micro_os_plus::micro_test_plus::detail::binary_op< Lhs_T, Rhs_T >::binary_op, micro_os_plus::micro_test_plus::detail::compare_op< Lhs_T, Rhs_T, Compare_T >::compare_op, micro_os_plus::micro_test_plus::detail::or_op< Lhs_T, Rhs_T >::or_op and micro_os_plus::micro_test_plus::detail::binary_op< Lhs_T, Rhs_T >::rhs.
Private Member Attributes
lhs_
|
Stores the left-hand operand.
A value, moved from a temporary or copied from a named operand, or, for a named operand that cannot be copied, a const reference to it (see stored_operand_t). It is not const, so that a temporary expression can be moved into an enclosing one.
Definition at line 410 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.
Stored as the left-hand operand is.
Definition at line 418 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.
Computed once, by the derived comparator constructor.
Definition at line 426 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.8 by Doxygen 1.18.0.