The header <initializer_list> defines one type.
Header <initializer_list> synopsis
namespace std { template<class E> class initializer_list { public: typedef E value_type; typedef const E& reference; typedef const E& const_reference; typedef size_t size_type; typedef const E* iterator; typedef const E* const_iterator; initializer_list() noexcept; size_t size() const noexcept; // number of elements const E* begin() const noexcept; // first element const E* end() const noexcept; // one past the last element }; // [support.initlist.range] initializer list range access template<class E> const E* begin(initializer_list<E> il) noexcept; template<class E> 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 ]
Effects: constructs an empty initializer_list object.
Postcondition: size() == 0
const E* begin() const noexcept;
Returns: A pointer to the beginning of the array. If size() == 0 the values of begin() and end() are unspecified but they shall be identical.
const E* end() const noexcept;
Returns: begin() + size()
Returns: The number of elements in the array.
Complexity: constant time.
template<class E> const E* begin(initializer_list<E> il) noexcept;
Returns: il.begin().
template<class E> const E* end(initializer_list<E> il) noexcept;
Returns: il.end().