#include <iostream>
using namespace std;
struct foo
{
void bar() const
{
cout << "hey" << endl;
}
};
template <typename T, void (T::*pf)() /*add const here for clang*/>
void call(T& t)
{
(t.*pf)();
}
int main()
{
foo f;
call<const foo, &foo::bar>(f);
return 0;
}