在libtorrent
我发现以下代码,它不能用 Visual Studio 2015 RC 编译:
boost::bind( &address::is_v4,
boost::bind( &tcp::endpoint::address,
_1
)
)
== m_bind_addr.is_v4()
虽然我们可能会争论使用 bind 使用运算符重载的问题,但我实际上想知道为什么它不能编译。错误信息是:
C:\Projects\boost\boost/bind/bind.hpp(2003): error C2027: use of undefined type 'boost::_bi::add_cref<Pm,0>'
with
[
Pm=bool (__thiscall boost::asio::ip::address::* )(void) const
]
C:\Projects\boost\boost/bind/bind.hpp(2011): note: see reference to class template instantiation 'boost::_bi::dm_result<M (__thiscall boost::asio::ip::address::* ),A1>' being compiled
with
[
M=bool (void) const,
A1=boost::_bi::bind_t<boost::asio::ip::address,boost::_mfi::cmf0<boost::asio::ip::address,boost::asio::ip::basic_endpoint<boost::asio::ip::tcp>>,boost::_bi::list1<boost::arg<1>>>
]