Skip to main content

Old logical function names

Deprecated v5.0.1 names of the logical functions. More...

Deprecated Functions Index​

template <class Expr_T>
constexpr auto_not (Expr_T &&expr)

Deprecated generic logical not operation, the v5.0.1 name of negate(). More...

template <class Lhs_T, class Rhs_T>
constexpr auto_and (Lhs_T &&lhs, Rhs_T &&rhs)

Deprecated generic logical and operation, the v5.0.1 name of all_of(). More...

template <class Lhs_T, class Rhs_T>
constexpr auto_or (Lhs_T &&lhs, Rhs_T &&rhs)

Deprecated generic logical (inclusive) or operation, the v5.0.1 name of any_of(). More...

template <class T>
constexpr T &mut (const T &t) noexcept

Deprecated generic mutator to remove const qualification from a reference. More...

template <class T>
constexpr auto approx (T value, std::type_identity_t< T > epsilon) noexcept -> detail::value< T >

Deprecated wrapping of a floating-point value with an explicit comparison tolerance. More...

Description​

Deprecated v5.0.1 names of the logical functions.

The functions mt::_and(), mt::_or(), and mt::_not() are the v5.0.1 names of mt::all_of(), mt::any_of(), and mt::negate(), and behave as them. They are deprecated since 6.0.0, because no other current public name starts with an underscore.

DeprecatedReplacement
mt::_and()mt::all_of()
mt::_or()mt::any_of()
mt::_not()mt::negate()

Unlike the replacements, mt::_and() and mt::_or() take exactly two operands, whereas mt::all_of() and mt::any_of() take two or more.

Example
 // Deprecated.
 t.expect (mt::_and (mt::eq (compute_answer (), 42),
  mt::lt (compute_answer (), 43)));
 
 // Replacement.
 t.expect (mt::all_of (mt::eq (compute_answer (), 42),
  mt::lt (compute_answer (), 43)));

The overloaded logical operators of the mt::operators namespace are also deprecated since 6.0.0, in favour of the same functions.

Deprecated Functions​

_and()​

template <class Lhs_T, class Rhs_T>
auto micro_os_plus::micro_test_plus::_and (Lhs_T && lhs, Rhs_T && rhs)
nodiscard constexpr

Deprecated generic logical and operation, the v5.0.1 name of all_of().

The same as all_of(). The name was changed since a leading underscore is not used by the other current public names.

Template Parameters
Lhs_T

Type of the left hand side operand.

Rhs_T

Type of the right hand side operand.

Parameters
lhs

Left hand side operand.

rhs

Right hand side operand.

Returns

An object that evaluates to true if both operand expressions are true.

Deprecated

use all_of() (since 6.0.0)

Forwards to all_of(), so the returned expression is the same, and is reported in the same way.

Definition at line 698 of file deprecated-inlines.h.

698 _and (Lhs_T&& lhs, Rhs_T&& rhs)
699 {
700 return all_of (std::forward<Lhs_T> (lhs), std::forward<Rhs_T> (rhs));
701 }

References micro_os_plus::micro_test_plus::_and and micro_os_plus::micro_test_plus::all_of.

Referenced by micro_os_plus::micro_test_plus::_and.

_not()​

template <class Expr_T>
auto micro_os_plus::micro_test_plus::_not (Expr_T && expr)
nodiscard constexpr

Deprecated generic logical not operation, the v5.0.1 name of negate().

The same as negate(). The name was changed since a leading underscore is not used by the other current public names.

Template Parameters
Expr_T

Type of the operand.

Parameters
expr

Logical expression to be negated.

Returns

An object that evaluates to true if the operand is false.

Deprecated

use negate() (since 6.0.0)

Forwards to negate(), so the returned expression is the same, and is reported in the same way.

Definition at line 685 of file deprecated-inlines.h.

685 _not (Expr_T&& expr)
686 {
687 return negate (std::forward<Expr_T> (expr));
688 }

References micro_os_plus::micro_test_plus::_not and micro_os_plus::micro_test_plus::negate.

Referenced by micro_os_plus::micro_test_plus::_not.

_or()​

template <class Lhs_T, class Rhs_T>
auto micro_os_plus::micro_test_plus::_or (Lhs_T && lhs, Rhs_T && rhs)
nodiscard constexpr

Deprecated generic logical (inclusive) or operation, the v5.0.1 name of any_of().

The same as any_of(). The name was changed since a leading underscore is not used by the other current public names.

Template Parameters
Lhs_T

Type of the left hand side operand.

Rhs_T

Type of the right hand side operand.

Parameters
lhs

Left hand side operand.

rhs

Right hand side operand.

Returns

An object that evaluates to true if at least one of the operand expressions is true, including when both are.

Deprecated

use any_of() (since 6.0.0)

Forwards to any_of(), so the returned expression is the same, and is reported in the same way.

Definition at line 711 of file deprecated-inlines.h.

711 _or (Lhs_T&& lhs, Rhs_T&& rhs)
712 {
713 return any_of (std::forward<Lhs_T> (lhs), std::forward<Rhs_T> (rhs));
714 }

References micro_os_plus::micro_test_plus::_or and micro_os_plus::micro_test_plus::any_of.

Referenced by micro_os_plus::micro_test_plus::_or.

approx()​

template <class T>
detail::value< T > micro_os_plus::micro_test_plus::approx (T value, std::type_identity_t< T > epsilon)
nodiscard constexpr noexcept

Deprecated wrapping of a floating-point value with an explicit comparison tolerance.

The floating-point literals (1.5_d) and wrappers (to_d{ 1.5 }) compare with a tolerance derived from the number of decimals written (0.1 for 1.5). approx() makes the tolerance explicit, independent of how the value is written. All six comparisons apply it: values whose difference is less than the tolerance are equal, and neither less nor greater. If both operands have a tolerance, the smaller one is used.

 t.expect (mt::eq (compute_float (), mt::approx (42.0f, 0.001f)));

For a single comparison, also of integers, the approx (lhs, rhs, epsilon) function comparator may be used instead.

Template Parameters
T

The floating-point type of the value.

Parameters
value

The expected value.

epsilon

The tolerance, converted to T.

Returns

A detail::value<T> wrapper, recognised by the comparators and the operators.

Deprecated

Use the function comparator approx (lhs, rhs, epsilon) instead (since 6.0.0).

Since

6.0.0

Deprecated

use approx (lhs, rhs, epsilon) (since 6.0.0)

Constructs the floating-point detail::value<T> with the given tolerance, instead of the one derived from the number of decimals of the value.

Definition at line 1277 of file deprecated-inlines.h.

1277 approx (T value, std::type_identity_t<T> epsilon) noexcept
1279 {
1280 return detail::value<T>{ value, epsilon };
1281 }

Reference micro_os_plus::micro_test_plus::approx.

Referenced by micro_os_plus::micro_test_plus::approx and micro_os_plus::micro_test_plus::approx.

mut()​

template <class T>
T & micro_os_plus::micro_test_plus::mut (const T & t)
nodiscard constexpr noexcept

Deprecated generic mutator to remove const qualification from a reference.

Not used by the framework. Equivalent to const_cast<T&> (t), which replaces it.

warning

Modifying an object that was originally declared as const through the returned reference is undefined behaviour.

Template Parameters
T

The type of the input object.

Parameters
t

The object from which to remove const qualification.

Returns

A non-const reference to the input object.

Deprecated

use const_cast<T&> (since 6.0.0)

Removes the const qualifier from the reference with const_cast.

Definition at line 725 of file deprecated-inlines.h.

725 mut (const T& t) noexcept -> T&
726 {
727 return const_cast<T&> (t);
728 }

Reference micro_os_plus::micro_test_plus::mut.

Referenced by micro_os_plus::micro_test_plus::mut.


Generated via doxygen2docusaurus 2.2.8 by Doxygen 1.18.0.