Callable object converting a product type of product type into a single product type recursively, or returns the input.
This construction naturally arises from the definition of product types, a product type of the form T(T(x...)) is strictly equivalent to T(x...) as long as the T is the same type.
On record types, the names of the outer record are concatenated to the inner ones ultimately constructing names such as "outer.inner". If the input is a product type containing record types or vice versa only the inner types matching the outer semantic will be compressed. Thus a record inside a tuple will not be compressed.
#include <kumi/algorithm/flatten.hpp>
template<product_type T>
constexpr auto compress(T && t)
noexcept;
constexpr compress_t compress
Callable object converting a product type of product type into a single product type recursively,...
Definition flatten.hpp:197
- t: Product type to process
- The resulting value of the application of T0(...(Tn(values))) => T(values)
template<kumi::concepts::product_type T>
struct compress
{
};
template<kumi::concepts::product_type T> using compress_t = typename kumi::result::compress<T>::type;
Computes the return type of a call to kumi::compress
#include <kumi/kumi.hpp>
#include <iostream>
int main()
{
}
Fixed-size collection of heterogeneous values.
Definition tuple.hpp:33
#include <kumi/kumi.hpp>
#include <iostream>
int main()
{
using namespace kumi::literals;
}
Fixed-size collection of heterogeneous tagged fields, tags are unique.
Definition record.hpp:36