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

Callable object creating a kumi::concepts::product_type of references given a reference to a kumi::concepts::product_type. More...

Variables

constexpr to_ref_t kumi::to_ref {}

Detailed Description

Callable object creating a kumi::concepts::product_type of references given a reference to a kumi::concepts::product_type.

Variable Documentation

◆ to_ref

to_ref_t kumi::to_ref {}
inlineconstexprnoexceptnodiscard

If the input type matches the kumi::concepts::record_type protocol, return a kumi::record, returns a kumi::tuple otherwise.

Header file

#include <kumi/kumi.hpp>

Call Signature

namespace kumi
{
template<concepts::product_type T>
constexpr decltype(auto) to_ref(T && t) noexcept;
}
constexpr to_ref_t to_ref
Definition tuple.hpp:722
Main KUMI namespace.
Definition algorithm.hpp:11

Parameters

  • t: Product Type whose elements are to be referenced.

Return value

Examples

#include <kumi/kumi.hpp>
#include <iostream>
int main()
{
auto original = kumi::make_tuple(0,'0',0.f);
auto ref = kumi::to_ref( original );
std::cout << original << "\n";
kumi::get<0>(ref) = 9;
kumi::get<1>(ref) = 'z';
kumi::get<2>(ref) = 3.14159f;
std::cout << original << "\n";
}
constexpr make_tuple_t make_tuple
Definition tuple.hpp:655
decltype(auto) constexpr get(array< T, N > &t) noexcept
Extracts the Ith element from a kumi::array.
Definition array.hpp:672