micro-test-plus 4.1.0
µ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 stored value.

Public Member Functions

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

Public Attributes

epsilon = T{}
 The epsilon value used for floating-point comparisons.
value_ {}
 The stored 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 641 of file literals.h.

Member Typedef Documentation

◆ value_type

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

Member Function Documentation

◆ get()

template<class T>
T micro_os_plus::micro_test_plus::type_traits::value_base_< T >::get ( void ) const
nodiscardconstexprnoexceptinherited
Parameters
None.
Returns
The stored value.

Returns the stored value by value.

Definition at line 94 of file type-traits-inlines.h.

95 {
96 return value_;
97 }

References value_.

Referenced by micro_os_plus::micro_test_plus::detail::expression_formatter::operator<<().

◆ operator T()

template<class T>
micro_os_plus::micro_test_plus::type_traits::value_base_< T >::operator T ( ) const
explicitnodiscardconstexprnoexceptinherited
Returns
The stored value as type T.

Allows explicit conversion to the encapsulated value.

Definition at line 82 of file type-traits-inlines.h.

84 {
85 return value_;
86 }

References value_base_(), and value_.

Member Data Documentation

◆ epsilon

template<class T>
T micro_os_plus::micro_test_plus::type_traits::value< T >::epsilon = T{}
inherited

This instance member defines the precision for comparisons. It is set via the constructor, either explicitly or computed as a default based on the number of decimal digits in the value. Each instance carries its own epsilon, so two value<T> objects with different precisions do not interfere with each other.

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

753{};

◆ value_

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

544{};

Referenced by value_base_(), get(), and operator T().


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