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

◆ members_of()

template<concepts::product_type T>
auto kumi::members_of ( as< T > )
inlinenodiscardconstexprnoexcept

Extracts the identifiers of the fields of a product type.

Note
If some fields are unnamed, the associated identifier is kumi::unit.
Template Parameters
Tthe type of the product type from which to extract identifierss.
Returns
A tuple of the identifierss of a product type if there are any.
See also
kumi::tuple
kumi::record

Example:

#include <kumi/kumi.hpp>
#include <iostream>
int main()
{
using namespace kumi::literals;
kumi::tuple t = { "x"_id = 1, 2.3, 4.5f, "z"_id = '@' };
kumi::record r = {"x"_id = 1, "y"_id = 2.f, "z"_id = '#', "t"_id = 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 identifiers of the fields of a product type.
Definition meta.hpp:29
Lightweight type-wrapper.
Definition as.hpp:29
Fixed-size collection of heterogeneous tagged fields, tags are unique.
Definition record.hpp:36
Fixed-size collection of heterogeneous values.
Definition tuple.hpp:33