我应该看到std :: bind和boost :: bind之间存在显着差异吗?

BD *_*ill 6 c++ boost boost-asio stdbind c++11

我正在探索对g ++ - 4.7(Ubuntu/Linaro 4.7.3-2ubuntu~12.04,具体而言)对C++ 11的支持,我似乎发现了差异.

特别是,如果我在Boost ASIO async客户端示例中注释#include <boost/bind.hpp>并系统地替换boost::bindwith的出现std::bind(取自http://www.boost.org/doc/libs/1_45_0/doc/html/boost_asio/example/http/client /async_client.cpp),程序不再编译.

对此有何解释?

pal*_*pal 7

#include <functional>
namespace boost {
    namespace asio {
        namespace stdplaceholders {
            static decltype ( :: std :: placeholders :: _1 ) & error = :: std :: placeholders :: _1;
            static decltype ( :: std :: placeholders :: _2 ) & bytes_transferred = :: std :: placeholders :: _2;
            static decltype ( :: std :: placeholders :: _2 ) & iterator = :: std :: placeholders :: _2;
            static decltype ( :: std :: placeholders :: _2 ) & signal_number = :: std :: placeholders :: _2;
        }
    }
}
Run Code Online (Sandbox Code Playgroud)

并使用boost::asio::stdplaceholders::*而不是boost::asio::placeholders::*