| constexpr /*iterator*/ begin() const; |
(since C++20) | |
Obtains an iterator to the beginning value.
Return value
Example
#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';
}2 3 4 5Content from this page on cppreference.com, licensed under CC-BY-SA 3.0 and GFDL. Modified: restyled, site navigation removed, code windows added. Offline snapshot of 9 February 2025.