I know that the title is not very clear, but I did not know how to write it in one sentence. So the problem is that I want something like this:
void(typeof(this)::*function)(int,int);
I know this will not work, but I wandered, is there a solution for this problem in C ++ or not?
Update:
class MainPage { public: MainPage() { void (std::remove_reference<decltype(*this)>::*callback)(int, int) = &MainPage::myFunction; ((*this).*callback)(nullptr,nullptr); } ~MainPage() { } void myFunction(int a, int b) { } }
Errors:
error C2440: 'new line': cannot be converted from 'MainPage *' to 'std :: remove_reference <_Ty> *'
error C2647: '. * ': cannot dereference' void (__thiscall std :: remove_reference <_Ty> :: *) (int, int) 'in' MainPage '
source share