KUMI v5.0.0
Gorgeous Garnet
Loading...
Searching...
No Matches

Extracts the identifiers of the fields of a kumi::product_type. More...

Variables

constexpr members_of_t kumi::members_of {}

Detailed Description

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

Variable Documentation

◆ members_of

members_of_t kumi::members_of {}
inlineconstexprnoexceptnodiscard
Note
An element that is not a field yields kumi::unknown.

Header file

#include <kumi/kumi.hpp>

Call Signature

namespace kumi
{
template<concepts::product_type T>
constexpr auto members_of(kumi::as<T> type) noexcept;
}
constexpr members_of_t members_of
Definition tuple.hpp:987
Main KUMI namespace.
Definition algorithm.hpp:11
Lightweight type-wrapper.
Definition as.hpp:29

Parameters

  • type: the kumi::as wrapping the product type whose identifiers are extracted.

Return value

  • A kumi::tuple of the identifiers of the elements, in their order.

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";
}
Fixed-size collection of heterogeneous fields with distinct labels.
Definition record.hpp:36
Fixed-size collection of heterogeneous values.
Definition tuple.hpp:35