apply

Processes the elements of an array.

  valarray<T> apply(T func(T)) const;
  valarray<T> apply(T func(const T&)) const;
  
Remarks

This function "applies" the function specified to all the elements of an array.

Return the modified array.