Sets val as the value for all the elements in the array object.
Parameters
val
Value to fill the array with.
Member type value_type is the type of the elements in the container, defined in array as an alias of its first template parameter (T).
Return value
none
Example
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
// array::fill example
#include <iostream>
#include <array>
int main () {
std::array<int,6> myarray;
myarray.fill(5);
std::cout << "myarray contains:";
for ( int& x : myarray) { std::cout << ' ' << x; }
std::cout << '\n';
return 0;
}