21 Language support library [language.support]

21.9 Initializer lists [support.initlist]

21.9.1 Header <initializer_­list> synopsis [initializer_list.syn]

namespace std {
  template<class E> class initializer_list {
    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

  // [support.initlist.range], 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;

An object of type initializer_­list<E> provides access to an array of objects of type const E. [Note: A pair of pointers or a pointer plus a length would be obvious representations for initializer_­list. initializer_­list is used to implement initializer lists as specified in [dcl.init.list]. Copying an initializer list does not copy the underlying elements. end note]

If an explicit specialization or partial specialization of initializer_­list is declared, the program is ill-formed.