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

◆ make_record()

template<typename... Ts>
constexpr 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"_f = 1, "y"_f = 2.3, "z"_f = 4.5f, "t"_f = '@', "m"_f = std::ref(k));
std::cout << t << "\n";
// Reference access
kumi::get<"m"_f>(t)++;
std::cout << k << "\n";
}
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:395