Callable object converting recursively a product type of product types into a flat product type of pointers to each of its components.
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.
inline constexpr
#include <kumi/algorithm/flatten.hpp>
template<product_type T>
constexpr as_flat_ptr_t as_flat_ptr
Callable object converting recursively a product type of product types into a flat product type of po...
Definition flatten.hpp:364
- t: Product type to process
- A flat product type composed of pointers to each elements of t.
template<kumi::concepts::product_type T>
struct as_flat_ptr
{
};
template<kumi::concepts::product_type T> using as_flat_ptr_t = typename kumi::result::as_flat_ptr<T>::type;
Computes the return type of a call to kumi::as_flat_ptr
#include <kumi/kumi.hpp>
#include <iostream>
int main()
{
std::cout << a << "\n";
std::cout << ptr << "\n";
std::cout << a << "\n";
}
Fixed-size collection of heterogeneous values.
Definition tuple.hpp:33
#include <kumi/kumi.hpp>
#include <iostream>
int main()
{
using namespace kumi::literals;
kumi::record{
"c"_id = 2.3,
"d"_id = 4.5f },
"e"_id =
short{89} };
std::cout << a << "\n";
std::cout << ptr << "\n";
std::cout << a << "\n";
}
Fixed-size collection of heterogeneous tagged fields, tags are unique.
Definition record.hpp:36