Namespaces
Variants

operator==, <=> (std::indirect)

From cppreference.net
Memory management library
( exposition only* )
Allocators
Uninitialized memory algorithms
Constrained uninitialized memory algorithms
Memory resources
Uninitialized storage (until C++20)
( until C++20* )
( until C++20* )
( until C++20* )

Garbage collector support (until C++23)
(C++11) (until C++23)
(C++11) (until C++23)
(C++11) (until C++23)
(C++11) (until C++23)
(C++11) (until C++23)
(C++11) (until C++23)
ヘッダーで定義 <memory>
二つの indirect オブジェクトを比較
template < class U, class A >

constexpr bool operator == ( const indirect & lhs, const indirect < U, A > & rhs )

noexcept ( noexcept ( * lhs == * rhs ) ) ;
(1) (C++26以降)
template < class U, class A >

constexpr /*synth-three-way-result*/ < T, U >

operator <=> ( const indirect & lhs, const indirect < U, A > & rhs ) ;
(2) (C++26以降)
indirect オブジェクトと値を比較
template < class U >

constexpr bool operator == ( const indirect & ind, const U & value )

noexcept ( noexcept ( * lhs == value ) ) ;
(3) (C++26以降)
template < class U >

constexpr /*synth-three-way-result*/ < T, U >

operator <=> ( const indirect & ind, const U & value ) ;
(4) (C++26以降)

indirect オブジェクトに対する比較操作を実行します。

/*synth-three-way-result*/ の定義については、 synth-three-way-result を参照してください。

1,2) 2つの indirect オブジェクトを比較します。比較結果は以下のように定義されます:
lhs valueless not valueless
rhs valueless not valueless valueless not valueless
operator == true false false * lhs == * rhs
operator <=> ! lhs. valueless_after_move ( ) <=>
! rhs. valueless_after_move ( )
synth-three-way
( * lhs, * rhs )
1) * lhs == * rhs が不適格であるか、その結果が bool に変換できない場合、プログラムは不適格となります。
3,4) indirect オブジェクトと値を比較する場合、比較結果は以下のように定義されます:
演算子 ind が値を持たない場合 ind が値を持つ場合
operator == false * ind == value
operator <=> std :: strong_ordering :: less synth-three-way  ( * ind, value )
3) * ind == value が不適格な形式であるか、その結果が bool に変換できない場合、プログラムは不適格となる。

パラメータ

lhs, rhs, ind - 比較対象の indirect オブジェクト
value - 所有値と比較する値

戻り値

上記の通り。