Namespaces
Variants

std:: weak_order

From cppreference.net
Utilities library
ヘッダーで定義 <compare>
inline namespace /* unspecified */ {

inline constexpr /* unspecified */ weak_order = /* unspecified */ ;

}
(C++20以降)
呼び出しシグネチャ
template < class T, class U >

requires /* see below */

constexpr std:: weak_ordering weak_order ( T && t, U && u ) noexcept ( /* see below */ ) ;

2つの値を3方向比較を使用して比較し、型 std::weak_ordering の結果を生成します。

t u を式とし、 T U がそれぞれ decltype ( ( t ) ) decltype ( ( u ) ) を表す場合、 std :: weak_order ( t, u ) は以下の式と 式等価 です:

目次

カスタマイゼーションポイントオブジェクト

名前 std::weak_order カスタマイゼーションポイントオブジェクト を表し、これは 関数オブジェクト のconstな リテラル semiregular クラス型である。詳細は CustomizationPointObject を参照のこと。

IEEE浮動小数点型の厳密弱順序

x y を同じIEEE浮動小数点型の値とし、 weak_order_less ( x, y ) を、C++標準で定義された厳密弱順序において x y に先行するかどうかを示すブーリアン結果とする。

  • x y のどちらもNaNでない場合、 weak_order_less ( x, y ) == true x < y と同値である。すなわち、等しい浮動小数点値のすべての表現は等価である。
  • x が負のNaNであり、 y が負のNaNでない場合、 weak_order_less ( x, y ) == true である。
  • x が正のNaNでなく、 y が正のNaNである場合、 weak_order_less ( x, y ) == true である。
  • x y の両方が同じ符号のNaNである場合、 ( weak_order_less ( x, y ) || weak_order_less ( y, x ) ) == false である。すなわち、同じ符号を持つすべてのNaNは等価である。

関連項目

すべての6つの演算子をサポートし、置換可能ではない3方向比較の結果型
(クラス)
3方向比較を実行し、型 std::strong_ordering の結果を生成する
(カスタマイゼーションポイントオブジェクト)
3方向比較を実行し、型 std::partial_ordering の結果を生成する
(カスタマイゼーションポイントオブジェクト)
3方向比較を実行し、型 std::weak_ordering の結果を生成する( operator <=> が利用できない場合でも)
(カスタマイゼーションポイントオブジェクト)