The syntax for pointers to members still apply. You should write :
typedef int (S::*func)(int a, int b);
template<func F> int do_it(int a, int b) {
return (this->*F)(a, b);
}
Using a pointer to member always require associating an object with it - here, it makes sense you would call your pointer on this
.