Excuse me if this is a stupid question, but I can't get my head around the following piece of code:
struct myStruct
{
static void func1(const event, void* pthis)
{
myStruct& foo = *static_cast<myStruct*>(pthis);
if(event.action != ...).... return;
if(event.action == ...) foo.func2();
}
void func2()
{}
}
So... pthis is casted to a static pointer of type myStruct? Does this mean foo is of type 'reference to myStruct', and is equal to the value pointed to by pthis.
Essentially foo is pointing to myStruct, without access to instances of myStruct?
I really don't get it...