C++ Logo

std-proposals

Advanced search

Re: [std-proposals] for ( repeat_count )

From: Pavel Vazharov <freakpv_at_[hidden]>
Date: Mon, 23 Oct 2023 13:09:02 +0300
>
>
>
>
> int main()
>
> {
>
> for (auto i : iota(10))
>
> Get();
>
>
>
> // or
>
>
>
> for_each(iota(10), [](auto i) {
>
> Get();
>
> });
>
>
>
> }
>
Doesn't `iota(10)` mean that it will start from 10 and produce unbounded
numbers?
Or I'm misunderstanding the documentation and the examples below (with the
the iota_view and take_view) -
https://en.cppreference.com/w/cpp/ranges/iota_view?

Received on 2023-10-23 10:09:13