0
我嘗試使用std ::綁定和std ::地圖不能存儲的boost ::綁定功能的std ::地圖
#include <boost/bind/bind.hpp>
#include <boost/function/function0.hpp>
#include <map>
class Foo {
public:
Foo();
void bar(bool i) {cout << i << endl;}
private:
typedef boost::function<void(bool)> Function;
std::map<int, Function> functionMap;
}
Foo::Foo() {
functionMap[0] = boost::bind(&Foo::bar, this, _1);
}
我正的錯誤映射部分功能如下:
錯誤C2582: '運算符=' 的功能是在 '的boost ::功能<簽名>'
不可用可能的問題是什麼?
工作完全正常http://ideone.com/ofViT8 – imreal