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 an older version of Boost and was released in 2021. The current version is 1.90.0.
Increase the capacity to at least a certain amount.
void reserve( std::size_t new_capacity);
This increases the capacity of the array to a value that is greater than
or equal to new_capacity.
If new_capacity >
capacity(),
new memory is allocated. Otherwise, the call has no effect. The number
of elements and therefore the size()
of the container is not changed.
At most, linear in size().
Strong guarantee. Calls to memory_resource::allocate
may throw.
If new memory is allocated, all iterators including any past-the-end iterators, and all references to the elements are invalidated. Otherwise, no iterators or references are invalidated.
|
Name |
Description |
|---|---|
|
|
The new capacity of the array. |
|
Type |
Thrown On |
|---|---|
|
|
|