C++ still doesn't have good loop syntax

matheus matheus at gmail.com
Wed Jul 15 02:45:05 UTC 2026


On Wednesday, 15 July 2026 at 01:43:56 UTC, Walter Bright wrote:
> ...

In C++23 still ugly:

auto enumerated_vec = std::views::enumerate(vec);

for (auto [i, s] : enumerated_vec ) {
         std::cout << i << ": " << s << "\n";
     }

Matheus.


More information about the Digitalmars-d mailing list