17 #ifndef OPENKALMAN_TUPLE_REVERSE_HPP 18 #define OPENKALMAN_TUPLE_REVERSE_HPP 20 #include <type_traits> 34 template<uniformly_gettable T>
42 static constexpr
auto base_size = size_of_v<T>;
49 template<
bool Enable = true, std::enable_if_t<Enable and stdex::default_initializable<T>,
int> = 0>
55 template<
typename Arg> requires std::constructible_from<T, Arg&&>
57 template<
typename Arg, std::enable_if_t<stdex::constructible_from<T, Arg&&>,
int> = 0>
65 #ifdef __cpp_explicit_this_parameter 66 template<std::
size_t i>
67 constexpr decltype(
auto)
68 get(
this auto&&
self) noexcept
70 static_assert(i < size_of_v<T>,
"Index out of range.");
71 return collections::get<base_size - i - 1_uz>(std::forward<decltype(self)>(
self).t);
74 template<std::
size_t i>
75 constexpr decltype(
auto)
78 static_assert(i < size_of_v<T>,
"Index out of range.");
82 template<std::
size_t i>
83 constexpr decltype(
auto)
86 static_assert(i < size_of_v<T>,
"Index out of range.");
90 template<std::
size_t i>
91 constexpr decltype(
auto)
94 static_assert(i < size_of_v<T>,
"Index out of range.");
98 template<std::
size_t i>
99 constexpr decltype(
auto)
100 get()
const && noexcept
102 static_assert(i < size_of_v<T>,
"Index out of range.");
116 template<
typename Arg>
128 template<std::
size_t i,
typename T>
131 static_assert(i < OpenKalman::collections::size_of_v<T>);
142 #ifdef __cpp_concepts 143 template<uniformly_gettable Arg>
146 template<
typename Arg, std::enable_if_t<uniformly_gettable<Arg>,
int> = 0>
158 #ifdef __cpp_concepts 159 template<uniformly_gettable T> requires std::default_initializable<T>
162 template<
typename T, std::enable_if_t<uniformly_gettable<T> and stdex::default_initializable<T>,
int> = 0>
Definition for collections::tuple_like.
Namespace for collections.
Definition: collections.hpp:27
tuple_reverse_view(Arg &&) -> tuple_reverse_view< Arg >
Deduction guide.
constexpr detail_get::get_impl< i > get
A generalization of std::get, where the index is known at compile time.
Definition: get.hpp:50
Definition for collections::size_of.
The size of a sized object (including a collection).
Definition: size_of.hpp:33
A view of a tuple that reverses the order of a base tuple.
Definition: tuple_reverse.hpp:38
The root namespace for OpenKalman.
Definition: basics.hpp:34
constexpr auto tuple_reverse(Arg &&arg)
Reverses the order of a uniformly_gettable object.
Definition: tuple_reverse.hpp:149
decltype(auto) constexpr get() &
Get element i of a tuple_reverse_view.
Definition: tuple_reverse.hpp:76
typename collection_element< i, T >::type collection_element_t
Helper template for collection_element.
Definition: collection_element.hpp:116
Definition for collections::collection_element.
constexpr bool tuple_like
T is a non-empty tuple, pair, array, or other type that acts like a tuple.
Definition: tuple_like.hpp:66