r/programminghorror • • Nov 27 '25

c C—

Post image
531 Upvotes

59 comments sorted by

View all comments

Show parent comment

8

u/TheChief275 Nov 27 '25

All to make it cleaner to appear even more magical haha. One of my previous posts actually implements actual vtables with similar wrappers (kind of hidden, but it’s why things are passed by address to print for example), but it becomes quite a bit messier quite fast

1

u/val_tuesday Nov 28 '25

Have this rattling around my head and it I can’t shake how amazing it is. It’s like the code you posted at first is the setup and the macros are the punchline.

define as . // [muted trombone goes wah wah wah]

1

u/TheChief275 Nov 28 '25

Well yeah mostly. The only complicated part was the selector mechanism and being able to pass the class name to them because it’s not part of the parameter pack