r/programmingcirclejerk • u/OorNaattaan • Nov 04 '26
Note that we’re not actually going to be using C++20 coroutines. I’m just using the co_yield keyword.
https://brevzin.github.io/c++/2026/11/04/operator-for/
68
Upvotes
35
u/al2o3cr Nov 04 '26
Token sequences + template metaprogramming would produce the most AMAZING error messages
31
u/imachug Nov 04 '26
Posting anything related to modern C++ on this subreddit is cheating at this point
57
u/dingwinger1225 Nov 04 '26
this reminds me of when I needed to split a string in c++ once and someone posted similar syntax vomit and said it's a mark of the elegance of the STL
28
u/dangerbird2 in open defiance of the Gopher Values Nov 05 '26
show this to someone in 2005 and they'd say it's Erlang or some shit
26
u/daidoji70 Nov 04 '26
Jesus I swear c++ is a disease of the mind.
3
u/itzjackybro 27d ago
This is literally reinventing Rust proc-macros.
2
u/Major_Barnulf LUMINARY IN COMPUTERSCIENCE 20d ago
It is $CURRENT_YEAR and c++ is still pioneering new ways to reinvent the for-loop