Loading [MathJax]/extensions/tex2jax.js
kumi v3.1.0
Exquisite Epidote
 
All Classes Namespaces Functions Variables Friends Modules Pages Concepts
Loading...
Searching...
No Matches

◆ to_ref()

template<product_type Type>
KUMI_TRIVIAL_NODISCARD constexpr auto to_ref ( Type &&  t)
related

Creates a kumi::tuple of references given a reference to a kumi::product_type.

Parameters
tCompile-time index of the element to access
Returns
A tuple equivalent to the result of kumi::apply([]<typename... T>(T&&... e) { return kumi::forward_as_tuple(std::forward<T>(e)...); }, t)

Example:

#include <kumi/tuple.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<1>(ref) = 'z';
kumi::get<2>(ref) = 3.14159f;
std::cout << original << "\n";
}
constexpr auto from_tuple(tuple< Ts... > const &t)
Converts a kumi::tuple to an instance of an arbitrary type.
Definition convert.hpp:59