16 #ifndef OPENKALMAN_VALUES_SIZE_COMPARES_WITH_HPP 17 #define OPENKALMAN_VALUES_SIZE_COMPARES_WITH_HPP 30 template<
auto comp,
bool op_is_and =
false,
typename...Ords>
34 if constexpr (op_is_and)
return (... and stdex::invoke(comp, ords));
35 else return (... or stdex::invoke(comp, ords));
39 template<
typename T,
typename U, auto comp, applicability a>
41 size_compares_with_impl()
43 constexpr
bool unbt = not index<T>;
44 constexpr
bool unbu = not index<U>;
45 constexpr
bool ft = fixed_value_compares_with<T, stdex::dynamic_extent, &stdex::is_neq>;
46 constexpr
bool fu = fixed_value_compares_with<U, stdex::dynamic_extent, &stdex::is_neq>;
48 if constexpr (unbt and unbu)
50 return do_comps<comp>(stdex::partial_ordering::equivalent);
52 else if constexpr (unbu)
54 return do_comps<comp>(stdex::partial_ordering::less);
56 else if constexpr (unbt)
58 return do_comps<comp>(stdex::partial_ordering::greater);
60 else if constexpr (ft and fu)
62 #ifdef __cpp_impl_three_way_comparison 63 return stdex::invoke(comp, fixed_value_of_v<T> <=> fixed_value_of_v<U>);
68 else if constexpr (ft)
70 if constexpr (fixed_value_compares_with<T, 0>)
71 return do_comps<comp, a == applicability::guaranteed>(stdex::partial_ordering::less, stdex::partial_ordering::equivalent);
75 else if constexpr (fu)
77 if constexpr (fixed_value_compares_with<U, 0>)
78 return do_comps<comp, a == applicability::guaranteed>(stdex::partial_ordering::greater, stdex::partial_ordering::equivalent);
94 template<
typename T,
typename U, auto comp = &stdex::is_eq, applicability a = applicability::guaranteed>
98 constexpr
bool size_compares_with =
102 detail::size_compares_with_impl<T, U, comp, a>();
Definition for values::size.
The concept, trait, or restraint is permitted, but whether it applies is not necessarily known at com...
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
Definition for values::abs.
Definition: fixed-constants.hpp:23
Definition for values::fixed_value_of.
constexpr auto compare_three_way(A &&a, B &&b, const Comparison &c={})
Compare two coordinates::pattern objects lexicographically.
Definition: compare_three_way.hpp:142
Global constants relating to collections.
Basic definitions for OpenKalman as a whole.
Definition for ::fixed_value_compares_with.