Callable object converting a product type of product types into a product type of all elements.
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 flattened. Thus a record inside a tuple will not be flattened.
#include <kumi/algorithm/flatten.hpp>
template<product_type T>
constexpr auto flatten(T && t)
noexcept;
constexpr flatten_t flatten
Callable object converting a product type of product types into a product type of all elements.
Definition flatten.hpp:249
- t: Product type to process
- A product type composed of all elements of t flattened non-recursively
template<kumi::concepts::product_type T>
struct flatten
{
};
template<kumi::concepts::product_type T> using flatten_t = typename kumi::result::flatten<T>::type;
Computes the return type of a call to kumi::flatten
#include <kumi/kumi.hpp>
#include <iostream>
int main()
{
std::cout << r << "\n";
}
Fixed-size collection of heterogeneous values.
Definition tuple.hpp:33
#include <kumi/kumi.hpp>
#include <iostream>
int main()
{
using namespace kumi::literals;
auto more_nbrs =
kumi::record{
"a"_id = 0,
"b"_id = nbrs,
"c"_id = 4};
auto ltrs =
kumi::record{
"a"_id =
'a',
"b"_id =
'b',
"c"_id =
'c'};
,"d"_id = more_nbrs,"e"_id = 5.35f,"f"_id = ltrs} );
std::cout << r << "\n";
}
Fixed-size collection of heterogeneous tagged fields, tags are unique.
Definition record.hpp:36