micro-test-plus 6.0.0
µTest++ Testing Framework
Loading...
Searching...
No Matches
micro_os_plus::micro_test_plus::detail::greater_equal Struct Reference

Greater than or equal tag for compare_op. More...

#include "micro-os-plus/micro-test-plus.h"

Static Public Member Functions

template<class Lhs_T, class Rhs_T>
static constexpr bool apply (const Lhs_T &lhs, const Rhs_T &rhs)
 Compares the operands with >=.

Static Public Attributes

static constexpr const char * symbol = " >= "
 The operator symbol, as displayed in the failure reports.
static constexpr bool within_tolerance_result = true
 Deprecated result when the operands are within the tolerance.

Detailed Description

Defines the operator applied by compare_op, its symbol in the failure reports, and the result when the operands are within the tolerance of the floating-point wrappers.

Definition at line 618 of file detail.h.

Member Function Documentation

◆ apply()

template<class Lhs_T, class Rhs_T>
bool micro_os_plus::micro_test_plus::detail::greater_equal::apply ( const Lhs_T & lhs,
const Rhs_T & rhs )
staticnodiscardconstexpr

Always inlined, also at -O0, so that the debug builds do not get one more function for each combination of operand types.

Template Parameters
Lhs_TThe type of the left-hand operand.
Rhs_TThe type of the right-hand operand.
Parameters
lhsThe left-hand operand.
rhsThe right-hand operand.
Returns
The result of lhs >= rhs, converted to bool.

The using-declaration makes the standard operators visible to unqualified lookup, in addition to those found by argument-dependent lookup, and hides any operator>= of the enclosing namespaces.

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

678 {
679 using std::operator>=;
680 if constexpr (sign_mixed_integers<Lhs_T, Rhs_T>)
681 {
682 return std::cmp_greater_equal (as_comparison_integer (lhs),
684 }
685 else
686 {
687 return lhs >= rhs;
688 }
constexpr comparison_integer_t< T > as_comparison_integer(const T value) noexcept
Converts an integer or a character to the type used to compare it.

References micro_os_plus::micro_test_plus::detail::as_comparison_integer().

Member Data Documentation

◆ symbol

const char* micro_os_plus::micro_test_plus::detail::greater_equal::symbol = " >= "
staticconstexpr

Includes the surrounding spaces, so that the formatter appends it with a single call; a C string, not a std::string_view, which would take two registers at each call site and enlarge the code.

Definition at line 628 of file detail.h.


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