- 912 名前:デフォルトの名無しさん mailto:sage [2012/04/21(土) 16:18:52.52 ]
- テンプレートクラスのメンバ関数を、
boost::threadとboost::bindで呼び出して、別スレッドで動かしたいのですが うまくいきません。ご教授願います。 template<class T> class TestClass : public T { public: TestClass(void) : T() {} }; class TestBase { public: void print(TCHAR *str){ cout << str << endl; }; }; typedef TestClass<TestBase> MyTestClass; int _tmain(int argc, _TCHAR* argv[]) { TCHAR *char str = _T("test"); MyTestClass myTestClass; myTestClass.print(str); // 正常に動作 boost::thread myThread(boost::bind(&MyTestClass::print,str)); // ←コンパイルエラー // c:\Program Files\boost\boost_1_47\boost\bind\mem_fn.hpp(333): error C2296: '->*' : 無効な左オペランドです。 }
|

|