Skip to main content

The not_ Struct Template Reference

Logical NOT comparator struct template. More...

Declaration

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

Included Headers

Base struct

structop

Empty base struct for all operator types. 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 autovalue () const

Retrieves the value of the operand. More...

Public Member Attributes Index

template <class T>
const Tt_ {}

Stores the operand. More...

template <class T>
const boolvalue_ {}

Stores the result of the logical NOT operation. More...

Description

Logical NOT comparator struct template.

Template Parameters
T

The type of the operand.

The not_ struct template provides a type-safe mechanism for evaluating the logical negation (NOT) of an operand within the framework.

This comparator supports a wide range of operand types, applying the generic getter to ensure correct value extraction for both custom and standard types. The result of the logical NOT operation is stored in the value_ member for efficient access.

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/micro-test-plus folder to maintain a structured and modular codebase.

Definition at line 1414 of file detail.h.

Public Constructors

not_()

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

Constructs a logical NOT comparator for the given operand.

Parameters
t

The operand to be negated.

Evaluates the logical negation of the provided operand at construction, supporting both custom and standard types. The result is stored in the value_ member for efficient access.

Definition at line 1426 of file detail.h.

1426 explicit constexpr not_ (const T& t = {})
1427 : t_{ t }, value_{ not static_cast<bool> (t) }
1428 {
1429 }

Public Operators

operator bool()

template <class T>
micro_os_plus::micro_test_plus::detail::not_< T >::operator bool ()
inline nodiscard constexpr

Conversion operator to boolean.

Parameters

None.

Return Values
true

The operand evaluates to false.

false

The operand evaluates to true.

Returns the result of the logical NOT operation.

Definition at line 1443 of file detail.h.

1443 operator bool () const
1444 {
1445 return value_;
1446 }

Reference micro_os_plus::micro_test_plus::detail::not_< T >::value_.

Public Member Functions

value()

template <class T>
auto micro_os_plus::micro_test_plus::detail::not_< T >::value ()
inline nodiscard constexpr

Retrieves the value of the operand.

Parameters

None.

Returns

The extracted operand value.

Returns the value of the operand, applying the generic getter to ensure correct extraction for both custom and standard types.

Definition at line 1460 of file detail.h.

1460 value () const
1461 {
1462 return get (t_);
1463 }

References micro_os_plus::micro_test_plus::detail::get and micro_os_plus::micro_test_plus::detail::not_< T >::t_.

Referenced by micro_os_plus::micro_test_plus::test_reporter::operator<<.

Public Member Attributes

t_

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

Stores the operand.

Definition at line 1468 of file detail.h.

1468 const T t_{};

Referenced by micro_os_plus::micro_test_plus::detail::not_< T >::value.

value_

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

Stores the result of the logical NOT operation.

Definition at line 1473 of file detail.h.

1473 const bool value_{};

Referenced by micro_os_plus::micro_test_plus::detail::not_< T >::operator bool.


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


Generated via doxygen2docusaurus by Doxygen 1.14.0.