Emplace a newly constructed element at the end.

Synopsis

Declared in <bslstl_vector.h>

template<class... Args>
VALUE_TYPE&
emplace_back(Args&&... arguments);

Description

Append to the end of this vector a newly created value_type object, constructed by forwarding get_allocator() (if required) and the specified (variable number of) arguments to the corresponding constructor of value_type. Return a reference providing modifiable access to the inserted element. If an exception is thrown (other than by the move constructor of a non‐copy‐insertable value_type), *this is unaffected. Throw std::length_error if size() == max_size(). This method requires that the (template parameter) type VALUE_TYPE be move‐insertable into this vector and emplace‐constructible from arguments (see {Requirements on VALUE_TYPE}).

Return Value

modifiable reference to the newly emplaced element

Parameters

Name

Description

arguments

constructor arguments forwarded to the new element

Created with MrDocs