Reorder elements of a kumi::record.
This function does not participate in overload resolution if the names are not in T
- Note
- Nothing prevent the number of reordered names to be lesser or greater than t size or the fact they can appear multiple times if it is applied on a named tuple.
- Template Parameters
-
| Name | Reordered names of elements |
- Parameters
-
- Returns
- A product type equivalent to product_type(t[index<Idx>]...);
Helper type
namespace kumi::result
{
}
Concept specifying a type follows the Product Type semantic.
Definition concepts.hpp:33
constexpr auto reorder_fields(Tuple &&t)
Reorder elements of a kumi::record.
Definition reorder.hpp:110
Computes the return type of a call to kumi::reorder_fields
Example
#include <kumi/kumi.hpp>
#include <iostream>
int main()
{
using namespace kumi::literals;
auto values =
kumi::record {
"a"_f = 1,
"b"_f =
'a',
"c"_f = 0.1 };
std::cout << values << "\n";
}
Fixed-size collection of heterogeneous fields necessarily named, names are unique.
Definition traits.hpp:366