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

◆ make_record()

template<typename... Ts>
auto make_record ( Ts &&... ts) -> record< std::unwrap_ref_decay_t< Ts >... >
related

Creates a record object, deducing the target type from the types of arguments.

Parameters
tsZero or more lvalue arguments to construct the record from.
Returns
A kumi::record constructed from the ts or their inner references when ts is an instance of std::reference_wrapper.

Example:

#include <kumi/kumi.hpp>
#include <functional>
#include <iostream>
int main()
{
using namespace kumi::literals;
int k = 99;
auto t = kumi::make_record( "x"_id = 1, "y"_id = 2.3, "z"_id = 4.5f, "t"_id = '@', "m"_id = std::ref(k));
std::cout << t << "\n";
// Reference access
kumi::get<"m"_id>(t)++;
std::cout << k << "\n";
}
constexpr auto make_record(Ts &&... ts) -> record< std::unwrap_ref_decay_t< Ts >... >
Creates a record object, deducing the target type from the types of arguments.
Definition record.hpp:396
constexpr decltype(auto) get(record< Ts... > &&r) noexcept
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition record.hpp:506