The above code won't compile with the following error:
external/boost/boost/asio/experimental/basic_channel.hpp:246:15: error: no matching member function for call to 'move_construct'
service_->move_construct(impl_, *other.service_, other.impl_);
~~~~~~~~~~^~~~~~~~~~~~~~
external/boost/boost/asio/use_awaitable.hpp:135:12: note: in instantiation of function template specialization 'boost::asio::experimental::basic_channel<boost::asio::use_awaitable_t<>::executor_with_default<boost::asio::any_io_executor>, boost::asio::experimental::channel_traits<>, void (int)>::basic_channel<boost::asio::any_io_executor>' requested here
return typename decay<T>::type::template rebind_executor<
^
test_asio.cpp:8:140: note: in instantiation of function template specialization 'boost::asio::use_awaitable_t<>::as_default_on<boost::asio::experimental::basic_channel<boost::asio::any_io_executor, boost::asio::experimental::channel_traits<>, void (int)>>' requested here
std::invoke_result_t<decltype(asio::use_awaitable_t<>::as_default_on<Channel>), Channel> default_awaitable_channel{asio::use_awaitable.as_default_on(Channel{ctx})};
^
external/boost/boost/asio/experimental/detail/channel_service.hpp:101:8: note: candidate function template not viable: requires 2 arguments, but 3 were provided
void move_construct(implementation_type<Traits, Signatures...>& impl,
The above code won't compile with the following error:
https://github.com/chriskohlhoff/asio/blob/c465349fa5cd91a64bb369f5131ceacab2c0c1c3/asio/include/asio/experimental/detail/channel_service.hpp#L98-L101
It looks like the call to
move_construct
on this line should pass two parameters instead of three, or should callmove_assign
which do needs three paramters. https://github.com/chriskohlhoff/asio/blob/c465349fa5cd91a64bb369f5131ceacab2c0c1c3/asio/include/asio/experimental/basic_channel.hpp#L245 Maybe the parameters is wrongly copied from theoperator=
implementation. https://github.com/chriskohlhoff/asio/blob/c465349fa5cd91a64bb369f5131ceacab2c0c1c3/asio/include/asio/experimental/basic_channel.hpp#L261-L275