Re:C++20 Improved the For-Loop Syntax
by pjmlp on Wednesday July 15, 2026 @05:21AM
(#48918228)
C++23 example,
As I keep mentioning, the features being copied, slowly erode D's relevance.
[ Parent
| on HN ]
Re:C++20 Improved the For-Loop Syntax
by WalterBright on Wednesday July 15, 2026 @01:37PM
(#48924383)
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?We may first need to go over what "elegant" means I guess. :)
There is elegant when writing code by hand, and when reviewing code by AI agents.