[template.slice.array.overview]

# 29 Numerics library [[numerics]](./#numerics)

## 29.6 Numeric arrays [[numarray]](numarray#template.slice.array.overview)

### 29.6.5 Class template slice_array [[template.slice.array]](template.slice.array#overview)

#### 29.6.5.1 Overview [template.slice.array.overview]

[ð](#lib:slice_array)

namespace std {template<class T> class slice_array {public:using value_type = T; 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};}

[1](#1)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L8504)

This template is a helper template used by theslice subscript operatorslice_array<T> valarray<T>::operator[](slice);

[2](#2)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L8511)

It has reference semantics to a subset of an array specified by aslice object[.](#2.sentence-1)

[*Example [1](#example-1)*:

The expressiona[slice(1, 5, 3)] = b; has the effect of assigning the elements ofb to a slice of the elements ina[.](#2.sentence-2)

For the slice shown, the elements
selected froma are 1,4,â¦,13[.](#2.sentence-3)

â *end example*]
