Reverse elements of a product type.
On record types, this function operates on elements as if they were ordered. The considered order is the order of declaration.
- Parameters
-
| t | The product type to reverse |
- Returns
- A product type with the type of t and elements equal to (t[index<size_v<T> - 1 - Idx>]...);
Helper type
namespace kumi::result
{
template<product_type T>
struct reverse;
template<product_type T>
}
constexpr auto reverse(T &&t)
Reverse elements of a product type.
Definition reverse.hpp:43
Computes the return type of a call to kumi::reverse
Examples:
Tuple:
#include <kumi/kumi.hpp>
#include <iostream>
int main()
{
std::cout << values << "\n";
}
Fixed-size collection of heterogeneous values.
Definition tuple.hpp:33
Record:
#include <kumi/kumi.hpp>
#include <iostream>
int main()
{
using namespace kumi::literals;
auto values =
kumi::record {
"a"_id = 1,
"b"_id =
'a',
"c"_id = 0.1 };
std::cout << values << "\n";
}
Fixed-size collection of heterogeneous tagged fields, tags are unique.
Definition record.hpp:36