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

Converts a kumi::tuple to an instance of an arbitrary type. More...

Variables

template<typename Type>
constexpr from_tuple_t< Type > kumi::from_tuple {}

Detailed Description

Converts a kumi::tuple to an instance of an arbitrary type.

Variable Documentation

◆ from_tuple

template<typename Type>
from_tuple_t<Type> kumi::from_tuple {}
inlineconstexprnodiscard

Constructs an instance of Type by passing elements of t to the appropriate constructor.

Header file

#include <kumi/kumi.hpp>

Call Signature

namespace kumi
{
template<typename Type, concepts::product_type T>
constexpr auto from_tuple(T&& t);
}
constexpr from_tuple_t< Type > from_tuple
Definition tuple.hpp:787
Main KUMI namespace.
Definition algorithm.hpp:11

Parameters

Return value

  • An instance of Type constructed from each element of t in order.

Example

#include <kumi/kumi.hpp>
#include <iostream>
#include <string>
struct my_struct
{
int i;
float f;
std::string name;
};
int main()
{
auto a = kumi::make_tuple(1337, 2.3475f, "John");
std::cout << a << "\n";
std::cout << b.i << ' ' << b.f << ' ' << b.name << "\n";
}
constexpr make_tuple_t make_tuple
Definition tuple.hpp:655
Compile-time text based identifier.
Definition identifier.hpp:165