KUMI v4.0.0
Flawless Fluorite
Loading...
Searching...
No Matches

◆ cat

cat_t kumi::cat {}
inlineconstexprnodiscard

Callable object concatenating multiple product types into a single one.

Note
This function does not take part in overload resolution if the input product types do not follow the same semantic.
See also
concepts::follows_same_semantic

Header file

#include <kumi/algorithm/cat.hpp>

Call Signature

template<product_type... Ts>
constexpr decltype(auto) cat(Ts... && t);
constexpr cat_t cat
Callable object concatenating multiple product types into a single one.
Definition cat.hpp:74

Parameters

  • ts: Product types to concatenate

Return value

  • A product type made of all element of all input product types in order.

Helper type

template<kumi::concepts::product_type... Ts> struct cat
{
using type = decltype(kumi::cat(std::declval<Ts>()...));
};
template<concepts::product_type... Ts> using cat_t = typename kumi::result::cat<Ts...>::type;

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

Examples

Tuple

#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 = kumi::cat(a,b,c);
std::cout << a << " " << b << " " << c << "\n";
std::cout << abc << "\n";
}
Fixed-size collection of heterogeneous values.
Definition tuple.hpp:33

Record

#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 = kumi::cat(a,b,c);
std::cout << a << " " << b << " " << c << "\n";
std::cout << abc << "\n";
}
Fixed-size collection of heterogeneous tagged fields, tags are unique.
Definition record.hpp:36