Namespaces
Variants

std::allocator_traits<Alloc>:: select_on_container_copy_construction

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>
static Alloc select_on_container_copy_construction ( const Alloc & a ) ;
(C++11부터)
(C++20부터 constexpr)

가능한 경우, a. select_on_container_copy_construction ( ) 를 호출하여 할당자 a 의 복사 생성된 버전을 획득합니다. 위 방법이 불가능한 경우(예: Alloc select_on_container_copy_construction() 멤버 함수가 없는 경우), 수정되지 않은 a 를 반환합니다.

이 함수는 모든 표준 라이브러리 컨테이너의 복사 생성자에 의해 호출됩니다. 이를 통해 생성자 인수가 사용하는 할당자가 컨테이너가 복사되고 있음을 인지하고 필요한 경우 상태를 수정할 수 있습니다.

매개변수

a - 컨테이너 복사 생성자에 인수로 전달된 표준 컨테이너가 사용하는 할당자

반환값

복사 생성된 표준 컨테이너들이 사용할 할당자입니다.

참고 항목

scoped_allocator_adaptor 의 상태와 모든 할당자를 복사합니다
( std::scoped_allocator_adaptor<OuterAlloc,InnerAlloc...>
공개 멤버 함수)