Don't copy completion handlers:

All asynchronous operations will now be able to use move-only
CompletionHandlers.

Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
This commit is contained in:
Damian Jarek authored and Vinnie Falco committed 2017-12-04 12:14:40 -08:00
1 parent 3361df142c
commit 200e898f7e
15 files changed
+69 -75

No files matched your search

+3 -3
View File
@@ -54,7 +54,7 @@ class stream<NextLayer>::write_some_op
public:
write_some_op(write_some_op&&) = default;
write_some_op(write_some_op const&) = default;
write_some_op(write_some_op const&) = delete;
template<class DeducedHandler>
write_some_op(
@@ -728,7 +728,7 @@ async_write_some(bool fin,
void(error_code, std::size_t)> init{handler};
write_some_op<ConstBufferSequence, BOOST_ASIO_HANDLER_TYPE(
WriteHandler, void(error_code, std::size_t))>{
init.completion_handler, *this, fin, bs}(
std::move(init.completion_handler), *this, fin, bs}(
{}, 0, false);
return init.result.get();
}
@@ -784,7 +784,7 @@ async_write(
void(error_code, std::size_t)> init{handler};
write_some_op<ConstBufferSequence, BOOST_ASIO_HANDLER_TYPE(
WriteHandler, void(error_code, std::size_t))>{
init.completion_handler, *this, true, bs}(
std::move(init.completion_handler), *this, true, bs}(
{}, 0, false);
return init.result.get();
}