gcc でテンプレート化されたメンバー関数にメンバー関数ポインターを渡す際に問題が発生しています。以下のコードを変更して、gccが私がやろうとしていることを受け入れるようにする方法を知っている人はいますか?
class Foo
{
public:
template <class C, class R>
void Execute(R(typename C::*memFn)())
{
}
};
コードをコンパイルしようとすると、次のエラーが発生します。
test.cpp:40: error: 'memFn' was not declared in this scope
test.cpp:40: error: expected primary-expression before '(' token
test.cpp:40: error: expected identifier before '*' token
test.cpp:40: error: expected '(' before '*' token
test.cpp:40: error: 'memFn' was not declared in this scope
test.cpp:40: error: variable or field 'Execute' declared void
私が使用している gcc のバージョンは 4.4.2 です。
ご助力ありがとうございます!