##### cppreference.com

##### Search

Create account

##### Namespaces

- Page
- Discussion

##### Variants

##### Views

- View
- Edit
- History

##### Actions

# 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`

Retrieved from "http://en.cppreference.com/mwiki/index.php?title=cpp/concept/MoveInsertable&oldid=64466"