logoalt Hacker News

Beautiful Type Erasure with C++26 Reflection

83 pointsby RyanJK5today at 12:40 PM33 commentsview on HN

Comments

RyanJK5today at 12:42 PM

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

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

show 2 replies
Leherenntoday at 2:21 PM

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 1 reply
feverzsjtoday at 1:01 PM

Reflections, especially static ones, are horrible for debugging.

show 2 replies
rob74today at 12:54 PM

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

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

show 3 replies
semiinfinitelytoday at 5:33 PM

this is the most disgusting programming language ever invented!

jrw0ngtoday at 4:17 PM

[dead]

briandilleytoday at 3:09 PM

are we still hand writing code?

show 1 reply