Literals and wrappers
Deprecated literal operators and wrappers for typed operands. More...
Classes Index
| struct | to_t<T> |
|
Deprecated generic strongly-typed wrapper for explicit type conversion. More... | |
Operators Index
| constexpr auto | operator""_b (const char *name, decltype(sizeof("")) size) |
|
Deprecated user-defined literal operator to create a named boolean constant. More... | |
template <char... Cs> | |
| constexpr auto | operator""_c () |
|
Deprecated user-defined literal operator to convert to char. More... | |
template <char... Cs> | |
| constexpr auto | operator""_d () |
|
Deprecated user-defined literal operator to convert to double. More... | |
template <char... Cs> | |
| constexpr auto | operator""_f () |
|
Deprecated user-defined literal operator to convert to float. More... | |
template <char... Cs> | |
| constexpr auto | operator""_i () |
|
Deprecated user-defined literal operator to convert to int. More... | |
template <char... Cs> | |
| constexpr auto | operator""_i16 () |
|
Deprecated user-defined literal operator to convert to int16_t. More... | |
template <char... Cs> | |
| constexpr auto | operator""_i32 () |
|
Deprecated user-defined literal operator to convert to int32_t. More... | |
template <char... Cs> | |
| constexpr auto | operator""_i64 () |
|
Deprecated user-defined literal operator to convert to int64_t. More... | |
template <char... Cs> | |
| constexpr auto | operator""_i8 () |
|
Deprecated user-defined literal operator to convert to int8_t. More... | |
template <char... Cs> | |
| constexpr auto | operator""_l () |
|
Deprecated user-defined literal operator to convert to long. More... | |
template <char... Cs> | |
| constexpr auto | operator""_ld () |
|
Deprecated user-defined literal operator to convert to long double. More... | |
template <char... Cs> | |
| constexpr auto | operator""_ll () |
|
Deprecated user-defined literal operator to convert to long long. More... | |
template <char... Cs> | |
| constexpr auto | operator""_s () |
|
Deprecated user-defined literal operator to convert to short. More... | |
template <char... Cs> | |
| constexpr auto | operator""_sc () |
|
Deprecated user-defined literal operator to convert to signed char. More... | |
template <char... Cs> | |
| constexpr auto | operator""_u () |
|
Deprecated user-defined literal operator to convert to unsigned. More... | |
template <char... Cs> | |
| constexpr auto | operator""_u16 () |
|
Deprecated user-defined literal operator to convert to uint16_t. More... | |
template <char... Cs> | |
| constexpr auto | operator""_u32 () |
|
Deprecated user-defined literal operator to convert to uint32_t. More... | |
template <char... Cs> | |
| constexpr auto | operator""_u64 () |
|
Deprecated user-defined literal operator to convert to uint64_t. More... | |
template <char... Cs> | |
| constexpr auto | operator""_u8 () |
|
Deprecated user-defined literal operator to convert to uint8_t. More... | |
template <char... Cs> | |
| constexpr auto | operator""_uc () |
|
Deprecated user-defined literal operator to convert to unsigned char. More... | |
template <char... Cs> | |
| constexpr auto | operator""_ul () |
|
Deprecated user-defined literal operator to convert to unsigned long. More... | |
template <char... Cs> | |
| constexpr auto | operator""_ull () |
|
Deprecated user-defined literal operator to convert to unsigned long long. More... | |
template <char... Cs> | |
| constexpr auto | operator""_us () |
|
Deprecated user-defined literal operator to convert to unsigned short. More... | |
Value Wrappers Index
| using | to_b = detail::value< bool > |
|
Deprecated strongly-typed wrapper for bool values. More... | |
| using | to_c = detail::value< char > |
|
Deprecated strongly-typed wrapper for char values. More... | |
| using | to_sc = detail::value< signed char > |
|
Deprecated strongly-typed wrapper for signed char values. More... | |
| using | to_s = detail::value< short > |
|
Deprecated strongly-typed wrapper for short values. More... | |
| using | to_i = detail::value< int > |
|
Deprecated strongly-typed wrapper for int values. More... | |
| using | to_l = detail::value< long > |
|
Deprecated strongly-typed wrapper for long values. More... | |
| using | to_ll = detail::value< long long > |
|
Deprecated strongly-typed wrapper for long long values. More... | |
| using | to_u = detail::value< unsigned > |
|
Deprecated strongly-typed wrapper for unsigned values. More... | |
| using | to_uc = detail::value< unsigned char > |
|
Deprecated strongly-typed wrapper for unsigned char values. More... | |
| using | to_us = detail::value< unsigned short > |
|
Deprecated strongly-typed wrapper for unsigned short values. More... | |
| using | to_ul = detail::value< unsigned long > |
|
Deprecated strongly-typed wrapper for unsigned long values. More... | |
| using | to_ull = detail::value< unsigned long long > |
|
Deprecated strongly-typed wrapper for unsigned long long values. More... | |
| using | to_i8 = detail::value< std::int8_t > |
|
Deprecated strongly-typed wrapper for std::int8_t values. More... | |
| using | to_i16 = detail::value< std::int16_t > |
|
Deprecated strongly-typed wrapper for std::int16_t values. More... | |
| using | to_i32 = detail::value< std::int32_t > |
|
Deprecated strongly-typed wrapper for std::int32_t values. More... | |
| using | to_i64 = detail::value< std::int64_t > |
|
Deprecated strongly-typed wrapper for std::int64_t values. More... | |
| using | to_u8 = detail::value< std::uint8_t > |
|
Deprecated strongly-typed wrapper for std::uint8_t values. More... | |
| using | to_u16 = detail::value< std::uint16_t > |
|
Deprecated strongly-typed wrapper for std::uint16_t values. More... | |
| using | to_u32 = detail::value< std::uint32_t > |
|
Deprecated strongly-typed wrapper for std::uint32_t values. More... | |
| using | to_u64 = detail::value< std::uint64_t > |
|
Deprecated strongly-typed wrapper for std::uint64_t values. More... | |
| using | to_f = detail::value< float > |
|
Deprecated strongly-typed wrapper for float values. More... | |
| using | to_d = detail::value< double > |
|
Deprecated strongly-typed wrapper for double values. More... | |
| using | to_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
- 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()
| 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.
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.
Reference micro_os_plus::micro_test_plus::detail::integral_literal.
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.
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()
| 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.
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()
| 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.
Reference micro_os_plus::micro_test_plus::detail::integral_literal.
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.
Reference micro_os_plus::micro_test_plus::detail::integral_literal.
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.
Reference micro_os_plus::micro_test_plus::detail::integral_literal.
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.
Reference micro_os_plus::micro_test_plus::detail::integral_literal.
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.
Reference micro_os_plus::micro_test_plus::detail::integral_literal.
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.
Reference micro_os_plus::micro_test_plus::detail::integral_literal.
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.
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()
| 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.
Reference micro_os_plus::micro_test_plus::detail::integral_literal.
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.
Reference micro_os_plus::micro_test_plus::detail::integral_literal.
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.
Reference micro_os_plus::micro_test_plus::detail::integral_literal.
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.
Reference micro_os_plus::micro_test_plus::detail::integral_literal.
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.
Reference micro_os_plus::micro_test_plus::detail::integral_literal.
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.
Reference micro_os_plus::micro_test_plus::detail::integral_literal.
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.
Reference micro_os_plus::micro_test_plus::detail::integral_literal.
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.
Reference micro_os_plus::micro_test_plus::detail::integral_literal.
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.
Reference micro_os_plus::micro_test_plus::detail::integral_literal.
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.
Reference micro_os_plus::micro_test_plus::detail::integral_literal.
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.
Reference micro_os_plus::micro_test_plus::detail::integral_literal.
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.
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
- Since
3.2.0
to_b
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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()
| 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.
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.
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.