Skip to main content

and_ Struct Template

Logical AND comparator struct template. More...

Declaration

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

Included Headers

Base struct

structbinary_op_<Lhs_T, Rhs_T>

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

Public Constructors Index

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

Constructs a logical AND 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...

Private 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 comparison. More...

Description

Logical AND comparator struct template.

Derived from binary_op_, this struct combines two sub-expressions with a logical AND operation. It enables composition of complex assertions by combining multiple conditions into a single logical whole, with reporting that shows the combined result and individual operand outcomes.

Template Parameters
Lhs_T

The type of the left-hand operand.

Rhs_T

The type of the right-hand operand.

Definition at line 502 of file detail.h.

Public Constructors

and_()

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

Constructs a logical AND comparator for the given operands.

Parameters
lhs

The left-hand operand.

rhs

The right-hand operand.

Evaluates the logical conjunction static_cast<bool>(lhs) and static_cast<bool>(rhs) and passes the result to the binary_op_ base class constructor.

Declaration at line 510 of file detail.h, definition at line 480 of file detail-inlines.h.

480 constexpr and_<Lhs_T, Rhs_T>::and_ (const Lhs_T& lhs, const Rhs_T& rhs)
481 : binary_op_<Lhs_T, Rhs_T>{
482 lhs, rhs, static_cast<bool> (lhs) and static_cast<bool> (rhs)
483 }
484 {
485 }

References micro_os_plus::micro_test_plus::detail::binary_op_< Lhs_T, Rhs_T >::binary_op_, micro_os_plus::micro_test_plus::detail::binary_op_< Lhs_T, Rhs_T >::lhs and micro_os_plus::micro_test_plus::detail::binary_op_< Lhs_T, Rhs_T >::rhs.

Public Operators

operator bool()

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

Conversion operator to boolean.

Parameters

None.

Returns

The result of the comparison.

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

Declaration at line 243 of file detail.h, definition at line 148 of file detail-inlines.h.

148 operator bool () const
149 {
150 return value_;
151 }

References micro_os_plus::micro_test_plus::detail::binary_op_< Lhs_T, Rhs_T >::binary_op_ and micro_os_plus::micro_test_plus::detail::binary_op_< Lhs_T, Rhs_T >::value_.

Public Member Functions

lhs()

template <class Lhs_T, class Rhs_T>
auto micro_os_plus::micro_test_plus::detail::binary_op_< Lhs_T, Rhs_T >::lhs (void)
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.

Declaration at line 253 of file detail.h, definition at line 161 of file detail-inlines.h.

162 {
163 return get (lhs_);
164 }

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

Referenced by micro_os_plus::micro_test_plus::detail::and_< Lhs_T, Rhs_T >::and_, micro_os_plus::micro_test_plus::detail::binary_op_< Lhs_T, Rhs_T >::binary_op_, micro_os_plus::micro_test_plus::detail::eq_< Lhs_T, Rhs_T >::eq_, micro_os_plus::micro_test_plus::detail::ge_< Lhs_T, Rhs_T >::ge_, micro_os_plus::micro_test_plus::detail::gt_< Lhs_T, Rhs_T >::gt_, micro_os_plus::micro_test_plus::detail::le_< Lhs_T, Rhs_T >::le_, micro_os_plus::micro_test_plus::detail::lt_< Lhs_T, Rhs_T >::lt_, micro_os_plus::micro_test_plus::detail::ne_< Lhs_T, Rhs_T >::ne_, micro_os_plus::micro_test_plus::detail::or_< Lhs_T, Rhs_T >::or_, micro_os_plus::micro_test_plus::detail::expression_formatter::operator<<, micro_os_plus::micro_test_plus::detail::expression_formatter::operator<<, micro_os_plus::micro_test_plus::detail::expression_formatter::operator<<, micro_os_plus::micro_test_plus::detail::expression_formatter::operator<<, micro_os_plus::micro_test_plus::detail::expression_formatter::operator<<, micro_os_plus::micro_test_plus::detail::expression_formatter::operator<<, micro_os_plus::micro_test_plus::detail::expression_formatter::operator<< and micro_os_plus::micro_test_plus::detail::expression_formatter::operator<<.

rhs()

template <class Lhs_T, class Rhs_T>
auto micro_os_plus::micro_test_plus::detail::binary_op_< Lhs_T, Rhs_T >::rhs (void)
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.

Declaration at line 263 of file detail.h, definition at line 174 of file detail-inlines.h.

175 {
176 return get (rhs_);
177 }

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

Referenced by micro_os_plus::micro_test_plus::detail::and_< Lhs_T, Rhs_T >::and_, micro_os_plus::micro_test_plus::detail::binary_op_< Lhs_T, Rhs_T >::binary_op_, micro_os_plus::micro_test_plus::detail::eq_< Lhs_T, Rhs_T >::eq_, micro_os_plus::micro_test_plus::detail::ge_< Lhs_T, Rhs_T >::ge_, micro_os_plus::micro_test_plus::detail::gt_< Lhs_T, Rhs_T >::gt_, micro_os_plus::micro_test_plus::detail::le_< Lhs_T, Rhs_T >::le_, micro_os_plus::micro_test_plus::detail::lt_< Lhs_T, Rhs_T >::lt_, micro_os_plus::micro_test_plus::detail::ne_< Lhs_T, Rhs_T >::ne_, micro_os_plus::micro_test_plus::detail::or_< Lhs_T, Rhs_T >::or_, micro_os_plus::micro_test_plus::detail::expression_formatter::operator<<, micro_os_plus::micro_test_plus::detail::expression_formatter::operator<<, micro_os_plus::micro_test_plus::detail::expression_formatter::operator<<, micro_os_plus::micro_test_plus::detail::expression_formatter::operator<<, micro_os_plus::micro_test_plus::detail::expression_formatter::operator<<, micro_os_plus::micro_test_plus::detail::expression_formatter::operator<<, micro_os_plus::micro_test_plus::detail::expression_formatter::operator<< and micro_os_plus::micro_test_plus::detail::expression_formatter::operator<<.

Private Member Attributes

lhs_

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

Stores the left-hand operand.

info

Operands are stored by value; passing a large container will copy it into this member.

Definition at line 272 of file detail.h.

272 const Lhs_T lhs_{};

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

rhs_

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

Stores the right-hand operand.

info

Operands are stored by value; passing a large container will copy it into this member.

Definition at line 280 of file detail.h.

280 const Rhs_T rhs_{};

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

value_

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

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


Generated via doxygen2docusaurus 2.2.0 by Doxygen 1.17.0.