16 #ifndef OPENKALMAN_COLLECTIONS_UNIFORMLY_SETTABLE_HPP 17 #define OPENKALMAN_COLLECTIONS_UNIFORMLY_SETTABLE_HPP 19 #include <type_traits> 25 #if not defined(__cpp_concepts) or __cpp_generic_lambdas < 201707L 28 template<
typename C,
typename T,
typename = std::make_index_sequence<size_of_v<C>>,
typename =
void>
29 struct uniformly_settable_sized_impl : std::false_type {};
31 template<
typename C,
typename T, std::size_t...i>
32 struct uniformly_settable_sized_impl<C, T,
std::index_sequence<i...>, std::enable_if_t<(... and settable<i, C, T>)>>
36 template<
typename C,
typename =
void>
37 struct uniformly_settable_sized : std::false_type {};
39 template<
typename C,
typename T>
40 struct uniformly_settable_sized<C, T, std::enable_if_t<size_of<C>::value != dynamic_size>>
41 : uniformly_settable_sized_impl<C, T> {};
51 template<
typename C,
typename T>
52 #if defined(__cpp_concepts) and __cpp_generic_lambdas >= 201707L 55 (settable<0_uz, C, T> and settable<std::numeric_limits<std::size_t>::max() - 1_uz, C, T>)) and
57 []<std::size_t...i>(std::index_sequence<i...>) {
return (... and settable<i, C, T>); }
58 (std::make_index_sequence<size_of_v<C>>{}));
60 constexpr
bool uniformly_settable =
62 (settable<0_uz, C, T> and settable<std::numeric_limits<std::size_t>::max() - 1_uz, C, T>)) and
Namespace for collections.
Definition: collections.hpp:27
Definition: tuple_reverse.hpp:103
Definition for collections::size_of.
constexpr bool value
T is numerical value or is reducible to a numerical value.
Definition: value.hpp:31
Definition for collections::settable.
constexpr bool uniformly_settable
C is settable with type C for all indices.
Definition: uniformly_settable.hpp:60
constexpr std::size_t dynamic_size
A constant indicating that a size or index is dynamic.
Definition: global-definitions.hpp:33