std::initializer_list<T>::begin

Obtains a pointer to the first element in the initializer list.

# Declarations

const T* begin() const noexcept;

(since C++11) (constexpr since C++14)

# Return value

A pointer to the first element in the initializer list

# Example

#include <initializer_list>
 
int main()
{
    static constexpr auto il = {42, 24};
    static_assert(*il.begin() == 0x2A);
    static_assert(il.begin()[1] == 030);
}

# See also