KUMI v5.0.0
Gorgeous Garnet
Loading...
Searching...
No Matches

Callable object. More...

Variables

template<std::size_t R>
constexpr rotate_right_t< R > kumi::rotate_right {}

Detailed Description

Callable object.

Variable Documentation

◆ rotate_right

template<std::size_t R>
rotate_right_t<R> kumi::rotate_right {}
inlineconstexprnodiscard

On record types, this function operates on elements as if they were ordered. The considered order is the order of declaration.

Header file

#include <kumi/kumi.hpp>

Call Signature

namespace kumi
{
template<std::size_t R, concepts::product_type T>
constexpr auto rotate_right(T && t);
}
constexpr rotate_right_t< R > rotate_right
Definition rotate.hpp:163
Main KUMI namespace.
Definition algorithm.hpp:11

Template Parameters

  • R: Rotation factor

Parameters

  • t: Product Type to rotate

Return value

  • A product type equivalent to t with elements rotated R positions to the right.

Helper type

template<std::size_t R, kumi::concepts::product_type T>
using rotate_right_t = decltype(kumi::rotate_right<R>(kumi::declval<T>()));
template<std::size_t R, kumi::concepts::product_type T> struct rotate_right
{
using type = kumi::result::rotate_right_t<R, T>;
};

Computes the return type of a call to kumi::rotate_right

Examples

  • Tuple
    #include <kumi/kumi.hpp>
    #include <iostream>
    int main()
    {
    auto values = kumi::tuple {'A','B','C','D','E','F'};
    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:35
  • Record
    #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 with distinct labels.
    Definition record.hpp:36