Standard library header <initializer_list> - cppreference.com

##### cppreference.com

##### Search

Create account

##### Namespaces

- Page
- Discussion

##### Variants

##### Views

- View
- Edit
- History

##### Actions

# Standard library header <initializer_list>

From cppreference.com
< cpp‎ | header

This header is part of the utility library.

### [edit] Classes

std::initializer_list(C++11) | (class template)

### [edit] Functions

std::begin(std::initializer_list) (C++11) | specializes std::begin (function template) [edit]
std::end(std::initializer_list) (C++11) | specializes std::end (function template) [edit]

### [edit] Synopsis

    namespace std {
      template<class E> class initializer_list {
      public:
        using value_type = E;
        using reference = const E&;
        using const_reference = const E&;
        using size_type = size_t;
        using iterator = const E*;
        using const_iterator = const E*;
        constexpr initializer_list() noexcept;
        constexpr size_t size() const noexcept; // number of elements
        constexpr const E* begin() const noexcept; // first element
        constexpr const E* end() const noexcept; // one past the last element
      };
      // initializer list range access
      template<class E> constexpr const E* begin(initializer_list<E> il) noexcept;
      template<class E> constexpr const E* end(initializer_list<E> il) noexcept;
    }

Retrieved from "http://en.cppreference.com/mwiki/index.php?title=cpp/header/initializer_list&oldid=92025"