16 #ifndef OPENKALMAN_COLLECTIONS_COLLECTION_ELEMENT_HPP 17 #define OPENKALMAN_COLLECTIONS_COLLECTION_ELEMENT_HPP 26 #ifndef __cpp_concepts 29 template<std::
size_t i,
typename T,
typename =
void>
32 template<std::
size_t i,
typename T>
44 template<std::
size_t i,
typename T>
46 template<std::
size_t i,
typename T,
typename =
void>
53 template<std::
size_t i, sized T> requires
54 values::size_compares_with<std::integral_constant<std::size_t, i>,
size_of<T>, &std::is_lt> and
55 requires {
typename std::tuple_element<i, std::decay_t<T>>::type; }
58 template<std::size_t i, typename T>
60 values::size_compares_with<std::integral_constant<std::size_t, i>, size_of<T>, &stdex::is_lt> and
61 detail::has_tuple_element<i, T>::value>>
63 : std::tuple_element<i, std::decay_t<T>> {};
71 template<std::
size_t i,
typename T> requires
72 values::size_compares_with<std::integral_constant<std::size_t, i>, size_of<T>, &std::is_lt> and
73 (not requires {
typename std::tuple_element<i, std::decay_t<T>>::type; }) and
77 template<std::size_t i, typename T>
85 decltype(get<i>(std::declval<stdex::remove_cvref_t<T>>()))>;
94 template<std::
size_t i, stdex::ranges::random_access_range T> requires
96 (not requires {
typename std::tuple_element<i, std::decay_t<T>>::type; }) and
100 template<std::size_t i, typename T>
102 (not values::size_compares_with<std::integral_constant<std::size_t, i>, size_of<T>, &stdex::is_lt>) and
103 stdex::ranges::random_access_range<T> and
104 not detail::has_tuple_element<i, T>::value and
108 using type = stdex::ranges::range_value_t<stdex::remove_cvref_t<T>>;
115 template<std::
size_t i,
typename T>
Namespace for collections.
Definition: collections.hpp:27
Header file for code relating to values (e.g., scalars and indices)
Definition for collections::size_of.
Definition for collections::sized.
typename remove_rvalue_reference< T >::type remove_rvalue_reference_t
Helper type for remove_rvalue_reference.
Definition: global-definitions.hpp:61
constexpr bool size_compares_with
T and U are sizes that compare in a particular way based on parameter comp.
Definition: size_compares_with.hpp:98
The type of the element at a given index, if it can be determined at compile time.
Definition: collection_element.hpp:48
typename collection_element< i, T >::type collection_element_t
Helper template for collection_element.
Definition: collection_element.hpp:116
Definition: collection_element.hpp:30
Definition for collections::gettable.