Namespaces
Variants
Views
Actions

cpp/named req/MoveInsertable

From cppreference.com
< cpp‎ | named req
Revision as of 18:38, 31 May 2013 by P12bot (Talk | contribs)

Template:cpp/concept/title Template:cpp/concept/navbar

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

Requirements

The type T is Template:concept into the Template:concept 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 Template:concept 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

Template:concept