16 #ifndef OPENKALMAN_COLLECTIONS_INDEX_HPP 17 #define OPENKALMAN_COLLECTIONS_INDEX_HPP 27 #if not defined(__cpp_lib_ranges) or __cpp_generic_lambdas < 201707L 30 template<
typename T,
typename =
void>
31 struct is_index_range : std::false_type {};
34 struct is_index_range<T,
std::enable_if_t<values::index<stdex::ranges::range_value_t<T>>>> : std::true_type {};
37 template<std::
size_t i,
typename T,
typename =
void>
38 struct has_index_element : std::false_type {};
40 template<std::
size_t i,
typename T>
41 struct has_index_element<i, T, std::enable_if_t<values::index<typename collection_element<i, T>::type>>>
45 template<
typename T,
typename = std::make_index_sequence<size_of_v<T>>>
46 struct is_index_tuple_impl : std::false_type {};
48 template<
typename T, std::size_t...i>
49 struct is_index_tuple_impl<T, std::index_sequence<i...>>
50 : std::bool_constant<(... and has_index_element<i, T>::value)> {};
53 template<
typename T,
typename =
void>
54 struct is_index_tuple : std::false_type {};
57 struct is_index_tuple<T, std::enable_if_t<size_of<T>::value != stdex::dynamic_extent>> : is_index_tuple_impl<T> {};
67 #if defined(__cpp_lib_ranges) and __cpp_generic_lambdas >= 201707L 71 size_of_v<T> != stdex::dynamic_extent and
73 return (... and
values::index<
typename collection_element<Ix, T>::type>);
74 }(std::make_index_sequence<size_of<T>::value>{}))
77 constexpr
bool index =
Namespace for collections.
Definition: collections.hpp:27
Definition for collections::collection.
Header file for code relating to values (e.g., scalars and indices)
Definition for collections::size_of.
constexpr bool value
T is a fixed or dynamic value that is reducible to a number.
Definition: value.hpp:45
Definition for collections::sized.
Definition: trait_backports.hpp:64
constexpr bool index
T is an index value.
Definition: index.hpp:62
Definition for collections::collection_element.
constexpr bool index
An object describing a collection of /ref values::index objects.
Definition: index.hpp:77