Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
Animats
· 6y ago · 0 comments
Objects as structs with function pointers? 1990 is calling. I'm not a huge C++ fan, but trying to emulate C++ concepts in C is kind of lame at this late date.
Comments
[–]
bobdobbs666
6y ago
This is pretty much the standard way to write ABI compatible plugin interfaces in C that can be easily bound to multiple other languages.
[–]
rootlocus
6y ago
Just goes to show C++ failed the zero overhead principle.
[–]
Animats
OP
6y ago
If you don't have virtual functions, a C++ object is just an struct associated with static function links.
[–]
cjwoodall
6y ago
So sad that it did...