Skip to main content

not_ Struct Template

Logical NOT comparator struct template. More...

Declaration

template <class T>
struct micro_os_plus::micro_test_plus::detail::not_<T> { ... }

Included Headers

Base struct

structunary_op_<T>

Common base struct template for unary comparators. More...

Public Constructors Index

template <class T>
constexprnot_ (const T &t={})

Constructs a logical NOT comparator for the given operand. More...

Public Operators Index

template <class T>
constexproperator bool () const

Conversion operator to boolean. More...

Public Member Functions Index

template <class T>
constexpr autooperand () const

Retrieves the wrapped operand expression. More...

Private Member Attributes Index

template <class T>
const Tt_ {}

Stores the operand. More...

template <class T>
const boolvalue_ {}

Stores the result of the operation. More...

Description

Logical NOT comparator struct template.

Derived from unary_op_, this struct negates a single sub-expression, enabling test writers to assert that a condition does not hold. The negation result is computed at construction time, ensuring consistent reporting throughout the assertion framework.

Template Parameters
T

The type of the operand.

Definition at line 566 of file detail.h.

Public Constructors

not_()

template <class T>
micro_os_plus::micro_test_plus::detail::not_< T >::not_ (const T & t={})
explicit constexpr

Constructs a logical NOT comparator for the given operand.

Parameters
t

The operand to be negated.

Evaluates the logical negation not static_cast<bool>(t) and passes the result to the unary_op_ base class constructor.

Declaration at line 573 of file detail.h, definition at line 511 of file detail-inlines.h.

511 constexpr not_<T>::not_ (const T& t)
512 : unary_op_<T>{ t, not static_cast<bool> (t) }
513 {
514 }

Reference micro_os_plus::micro_test_plus::detail::unary_op_< T >::unary_op_.

Public Operators

operator bool()

template <class T>
micro_os_plus::micro_test_plus::detail::unary_op_< T >::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.

109 operator bool () const
110 {
111 return value_;
112 }

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()

template <class T>
auto micro_os_plus::micro_test_plus::detail::unary_op_< T >::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.

122 {
123 return get (t_);
124 }

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_

template <class T>
const T micro_os_plus::micro_test_plus::detail::unary_op_< T >::t_ {}

value_

template <class T>
const bool micro_os_plus::micro_test_plus::detail::unary_op_< T >::value_ {}

Stores the result of the operation.

Definition at line 201 of file detail.h.

201 const bool value_{};

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.