以下のコードは、VC++ 2012 によって「エラー C2207: 'A::bar': クラス テンプレートのメンバーは関数型を取得できません」で拒否されます。
int Hello(int n)
{
return n;
}
template<class FunctionPtr>
struct A
{
A(FunctionPtr foo)
: bar(foo)
{}
FunctionPtr bar;
};
int main()
{
A<decltype(Hello)> a(Hello);
return 0;
}
なんで?