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

◆ cat()

template<concepts::product_type... Ts>
requires (concepts::follows_same_semantic<Ts...>)
auto kumi::cat ( Ts &&... ts)
inlinenodiscardconstexpr

Concatenates product types in a single one.

Parameters
tsProduct types to concatenate
Returns
A product type made of all element of all input product types in order

Helper type

namespace kumi::result
{
template<product_type... Ts> struct cat;
template<product_type... Ts>
using cat_t = typename cat<Ts...>::type;
}
constexpr auto cat(Ts &&... ts)
Concatenates product types in a single one.
Definition cat.hpp:37

Computes the return type of a call to kumi::cat

Examples:

#include <kumi/kumi.hpp>
#include <iostream>
int main()
{
kumi::tuple a = { 1, 2.3, 4.5f};
kumi::tuple b = { '6' };
kumi::tuple c = { "7", short{89} };
auto abc = cat(a,b,c);
std::cout << a << " " << b << " " << c << "\n";
std::cout << abc << "\n";
}
Fixed-size collection of heterogeneous values.
Definition tuple.hpp:29
#include <kumi/kumi.hpp>
#include <iostream>
int main()
{
using namespace kumi::literals;
kumi::record a = { "r"_id = 1,"g"_id = 2.3, "b"_id = 4.5f};
kumi::record b = { "x"_id = '6' };
kumi::record c = { "y"_id = "7", "z"_id = short{89} };
auto abc = cat(a,b,c);
std::cout << a << " " << b << " " << c << "\n";
std::cout << abc << "\n";
}
Fixed-size collection of heterogeneous fields necessarily named, names are unique.
Definition record.hpp:29