cxxomfort  rel.20211024
Simple backports for C++ - https://ryan.gulix.cl/fossil.cgi/cxxomfort/
List of all members
equivalent_to< T, Ord > Struct Template Reference

Function object that performs equivalence comparison: arguments are "equivalent" if they are not less or greater than each other. Or, alternatively, if neither is less than the other. More...

Detailed Description

template<typename T, typename Ord = std::less<T>>
struct cxxomfort::library::functional::equivalent_to< T, Ord >

Function object that performs equivalence comparison: arguments are "equivalent" if they are not less or greater than each other. Or, alternatively, if neither is less than the other.

Given a functor eq:

equivalent_to<T> eq;
T foo, bar;
eq(foo,bar) == !less(foo,bar) && !greater(foo,bar) == !less(foo,bar) && !less(bar,foo)
// note the above relationship does not necessarily imply!:
eq(foo,bar) == equal_to(foo,bar)

See also: utility/functional/equal_to @ cppreference


The documentation for this struct was generated from the following file: