class A
{
public:
template<class T>
void Hello(void(T::*func)())
{
func(); // Not working. Error term does not evaluate to function taking 0 argument
}
};
class B
{
public:
void funcA()
{
std::cout << "Hello world" << std::endl;
}
};
void main()
{
A a;
a.Hello(&B::funcA);
}
What sort of template is this? a template class declared on a function but not declared on the class? Im confuse. Also why cant I call the func() on the Hello()? I can do that on regular function pointer why not in here? Thanks