26 Numerics library [numerics]

26.6 Numeric arrays [numarray]

26.6.5 Class template slice_array[template.slice.array]

26.6.5.1 Class template slice_array overview [template.slice.array.overview]

```namespace std {
template <class T> class slice_array {
public:
typedef T value_type;

void operator=  (const valarray<T>&) const;
void operator*= (const valarray<T>&) const;
void operator/= (const valarray<T>&) const;
void operator%= (const valarray<T>&) const;
void operator+= (const valarray<T>&) const;
void operator-= (const valarray<T>&) const;
void operator^= (const valarray<T>&) const;
void operator&= (const valarray<T>&) const;
void operator|= (const valarray<T>&) const;
void operator<<=(const valarray<T>&) const;
void operator>>=(const valarray<T>&) const;

slice_array(const slice_array&);
~slice_array();
const slice_array& operator=(const slice_array&) const;
void operator=(const T&) const;

slice_array() = delete;       // as implied by declaring copy constructor above
};
}
```

The slice_array template is a helper template used by the slice subscript operator

```slice_array<T> valarray<T>::operator[](slice);
```

It has reference semantics to a subset of an array specified by a slice object.

Example: The expression a[slice(1, 5, 3)] = b; has the effect of assigning the elements of b to a slice of the elements in a. For the slice shown, the elements selected from a are 1, 4, ..., 13.  — end example ]

26.6.5.2slice_array assignment [slice.arr.assign]

``` void operator=(const valarray<T>&) const; const slice_array& operator=(const slice_array&) const; ```

These assignment operators have reference semantics, assigning the values of the argument array elements to selected elements of the valarray<T> object to which the slice_array object refers.

26.6.5.3slice_array computed assignment [slice.arr.comp.assign]

``` void operator*= (const valarray<T>&) const; void operator/= (const valarray<T>&) const; void operator%= (const valarray<T>&) const; void operator+= (const valarray<T>&) const; void operator-= (const valarray<T>&) const; void operator^= (const valarray<T>&) const; void operator&= (const valarray<T>&) const; void operator|= (const valarray<T>&) const; void operator<<=(const valarray<T>&) const; void operator>>=(const valarray<T>&) const; ```

These computed assignments have reference semantics, applying the indicated operation to the elements of the argument array and selected elements of the valarray<T> object to which the slice_array object refers.

26.6.5.4slice_array fill function [slice.arr.fill]

``` void operator=(const T&) const; ```

This function has reference semantics, assigning the value of its argument to the elements of the valarray<T> object to which the slice_array object refers.