Is it possible to deduce the type of the class T
from its pointer to memmber T::*f
as shown below.
struct Foo
{
void func(){}
};
template<typename T, void (T::*f)()>
void bar()
{
}
int main()
{
bar<Foo,Foo::func>();
// bar<Foo::func>(); // Desired
}
In C++17, you will be allowed to write
template<auto M>
void bar();
Which allows
bar<&Foo::func>();