KUMI
v5.0.0
Gorgeous Garnet
Loading...
Searching...
No Matches
◆
members_of
members_of_t kumi::members_of {}
inline
constexpr
nodiscard
Extracts the names of the fields of a kumi::product_type.
Note
If some fields are unnamed, the associated name is
kumi::unit
.
Header file
#include <kumi/product_types/tuple.hpp>
Call Signature
template
<product_type T>
constexpr
auto
members_of
(
kumi::as<T>
type);
kumi::members_of
constexpr members_of_t members_of
Extracts the names of the fields of a kumi::product_type.
Definition
tuple.hpp:964
kumi::as
Lightweight type-wrapper.
Definition
as.hpp:29
Parameters
type
: the type of the
kumi::concepts::product_type
from which to extract names.
Return value
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"
_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"
;
}
kumi::record
Fixed-size collection of heterogeneous tagged fields, tags are unique.
Definition
record.hpp:36
kumi::tuple
Fixed-size collection of heterogeneous values.
Definition
tuple.hpp:35
kumi