The ne_
Struct Template Reference
Non-equality comparator struct template. More...
Declaration
Included Headers
Base struct
struct | op |
Empty base struct for all operator types. More... | |
Public Constructors Index
template <class Lhs_T, class Rhs_T> | |
constexpr | ne_ (const Lhs_T &lhs={}, const Rhs_T &rhs={}) |
Constructs a non-equality 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 |
Retrieves the left-hand operand. More... | |
template <class Lhs_T, class Rhs_T> | |
constexpr auto | rhs (void) const |
Retrieves the right-hand operand. More... | |
Public 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 non-equality comparison. More... | |
Description
Non-equality comparator struct template.
- Template Parameters
-
Lhs_T The type of the left-hand operand.
Rhs_T The type of the right-hand operand.
The ne_ struct template provides a type-safe mechanism for evaluating non-equality between two operands within the framework.
This comparator supports a variety of operand types, including those with static values, types with precision (epsilon), and generic types. For types with static values, the comparison is performed directly. For types supporting precision, the comparison accounts for the smallest epsilon to ensure accuracy, particularly for floating-point types. For all other types, the generic getter is used to retrieve and compare the values.
The implementation is optimised for use in embedded environments and supports both compile-time and run-time evaluation.
All definitions are intended for internal use within the framework and are implemented in the include/micro-os-plus folder to maintain a structured and modular codebase.
Definition at line 431 of file detail.h.
Public Constructors
ne_()
| inline constexpr |
Constructs a non-equality comparator for the given operands.
- Parameters
-
lhs The left-hand operand.
rhs The right-hand operand.
Evaluates the non-equality of the provided operands at construction, supporting static values, types with precision, and generic types. The result is stored in the value_ member for efficient access.
Definition at line 444 of file detail.h.
Reference micro_os_plus::micro_test_plus::detail::ne_< Lhs_T, Rhs_T >::lhs.
Public Operators
operator bool()
| inline nodiscard constexpr |
Conversion operator to boolean.
- Parameters
None.
- Return Values
-
true The operands are considered not equal.
false The operands are considered equal.
Returns the result of the non-equality comparison.
Definition at line 503 of file detail.h.
Reference micro_os_plus::micro_test_plus::detail::ne_< Lhs_T, Rhs_T >::value_.
Public Member Functions
lhs()
| inline 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.
Definition at line 521 of file detail.h.
References micro_os_plus::micro_test_plus::detail::get and micro_os_plus::micro_test_plus::detail::ne_< Lhs_T, Rhs_T >::lhs_.
Referenced by micro_os_plus::micro_test_plus::detail::ne_< Lhs_T, Rhs_T >::ne_ and micro_os_plus::micro_test_plus::test_reporter::operator<<.
rhs()
| inline 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.
Definition at line 539 of file detail.h.
References micro_os_plus::micro_test_plus::detail::get and micro_os_plus::micro_test_plus::detail::ne_< Lhs_T, Rhs_T >::rhs_.
Referenced by micro_os_plus::micro_test_plus::test_reporter::operator<<.
Public Member Attributes
lhs_
|
Stores the left-hand operand.
Definition at line 547 of file detail.h.
Referenced by micro_os_plus::micro_test_plus::detail::ne_< Lhs_T, Rhs_T >::lhs.
rhs_
|
Stores the right-hand operand.
Definition at line 552 of file detail.h.
Referenced by micro_os_plus::micro_test_plus::detail::ne_< Lhs_T, Rhs_T >::rhs.
value_
|
Stores the result of the non-equality comparison.
Definition at line 557 of file detail.h.
Referenced by micro_os_plus::micro_test_plus::detail::ne_< Lhs_T, Rhs_T >::operator bool.
The documentation for this struct was generated from the following file:
Generated via doxygen2docusaurus by Doxygen 1.14.0.