std :: bind do std :: function?
Używam tego błędu kompilacji:
std::vector<std::function<int(int)>> functions;
std::function<int(int, int)> foo = [](int a, int b){ return a + b; };
std::function<int(int)> bar = std::bind(foo, 2);
functions.push_back(bar);
Błąd jest:
/usr/include/c++/4.6/functional: 1764:40: error: brak dopasowania dla call to '(std :: _ Bind (int)>) (int)'
Czy ktoś może mi powiedzieć, jak przekonwertowaćstd::bind
w astd::function
?