У меня есть несколько лямбда-функций, которые я хочу связать с помощью boost :: bind или std :: bind. (Неважно, какой из них, если он работает.) К сожалению, оба они дают мне разные ошибки компилятора:
auto f = [](){ cout<<"f()"<<endl; };
auto f2 = [](int x){ cout<<"f2() x="<<x<<endl; };
std::bind(f)(); //ok
std::bind(f2, 13)(); //error C2903: 'result' : symbol is neither a class template nor a function template
boost::bind(f)(); //error C2039: 'result_type' : is not a member of '`anonymous-namespace'::<lambda0>'
boost::bind(f2, 13)(); //error C2039: 'result_type' : is not a member of '`anonymous-namespace'::<lambda1>'
Итак, каков самый простой способ решения этой проблемы?