Class valarray provides six assignment operations. These are: assignment from another valarray, assignment from a T value, and assignment from any of the four auxiliary classes returned by the subset operations.
Assignment from a T value assigns that value to all elements in the valarray. Assignment from another valarray or any of the auxiliary classes assigns corresponding elements from the one to the other. In any case, the left- and right-hand- side arrays must be equal in length.