# std::ranges::iota_view<W, Bound>::begin

> C++ Atlas: `cppatlas.com/w/cpp/ranges/iota_view/begin` | Source: https://en.cppreference.com/w/cpp/ranges/iota_view/begin | Domain: Ranges | Standards: C++20

Obtains an iterator to the beginning value.

## Official Specification Summary (cppreference)

```cpp
constexpr /*iterator*/ begin() const; // (since C++20)
```

Obtains an iterator to the beginning value.

### Return value

`iterator {value_ }`

### Example

```cpp
#include <iostream>
#include <ranges>

int main()
{
    auto iota{std::views::iota(2, 6)};
    auto iter{iota.begin()};
    while (iter != iota.end())
        std::cout << *iter++ << ' ';
    std::cout << '\n';
}
```

Output:

```text
2 3 4 5
```

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