Namespaces
Variants

std:: allocator_arg, std:: allocator_arg_t

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>
struct allocator_arg_t { explicit allocator_arg_t ( ) = default ; } ;
(1) (C++11부터)
constexpr std:: allocator_arg_t allocator_arg { } ;
(2) (C++11부터)
(C++17부터 인라인)
1) std::allocator_arg_t 는 allocator-aware 객체들의 생성자와 멤버 함수 오버로드를 구분하기 위해 사용되는 빈 클래스 타입입니다. 여기에는 std::tuple , std::function , std::packaged_task , (C++17까지) 그리고 std::promise 가 포함됩니다.
2) std::allocator_arg 는 이러한 허용된 타입들의 생성자와 멤버 함수에 전달될 수 있는 ( 1 ) 의 인스턴스입니다.

결함 보고서

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

DR 적용 대상 게시된 동작 올바른 동작
LWG 2510 C++11 기본 생성자가 non-explicit였으며, 이로 인해 모호성이 발생할 수 있었음 explicit로 변경됨

참고 항목

지정된 타입이 uses-allocator 생성 방식을 지원하는지 확인합니다
(클래스 템플릿)