Namespaces
Variants

C++ named requirements: EmplaceConstructible (since C++11)

From cppreference.net
C++ named requirements

주어진 할당자를 사용하여 초기화되지 않은 저장 공간에서 주어진 인수 집합으로 해당 타입의 객체를 생성할 수 있음을 지정합니다.

요구사항

타입 T 는 인수 args 로부터 Container X (그의 value_type T 와 동일한) 안으로 EmplaceConstructible 입니다, 만약 주어진다면

A 할당자 타입
m 타입 A 의 lvalue
p 컨테이너가 준비한 T* 타입의 포인터
args 0개 이상의 인수들

여기서 X::allocator_type std:: allocator_traits < A > :: rebind_alloc < T > 와 동일합니다,

다음 표현식은 올바른 형식입니다:

std::allocator_traits<A>::construct(m, p, args);

만약 X 가 allocator-aware가 아니거나 std::basic_string 특수화인 경우, 이 용어는 A std::allocator<T> 인 것처럼 정의되지만, allocator 객체를 생성할 필요가 없으며 std::allocator 의 사용자 정의 특수화는 인스턴스화되지 않습니다.

참고 사항

C++23 이전까지 std::basic_string 요소를 생성할 때 사용자 정의 construct 를 사용해야 하지만, 모든 구현체는 기본 메커니즘만 사용했습니다. 이 요구사항은 기존 관행과 일치하도록 P1072R10 에 의해 수정되었습니다.

참고 항목

CopyInsertable
MoveInsertable