[template.mask.array.overview]

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

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

### 29.6.8 Class template mask_array [[template.mask.array]](template.mask.array#overview)

#### 29.6.8.1 Overview [template.mask.array.overview]

[ð](#lib:mask_array)

namespace std {template<class T> class mask_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;

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

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

[1](#1)

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

This template is a helper template used by the mask subscript operator:

[ð](#lib:operator%5b%5d,mask_array)

`mask_array<T> valarray<T>::operator[](const valarray<bool>&);
`

[2](#2)

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

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

Thus, the expression a[mask] = b; has the effect of assigning the elements ofb to the masked elements in a (those for which the corresponding element inmask is true)[.](#2.sentence-2)
