KUMI v3.1.0
Exquisite Epidote
Loading...
Searching...
No Matches
kumi::field< Id, T > Class Template Reference

Named wrapper over a type. More...

#include <kumi/detail/field.hpp>

Detailed Description

template<typename Id, typename T>
class kumi::field< Id, T >

Named wrapper over a type.

kumi::field provides a way to define named fields in a product type. Any type can be used as an identifier as long as it models kumi::concepts::identifier.

Template Parameters
Ida compile time string that is used to retrieve the field.
Tthe type of the value that is wrapped.

Static Public Member Functions

static constexpr auto label ()
 Name associated to the field.

(Note that these are not member symbols.)

template<kumi_implementation_defined auto Name, typename T>
decltype(auto) constexpr capture_field (T &&t) noexcept
 Creates a field from a given value keeping the qualifiers.
template<typename U, typename T>
decltype(auto) constexpr field_cast (T &&t) noexcept
 Casts the provided value to the target type using static_cast.
template<typename CharT, typename Traits>
std::basic_ostream< CharT, Traits > & operator<< (std::basic_ostream< CharT, Traits > &os, field const &w) noexcept
 Inserts a kumi::field in an output stream.