Namespaces
Variants
Actions

std::valarray<T>::apply

From cppreference.com
< cpp‎ | numeric‎ | valarray
 
 
 
 
valarray<T> apply( T func(T) ) const;
valarray<T> apply( T func(const T&) ) const;

Returns a new valarray of the same size with values which are acquired by applying function func to the previous values of the elements.

Contents

[edit] Parameters

func - function to apply to the values

[edit] Return value

The resulting valarray with values acquired by applying function func.

[edit] Notes

The function can be implemented with the return type different from std::valarray. In this case, the replacement type has the following properties: