16 #ifndef OPENKALMAN_PATTERNS_COLLECTION_PATTERNS_HAVE_SAME_DIMENSION_HPP 17 #define OPENKALMAN_PATTERNS_COLLECTION_PATTERNS_HAVE_SAME_DIMENSION_HPP 30 #ifndef __cpp_concepts 31 template<
typename T,
typename =
void>
40 template<
typename T, std::
size_t N, std::
size_t i = 0>
47 if constexpr (fixed_pattern<P>)
return dimension_of_v<P>;
48 else return best_comparison_dim<T, N, i + 1>();
52 return stdex::dynamic_extent;
57 template<
typename T, std::
size_t N, applicability b,
typename = std::make_index_sequence<N>>
60 template<
typename T, std::size_t N,
applicability b, std::size_t...i>
62 : std::bool_constant<(... and values::size_compares_with<
63 dimension_of<pattern_collection_element_t<i, T>>,
64 std::integral_constant<std::size_t, best_comparison_dim<T, N>()>,
65 &stdex::is_eq, b>)> {};
68 template<
typename T, auto N, applicability b>
70 collection_patterns_have_same_dimension_impl()
72 constexpr
bool n_lt_2 = []{
96 requires { requires fixed_pattern<collections::common_collection_type_t<T>>; } or
114 #ifdef __cpp_concepts 115 template<
typename T, auto N = values::unbounded_size, applicability b = applicability::guaranteed>
120 template<typename T, std::size_t N = values::unbounded_size, applicability b = applicability::guaranteed>
121 constexpr
inline bool collection_patterns_have_same_dimension =
124 pattern_collection<T> and
125 detail::collection_patterns_have_same_dimension_impl<T, N, b>();
Definition for pattern_collection.
applicability
The applicability of a concept, trait, or restraint.
Definition: constants.hpp:35
The concept, trait, or restraint is permitted, but whether it applies is not necessarily known at com...
Definition for patterns::fixed_pattern.
constexpr bool value
T is a fixed or dynamic value that is reducible to a number.
Definition: value.hpp:45
constexpr bool collection_patterns_have_same_dimension
Specifies that the first N elements of a pattern_collection have the same dimensions.
Definition: collection_patterns_have_same_dimension.hpp:121
typename pattern_collection_element< i, T >::type pattern_collection_element_t
Helper template for collection_element.
Definition: pattern_collection_element.hpp:58
Definition: collection_patterns_have_same_dimension.hpp:32
The namespace for features relating to patterns::pattern object.
Definition: collection_compares_with.hpp:24
Inclusion file for collections.
A type reflecting an unbound size.
Definition: size.hpp:27
Definition: collection_patterns_have_same_dimension.hpp:58
constexpr bool integral
T is an integral value.
Definition: integral.hpp:47
constexpr bool fixed_value_compares_with
T has a fixed value that compares with N in a particular way based on parameter comp.
Definition: fixed_value_compares_with.hpp:74
constexpr unbounded_size_t unbounded_size
An instance of unbounded_size_t;.
Definition: size.hpp:60
Definition for patterns::get_common_pattern_collection_dimension.
Definition for collections::pattern_collection_element.
Definition for patterns::dimension_of.