valarray<T>& operator=(const valarray<T>& va);
valarray<T>& operator=(const T& x);
valarray<T>& operator=(const slice_array<T>& sa);
valarray<T>& operator=(const gslice_array<T>& ga);
valarray<T>& operator=(const mask_array<T>& ma);
valarray<T>& operator=(const indirect_array<T>& ia);
The first member operator replaces the controlled sequence with a copy of the sequence controlled by va
. The second
member operator replaces each element of the controlled sequence with a copy of x
. The remaining member operators
replace those elements of the controlled sequence selected by their arguments, which are generated only by
operator[]
. If the value of a member in the replacement controlled sequence depends on a member in the initial
controlled sequence, the result is undefined.
If the length of the controlled sequence changes, the result is generally undefined. In this implementation, however, the effect is merely to invalidate any pointers or references to elements in the controlled sequence.