Namespaces
Variants

std:: partial_order

From cppreference.net
Utilities library
定义于头文件 <compare>
inline namespace /* 未指定 */ {

inline constexpr /* 未指定 */ partial_order = /* 未指定 */ ;

}
(C++20 起)
调用签名
template < class T, class U >

requires /* 见下文 */
constexpr std:: partial_ordering

partial_order ( T && t, U && u ) noexcept ( /* 见下文 */ ) ;

使用三路比较法比较两个值,并生成类型为 std::partial_ordering 的结果。

t u 为表达式,且 T U 分别表示 decltype ( ( t ) ) decltype ( ( u ) ) ,则 std :: partial_order ( t, u ) 表达式等价性 上等同于:

定制点对象

名称 std::partial_order 表示一个 定制点对象 ,这是一个字面量 semiregular 类类型的常量 函数对象 。详情请参阅 定制点对象

示例

参见

支持全部6种运算符、不可替换且允许不可比较值的三路比较结果类型
(类)
执行三路比较并生成 std::strong_ordering 类型的结果
(定制点对象)
(C++20)
执行三路比较并生成 std::weak_ordering 类型的结果
(定制点对象)
执行三路比较并生成 std::partial_ordering 类型的结果,即使 operator <=> 不可用
(定制点对象)