std::partial_order
来自cppreference.com
                    
                                        
                    
                    
                                                            
                    |   定义于头文件  <compare>
  | 
||
|   inline namespace /* unspecified */ {     inline constexpr /* unspecified */ partial_order = /* unspecified */;  | 
(C++20 起) | |
|   调用签名  | 
||
|   template< class T, class U >     requires /* see below */  | 
||
用三路比较比较二个值并产生 std::partial_ordering 类型结果。
设 t 与 u 为表达式而 T 与 U 分别代表 decltype((t)) 与 decltype((u)) ,则 std::partial_order(t, u) 表达式等价于:
-  若 std::is_same_v<std::decay_t<T>, std::decay_t<U>> == true :
-  std::partial_ordering(partial_order(t, u)) ,若它在不包含 
std::partial_order的声明的语境中进行重载决议的情况下为良构的表达式, - 否则为 std::partial_ordering(std::compare_three_way()(t, u)) ,若它为良构,
 - 否则为 std::partial_ordering(std::weak_order(t, u)) ,若它为良构,
 - 否则该表示为非良构,这能在出现于模板实例化的立即语境时导致替换失败。
 
 -  std::partial_ordering(partial_order(t, u)) ,若它在不包含 
 - 否则 std::partial_order(t, u) 为非良构。
 
表达式等价
表达式 e 表达式等价于表达式 f ,若 e 与 f 拥有相同效果,均为潜在抛出或均非潜在抛出(即 noexcept(e) == noexcept(f) ),且均为常量子表达式或均非常量子表达式。
定制点对象
名字 std::partial_order 代表一个定制点对象,它是字面 semiregular 类类型(为说明目的以 partial_order_ftor 表示)的 const 函数对象。partial_order_ftor 的所有实例均相等。从而能自由地复制 std::partial_order ,且能交替使用其副本。
给定类型集合 Args... ,若 std::declval<Args>()... 满足上面对于 std::partial_order 的参数要求,则 partial_order_ftor 将满足 std::invocable<const partial_order_ftor&, Args...> 。否则, partial_order_ftor 的函数调用运算符不参与重载决议。
注解
示例
| 本节未完成 原因:暂无示例  | 
参阅
|    (C++20)  | 
  三路比较的结果类型,支持所有 6 种运算符,不可替换,并允许不可比较的值  (类)  | 
|    (C++20)  | 
  进行三路比较并产生 std::strong_ordering 类型结果 (定制点对象)  | 
|    (C++20)  | 
  进行三路比较并产生 std::weak_ordering 类型结果 (定制点对象)  | 
  进行三路比较并产生 std::partial_ordering 类型的结果,即使 operator<=> 不可用 (定制点对象)  |