Increase capacity to at least newCapacity if needed.

Synopsis

Declared in <bslstl_vector.h>

void
reserve(size_type newCapacity);

Description

If an exception is thrown (other than by the move constructor of a non‐copy‐insertable value_type), *this is unaffected. Throw bsl::length_error if newCapacity > max_size(). This method requires that the (template parameter) type VALUE_TYPE be move‐insertable into this vector (see {Requirements on VALUE_TYPE}). Note that the capacity of this vector after this operation has completed may be greater than newCapacity.

Parameters

Name

Description

newCapacity

desired minimum capacity

Created with MrDocs