The C++ syntax is killing me.
I'm trying to pass this
+ pointer to member function:
So I did the following :
template <void(Myclass::*func)()>
static void Myfunction(Myclass* theThis)
{
theThis->*func();
}
This works great.
But now I want to pass from this function to another function this member function.
template <void(Myclass::*func)()>
static void Myfunction2(Myclass* theThis) // My new function
{
theThis->*func();
}
template <void(Myclass::*func)()>
static void Myfunction(Myclass* theThis)
{
Myfunction2<&(Myclass::*func)>(theThis) // This doesn't compile, the template parameter is probably incorrect
}
But it doesn't compile, I'm not sure how to pass this member function.
I get : error C2059: syntax error: '<tag>::*'
EDIT:
Just to make things clear. I don't have a function named func, this is just the name of the pointer to the member function