Namespaces
Variants

std::pmr:: operator==, std::pmr:: operator!=

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_resource>
template < class T1, class T2 >

bool operator == ( const std:: pmr :: polymorphic_allocator < T1 > & lhs,

const std:: pmr :: polymorphic_allocator < T2 > & rhs ) noexcept ;
(1) (C++17부터)
friend bool operator == ( const polymorphic_allocator & lhs,
const polymorphic_allocator & rhs ) noexcept ;
(2) (C++17부터)
template < class T1, class T2 >

bool operator ! = ( const std:: pmr :: polymorphic_allocator < T1 > & lhs,

const std:: pmr :: polymorphic_allocator < T2 > & rhs ) noexcept ;
(3) (C++17부터)
(C++20 이전)
friend bool operator ! = ( const polymorphic_allocator & lhs,
const polymorphic_allocator & rhs ) noexcept ;
(4) (C++17부터)
(C++20 이전)

두 개의 다형성 할당자를 비교합니다. 두 다형성 할당자의 기본 메모리 리소스가 동일하게 비교되면 두 할당자는 동일하게 비교됩니다.

1) 반환값 * lhs. resource ( ) == * rhs. resource ( ) .
2) (1) 와 동일하며, polymorphic_allocator 로의 변환을 허용합니다.
이 함수는 일반적인 비한정 검색 또는 한정 검색 에는 보이지 않으며, std::pmr::polymorphic_allocator가 인자의 연관 클래스일 때에만 인자 종속 검색 에 의해 발견될 수 있습니다.
3) 반환값 ! ( lhs == rhs ) .
4) (3) 과 동일하며, polymorphic_allocator 로의 변환을 허용합니다.
이 함수는 일반적인 비한정 또는 한정 검색 에는 보이지 않으며, std::pmr::polymorphic_allocator가 인자의 연관 클래스일 때에만 인자 종속 검색 에 의해서만 찾을 수 있습니다.

!= 연산자는 합성된 operator== 로부터 생성됩니다.

(C++20 이후)

매개변수

lhs, rhs - 비교할 다형적 할당자

반환값

1,2) * lhs. resource ( ) == * rhs. resource ( )
3,4) ! ( lhs == rhs )

결함 보고서

다음의 동작 변경 결함 보고서들은 이전에 발표된 C++ 표준에 소급 적용되었습니다.

DR 적용 대상 게시된 동작 올바른 동작
LWG 3683 C++17 polymorphic_allocator 는 변환 가능한 타입과 비교할 수 없었음 오버로드 추가됨