# std::begin(std::initializer_list)

> C++ Atlas: `cppatlas.com/w/cpp/utility/initializer_list/begin2` | Source: https://en.cppreference.com/w/cpp/utility/initializer_list/begin2 | Domain: Utility | Standards: C++11, C++14

The overload of std::begin for initializer_list returns a pointer to the first element of il.

## Official Specification Summary (cppreference)

```cpp
// Defined in header <initializer_list>

template< class E >
const E* begin( std::initializer_list<E> il ) noexcept; // (since C++11) (constexpr since C++14)
```

The overload of `std::begin` for `initializer_list` returns a pointer to the first element of `il`.

### Parameters

- `il` - an `initializer_list`

### Return value

`il.begin()`

### Example

```cpp
#include <algorithm>
#include <initializer_list>
#include <iostream>
#include <iterator>

int main()
{
    std::initializer_list ϕ = {'1', '.', '6', '1', '8', '0'};

    std::copy(std::begin(ϕ),
              std::end(ϕ),
              std::ostream_iterator<char>(std::cout, ""));

    std::cout << '\n';
}
```

Output:

```text
1.6180
```

### See also

- [`begin`](https://en.cppreference.com/w/cpp/utility/initializer_list/begin): returns a pointer to the first element (public member function)

---
Attribution: content from https://en.cppreference.com/w/cpp/utility/initializer_list/begin2 (cppreference.com), licensed under CC-BY-SA 3.0 and GFDL. Modified: converted to markdown, study notes added. Offline snapshot of 9 February 2025.