C++相談室 part87
■ このスレッドは過去ログ倉庫に格納されています
0702デフォルトの名無しさん
2011/01/07(金) 02:40:37const なメンバ関数の型を正しく推測できていないようです。
何か規格外の事をしているのか、それとも単なる VC のバグなのでしょうか?
struct Foo{
void test1(){ cout << "test1" << endl; }
void test2() const{ cout << "test2" << endl; }
};
template<typename F>
void test( Foo* foo, F Foo::*func ){
( foo->*func )();
}
Foo foo;
test( &foo, &Foo::test1 );
test( &foo, &Foo::test2 ); // C2664
■ このスレッドは過去ログ倉庫に格納されています