C++ Logo

STD-PROPOSALS

Advanced search

Subject: Re: [std-proposals] count-based for loop
From: Justin Bassett (jbassett271_at_[hidden])
Date: 2019-08-29 14:04:00


On Thu, Aug 29, 2019, 10:48 AM Matthew Woehlke via Std-Proposals <
std-proposals_at_[hidden]> wrote:

>
> That reminds me, though... what is wrong with:
>
> for (auto const i : std::iota(x))
>
> ...? (IOW, add a single-argument overload that counts from 0 up to the
> argument?)
>

If it hasn't changed since it's been last updated on cppreference, iota(x)
is an infinite range counting up from x: x, x+1, x+2, ...

--Justin

>



STD-PROPOSALS list run by herb.sutter at gmail.com

Standard Proposals Archives on Google Groups