|
micro-test-plus 6.0.0
µTest++ Testing Framework
|
Deprecated generic strongly-typed wrapper for explicit type conversion. More...
#include "micro-os-plus/micro-test-plus.h"
Public Types | |
| using | op_type = op |
| Marker identifying the framework expression types. | |
| using | value_type = T |
| The type of the stored value. | |
Public Member Functions | |
| constexpr | to_t (const T &t) |
| Constructor for the strongly-typed wrapper. | |
| constexpr const 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 | |
| T | epsilon = T{} |
| The epsilon value used for floating-point comparisons. | |
Private Attributes | |
| T | value_ {} |
| The stored value. | |
The to_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 detail::value<T>, ensuring that the encapsulated value is treated as the specified type within the framework, for the types without a to_* alias, including the application types; with the operators of the operators namespace, the comparisons are then reported with their operands.
Definition at line 1871 of file deprecated.h.
|
inherited |
Declared directly rather than inherited from op, to avoid the empty base; detected by the extension::is_op concept.
Definition at line 360 of file deprecated.h.
|
inherited |
Exposed for use by generic code that inspects wrapper types.
Definition at line 368 of file deprecated.h.
|
explicitconstexpr |
| t | The value to be wrapped and explicitly converted. |
Constructs a to_t instance by forwarding the provided value to the base detail::value<T> wrapper.
Definition at line 1260 of file deprecated-inlines.h.
References micro_os_plus::micro_test_plus::detail::value< T >::value().
|
nodiscardconstexprnoexceptinherited |
Returns a reference, so that a wrapped object (for example a to_t<std::string>) is not copied each time it is compared or formatted.
Returns a const reference to the stored value, valid as long as the wrapper.
Definition at line 504 of file deprecated-inlines.h.
References value_.
|
explicitnodiscardconstexprnoexceptinherited |
Allows explicit conversion to the encapsulated value.
Definition at line 491 of file deprecated-inlines.h.
References value_base(), and value_.
|
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 674 of file deprecated.h.
|
privateinherited |
Set by the constructor. Derived wrappers and comparators access it via get() or the explicit conversion operator.
Definition at line 408 of file deprecated.h.
Referenced by value_base(), get(), and operator T().