Skip to content

Commit d25fa4e

Browse files
committed
Enable move-only handlers.
All async operations and executor operations support move-only handlers. However, the io_service::post(), io_service::dispatch(), io_service::strand::post() and io_service::strand::dispatch() functions still require copyable handlers.
1 parent 74e12e5 commit d25fa4e

File tree

17 files changed

+398
-585
lines changed

17 files changed

+398
-585
lines changed

asio/include/asio/basic_socket.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include "asio/detail/throw_error.hpp"
2323
#include "asio/detail/type_traits.hpp"
2424
#include "asio/error.hpp"
25+
#include "asio/post.hpp"
2526
#include "asio/socket_base.hpp"
2627

2728
#include "asio/detail/push_options.hpp"
@@ -747,7 +748,7 @@ class basic_socket
747748
async_completion<ConnectHandler,
748749
void (asio::error_code)> init(handler);
749750

750-
this->get_service().get_io_service().post(
751+
asio::post(this->get_executor(),
751752
asio::detail::bind_handler(
752753
ASIO_MOVE_CAST(ASIO_HANDLER_TYPE(
753754
ConnectHandler, void (asio::error_code)))(

0 commit comments

Comments
 (0)