synth-three-way , synth-three-way-result
From cppreference.net
<
cpp
|
standard library
|
constexpr
auto
synth
-
three
-
way
=
/* 见下文 */
;
|
(1) |
(C++20 起)
( 仅用于说明* ) |
|
template
<
class
T,
class
U
=
T
>
using
synth
-
three
-
way
-
result
=
|
(2) |
(C++20 起)
( 仅用于说明* ) |
1)
一个函数对象,其
operator
(
)
行为与合成的三路比较函数相同。等价于:
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)
(1)
的
operator
(
)
的返回类型(
synth-three-way
)。
参数
| t, u | - | 待比较的值 |
返回值
比较结果。
参见
|
(在 C++20 中移除)
(在 C++20 中移除)
(在 C++20 中移除)
(在 C++20 中移除)
(在 C++20 中移除)
(C++20)
|
按字典序比较
pair
中的值
(函数模板) |
|
(在 C++20 中移除)
(在 C++20 中移除)
(在 C++20 中移除)
(在 C++20 中移除)
(在 C++20 中移除)
(C++20)
|
按字典序比较 tuple 中的值
(函数模板) |
|
(C++11)
(C++11)
(在 C++20 中移除)
(C++11)
(在 C++20 中移除)
(C++11)
(在 C++20 中移除)
(C++11)
(在 C++20 中移除)
(C++11)
(在 C++20 中移除)
(C++20)
|
按字典序比较两个
array
的值
(函数模板) |
|
(在 C++20 中移除)
(在 C++20 中移除)
(在 C++20 中移除)
(在 C++20 中移除)
(在 C++20 中移除)
(C++20)
|
按字典序比较两个
deque
的值
(函数模板) |
|
(C++11)
(C++11)
(在 C++20 中移除)
(C++11)
(在 C++20 中移除)
(C++11)
(在 C++20 中移除)
(C++11)
(在 C++20 中移除)
(C++11)
(在 C++20 中移除)
(C++20)
|
按字典序比较两个
forward_list
的值
(函数模板) |
|
(在 C++20 中移除)
(在 C++20 中移除)
(在 C++20 中移除)
(在 C++20 中移除)
(在 C++20 中移除)
(C++20)
|
按字典序比较两个
list
的值
(函数模板) |
|
(在 C++20 中移除)
(在 C++20 中移除)
(在 C++20 中移除)
(在 C++20 中移除)
(在 C++20 中移除)
(C++20)
|
按字典序比较两个
vector
的值
(函数模板) |
|
(在 C++20 中移除)
(在 C++20 中移除)
(在 C++20 中移除)
(在 C++20 中移除)
(在 C++20 中移除)
(C++20)
|
按字典序比较两个
map
的值
(函数模板) |
|
(在 C++20 中移除)
(在 C++20 中移除)
(在 C++20 中移除)
(在 C++20 中移除)
(在 C++20 中移除)
(C++20)
|
按字典序比较两个
multimap
的值
(函数模板) |