kumi v3.1.0
Exquisite Epidote
 
Loading...
Searching...
No Matches

◆ members_of()

template<product_type T>
constexpr auto kumi::members_of ( as< T >  )
inlineconstexprnoexcept

Extracts the names of the fields of a kumi::product_type.

Note
If some fields are unnamed, the associated name is kumi::unit.
Template Parameters
Tthe type of the prodcut_type from which to extract names.
Returns
A tuple of the names of a kumi::product_type.

Example:

#include <kumi/kumi.hpp>
#include <iostream>
int main()
{
using namespace kumi::literals;
kumi::tuple t = { "x"_f = 1, 2.3, 4.5f, "z"_f = '@' };
kumi::record r = {"x"_f = 1, "y"_f = 2.f, "z"_f = '#', "t"_f = 12};
std::cout << kumi::members_of(kumi::as(t)) << "\n";
std::cout << kumi::members_of(kumi::as(r)) << "\n";
}
constexpr auto members_of(as< T >) noexcept
Extracts the names of the fields of a kumi::product_type.
Definition meta.hpp:25
Lightweight type-wrapper.
Definition as.hpp:25
Fixed-size collection of heterogeneous fields necessarily named, names are unique.
Definition traits.hpp:366
Fixed-size collection of heterogeneous values.
Definition tuple.hpp:37