r/cpp • u/claimred • Apr 09 '26
0xd34df00d/you-dont-know-cpp: and neither do I
https://github.com/0xd34df00d/you-dont-know-cppSome non trivial cpp quiz style questions
155
Upvotes
r/cpp • u/claimred • Apr 09 '26
Some non trivial cpp quiz style questions
View all comments
Show parent comment
3
u/38thTimesACharm Apr 10 '26
I don't think your last sentence follows from the rest. Newer standards aren't more obscure, they're just different. And they come with features specifically designed to avoid ambiguity and confusion, along with fixes that prevent unintuitive results.
Like the aggregate init with deleted ctor example. Allowed, surprisingly, in C++17; disallowed in C++20. That's an improvement.
That's why I don't really like articles like these. Most of this stuff just doesn't come up. People write terrible C++ code all the time, but it's overwhelmingly bad because they refuse to learn new paradigms and use ancient, risky techniques from C (raw pointers, untagged unions, uninitialized out params...) instead of modern tools.
The opposite problem, relying too much on obscure corner cases in modern standards, is so rare by comparison.