Hi!
I'm try to store member function pointers by templates like this. (This is a simplified version of my real code)
template<class Arg1>
void connect(void (T::*f)(Arg1))
{
//Do some stuff
}
template<class Arg1>
void connect(void (T::*f)())
{
//Do some stuff
}
class GApp
{
public:
void foo() {}
void foo(double d) {}
};
Then I want to do like following for every overloaded methods in GApp,
connect(&GApp::foo);
Calling this for foo() is ok, but how can I call this for foo(double d) ?? Why following isn't working ?
connect((&GApp::foo)(double));
It will give me "syntax error : 'double' should be preceded by ')'". I don't understand the syntax which must use here.This is may be a stupid qustion, but can anyone help me on this pls ?
Thanks