micro-test-plus 4.1.0
µTest++ Testing Framework
Loading...
Searching...
No Matches
micro_os_plus::micro_test_plus::detail::not_< T > Struct Template Reference

Logical NOT comparator struct template. More...

#include <micro-os-plus/micro-test-plus.h>

Inheritance diagram for micro_os_plus::micro_test_plus::detail::not_< T >:

Public Member Functions

constexpr not_ (const T &t={})
 Constructs a logical NOT comparator for the given operand.
constexpr auto operand () const
 Retrieves the wrapped operand expression.
constexpr operator bool () const
 Conversion operator to boolean.

Private Attributes

const T t_ {}
 Stores the operand.
const bool value_ {}
 Stores the result of the operation.

Detailed Description

template<class T>
struct micro_os_plus::micro_test_plus::detail::not_< T >

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
TThe type of the operand.

Definition at line 566 of file detail.h.

Constructor & Destructor Documentation

◆ not_()

template<class T>
micro_os_plus::micro_test_plus::detail::not_< T >::not_ ( const T & t = {})
explicitconstexpr
Parameters
tThe operand to be negated.

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

Definition at line 511 of file detail-inlines.h.

512 : unary_op_<T>{ t, not static_cast<bool> (t) }
513 {
514 }
Logical NOT comparator struct template.
Definition detail.h:567
constexpr unary_op_(const T &t, bool value)
Constructs a unary comparator with the given operand and pre-computed result.

References micro_os_plus::micro_test_plus::detail::unary_op_< T >::unary_op_().

Member Function Documentation

◆ operand()

template<class T>
auto micro_os_plus::micro_test_plus::detail::unary_op_< T >::operand ( ) const
nodiscardconstexprinherited
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.

Definition at line 121 of file detail-inlines.h.

122 {
123 return get (t_);
124 }
constexpr auto get(const T &t)
Generic getter function template for value retrieval.

References micro_os_plus::micro_test_plus::detail::get(), and t_.

Referenced by micro_os_plus::micro_test_plus::detail::expression_formatter::operator<<().

◆ operator bool()

template<class T>
micro_os_plus::micro_test_plus::detail::unary_op_< T >::operator bool ( ) const
nodiscardconstexprinherited
Parameters
None.
Returns
The result of the operation.

Returns the pre-computed boolean result stored by the derived comparator's constructor.

Definition at line 108 of file detail-inlines.h.

110 {
111 return value_;
112 }
const bool value_
Stores the result of the operation.
Definition detail.h:201

References unary_op_(), and value_.

Member Data Documentation

◆ t_

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

Definition at line 196 of file detail.h.

196{};

Referenced by unary_op_(), and operand().

◆ value_

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

Definition at line 201 of file detail.h.

201{};

Referenced by unary_op_(), and operator bool().


The documentation for this struct was generated from the following files: