-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
enhancementNew feature or requestNew feature or request
Description
template <class T>
concept odering_category = std::same_as<T, std::strong_ordering>
|| std::same_as<T, std::weak_ordering>
|| std::same_as<T, std::partial_ordering>;
template <class T, odering_category Alternative>
struct ordering_category_of_or
{
using type = Alternative;
};
template <std::three_way_comparable T, odering_category Alternative>
struct ordering_category_of_or<T, Alternative>
{
using type = std::compare_three_way_result_t<T>;
};
template <class T, class Alternative>
using ordering_category_of_or_t = typename ordering_category_of_or<T, Alternative>::type;May be useful.
See https://en.cppreference.com/w/cpp/utility/compare/common_comparison_category
template<class T, class Cat>
concept __ComparesAs = std::same_as<std::common_comparison_category_t<T, Cat>, Cat>;Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request