Stroika Library 3.0d16
 
Loading...
Searching...
No Matches
Stroika::Foundation::Common::IPotentiallyComparer Concept Reference

#include <Compare.h>

Concept definition

template<typename COMPARER, typename ARG_T>
concept Stroika::Foundation::Common::IPotentiallyComparer = relation<COMPARER, ARG_T, ARG_T> or (same_as<COMPARER, compare_three_way> and three_way_comparable<ARG_T>) or
(regular_invocable<COMPARER, ARG_T, ARG_T> and requires (COMPARER c, ARG_T l, ARG_T r) {
{ c (l, r) } -> convertible_to<strong_ordering>;
})

Detailed Description

This concept checks if the given function argument (COMPARER) appears to compare 'ARG_T's and return true/false. This doesn't require that that you've annotated the comparer, so it can false-positive (like mixing up an equality comparer for an in-order comparer).

See also
IComparer or IEqualsComparer for something stricter

Definition at line 156 of file Compare.h.