I need to call a non static member function from a static member function of the same class. The static function is a callback. It can receive only void as data, though whic
This is the only way :
#include #include struct A; A *oneObj = NULL; struct A { A(){ oneObj=this; } ~A(){ oneObj=NULL; } void foo() { } static void boo() { assert( NULL != oneObj ); oneObj->foo(); } }; int main() { A onlyOne; A::boo(); }