# std::end(std::initializer_list)

From cppreference.com
< cpp‎ | utility‎ | initializer list

Defined in header `<initializer_list>` |  |
template< class E > const E* end( std::initializer_list<E> il ) noexcept; |  | (since C++11) (until C++14)
template< class E > constexpr const E* end( std::initializer_list<E> il ) noexcept; |  | (since C++14)

The overload of std::end for `initializer_list` returns a pointer to one past the last element of `il`.

### Parameters

il | - | an `initializer_list`

### Return value

il.end()

### Example

Run this code

    #include <iostream>
    #include <iterator>
    #include <algorithm>
    #include <initializer_list>

    int main()
    {
        std::initializer_list il = {3, 1, 4, 1, 5, 9};

        std::reverse_copy(std::begin(il),
                          std::end(il),
                          std::ostream_iterator<int>(std::cout, " "));
    }

Output:

    9 5 1 4 1 3

### See also

end | returns a pointer to one past the last element (public member function)

Retrieved from "https://en.cppreference.com/mwiki/index.php?title=cpp/utility/initializer_list/end2&oldid=142800"