Skip to main content

Literals and Wrappers

Literal operators and wrappers for typed operands. More...

Classes Index

struct_t<T>

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

structto_t<T>

Generic strongly-typed wrapper for explicit type conversion. More...

Operators Index

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

User-defined literal operator to convert to bool. More...

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

User-defined literal operator to convert to char. More...

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

User-defined literal operator to convert to double. More...

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

User-defined literal operator to convert to float. More...

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

User-defined literal operator to convert to int. More...

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

User-defined literal operator to convert to int16_t. More...

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

User-defined literal operator to convert to int32_t. More...

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

User-defined literal operator to convert to int64_t. More...

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

User-defined literal operator to convert to int8_t. More...

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

User-defined literal operator to convert to long. More...

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

User-defined literal operator to convert to long double. More...

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

User-defined literal operator to convert to long long. More...

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

User-defined literal operator to convert to short. More...

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

User-defined literal operator to convert to signed char. More...

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

User-defined literal operator to convert to unsigned. More...

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

User-defined literal operator to convert to uint16_t. More...

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

User-defined literal operator to convert to uint32_t. More...

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

User-defined literal operator to convert to uint64_t. More...

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

User-defined literal operator to convert to uint8_t. More...

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

User-defined literal operator to convert to unsigned char. More...

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

User-defined literal operator to convert to unsigned long. More...

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

User-defined literal operator to convert to unsigned long long. More...

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

User-defined literal operator to convert to unsigned short. More...

Functions Index

constexpr_t (const T &t)

Constructor for the deprecated strongly-typed wrapper. More...

constexprto_t (const T &t)

Constructor for the strongly-typed wrapper. More...

Deprecated Type Wrappers Index

using_b = type_traits::value< bool >

Strongly-typed wrapper for bool values. More...

using_c = type_traits::value< char >

Strongly-typed wrapper for char values. More...

using_sc = type_traits::value< signed char >

Strongly-typed wrapper for signed char values. More...

using_s = type_traits::value< short >

Strongly-typed wrapper for short values. More...

using_i = type_traits::value< int >

Strongly-typed wrapper for int values. More...

using_l = type_traits::value< long >

Strongly-typed wrapper for long values. More...

using_ll = type_traits::value< long long >

Strongly-typed wrapper for long long values. More...

using_u = type_traits::value< unsigned >

Strongly-typed wrapper for unsigned values. More...

using_uc = type_traits::value< unsigned char >

Strongly-typed wrapper for unsigned char values. More...

using_us = type_traits::value< unsigned short >

Strongly-typed wrapper for unsigned short values. More...

using_ul = type_traits::value< unsigned long >

Strongly-typed wrapper for unsigned long values. More...

using_ull = type_traits::value< unsigned long long >

Strongly-typed wrapper for unsigned long long values. More...

using_i8 = type_traits::value< std::int8_t >

Strongly-typed wrapper for std::int8_t values. More...

using_i16 = type_traits::value< std::int16_t >

Strongly-typed wrapper for std::int16_t values. More...

using_i32 = type_traits::value< std::int32_t >

Strongly-typed wrapper for std::int32_t values. More...

using_i64 = type_traits::value< std::int64_t >

Strongly-typed wrapper for std::int64_t values. More...

using_u8 = type_traits::value< std::uint8_t >

Strongly-typed wrapper for std::uint8_t values. More...

using_u16 = type_traits::value< std::uint16_t >

Strongly-typed wrapper for std::uint16_t values. More...

using_u32 = type_traits::value< std::uint32_t >

Strongly-typed wrapper for std::uint32_t values. More...

using_u64 = type_traits::value< std::uint64_t >

Strongly-typed wrapper for std::uint64_t values. More...

using_f = type_traits::value< float >

Strongly-typed wrapper for float values. More...

using_d = type_traits::value< double >

Strongly-typed wrapper for double values. More...

using_ld = type_traits::value< long double >

Strongly-typed wrapper for long double values. More...

Type Wrappers Index

usingto_b = type_traits::value< bool >

Strongly-typed wrapper for bool values. More...

usingto_c = type_traits::value< char >

Strongly-typed wrapper for char values. More...

usingto_sc = type_traits::value< signed char >

Strongly-typed wrapper for signed char values. More...

usingto_s = type_traits::value< short >

Strongly-typed wrapper for short values. More...

usingto_i = type_traits::value< int >

Strongly-typed wrapper for int values. More...

usingto_l = type_traits::value< long >

Strongly-typed wrapper for long values. More...

usingto_ll = type_traits::value< long long >

Strongly-typed wrapper for long long values. More...

usingto_u = type_traits::value< unsigned >

Strongly-typed wrapper for unsigned values. More...

usingto_uc = type_traits::value< unsigned char >

Strongly-typed wrapper for unsigned char values. More...

usingto_us = type_traits::value< unsigned short >

Strongly-typed wrapper for unsigned short values. More...

usingto_ul = type_traits::value< unsigned long >

Strongly-typed wrapper for unsigned long values. More...

usingto_ull = type_traits::value< unsigned long long >

Strongly-typed wrapper for unsigned long long values. More...

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

Strongly-typed wrapper for std::int8_t values. More...

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

Strongly-typed wrapper for std::int16_t values. More...

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

Strongly-typed wrapper for std::int32_t values. More...

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

Strongly-typed wrapper for std::int64_t values. More...

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

Strongly-typed wrapper for std::uint8_t values. More...

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

Strongly-typed wrapper for std::uint16_t values. More...

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

Strongly-typed wrapper for std::uint32_t values. More...

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

Strongly-typed wrapper for std::uint64_t values. More...

usingto_f = type_traits::value< float >

Strongly-typed wrapper for float values. More...

usingto_d = type_traits::value< double >

Strongly-typed wrapper for double values. More...

usingto_ld = type_traits::value< long double >

Strongly-typed wrapper for long double values. More...

Description

Literal operators and wrappers for typed operands.

Within test expressions, literals such as 1_i and 42_f create strongly typed operands, whilst wrappers like mt::to_i{expression} convert dynamic values. These mechanisms enable clear, type-safe comparisons, improving readability and correctness in test cases.

Literal operators, available in the dedicated literals namespace, allow constants to be expressed with explicit types, such as integers and floating-point values. For dynamic values, wrappers convert operands into recognised comparison types at run-time.

This approach ensures that both compile-time constants and run-time values can be compared accurately and expressively, supporting robust, maintainable test code.

Examples
 ts.test ("Check typed operands", [] (auto& t) {
  using namespace micro_test_plus::operators;
  using namespace micro_test_plus::literals;
 
  t.expect (mt::to_i {answer} == 42_i);
  t.expect (mt::to_f {expression} == 42_f);
 });

Operators

operator""_b()

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

User-defined literal operator to convert to bool.

This user-defined literal operator enables the creation of strongly-typed boolean constants from character sequences at compile time.

The operator is particularly useful in test expressions, allowing string literals to be suffixed with _b (for example, "feature_enabled"_b) to produce a type-safe value that integrates seamlessly with the µTest++ comparators and reporting mechanisms.

The returned type is a lightweight wrapper that behaves as a bool and supports equality comparison with both other named instances and boolean values. This operator is intended to facilitate expressive and type-safe test conditions.

Parameters
name

Pointer to the character sequence representing the literal.

size

The size of the character sequence.

Returns

An instance of a wrapper type convertible to bool and supporting equality comparisons.

Definition at line 516 of file literals-inlines.h.

516 operator""_b (const char* name, decltype (sizeof ("")) size)
517 {
527 struct named : std::string_view, type_traits::op
528 {
532 using value_type = bool;
533
543 constexpr
544 operator value_type () const
545 {
546 return true;
547 }
548
558 constexpr auto
559 operator== (const named&) const
560 {
561 return true;
562 }
563
573 constexpr auto
574 operator== (const bool other) const
575 {
576 return other;
577 }
578 };
579
580 return named{ { name, size }, {} };
581 }

operator""_c()

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

User-defined literal operator to convert to char.

This user-defined literal operator enables the creation of strongly-typed integral constants of type char from character sequences at compile time.

The operator is particularly useful in test expressions, allowing constants to be suffixed with _c (for example, 'A'_c) to produce a type-safe value that integrates seamlessly with the µTest++ comparators and reporting mechanisms.

Template Parameters
Cs

The character pack representing the digits of the character constant.

Returns

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

Definition at line 130 of file literals-inlines.h.

130 operator""_c ()
131 {
132 return type_traits::integral_constant<math::num<char, Cs...> ()>{};
133 }

Reference micro_os_plus::micro_test_plus::math::num.

operator""_d()

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

User-defined literal operator to convert to double.

This user-defined literal operator enables the creation of strongly-typed floating-point constants of type double from character sequences at compile time.

The operator is particularly useful in test expressions, allowing constants to be suffixed with _d (for example, 2.718_d) to produce a type-safe value that integrates seamlessly with the µTest++ comparators and reporting mechanisms.

Template Parameters
Cs

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

Returns

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

Definition at line 470 of file literals-inlines.h.

470 operator""_d ()
471 {
473 double, math::num<unsigned long, Cs...> (),
475 math::den_size<unsigned long, Cs...> ()>{};
476 }

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

operator""_f()

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

User-defined literal operator to convert to float.

This user-defined literal operator enables the creation of strongly-typed floating-point constants of type float from character sequences at compile time.

The operator is particularly useful in test expressions, allowing constants to be suffixed with _f (for example, 3.14_f) to produce a type-safe value that integrates seamlessly with the µTest++ comparators and reporting mechanisms.

Template Parameters
Cs

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

Returns

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

Definition at line 449 of file literals-inlines.h.

449 operator""_f ()
450 {
452 float, math::num<unsigned long, Cs...> (),
454 math::den_size<unsigned long, Cs...> ()>{};
455 }

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

operator""_i()

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

User-defined literal operator to convert to int.

This user-defined literal operator enables the creation of strongly-typed integral constants of type int from character sequences at compile time.

The operator is particularly useful in test expressions, allowing constants to be suffixed with _i (for example, 42_i) to produce a type-safe value that integrates seamlessly with the µTest++ comparators and reporting mechanisms.

Template Parameters
Cs

The character pack representing the digits of the integer constant.

Returns

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

Definition at line 94 of file literals-inlines.h.

94 operator""_i ()
95 {
96 return type_traits::integral_constant<math::num<int, Cs...> ()>{};
97 }

Reference micro_os_plus::micro_test_plus::math::num.

operator""_i16()

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

User-defined literal operator to convert to int16_t.

This user-defined literal operator enables the creation of strongly-typed integral constants of type int16_t from character sequences at compile time.

The operator is particularly useful in test expressions, allowing constants to be suffixed with _i16 (for example, 32767_i16) to produce a type-safe value that integrates seamlessly with the µTest++ comparators and reporting mechanisms.

Template Parameters
Cs

The character pack representing the digits of the int16_t constant.

Returns

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

Definition at line 316 of file literals-inlines.h.

316 operator""_i16 ()
317 {
319 math::num<std::int16_t, Cs...> ()>{};
320 }

Reference micro_os_plus::micro_test_plus::math::num.

operator""_i32()

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

User-defined literal operator to convert to int32_t.

This user-defined literal operator enables the creation of strongly-typed integral constants of type int32_t from character sequences at compile time.

The operator is particularly useful in test expressions, allowing constants to be suffixed with _i32 (for example, 2147483647_i32) to produce a type-safe value that integrates seamlessly with the µTest++ comparators and reporting mechanisms.

Template Parameters
Cs

The character pack representing the digits of the int32_t constant.

Returns

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

Definition at line 335 of file literals-inlines.h.

335 operator""_i32 ()
336 {
338 math::num<std::int32_t, Cs...> ()>{};
339 }

Reference micro_os_plus::micro_test_plus::math::num.

operator""_i64()

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

User-defined literal operator to convert to int64_t.

This user-defined literal operator enables the creation of strongly-typed integral constants of type int64_t from character sequences at compile time.

The operator is particularly useful in test expressions, allowing constants to be suffixed with _i64 (for example, 9223372036854775807_i64) to produce a type-safe value that integrates seamlessly with the µTest++ comparators and reporting mechanisms.

Template Parameters
Cs

The character pack representing the digits of the int64_t constant.

Returns

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

Definition at line 354 of file literals-inlines.h.

354 operator""_i64 ()
355 {
357 math::num<std::int64_t, Cs...> ()>{};
358 }

Reference micro_os_plus::micro_test_plus::math::num.

operator""_i8()

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

User-defined literal operator to convert to int8_t.

This user-defined literal operator enables the creation of strongly-typed integral constants of type int8_t from character sequences at compile time.

The operator is particularly useful in test expressions, allowing constants to be suffixed with _i8 (for example, 127_i8) to produce a type-safe value that integrates seamlessly with the µTest++ comparators and reporting mechanisms.

Template Parameters
Cs

The character pack representing the digits of the int8_t constant.

Returns

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

Definition at line 297 of file literals-inlines.h.

297 operator""_i8 ()
298 {
300 math::num<std::int8_t, Cs...> ()>{};
301 }

Reference micro_os_plus::micro_test_plus::math::num.

operator""_l()

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

User-defined literal operator to convert to long.

This user-defined literal operator enables the creation of strongly-typed integral constants of type long from character sequences at compile time.

The operator is particularly useful in test expressions, allowing constants to be suffixed with _l (for example, 123_l) to produce a type-safe value that integrates seamlessly with the µTest++ comparators and reporting mechanisms.

Template Parameters
Cs

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

Returns

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

Definition at line 167 of file literals-inlines.h.

167 operator""_l ()
168 {
169 return type_traits::integral_constant<math::num<long, Cs...> ()>{};
170 }

Reference micro_os_plus::micro_test_plus::math::num.

operator""_ld()

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

User-defined literal operator to convert to long double.

This user-defined literal operator enables the creation of strongly-typed floating-point constants of type long double from character sequences at compile time.

The operator is particularly useful in test expressions, allowing constants to be suffixed with _ld (for example, 1.618_ld) to produce a type-safe value that integrates seamlessly with the µTest++ comparators and reporting mechanisms.

Template Parameters
Cs

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

Returns

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

Definition at line 491 of file literals-inlines.h.

491 operator""_ld ()
492 {
494 long double, math::num<unsigned long long, Cs...> (),
496 math::den_size<unsigned long long, Cs...> ()>{};
497 }

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

operator""_ll()

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

User-defined literal operator to convert to long long.

This user-defined literal operator enables the creation of strongly-typed integral constants of type long long from character sequences at compile time.

The operator is particularly useful in test expressions, allowing constants to be suffixed with _ll (for example, 123_ll) to produce a type-safe value that integrates seamlessly with the µTest++ comparators and reporting mechanisms.

Template Parameters
Cs

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

Returns

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

Definition at line 185 of file literals-inlines.h.

185 operator""_ll ()
186 {
187 return type_traits::integral_constant<math::num<long long, Cs...> ()>{};
188 }

Reference micro_os_plus::micro_test_plus::math::num.

operator""_s()

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

User-defined literal operator to convert to short.

This user-defined literal operator enables the creation of strongly-typed integral constants of type short from character sequences at compile time.

The operator is particularly useful in test expressions, allowing constants to be suffixed with _s (for example, 123_s) to produce a type-safe value that integrates seamlessly with the µTest++ comparators and reporting mechanisms.

Template Parameters
Cs

The character pack representing the digits of the integer constant.

Returns

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

Definition at line 112 of file literals-inlines.h.

112 operator""_s ()
113 {
114 return type_traits::integral_constant<math::num<short, Cs...> ()>{};
115 }

Reference micro_os_plus::micro_test_plus::math::num.

operator""_sc()

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

User-defined literal operator to convert to signed char.

This user-defined literal operator enables the creation of strongly-typed integral constants of type signed char from character sequences at compile time.

The operator is particularly useful in test expressions, allowing constants to be suffixed with _sc (for example, 65_sc) to produce a type-safe value that integrates seamlessly with the µTest++ comparators and reporting mechanisms.

Template Parameters
Cs

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

Returns

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

Definition at line 148 of file literals-inlines.h.

148 operator""_sc ()
149 {
151 math::num<signed char, Cs...> ()>{};
152 }

Reference micro_os_plus::micro_test_plus::math::num.

operator""_u()

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

User-defined literal operator to convert to unsigned.

This user-defined literal operator enables the creation of strongly-typed integral constants of type unsigned from character sequences at compile time.

The operator is particularly useful in test expressions, allowing constants to be suffixed with _u (for example, 123_u) to produce a type-safe value that integrates seamlessly with the µTest++ comparators and reporting mechanisms.

Template Parameters
Cs

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

Returns

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

Definition at line 203 of file literals-inlines.h.

203 operator""_u ()
204 {
205 return type_traits::integral_constant<math::num<unsigned, Cs...> ()>{};
206 }

Reference micro_os_plus::micro_test_plus::math::num.

operator""_u16()

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

User-defined literal operator to convert to uint16_t.

This user-defined literal operator enables the creation of strongly-typed integral constants of type uint16_t from character sequences at compile time.

The operator is particularly useful in test expressions, allowing constants to be suffixed with _u16 (for example, 65535_u16) to produce a type-safe value that integrates seamlessly with the µTest++ comparators and reporting mechanisms.

Template Parameters
Cs

The character pack representing the digits of the uint16_t constant.

Returns

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

Definition at line 392 of file literals-inlines.h.

392 operator""_u16 ()
393 {
395 math::num<std::uint16_t, Cs...> ()>{};
396 }

Reference micro_os_plus::micro_test_plus::math::num.

operator""_u32()

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

User-defined literal operator to convert to uint32_t.

This user-defined literal operator enables the creation of strongly-typed integral constants of type uint32_t from character sequences at compile time.

The operator is particularly useful in test expressions, allowing constants to be suffixed with _u32 (for example, 4294967295_u32) to produce a type-safe value that integrates seamlessly with the µTest++ comparators and reporting mechanisms.

Template Parameters
Cs

The character pack representing the digits of the uint32_t constant.

Returns

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

Definition at line 411 of file literals-inlines.h.

411 operator""_u32 ()
412 {
414 math::num<std::uint32_t, Cs...> ()>{};
415 }

Reference micro_os_plus::micro_test_plus::math::num.

operator""_u64()

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

User-defined literal operator to convert to uint64_t.

This user-defined literal operator enables the creation of strongly-typed integral constants of type uint64_t from character sequences at compile time.

The operator is particularly useful in test expressions, allowing constants to be suffixed with _u64 (for example, 18446744073709551615_u64) to produce a type-safe value that integrates seamlessly with the µTest++ comparators and reporting mechanisms.

Template Parameters
Cs

The character pack representing the digits of the uint64_t constant.

Returns

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

Definition at line 430 of file literals-inlines.h.

430 operator""_u64 ()
431 {
433 math::num<std::uint64_t, Cs...> ()>{};
434 }

Reference micro_os_plus::micro_test_plus::math::num.

operator""_u8()

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

User-defined literal operator to convert to uint8_t.

This user-defined literal operator enables the creation of strongly-typed integral constants of type uint8_t from character sequences at compile time.

The operator is particularly useful in test expressions, allowing constants to be suffixed with _u8 (for example, 255_u8) to produce a type-safe value that integrates seamlessly with the µTest++ comparators and reporting mechanisms.

Template Parameters
Cs

The character pack representing the digits of the uint8_t constant.

Returns

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

Definition at line 373 of file literals-inlines.h.

373 operator""_u8 ()
374 {
376 math::num<std::uint8_t, Cs...> ()>{};
377 }

Reference micro_os_plus::micro_test_plus::math::num.

operator""_uc()

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

User-defined literal operator to convert to unsigned char.

This user-defined literal operator enables the creation of strongly-typed integral constants of type unsigned char from character sequences at compile time.

The operator is particularly useful in test expressions, allowing constants to be suffixed with _uc (for example, 65_uc) to produce a type-safe value that integrates seamlessly with the µTest++ comparators and reporting mechanisms.

Template Parameters
Cs

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

Returns

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

Definition at line 221 of file literals-inlines.h.

221 operator""_uc ()
222 {
224 math::num<unsigned char, Cs...> ()>{};
225 }

Reference micro_os_plus::micro_test_plus::math::num.

operator""_ul()

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

User-defined literal operator to convert to unsigned long.

This user-defined literal operator enables the creation of strongly-typed integral constants of type unsigned long from character sequences at compile time.

The operator is particularly useful in test expressions, allowing constants to be suffixed with _ul (for example, 123_ul) to produce a type-safe value that integrates seamlessly with the µTest++ comparators and reporting mechanisms.

Template Parameters
Cs

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

Returns

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

Definition at line 259 of file literals-inlines.h.

259 operator""_ul ()
260 {
262 math::num<unsigned long, Cs...> ()>{};
263 }

Reference micro_os_plus::micro_test_plus::math::num.

operator""_ull()

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

User-defined literal operator to convert to unsigned long long.

This user-defined literal operator enables the creation of strongly-typed integral constants of type unsigned long long from character sequences at compile time.

The operator is particularly useful in test expressions, allowing constants to be suffixed with _ull (for example, 123_ull) to produce a type-safe value that integrates seamlessly with the µTest++ comparators and reporting mechanisms.

Template Parameters
Cs

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

Returns

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

Definition at line 278 of file literals-inlines.h.

278 operator""_ull ()
279 {
281 math::num<unsigned long long, Cs...> ()>{};
282 }

Reference micro_os_plus::micro_test_plus::math::num.

operator""_us()

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

User-defined literal operator to convert to unsigned short.

This user-defined literal operator enables the creation of strongly-typed integral constants of type unsigned short from character sequences at compile time.

The operator is particularly useful in test expressions, allowing constants to be suffixed with _us (for example, 123_us) to produce a type-safe value that integrates seamlessly with the µTest++ comparators and reporting mechanisms.

Template Parameters
Cs

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

Returns

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

Definition at line 240 of file literals-inlines.h.

240 operator""_us ()
241 {
243 math::num<unsigned short, Cs...> ()>{};
244 }

Reference micro_os_plus::micro_test_plus::math::num.

Functions

_t()

micro_os_plus::micro_test_plus::_t< T >::_t (const T & t)
explicit constexpr

Constructor for the deprecated strongly-typed wrapper.

Parameters
t

The value to be wrapped and explicitly converted.

Constructs an _t instance by forwarding the provided value to the base type_traits::value<T> wrapper.

Declaration at line 648 of file literals.h, definition at line 594 of file literals-inlines.h.

594 constexpr _t<T>::_t (const T& t) : type_traits::value<T>{ t }
595 {
596 }

Reference micro_os_plus::micro_test_plus::type_traits::value< T >::value.

to_t()

micro_os_plus::micro_test_plus::to_t< T >::to_t (const T & t)
explicit constexpr

Constructor for the strongly-typed wrapper.

Parameters
t

The value to be wrapped and explicitly converted.

Constructs a to_t instance by forwarding the provided value to the base type_traits::value<T> wrapper.

Declaration at line 884 of file literals.h, definition at line 604 of file literals-inlines.h.

604 constexpr to_t<T>::to_t (const T& t) : type_traits::value<T>{ t }
605 {
606 }

Reference micro_os_plus::micro_test_plus::type_traits::value< T >::value.

Deprecated Type Wrappers

Strongly-typed wrappers for explicit type conversion.

These type aliases provide wrappers for converting values and expressions to specific types for use with µTest++ comparators and test expressions.

The _i, _u8, etc. forms are now deprecated as of version 3.2.0. Please use the preferred to_* type wrappers for new code, as they offer improved clarity and consistency.

Deprecated

Use the corresponding to_* type wrappers instead (since 3.2.0).

_b

using micro_os_plus::micro_test_plus::_b = type_traits::value<bool>

Strongly-typed wrapper for bool values.

Deprecated

Use to_b (since 3.2.0).

Definition at line 470 of file literals.h.

_c

using micro_os_plus::micro_test_plus::_c = type_traits::value<char>

Strongly-typed wrapper for char values.

Deprecated

Use to_c (since 3.2.0).

Definition at line 477 of file literals.h.

_d

using micro_os_plus::micro_test_plus::_d = type_traits::value<double>

Strongly-typed wrapper for double values.

Deprecated

Use to_d (since 3.2.0).

Definition at line 615 of file literals.h.

_f

using micro_os_plus::micro_test_plus::_f = type_traits::value<float>

Strongly-typed wrapper for float values.

Deprecated

Use to_f (since 3.2.0).

Definition at line 609 of file literals.h.

_i

using micro_os_plus::micro_test_plus::_i = type_traits::value<int>

Strongly-typed wrapper for int values.

Deprecated

Use to_i (since 3.2.0).

Definition at line 498 of file literals.h.

_i16

using micro_os_plus::micro_test_plus::_i16 = type_traits::value<std::int16_t>

Strongly-typed wrapper for std::int16_t values.

Deprecated

Use to_i16 (since 3.2.0).

Definition at line 561 of file literals.h.

_i32

using micro_os_plus::micro_test_plus::_i32 = type_traits::value<std::int32_t>

Strongly-typed wrapper for std::int32_t values.

Deprecated

Use to_i32 (since 3.2.0).

Definition at line 568 of file literals.h.

_i64

using micro_os_plus::micro_test_plus::_i64 = type_traits::value<std::int64_t>

Strongly-typed wrapper for std::int64_t values.

Deprecated

Use to_i64 (since 3.2.0).

Definition at line 575 of file literals.h.

_i8

using micro_os_plus::micro_test_plus::_i8 = type_traits::value<std::int8_t>

Strongly-typed wrapper for std::int8_t values.

Deprecated

Use to_i8 (since 3.2.0).

Definition at line 554 of file literals.h.

_l

using micro_os_plus::micro_test_plus::_l = type_traits::value<long>

Strongly-typed wrapper for long values.

Deprecated

Use to_l (since 3.2.0).

Definition at line 505 of file literals.h.

_ld

using micro_os_plus::micro_test_plus::_ld = type_traits::value<long double>

Strongly-typed wrapper for long double values.

Deprecated

Use to_ld (since 3.2.0).

Definition at line 622 of file literals.h.

_ll

using micro_os_plus::micro_test_plus::_ll = type_traits::value<long long>

Strongly-typed wrapper for long long values.

Deprecated

Use to_ll (since 3.2.0).

Definition at line 512 of file literals.h.

_s

using micro_os_plus::micro_test_plus::_s = type_traits::value<short>

Strongly-typed wrapper for short values.

Deprecated

Use to_s (since 3.2.0).

Definition at line 491 of file literals.h.

_sc

using micro_os_plus::micro_test_plus::_sc = type_traits::value<signed char>

Strongly-typed wrapper for signed char values.

Deprecated

Use to_sc (since 3.2.0).

Definition at line 484 of file literals.h.

_u

using micro_os_plus::micro_test_plus::_u = type_traits::value<unsigned>

Strongly-typed wrapper for unsigned values.

Deprecated

Use to_u (since 3.2.0).

Definition at line 519 of file literals.h.

_u16

using micro_os_plus::micro_test_plus::_u16 = type_traits::value<std::uint16_t>

Strongly-typed wrapper for std::uint16_t values.

Deprecated

Use to_u16 (since 3.2.0).

Definition at line 589 of file literals.h.

_u32

using micro_os_plus::micro_test_plus::_u32 = type_traits::value<std::uint32_t>

Strongly-typed wrapper for std::uint32_t values.

Deprecated

Use to_u32 (since 3.2.0).

Definition at line 596 of file literals.h.

_u64

using micro_os_plus::micro_test_plus::_u64 = type_traits::value<std::uint64_t>

Strongly-typed wrapper for std::uint64_t values.

Deprecated

Use to_u64 (since 3.2.0).

Definition at line 603 of file literals.h.

_u8

using micro_os_plus::micro_test_plus::_u8 = type_traits::value<std::uint8_t>

Strongly-typed wrapper for std::uint8_t values.

Deprecated

Use to_u8 (since 3.2.0).

Definition at line 582 of file literals.h.

_uc

using micro_os_plus::micro_test_plus::_uc = type_traits::value<unsigned char>

Strongly-typed wrapper for unsigned char values.

Deprecated

Use to_uc (since 3.2.0).

Definition at line 526 of file literals.h.

_ul

using micro_os_plus::micro_test_plus::_ul = type_traits::value<unsigned long>

Strongly-typed wrapper for unsigned long values.

Deprecated

Use to_ul (since 3.2.0).

Definition at line 540 of file literals.h.

_ull

using micro_os_plus::micro_test_plus::_ull = type_traits::value<unsigned long long>

Strongly-typed wrapper for unsigned long long values.

Deprecated

Use to_ull (since 3.2.0).

Definition at line 547 of file literals.h.

_us

using micro_os_plus::micro_test_plus::_us = type_traits::value<unsigned short>

Strongly-typed wrapper for unsigned short values.

Deprecated

Use to_us (since 3.2.0).

Definition at line 533 of file literals.h.

Type Wrappers

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

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

The to_* forms are the preferred approach since version 3.2.0, superseding the older _i, _u8, etc. aliases, which are now deprecated.

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

3.2.0

to_b

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

Strongly-typed wrapper for bool values.

Since

3.2.0

Definition at line 686 of file literals.h.

to_c

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

Strongly-typed wrapper for char values.

Since

3.2.0

Definition at line 693 of file literals.h.

to_d

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

Strongly-typed wrapper for double values.

Since

3.2.0

Definition at line 833 of file literals.h.

to_f

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

Strongly-typed wrapper for float values.

Since

3.2.0

Definition at line 826 of file literals.h.

to_i

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

Strongly-typed wrapper for int values.

Since

3.2.0

Definition at line 714 of file literals.h.

to_i16

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

Strongly-typed wrapper for std::int16_t values.

Since

3.2.0

Definition at line 777 of file literals.h.

to_i32

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

Strongly-typed wrapper for std::int32_t values.

Since

3.2.0

Definition at line 784 of file literals.h.

to_i64

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

Strongly-typed wrapper for std::int64_t values.

Since

3.2.0

Definition at line 791 of file literals.h.

to_i8

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

Strongly-typed wrapper for std::int8_t values.

Since

3.2.0

Definition at line 770 of file literals.h.

to_l

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

Strongly-typed wrapper for long values.

Since

3.2.0

Definition at line 721 of file literals.h.

to_ld

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

Strongly-typed wrapper for long double values.

Since

3.2.0

Definition at line 840 of file literals.h.

to_ll

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

Strongly-typed wrapper for long long values.

Since

3.2.0

Definition at line 728 of file literals.h.

to_s

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

Strongly-typed wrapper for short values.

Since

3.2.0

Definition at line 707 of file literals.h.

to_sc

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

Strongly-typed wrapper for signed char values.

Since

3.2.0

Definition at line 700 of file literals.h.

to_u

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

Strongly-typed wrapper for unsigned values.

Since

3.2.0

Definition at line 735 of file literals.h.

to_u16

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

Strongly-typed wrapper for std::uint16_t values.

Since

3.2.0

Definition at line 805 of file literals.h.

to_u32

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

Strongly-typed wrapper for std::uint32_t values.

Since

3.2.0

Definition at line 812 of file literals.h.

to_u64

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

Strongly-typed wrapper for std::uint64_t values.

Since

3.2.0

Definition at line 819 of file literals.h.

to_u8

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

Strongly-typed wrapper for std::uint8_t values.

Since

3.2.0

Definition at line 798 of file literals.h.

to_uc

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

Strongly-typed wrapper for unsigned char values.

Since

3.2.0

Definition at line 742 of file literals.h.

to_ul

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

Strongly-typed wrapper for unsigned long values.

Since

3.2.0

Definition at line 756 of file literals.h.

to_ull

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

Strongly-typed wrapper for unsigned long long values.

Since

3.2.0

Definition at line 763 of file literals.h.

to_us

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

Strongly-typed wrapper for unsigned short values.

Since

3.2.0

Definition at line 749 of file literals.h.


Generated via doxygen2docusaurus 2.2.0 by Doxygen 1.17.0.