std::end(std::valarray) (3) - Linux Manuals

std::end(std::valarray): std::end(std::valarray)

NAME

std::end(std::valarray) - std::end(std::valarray)

Synopsis


template< class T > (1) (since C++11)
/*unspecified1*/ end( valarray<T>& v );
template< class T > (2) (since C++11)
/*unspecified2*/ end( const valarray<T>& v );


The overload of std::end for valarray returns an iterator of unspecified type referring to the one past the last element in the numeric array.
1) The return type meets the requirements of mutable LegacyRandomAccessIterator.
2) The return type meets the requirements of constant LegacyRandomAccessIterator.
The iterator obtained from this function template is invalidated when the member function resize() is called on the array v or when the lifetime of v ends, whichever comes first.

Parameters


v - a numeric array

Return value


Iterator to one past the last value in the numeric array.

Exceptions


(none)

Notes


Unlike other functions that take std::valarray arguments, end() cannot accept the replacement types (such as the types produced by expression templates) that may be returned from expressions involving valarrays: std::end(v1 + v2) is not portable, std::end(std::valarray<T>(v1 + v2)) has to be used instead.
The intent of this function is to allow range_for_loops to work with valarrays, not to provide container semantics.

Example


 This section is incomplete
 Reason: no example

See also


std::begin(std::valarray) specializes std::begin
                          (function template)
(C++11)