unary_op_ Struct Template
Common base struct template for unary comparators. More...
Declaration
struct micro_os_plus::micro_test_plus::detail::unary_op_<T> { ... }
Included Headers
Base struct
| struct | op |
|
Empty base struct for all operator types. More... | |
Derived Structs
| struct | not_<T> |
|
Logical NOT comparator struct template. More... | |
Public Constructors Index
template <class T> | |
| constexpr | unary_op_ (const T &t, bool value) |
|
Constructs a unary comparator with the given operand and pre-computed result. More... | |
Public Operators Index
template <class T> | |
| constexpr | operator bool () const |
|
Conversion operator to boolean. More... | |
Public Member Functions Index
template <class T> | |
| constexpr auto | operand () const |
|
Retrieves the wrapped operand expression. More... | |
Private Member Attributes Index
template <class T> | |
| const T | t_ {} |
|
Stores the operand. More... | |
template <class T> | |
| const bool | value_ {} |
|
Stores the result of the operation. More... | |
Description
Common base struct template for unary comparators.
This base struct stores a single operand and the pre-computed boolean result of a unary operation. Derived structs such as not_ inherit from this to provide logical negation. The result is computed at construction time, enabling consistent handling and reporting of operations throughout the assertion framework.
- Template Parameters
-
T The type of the operand.
Definition at line 161 of file detail.h.
Public Constructors
unary_op_()
| constexpr |
Constructs a unary comparator with the given operand and pre-computed result.
- Parameters
-
t The operand.
value The pre-computed boolean result of the operation.
Stores the operand and the pre-computed boolean result of the operation in the corresponding private members.
Declaration at line 170 of file detail.h, definition at line 97 of file detail-inlines.h.
References micro_os_plus::micro_test_plus::detail::unary_op_< T >::t_ and micro_os_plus::micro_test_plus::detail::unary_op_< T >::value_.
Referenced by micro_os_plus::micro_test_plus::detail::not_< T >::not_ and micro_os_plus::micro_test_plus::detail::unary_op_< T >::operator bool.
Public Operators
operator bool()
| nodiscard constexpr |
Conversion operator to boolean.
- Parameters
None.
- Returns
The result of the operation.
Returns the pre-computed boolean result stored by the derived comparator's constructor.
Declaration at line 180 of file detail.h, definition at line 109 of file detail-inlines.h.
References micro_os_plus::micro_test_plus::detail::unary_op_< T >::unary_op_ and micro_os_plus::micro_test_plus::detail::unary_op_< T >::value_.
Public Member Functions
operand()
| nodiscard constexpr |
Retrieves the wrapped operand expression.
- Parameters
None.
- Returns
The extracted operand value.
Returns the wrapped operand, applying the generic getter to ensure correct extraction for both custom and standard types.
Declaration at line 190 of file detail.h, definition at line 121 of file detail-inlines.h.
References micro_os_plus::micro_test_plus::detail::get and micro_os_plus::micro_test_plus::detail::unary_op_< T >::t_.
Referenced by micro_os_plus::micro_test_plus::detail::expression_formatter::operator<<.
Private Member Attributes
t_
|
Stores the operand.
Definition at line 196 of file detail.h.
Referenced by micro_os_plus::micro_test_plus::detail::unary_op_< T >::unary_op_ and micro_os_plus::micro_test_plus::detail::unary_op_< T >::operand.
value_
|
Stores the result of the operation.
Definition at line 201 of file detail.h.
Referenced by micro_os_plus::micro_test_plus::detail::unary_op_< T >::unary_op_ and micro_os_plus::micro_test_plus::detail::unary_op_< 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.