micro-test-plus 6.0.0
µTest++ Testing Framework
Loading...
Searching...
No Matches
Literals and wrappers

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

Classes

struct  micro_os_plus::micro_test_plus::to_t< T >
 Deprecated generic strongly-typed wrapper for explicit type conversion. More...

Functions

constexpr auto micro_os_plus::micro_test_plus::literals::operator""_b (const char *name, decltype(sizeof("")) size)
 Deprecated user-defined literal operator to create a named boolean constant.
template<char... Cs>
constexpr auto micro_os_plus::micro_test_plus::literals::operator""_c ()
 Deprecated user-defined literal operator to convert to char.
template<char... Cs>
constexpr auto micro_os_plus::micro_test_plus::literals::operator""_d ()
 Deprecated user-defined literal operator to convert to double.
template<char... Cs>
constexpr auto micro_os_plus::micro_test_plus::literals::operator""_f ()
 Deprecated user-defined literal operator to convert to float.
template<char... Cs>
constexpr auto micro_os_plus::micro_test_plus::literals::operator""_i ()
 Deprecated user-defined literal operator to convert to int.
template<char... Cs>
constexpr auto micro_os_plus::micro_test_plus::literals::operator""_i16 ()
 Deprecated user-defined literal operator to convert to int16_t.
template<char... Cs>
constexpr auto micro_os_plus::micro_test_plus::literals::operator""_i32 ()
 Deprecated user-defined literal operator to convert to int32_t.
template<char... Cs>
constexpr auto micro_os_plus::micro_test_plus::literals::operator""_i64 ()
 Deprecated user-defined literal operator to convert to int64_t.
template<char... Cs>
constexpr auto micro_os_plus::micro_test_plus::literals::operator""_i8 ()
 Deprecated user-defined literal operator to convert to int8_t.
template<char... Cs>
constexpr auto micro_os_plus::micro_test_plus::literals::operator""_l ()
 Deprecated user-defined literal operator to convert to long.
template<char... Cs>
constexpr auto micro_os_plus::micro_test_plus::literals::operator""_ld ()
 Deprecated user-defined literal operator to convert to long double.
template<char... Cs>
constexpr auto micro_os_plus::micro_test_plus::literals::operator""_ll ()
 Deprecated user-defined literal operator to convert to long long.
template<char... Cs>
constexpr auto micro_os_plus::micro_test_plus::literals::operator""_s ()
 Deprecated user-defined literal operator to convert to short.
template<char... Cs>
constexpr auto micro_os_plus::micro_test_plus::literals::operator""_sc ()
 Deprecated user-defined literal operator to convert to signed char.
template<char... Cs>
constexpr auto micro_os_plus::micro_test_plus::literals::operator""_u ()
 Deprecated user-defined literal operator to convert to unsigned.
template<char... Cs>
constexpr auto micro_os_plus::micro_test_plus::literals::operator""_u16 ()
 Deprecated user-defined literal operator to convert to uint16_t.
template<char... Cs>
constexpr auto micro_os_plus::micro_test_plus::literals::operator""_u32 ()
 Deprecated user-defined literal operator to convert to uint32_t.
template<char... Cs>
constexpr auto micro_os_plus::micro_test_plus::literals::operator""_u64 ()
 Deprecated user-defined literal operator to convert to uint64_t.
template<char... Cs>
constexpr auto micro_os_plus::micro_test_plus::literals::operator""_u8 ()
 Deprecated user-defined literal operator to convert to uint8_t.
template<char... Cs>
constexpr auto micro_os_plus::micro_test_plus::literals::operator""_uc ()
 Deprecated user-defined literal operator to convert to unsigned char.
template<char... Cs>
constexpr auto micro_os_plus::micro_test_plus::literals::operator""_ul ()
 Deprecated user-defined literal operator to convert to unsigned long.
template<char... Cs>
constexpr auto micro_os_plus::micro_test_plus::literals::operator""_ull ()
 Deprecated user-defined literal operator to convert to unsigned long long.
template<char... Cs>
constexpr auto micro_os_plus::micro_test_plus::literals::operator""_us ()
 Deprecated user-defined literal operator to convert to unsigned short.

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};
Primary namespace for the µTest++ testing framework.
Since
3.2.0
using micro_os_plus::micro_test_plus::to_b = detail::value<bool>
 Deprecated strongly-typed wrapper for bool values.
using micro_os_plus::micro_test_plus::to_c = detail::value<char>
 Deprecated strongly-typed wrapper for char values.
using micro_os_plus::micro_test_plus::to_sc = detail::value<signed char>
 Deprecated strongly-typed wrapper for signed char values.
using micro_os_plus::micro_test_plus::to_s = detail::value<short>
 Deprecated strongly-typed wrapper for short values.
using micro_os_plus::micro_test_plus::to_i = detail::value<int>
 Deprecated strongly-typed wrapper for int values.
using micro_os_plus::micro_test_plus::to_l = detail::value<long>
 Deprecated strongly-typed wrapper for long values.
using micro_os_plus::micro_test_plus::to_ll = detail::value<long long>
 Deprecated strongly-typed wrapper for long long values.
using micro_os_plus::micro_test_plus::to_u = detail::value<unsigned>
 Deprecated strongly-typed wrapper for unsigned values.
using micro_os_plus::micro_test_plus::to_uc = detail::value<unsigned char>
 Deprecated strongly-typed wrapper for unsigned char values.
using micro_os_plus::micro_test_plus::to_us = detail::value<unsigned short>
 Deprecated strongly-typed wrapper for unsigned short values.
using micro_os_plus::micro_test_plus::to_ul = detail::value<unsigned long>
 Deprecated strongly-typed wrapper for unsigned long values.
using micro_os_plus::micro_test_plus::to_ull = detail::value<unsigned long long>
 Deprecated strongly-typed wrapper for unsigned long long values.
using micro_os_plus::micro_test_plus::to_i8 = detail::value<std::int8_t>
 Deprecated strongly-typed wrapper for std::int8_t values.
using micro_os_plus::micro_test_plus::to_i16 = detail::value<std::int16_t>
 Deprecated strongly-typed wrapper for std::int16_t values.
using micro_os_plus::micro_test_plus::to_i32 = detail::value<std::int32_t>
 Deprecated strongly-typed wrapper for std::int32_t values.
using micro_os_plus::micro_test_plus::to_i64 = detail::value<std::int64_t>
 Deprecated strongly-typed wrapper for std::int64_t values.
using micro_os_plus::micro_test_plus::to_u8 = detail::value<std::uint8_t>
 Deprecated strongly-typed wrapper for std::uint8_t values.
using micro_os_plus::micro_test_plus::to_u16 = detail::value<std::uint16_t>
 Deprecated strongly-typed wrapper for std::uint16_t values.
using micro_os_plus::micro_test_plus::to_u32 = detail::value<std::uint32_t>
 Deprecated strongly-typed wrapper for std::uint32_t values.
using micro_os_plus::micro_test_plus::to_u64 = detail::value<std::uint64_t>
 Deprecated strongly-typed wrapper for std::uint64_t values.
using micro_os_plus::micro_test_plus::to_f = detail::value<float>
 Deprecated strongly-typed wrapper for float values.
using micro_os_plus::micro_test_plus::to_d = detail::value<double>
 Deprecated strongly-typed wrapper for double values.
using micro_os_plus::micro_test_plus::to_ld = detail::value<long double>
 Deprecated strongly-typed wrapper for long double values.

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).
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.

Deprecated Functions

template<class T>
requires std::is_floating_point_v<T>
constexpr auto micro_os_plus::micro_test_plus::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.

Detailed Description

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.

Typedef Documentation

◆ _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)

◆ _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)

◆ _d

The same type as to_d; kept for backwards compatibility.

Deprecated
use approx() for tolerances (since 6.0.0)

◆ _f

The same type as to_f; kept for backwards compatibility.

Deprecated
use approx() for tolerances (since 6.0.0)

◆ _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)

◆ _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)

◆ _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)

◆ _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)

◆ _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)

◆ _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)

◆ _ld

The same type as to_ld; kept for backwards compatibility.

Deprecated
use approx() for tolerances (since 6.0.0)

◆ _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)

◆ _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)

◆ _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)

◆ _t

template<class T>
using micro_os_plus::micro_test_plus::_t = to_t<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
TThe type of the wrapped value.
Deprecated
pass plain values to eq() and the other comparators (since 6.0.0)

◆ _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)

◆ _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)

◆ _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)

◆ _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)

◆ _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)

◆ _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)

◆ _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)

◆ _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)

◆ _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)

◆ to_b

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)

◆ to_c

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)

◆ to_d

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)

◆ to_f

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)

◆ to_i

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)

◆ to_i16

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)

◆ to_i32

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)

◆ to_i64

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)

◆ to_i8

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)

◆ to_l

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)

◆ to_ld

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)

◆ to_ll

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)

◆ to_s

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)

◆ to_sc

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)

◆ to_u

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)

◆ to_u16

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)

◆ to_u32

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)

◆ to_u64

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)

◆ to_u8

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)

◆ to_uc

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)

◆ to_ul

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)

◆ to_ull

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)

◆ to_us

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)

Function Documentation

◆ approx()

template<class T>
requires std::is_floating_point_v<T>
auto micro_os_plus::micro_test_plus::approx ( T value,
std::type_identity_t< T > epsilon ) -> detail::value< T >
nodiscardconstexprnoexcept

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
TThe floating-point type of the value.
Parameters
valueThe expected value.
epsilonThe 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.

1279 {
1280 return detail::value<T>{ value, epsilon };
1281 }
Struct template representing a generic value, accessible via a getter.
Definition deprecated.h:629

References approx().

Referenced by approx(), and approx().

◆ operator""_b()

auto micro_os_plus::micro_test_plus::literals::operator""_b ( const char * name,
decltype(sizeof("")) size )
nodiscardconstexpr
Parameters
namePointer to the character sequence representing the literal.
sizeThe 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.

1239 {
1240 return detail::named_bool{ std::string_view{ name, size } };
1241 }
Struct representing a named boolean constant, created by the _b literal.
Definition deprecated.h:744

◆ operator""_c()

template<char... Cs>
auto micro_os_plus::micro_test_plus::literals::operator""_c ( )
nodiscardconstexpr
Template Parameters
CsThe 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.

940 {
941 return detail::integral_literal<char, Cs...> ();
942 }
constexpr auto integral_literal(void)
Creates the compile-time constant of an integer literal.

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

◆ operator""_d()

template<char... Cs>
auto micro_os_plus::micro_test_plus::literals::operator""_d ( )
nodiscardconstexpr
Template Parameters
CsThe 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.

1197 {
1199 double, detail::math::num<unsigned long long, Cs...> (),
1201 detail::math::den_size<unsigned long long, Cs...> ()>{};
1202 }
consteval auto den(void) -> T
Computes the decimal part of a number represented as an array of characters.
consteval auto den_size(void) -> T
Counts the decimal places of a number represented as an array of characters.
consteval auto num(void) -> T
Computes the integral part of a decimal floating-point number represented as an array of characters.
Struct template representing a generic floating-point constant with custom size and precision.
Definition deprecated.h:556

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 ( )
nodiscardconstexpr
Template Parameters
CsThe 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.

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 ( )
nodiscardconstexpr
Template Parameters
CsThe 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.

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

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

◆ operator""_i16()

template<char... Cs>
auto micro_os_plus::micro_test_plus::literals::operator""_i16 ( )
nodiscardconstexpr
Template Parameters
CsThe 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.

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

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

◆ operator""_i32()

template<char... Cs>
auto micro_os_plus::micro_test_plus::literals::operator""_i32 ( )
nodiscardconstexpr
Template Parameters
CsThe 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.

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

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

◆ operator""_i64()

template<char... Cs>
auto micro_os_plus::micro_test_plus::literals::operator""_i64 ( )
nodiscardconstexpr
Template Parameters
CsThe 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.

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

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

◆ operator""_i8()

template<char... Cs>
auto micro_os_plus::micro_test_plus::literals::operator""_i8 ( )
nodiscardconstexpr
Template Parameters
CsThe 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.

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

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

◆ operator""_l()

template<char... Cs>
auto micro_os_plus::micro_test_plus::literals::operator""_l ( )
nodiscardconstexpr
Template Parameters
CsThe 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.

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

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

◆ operator""_ld()

template<char... Cs>
auto micro_os_plus::micro_test_plus::literals::operator""_ld ( )
nodiscardconstexpr
Template Parameters
CsThe 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.

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 ( )
nodiscardconstexpr
Template Parameters
CsThe 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.

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

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

◆ operator""_s()

template<char... Cs>
auto micro_os_plus::micro_test_plus::literals::operator""_s ( )
nodiscardconstexpr
Template Parameters
CsThe 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.

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

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

◆ operator""_sc()

template<char... Cs>
auto micro_os_plus::micro_test_plus::literals::operator""_sc ( )
nodiscardconstexpr
Template Parameters
CsThe 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.

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

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

◆ operator""_u()

template<char... Cs>
auto micro_os_plus::micro_test_plus::literals::operator""_u ( )
nodiscardconstexpr
Template Parameters
CsThe 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.

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

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

◆ operator""_u16()

template<char... Cs>
auto micro_os_plus::micro_test_plus::literals::operator""_u16 ( )
nodiscardconstexpr
Template Parameters
CsThe 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.

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

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

◆ operator""_u32()

template<char... Cs>
auto micro_os_plus::micro_test_plus::literals::operator""_u32 ( )
nodiscardconstexpr
Template Parameters
CsThe 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.

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

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

◆ operator""_u64()

template<char... Cs>
auto micro_os_plus::micro_test_plus::literals::operator""_u64 ( )
nodiscardconstexpr
Template Parameters
CsThe 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.

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

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

◆ operator""_u8()

template<char... Cs>
auto micro_os_plus::micro_test_plus::literals::operator""_u8 ( )
nodiscardconstexpr
Template Parameters
CsThe 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.

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

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

◆ operator""_uc()

template<char... Cs>
auto micro_os_plus::micro_test_plus::literals::operator""_uc ( )
nodiscardconstexpr
Template Parameters
CsThe 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.

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

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

◆ operator""_ul()

template<char... Cs>
auto micro_os_plus::micro_test_plus::literals::operator""_ul ( )
nodiscardconstexpr
Template Parameters
CsThe 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.

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

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

◆ operator""_ull()

template<char... Cs>
auto micro_os_plus::micro_test_plus::literals::operator""_ull ( )
nodiscardconstexpr
Template Parameters
CsThe 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.

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

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

◆ operator""_us()

template<char... Cs>
auto micro_os_plus::micro_test_plus::literals::operator""_us ( )
nodiscardconstexpr
Template Parameters
CsThe 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.

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

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