Skip to main content

The or_ Struct Template Reference

Logical OR comparator struct template. More...

Declaration

template <class Lhs_T, class Rhs_T> struct micro_os_plus::micro_test_plus::detail::or_<Lhs_T, Rhs_T> { ... }

Included Headers

Base struct

structop

Empty base struct for all operator types. More...

Public Constructors Index

template <class Lhs_T, class Rhs_T>
constexpror_ (const Lhs_T &lhs={}, const Rhs_T &rhs={})

Constructs a logical OR comparator for the given operands. More...

Public Operators Index

template <class Lhs_T, class Rhs_T>
constexproperator bool () const

Conversion operator to boolean. More...

Public Member Functions Index

template <class Lhs_T, class Rhs_T>
constexpr autolhs (void) const

Retrieves the left-hand operand. More...

template <class Lhs_T, class Rhs_T>
constexpr autorhs (void) const

Retrieves the right-hand operand. More...

Public Member Attributes Index

template <class Lhs_T, class Rhs_T>
const Lhs_Tlhs_ {}

Stores the left-hand operand. More...

template <class Lhs_T, class Rhs_T>
const Rhs_Trhs_ {}

Stores the right-hand operand. More...

template <class Lhs_T, class Rhs_T>
const boolvalue_ {}

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

Description

Logical OR comparator struct template.

Template Parameters
Lhs_T

The type of the left-hand operand.

Rhs_T

The type of the right-hand operand.

The or_ struct template provides a type-safe mechanism for evaluating the logical disjunction (OR) of two operands 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 OR 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 1296 of file detail.h.

Public Constructors

or_()

template <class Lhs_T, class Rhs_T>
micro_os_plus::micro_test_plus::detail::or_< Lhs_T, Rhs_T >::or_ (const Lhs_T & lhs={}, const Rhs_T & rhs={})
inline constexpr

Constructs a logical OR comparator for the given operands.

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

Parameters
lhs

The left-hand operand.

rhs

The right-hand operand.

Definition at line 1309 of file detail.h.

1309 constexpr or_ (const Lhs_T& lhs = {}, const Rhs_T& rhs = {})
1310 : lhs_{ lhs }, rhs_{ rhs },
1311 value_{ static_cast<bool> (lhs) or static_cast<bool> (rhs) }
1312 {
1313 }

Reference micro_os_plus::micro_test_plus::detail::or_< Lhs_T, Rhs_T >::lhs.

Public Operators

operator bool()

template <class Lhs_T, class Rhs_T>
micro_os_plus::micro_test_plus::detail::or_< Lhs_T, Rhs_T >::operator bool ()
inline nodiscard constexpr

Conversion operator to boolean.

Parameters

None.

Return Values
true

At least one operand evaluates to true.

false

Both operands evaluate to false.

Returns the result of the logical OR operation.

Definition at line 1327 of file detail.h.

1327 operator bool () const
1328 {
1329 return value_;
1330 }

Reference micro_os_plus::micro_test_plus::detail::or_< Lhs_T, Rhs_T >::value_.

Public Member Functions

lhs()

template <class Lhs_T, class Rhs_T>
auto micro_os_plus::micro_test_plus::detail::or_< Lhs_T, Rhs_T >::lhs (void)
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 1345 of file detail.h.

1345 lhs (void) const
1346 {
1347 return get (lhs_);
1348 }

References micro_os_plus::micro_test_plus::detail::get and micro_os_plus::micro_test_plus::detail::or_< Lhs_T, Rhs_T >::lhs_.

Referenced by micro_os_plus::micro_test_plus::detail::or_< Lhs_T, Rhs_T >::or_ and micro_os_plus::micro_test_plus::test_reporter::operator<<.

rhs()

template <class Lhs_T, class Rhs_T>
auto micro_os_plus::micro_test_plus::detail::or_< Lhs_T, Rhs_T >::rhs (void)
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 1363 of file detail.h.

1363 rhs (void) const
1364 {
1365 return get (rhs_);
1366 }

References micro_os_plus::micro_test_plus::detail::get and micro_os_plus::micro_test_plus::detail::or_< Lhs_T, Rhs_T >::rhs_.

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

Public Member Attributes

lhs_

template <class Lhs_T, class Rhs_T>
const Lhs_T micro_os_plus::micro_test_plus::detail::or_< Lhs_T, Rhs_T >::lhs_ {}

Stores the left-hand operand.

Definition at line 1371 of file detail.h.

1371 const Lhs_T lhs_{};

Referenced by micro_os_plus::micro_test_plus::detail::or_< Lhs_T, Rhs_T >::lhs.

rhs_

template <class Lhs_T, class Rhs_T>
const Rhs_T micro_os_plus::micro_test_plus::detail::or_< Lhs_T, Rhs_T >::rhs_ {}

Stores the right-hand operand.

Definition at line 1376 of file detail.h.

1376 const Rhs_T rhs_{};

Referenced by micro_os_plus::micro_test_plus::detail::or_< Lhs_T, Rhs_T >::rhs.

value_

template <class Lhs_T, class Rhs_T>
const bool micro_os_plus::micro_test_plus::detail::or_< Lhs_T, Rhs_T >::value_ {}

Stores the result of the logical OR operation.

Definition at line 1381 of file detail.h.

1381 const bool value_{};

Referenced by micro_os_plus::micro_test_plus::detail::or_< 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.