16 #ifndef OPENKALMAN_COORDINATE_PATTERN_COLLECTION_COMPARES_WITH_HPP 17 #define OPENKALMAN_COORDINATE_PATTERN_COLLECTION_COMPARES_WITH_HPP 28 template<
typename T,
typename PU, auto comp, applicability a, std::
size_t i = 0>
30 pattern_collection_compares_with_iter_T()
32 if constexpr (i < collections::size_of_v<T>)
34 using Ti = std::decay_t<collections::collection_element_t<i, T>>;
35 if constexpr (compares_with<Ti, PU, comp, a>)
36 return pattern_collection_compares_with_iter_T<T, PU, comp, a, i + 1>();
47 template<
typename PT,
typename U, auto comp, applicability a, std::
size_t i = 0>
49 pattern_collection_compares_with_iter_U()
51 if constexpr (i < collections::size_of_v<U>)
53 using Ui = std::decay_t<collections::collection_element_t<i, U>>;
54 if constexpr (compares_with<PT, Ui, comp, a>)
55 return pattern_collection_compares_with_iter_U<PT, U, comp, a, i + 1>();
66 template<
typename T,
typename U, auto comp, applicability a, std::
size_t i = 0>
68 pattern_collection_compares_with_iter()
70 if constexpr (i < collections::size_of_v<T>)
72 if constexpr (i < collections::size_of_v<U>)
74 using Ti = std::decay_t<collections::collection_element_t<i, T>>;
75 using Ui = std::decay_t<collections::collection_element_t<i, U>>;
76 if constexpr (compares_with<Ti, Ui, comp, a>)
77 return pattern_collection_compares_with_iter<T, U, comp, a, i + 1>();
83 return pattern_collection_compares_with_iter_T<T, Dimensions<1>, comp, a, i>();
86 else if constexpr (i < collections::size_of_v<U>)
88 return pattern_collection_compares_with_iter_U<Dimensions<1>, U, comp, a, i>();
97 template<
typename T,
typename U, auto comp, applicability a>
99 pattern_collection_compares_with_impl()
101 constexpr
bool fixed_t = collections::sized<T> and not values::fixed_value_compares_with<collections::size_of<T>, stdex::dynamic_extent>;
102 constexpr
bool fixed_u = collections::sized<U> and not values::fixed_value_compares_with<collections::size_of<U>, stdex::dynamic_extent>;
103 if constexpr (fixed_t and fixed_u)
105 return detail::pattern_collection_compares_with_iter<T, U, comp, a>();
107 else if constexpr (fixed_t)
109 return detail::pattern_collection_compares_with_iter_T<T, stdex::ranges::range_value_t<U>, comp, a>();
111 else if constexpr (fixed_u)
113 return detail::pattern_collection_compares_with_iter_U<stdex::ranges::range_value_t<T>, U, comp, a>();
117 return compares_with<stdex::ranges::range_value_t<T>, stdex::ranges::range_value_t<U>, comp, a>;
130 template<
typename T,
typename U, auto comp = &stdex::is_eq, applicability a = applicability::guaranteed>
131 #ifdef __cpp_concepts 134 constexpr
bool pattern_collection_compares_with =
136 pattern_collection<T> and pattern_collection<U> and
137 std::is_invocable_r_v<bool, decltype(comp), stdex::partial_ordering> and
138 detail::pattern_collection_compares_with_impl<T, U, comp, a>();
Definition for pattern_collection.
Definition for compares_with.
Definition of the Dimensions class.
The namespace for features relating to coordinates::pattern object.
Definition: compares_with.hpp:25
Inclusion file for collections.
constexpr bool pattern_collection_compares_with
Compares a two coordinates::pattern_collection objects.
Definition: pattern_collection_compares_with.hpp:134