Is there an equivalent to the range-based `enumerate` loop from python in modern C++?

后端 未结 9 1289
终归单人心
终归单人心 2020-12-21 00:48

Is there an equivalent to the range-based enumerate loop from python in C++? I would imagine something like this.

enumerateLoop (auto counter, a         


        
9条回答
  •  执念已碎
    2020-12-21 01:32

    This question is tagged c++14, but I would like to post an answer for c++20 because there's a really beautiful solution that I posted here

提交回复
热议问题