[valarray.range]

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

## 29.6 Numeric arrays [[numarray]](numarray#valarray.range)

### 29.6.10 valarray range access [valarray.range]

[1](#1)

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

In the begin and end function templates that follow, *unspecified*1
is a type that meets the requirements of a mutable[*Cpp17RandomAccessIterator*](random.access.iterators#:Cpp17RandomAccessIterator "24.3.5.7 Random access iterators [random.access.iterators]") ([[random.access.iterators]](random.access.iterators "24.3.5.7 Random access iterators"))
and models [contiguous_iterator](iterator.concept.contiguous#concept:contiguous_iterator "24.3.4.14 Concept contiguous_­iterator [iterator.concept.contiguous]") ([[iterator.concept.contiguous]](iterator.concept.contiguous "24.3.4.14 Concept contiguous_­iterator")),
whose value_type is the template
parameter T and whose reference type is T&[.](#1.sentence-1)

*unspecified*2 is a
type that meets the requirements of a constant[*Cpp17RandomAccessIterator*](random.access.iterators#:Cpp17RandomAccessIterator "24.3.5.7 Random access iterators [random.access.iterators]") and models [contiguous_iterator](iterator.concept.contiguous#concept:contiguous_iterator "24.3.4.14 Concept contiguous_­iterator [iterator.concept.contiguous]"),
whose value_type is the template
parameter T and whose reference type is const T&[.](#1.sentence-2)

[2](#2)

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

The iterators returned by begin and end for an array
are guaranteed to be valid until the member function[resize(size_t, T)](valarray.members#lib:valarray,resize "29.6.2.8 Member functions [valarray.members]") is called for that
array or until the lifetime of that array ends, whichever happens
first[.](#2.sentence-1)

[ð](#lib:begin,valarray)

`template<class T> unspecified1 begin(valarray<T>& v);
template<class T> unspecified2 begin(const valarray<T>& v);
`

[3](#3)

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

*Returns*: An iterator referencing the first value in the array[.](#3.sentence-1)

[ð](#lib:end,valarray)

`template<class T> unspecified1 end(valarray<T>& v);
template<class T> unspecified2 end(const valarray<T>& v);
`

[4](#4)

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

*Returns*: An iterator referencing one past the last value in the array[.](#4.sentence-1)
