KUMI v5.0.0
Gorgeous Garnet
Loading...
Searching...
No Matches
Record Types and associated Functions

Definitions of kumi::record and associated functions. More...

Topics

 kumi::forward_as_record
 Creates a kumi::record of forwarding references to its arguments.
 kumi::from_record
 Converts a kumi::record to an instance of an arbitrary type that models kumi::record_type.
 kumi::make_record
 Creates a record object, deducing the target type from the types of arguments.
 kumi::to_record
 Converts a kumi::concepts::record_type to an instance of kumi::record.

Classes

class  kumi::record< Ts >
 Fixed-size collection of heterogeneous fields with distinct labels. More...

Variables

template<kumi::concepts::identifier auto... Fields>
constexpr tie_as_record_t< Fields... > kumi::tie_as_record {}
 Creates a kumi::record of lvalue references to its arguments.

Detailed Description

Definitions of kumi::record and associated functions.

Variable Documentation

◆ tie_as_record

template<kumi::concepts::identifier auto... Fields>
tie_as_record_t<Fields...> kumi::tie_as_record {}
inlineconstexprnodiscard

Creates a kumi::record of lvalue references to its arguments.

Header file

#include <kumi/kumi.hpp>

Call Signature

namespace kumi
{
template<kumi::concepts::identifier auto... Fields, typename... Ts>
constexpr auto tie_as_record(Ts&... ts);
}
Concept specifying a type represents an identifier.
Definition concepts.hpp:204
Main KUMI namespace.
Definition algorithm.hpp:11

Parameters

  • Fields : Non type template parameters names to associate with each element.
  • ts: Zero or more lvalue arguments to construct the record from.

Return value

Example

#include <kumi/kumi.hpp>
#include <iostream>
using namespace kumi::literals;
auto generate()
{
return kumi::record{"i"_id = 1,"d"_id = 2.3,"f"_id = 4.56f};
}
int main()
{
int i;
double d;
float f;
kumi::tie_as_record<"i"_id, "d"_id, "f"_id>( i,d,f ) = generate();
std::cout << i << " " << d << " " << f << "\n";
}
constexpr generate_t< N > generate
Definition generate.hpp:105
Fixed-size collection of heterogeneous fields with distinct labels.
Definition record.hpp:36