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

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

Variables

constexpr make_record_t kumi::make_record {}

Detailed Description

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

Variable Documentation

◆ make_record

make_record_t kumi::make_record {}
inlineconstexprnodiscard

Header file

#include <kumi/kumi.hpp>

Call Signature

namespace kumi
{
template<typename... Ts>
constexpr auto make_record(Ts&&... ts);
}
constexpr make_record_t make_record
Definition record.hpp:620
Main KUMI namespace.
Definition algorithm.hpp:11

Parameters

  • ts: Zero or more arguments to construct the record from.

Return value

  • A kumi::record constructed from the arguments or their inner references when an argument 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";
}
decltype(auto) constexpr get(array< T, N > &t) noexcept
Extracts the Ith element from a kumi::array.
Definition array.hpp:672