A "little" easier is the appropriate term. The OP asked for virtual
destructor functionality, which requires some form of virtual dispatch
mechanism. Doable, but ugly.
IMO, using C function pointers are not that much drastically worse than
using C++ virtual methods.
yes, one either needs to use a vtable, or assign all of the "methods" on
object construction, but this isn't really a huge issue IMO.
say, we have something like:
BaseClass *obj;
....
obj=(BaseClass *)FooClass_New(); //FooClass extends BaseClass
....
BaseClass_Delete(obj); //internally calls FooClass destructor
with, say:
void BaseClass_Delete(BaseClass *obj)
{ obj->vt->Destroy(obj); myapp_free(obj); }
but, hell, it works...