2 days ago,BitFlipper wrote
Edit: I can't make virtual functions static. I don't believe this will be a problem since AFAIC the virtual tables themselves are static, so it doesn't matter if the class instance moves around memory.
Virtual tables aren't static:
class myClass {
int a;
static int b;
virtual void myFunc();
myClass() {}
}
looks like this in C:
static int _myClass_b;
typedef struct
{
int m_a;
void* myFunc
} MyClass;
void _myClass(MyClass* cls)
{
cls->myFunc = &MyClass_myFunc;
}