chsvlib
chsv helper source code

◆ resize() [2/3]

void resize ( std::size_t  new_size,
const ElementType &  value 
)

Changes the size of the vector copy-constructing new elements from a parameter value, if necessary. .

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 elements are copy-constructed from value at the end of the vector.
valueA value whose copy is constructed in place of the newly created elements.
See also
sbo_vector_resize_def Resizes the vector setting default values of any new elements and does not require the elements to be copy-constructible.
sbo_vector_resize_non_raii Non-RAII resize of elements, i.e. new elements are not constructed.