Windows apps
Collapse the table of content
Expand the table of content
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.
We recommend using Visual Studio 2017


Retrieves an iterator to the element that follows the last element in the specified container.

template<class Container>
    auto end(Container& cont) 
        -> decltype(cont.end());
template<class Container>
    auto end(const Container& cont) 
        -> decltype(cont.end());
template<class Ty, class Size>
    Ty *end(Ty (&array)[Size]); 


A container.


An array of objects of type Ty.

The first two template functions return cont.end() (the first is non-constant and the second is constant).

The third template function returns array + Size.

For a code example, see begin.

Header: <iterator>

Namespace: std

© 2018 Microsoft