Reputation: 175
struct S
{
template <auto> void F(){};
};
S s;
void (S::* pmf)()=s.F<true>;
compiles error, how to fix it? Thanks for your help.
Upvotes: 2
Views: 61
Reputation: 172864
You should use the class name to qualify the member function, and there's no implicit conversion from member function to member function pointer, so use operator&
explicitly. e.g.
void (S::* pmf)() = &S::F<true>;
Upvotes: 3