Skip to content

Commit a482f2d

Browse files
committed
Eliminate some unnecessary handler copies.
1 parent 93ed48b commit a482f2d

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

asio/include/asio/detail/reactive_socket_service_base.hpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ class reactive_socket_service_base
197197
template <typename ConstBufferSequence, typename Handler>
198198
void async_send(base_implementation_type& impl,
199199
const ConstBufferSequence& buffers,
200-
socket_base::message_flags flags, Handler handler)
200+
socket_base::message_flags flags, Handler& handler)
201201
{
202202
bool is_continuation =
203203
asio_handler_cont_helpers::is_continuation(handler);
@@ -221,7 +221,7 @@ class reactive_socket_service_base
221221
// Start an asynchronous wait until data can be sent without blocking.
222222
template <typename Handler>
223223
void async_send(base_implementation_type& impl, const null_buffers&,
224-
socket_base::message_flags, Handler handler)
224+
socket_base::message_flags, Handler& handler)
225225
{
226226
bool is_continuation =
227227
asio_handler_cont_helpers::is_continuation(handler);
@@ -268,7 +268,7 @@ class reactive_socket_service_base
268268
template <typename MutableBufferSequence, typename Handler>
269269
void async_receive(base_implementation_type& impl,
270270
const MutableBufferSequence& buffers,
271-
socket_base::message_flags flags, Handler handler)
271+
socket_base::message_flags flags, Handler& handler)
272272
{
273273
bool is_continuation =
274274
asio_handler_cont_helpers::is_continuation(handler);
@@ -296,7 +296,7 @@ class reactive_socket_service_base
296296
// Wait until data can be received without blocking.
297297
template <typename Handler>
298298
void async_receive(base_implementation_type& impl, const null_buffers&,
299-
socket_base::message_flags flags, Handler handler)
299+
socket_base::message_flags flags, Handler& handler)
300300
{
301301
bool is_continuation =
302302
asio_handler_cont_helpers::is_continuation(handler);
@@ -353,7 +353,7 @@ class reactive_socket_service_base
353353
template <typename MutableBufferSequence, typename Handler>
354354
void async_receive_with_flags(base_implementation_type& impl,
355355
const MutableBufferSequence& buffers, socket_base::message_flags in_flags,
356-
socket_base::message_flags& out_flags, Handler handler)
356+
socket_base::message_flags& out_flags, Handler& handler)
357357
{
358358
bool is_continuation =
359359
asio_handler_cont_helpers::is_continuation(handler);
@@ -380,7 +380,7 @@ class reactive_socket_service_base
380380
template <typename Handler>
381381
void async_receive_with_flags(base_implementation_type& impl,
382382
const null_buffers&, socket_base::message_flags in_flags,
383-
socket_base::message_flags& out_flags, Handler handler)
383+
socket_base::message_flags& out_flags, Handler& handler)
384384
{
385385
bool is_continuation =
386386
asio_handler_cont_helpers::is_continuation(handler);

asio/include/asio/detail/win_iocp_socket_service_base.hpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ class win_iocp_socket_service_base
214214
template <typename ConstBufferSequence, typename Handler>
215215
void async_send(base_implementation_type& impl,
216216
const ConstBufferSequence& buffers,
217-
socket_base::message_flags flags, Handler handler)
217+
socket_base::message_flags flags, Handler& handler)
218218
{
219219
// Allocate and construct an operation to wrap the handler.
220220
typedef win_iocp_socket_send_op<ConstBufferSequence, Handler> op;
@@ -237,7 +237,7 @@ class win_iocp_socket_service_base
237237
// Start an asynchronous wait until data can be sent without blocking.
238238
template <typename Handler>
239239
void async_send(base_implementation_type& impl, const null_buffers&,
240-
socket_base::message_flags, Handler handler)
240+
socket_base::message_flags, Handler& handler)
241241
{
242242
// Allocate and construct an operation to wrap the handler.
243243
typedef win_iocp_null_buffers_op<Handler> op;
@@ -281,7 +281,7 @@ class win_iocp_socket_service_base
281281
template <typename MutableBufferSequence, typename Handler>
282282
void async_receive(base_implementation_type& impl,
283283
const MutableBufferSequence& buffers,
284-
socket_base::message_flags flags, Handler handler)
284+
socket_base::message_flags flags, Handler& handler)
285285
{
286286
// Allocate and construct an operation to wrap the handler.
287287
typedef win_iocp_socket_recv_op<MutableBufferSequence, Handler> op;
@@ -304,7 +304,7 @@ class win_iocp_socket_service_base
304304
// Wait until data can be received without blocking.
305305
template <typename Handler>
306306
void async_receive(base_implementation_type& impl, const null_buffers&,
307-
socket_base::message_flags flags, Handler handler)
307+
socket_base::message_flags flags, Handler& handler)
308308
{
309309
// Allocate and construct an operation to wrap the handler.
310310
typedef win_iocp_null_buffers_op<Handler> op;
@@ -355,7 +355,7 @@ class win_iocp_socket_service_base
355355
template <typename MutableBufferSequence, typename Handler>
356356
void async_receive_with_flags(base_implementation_type& impl,
357357
const MutableBufferSequence& buffers, socket_base::message_flags in_flags,
358-
socket_base::message_flags& out_flags, Handler handler)
358+
socket_base::message_flags& out_flags, Handler& handler)
359359
{
360360
// Allocate and construct an operation to wrap the handler.
361361
typedef win_iocp_socket_recvmsg_op<MutableBufferSequence, Handler> op;
@@ -378,7 +378,7 @@ class win_iocp_socket_service_base
378378
template <typename Handler>
379379
void async_receive_with_flags(base_implementation_type& impl,
380380
const null_buffers&, socket_base::message_flags in_flags,
381-
socket_base::message_flags& out_flags, Handler handler)
381+
socket_base::message_flags& out_flags, Handler& handler)
382382
{
383383
// Allocate and construct an operation to wrap the handler.
384384
typedef win_iocp_null_buffers_op<Handler> op;

asio/include/asio/detail/win_object_handle_service.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ class win_object_handle_service
129129

130130
/// Start an asynchronous wait.
131131
template <typename Handler>
132-
void async_wait(implementation_type& impl, Handler handler)
132+
void async_wait(implementation_type& impl, Handler& handler)
133133
{
134134
// Allocate and construct an operation to wrap the handler.
135135
typedef wait_handler<Handler> op;

0 commit comments

Comments
 (0)