```
void swap(valarray& v) noexcept;
```

```
size_t size() const;
```

```
T sum() const;
```

Requires: size() > 0. This function may only be instantiated for a type T to which operator+= can be applied.

Returns: The sum of all the elements of the array. If the array has length 1, returns the value of element 0. Otherwise, the returned value is calculated by applying operator+= to a copy of an element of the array and all other elements of the array in an unspecified order.

```
T min() const;
```

Returns: The minimum value contained in *this. For an array of length 1, the value of element 0 is returned. For all other array lengths, the determination is made using operator<.

```
T max() const;
```

Returns: The maximum value contained in *this. For an array of length 1, the value of element 0 is returned. For all other array lengths, the determination is made using operator<.

```
valarray shift(int n) const;
```

Returns: A valarray of length size(), each of whose elements I is (*this)[I + n] if I + n is non-negative and less than size(), otherwise T(). [ Note: If element zero is taken as the leftmost element, a positive value of n shifts the elements left n places, with zero fill. — end note ]

[ Example: If the argument has the value -2, the first two elements of the result will be value-initialized; the third element of the result will be assigned the value of the first element of the argument; etc. — end example ]

```
valarray cshift(int n) const;
```

Returns: A valarray of length size() that is a circular shift of *this. If element zero is taken as the leftmost element, a non-negative value of n shifts the elements circularly left n places and a negative value of n shifts the elements circularly right −n places.

```
valarray apply(T func(T)) const;
valarray apply(T func(const T&)) const;
```

Returns: A valarray whose length is size(). Each element of the returned array is assigned the value returned by applying the argument function to the corresponding element of *this.

```
void resize(size_t sz, T c = T());
```