Namespaces
Variants
Views
Actions

C++ concepts: CopyInsertable

From cppreference.com

Specifies that an instance of the type can be copy-constructed in-place, in uninitialized storage.

[edit] Requirements

The type T is CopyInsertable into the container X if, given

A the allocator type defined as X::allocator_type
m the lvalue of type A obtained from X::get_allocator()
p the pointer of type T* prepared by the container
v expression of type T, provided as the argument to push_back(), etc

the following expression is well-formed:

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

Note that if A is std::allocator<T>, then this will call placement-new, as by ::new((void*)p) T(v)