Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for an old version of Boost. Click here to view this page for the latest version.
PrevUpHomeNext
array::push_back (2 of 2 overloads)

Add an element to the end.

Synopsis
void
push_back(
    value&& v);
Description

This appends v to the container's elements via move-construction. If capacity() < size() + 1, a reallocation occurs first, and all iterators and references are invalidated. Any past-the-end iterators are always invalidated.

Complexity

Amortized constant.

Exception Safety

Strong guarantee. Calls to memory_resource::allocate may throw.

Parameters

Name

Description

v

The value to insert. Ownership of the value will be transferred via move construction, using the container's associated memory_resource.


PrevUpHomeNext