3 ms·
While you do need to manually initialize a vtable pointer, that pointer can simply point to a const struct which lives in the read-only data section. You don't
by Dwedit 4y ago
While you do need to manually initialize a vtable pointer, that pointer can simply point to a const struct which lives in the read-only data section. You don't need to allocate a new vtable with each object or anything like that.
And you can do COM objects in C without using the preprocessor at all (outside of the "are we C++ or not" condition, then you could use real classes instead)
- rzzzt 4y agoCan you emulate partial function application somehow in C or does the caller still need to supply "this" as an argument to instance methods?
- ablob 4y agoYou can emulate partial function application. You also always need to supply some kind of "this" if you don't want your data to live in static memory.