Rotates the element of a product type R positions to the right, wrapping around when getting to the end.
- Template Parameters
-
- Parameters
-
- Returns
- A product type equivalent to t with elements rotated R positions to the right.
Helper type
namespace kumi::result
{
template<std::
size_t R, product_type T>
struct rotate_right;
template<std::size_t R, product_type T>
}
constexpr auto rotate_right(T &&t)
Rotates the element of a product type R positions to the right, wrapping around when getting to the e...
Definition rotate.hpp:99
Computes the return type of a call to kumi::rotate_right
Example
#include <kumi/kumi.hpp>
#include <iostream>
int main()
{
std::cout << values << "\n";
std::cout << kumi::rotate_right<1>(values) << "\n";
std::cout << kumi::rotate_right<3>(values) << "\n";
}
Fixed-size collection of heterogeneous values.
Definition tuple.hpp:29
#include <kumi/kumi.hpp>
#include <iostream>
int main()
{
using namespace kumi::literals;
auto values =
kumi::record{
"a"_id=1,
"b"_id=2,
"c"_id=3,
"d"_id=4,
"e"_id=5,
"f"_id=6};
std::cout << values << "\n";
std::cout << kumi::rotate_right<1>(values) << "\n";
std::cout << kumi::rotate_right<3>(values) << "\n";
}
Fixed-size collection of heterogeneous fields necessarily named, names are unique.
Definition record.hpp:29