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) 두 개의 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 객체를 값과 비교할 때, 비교 결과는 다음과 같이 정의됩니다:
Operator ind is valueless ind is not valueless
operator == false * ind == value
operator <=> std :: strong_ordering :: less synth-three-way  ( * ind, value )
3) 표현식 * ind == value 이 형성되지 않거나 그 결과가 bool 로 변환 가능하지 않을 경우, 프로그램은 형성되지 않습니다.

매개변수

lhs, rhs, ind - 비교할 indirect 객체
value - 소유된 값과 비교할 값

반환값

위에서 설명한 바와 같습니다.

예제