- C++相談室 part117 [転載禁止]©2ch.net
19 :デフォルトの名無しさん[sage]:2015/05/13(水) 23:51:59.04 ID:ge68r1dD - http://www.boost.org/doc/libs/1_58_0/doc/html/boost_asio/tutorial/tuttimer5.html
ここみていろいろ遊んでるときに気づいたことがあったので質問です (このページの主題は質問とは無関係です) #include <functional> #include <boost/asio.hpp> #include <boost/bind.hpp> int main() { boost::asio::io_service io; auto fb = boost::bind(&boost::asio::io_service::run, &io); auto fs = std::bind(&boost::asio::io_service::run, &io); // こっちだけエラーがでる } このようなコードを書くと、std::bindのほうだけ prog.cc:8:15: error: no matching function for call to 'bind' auto fs = std::bind(&boost::asio::io_service::run, &io); ^~~~~~~~~ /usr/local/libcxx-3.6/include/c++/v1/functional:2184:1: note: candidate template ignored: couldn't infer template argument '_Fp' bind(_Fp&& __f, _BoundArgs&&... __bound_args) ^ /usr/local/libcxx-3.6/include/c++/v1/functional:2193:1: note: candidate template ignored: couldn't infer template argument '_Rp' bind(_Fp&& __f, _BoundArgs&&... __bound_args) ^ 1 error generated. といったエラーが出ます boost::bindとstd::bindでなぜこのような違いがでてくるんでしょうか?
|
|