I'm trying to extend to methods the technique explained here for functions. The problem is the method signature template parameter. For instance, a wrapper for the sin function is created this way:
template<typename Sig, Sig& S> struct wrapper;
template<typename Ret, typename... Args, Ret(&P)(Args...)>
struct wrapper<Ret(Args...), P> {
// blah
}
and then is instantiated with
wrapper<decltype(sin), sin>
But for a method bool Foo::blah(int)
this technique is rejected:
template<class C, typename Sig, Sig& S> struct wrapper;
template<class C, typename Ret, typename... Args, Ret(C::*P)(Args...)>
struct wrapper<Ret(C::)(Args...), P> {
// blah
}
wrapper<decltype(Foo::blah), &Foo::blah>
So what's the proper syntax?