Is there a library with STL functions such as std::sort() , std::binary_search() , std::lower_bound() , std::upper_bound() that accepts three-dimensional comparison predicates (which return -1 by a smaller, 0 on equal, 1 on large) instead of less predicate (true on less, false on equal or large)?
Of course, the fewer predicates can be easily made from an existing three-way predicate (for example, [](A a, B b) { return compare3(a,b)<0; } ), but this leads to an additional number of predicate calls.
source share