micro-test-plus 3.2.2
µTest++ Testing Framework
Loading...
Searching...
No Matches
micro_os_plus::micro_test_plus::_t< T > Struct Template Reference

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

#include <micro-os-plus/micro-test-plus.h>

Inheritance diagram for micro_os_plus::micro_test_plus::_t< T >:

Public Types

using value_type = T
 The type of the encapsulated value.

Public Member Functions

constexpr _t (const T &t)
 Constructor for the deprecated strongly-typed wrapper.
constexpr decltype(auto) get (void) const
 Getter for the encapsulated value.
constexpr operator T () const
 Explicit conversion operator to the underlying value type.

Public Attributes

value_ {}
 The encapsulated value.

Detailed Description

template<class T>
struct micro_os_plus::micro_test_plus::_t< T >

The _t template provides a public, strongly-typed wrapper for any type T, enabling explicit conversion of dynamic values and expressions to a type recognised by the µTest++ comparators and reporting mechanisms.

This wrapper inherits from type_traits::value<T>, ensuring that the encapsulated value is treated as the specified type within the framework.

Deprecated
Use to_t (since 3.2.0).

Definition at line 639 of file literals.h.

Member Typedef Documentation

◆ value_type

template<class T, class = int>
using micro_os_plus::micro_test_plus::type_traits::value< T, class >::value_type = T
inherited

Definition at line 976 of file type-traits.h.

Member Function Documentation

◆ get()

template<class T, class = int>
decltype(auto) micro_os_plus::micro_test_plus::type_traits::value< T, class >::get ( void ) const
inlinenodiscardconstexprinherited
Parameters
None.
Returns
The value of type T.

Returns the stored value.

Definition at line 1012 of file type-traits.h.

1013 {
1014 return value_;
1015 }

◆ operator T()

template<class T, class = int>
micro_os_plus::micro_test_plus::type_traits::value< T, class >::operator T ( ) const
inlineexplicitnodiscardconstexprinherited
Returns
The stored value as type T.

Allows explicit conversion to the encapsulated value.

Definition at line 996 of file type-traits.h.

997 {
998 return value_;
999 }

Member Data Documentation

◆ value_

template<class T, class = int>
T micro_os_plus::micro_test_plus::type_traits::value< T, class >::value_ {}
inherited

Definition at line 1020 of file type-traits.h.

1020{};

The documentation for this struct was generated from the following file: