std::valarray<T>::resize
Min standard notice:
Resizes the valarray to contain count elements and assigns value to each element.
# Declarations
void resize( std::size_t count, T value = T() );
# Parameters
count: new size of the containervalue: the value to initialize the new elements with
# Return value
(none)
# Example
#include <iostream>
#include <valarray>
int main()
{
std::valarray<int> v{1, 2, 3};
v.resize(10);
for (int n : v)
std::cout << n << ' ';
std::cout << '\n';
}