Questions tagged «tr1»


6
在类中使用具有成员函数的通用std :: function对象
对于一个类,我想在一个map存储std::function对象中存储一些指向同一类成员函数的函数指针。但是我在使用此代码的开头就失败了: class Foo { public: void doSomething() {} void bindFunction() { // ERROR std::function<void(void)> f = &Foo::doSomething; } }; 我收到error C2064: term does not evaluate to a function taking 0 arguments的xxcallobj一些奇怪的模板实例化的错误结合。目前,我在使用Visual Studio 2010/2011的Windows 8上以及在VS10的Win 7上也失败。该错误必须基于一些我不遵循的奇怪C ++规则
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.