table of contents
| std::ranges::iota_view::begin(3) | C++ Standard Libary | std::ranges::iota_view::begin(3) |
NAME¶
std::ranges::iota_view::begin - std::ranges::iota_view::begin
Synopsis¶
constexpr /*iterator*/ begin() const; (since C++20)
Obtains an iterator to the beginning value.
Return value¶
iterator {value_ }
Example¶
// Run this code
#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:¶
2 3 4 5
| 2026.11.10 | http://cppreference.com |