Hacker News new | ask | show | jobs
by aaaaaaaaaaab 1754 days ago
I think you're misinterpreting GP's code. It is a vtable, hence the static const. There would be a pointer in each struct "instance" to this static vtable, thus the same double indirection would occcur as in C++.
2 comments

Plus this was a discussion about conceptual models and "what counts as OO", not the specific details and optimisation possibilities of the implementation.
OP mimic'd C++ vtables. But in C you can do better and inline them. I mostly inline them for performance reasons.