2 ms·
> We designed what I call "false object pattern." It used a C struct to simulate a dynamic object, complete with function pointers (that could be replaced, in i
by PaulDavisThe1st 2y ago
> We designed what I call "false object pattern." It used a C struct to simulate a dynamic object, complete with function pointers (that could be replaced, in implementation), and that gave us a "sorta/kinda" vtable.
You were not alone in this. It is the basis of glib's GObject which is at the bottom of the stack for all of GTK and GNOME.
- synergy20 2y agosadly glib doesn't have error handling for memory errors,it will just crash. otherwise it can be widely used as a oop c
- ChrisMarshallNY 2y agoI got the idea from Apple's QuickDraw GX. It used a similar pattern.