3 ms·
If you prefer writing: for (auto&& [i, it] : vec | std::views::enumerate) println ("{}:{}", ++i, it); instead of: foreach (i, s; vec)
by WalterBright 3mo ago
If you prefer writing:
for (auto&& [i, it] : vec | std::views::enumerate)
println ("{}:{}", ++i, it);
instead of:
foreach (i, s; vec)
writeln(i, ": ", s);
well, what can I say?
- acehreli 3mo agoWe may first need to go over what "elegant" means I guess. :)
- pjmlp 3mo agoThere is elegant when writing code by hand, and when reviewing code by AI agents.
- pjmlp 3mo agoI prefer to use the option with better market share. I am not counting characters, especially when AI completes typing for me.