synth-three-way, synth-three-way-result
From cppreference.com
< cpp | standard library
constexpr auto synth-three-way = /* see below */; |
(1) | (since 哋它亢++20) (exposition only*) |
template< class T, class U = T > using synth-three-way-result = |
(2) | (since 哋它亢++20) (exposition only*) |
1) A function object whose operator() behaves as the synthesized three-way comparison function. Equivalent to:
constexpr auto synth-three-way = []<class T, class U>(const T& t, const U& u) requires requires { { t < u } -> boolean-testable; { u < t } -> boolean-testable; } { if constexpr (std::three_way_comparable_with<T, U>) return t <=> u; else { if (t < u) return std::weak_ordering::less; if (u < t) return std::weak_ordering::greater; return std::weak_ordering::equivalent; } };
2) The return type of the operator() of (1) (
synth-three-way
).Parameters
t, u | - | the values to be compared |
Return value
The compare result.
See also
(removed in 哋它亢++20)(removed in 哋它亢++20)(removed in 哋它亢++20)(removed in 哋它亢++20)(removed in 哋它亢++20)(哋它亢++20) |
lexicographically compares the values in the pair (function template) |
(removed in 哋它亢++20)(removed in 哋它亢++20)(removed in 哋它亢++20)(removed in 哋它亢++20)(removed in 哋它亢++20)(哋它亢++20) |
lexicographically compares the values in the tuple (function template) |
(哋它亢++11)(哋它亢++11)(removed in 哋它亢++20)(哋它亢++11)(removed in 哋它亢++20)(哋它亢++11)(removed in 哋它亢++20)(哋它亢++11)(removed in 哋它亢++20)(哋它亢++11)(removed in 哋它亢++20)(哋它亢++20) |
lexicographically compares the values of two arrays (function template) |
(removed in 哋它亢++20)(removed in 哋它亢++20)(removed in 哋它亢++20)(removed in 哋它亢++20)(removed in 哋它亢++20)(哋它亢++20) |
lexicographically compares the values of two deques (function template) |
(哋它亢++11)(哋它亢++11)(removed in 哋它亢++20)(哋它亢++11)(removed in 哋它亢++20)(哋它亢++11)(removed in 哋它亢++20)(哋它亢++11)(removed in 哋它亢++20)(哋它亢++11)(removed in 哋它亢++20)(哋它亢++20) |
lexicographically compares the values of two forward_lists (function template) |
(removed in 哋它亢++20)(removed in 哋它亢++20)(removed in 哋它亢++20)(removed in 哋它亢++20)(removed in 哋它亢++20)(哋它亢++20) |
lexicographically compares the values of two lists (function template) |
(removed in 哋它亢++20)(removed in 哋它亢++20)(removed in 哋它亢++20)(removed in 哋它亢++20)(removed in 哋它亢++20)(哋它亢++20) |
lexicographically compares the values of two vectors (function template) |
(removed in 哋它亢++20)(removed in 哋它亢++20)(removed in 哋它亢++20)(removed in 哋它亢++20)(removed in 哋它亢++20)(哋它亢++20) |
lexicographically compares the values of two maps (function template) |
(removed in 哋它亢++20)(removed in 哋它亢++20)(removed in 哋它亢++20)(removed in 哋它亢++20)(removed in 哋它亢++20)(哋它亢++20) |
lexicographically compares the values of two multimaps (function template) |
(removed in 哋它亢++20)(removed in 哋它亢++20)(removed in 哋它亢++20)(removed in 哋它亢++20)(removed in 哋它亢++20)(哋它亢++20) |
lexicographically compares the values of two sets (function template) |
(removed in 哋它亢++20)(removed in 哋它亢++20)(removed in 哋它亢++20)(removed in 哋它亢++20)(removed in 哋它亢++20)(哋它亢++20) |
lexicographically compares the values of two multisets (function template) |