Callable object reversing 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.
#include <kumi/algorithm/reverse.hpp>
template<product_type T>
constexpr auto reverse(T && t)
noexcept;
constexpr reverse_t reverse
Callable object reversing elements of a product type.
Definition reverse.hpp:78
- t: Product Type to reverse
- A product type with the type of t and elements equal to (get<index<size_v<T> - 1 - Idx>>(t)...);
template<kumi::concepts::product_type T>
using reverse_t =
decltype(
kumi::reverse(std::declval<T>()));
template<kumi::concepts::product_type T> struct reverse
{
using type = kumi::result::reverse_t<T>;
};
Computes the return type of a call to kumi::reverse
- Tuple
#include <kumi/kumi.hpp>
#include <iostream>
int main()
{
std::cout << values << "\n";
}
Fixed-size collection of heterogeneous values.
Definition tuple.hpp:35
- 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