array::push_back

Add an element to the end.

Synopsis

void
push_back(
    value const& jv); (1)

void
push_back(
    value&& jv); (2)

Description

Insert a new element at the end of the container. (1) copy-constructs the new element from jv, (2) move-constructs from jv.

If capacity() < size() + 1, a reallocation occurs first, and all iterators and references are invalidated. Any past-the-end iterators are always invalidated.

The new element will be constructed using the container’s associated boost::container::pmr::memory_resource.

Complexity

Amortized constant.

Exception Safety

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

Parameters

Name Description

jv

The value to insert.