Skip to main content

value Struct Template

Struct template representing a generic value, accessible via a getter. More...

Declaration

template <class T, class Opt = int> struct micro_os_plus::micro_test_plus::type_traits::value<T, Opt> { ... }

Included Headers

Base struct

structop

Empty base struct for all operator types. More...

Derived Structs

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...

Public Member Typedefs Index

template <class T, class Opt = int>
usingvalue_type = T

The type of the encapsulated value. More...

Public Constructors Index

template <class T, class Opt = int>
constexprvalue (const T &_value)

Constructs a value object with the specified value. More...

Public Operators Index

template <class T, class Opt = int>
constexproperator T () const

Explicit conversion operator to the underlying value type. More...

Public Member Functions Index

template <class T, class Opt = int>
constexpr auto get (void) const -> decltype(auto)

Getter for the encapsulated value. More...

Public Member Attributes Index

template <class T, class Opt = int>
Tvalue_ {}

The encapsulated value. More...

Description

Struct template representing a generic value, accessible via a getter.

Template Parameters
T

The type of the value to be encapsulated.

Opt

An optional parameter for SFINAE or specialisation, defaults to int.

The value struct template encapsulates a value of type T, providing a consistent interface for value access and conversion. It inherits from type_traits::op to enable unified handling within the µTest++ framework's type traits and metaprogramming utilities.

This struct template exposes the value via a member variable, a getter method, and an explicit conversion operator. It is intended for use cases where a value must be wrapped and treated generically within the framework, supporting advanced template metaprogramming and type introspection.

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

Public Member Typedefs

value_type

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

The type of the encapsulated value.

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

974 using value_type = T;

Public Constructors

value()

template <class T, class Opt = int>
micro_os_plus::micro_test_plus::type_traits::value< T, Opt >::value (const T & _value)
inline constexpr

Constructs a value object with the specified value.

Parameters
_value

The value to be stored.

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

981 constexpr value (const T& _value) : value_{ _value }
982 {
983 }

Referenced by micro_os_plus::micro_test_plus::_t< T >::_t and micro_os_plus::micro_test_plus::to_t< T >::to_t.

Public Operators

operator T()

template <class T, class Opt = int>
micro_os_plus::micro_test_plus::type_traits::value< T, Opt >::operator T ()
inline explicit nodiscard constexpr

Explicit conversion operator to the underlying value type.

Returns

The stored value as type T.

Allows explicit conversion to the encapsulated value.

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

994 operator T () const
995 {
996 return value_;
997 }

Public Member Functions

get()

template <class T, class Opt = int>
decltype(auto) micro_os_plus::micro_test_plus::type_traits::value< T, Opt >::get (void)
inline nodiscard constexpr

Getter for the encapsulated value.

Parameters

None.

Returns

The value of type T.

Returns the stored value.

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

1010 get (void) const
1011 {
1012 return value_;
1013 }

Public Member Attributes

value_

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

The encapsulated value.

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


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


Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.14.0.