25 comments

[ 4.3 ms ] story [ 57.5 ms ] thread
(comment deleted)
(comment deleted)
The things people describe as "beautiful" never cease to amaze me...

...but, as they say, beauty is in the eye of the beholder!

Yes unfortunately, C++ has a long history of features that were supposed to be much more limited than how they ended up being used - but engineers ended up finding holes in these fences, and that's how we ended up with things like SFINAE and weird compile time code execution methods.

People ended up getting celebrated for their cleverness and not horrified by the abuse of good taste, and many of these tricks appeared in core C++ libraries like Boost.

So doing stuff like this is unfortunately just part of C++ culture, and allows you to emulate proper features that using a C++ standard that's at least a decade older.

Reflections, especially static ones, are horrible for debugging.
I get a heart attack whenever I have to view core file from a decently complicated C++ program. The amount of template-in-a-template-in-a-template...(and this continues for some time) is not so readable to me. Maybe it is just me.
IDEs like CLion now have compile time visual debuggers.
What's compilation time like when using it?

I see there's an issue in the tracker to get more accurate data, and since it's using an under dev feature in compilers, it's not going to be definitive, but any rough numbers?

in the first example:

```

10: rjk::duck<Container> c{std::vector<int>{1, 2, 3}};

11: c.size(); // 3

12:

13: c = std::string{"hello"};

```

Does the assignment on line 13 call the destrucor for the vector of ints created on line 10?

An include with a HTTP URL is a scary abomination straight put of hell. Please tell me that this is a compiler explorer specialty (which would still be cursed, but in a cool way) and not a GCC feature (which would be an absolute nightmare).
this is the most disgusting programming language ever invented!
I think that is perl, but I share what you mean, as more features they add, as uglyer it gets.
> If you’ve ever tried using type erasure for something more complicated than std::any or std::function, you’ve either written 100+ lines of easy-to-mess-up code or reached for a boilerplate-heavy library like Boost.TypeErasure or Folly.Poly

Or you just used void* and went on with your life

And lost value semantics and any hope of type safety.
I use C++ every day and this feels like an entirely different language and philosophy. I know this is the reality of C++, but I never go searching for it so when it pops up randomly my jaw drops a little.
I last used C++ in 1999 and modern C++ seems like a different language.
looks like the kind of thing that will compile for 60 seconds only to spew 10k lines of error message to your terminal because you got 1 character wrong
People writing incomprehensible slop like this is the reason why some other people felt they had to invent AI coding agents
glad to see that in the yaer of our lord 2026 c++ is still slaying, wasting gigawatts of 18yo supple brain energy on useless shit like this
This is awesome and horrendous at the same time.