Skip to main content

Literals and wrappers

Deprecated literal operators and wrappers for typed operands. More...

Classes Index​

structto_t<T>

Deprecated generic strongly-typed wrapper for explicit type conversion. More...

Operators Index​

constexpr autooperator""_b (const char *name, decltype(sizeof("")) size)

Deprecated user-defined literal operator to create a named boolean constant. More...

template <char... Cs>
constexpr autooperator""_c ()

Deprecated user-defined literal operator to convert to char. More...

template <char... Cs>
constexpr autooperator""_d ()

Deprecated user-defined literal operator to convert to double. More...

template <char... Cs>
constexpr autooperator""_f ()

Deprecated user-defined literal operator to convert to float. More...

template <char... Cs>
constexpr autooperator""_i ()

Deprecated user-defined literal operator to convert to int. More...

template <char... Cs>
constexpr autooperator""_i16 ()

Deprecated user-defined literal operator to convert to int16_t. More...

template <char... Cs>
constexpr autooperator""_i32 ()

Deprecated user-defined literal operator to convert to int32_t. More...

template <char... Cs>
constexpr autooperator""_i64 ()

Deprecated user-defined literal operator to convert to int64_t. More...

template <char... Cs>
constexpr autooperator""_i8 ()

Deprecated user-defined literal operator to convert to int8_t. More...

template <char... Cs>
constexpr autooperator""_l ()

Deprecated user-defined literal operator to convert to long. More...

template <char... Cs>
constexpr autooperator""_ld ()

Deprecated user-defined literal operator to convert to long double. More...

template <char... Cs>
constexpr autooperator""_ll ()

Deprecated user-defined literal operator to convert to long long. More...

template <char... Cs>
constexpr autooperator""_s ()

Deprecated user-defined literal operator to convert to short. More...

template <char... Cs>
constexpr autooperator""_sc ()

Deprecated user-defined literal operator to convert to signed char. More...

template <char... Cs>
constexpr autooperator""_u ()

Deprecated user-defined literal operator to convert to unsigned. More...

template <char... Cs>
constexpr autooperator""_u16 ()

Deprecated user-defined literal operator to convert to uint16_t. More...

template <char... Cs>
constexpr autooperator""_u32 ()

Deprecated user-defined literal operator to convert to uint32_t. More...

template <char... Cs>
constexpr autooperator""_u64 ()

Deprecated user-defined literal operator to convert to uint64_t. More...

template <char... Cs>
constexpr autooperator""_u8 ()

Deprecated user-defined literal operator to convert to uint8_t. More...

template <char... Cs>
constexpr autooperator""_uc ()

Deprecated user-defined literal operator to convert to unsigned char. More...

template <char... Cs>
constexpr autooperator""_ul ()

Deprecated user-defined literal operator to convert to unsigned long. More...

template <char... Cs>
constexpr autooperator""_ull ()

Deprecated user-defined literal operator to convert to unsigned long long. More...

template <char... Cs>
constexpr autooperator""_us ()

Deprecated user-defined literal operator to convert to unsigned short. More...

Value Wrappers Index​

usingto_b = detail::value< bool >

Deprecated strongly-typed wrapper for bool values. More...

usingto_c = detail::value< char >

Deprecated strongly-typed wrapper for char values. More...

usingto_sc = detail::value< signed char >

Deprecated strongly-typed wrapper for signed char values. More...

usingto_s = detail::value< short >

Deprecated strongly-typed wrapper for short values. More...

usingto_i = detail::value< int >

Deprecated strongly-typed wrapper for int values. More...

usingto_l = detail::value< long >

Deprecated strongly-typed wrapper for long values. More...

usingto_ll = detail::value< long long >

Deprecated strongly-typed wrapper for long long values. More...

usingto_u = detail::value< unsigned >

Deprecated strongly-typed wrapper for unsigned values. More...

usingto_uc = detail::value< unsigned char >

Deprecated strongly-typed wrapper for unsigned char values. More...

usingto_us = detail::value< unsigned short >

Deprecated strongly-typed wrapper for unsigned short values. More...

usingto_ul = detail::value< unsigned long >

Deprecated strongly-typed wrapper for unsigned long values. More...

usingto_ull = detail::value< unsigned long long >

Deprecated strongly-typed wrapper for unsigned long long values. More...

usingto_i8 = detail::value< std::int8_t >

Deprecated strongly-typed wrapper for std::int8_t values. More...

usingto_i16 = detail::value< std::int16_t >

Deprecated strongly-typed wrapper for std::int16_t values. More...

usingto_i32 = detail::value< std::int32_t >

Deprecated strongly-typed wrapper for std::int32_t values. More...

usingto_i64 = detail::value< std::int64_t >

Deprecated strongly-typed wrapper for std::int64_t values. More...

usingto_u8 = detail::value< std::uint8_t >

Deprecated strongly-typed wrapper for std::uint8_t values. More...

usingto_u16 = detail::value< std::uint16_t >

Deprecated strongly-typed wrapper for std::uint16_t values. More...

usingto_u32 = detail::value< std::uint32_t >

Deprecated strongly-typed wrapper for std::uint32_t values. More...

usingto_u64 = detail::value< std::uint64_t >

Deprecated strongly-typed wrapper for std::uint64_t values. More...

usingto_f = detail::value< float >

Deprecated strongly-typed wrapper for float values. More...

usingto_d = detail::value< double >

Deprecated strongly-typed wrapper for double values. More...

usingto_ld = detail::value< long double >

Deprecated strongly-typed wrapper for long double values. More...

Deprecated Value Wrappers Index​

using_b = to_b

Deprecated strongly-typed wrapper for bool values, the v5.0.1 name of to_b. More...

using_c = to_c

Deprecated strongly-typed wrapper for char values, the v5.0.1 name of to_c. More...

using_sc = to_sc

Deprecated strongly-typed wrapper for signed char values, the v5.0.1 name of to_sc. More...

using_s = to_s

Deprecated strongly-typed wrapper for short values, the v5.0.1 name of to_s. More...

using_i = to_i

Deprecated strongly-typed wrapper for int values, the v5.0.1 name of to_i. More...

using_l = to_l

Deprecated strongly-typed wrapper for long values, the v5.0.1 name of to_l. More...

using_ll = to_ll

Deprecated strongly-typed wrapper for long long values, the v5.0.1 name of to_ll. More...

using_u = to_u

Deprecated strongly-typed wrapper for unsigned values, the v5.0.1 name of to_u. More...

using_uc = to_uc

Deprecated strongly-typed wrapper for unsigned char values, the v5.0.1 name of to_uc. More...

using_us = to_us

Deprecated strongly-typed wrapper for unsigned short values, the v5.0.1 name of to_us. More...

using_ul = to_ul

Deprecated strongly-typed wrapper for unsigned long values, the v5.0.1 name of to_ul. More...

using_ull = to_ull

Deprecated strongly-typed wrapper for unsigned long long values, the v5.0.1 name of to_ull. More...

using_i8 = to_i8

Deprecated strongly-typed wrapper for std::int8_t values, the v5.0.1 name of to_i8. More...

using_i16 = to_i16

Deprecated strongly-typed wrapper for std::int16_t values, the v5.0.1 name of to_i16. More...

using_i32 = to_i32

Deprecated strongly-typed wrapper for std::int32_t values, the v5.0.1 name of to_i32. More...

using_i64 = to_i64

Deprecated strongly-typed wrapper for std::int64_t values, the v5.0.1 name of to_i64. More...

using_u8 = to_u8

Deprecated strongly-typed wrapper for std::uint8_t values, the v5.0.1 name of to_u8. More...

using_u16 = to_u16

Deprecated strongly-typed wrapper for std::uint16_t values, the v5.0.1 name of to_u16. More...

using_u32 = to_u32

Deprecated strongly-typed wrapper for std::uint32_t values, the v5.0.1 name of to_u32. More...

using_u64 = to_u64

Deprecated strongly-typed wrapper for std::uint64_t values, the v5.0.1 name of to_u64. More...

using_f = to_f

Deprecated strongly-typed wrapper for float values, the v5.0.1 name of to_f. More...

using_d = to_d

Deprecated strongly-typed wrapper for double values, the v5.0.1 name of to_d. More...

using_ld = to_ld

Deprecated strongly-typed wrapper for long double values, the v5.0.1 name of to_ld. More...

template <class T>
using_t = to_t< T >

Deprecated generic strongly-typed wrapper, the v5.0.1 name of to_t. More...

Deprecated Functions Index​

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 literal operators and wrappers for typed operands.

The deprecated overloaded operators compare only the framework expression types. The literals of the mt::literals namespace, such as 1_i and 42.0_f, create such operands from constants, and the wrappers, such as mt::to_i{ value }, from the values computed at run time.

Deprecated

The literals, the to_* wrappers, to_t<T>, and the two-argument mt::approx (value, epsilon) are deprecated since 6.0.0. Use instead:

  • the function comparators mt::eq(), mt::ne(), mt::lt(), mt::le(), mt::gt(), and mt::ge(), which compare and report the plain values;
  • the function comparator mt::approx (lhs, rhs, epsilon), which sets the tolerance explicitly.
Replacement
 
 ts.test ("Check operands", [] (auto& t) {
  t.expect (mt::eq (compute_answer (), 42));
  t.expect (mt::approx (compute_float (), 42.0, 0.01));
 });
The v5.0.1 aliases

The wrappers had names with a leading underscore in v5.0.1: _i, _u8, _f, _d, _t, and the like, as in mt::_i{ value }. They are aliases of the to_* wrappers (to_i, to_u8, to_f, to_d, and to_t), and are deprecated since 6.0.0 in the same way, so the replacement is also the same: pass the plain value to the function comparators, or use mt::approx (lhs, rhs, epsilon) for the tolerances.

Integer literals

They follow the C++ syntax: decimal, hexadecimal (0x10_i), binary (0b101_i), and octal (010_i, which is 8), with digit separators (1'000_i). A decimal point, an exponent, or a value that does not fit in the type of the literal (for example 300_u8) is a compilation error.

Floating-point literals

They are written with decimal digits and a decimal point, which is required (42.0_f, not 42_f), optionally with digit separators (1'000.000'5_d), and without an exponent. The digits before the decimal point, and the decimals, are each limited to 19 digits, the capacity of the unsigned long long that holds them at compile time, whatever the type of the literal (also for _f), otherwise the compilation fails.

The floating-point literals (1.5_d) and wrappers (mt::to_d{ 1.5 }) compare with a tolerance of one unit of the last decimal written (0.1 for 1.5), so that 1.45 == 1.5_d is true. All six comparisons apply it: values within the tolerance are equal, and neither less nor greater. Plain floating-point values compare exactly. Since the tolerance depends on the digits written and on which operand is wrapped, set it explicitly with mt::approx (lhs, rhs, epsilon) instead.

Boolean literals

The literal "name"_b creates a constant with the value true, whatever the name ("false"_b is also true), reported by its name. Use a plain bool and a check message instead.

Operators​

operator""_b()​

auto micro_os_plus::micro_test_plus::literals::operator""_b (const char * name, decltype(sizeof("")) size)
nodiscard constexpr

Deprecated user-defined literal operator to create a named boolean constant.

Parameters
name

Pointer to the character sequence representing the literal.

size

The size of the character sequence.

Returns

A detail::named_bool instance, with the value true, reported by its name.

Deprecated

use a plain bool and a check message (since 6.0.0)

This user-defined literal operator creates a named boolean constant, with the value true, from a string literal (for example, "feature_enabled"_b).

The returned detail::named_bool converts implicitly to bool, and the expression formatter prints its name instead of its value. With the operators in the operators namespace, a comparison like "feature_enabled"_b == flag is true when flag is true, and, when it fails, it is reported as feature_enabled == false; the same applies to eq ("feature_enabled"_b, flag). Without these operators, the comparison is a plain bool expression, and its operands are not reported.

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

1238 operator""_b (const char* name, decltype (sizeof ("")) size)
1239 {
1240 return detail::named_bool{ std::string_view{ name, size } };
1241 }

operator""_c()​

template <char... Cs>
auto micro_os_plus::micro_test_plus::literals::operator""_c ()
nodiscard constexpr

Deprecated user-defined literal operator to convert to char.

Template Parameters
Cs

The character pack representing the digits of the character constant.

Returns

A detail::integral_constant instance holding the parsed char value.

Deprecated

pass plain values to eq() and the other comparators (since 6.0.0)

Creates a compile-time char constant, for example 65_c, with detail::integral_literal(). The literal is parsed, and its value checked against the range of the type, at compile time; a negative constant is written with the unary minus.

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

939 operator""_c ()
940 {
941 return detail::integral_literal<char, Cs...> ();
942 }

Reference micro_os_plus::micro_test_plus::detail::integral_literal.

operator""_d()​

template <char... Cs>
auto micro_os_plus::micro_test_plus::literals::operator""_d ()
nodiscard constexpr

Deprecated user-defined literal operator to convert to double.

Template Parameters
Cs

The character pack representing the digits of the floating-point constant.

Returns

A detail::floating_point_constant instance holding the parsed double value.

Deprecated

use approx() for tolerances (since 6.0.0)

Creates a compile-time double constant, for example 2.718_d, from the integral part, the decimals, and the number of decimals of the literal, parsed at compile time by detail::math::num(), den(), and den_size(); the comparison tolerance is one unit of the last decimal written.

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

1196 operator""_d ()
1197 {
1199 double, detail::math::num<unsigned long long, Cs...> (),
1201 detail::math::den_size<unsigned long long, Cs...> ()>{};
1202 }

References micro_os_plus::micro_test_plus::detail::math::den, micro_os_plus::micro_test_plus::detail::math::den_size and micro_os_plus::micro_test_plus::detail::math::num.

operator""_f()​

template <char... Cs>
auto micro_os_plus::micro_test_plus::literals::operator""_f ()
nodiscard constexpr

Deprecated user-defined literal operator to convert to float.

Template Parameters
Cs

The character pack representing the digits of the floating-point constant.

Returns

A detail::floating_point_constant instance holding the parsed float value.

Deprecated

use approx() for tolerances (since 6.0.0)

Creates a compile-time float constant, for example 3.14_f, from the integral part, the decimals, and the number of decimals of the literal, parsed at compile time by detail::math::num(), den(), and den_size(); the comparison tolerance is one unit of the last decimal written.

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

1178 operator""_f ()
1179 {
1181 float, detail::math::num<unsigned long long, Cs...> (),
1183 detail::math::den_size<unsigned long long, Cs...> ()>{};
1184 }

References micro_os_plus::micro_test_plus::detail::math::den, micro_os_plus::micro_test_plus::detail::math::den_size and micro_os_plus::micro_test_plus::detail::math::num.

operator""_i()​

template <char... Cs>
auto micro_os_plus::micro_test_plus::literals::operator""_i ()
nodiscard constexpr

Deprecated user-defined literal operator to convert to int.

Template Parameters
Cs

The character pack representing the digits of the integer constant.

Returns

A detail::integral_constant instance holding the parsed int value.

Deprecated

pass plain values to eq() and the other comparators (since 6.0.0)

Creates a compile-time int constant, for example 42_i, with detail::integral_literal(). The literal is parsed, and its value checked against the range of the type, at compile time; a negative constant is written with the unary minus.

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

911 operator""_i ()
912 {
913 return detail::integral_literal<int, Cs...> ();
914 }

Reference micro_os_plus::micro_test_plus::detail::integral_literal.

operator""_i16()​

template <char... Cs>
auto micro_os_plus::micro_test_plus::literals::operator""_i16 ()
nodiscard constexpr

Deprecated user-defined literal operator to convert to int16_t.

Template Parameters
Cs

The character pack representing the digits of the int16_t constant.

Returns

A detail::integral_constant instance holding the parsed int16_t value.

Deprecated

pass plain values to eq() and the other comparators (since 6.0.0)

Creates a compile-time int16_t constant, for example 32767_i16, with detail::integral_literal(). The literal is parsed, and its value checked against the range of the type, at compile time; a negative constant is written with the unary minus.

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

1079 operator""_i16 ()
1080 {
1081 return detail::integral_literal<std::int16_t, Cs...> ();
1082 }

Reference micro_os_plus::micro_test_plus::detail::integral_literal.

operator""_i32()​

template <char... Cs>
auto micro_os_plus::micro_test_plus::literals::operator""_i32 ()
nodiscard constexpr

Deprecated user-defined literal operator to convert to int32_t.

Template Parameters
Cs

The character pack representing the digits of the int32_t constant.

Returns

A detail::integral_constant instance holding the parsed int32_t value.

Deprecated

pass plain values to eq() and the other comparators (since 6.0.0)

Creates a compile-time int32_t constant, for example 2147483647_i32, with detail::integral_literal(). The literal is parsed, and its value checked against the range of the type, at compile time; a negative constant is written with the unary minus.

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

1093 operator""_i32 ()
1094 {
1095 return detail::integral_literal<std::int32_t, Cs...> ();
1096 }

Reference micro_os_plus::micro_test_plus::detail::integral_literal.

operator""_i64()​

template <char... Cs>
auto micro_os_plus::micro_test_plus::literals::operator""_i64 ()
nodiscard constexpr

Deprecated user-defined literal operator to convert to int64_t.

Template Parameters
Cs

The character pack representing the digits of the int64_t constant.

Returns

A detail::integral_constant instance holding the parsed int64_t value.

Deprecated

pass plain values to eq() and the other comparators (since 6.0.0)

Creates a compile-time int64_t constant, for example 9223372036854775807_i64, with detail::integral_literal(). The literal is parsed, and its value checked against the range of the type, at compile time; a negative constant is written with the unary minus.

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

1107 operator""_i64 ()
1108 {
1109 return detail::integral_literal<std::int64_t, Cs...> ();
1110 }

Reference micro_os_plus::micro_test_plus::detail::integral_literal.

operator""_i8()​

template <char... Cs>
auto micro_os_plus::micro_test_plus::literals::operator""_i8 ()
nodiscard constexpr

Deprecated user-defined literal operator to convert to int8_t.

Template Parameters
Cs

The character pack representing the digits of the int8_t constant.

Returns

A detail::integral_constant instance holding the parsed int8_t value.

Deprecated

pass plain values to eq() and the other comparators (since 6.0.0)

Creates a compile-time int8_t constant, for example 127_i8, with detail::integral_literal(). The literal is parsed, and its value checked against the range of the type, at compile time; a negative constant is written with the unary minus.

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

1065 operator""_i8 ()
1066 {
1067 return detail::integral_literal<std::int8_t, Cs...> ();
1068 }

Reference micro_os_plus::micro_test_plus::detail::integral_literal.

operator""_l()​

template <char... Cs>
auto micro_os_plus::micro_test_plus::literals::operator""_l ()
nodiscard constexpr

Deprecated user-defined literal operator to convert to long.

Template Parameters
Cs

The character pack representing the digits of the long integer constant.

Returns

A detail::integral_constant instance holding the parsed long value.

Deprecated

pass plain values to eq() and the other comparators (since 6.0.0)

Creates a compile-time long constant, for example 123_l, with detail::integral_literal(). The literal is parsed, and its value checked against the range of the type, at compile time; a negative constant is written with the unary minus.

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

967 operator""_l ()
968 {
969 return detail::integral_literal<long, Cs...> ();
970 }

Reference micro_os_plus::micro_test_plus::detail::integral_literal.

operator""_ld()​

template <char... Cs>
auto micro_os_plus::micro_test_plus::literals::operator""_ld ()
nodiscard constexpr

Deprecated user-defined literal operator to convert to long double.

Template Parameters
Cs

The character pack representing the digits of the floating-point constant.

Returns

A detail::floating_point_constant instance holding the parsed long double value.

Deprecated

use approx() for tolerances (since 6.0.0)

Creates a compile-time long double constant, for example 1.618_ld, from the integral part, the decimals, and the number of decimals of the literal, parsed at compile time by detail::math::num(), den(), and den_size(); the comparison tolerance is one unit of the last decimal written.

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

1214 operator""_ld ()
1215 {
1217 long double, detail::math::num<unsigned long long, Cs...> (),
1219 detail::math::den_size<unsigned long long, Cs...> ()>{};
1220 }

References micro_os_plus::micro_test_plus::detail::math::den, micro_os_plus::micro_test_plus::detail::math::den_size and micro_os_plus::micro_test_plus::detail::math::num.

operator""_ll()​

template <char... Cs>
auto micro_os_plus::micro_test_plus::literals::operator""_ll ()
nodiscard constexpr

Deprecated user-defined literal operator to convert to long long.

Template Parameters
Cs

The character pack representing the digits of the long long integer constant.

Returns

A detail::integral_constant instance holding the parsed long long value.

Deprecated

pass plain values to eq() and the other comparators (since 6.0.0)

Creates a compile-time long long constant, for example 123_ll, with detail::integral_literal(). The literal is parsed, and its value checked against the range of the type, at compile time; a negative constant is written with the unary minus.

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

981 operator""_ll ()
982 {
983 return detail::integral_literal<long long, Cs...> ();
984 }

Reference micro_os_plus::micro_test_plus::detail::integral_literal.

operator""_s()​

template <char... Cs>
auto micro_os_plus::micro_test_plus::literals::operator""_s ()
nodiscard constexpr

Deprecated user-defined literal operator to convert to short.

Template Parameters
Cs

The character pack representing the digits of the integer constant.

Returns

A detail::integral_constant instance holding the parsed short value.

Deprecated

pass plain values to eq() and the other comparators (since 6.0.0)

Creates a compile-time short constant, for example 123_s, with detail::integral_literal(). The literal is parsed, and its value checked against the range of the type, at compile time; a negative constant is written with the unary minus.

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

925 operator""_s ()
926 {
927 return detail::integral_literal<short, Cs...> ();
928 }

Reference micro_os_plus::micro_test_plus::detail::integral_literal.

operator""_sc()​

template <char... Cs>
auto micro_os_plus::micro_test_plus::literals::operator""_sc ()
nodiscard constexpr

Deprecated user-defined literal operator to convert to signed char.

Template Parameters
Cs

The character pack representing the digits of the signed character constant.

Returns

A detail::integral_constant instance holding the parsed signed char value.

Deprecated

pass plain values to eq() and the other comparators (since 6.0.0)

Creates a compile-time signed char constant, for example 65_sc, with detail::integral_literal(). The literal is parsed, and its value checked against the range of the type, at compile time; a negative constant is written with the unary minus.

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

953 operator""_sc ()
954 {
955 return detail::integral_literal<signed char, Cs...> ();
956 }

Reference micro_os_plus::micro_test_plus::detail::integral_literal.

operator""_u()​

template <char... Cs>
auto micro_os_plus::micro_test_plus::literals::operator""_u ()
nodiscard constexpr

Deprecated user-defined literal operator to convert to unsigned.

Template Parameters
Cs

The character pack representing the digits of the unsigned integer constant.

Returns

A detail::integral_constant instance holding the parsed unsigned value.

Deprecated

pass plain values to eq() and the other comparators (since 6.0.0)

Creates a compile-time unsigned constant, for example 123_u, with detail::integral_literal(). The literal is parsed, and its value checked against the range of the type, at compile time; a negative constant is written with the unary minus.

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

995 operator""_u ()
996 {
997 return detail::integral_literal<unsigned, Cs...> ();
998 }

Reference micro_os_plus::micro_test_plus::detail::integral_literal.

operator""_u16()​

template <char... Cs>
auto micro_os_plus::micro_test_plus::literals::operator""_u16 ()
nodiscard constexpr

Deprecated user-defined literal operator to convert to uint16_t.

Template Parameters
Cs

The character pack representing the digits of the uint16_t constant.

Returns

A detail::integral_constant instance holding the parsed uint16_t value.

Deprecated

pass plain values to eq() and the other comparators (since 6.0.0)

Creates a compile-time uint16_t constant, for example 65535_u16, with detail::integral_literal(). The literal is parsed, and its value checked against the range of the type, at compile time; a negative constant is written with the unary minus.

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

1135 operator""_u16 ()
1136 {
1137 return detail::integral_literal<std::uint16_t, Cs...> ();
1138 }

Reference micro_os_plus::micro_test_plus::detail::integral_literal.

operator""_u32()​

template <char... Cs>
auto micro_os_plus::micro_test_plus::literals::operator""_u32 ()
nodiscard constexpr

Deprecated user-defined literal operator to convert to uint32_t.

Template Parameters
Cs

The character pack representing the digits of the uint32_t constant.

Returns

A detail::integral_constant instance holding the parsed uint32_t value.

Deprecated

pass plain values to eq() and the other comparators (since 6.0.0)

Creates a compile-time uint32_t constant, for example 4294967295_u32, with detail::integral_literal(). The literal is parsed, and its value checked against the range of the type, at compile time; a negative constant is written with the unary minus.

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

1149 operator""_u32 ()
1150 {
1151 return detail::integral_literal<std::uint32_t, Cs...> ();
1152 }

Reference micro_os_plus::micro_test_plus::detail::integral_literal.

operator""_u64()​

template <char... Cs>
auto micro_os_plus::micro_test_plus::literals::operator""_u64 ()
nodiscard constexpr

Deprecated user-defined literal operator to convert to uint64_t.

Template Parameters
Cs

The character pack representing the digits of the uint64_t constant.

Returns

A detail::integral_constant instance holding the parsed uint64_t value.

Deprecated

pass plain values to eq() and the other comparators (since 6.0.0)

Creates a compile-time uint64_t constant, for example 18446744073709551615_u64, with detail::integral_literal(). The literal is parsed, and its value checked against the range of the type, at compile time; a negative constant is written with the unary minus.

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

1163 operator""_u64 ()
1164 {
1165 return detail::integral_literal<std::uint64_t, Cs...> ();
1166 }

Reference micro_os_plus::micro_test_plus::detail::integral_literal.

operator""_u8()​

template <char... Cs>
auto micro_os_plus::micro_test_plus::literals::operator""_u8 ()
nodiscard constexpr

Deprecated user-defined literal operator to convert to uint8_t.

Template Parameters
Cs

The character pack representing the digits of the uint8_t constant.

Returns

A detail::integral_constant instance holding the parsed uint8_t value.

Deprecated

pass plain values to eq() and the other comparators (since 6.0.0)

Creates a compile-time uint8_t constant, for example 255_u8, with detail::integral_literal(). The literal is parsed, and its value checked against the range of the type, at compile time; a negative constant is written with the unary minus.

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

1121 operator""_u8 ()
1122 {
1123 return detail::integral_literal<std::uint8_t, Cs...> ();
1124 }

Reference micro_os_plus::micro_test_plus::detail::integral_literal.

operator""_uc()​

template <char... Cs>
auto micro_os_plus::micro_test_plus::literals::operator""_uc ()
nodiscard constexpr

Deprecated user-defined literal operator to convert to unsigned char.

Template Parameters
Cs

The character pack representing the digits of the unsigned character constant.

Returns

A detail::integral_constant instance holding the parsed unsigned char value.

Deprecated

pass plain values to eq() and the other comparators (since 6.0.0)

Creates a compile-time unsigned char constant, for example 65_uc, with detail::integral_literal(). The literal is parsed, and its value checked against the range of the type, at compile time; a negative constant is written with the unary minus.

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

1009 operator""_uc ()
1010 {
1011 return detail::integral_literal<unsigned char, Cs...> ();
1012 }

Reference micro_os_plus::micro_test_plus::detail::integral_literal.

operator""_ul()​

template <char... Cs>
auto micro_os_plus::micro_test_plus::literals::operator""_ul ()
nodiscard constexpr

Deprecated user-defined literal operator to convert to unsigned long.

Template Parameters
Cs

The character pack representing the digits of the unsigned long integer constant.

Returns

A detail::integral_constant instance holding the parsed unsigned long value.

Deprecated

pass plain values to eq() and the other comparators (since 6.0.0)

Creates a compile-time unsigned long constant, for example 123_ul, with detail::integral_literal(). The literal is parsed, and its value checked against the range of the type, at compile time; a negative constant is written with the unary minus.

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

1037 operator""_ul ()
1038 {
1039 return detail::integral_literal<unsigned long, Cs...> ();
1040 }

Reference micro_os_plus::micro_test_plus::detail::integral_literal.

operator""_ull()​

template <char... Cs>
auto micro_os_plus::micro_test_plus::literals::operator""_ull ()
nodiscard constexpr

Deprecated user-defined literal operator to convert to unsigned long long.

Template Parameters
Cs

The character pack representing the digits of the unsigned long long integer constant.

Returns

A detail::integral_constant instance holding the parsed unsigned long long value.

Deprecated

pass plain values to eq() and the other comparators (since 6.0.0)

Creates a compile-time unsigned long long constant, for example 123_ull, with detail::integral_literal(). The literal is parsed, and its value checked against the range of the type, at compile time; a negative constant is written with the unary minus.

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

1051 operator""_ull ()
1052 {
1053 return detail::integral_literal<unsigned long long, Cs...> ();
1054 }

Reference micro_os_plus::micro_test_plus::detail::integral_literal.

operator""_us()​

template <char... Cs>
auto micro_os_plus::micro_test_plus::literals::operator""_us ()
nodiscard constexpr

Deprecated user-defined literal operator to convert to unsigned short.

Template Parameters
Cs

The character pack representing the digits of the unsigned short constant.

Returns

A detail::integral_constant instance holding the parsed unsigned short value.

Deprecated

pass plain values to eq() and the other comparators (since 6.0.0)

Creates a compile-time unsigned short constant, for example 123_us, with detail::integral_literal(). The literal is parsed, and its value checked against the range of the type, at compile time; a negative constant is written with the unary minus.

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

1023 operator""_us ()
1024 {
1025 return detail::integral_literal<unsigned short, Cs...> ();
1026 }

Reference micro_os_plus::micro_test_plus::detail::integral_literal.

Value Wrappers​

Strongly-typed wrappers for converting dynamic values and expressions to specific types recognised by µTest++ comparators.

These type aliases provide a type-safe mechanism for explicitly converting values to the required types for µTest++ test expressions and comparators. Each alias is a wrapper around detail::value<T>, ensuring that the value is treated as the specified type within the framework.

The to_* forms replaced the older _i, _u8, etc. aliases, which were deprecated in version 3.2.0.

Deprecated

Pass the plain values to the function comparators eq(), ne(), gt(), ge(), lt(), and le() instead; they report the operands in the same way. For the floating-point values compared with a tolerance, use approx() (since 6.0.0).

Example
 
 int x = 42;
 // Explicitly treat x as an int for test comparison.
 auto wrapped = mt::to_i{x};
Since

3.2.0

to_b​

using micro_os_plus::micro_test_plus::to_b = detail::value<bool>

Deprecated strongly-typed wrapper for bool values.

Wraps a run-time value, so that the comparators and the reporter treat it as bool.

Since

3.2.0

Deprecated

pass plain values to eq() and the other comparators (since 6.0.0)

Definition at line 1563 of file deprecated.h.

to_c​

using micro_os_plus::micro_test_plus::to_c = detail::value<char>

Deprecated strongly-typed wrapper for char values.

Wraps a run-time value, so that the comparators and the reporter treat it as char.

Since

3.2.0

Deprecated

pass plain values to eq() and the other comparators (since 6.0.0)

Definition at line 1575 of file deprecated.h.

to_d​

using micro_os_plus::micro_test_plus::to_d = detail::value<double>

Deprecated strongly-typed wrapper for double values.

Wraps a run-time value, so that the comparators and the reporter treat it as double.

Since

3.2.0

Deprecated

use approx() for tolerances (since 6.0.0)

Definition at line 1814 of file deprecated.h.

to_f​

using micro_os_plus::micro_test_plus::to_f = detail::value<float>

Deprecated strongly-typed wrapper for float values.

Wraps a run-time value, so that the comparators and the reporter treat it as float.

Since

3.2.0

Deprecated

use approx() for tolerances (since 6.0.0)

Definition at line 1803 of file deprecated.h.

to_i​

using micro_os_plus::micro_test_plus::to_i = detail::value<int>

Deprecated strongly-typed wrapper for int values.

Wraps a run-time value, so that the comparators and the reporter treat it as int.

Since

3.2.0

Deprecated

pass plain values to eq() and the other comparators (since 6.0.0)

Definition at line 1611 of file deprecated.h.

to_i16​

using micro_os_plus::micro_test_plus::to_i16 = detail::value<std::int16_t>

Deprecated strongly-typed wrapper for std::int16_t values.

Wraps a run-time value, so that the comparators and the reporter treat it as std::int16_t.

Since

3.2.0

Deprecated

pass plain values to eq() and the other comparators (since 6.0.0)

Definition at line 1719 of file deprecated.h.

to_i32​

using micro_os_plus::micro_test_plus::to_i32 = detail::value<std::int32_t>

Deprecated strongly-typed wrapper for std::int32_t values.

Wraps a run-time value, so that the comparators and the reporter treat it as std::int32_t.

Since

3.2.0

Deprecated

pass plain values to eq() and the other comparators (since 6.0.0)

Definition at line 1731 of file deprecated.h.

to_i64​

using micro_os_plus::micro_test_plus::to_i64 = detail::value<std::int64_t>

Deprecated strongly-typed wrapper for std::int64_t values.

Wraps a run-time value, so that the comparators and the reporter treat it as std::int64_t.

Since

3.2.0

Deprecated

pass plain values to eq() and the other comparators (since 6.0.0)

Definition at line 1743 of file deprecated.h.

to_i8​

using micro_os_plus::micro_test_plus::to_i8 = detail::value<std::int8_t>

Deprecated strongly-typed wrapper for std::int8_t values.

Wraps a run-time value, so that the comparators and the reporter treat it as std::int8_t.

Since

3.2.0

Deprecated

pass plain values to eq() and the other comparators (since 6.0.0)

Definition at line 1707 of file deprecated.h.

to_l​

using micro_os_plus::micro_test_plus::to_l = detail::value<long>

Deprecated strongly-typed wrapper for long values.

Wraps a run-time value, so that the comparators and the reporter treat it as long.

Since

3.2.0

Deprecated

pass plain values to eq() and the other comparators (since 6.0.0)

Definition at line 1623 of file deprecated.h.

to_ld​

using micro_os_plus::micro_test_plus::to_ld = detail::value<long double>

Deprecated strongly-typed wrapper for long double values.

Wraps a run-time value, so that the comparators and the reporter treat it as long double.

Since

3.2.0

Deprecated

use approx() for tolerances (since 6.0.0)

Definition at line 1825 of file deprecated.h.

to_ll​

using micro_os_plus::micro_test_plus::to_ll = detail::value<long long>

Deprecated strongly-typed wrapper for long long values.

Wraps a run-time value, so that the comparators and the reporter treat it as long long.

Since

3.2.0

Deprecated

pass plain values to eq() and the other comparators (since 6.0.0)

Definition at line 1635 of file deprecated.h.

to_s​

using micro_os_plus::micro_test_plus::to_s = detail::value<short>

Deprecated strongly-typed wrapper for short values.

Wraps a run-time value, so that the comparators and the reporter treat it as short.

Since

3.2.0

Deprecated

pass plain values to eq() and the other comparators (since 6.0.0)

Definition at line 1599 of file deprecated.h.

to_sc​

using micro_os_plus::micro_test_plus::to_sc = detail::value<signed char>

Deprecated strongly-typed wrapper for signed char values.

Wraps a run-time value, so that the comparators and the reporter treat it as signed char.

Since

3.2.0

Deprecated

pass plain values to eq() and the other comparators (since 6.0.0)

Definition at line 1587 of file deprecated.h.

to_u​

using micro_os_plus::micro_test_plus::to_u = detail::value<unsigned>

Deprecated strongly-typed wrapper for unsigned values.

Wraps a run-time value, so that the comparators and the reporter treat it as unsigned.

Since

3.2.0

Deprecated

pass plain values to eq() and the other comparators (since 6.0.0)

Definition at line 1647 of file deprecated.h.

to_u16​

using micro_os_plus::micro_test_plus::to_u16 = detail::value<std::uint16_t>

Deprecated strongly-typed wrapper for std::uint16_t values.

Wraps a run-time value, so that the comparators and the reporter treat it as std::uint16_t.

Since

3.2.0

Deprecated

pass plain values to eq() and the other comparators (since 6.0.0)

Definition at line 1767 of file deprecated.h.

to_u32​

using micro_os_plus::micro_test_plus::to_u32 = detail::value<std::uint32_t>

Deprecated strongly-typed wrapper for std::uint32_t values.

Wraps a run-time value, so that the comparators and the reporter treat it as std::uint32_t.

Since

3.2.0

Deprecated

pass plain values to eq() and the other comparators (since 6.0.0)

Definition at line 1779 of file deprecated.h.

to_u64​

using micro_os_plus::micro_test_plus::to_u64 = detail::value<std::uint64_t>

Deprecated strongly-typed wrapper for std::uint64_t values.

Wraps a run-time value, so that the comparators and the reporter treat it as std::uint64_t.

Since

3.2.0

Deprecated

pass plain values to eq() and the other comparators (since 6.0.0)

Definition at line 1791 of file deprecated.h.

to_u8​

using micro_os_plus::micro_test_plus::to_u8 = detail::value<std::uint8_t>

Deprecated strongly-typed wrapper for std::uint8_t values.

Wraps a run-time value, so that the comparators and the reporter treat it as std::uint8_t.

Since

3.2.0

Deprecated

pass plain values to eq() and the other comparators (since 6.0.0)

Definition at line 1755 of file deprecated.h.

to_uc​

using micro_os_plus::micro_test_plus::to_uc = detail::value<unsigned char>

Deprecated strongly-typed wrapper for unsigned char values.

Wraps a run-time value, so that the comparators and the reporter treat it as unsigned char.

Since

3.2.0

Deprecated

pass plain values to eq() and the other comparators (since 6.0.0)

Definition at line 1659 of file deprecated.h.

to_ul​

using micro_os_plus::micro_test_plus::to_ul = detail::value<unsigned long>

Deprecated strongly-typed wrapper for unsigned long values.

Wraps a run-time value, so that the comparators and the reporter treat it as unsigned long.

Since

3.2.0

Deprecated

pass plain values to eq() and the other comparators (since 6.0.0)

Definition at line 1683 of file deprecated.h.

to_ull​

using micro_os_plus::micro_test_plus::to_ull = detail::value<unsigned long long>

Deprecated strongly-typed wrapper for unsigned long long values.

Wraps a run-time value, so that the comparators and the reporter treat it as unsigned long long.

Since

3.2.0

Deprecated

pass plain values to eq() and the other comparators (since 6.0.0)

Definition at line 1695 of file deprecated.h.

to_us​

using micro_os_plus::micro_test_plus::to_us = detail::value<unsigned short>

Deprecated strongly-typed wrapper for unsigned short values.

Wraps a run-time value, so that the comparators and the reporter treat it as unsigned short.

Since

3.2.0

Deprecated

pass plain values to eq() and the other comparators (since 6.0.0)

Definition at line 1671 of file deprecated.h.

Deprecated Value Wrappers​

The v5.0.1 names of the to_* value wrappers.

The Boost UT style names, with a leading underscore, kept for compatibility with the existing applications. Each one is an alias of the corresponding to_* wrapper, so the wrapped values are compared and reported in the same way. They do not conflict with the literal operators with the same suffixes (42_i), which are in the literals namespace.

GCC reports the deprecation only when the alias names the type of a declaration, not when it is used in an expression, as in _i (expr); Clang reports it in both cases.

Deprecated

Pass the plain values to the function comparators eq(), ne(), gt(), ge(), lt(), and le() instead; the to_* value wrappers that replaced these aliases (since 3.2.0) are deprecated too (since 6.0.0).

_b​

using micro_os_plus::micro_test_plus::_b = to_b

Deprecated strongly-typed wrapper for bool values, the v5.0.1 name of to_b.

The same type as to_b; kept for backwards compatibility.

Deprecated

pass plain values to eq() and the other comparators (since 6.0.0)

Definition at line 1976 of file deprecated.h.

_c​

using micro_os_plus::micro_test_plus::_c = to_c

Deprecated strongly-typed wrapper for char values, the v5.0.1 name of to_c.

The same type as to_c; kept for backwards compatibility.

Deprecated

pass plain values to eq() and the other comparators (since 6.0.0)

Definition at line 1986 of file deprecated.h.

_d​

using micro_os_plus::micro_test_plus::_d = to_d

Deprecated strongly-typed wrapper for double values, the v5.0.1 name of to_d.

The same type as to_d; kept for backwards compatibility.

Deprecated

use approx() for tolerances (since 6.0.0)

Definition at line 2185 of file deprecated.h.

_f​

using micro_os_plus::micro_test_plus::_f = to_f

Deprecated strongly-typed wrapper for float values, the v5.0.1 name of to_f.

The same type as to_f; kept for backwards compatibility.

Deprecated

use approx() for tolerances (since 6.0.0)

Definition at line 2176 of file deprecated.h.

_i​

using micro_os_plus::micro_test_plus::_i = to_i

Deprecated strongly-typed wrapper for int values, the v5.0.1 name of to_i.

The same type as to_i; kept for backwards compatibility.

Deprecated

pass plain values to eq() and the other comparators (since 6.0.0)

Definition at line 2016 of file deprecated.h.

_i16​

using micro_os_plus::micro_test_plus::_i16 = to_i16

Deprecated strongly-typed wrapper for std::int16_t values, the v5.0.1 name of to_i16.

The same type as to_i16; kept for backwards compatibility.

Deprecated

pass plain values to eq() and the other comparators (since 6.0.0)

Definition at line 2106 of file deprecated.h.

_i32​

using micro_os_plus::micro_test_plus::_i32 = to_i32

Deprecated strongly-typed wrapper for std::int32_t values, the v5.0.1 name of to_i32.

The same type as to_i32; kept for backwards compatibility.

Deprecated

pass plain values to eq() and the other comparators (since 6.0.0)

Definition at line 2116 of file deprecated.h.

_i64​

using micro_os_plus::micro_test_plus::_i64 = to_i64

Deprecated strongly-typed wrapper for std::int64_t values, the v5.0.1 name of to_i64.

The same type as to_i64; kept for backwards compatibility.

Deprecated

pass plain values to eq() and the other comparators (since 6.0.0)

Definition at line 2126 of file deprecated.h.

_i8​

using micro_os_plus::micro_test_plus::_i8 = to_i8

Deprecated strongly-typed wrapper for std::int8_t values, the v5.0.1 name of to_i8.

The same type as to_i8; kept for backwards compatibility.

Deprecated

pass plain values to eq() and the other comparators (since 6.0.0)

Definition at line 2096 of file deprecated.h.

_l​

using micro_os_plus::micro_test_plus::_l = to_l

Deprecated strongly-typed wrapper for long values, the v5.0.1 name of to_l.

The same type as to_l; kept for backwards compatibility.

Deprecated

pass plain values to eq() and the other comparators (since 6.0.0)

Definition at line 2026 of file deprecated.h.

_ld​

using micro_os_plus::micro_test_plus::_ld = to_ld

Deprecated strongly-typed wrapper for long double values, the v5.0.1 name of to_ld.

The same type as to_ld; kept for backwards compatibility.

Deprecated

use approx() for tolerances (since 6.0.0)

Definition at line 2194 of file deprecated.h.

_ll​

using micro_os_plus::micro_test_plus::_ll = to_ll

Deprecated strongly-typed wrapper for long long values, the v5.0.1 name of to_ll.

The same type as to_ll; kept for backwards compatibility.

Deprecated

pass plain values to eq() and the other comparators (since 6.0.0)

Definition at line 2036 of file deprecated.h.

_s​

using micro_os_plus::micro_test_plus::_s = to_s

Deprecated strongly-typed wrapper for short values, the v5.0.1 name of to_s.

The same type as to_s; kept for backwards compatibility.

Deprecated

pass plain values to eq() and the other comparators (since 6.0.0)

Definition at line 2006 of file deprecated.h.

_sc​

using micro_os_plus::micro_test_plus::_sc = to_sc

Deprecated strongly-typed wrapper for signed char values, the v5.0.1 name of to_sc.

The same type as to_sc; kept for backwards compatibility.

Deprecated

pass plain values to eq() and the other comparators (since 6.0.0)

Definition at line 1996 of file deprecated.h.

_t​

template <class T>
using micro_os_plus::micro_test_plus::_t = to_t<T>

Deprecated generic strongly-typed wrapper, the v5.0.1 name of to_t.

The same type as to_t<T>, so it takes the same argument and is reported in the same way; kept for backwards compatibility. In v5.0.1 it was a separate class, also derived from detail::value<T>.

Template Parameters
T

The type of the wrapped value.

Deprecated

pass plain values to eq() and the other comparators (since 6.0.0)

Definition at line 2209 of file deprecated.h.

_u​

using micro_os_plus::micro_test_plus::_u = to_u

Deprecated strongly-typed wrapper for unsigned values, the v5.0.1 name of to_u.

The same type as to_u; kept for backwards compatibility.

Deprecated

pass plain values to eq() and the other comparators (since 6.0.0)

Definition at line 2046 of file deprecated.h.

_u16​

using micro_os_plus::micro_test_plus::_u16 = to_u16

Deprecated strongly-typed wrapper for std::uint16_t values, the v5.0.1 name of to_u16.

The same type as to_u16; kept for backwards compatibility.

Deprecated

pass plain values to eq() and the other comparators (since 6.0.0)

Definition at line 2146 of file deprecated.h.

_u32​

using micro_os_plus::micro_test_plus::_u32 = to_u32

Deprecated strongly-typed wrapper for std::uint32_t values, the v5.0.1 name of to_u32.

The same type as to_u32; kept for backwards compatibility.

Deprecated

pass plain values to eq() and the other comparators (since 6.0.0)

Definition at line 2156 of file deprecated.h.

_u64​

using micro_os_plus::micro_test_plus::_u64 = to_u64

Deprecated strongly-typed wrapper for std::uint64_t values, the v5.0.1 name of to_u64.

The same type as to_u64; kept for backwards compatibility.

Deprecated

pass plain values to eq() and the other comparators (since 6.0.0)

Definition at line 2166 of file deprecated.h.

_u8​

using micro_os_plus::micro_test_plus::_u8 = to_u8

Deprecated strongly-typed wrapper for std::uint8_t values, the v5.0.1 name of to_u8.

The same type as to_u8; kept for backwards compatibility.

Deprecated

pass plain values to eq() and the other comparators (since 6.0.0)

Definition at line 2136 of file deprecated.h.

_uc​

using micro_os_plus::micro_test_plus::_uc = to_uc

Deprecated strongly-typed wrapper for unsigned char values, the v5.0.1 name of to_uc.

The same type as to_uc; kept for backwards compatibility.

Deprecated

pass plain values to eq() and the other comparators (since 6.0.0)

Definition at line 2056 of file deprecated.h.

_ul​

using micro_os_plus::micro_test_plus::_ul = to_ul

Deprecated strongly-typed wrapper for unsigned long values, the v5.0.1 name of to_ul.

The same type as to_ul; kept for backwards compatibility.

Deprecated

pass plain values to eq() and the other comparators (since 6.0.0)

Definition at line 2076 of file deprecated.h.

_ull​

using micro_os_plus::micro_test_plus::_ull = to_ull

Deprecated strongly-typed wrapper for unsigned long long values, the v5.0.1 name of to_ull.

The same type as to_ull; kept for backwards compatibility.

Deprecated

pass plain values to eq() and the other comparators (since 6.0.0)

Definition at line 2086 of file deprecated.h.

_us​

using micro_os_plus::micro_test_plus::_us = to_us

Deprecated strongly-typed wrapper for unsigned short values, the v5.0.1 name of to_us.

The same type as to_us; kept for backwards compatibility.

Deprecated

pass plain values to eq() and the other comparators (since 6.0.0)

Definition at line 2066 of file deprecated.h.

Deprecated Functions​

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.


Generated via doxygen2docusaurus 2.2.8 by Doxygen 1.18.0.