4#ifndef TETL_COMPARE_THREE_WAY_COMPAREABLE_HPP
5#define TETL_COMPARE_THREE_WAY_COMPAREABLE_HPP
7#include <etl/_compare/common_comparison_category.hpp>
8#include <etl/_compare/partial_ordering.hpp>
9#include <etl/_compare/weak_ordering.hpp>
10#include <etl/_concepts/boolean_testable.hpp>
11#include <etl/_concepts/same_as.hpp>
12#include <etl/_concepts/weakly_equality_comparable_with.hpp>
13#include <etl/_type_traits/remove_reference.hpp>
17template <
typename T,
typename Cat>
18concept compares_as = same_as<common_comparison_category_t<T, Cat>, Cat>;
21template<
typename T,
typename U>
22concept partially_ordered_with =
requires(remove_reference_t<T>
const& t, remove_reference_t<U>
const& u) {
23 { t < u } -> boolean_testable;
24 { t > u } -> boolean_testable;
25 { t <= u } -> boolean_testable;
26 { t >= u } -> boolean_testable;
27 { u < t } -> boolean_testable;
28 { u > t } -> boolean_testable;
29 { u <= t } -> boolean_testable;
30 { u >= t } -> boolean_testable;
39concept three_way_comparable =
40 weakly_equality_comparable_with<T, T> &&
41 detail::partially_ordered_with<T, T> &&
42 requires(remove_reference_t<T>
const& a, remove_reference_t<T>
const& b) {
43 { a <=> b } -> detail::compares_as<Cat>;
Definition adjacent_find.hpp:9
Definition partial_ordering.hpp:13