Hello!
I have two classes, ClassA needs to use ClassB, but ClassB has a callback whick needs to be a static method in ClassA, but if it is static I cannot reach ClassA's variables from that method. I tried it with lambda, but I canot figure out how to use it.
if you want class a to call class b then pass reference to class b to class a during class a initialisation, and then you will have class b methods available to class a
What’s the point of having a callback tied to a member function. It needs to be static because it won’t be invoked as an instance call - just a class method call and thus won’t have access to whatever instance/member variables you might have in mind.
Just use a standard function for callback and ensure there is a way to tie that to a specific instance if needed