template<class T>
concept boolean-testable-impl = convertible_to<T, bool>; // exposition only
template<class T>
concept boolean-testable = // exposition only
boolean-testable-impl<T> && requires (T&& t) {
{ !std::forward<T>(t) } -> boolean-testable-impl;
};
template<class T, class U>
concept weakly-equality-comparable-with = // exposition only
requires(const remove_reference_t<T>& t,
const remove_reference_t<U>& u) {
{ t == u } -> boolean-testable;
{ t != u } -> boolean-testable;
{ u == t } -> boolean-testable;
{ u != t } -> boolean-testable;
};
template<class T>
concept equality_comparable = weakly-equality-comparable-with<T, T>;
template<class T, class U>
concept equality_comparable_with =
equality_comparable<T> && equality_comparable<U> &&
common_reference_with<const remove_reference_t<T>&, const remove_reference_t<U>&> &&
equality_comparable<
common_reference_t<
const remove_reference_t<T>&,
const remove_reference_t<U>&>> &&
weakly-equality-comparable-with<T, U>;
template<class T>
concept totally_ordered =
equality_comparable<T> && partially-ordered-with<T, T>;
template<class T, class U>
concept totally_ordered_with =
totally_ordered<T> && totally_ordered<U> &&
equality_comparable_with<T, U> &&
totally_ordered<
common_reference_t<
const remove_reference_t<T>&,
const remove_reference_t<U>&>> &&
partially-ordered-with<T, U>;