Namespaces
Variants
Views
Actions

C++ concepts: MoveInsertable (since C++11)

From cppreference.com
< cpp‎ | concept
Revision as of 16:15, 4 December 2012 by Bazzy (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
 
 
 

Specifies that a rvalue of the type can be copied in uninitialized storage.

Requirements

The type T is MoveInsertable 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
rv rvalue 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, rv);

The difference with CopyInsertable is that the requirement is for an rvalue expression of type T.

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


See Also

CopyInsertable