Beautiful Type Erasure with C++26 Reflection

92 points16 comments7 hours ago
RyanJK5

Try it on Compiler Explorer: https://godbolt.org/z/91dj5jeGW

Check out the source code: https://github.com/RyanJK5/rjk-duck

show comments
Leherenn

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?

show comments
feverzsj

Reflections, especially static ones, are horrible for debugging.

show comments
rob74

The things people describe as "beautiful" never cease to amaze me...

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

show comments
semiinfinitely

this is the most disgusting programming language ever invented!

show comments
briandilley

are we still hand writing code?

show comments