C++ still doesn't have good loop syntax

Walter Bright newshound2 at digitalmars.com
Wed Jul 15 05:29:51 UTC 2026


C++ keeps circling around doing a better syntax, but never quite close the deal. 
This means that there will be another iteration of this, but the various 
previous incarnations will have to be supported forever.

On 7/14/2026 7:45 PM, matheus wrote:
> 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