std::initializer_list<T>::begin
From cppreference.com
< cpp | utility | initializer list
C++
Feature test macros (C++20)
Concepts library (C++20)
Metaprogramming library (C++11)
Ranges library (C++20)
Filesystem library (C++17)
Concurrency support library (C++11)
Execution control library (C++26)
Utilities library
Type support (basic types, RTTI)
Library feature-test macros (C++20)
(C++11)
(C++20)
(C++26)
(C++20)
Coroutine support (C++20)
Contract support (C++26)
(C++20)(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)(C++20)(C++20)
(C++20)(C++20)(C++20)
General utilities
Relational operators (deprecated in C++20)
(C++20)(C++20)(C++20)
(C++20)(C++20)(C++20)
(C++20)
Swap and type operations
Common vocabulary types
std::initializer_list
Member functions
Capacity
Iterators
initializer_list::begin
Non-member functions
const T* begin() const noexcept;
(since C++11) (constexpr since C++14)
Obtains a pointer to the first element in the initializer list.
If the initializer list is empty, the values of begin()
and end() are unspecified, but will be identical.
[edit] Parameters
(none)
[edit] Return value
A pointer to the first element in the initializer list
[edit] Complexity
Constant
[edit] Example
Run this code
#include <initializer_list> int main() { static constexpr auto il = {42, 24}; static_assert(*il.begin() == 0x2A); static_assert(il.begin()[1] == 030); }