Parameters
- n
- Length of array.
If this is the only parameter, the elements are constructed with their default constructor.
size_t is an unsigned integral type. - val
- Value to which each of the elements is initialized.
T is the template type of valarray (the elements' type). - p
- Pointer to an array of elements. The first n elements are used as initial values for the elements in the valarray.
T is the template type of valarray (the elements' type). - x
- A valarray object.
The elements in *this are initialized to copies of the elements in x. The resulting length matches that of x. - sub
- The result of a valarray subscripting operation.
The elements in *this are initialized to copies of the elements in sub. The resulting length matches that of sub.
Example
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
|
Output:
fifth sums 100 |
See also
| valarray::operator= | Assign content (public member function) |
