since boost 1.74: compile errors building code using boost-asio with intel-18.0-vc14

625 views Asked by At
  1. I built boost 1.74 with Intel c++ 2018 (update 2) with VS 2015 (the intel-18.0-vc14 toolset) in release x64

  2. when I try to build code that uses ASIO with the intel c++ compiler with VS2015 integration, I get loads of compile errors.

  3. when I try to build the same code with VS 2015 it compiles fine.

  4. following code does not compile:

    boost::asio::io_context context;
    boost::asio::ip::tcp::acceptor acceptor(context);
    

    with following error message:

    > boost/asio/detail/io_object_impl.hpp(61): error : no instance of constructor "boost::asio::execution::any_executor
    
  5. if I define BOOST_ASIO_USE_TS_EXECUTOR_AS_DEFAULT the above example compiles. but following example code does not:

     boost::asio::io_context context;
     boost::asio::ip::tcp::acceptor acceptor(context);
     boost::asio::io_context::strand strand(context);
     boost::asio::ip::tcp::socket socket(context);
    
     acceptor.async_accept(socket,
         strand.wrap([](const boost::system::error_code & error) {})
     );
    

    with the error message (I posted the complete error message below):

     > boost/asio/detail/handler_work.hpp(366): error : more than one partial specialization matches the template argument list of class "boost::asio::detail::handler_work_base<boost::asio::io_context::executor_type, void, boost::asio::io_context, boost::asio::executor, void>"
    

Questions:

  • how do I need to modify the above signatures in my example to update our legacy code to use boost 1.74?
  • or is there some compile definition I need define to to get backwards compatible behavior?
  • is this a bug in the compiler detection (in boost or asio), or have we been lucky all these years and need to build boost with the intel compiler to be compatible?
1>F:\ThirdPartyLibsRoot\svn-esx_SuperMash_libraries_boost_boost_1_74_0_z43_win_msvc-14.0-python2\include\boost/asio/detail/handler_work.hpp(366): error : more than one partial specialization matches the template argument list of class "boost::asio::detail::handler_work_base<boost::asio::io_context::executor_type, void, boost::asio::io_context, boost::asio::executor, void>"
1>              "boost::asio::detail::handler_work_base<Executor, CandidateExecutor, IoContext, PolymorphicExecutor, boost::asio::enable_if<<expression>, void>::type>"
1>              "boost::asio::detail::handler_work_base<Executor, void, IoContext, PolymorphicExecutor, boost::asio::enable_if<boost::is_same<Executor, IoContext::executor_type>::value, void>::type>"
1>      handler_work_base<IoExecutor>,
1>      ^
1>            detected during:
1>              instantiation of class "boost::asio::detail::handler_work<Handler, IoExecutor, <unnamed>> [with Handler=boost::asio::detail::binder1<lambda [](const boost::system::error_code &)->void, boost::system::error_code>, IoExecutor=boost::asio::io_context::executor_type, <unnamed>=void]" at line 81 of "F:\ThirdPartyLibsRoot\svn-esx_SuperMash_libraries_boost_boost_1_74_0_z43_win_msvc-14.0-python2\include\boost/asio/detail/completion_handler.hpp"
1>              instantiation of class "boost::asio::detail::completion_handler<Handler, IoExecutor> [with Handler=boost::asio::detail::binder1<lambda [](const boost::system::error_code &)->void, boost::system::error_code>, IoExecutor=boost::asio::io_context::executor_type]" at line 68 of "F:\ThirdPartyLibsRoot\svn-esx_SuperMash_libraries_boost_boost_1_74_0_z43_win_msvc-14.0-python2\include\boost/asio/detail/impl/strand_service.hpp"
1>              instantiation of "void boost::asio::detail::strand_service::dispatch(boost::asio::detail::strand_service::implementation_type &, Handler &) [with Handler=boost::asio::detail::binder1<lambda [](const boost::system::error_code &)->void, boost::system::error_code>]" at line 344 of "F:\ThirdPartyLibsRoot\svn-esx_SuperMash_libraries_boost_boost_1_74_0_z43_win_msvc-14.0-python2\include\boost/asio/io_context_strand.hpp"
1>              instantiation of "void boost::asio::io_context::strand::initiate_dispatch::operator()(LegacyCompletionHandler &&, boost::asio::io_context::strand *) const [with LegacyCompletionHandler=boost::asio::detail::binder1<lambda [](const boost::system::error_code &)->void, boost::system::error_code>]" at line 183 of "F:\ThirdPartyLibsRoot\svn-esx_SuperMash_libraries_boost_boost_1_74_0_z43_win_msvc-14.0-python2\include\boost/asio/async_result.hpp"
1>              instantiation of "boost::asio::async_result<CompletionToken, Signature>::return_type boost::asio::async_result<CompletionToken, Signature>::initiate(Initiation &&, RawCompletionToken &&, T1 &&) [with CompletionToken=boost::asio::detail::binder1<lambda [](const boost::system::error_code &)->void, boost::system::error_code>, Signature=void (), Initiation=boost::asio::io_context::strand::initiate_dispatch, RawCompletionToken=boost::asio::detail::binder1<lambda [](const
1>                        boost::system::error_code &)->void, boost::system::error_code>, T1=boost::asio::io_context::strand *]" at line 470 of "F:\ThirdPartyLibsRoot\svn-esx_SuperMash_libraries_boost_boost_1_74_0_z43_win_msvc-14.0-python2\include\boost/asio/async_result.hpp"
1>              [ 18 instantiation contexts not shown ]
1>              instantiation of "boost::asio::detail::win_iocp_socket_accept_op<Socket, Protocol, Handler, IoExecutor>::win_iocp_socket_accept_op(boost::asio::detail::win_iocp_socket_service_base &, boost::asio::detail::socket_type={SOCKET={UINT_PTR={unsigned __int64}}}, Socket &, const Protocol &, Protocol::endpoint *, bool, Handler &, const IoExecutor &) [with Socket=boost::asio::basic_socket<boost::asio::ip::tcp, boost::asio::any_io_executor>, Protocol=boost::asio::ip::tcp,
1>                        Handler=boost::asio::detail::wrapped_handler<boost::asio::io_context::strand, lambda [](const boost::system::error_code &)->void, boost::asio::detail::is_continuation_if_running>, IoExecutor=boost::asio::any_io_executor]" at line 503 of "F:\ThirdPartyLibsRoot\svn-esx_SuperMash_libraries_boost_boost_1_74_0_z43_win_msvc-14.0-python2\include\boost/asio/detail/win_iocp_socket_service.hpp"
1>              instantiation of "void boost::asio::detail::win_iocp_socket_service<Protocol>::async_accept(boost::asio::detail::win_iocp_socket_service<Protocol>::implementation_type &, Socket &, boost::asio::detail::win_iocp_socket_service<Protocol>::endpoint_type *, Handler &, const IoExecutor &) [with Protocol=boost::asio::ip::tcp, Socket=boost::asio::basic_socket<boost::asio::ip::tcp, boost::asio::any_io_executor>, Handler=boost::asio::detail::wrapped_handler<boost::asio::io_context::strand,
1>                        lambda [](const boost::system::error_code &)->void, boost::asio::detail::is_continuation_if_running>, IoExecutor=boost::asio::any_io_executor]" at line 2445 of "F:\ThirdPartyLibsRoot\svn-esx_SuperMash_libraries_boost_boost_1_74_0_z43_win_msvc-14.0-python2\include\boost/asio/basic_socket_acceptor.hpp"
1>              instantiation of "void boost::asio::basic_socket_acceptor<Protocol, Executor>::initiate_async_accept::operator()(AcceptHandler &&, boost::asio::basic_socket<Protocol1, Executor1> *, boost::asio::basic_socket_acceptor<Protocol, Executor>::endpoint_type *) const [with Protocol=boost::asio::ip::tcp, Executor=boost::asio::any_io_executor, AcceptHandler=boost::asio::detail::wrapped_handler<boost::asio::io_context::strand, lambda [](const boost::system::error_code &)->void,
1>                        boost::asio::detail::is_continuation_if_running>, Protocol1=boost::asio::ip::tcp, Executor1=boost::asio::any_io_executor]" at line 183 of "F:\ThirdPartyLibsRoot\svn-esx_SuperMash_libraries_boost_boost_1_74_0_z43_win_msvc-14.0-python2\include\boost/asio/async_result.hpp"
1>              instantiation of "boost::asio::async_result<CompletionToken, Signature>::return_type boost::asio::async_result<CompletionToken, Signature>::initiate(Initiation &&, RawCompletionToken &&, T1 &&, T2 &&) [with CompletionToken=boost::asio::detail::wrapped_handler<boost::asio::io_context::strand, lambda [](const boost::system::error_code &)->void, boost::asio::detail::is_continuation_if_running>, Signature=void (boost::system::error_code),
1>                        Initiation=boost::asio::basic_socket_acceptor<boost::asio::ip::tcp, boost::asio::any_io_executor>::initiate_async_accept, RawCompletionToken=boost::asio::detail::wrapped_handler<boost::asio::io_context::strand, lambda [](const boost::system::error_code &)->void, boost::asio::detail::is_continuation_if_running>, T1=boost::asio::basic_socket<boost::asio::ip::tcp, boost::asio::any_io_executor> *, T2=boost::asio::ip::tcp::endpoint *]" at line 470 of
1>                        "F:\ThirdPartyLibsRoot\svn-esx_SuperMash_libraries_boost_boost_1_74_0_z43_win_msvc-14.0-python2\include\boost/asio/async_result.hpp"
1>              instantiation of "boost::asio::enable_if<boost::asio::detail::async_result_has_initiate_memfn<CompletionToken, Signature>::value, boost::asio::async_result<boost::decay<CompletionToken>::type, Signature>::return_type>::type boost::asio::async_initiate<CompletionToken,Signature,Initiation,T1,T2>(Initiation &&, CompletionToken &, T1 &&, T2 &&) [with CompletionToken=boost::asio::detail::wrapped_handler<boost::asio::io_context::strand, lambda [](const boost::system::error_code &)->void,
1>                        boost::asio::detail::is_continuation_if_running>, Signature=void (boost::system::error_code), Initiation=boost::asio::basic_socket_acceptor<boost::asio::ip::tcp, boost::asio::any_io_executor>::initiate_async_accept, T1=boost::asio::basic_socket<boost::asio::ip::tcp, boost::asio::any_io_executor> *, T2=boost::asio::ip::tcp::endpoint *]" at line 1351 of
1>                        "F:\ThirdPartyLibsRoot\svn-esx_SuperMash_libraries_boost_boost_1_74_0_z43_win_msvc-14.0-python2\include\boost/asio/basic_socket_acceptor.hpp"
0

There are 0 answers