std :: bind to std :: function?

Я получаю ошибку компиляции, используя это:

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);

Ошибка:

/usr/include/c++/4.6/functional:1764:40: error: no match for call to '(std::_Bind(int)>) (int)'

Может кто-нибудь сказать мне, как конвертироватьstd::bind вstd::function?

Ответы на вопрос(1)

Ваш ответ на вопрос