synth-three-way, synth-three-way-result
From cppreference.com
< cpp | standard library
C++
Feature test macros (C++20)
Concepts library (C++20)
Metaprogramming library (C++11)
Ranges library (C++20)
Filesystem library (C++17)
Concurrency support library (C++11)
Execution control library (C++26)
Standard library
Customization point object (C++20)
Exposition-only entities
(C++11)
synth-three-waysynth-three-way-result
(C++20)(C++20)
constexpr auto synth-three-way = /* see below */;
(1)
(since C++20) (exposition only*)
template< class T, class U = T >
(2)
(since C++20) using synth-three-way-result =
(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
).[edit] Parameters
t, u
-
the values to be compared
[edit] Return value
The compare result.
[edit] See also
(removed in C++20)(removed in C++20)(removed in C++20)(removed in C++20)(removed in C++20)(C++20)
pair
(function template) [edit]
(removed in C++20)(removed in C++20)(removed in C++20)(removed in C++20)(removed in C++20)(C++20)
(function template) [edit]
(C++11)(C++11)(removed in C++20)(C++11)(removed in C++20)(C++11)(removed in C++20)(C++11)(removed in C++20)(C++11)(removed in C++20)(C++20)
array
s (function template) [edit]
(removed in C++20)(removed in C++20)(removed in C++20)(removed in C++20)(removed in C++20)(C++20)
deque
s (function template) [edit]
(C++11)(C++11)(removed in C++20)(C++11)(removed in C++20)(C++11)(removed in C++20)(C++11)(removed in C++20)(C++11)(removed in C++20)(C++20)
forward_list
s (function template) [edit]
(removed in C++20)(removed in C++20)(removed in C++20)(removed in C++20)(removed in C++20)(C++20)
list
s (function template) [edit]
(removed in C++20)(removed in C++20)(removed in C++20)(removed in C++20)(removed in C++20)(C++20)
vector
s (function template) [edit]
(removed in C++20)(removed in C++20)(removed in C++20)(removed in C++20)(removed in C++20)(C++20)
map
s (function template) [edit]
(removed in C++20)(removed in C++20)(removed in C++20)(removed in C++20)(removed in C++20)(C++20)
multimap
s (function template) [edit]
(removed in C++20)(removed in C++20)(removed in C++20)(removed in C++20)(removed in C++20)(C++20)
set
s (function template) [edit]
(removed in C++20)(removed in C++20)(removed in C++20)(removed in C++20)(removed in C++20)(C++20)
multiset
s (function template) [edit]