begin

Retrieves an iterator to the first element in a specified container.

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

Parameters

  • cont
    A container.

  • array
    An array of objects of type Ty.

Return Value

The first two template functions return cont.begin().

The third template function returns &array[0].

Requirements

Header: <iterator>

Namespace: std

See Also

Reference

<iterator>

end