micro-test-plus 3.2.2
µTest++ Testing Framework
Loading...
Searching...
No Matches
micro_os_plus::micro_test_plus::literals Namespace Reference

User-defined literals and type wrappers for the µTest++ testing framework. More...

Functions

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

Detailed Description

The literals namespace provides an extensive collection of user-defined literal operators and type wrappers, enabling explicit specification of operand types for use with the µTest++ comparators and operators.

These operators allow constants to be suffixed (for example, 1_i, 2_u16) to produce strongly-typed values, thereby enhancing type safety and ensuring that comparator functions and operators can display actual values in test reports.

In addition to literals, the namespace includes wrappers for converting dynamic values and expressions to recognised types, both via deprecated aliases (such as _i, _u8) and the preferred to_* forms (such as to_i, to_u8).

All definitions within this namespace are intended to facilitate clear and type-safe test expressions, and are implemented in the include/micro-os-plus folder to maintain a structured and modular codebase.