Assign a new value to this vector.
Declared in <bslstl_vector.h>
void
assign(
size_type numElements,
VALUE_TYPE const& value);
Assign to this object the value resulting from first clearing this vector and then inserting the specified numElements copies of the specified value. If an exception is thrown, *this is left in a valid but unspecified state. Throw std::length_error if `numElements > max_size()`. This method requires that the (template parameter) type VALUE_TYPE be copy-insertable into this vector (see {Requirements on VALUE_TYPE}).
| Name | Description |
|---|---|
| numElements | number of elements to insert or assign |
| value | element value |