C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Array Index in Range-based For Loops

From: Thiago Macieira <thiago_at_[hidden]>
Date: Thu, 02 Mar 2023 14:01:18 -0800
On Thursday, 2 March 2023 13:47:14 PST Sebastian Wittmeier via Std-Proposals
wrote:
> for (int i = 0; auto const &e : some_container)
> DoSomeProcessing(e, i++);

Or:

    int i = 0;
    for (auto const &e : some_container)
        DoSomeProcessing(e, i++);

which is already possible.
-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
   Software Architect - Intel DCAI Cloud Engineering

Received on 2023-03-02 22:01:19