chsvlib
chsv helper source code

◆ resize() [3/3]

void resize ( std::size_t  new_size,
do_not_initialize_t   
)

Changes the size of the vector without initializing memory allocated for any new elements, if there are any. .

Parameters
new_sizeThe desired size of the vector. If the value is less than the current size of the vector, the excessive elements are removed from the end of the vector. If the value is greater than the current vector size, new memory is allocated, as required, but the elements themselves are left uninitialized.
Warning
The caller is responsible for construction of the elements in place of the respective memory locations prior to any operations upon vector and/or its elements that might involve assignment, access or destruction of the new elements.
See also
sbo_vector_resize_set Resizes the vector setting values of any new elements via their copy-construction from a parameter value.
sbo_vector_resize_def Resizes the vector setting default values of any new elements and does not require the elements to be copy-constructible.