std::experimental::ranges::equal_to
From cppreference.com
< cpp | experimental | ranges
| Defined in header <experimental/ranges/functional>
|
||
| template <class T = void> requires /* see below */ |
(ranges TS) | |
Function object for performing comparisons. Unless specialized, invokes operator == on type T.
Parameters
| T | - | object type |
| Type requirements | ||
-T must meet one of the following requirements: EqualityComparable, Same<T, void> or BUILTIN_PTR_CMP (const T&, ==, const T&)(see below).
| ||
Member functions
| operator() |
checks if the arguments are equal (public member function) |
operator() has effects equivalent to: return equal_to<>(x, y);
| This section is incomplete Reason: add description |
Notes
In this section, BUILTIN_PTR_CMP (T, op, U) for types T and U and where op is an equality or relational operator is a boolean constant expression. BUILTIN_PTR_CMP (T, op, U) is true if and only if op in the expression declval<T>() op declval<U>() resolves to a built-in operator comparing pointers.
There is an implementation-defined strict total ordering over all pointer values of a given type. This total ordering is consistent with the partial order imposed by the builtin operators <, >, <=, and >=.
| This section is incomplete Reason: possibly move to a template and replace |
Specializations
template <> struct equal_to<void> { template <class T, class U> requires EqualityComparableWith<T, U> || BUILTIN_PTR_CMP (T, ==, U) constexpr bool operator()(T&& t, U&& u) const; typedef /* unspecified */ is_transparent; };
1) Requires:
- If the expression std::forward<T>(t) == std::forward<U>(u) results in a call to a builtin operator == comparing pointers of type
P, the conversion sequences from bothTandUtoPshall be equality-preserving.
2) Effects:
- If the expression std::forward<T>(t) == std::forward<U>(u) results in a call to a built-in operator == comparing pointers of type
P: returns false if either (the converted value of)tprecedesuoruprecedestin the implementation-defined strict total order over pointers of typePand otherwise true. - Otherwise, equivalent to: return std::forward<T>(t) == std::forward<U>(u);
| This section is incomplete Reason: need revision |
Example
| This section is incomplete Reason: no example |
See also
| function object implementing x == y (class template) |