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

From cppreference.com
< cpp‎ | concept
 
 
 

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

[edit] 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);

And after evaluation, the value of *p is equivalent to the value formerly held by rv (rv remains valid, but unspecified)

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).

[edit] See Also

CopyInsertable