summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrobot-contrib <[email protected]>2024-12-16 19:22:55 +0300
committerrobot-contrib <[email protected]>2024-12-16 19:41:45 +0300
commit52b429953d5dbb62b4cac031501c1b8b95dc66ee (patch)
tree9b12264c75531fd23bc5effb8cf345a14a3669eb
parent2bb2097a0d38fd6cfce127240628bdad3ece5409 (diff)
Update contrib/restricted/boost/asio to 1.86.0
commit_hash:126cd013d1356f62ae56538781fb84105c0b06f3
-rw-r--r--contrib/restricted/boost/asio/.yandex_meta/devtools.copyrights.report17
-rw-r--r--contrib/restricted/boost/asio/.yandex_meta/devtools.licenses.report17
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio.hpp6
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/as_tuple.hpp44
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/associated_immediate_executor.hpp5
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/associator.hpp2
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/async_result.hpp142
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/basic_datagram_socket.hpp22
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/basic_deadline_timer.hpp4
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/basic_random_access_file.hpp4
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/basic_raw_socket.hpp20
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/basic_readable_pipe.hpp2
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/basic_seq_packet_socket.hpp6
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/basic_serial_port.hpp4
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/basic_signal_set.hpp2
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/basic_socket.hpp4
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/basic_socket_acceptor.hpp18
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/basic_stream_file.hpp4
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/basic_stream_socket.hpp12
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/basic_waitable_timer.hpp4
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/basic_writable_pipe.hpp2
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/bind_allocator.hpp110
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/bind_cancellation_slot.hpp113
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/bind_executor.hpp128
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/bind_immediate_executor.hpp113
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/buffer.hpp4
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/buffer_registration.hpp2
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/cancel_after.hpp303
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/cancel_at.hpp296
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/co_composed.hpp (renamed from contrib/restricted/boost/asio/include/boost/asio/experimental/impl/co_composed.hpp)269
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/completion_condition.hpp49
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/compose.hpp211
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/composed.hpp415
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/connect.hpp262
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/coroutine.hpp7
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/default_completion_token.hpp91
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/deferred.hpp14
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/detached.hpp4
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/detail/buffered_stream_storage.hpp2
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/detail/completion_message.hpp (renamed from contrib/restricted/boost/asio/include/boost/asio/experimental/detail/channel_message.hpp)30
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/detail/completion_payload.hpp (renamed from contrib/restricted/boost/asio/include/boost/asio/experimental/detail/channel_payload.hpp)62
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/detail/completion_payload_handler.hpp (renamed from contrib/restricted/boost/asio/include/boost/asio/experimental/detail/channel_handler.hpp)28
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/detail/config.hpp32
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/detail/deadline_timer_service.hpp6
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/detail/handler_alloc_helpers.hpp132
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/detail/impl/descriptor_ops.ipp69
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/detail/impl/dev_poll_reactor.ipp2
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/detail/impl/reactive_descriptor_service.ipp12
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/detail/impl/reactive_socket_service_base.ipp10
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/detail/impl/socket_ops.ipp79
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/detail/impl/socket_select_interrupter.ipp2
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/detail/impl/win_iocp_file_service.ipp16
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/detail/impl/win_iocp_handle_service.ipp10
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/detail/initiation_base.hpp64
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/detail/reactive_descriptor_service.hpp36
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/detail/reactive_socket_send_op.hpp1
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/detail/reactive_socket_service.hpp8
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/detail/reactive_socket_service_base.hpp41
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/detail/recycling_allocator.hpp9
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/detail/resolve_endpoint_op.hpp2
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/detail/resolve_query_op.hpp2
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/detail/thread_info_base.hpp12
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/detail/timed_cancel_op.hpp363
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/detail/win_iocp_socket_service_base.hpp2
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/detail/winrt_ssocket_service_base.hpp2
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/detail/wrapped_handler.hpp80
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/execution/allocator.hpp2
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/execution/blocking.hpp2
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/execution/blocking_adaptation.hpp2
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/execution/context.hpp2
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/execution/mapping.hpp2
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/execution/occupancy.hpp2
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/execution/outstanding_work.hpp2
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/execution/relationship.hpp2
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/experimental/basic_channel.hpp3
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/experimental/basic_concurrent_channel.hpp3
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/experimental/co_composed.hpp116
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/experimental/detail/channel_receive_op.hpp5
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/experimental/detail/channel_send_functions.hpp46
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/experimental/detail/channel_send_op.hpp1
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/experimental/detail/channel_service.hpp32
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/experimental/detail/coro_promise_allocator.hpp5
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/experimental/detail/impl/channel_service.hpp6
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/experimental/detail/partial_promise.hpp8
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/experimental/impl/as_single.hpp19
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/experimental/impl/coro.hpp2
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/experimental/parallel_group.hpp78
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/experimental/promise.hpp6
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/experimental/use_coro.hpp10
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/experimental/use_promise.hpp2
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/immediate.hpp144
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/impl/append.hpp21
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/impl/as_tuple.hpp59
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/impl/awaitable.hpp6
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/impl/cancel_after.hpp270
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/impl/cancel_at.hpp270
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/impl/co_spawn.hpp8
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/impl/connect.hpp226
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/impl/consign.hpp21
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/impl/detached.hpp4
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/impl/prepend.hpp21
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/impl/read.hpp203
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/impl/read_at.hpp98
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/impl/read_until.hpp299
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/impl/redirect_error.hpp73
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/impl/spawn.hpp2
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/impl/write.hpp211
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/impl/write_at.hpp103
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/io_context_strand.hpp10
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/ip/basic_resolver.hpp12
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/ip/detail/socket_option.hpp2
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/ip/impl/address_v6.ipp2
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/placeholders.hpp18
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/posix/basic_descriptor.hpp2
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/posix/basic_stream_descriptor.hpp4
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/read.hpp155
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/read_at.hpp90
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/read_until.hpp150
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/redirect_error.hpp46
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/registered_buffer.hpp4
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/spawn.hpp1
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/ssl/detail/impl/openssl_init.ipp4
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/ssl/impl/context.ipp17
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/ssl/stream.hpp10
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/this_coro.hpp4
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/use_awaitable.hpp4
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/use_future.hpp2
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/uses_executor.hpp2
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/version.hpp2
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/windows/basic_object_handle.hpp2
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/windows/basic_random_access_handle.hpp4
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/windows/basic_stream_handle.hpp4
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/write.hpp182
-rw-r--r--contrib/restricted/boost/asio/include/boost/asio/write_at.hpp96
-rw-r--r--contrib/restricted/boost/asio/ya.make4
135 files changed, 4680 insertions, 2396 deletions
diff --git a/contrib/restricted/boost/asio/.yandex_meta/devtools.copyrights.report b/contrib/restricted/boost/asio/.yandex_meta/devtools.copyrights.report
index 5067c34fcc7..4d3ba7fcfc7 100644
--- a/contrib/restricted/boost/asio/.yandex_meta/devtools.copyrights.report
+++ b/contrib/restricted/boost/asio/.yandex_meta/devtools.copyrights.report
@@ -101,17 +101,22 @@ BELONGS ya.make
include/boost/asio/buffered_write_stream.hpp [5:5]
include/boost/asio/buffered_write_stream_fwd.hpp [5:5]
include/boost/asio/buffers_iterator.hpp [5:5]
+ include/boost/asio/cancel_after.hpp [5:5]
+ include/boost/asio/cancel_at.hpp [5:5]
include/boost/asio/cancellation_signal.hpp [5:5]
include/boost/asio/cancellation_state.hpp [5:5]
include/boost/asio/cancellation_type.hpp [5:5]
+ include/boost/asio/co_composed.hpp [5:5]
include/boost/asio/co_spawn.hpp [5:5]
include/boost/asio/completion_condition.hpp [5:5]
include/boost/asio/compose.hpp [5:5]
+ include/boost/asio/composed.hpp [5:5]
include/boost/asio/connect.hpp [5:5]
include/boost/asio/connect_pipe.hpp [5:5]
include/boost/asio/consign.hpp [5:5]
include/boost/asio/coroutine.hpp [5:5]
include/boost/asio/deadline_timer.hpp [5:5]
+ include/boost/asio/default_completion_token.hpp [5:5]
include/boost/asio/defer.hpp [5:5]
include/boost/asio/deferred.hpp [5:5]
include/boost/asio/detached.hpp [5:5]
@@ -130,6 +135,9 @@ BELONGS ya.make
include/boost/asio/detail/chrono.hpp [5:5]
include/boost/asio/detail/chrono_time_traits.hpp [5:5]
include/boost/asio/detail/completion_handler.hpp [5:5]
+ include/boost/asio/detail/completion_message.hpp [5:5]
+ include/boost/asio/detail/completion_payload.hpp [5:5]
+ include/boost/asio/detail/completion_payload_handler.hpp [5:5]
include/boost/asio/detail/composed_work.hpp [5:5]
include/boost/asio/detail/concurrency_hint.hpp [5:5]
include/boost/asio/detail/conditionally_enabled_event.hpp [5:5]
@@ -222,6 +230,7 @@ BELONGS ya.make
include/boost/asio/detail/initiate_defer.hpp [5:5]
include/boost/asio/detail/initiate_dispatch.hpp [5:5]
include/boost/asio/detail/initiate_post.hpp [5:5]
+ include/boost/asio/detail/initiation_base.hpp [5:5]
include/boost/asio/detail/io_control.hpp [5:5]
include/boost/asio/detail/io_object_impl.hpp [5:5]
include/boost/asio/detail/io_uring_descriptor_read_at_op.hpp [5:5]
@@ -336,6 +345,7 @@ BELONGS ya.make
include/boost/asio/detail/thread_info_base.hpp [5:5]
include/boost/asio/detail/throw_error.hpp [5:5]
include/boost/asio/detail/throw_exception.hpp [5:5]
+ include/boost/asio/detail/timed_cancel_op.hpp [5:5]
include/boost/asio/detail/timer_queue.hpp [5:5]
include/boost/asio/detail/timer_queue_base.hpp [5:5]
include/boost/asio/detail/timer_queue_ptime.hpp [5:5]
@@ -425,10 +435,7 @@ BELONGS ya.make
include/boost/asio/experimental/co_composed.hpp [5:5]
include/boost/asio/experimental/concurrent_channel.hpp [5:5]
include/boost/asio/experimental/deferred.hpp [5:5]
- include/boost/asio/experimental/detail/channel_handler.hpp [5:5]
- include/boost/asio/experimental/detail/channel_message.hpp [5:5]
include/boost/asio/experimental/detail/channel_operation.hpp [5:5]
- include/boost/asio/experimental/detail/channel_payload.hpp [5:5]
include/boost/asio/experimental/detail/channel_receive_op.hpp [5:5]
include/boost/asio/experimental/detail/channel_send_functions.hpp [5:5]
include/boost/asio/experimental/detail/channel_send_op.hpp [5:5]
@@ -437,7 +444,6 @@ BELONGS ya.make
include/boost/asio/experimental/detail/impl/channel_service.hpp [5:5]
include/boost/asio/experimental/impl/as_single.hpp [5:5]
include/boost/asio/experimental/impl/channel_error.ipp [5:5]
- include/boost/asio/experimental/impl/co_composed.hpp [5:5]
include/boost/asio/experimental/impl/parallel_group.hpp [5:5]
include/boost/asio/experimental/parallel_group.hpp [5:5]
include/boost/asio/experimental/prepend.hpp [5:5]
@@ -451,6 +457,7 @@ BELONGS ya.make
include/boost/asio/generic/stream_protocol.hpp [5:5]
include/boost/asio/handler_continuation_hook.hpp [5:5]
include/boost/asio/high_resolution_timer.hpp [5:5]
+ include/boost/asio/immediate.hpp [5:5]
include/boost/asio/impl/any_completion_executor.ipp [5:5]
include/boost/asio/impl/any_io_executor.ipp [5:5]
include/boost/asio/impl/append.hpp [5:5]
@@ -458,6 +465,8 @@ BELONGS ya.make
include/boost/asio/impl/awaitable.hpp [5:5]
include/boost/asio/impl/buffered_read_stream.hpp [5:5]
include/boost/asio/impl/buffered_write_stream.hpp [5:5]
+ include/boost/asio/impl/cancel_after.hpp [5:5]
+ include/boost/asio/impl/cancel_at.hpp [5:5]
include/boost/asio/impl/cancellation_signal.ipp [5:5]
include/boost/asio/impl/co_spawn.hpp [5:5]
include/boost/asio/impl/connect.hpp [5:5]
diff --git a/contrib/restricted/boost/asio/.yandex_meta/devtools.licenses.report b/contrib/restricted/boost/asio/.yandex_meta/devtools.licenses.report
index 84571c90fb6..a08b97b0e9c 100644
--- a/contrib/restricted/boost/asio/.yandex_meta/devtools.licenses.report
+++ b/contrib/restricted/boost/asio/.yandex_meta/devtools.licenses.report
@@ -90,17 +90,22 @@ BELONGS ya.make
include/boost/asio/buffered_write_stream.hpp [7:8]
include/boost/asio/buffered_write_stream_fwd.hpp [7:8]
include/boost/asio/buffers_iterator.hpp [7:8]
+ include/boost/asio/cancel_after.hpp [7:8]
+ include/boost/asio/cancel_at.hpp [7:8]
include/boost/asio/cancellation_signal.hpp [7:8]
include/boost/asio/cancellation_state.hpp [7:8]
include/boost/asio/cancellation_type.hpp [7:8]
+ include/boost/asio/co_composed.hpp [7:8]
include/boost/asio/co_spawn.hpp [7:8]
include/boost/asio/completion_condition.hpp [7:8]
include/boost/asio/compose.hpp [7:8]
+ include/boost/asio/composed.hpp [7:8]
include/boost/asio/connect.hpp [7:8]
include/boost/asio/connect_pipe.hpp [7:8]
include/boost/asio/consign.hpp [7:8]
include/boost/asio/coroutine.hpp [7:8]
include/boost/asio/deadline_timer.hpp [7:8]
+ include/boost/asio/default_completion_token.hpp [7:8]
include/boost/asio/defer.hpp [7:8]
include/boost/asio/deferred.hpp [7:8]
include/boost/asio/detached.hpp [7:8]
@@ -119,6 +124,9 @@ BELONGS ya.make
include/boost/asio/detail/chrono.hpp [7:8]
include/boost/asio/detail/chrono_time_traits.hpp [7:8]
include/boost/asio/detail/completion_handler.hpp [7:8]
+ include/boost/asio/detail/completion_message.hpp [7:8]
+ include/boost/asio/detail/completion_payload.hpp [7:8]
+ include/boost/asio/detail/completion_payload_handler.hpp [7:8]
include/boost/asio/detail/composed_work.hpp [7:8]
include/boost/asio/detail/concurrency_hint.hpp [7:8]
include/boost/asio/detail/conditionally_enabled_event.hpp [7:8]
@@ -211,6 +219,7 @@ BELONGS ya.make
include/boost/asio/detail/initiate_defer.hpp [7:8]
include/boost/asio/detail/initiate_dispatch.hpp [7:8]
include/boost/asio/detail/initiate_post.hpp [7:8]
+ include/boost/asio/detail/initiation_base.hpp [7:8]
include/boost/asio/detail/io_control.hpp [7:8]
include/boost/asio/detail/io_object_impl.hpp [7:8]
include/boost/asio/detail/io_uring_descriptor_read_at_op.hpp [7:8]
@@ -326,6 +335,7 @@ BELONGS ya.make
include/boost/asio/detail/thread_info_base.hpp [7:8]
include/boost/asio/detail/throw_error.hpp [7:8]
include/boost/asio/detail/throw_exception.hpp [7:8]
+ include/boost/asio/detail/timed_cancel_op.hpp [7:8]
include/boost/asio/detail/timer_queue.hpp [7:8]
include/boost/asio/detail/timer_queue_base.hpp [7:8]
include/boost/asio/detail/timer_queue_ptime.hpp [7:8]
@@ -418,10 +428,7 @@ BELONGS ya.make
include/boost/asio/experimental/coro.hpp [8:9]
include/boost/asio/experimental/coro_traits.hpp [8:9]
include/boost/asio/experimental/deferred.hpp [7:8]
- include/boost/asio/experimental/detail/channel_handler.hpp [7:8]
- include/boost/asio/experimental/detail/channel_message.hpp [7:8]
include/boost/asio/experimental/detail/channel_operation.hpp [7:8]
- include/boost/asio/experimental/detail/channel_payload.hpp [7:8]
include/boost/asio/experimental/detail/channel_receive_op.hpp [7:8]
include/boost/asio/experimental/detail/channel_send_functions.hpp [7:8]
include/boost/asio/experimental/detail/channel_send_op.hpp [7:8]
@@ -433,7 +440,6 @@ BELONGS ya.make
include/boost/asio/experimental/detail/partial_promise.hpp [8:9]
include/boost/asio/experimental/impl/as_single.hpp [7:8]
include/boost/asio/experimental/impl/channel_error.ipp [7:8]
- include/boost/asio/experimental/impl/co_composed.hpp [7:8]
include/boost/asio/experimental/impl/coro.hpp [8:9]
include/boost/asio/experimental/impl/parallel_group.hpp [7:8]
include/boost/asio/experimental/impl/promise.hpp [8:9]
@@ -454,6 +460,7 @@ BELONGS ya.make
include/boost/asio/generic/stream_protocol.hpp [7:8]
include/boost/asio/handler_continuation_hook.hpp [7:8]
include/boost/asio/high_resolution_timer.hpp [7:8]
+ include/boost/asio/immediate.hpp [7:8]
include/boost/asio/impl/any_completion_executor.ipp [7:8]
include/boost/asio/impl/any_io_executor.ipp [7:8]
include/boost/asio/impl/append.hpp [7:8]
@@ -461,6 +468,8 @@ BELONGS ya.make
include/boost/asio/impl/awaitable.hpp [7:8]
include/boost/asio/impl/buffered_read_stream.hpp [7:8]
include/boost/asio/impl/buffered_write_stream.hpp [7:8]
+ include/boost/asio/impl/cancel_after.hpp [7:8]
+ include/boost/asio/impl/cancel_at.hpp [7:8]
include/boost/asio/impl/cancellation_signal.ipp [7:8]
include/boost/asio/impl/co_spawn.hpp [7:8]
include/boost/asio/impl/connect.hpp [7:8]
diff --git a/contrib/restricted/boost/asio/include/boost/asio.hpp b/contrib/restricted/boost/asio/include/boost/asio.hpp
index a55617e03a8..09efee9d6ad 100644
--- a/contrib/restricted/boost/asio/include/boost/asio.hpp
+++ b/contrib/restricted/boost/asio/include/boost/asio.hpp
@@ -61,12 +61,16 @@
#include <boost/asio/buffered_write_stream_fwd.hpp>
#include <boost/asio/buffered_write_stream.hpp>
#include <boost/asio/buffers_iterator.hpp>
+#include <boost/asio/cancel_after.hpp>
+#include <boost/asio/cancel_at.hpp>
#include <boost/asio/cancellation_signal.hpp>
#include <boost/asio/cancellation_state.hpp>
#include <boost/asio/cancellation_type.hpp>
+#include <boost/asio/co_composed.hpp>
#include <boost/asio/co_spawn.hpp>
#include <boost/asio/completion_condition.hpp>
#include <boost/asio/compose.hpp>
+#include <boost/asio/composed.hpp>
#include <boost/asio/connect.hpp>
#include <boost/asio/connect_pipe.hpp>
#include <boost/asio/consign.hpp>
@@ -74,6 +78,7 @@
#include <boost/asio/deadline_timer.hpp>
#include <boost/asio/defer.hpp>
#include <boost/asio/deferred.hpp>
+#include <boost/asio/default_completion_token.hpp>
#include <boost/asio/detached.hpp>
#include <boost/asio/dispatch.hpp>
#include <boost/asio/error.hpp>
@@ -101,6 +106,7 @@
#include <boost/asio/generic/stream_protocol.hpp>
#include <boost/asio/handler_continuation_hook.hpp>
#include <boost/asio/high_resolution_timer.hpp>
+#include <boost/asio/immediate.hpp>
#include <boost/asio/io_context.hpp>
#include <boost/asio/io_context_strand.hpp>
#include <boost/asio/io_service.hpp>
diff --git a/contrib/restricted/boost/asio/include/boost/asio/as_tuple.hpp b/contrib/restricted/boost/asio/include/boost/asio/as_tuple.hpp
index 6e91d8edd52..be508b8681f 100644
--- a/contrib/restricted/boost/asio/include/boost/asio/as_tuple.hpp
+++ b/contrib/restricted/boost/asio/include/boost/asio/as_tuple.hpp
@@ -107,16 +107,42 @@ public:
CompletionToken token_;
};
-/// Adapt a @ref completion_token to specify that the completion handler
-/// arguments should be combined into a single tuple argument.
-template <typename CompletionToken>
-BOOST_ASIO_NODISCARD inline
-constexpr as_tuple_t<decay_t<CompletionToken>>
-as_tuple(CompletionToken&& completion_token)
+/// A function object type that adapts a @ref completion_token to specify that
+/// the completion handler arguments should be combined into a single tuple
+/// argument.
+/**
+ * May also be used directly as a completion token, in which case it adapts the
+ * asynchronous operation's default completion token (or boost::asio::deferred
+ * if no default is available).
+ */
+struct partial_as_tuple
{
- return as_tuple_t<decay_t<CompletionToken>>(
- static_cast<CompletionToken&&>(completion_token));
-}
+ /// Default constructor.
+ constexpr partial_as_tuple()
+ {
+ }
+
+ /// Adapt a @ref completion_token to specify that the completion handler
+ /// arguments should be combined into a single tuple argument.
+ template <typename CompletionToken>
+ BOOST_ASIO_NODISCARD inline
+ constexpr as_tuple_t<decay_t<CompletionToken>>
+ operator()(CompletionToken&& completion_token) const
+ {
+ return as_tuple_t<decay_t<CompletionToken>>(
+ static_cast<CompletionToken&&>(completion_token));
+ }
+};
+
+/// A function object that adapts a @ref completion_token to specify that the
+/// completion handler arguments should be combined into a single tuple
+/// argument.
+/**
+ * May also be used directly as a completion token, in which case it adapts the
+ * asynchronous operation's default completion token (or boost::asio::deferred
+ * if no default is available).
+ */
+BOOST_ASIO_INLINE_VARIABLE constexpr partial_as_tuple as_tuple;
} // namespace asio
} // namespace boost
diff --git a/contrib/restricted/boost/asio/include/boost/asio/associated_immediate_executor.hpp b/contrib/restricted/boost/asio/include/boost/asio/associated_immediate_executor.hpp
index 7e898f478f8..64fa4d943dc 100644
--- a/contrib/restricted/boost/asio/include/boost/asio/associated_immediate_executor.hpp
+++ b/contrib/restricted/boost/asio/include/boost/asio/associated_immediate_executor.hpp
@@ -50,9 +50,10 @@ struct has_immediate_executor_type<T,
template <typename E, typename = void, typename = void>
struct default_immediate_executor
{
- typedef require_result_t<E, execution::blocking_t::never_t> type;
+ typedef decay_t<require_result_t<E, execution::blocking_t::never_t>> type;
- static type get(const E& e) noexcept
+ static auto get(const E& e) noexcept
+ -> decltype(boost::asio::require(e, execution::blocking.never))
{
return boost::asio::require(e, execution::blocking.never);
}
diff --git a/contrib/restricted/boost/asio/include/boost/asio/associator.hpp b/contrib/restricted/boost/asio/include/boost/asio/associator.hpp
index 3096de3e2c1..d9f5e6e94e3 100644
--- a/contrib/restricted/boost/asio/include/boost/asio/associator.hpp
+++ b/contrib/restricted/boost/asio/include/boost/asio/associator.hpp
@@ -24,7 +24,7 @@ namespace asio {
/// Used to generically specialise associators for a type.
template <template <typename, typename> class Associator,
- typename T, typename DefaultCandidate>
+ typename T, typename DefaultCandidate, typename _ = void>
struct associator
{
};
diff --git a/contrib/restricted/boost/asio/include/boost/asio/async_result.hpp b/contrib/restricted/boost/asio/include/boost/asio/async_result.hpp
index 63d2169a568..894a94d231e 100644
--- a/contrib/restricted/boost/asio/include/boost/asio/async_result.hpp
+++ b/contrib/restricted/boost/asio/include/boost/asio/async_result.hpp
@@ -22,9 +22,6 @@
namespace boost {
namespace asio {
-
-#if defined(BOOST_ASIO_HAS_CONCEPTS)
-
namespace detail {
template <typename T>
@@ -71,6 +68,12 @@ struct are_completion_signatures : false_type
{
};
+template <>
+struct are_completion_signatures<>
+ : true_type
+{
+};
+
template <typename T0>
struct are_completion_signatures<T0>
: is_completion_signature<T0>
@@ -85,6 +88,12 @@ struct are_completion_signatures<T0, TN...>
{
};
+} // namespace detail
+
+#if defined(BOOST_ASIO_HAS_CONCEPTS)
+
+namespace detail {
+
template <typename T, typename... Args>
BOOST_ASIO_CONCEPT callable_with = requires(T&& t, Args&&... args)
{
@@ -607,14 +616,36 @@ template <typename CompletionToken,
typename Initiation, typename... Args>
inline auto async_initiate(Initiation&& initiation,
type_identity_t<CompletionToken>& token, Args&&... args)
- -> constraint_t<
- detail::async_result_has_initiate_memfn<
- CompletionToken, Signatures...>::value,
- decltype(
- async_result<decay_t<CompletionToken>, Signatures...>::initiate(
- static_cast<Initiation&&>(initiation),
- static_cast<CompletionToken&&>(token),
- static_cast<Args&&>(args)...))>
+ -> decltype(enable_if_t<
+ enable_if_t<
+ detail::are_completion_signatures<Signatures...>::value,
+ detail::async_result_has_initiate_memfn<
+ CompletionToken, Signatures...>>::value,
+ async_result<decay_t<CompletionToken>, Signatures...>>::initiate(
+ static_cast<Initiation&&>(initiation),
+ static_cast<CompletionToken&&>(token),
+ static_cast<Args&&>(args)...))
+{
+ return async_result<decay_t<CompletionToken>, Signatures...>::initiate(
+ static_cast<Initiation&&>(initiation),
+ static_cast<CompletionToken&&>(token),
+ static_cast<Args&&>(args)...);
+}
+
+template <
+ BOOST_ASIO_COMPLETION_SIGNATURE... Signatures,
+ typename CompletionToken, typename Initiation, typename... Args>
+inline auto async_initiate(Initiation&& initiation,
+ CompletionToken&& token, Args&&... args)
+ -> decltype(enable_if_t<
+ enable_if_t<
+ detail::are_completion_signatures<Signatures...>::value,
+ detail::async_result_has_initiate_memfn<
+ CompletionToken, Signatures...>>::value,
+ async_result<decay_t<CompletionToken>, Signatures...>>::initiate(
+ static_cast<Initiation&&>(initiation),
+ static_cast<CompletionToken&&>(token),
+ static_cast<Args&&>(args)...))
{
return async_result<decay_t<CompletionToken>, Signatures...>::initiate(
static_cast<Initiation&&>(initiation),
@@ -625,10 +656,13 @@ inline auto async_initiate(Initiation&& initiation,
template <typename CompletionToken,
BOOST_ASIO_COMPLETION_SIGNATURE... Signatures,
typename Initiation, typename... Args>
-inline constraint_t<
- !detail::async_result_has_initiate_memfn<
- CompletionToken, Signatures...>::value,
- typename async_result<decay_t<CompletionToken>, Signatures...>::return_type>
+inline typename enable_if_t<
+ !enable_if_t<
+ detail::are_completion_signatures<Signatures...>::value,
+ detail::async_result_has_initiate_memfn<
+ CompletionToken, Signatures...>>::value,
+ async_result<decay_t<CompletionToken>, Signatures...>
+ >::return_type
async_initiate(Initiation&& initiation,
type_identity_t<CompletionToken>& token, Args&&... args)
{
@@ -644,6 +678,29 @@ async_initiate(Initiation&& initiation,
return completion.result.get();
}
+template <BOOST_ASIO_COMPLETION_SIGNATURE... Signatures,
+ typename CompletionToken, typename Initiation, typename... Args>
+inline typename enable_if_t<
+ !enable_if_t<
+ detail::are_completion_signatures<Signatures...>::value,
+ detail::async_result_has_initiate_memfn<
+ CompletionToken, Signatures...>>::value,
+ async_result<decay_t<CompletionToken>, Signatures...>
+ >::return_type
+async_initiate(Initiation&& initiation, CompletionToken&& token, Args&&... args)
+{
+ async_completion<CompletionToken, Signatures...> completion(token);
+
+ static_cast<Initiation&&>(initiation)(
+ static_cast<
+ typename async_result<decay_t<CompletionToken>,
+ Signatures...>::completion_handler_type&&>(
+ completion.completion_handler),
+ static_cast<Args&&>(args)...);
+
+ return completion.result.get();
+}
+
#endif // defined(GENERATING_DOCUMENTATION)
#if defined(BOOST_ASIO_HAS_CONCEPTS)
@@ -883,62 +940,11 @@ template <typename T, typename... Args>
using completion_signature_of_t =
typename completion_signature_of<T, Args...>::type;
-namespace detail {
-
-template <typename T, typename = void>
-struct default_completion_token_impl
-{
- typedef void type;
-};
-
-template <typename T>
-struct default_completion_token_impl<T,
- void_t<typename T::default_completion_token_type>
- >
-{
- typedef typename T::default_completion_token_type type;
-};
-
-} // namespace detail
-
-#if defined(GENERATING_DOCUMENTATION)
-
-/// Traits type used to determine the default completion token type associated
-/// with a type (such as an executor).
-/**
- * A program may specialise this traits type if the @c T template parameter in
- * the specialisation is a user-defined type.
- *
- * Specialisations of this trait may provide a nested typedef @c type, which is
- * a default-constructible completion token type.
- */
-template <typename T>
-struct default_completion_token
-{
- /// If @c T has a nested type @c default_completion_token_type,
- /// <tt>T::default_completion_token_type</tt>. Otherwise the typedef @c type
- /// is not defined.
- typedef see_below type;
-};
-#else
-template <typename T>
-struct default_completion_token
- : detail::default_completion_token_impl<T>
-{
-};
-#endif
-
-template <typename T>
-using default_completion_token_t = typename default_completion_token<T>::type;
-
-#define BOOST_ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(e) \
- = typename ::boost::asio::default_completion_token<e>::type
-#define BOOST_ASIO_DEFAULT_COMPLETION_TOKEN(e) \
- = typename ::boost::asio::default_completion_token<e>::type()
-
} // namespace asio
} // namespace boost
#include <boost/asio/detail/pop_options.hpp>
+#include <boost/asio/default_completion_token.hpp>
+
#endif // BOOST_ASIO_ASYNC_RESULT_HPP
diff --git a/contrib/restricted/boost/asio/include/boost/asio/basic_datagram_socket.hpp b/contrib/restricted/boost/asio/include/boost/asio/basic_datagram_socket.hpp
index ecf1abb8486..88738d939c2 100644
--- a/contrib/restricted/boost/asio/include/boost/asio/basic_datagram_socket.hpp
+++ b/contrib/restricted/boost/asio/include/boost/asio/basic_datagram_socket.hpp
@@ -448,7 +448,7 @@ public:
* Regardless of whether the asynchronous operation completes immediately or
* not, the completion handler will not be invoked from within this function.
* On immediate completion, invocation of the handler will be performed in a
- * manner equivalent to using boost::asio::post().
+ * manner equivalent to using boost::asio::async_immediate().
*
* @par Completion Signature
* @code void(boost::system::error_code, std::size_t) @endcode
@@ -518,7 +518,7 @@ public:
* Regardless of whether the asynchronous operation completes immediately or
* not, the completion handler will not be invoked from within this function.
* On immediate completion, invocation of the handler will be performed in a
- * manner equivalent to using boost::asio::post().
+ * manner equivalent to using boost::asio::async_immediate().
*
* @par Completion Signature
* @code void(boost::system::error_code, std::size_t) @endcode
@@ -667,7 +667,7 @@ public:
* Regardless of whether the asynchronous operation completes immediately or
* not, the completion handler will not be invoked from within this function.
* On immediate completion, invocation of the handler will be performed in a
- * manner equivalent to using boost::asio::post().
+ * manner equivalent to using boost::asio::async_immediate().
*
* @par Completion Signature
* @code void(boost::system::error_code, std::size_t) @endcode
@@ -740,7 +740,7 @@ public:
* Regardless of whether the asynchronous operation completes immediately or
* not, the completion handler will not be invoked from within this function.
* On immediate completion, invocation of the handler will be performed in a
- * manner equivalent to using boost::asio::post().
+ * manner equivalent to using boost::asio::async_immediate().
*
* @par Completion Signature
* @code void(boost::system::error_code, std::size_t) @endcode
@@ -885,7 +885,7 @@ public:
* Regardless of whether the asynchronous operation completes immediately or
* not, the completion handler will not be invoked from within this function.
* On immediate completion, invocation of the handler will be performed in a
- * manner equivalent to using boost::asio::post().
+ * manner equivalent to using boost::asio::async_immediate().
*
* @par Completion Signature
* @code void(boost::system::error_code, std::size_t) @endcode
@@ -956,7 +956,7 @@ public:
* Regardless of whether the asynchronous operation completes immediately or
* not, the completion handler will not be invoked from within this function.
* On immediate completion, invocation of the handler will be performed in a
- * manner equivalent to using boost::asio::post().
+ * manner equivalent to using boost::asio::async_immediate().
*
* @par Completion Signature
* @code void(boost::system::error_code, std::size_t) @endcode
@@ -1027,7 +1027,7 @@ public:
boost::asio::detail::throw_error(ec, "receive_from");
return s;
}
-
+
/// Receive a datagram with the endpoint of the sender.
/**
* This function is used to receive a datagram. The function call will block
@@ -1054,7 +1054,7 @@ public:
boost::asio::detail::throw_error(ec, "receive_from");
return s;
}
-
+
/// Receive a datagram with the endpoint of the sender.
/**
* This function is used to receive a datagram. The function call will block
@@ -1108,7 +1108,7 @@ public:
* Regardless of whether the asynchronous operation completes immediately or
* not, the completion handler will not be invoked from within this function.
* On immediate completion, invocation of the handler will be performed in a
- * manner equivalent to using boost::asio::post().
+ * manner equivalent to using boost::asio::async_immediate().
*
* @par Completion Signature
* @code void(boost::system::error_code, std::size_t) @endcode
@@ -1180,7 +1180,7 @@ public:
* Regardless of whether the asynchronous operation completes immediately or
* not, the completion handler will not be invoked from within this function.
* On immediate completion, invocation of the handler will be performed in a
- * manner equivalent to using boost::asio::post().
+ * manner equivalent to using boost::asio::async_immediate().
*
* @par Completion Signature
* @code void(boost::system::error_code, std::size_t) @endcode
@@ -1220,7 +1220,7 @@ private:
const basic_datagram_socket&) = delete;
class initiate_async_send
- {
+ {
public:
typedef Executor executor_type;
diff --git a/contrib/restricted/boost/asio/include/boost/asio/basic_deadline_timer.hpp b/contrib/restricted/boost/asio/include/boost/asio/basic_deadline_timer.hpp
index 3d68f4528f6..742d6cb8fa8 100644
--- a/contrib/restricted/boost/asio/include/boost/asio/basic_deadline_timer.hpp
+++ b/contrib/restricted/boost/asio/include/boost/asio/basic_deadline_timer.hpp
@@ -64,7 +64,7 @@ namespace asio {
* timer.wait();
* @endcode
*
- * @par
+ * @par
* Performing an asynchronous wait:
* @code
* void handler(const boost::system::error_code& error)
@@ -631,7 +631,7 @@ public:
* Regardless of whether the asynchronous operation completes immediately or
* not, the completion handler will not be invoked from within this function.
* On immediate completion, invocation of the handler will be performed in a
- * manner equivalent to using boost::asio::post().
+ * manner equivalent to using boost::asio::async_immediate().
*
* @par Completion Signature
* @code void(boost::system::error_code) @endcode
diff --git a/contrib/restricted/boost/asio/include/boost/asio/basic_random_access_file.hpp b/contrib/restricted/boost/asio/include/boost/asio/basic_random_access_file.hpp
index f9e109bb526..099514f689a 100644
--- a/contrib/restricted/boost/asio/include/boost/asio/basic_random_access_file.hpp
+++ b/contrib/restricted/boost/asio/include/boost/asio/basic_random_access_file.hpp
@@ -428,7 +428,7 @@ public:
* Regardless of whether the asynchronous operation completes immediately or
* not, the completion handler will not be invoked from within this function.
* On immediate completion, invocation of the handler will be performed in a
- * manner equivalent to using boost::asio::post().
+ * manner equivalent to using boost::asio::async_immediate().
*
* @par Completion Signature
* @code void(boost::system::error_code, std::size_t) @endcode
@@ -563,7 +563,7 @@ public:
* Regardless of whether the asynchronous operation completes immediately or
* not, the completion handler will not be invoked from within this function.
* On immediate completion, invocation of the handler will be performed in a
- * manner equivalent to using boost::asio::post().
+ * manner equivalent to using boost::asio::async_immediate().
*
* @par Completion Signature
* @code void(boost::system::error_code, std::size_t) @endcode
diff --git a/contrib/restricted/boost/asio/include/boost/asio/basic_raw_socket.hpp b/contrib/restricted/boost/asio/include/boost/asio/basic_raw_socket.hpp
index f9c64d5d469..97dfd95f4bd 100644
--- a/contrib/restricted/boost/asio/include/boost/asio/basic_raw_socket.hpp
+++ b/contrib/restricted/boost/asio/include/boost/asio/basic_raw_socket.hpp
@@ -440,7 +440,7 @@ public:
* Regardless of whether the asynchronous operation completes immediately or
* not, the completion handler will not be invoked from within this function.
* On immediate completion, invocation of the handler will be performed in a
- * manner equivalent to using boost::asio::post().
+ * manner equivalent to using boost::asio::async_immediate().
*
* @par Completion Signature
* @code void(boost::system::error_code, std::size_t) @endcode
@@ -510,7 +510,7 @@ public:
* Regardless of whether the asynchronous operation completes immediately or
* not, the completion handler will not be invoked from within this function.
* On immediate completion, invocation of the handler will be performed in a
- * manner equivalent to using boost::asio::post().
+ * manner equivalent to using boost::asio::async_immediate().
*
* @par Completion Signature
* @code void(boost::system::error_code, std::size_t) @endcode
@@ -659,7 +659,7 @@ public:
* Regardless of whether the asynchronous operation completes immediately or
* not, the completion handler will not be invoked from within this function.
* On immediate completion, invocation of the handler will be performed in a
- * manner equivalent to using boost::asio::post().
+ * manner equivalent to using boost::asio::async_immediate().
*
* @par Completion Signature
* @code void(boost::system::error_code, std::size_t) @endcode
@@ -732,7 +732,7 @@ public:
* Regardless of whether the asynchronous operation completes immediately or
* not, the completion handler will not be invoked from within this function.
* On immediate completion, invocation of the handler will be performed in a
- * manner equivalent to using boost::asio::post().
+ * manner equivalent to using boost::asio::async_immediate().
*
* @par Completion Signature
* @code void(boost::system::error_code, std::size_t) @endcode
@@ -877,7 +877,7 @@ public:
* Regardless of whether the asynchronous operation completes immediately or
* not, the completion handler will not be invoked from within this function.
* On immediate completion, invocation of the handler will be performed in a
- * manner equivalent to using boost::asio::post().
+ * manner equivalent to using boost::asio::async_immediate().
*
* @par Completion Signature
* @code void(boost::system::error_code, std::size_t) @endcode
@@ -948,7 +948,7 @@ public:
* Regardless of whether the asynchronous operation completes immediately or
* not, the completion handler will not be invoked from within this function.
* On immediate completion, invocation of the handler will be performed in a
- * manner equivalent to using boost::asio::post().
+ * manner equivalent to using boost::asio::async_immediate().
*
* @par Completion Signature
* @code void(boost::system::error_code, std::size_t) @endcode
@@ -1020,7 +1020,7 @@ public:
boost::asio::detail::throw_error(ec, "receive_from");
return s;
}
-
+
/// Receive raw data with the endpoint of the sender.
/**
* This function is used to receive raw data. The function call will block
@@ -1047,7 +1047,7 @@ public:
boost::asio::detail::throw_error(ec, "receive_from");
return s;
}
-
+
/// Receive raw data with the endpoint of the sender.
/**
* This function is used to receive raw data. The function call will block
@@ -1101,7 +1101,7 @@ public:
* Regardless of whether the asynchronous operation completes immediately or
* not, the completion handler will not be invoked from within this function.
* On immediate completion, invocation of the handler will be performed in a
- * manner equivalent to using boost::asio::post().
+ * manner equivalent to using boost::asio::async_immediate().
*
* @par Completion Signature
* @code void(boost::system::error_code, std::size_t) @endcode
@@ -1174,7 +1174,7 @@ public:
* Regardless of whether the asynchronous operation completes immediately or
* not, the completion handler will not be invoked from within this function.
* On immediate completion, invocation of the handler will be performed in a
- * manner equivalent to using boost::asio::post().
+ * manner equivalent to using boost::asio::async_immediate().
*
* @par Completion Signature
* @code void(boost::system::error_code, std::size_t) @endcode
diff --git a/contrib/restricted/boost/asio/include/boost/asio/basic_readable_pipe.hpp b/contrib/restricted/boost/asio/include/boost/asio/basic_readable_pipe.hpp
index 9917823ec30..2e88cad8e7f 100644
--- a/contrib/restricted/boost/asio/include/boost/asio/basic_readable_pipe.hpp
+++ b/contrib/restricted/boost/asio/include/boost/asio/basic_readable_pipe.hpp
@@ -535,7 +535,7 @@ public:
* Regardless of whether the asynchronous operation completes immediately or
* not, the completion handler will not be invoked from within this function.
* On immediate completion, invocation of the handler will be performed in a
- * manner equivalent to using boost::asio::post().
+ * manner equivalent to using boost::asio::async_immediate().
*
* @par Completion Signature
* @code void(boost::system::error_code, std::size_t) @endcode
diff --git a/contrib/restricted/boost/asio/include/boost/asio/basic_seq_packet_socket.hpp b/contrib/restricted/boost/asio/include/boost/asio/basic_seq_packet_socket.hpp
index cf822cfde1b..7928d881ffa 100644
--- a/contrib/restricted/boost/asio/include/boost/asio/basic_seq_packet_socket.hpp
+++ b/contrib/restricted/boost/asio/include/boost/asio/basic_seq_packet_socket.hpp
@@ -431,7 +431,7 @@ public:
* Regardless of whether the asynchronous operation completes immediately or
* not, the completion handler will not be invoked from within this function.
* On immediate completion, invocation of the handler will be performed in a
- * manner equivalent to using boost::asio::post().
+ * manner equivalent to using boost::asio::async_immediate().
*
* @par Completion Signature
* @code void(boost::system::error_code, std::size_t) @endcode
@@ -621,7 +621,7 @@ public:
* Regardless of whether the asynchronous operation completes immediately or
* not, the completion handler will not be invoked from within this function.
* On immediate completion, invocation of the handler will be performed in a
- * manner equivalent to using boost::asio::post().
+ * manner equivalent to using boost::asio::async_immediate().
*
* @par Completion Signature
* @code void(boost::system::error_code, std::size_t) @endcode
@@ -695,7 +695,7 @@ public:
* Regardless of whether the asynchronous operation completes immediately or
* not, the completion handler will not be invoked from within this function.
* On immediate completion, invocation of the handler will be performed in a
- * manner equivalent to using boost::asio::post().
+ * manner equivalent to using boost::asio::async_immediate().
*
* @par Completion Signature
* @code void(boost::system::error_code, std::size_t) @endcode
diff --git a/contrib/restricted/boost/asio/include/boost/asio/basic_serial_port.hpp b/contrib/restricted/boost/asio/include/boost/asio/basic_serial_port.hpp
index c4cb0a3f059..fdfc01bfe9a 100644
--- a/contrib/restricted/boost/asio/include/boost/asio/basic_serial_port.hpp
+++ b/contrib/restricted/boost/asio/include/boost/asio/basic_serial_port.hpp
@@ -725,7 +725,7 @@ public:
* Regardless of whether the asynchronous operation completes immediately or
* not, the completion handler will not be invoked from within this function.
* On immediate completion, invocation of the handler will be performed in a
- * manner equivalent to using boost::asio::post().
+ * manner equivalent to using boost::asio::async_immediate().
*
* @par Completion Signature
* @code void(boost::system::error_code, std::size_t) @endcode
@@ -855,7 +855,7 @@ public:
* Regardless of whether the asynchronous operation completes immediately or
* not, the completion handler will not be invoked from within this function.
* On immediate completion, invocation of the handler will be performed in a
- * manner equivalent to using boost::asio::post().
+ * manner equivalent to using boost::asio::async_immediate().
*
* @par Completion Signature
* @code void(boost::system::error_code, std::size_t) @endcode
diff --git a/contrib/restricted/boost/asio/include/boost/asio/basic_signal_set.hpp b/contrib/restricted/boost/asio/include/boost/asio/basic_signal_set.hpp
index e4cde56419b..fb3b22d2e1c 100644
--- a/contrib/restricted/boost/asio/include/boost/asio/basic_signal_set.hpp
+++ b/contrib/restricted/boost/asio/include/boost/asio/basic_signal_set.hpp
@@ -574,7 +574,7 @@ public:
* Regardless of whether the asynchronous operation completes immediately or
* not, the completion handler will not be invoked from within this function.
* On immediate completion, invocation of the handler will be performed in a
- * manner equivalent to using boost::asio::post().
+ * manner equivalent to using boost::asio::async_immediate().
*
* @par Completion Signature
* @code void(boost::system::error_code, int) @endcode
diff --git a/contrib/restricted/boost/asio/include/boost/asio/basic_socket.hpp b/contrib/restricted/boost/asio/include/boost/asio/basic_socket.hpp
index 6eb4290c537..aacce47a788 100644
--- a/contrib/restricted/boost/asio/include/boost/asio/basic_socket.hpp
+++ b/contrib/restricted/boost/asio/include/boost/asio/basic_socket.hpp
@@ -928,7 +928,7 @@ public:
* Regardless of whether the asynchronous operation completes immediately or
* not, the completion handler will not be invoked from within this function.
* On immediate completion, invocation of the handler will be performed in a
- * manner equivalent to using boost::asio::post().
+ * manner equivalent to using boost::asio::async_immediate().
*
* @par Completion Signature
* @code void(boost::system::error_code) @endcode
@@ -1780,7 +1780,7 @@ public:
* Regardless of whether the asynchronous operation completes immediately or
* not, the completion handler will not be invoked from within this function.
* On immediate completion, invocation of the handler will be performed in a
- * manner equivalent to using boost::asio::post().
+ * manner equivalent to using boost::asio::async_immediate().
*
* @par Completion Signature
* @code void(boost::system::error_code) @endcode
diff --git a/contrib/restricted/boost/asio/include/boost/asio/basic_socket_acceptor.hpp b/contrib/restricted/boost/asio/include/boost/asio/basic_socket_acceptor.hpp
index cefc3623729..a2254a43e96 100644
--- a/contrib/restricted/boost/asio/include/boost/asio/basic_socket_acceptor.hpp
+++ b/contrib/restricted/boost/asio/include/boost/asio/basic_socket_acceptor.hpp
@@ -1214,7 +1214,7 @@ public:
* Regardless of whether the asynchronous operation completes immediately or
* not, the completion handler will not be invoked from within this function.
* On immediate completion, invocation of the handler will be performed in a
- * manner equivalent to using boost::asio::post().
+ * manner equivalent to using boost::asio::async_immediate().
*
* @par Completion Signature
* @code void(boost::system::error_code) @endcode
@@ -1349,7 +1349,7 @@ public:
* Regardless of whether the asynchronous operation completes immediately or
* not, the completion handler will not be invoked from within this function.
* On immediate completion, invocation of the handler will be performed in a
- * manner equivalent to using boost::asio::post().
+ * manner equivalent to using boost::asio::async_immediate().
*
* @par Completion Signature
* @code void(boost::system::error_code) @endcode
@@ -1497,7 +1497,7 @@ public:
* Regardless of whether the asynchronous operation completes immediately or
* not, the completion handler will not be invoked from within this function.
* On immediate completion, invocation of the handler will be performed in a
- * manner equivalent to using boost::asio::post().
+ * manner equivalent to using boost::asio::async_immediate().
*
* @par Completion Signature
* @code void(boost::system::error_code) @endcode
@@ -1617,7 +1617,7 @@ public:
* Regardless of whether the asynchronous operation completes immediately or
* not, the completion handler will not be invoked from within this function.
* On immediate completion, invocation of the handler will be performed in a
- * manner equivalent to using boost::asio::post().
+ * manner equivalent to using boost::asio::async_immediate().
*
* @par Completion Signature
* @code void(boost::system::error_code,
@@ -1867,7 +1867,7 @@ public:
* Regardless of whether the asynchronous operation completes immediately or
* not, the completion handler will not be invoked from within this function.
* On immediate completion, invocation of the handler will be performed in a
- * manner equivalent to using boost::asio::post().
+ * manner equivalent to using boost::asio::async_immediate().
*
* @par Completion Signature
* @code void(boost::system::error_code,
@@ -1963,7 +1963,7 @@ public:
* Regardless of whether the asynchronous operation completes immediately or
* not, the completion handler will not be invoked from within this function.
* On immediate completion, invocation of the handler will be performed in a
- * manner equivalent to using boost::asio::post().
+ * manner equivalent to using boost::asio::async_immediate().
*
* @par Completion Signature
* @code void(boost::system::error_code,
@@ -2133,7 +2133,7 @@ public:
* Regardless of whether the asynchronous operation completes immediately or
* not, the completion handler will not be invoked from within this function.
* On immediate completion, invocation of the handler will be performed in a
- * manner equivalent to using boost::asio::post().
+ * manner equivalent to using boost::asio::async_immediate().
*
* @par Completion Signature
* @code void(boost::system::error_code,
@@ -2415,7 +2415,7 @@ public:
* Regardless of whether the asynchronous operation completes immediately or
* not, the completion handler will not be invoked from within this function.
* On immediate completion, invocation of the handler will be performed in a
- * manner equivalent to using boost::asio::post().
+ * manner equivalent to using boost::asio::async_immediate().
*
* @par Completion Signature
* @code void(boost::system::error_code,
@@ -2515,7 +2515,7 @@ public:
* Regardless of whether the asynchronous operation completes immediately or
* not, the completion handler will not be invoked from within this function.
* On immediate completion, invocation of the handler will be performed in a
- * manner equivalent to using boost::asio::post().
+ * manner equivalent to using boost::asio::async_immediate().
*
* @par Completion Signature
* @code void(boost::system::error_code,
diff --git a/contrib/restricted/boost/asio/include/boost/asio/basic_stream_file.hpp b/contrib/restricted/boost/asio/include/boost/asio/basic_stream_file.hpp
index 314506f71c7..b99fa9b60b6 100644
--- a/contrib/restricted/boost/asio/include/boost/asio/basic_stream_file.hpp
+++ b/contrib/restricted/boost/asio/include/boost/asio/basic_stream_file.hpp
@@ -491,7 +491,7 @@ public:
* Regardless of whether the asynchronous operation completes immediately or
* not, the completion handler will not be invoked from within this function.
* On immediate completion, invocation of the handler will be performed in a
- * manner equivalent to using boost::asio::post().
+ * manner equivalent to using boost::asio::async_immediate().
*
* @par Completion Signature
* @code void(boost::system::error_code, std::size_t) @endcode
@@ -619,7 +619,7 @@ public:
* Regardless of whether the asynchronous operation completes immediately or
* not, the completion handler will not be invoked from within this function.
* On immediate completion, invocation of the handler will be performed in a
- * manner equivalent to using boost::asio::post().
+ * manner equivalent to using boost::asio::async_immediate().
*
* @par Completion Signature
* @code void(boost::system::error_code, std::size_t) @endcode
diff --git a/contrib/restricted/boost/asio/include/boost/asio/basic_stream_socket.hpp b/contrib/restricted/boost/asio/include/boost/asio/basic_stream_socket.hpp
index 55a6ccafe2c..77896a48aea 100644
--- a/contrib/restricted/boost/asio/include/boost/asio/basic_stream_socket.hpp
+++ b/contrib/restricted/boost/asio/include/boost/asio/basic_stream_socket.hpp
@@ -462,7 +462,7 @@ public:
* Regardless of whether the asynchronous operation completes immediately or
* not, the completion handler will not be invoked from within this function.
* On immediate completion, invocation of the handler will be performed in a
- * manner equivalent to using boost::asio::post().
+ * manner equivalent to using boost::asio::async_immediate().
*
* @par Completion Signature
* @code void(boost::system::error_code, std::size_t) @endcode
@@ -532,7 +532,7 @@ public:
* Regardless of whether the asynchronous operation completes immediately or
* not, the completion handler will not be invoked from within this function.
* On immediate completion, invocation of the handler will be performed in a
- * manner equivalent to using boost::asio::post().
+ * manner equivalent to using boost::asio::async_immediate().
*
* @par Completion Signature
* @code void(boost::system::error_code, std::size_t) @endcode
@@ -704,7 +704,7 @@ public:
* Regardless of whether the asynchronous operation completes immediately or
* not, the completion handler will not be invoked from within this function.
* On immediate completion, invocation of the handler will be performed in a
- * manner equivalent to using boost::asio::post().
+ * manner equivalent to using boost::asio::async_immediate().
*
* @par Completion Signature
* @code void(boost::system::error_code, std::size_t) @endcode
@@ -776,7 +776,7 @@ public:
* Regardless of whether the asynchronous operation completes immediately or
* not, the completion handler will not be invoked from within this function.
* On immediate completion, invocation of the handler will be performed in a
- * manner equivalent to using boost::asio::post().
+ * manner equivalent to using boost::asio::async_immediate().
*
* @par Completion Signature
* @code void(boost::system::error_code, std::size_t) @endcode
@@ -906,7 +906,7 @@ public:
* Regardless of whether the asynchronous operation completes immediately or
* not, the completion handler will not be invoked from within this function.
* On immediate completion, invocation of the handler will be performed in a
- * manner equivalent to using boost::asio::post().
+ * manner equivalent to using boost::asio::async_immediate().
*
* @par Completion Signature
* @code void(boost::system::error_code, std::size_t) @endcode
@@ -1037,7 +1037,7 @@ public:
* Regardless of whether the asynchronous operation completes immediately or
* not, the completion handler will not be invoked from within this function.
* On immediate completion, invocation of the handler will be performed in a
- * manner equivalent to using boost::asio::post().
+ * manner equivalent to using boost::asio::async_immediate().
*
* @par Completion Signature
* @code void(boost::system::error_code, std::size_t) @endcode
diff --git a/contrib/restricted/boost/asio/include/boost/asio/basic_waitable_timer.hpp b/contrib/restricted/boost/asio/include/boost/asio/basic_waitable_timer.hpp
index eb8967e42da..484b3118623 100644
--- a/contrib/restricted/boost/asio/include/boost/asio/basic_waitable_timer.hpp
+++ b/contrib/restricted/boost/asio/include/boost/asio/basic_waitable_timer.hpp
@@ -76,7 +76,7 @@ class basic_waitable_timer;
* timer.wait();
* @endcode
*
- * @par
+ * @par
* Performing an asynchronous wait (C++11):
* @code
* void handler(const boost::system::error_code& error)
@@ -747,7 +747,7 @@ public:
* Regardless of whether the asynchronous operation completes immediately or
* not, the completion handler will not be invoked from within this function.
* On immediate completion, invocation of the handler will be performed in a
- * manner equivalent to using boost::asio::post().
+ * manner equivalent to using boost::asio::async_immediate().
*
* @par Completion Signature
* @code void(boost::system::error_code) @endcode
diff --git a/contrib/restricted/boost/asio/include/boost/asio/basic_writable_pipe.hpp b/contrib/restricted/boost/asio/include/boost/asio/basic_writable_pipe.hpp
index 2e7536cd040..9aa58525f2e 100644
--- a/contrib/restricted/boost/asio/include/boost/asio/basic_writable_pipe.hpp
+++ b/contrib/restricted/boost/asio/include/boost/asio/basic_writable_pipe.hpp
@@ -533,7 +533,7 @@ public:
* Regardless of whether the asynchronous operation completes immediately or
* not, the completion handler will not be invoked from within this function.
* On immediate completion, invocation of the handler will be performed in a
- * manner equivalent to using boost::asio::post().
+ * manner equivalent to using boost::asio::async_immediate().
*
* @par Completion Signature
* @code void(boost::system::error_code, std::size_t) @endcode
diff --git a/contrib/restricted/boost/asio/include/boost/asio/bind_allocator.hpp b/contrib/restricted/boost/asio/include/boost/asio/bind_allocator.hpp
index 9a7134adce7..ac7faaf8c66 100644
--- a/contrib/restricted/boost/asio/include/boost/asio/bind_allocator.hpp
+++ b/contrib/restricted/boost/asio/include/boost/asio/bind_allocator.hpp
@@ -16,10 +16,12 @@
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
#include <boost/asio/detail/config.hpp>
-#include <boost/asio/detail/type_traits.hpp>
#include <boost/asio/associated_allocator.hpp>
+#include <boost/asio/associated_executor.hpp>
#include <boost/asio/associator.hpp>
#include <boost/asio/async_result.hpp>
+#include <boost/asio/detail/initiation_base.hpp>
+#include <boost/asio/detail/type_traits.hpp>
#include <boost/asio/detail/push_options.hpp>
@@ -361,6 +363,46 @@ private:
T target_;
};
+/// A function object type that adapts a @ref completion_token to specify that
+/// the completion handler should have the supplied allocator as its associated
+/// allocator.
+/**
+ * May also be used directly as a completion token, in which case it adapts the
+ * asynchronous operation's default completion token (or boost::asio::deferred
+ * if no default is available).
+ */
+template <typename Allocator>
+struct partial_allocator_binder
+{
+ /// Constructor that specifies associated allocator.
+ explicit partial_allocator_binder(const Allocator& ex)
+ : allocator_(ex)
+ {
+ }
+
+ /// Adapt a @ref completion_token to specify that the completion handler
+ /// should have the allocator as its associated allocator.
+ template <typename CompletionToken>
+ BOOST_ASIO_NODISCARD inline
+ constexpr allocator_binder<decay_t<CompletionToken>, Allocator>
+ operator()(CompletionToken&& completion_token) const
+ {
+ return allocator_binder<decay_t<CompletionToken>, Allocator>(
+ allocator_, static_cast<CompletionToken&&>(completion_token));
+ }
+
+//private:
+ Allocator allocator_;
+};
+
+/// Create a partial completion token that associates an allocator.
+template <typename Allocator>
+BOOST_ASIO_NODISCARD inline partial_allocator_binder<Allocator>
+bind_allocator(const Allocator& ex)
+{
+ return partial_allocator_binder<Allocator>(ex);
+}
+
/// Associate an object of type @c T with an allocator of type
/// @c Allocator.
template <typename Allocator, typename T>
@@ -438,49 +480,48 @@ public:
}
template <typename Initiation>
- struct init_wrapper
+ struct init_wrapper : detail::initiation_base<Initiation>
{
- template <typename Init>
- init_wrapper(const Allocator& allocator, Init&& init)
- : allocator_(allocator),
- initiation_(static_cast<Init&&>(init))
- {
- }
+ using detail::initiation_base<Initiation>::initiation_base;
template <typename Handler, typename... Args>
- void operator()(Handler&& handler, Args&&... args)
+ void operator()(Handler&& handler, const Allocator& a, Args&&... args) &&
{
- static_cast<Initiation&&>(initiation_)(
+ static_cast<Initiation&&>(*this)(
allocator_binder<decay_t<Handler>, Allocator>(
- allocator_, static_cast<Handler&&>(handler)),
+ a, static_cast<Handler&&>(handler)),
static_cast<Args&&>(args)...);
}
template <typename Handler, typename... Args>
- void operator()(Handler&& handler, Args&&... args) const
+ void operator()(Handler&& handler,
+ const Allocator& a, Args&&... args) const &
{
- initiation_(
+ static_cast<const Initiation&>(*this)(
allocator_binder<decay_t<Handler>, Allocator>(
- allocator_, static_cast<Handler&&>(handler)),
+ a, static_cast<Handler&&>(handler)),
static_cast<Args&&>(args)...);
}
-
- Allocator allocator_;
- Initiation initiation_;
};
template <typename Initiation, typename RawCompletionToken, typename... Args>
static auto initiate(Initiation&& initiation,
RawCompletionToken&& token, Args&&... args)
-> decltype(
- async_initiate<T, Signature>(
+ async_initiate<
+ conditional_t<
+ is_const<remove_reference_t<RawCompletionToken>>::value, const T, T>,
+ Signature>(
declval<init_wrapper<decay_t<Initiation>>>(),
- token.get(), static_cast<Args&&>(args)...))
+ token.get(), token.get_allocator(), static_cast<Args&&>(args)...))
{
- return async_initiate<T, Signature>(
- init_wrapper<decay_t<Initiation>>(token.get_allocator(),
+ return async_initiate<
+ conditional_t<
+ is_const<remove_reference_t<RawCompletionToken>>::value, const T, T>,
+ Signature>(
+ init_wrapper<decay_t<Initiation>>(
static_cast<Initiation&&>(initiation)),
- token.get(), static_cast<Args&&>(args)...);
+ token.get(), token.get_allocator(), static_cast<Args&&>(args)...);
}
private:
@@ -490,6 +531,31 @@ private:
async_result<T, Signature> target_;
};
+template <typename Allocator, typename... Signatures>
+struct async_result<partial_allocator_binder<Allocator>, Signatures...>
+{
+ template <typename Initiation, typename RawCompletionToken, typename... Args>
+ static auto initiate(Initiation&& initiation,
+ RawCompletionToken&& token, Args&&... args)
+ -> decltype(
+ async_initiate<Signatures...>(
+ static_cast<Initiation&&>(initiation),
+ allocator_binder<
+ default_completion_token_t<associated_executor_t<Initiation>>,
+ Allocator>(token.allocator_,
+ default_completion_token_t<associated_executor_t<Initiation>>{}),
+ static_cast<Args&&>(args)...))
+ {
+ return async_initiate<Signatures...>(
+ static_cast<Initiation&&>(initiation),
+ allocator_binder<
+ default_completion_token_t<associated_executor_t<Initiation>>,
+ Allocator>(token.allocator_,
+ default_completion_token_t<associated_executor_t<Initiation>>{}),
+ static_cast<Args&&>(args)...);
+ }
+};
+
template <template <typename, typename> class Associator,
typename T, typename Allocator, typename DefaultCandidate>
struct associator<Associator, allocator_binder<T, Allocator>, DefaultCandidate>
diff --git a/contrib/restricted/boost/asio/include/boost/asio/bind_cancellation_slot.hpp b/contrib/restricted/boost/asio/include/boost/asio/bind_cancellation_slot.hpp
index acf724b9eb0..38e8571fbec 100644
--- a/contrib/restricted/boost/asio/include/boost/asio/bind_cancellation_slot.hpp
+++ b/contrib/restricted/boost/asio/include/boost/asio/bind_cancellation_slot.hpp
@@ -16,10 +16,12 @@
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
#include <boost/asio/detail/config.hpp>
-#include <boost/asio/detail/type_traits.hpp>
#include <boost/asio/associated_cancellation_slot.hpp>
+#include <boost/asio/associated_executor.hpp>
#include <boost/asio/associator.hpp>
#include <boost/asio/async_result.hpp>
+#include <boost/asio/detail/initiation_base.hpp>
+#include <boost/asio/detail/type_traits.hpp>
#include <boost/asio/detail/push_options.hpp>
@@ -367,6 +369,46 @@ private:
T target_;
};
+/// A function object type that adapts a @ref completion_token to specify that
+/// the completion handler should have the supplied cancellation slot as its
+/// associated cancellation slot.
+/**
+ * May also be used directly as a completion token, in which case it adapts the
+ * asynchronous operation's default completion token (or boost::asio::deferred
+ * if no default is available).
+ */
+template <typename CancellationSlot>
+struct partial_cancellation_slot_binder
+{
+ /// Constructor that specifies associated cancellation slot.
+ explicit partial_cancellation_slot_binder(const CancellationSlot& ex)
+ : cancellation_slot_(ex)
+ {
+ }
+
+ /// Adapt a @ref completion_token to specify that the completion handler
+ /// should have the cancellation slot as its associated cancellation slot.
+ template <typename CompletionToken>
+ BOOST_ASIO_NODISCARD inline
+ constexpr cancellation_slot_binder<decay_t<CompletionToken>, CancellationSlot>
+ operator()(CompletionToken&& completion_token) const
+ {
+ return cancellation_slot_binder<decay_t<CompletionToken>, CancellationSlot>(
+ static_cast<CompletionToken&&>(completion_token), cancellation_slot_);
+ }
+
+//private:
+ CancellationSlot cancellation_slot_;
+};
+
+/// Create a partial completion token that associates a cancellation slot.
+template <typename CancellationSlot>
+BOOST_ASIO_NODISCARD inline partial_cancellation_slot_binder<CancellationSlot>
+bind_cancellation_slot(const CancellationSlot& ex)
+{
+ return partial_cancellation_slot_binder<CancellationSlot>(ex);
+}
+
/// Associate an object of type @c T with a cancellation slot of type
/// @c CancellationSlot.
template <typename CancellationSlot, typename T>
@@ -447,50 +489,51 @@ public:
}
template <typename Initiation>
- struct init_wrapper
+ struct init_wrapper : detail::initiation_base<Initiation>
{
- template <typename Init>
- init_wrapper(const CancellationSlot& slot, Init&& init)
- : slot_(slot),
- initiation_(static_cast<Init&&>(init))
- {
- }
+ using detail::initiation_base<Initiation>::initiation_base;
template <typename Handler, typename... Args>
- void operator()(Handler&& handler, Args&&... args)
+ void operator()(Handler&& handler,
+ const CancellationSlot& slot, Args&&... args) &&
{
- static_cast<Initiation&&>(initiation_)(
+ static_cast<Initiation&&>(*this)(
cancellation_slot_binder<decay_t<Handler>, CancellationSlot>(
- slot_, static_cast<Handler&&>(handler)),
+ slot, static_cast<Handler&&>(handler)),
static_cast<Args&&>(args)...);
}
template <typename Handler, typename... Args>
- void operator()(Handler&& handler, Args&&... args) const
+ void operator()(Handler&& handler,
+ const CancellationSlot& slot, Args&&... args) const &
{
- initiation_(
+ static_cast<const Initiation&>(*this)(
cancellation_slot_binder<decay_t<Handler>, CancellationSlot>(
- slot_, static_cast<Handler&&>(handler)),
+ slot, static_cast<Handler&&>(handler)),
static_cast<Args&&>(args)...);
}
-
- CancellationSlot slot_;
- Initiation initiation_;
};
template <typename Initiation, typename RawCompletionToken, typename... Args>
static auto initiate(Initiation&& initiation,
RawCompletionToken&& token, Args&&... args)
-> decltype(
- async_initiate<T, Signature>(
+ async_initiate<
+ conditional_t<
+ is_const<remove_reference_t<RawCompletionToken>>::value, const T, T>,
+ Signature>(
declval<init_wrapper<decay_t<Initiation>>>(),
- token.get(), static_cast<Args&&>(args)...))
+ token.get(), token.get_cancellation_slot(),
+ static_cast<Args&&>(args)...))
{
- return async_initiate<T, Signature>(
+ return async_initiate<
+ conditional_t<
+ is_const<remove_reference_t<RawCompletionToken>>::value, const T, T>,
+ Signature>(
init_wrapper<decay_t<Initiation>>(
- token.get_cancellation_slot(),
static_cast<Initiation&&>(initiation)),
- token.get(), static_cast<Args&&>(args)...);
+ token.get(), token.get_cancellation_slot(),
+ static_cast<Args&&>(args)...);
}
private:
@@ -500,6 +543,32 @@ private:
async_result<T, Signature> target_;
};
+template <typename CancellationSlot, typename... Signatures>
+struct async_result<partial_cancellation_slot_binder<CancellationSlot>,
+ Signatures...>
+{
+ template <typename Initiation, typename RawCompletionToken, typename... Args>
+ static auto initiate(Initiation&& initiation,
+ RawCompletionToken&& token, Args&&... args)
+ -> decltype(
+ async_initiate<Signatures...>(
+ static_cast<Initiation&&>(initiation),
+ cancellation_slot_binder<
+ default_completion_token_t<associated_executor_t<Initiation>>,
+ CancellationSlot>(token.cancellation_slot_,
+ default_completion_token_t<associated_executor_t<Initiation>>{}),
+ static_cast<Args&&>(args)...))
+ {
+ return async_initiate<Signatures...>(
+ static_cast<Initiation&&>(initiation),
+ cancellation_slot_binder<
+ default_completion_token_t<associated_executor_t<Initiation>>,
+ CancellationSlot>(token.cancellation_slot_,
+ default_completion_token_t<associated_executor_t<Initiation>>{}),
+ static_cast<Args&&>(args)...);
+ }
+};
+
template <template <typename, typename> class Associator,
typename T, typename CancellationSlot, typename DefaultCandidate>
struct associator<Associator,
diff --git a/contrib/restricted/boost/asio/include/boost/asio/bind_executor.hpp b/contrib/restricted/boost/asio/include/boost/asio/bind_executor.hpp
index b38d2c8933f..818b32e4b07 100644
--- a/contrib/restricted/boost/asio/include/boost/asio/bind_executor.hpp
+++ b/contrib/restricted/boost/asio/include/boost/asio/bind_executor.hpp
@@ -16,10 +16,11 @@
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
#include <boost/asio/detail/config.hpp>
-#include <boost/asio/detail/type_traits.hpp>
#include <boost/asio/associated_executor.hpp>
#include <boost/asio/associator.hpp>
#include <boost/asio/async_result.hpp>
+#include <boost/asio/detail/initiation_base.hpp>
+#include <boost/asio/detail/type_traits.hpp>
#include <boost/asio/execution/executor.hpp>
#include <boost/asio/execution_context.hpp>
#include <boost/asio/is_executor.hpp>
@@ -395,6 +396,49 @@ private:
uses_executor<T, Executor>::value> base_type;
};
+/// A function object type that adapts a @ref completion_token to specify that
+/// the completion handler should have the supplied executor as its associated
+/// executor.
+/**
+ * May also be used directly as a completion token, in which case it adapts the
+ * asynchronous operation's default completion token (or boost::asio::deferred
+ * if no default is available).
+ */
+template <typename Executor>
+struct partial_executor_binder
+{
+ /// Constructor that specifies associated executor.
+ explicit partial_executor_binder(const Executor& ex)
+ : executor_(ex)
+ {
+ }
+
+ /// Adapt a @ref completion_token to specify that the completion handler
+ /// should have the executor as its associated executor.
+ template <typename CompletionToken>
+ BOOST_ASIO_NODISCARD inline
+ constexpr executor_binder<decay_t<CompletionToken>, Executor>
+ operator()(CompletionToken&& completion_token) const
+ {
+ return executor_binder<decay_t<CompletionToken>, Executor>(executor_arg_t(),
+ static_cast<CompletionToken&&>(completion_token), executor_);
+ }
+
+//private:
+ Executor executor_;
+};
+
+/// Create a partial completion token that associates an executor.
+template <typename Executor>
+BOOST_ASIO_NODISCARD inline partial_executor_binder<Executor>
+bind_executor(const Executor& ex,
+ constraint_t<
+ is_executor<Executor>::value || execution::is_executor<Executor>::value
+ > = 0)
+{
+ return partial_executor_binder<Executor>(ex);
+}
+
/// Associate an object of type @c T with an executor of type @c Executor.
template <typename Executor, typename T>
BOOST_ASIO_NODISCARD inline executor_binder<decay_t<T>, Executor>
@@ -407,6 +451,20 @@ bind_executor(const Executor& ex, T&& t,
executor_arg_t(), ex, static_cast<T&&>(t));
}
+/// Create a partial completion token that associates an execution context's
+/// executor.
+template <typename ExecutionContext>
+BOOST_ASIO_NODISCARD inline partial_executor_binder<
+ typename ExecutionContext::executor_type>
+bind_executor(ExecutionContext& ctx,
+ constraint_t<
+ is_convertible<ExecutionContext&, execution_context&>::value
+ > = 0)
+{
+ return partial_executor_binder<typename ExecutionContext::executor_type>(
+ ctx.get_executor());
+}
+
/// Associate an object of type @c T with an execution context's executor.
template <typename ExecutionContext, typename T>
BOOST_ASIO_NODISCARD inline executor_binder<decay_t<T>,
@@ -492,49 +550,48 @@ public:
}
template <typename Initiation>
- struct init_wrapper
+ struct init_wrapper : detail::initiation_base<Initiation>
{
- template <typename Init>
- init_wrapper(const Executor& ex, Init&& init)
- : ex_(ex),
- initiation_(static_cast<Init&&>(init))
- {
- }
+ using detail::initiation_base<Initiation>::initiation_base;
template <typename Handler, typename... Args>
- void operator()(Handler&& handler, Args&&... args)
+ void operator()(Handler&& handler, const Executor& e, Args&&... args) &&
{
- static_cast<Initiation&&>(initiation_)(
+ static_cast<Initiation&&>(*this)(
executor_binder<decay_t<Handler>, Executor>(
- executor_arg_t(), ex_, static_cast<Handler&&>(handler)),
+ executor_arg_t(), e, static_cast<Handler&&>(handler)),
static_cast<Args&&>(args)...);
}
template <typename Handler, typename... Args>
- void operator()(Handler&& handler, Args&&... args) const
+ void operator()(Handler&& handler,
+ const Executor& e, Args&&... args) const &
{
- initiation_(
+ static_cast<const Initiation&>(*this)(
executor_binder<decay_t<Handler>, Executor>(
- executor_arg_t(), ex_, static_cast<Handler&&>(handler)),
+ executor_arg_t(), e, static_cast<Handler&&>(handler)),
static_cast<Args&&>(args)...);
}
-
- Executor ex_;
- Initiation initiation_;
};
template <typename Initiation, typename RawCompletionToken, typename... Args>
static auto initiate(Initiation&& initiation,
RawCompletionToken&& token, Args&&... args)
-> decltype(
- async_initiate<T, Signature>(
- declval<init_wrapper<decay_t<Initiation>>>(),
- token.get(), static_cast<Args&&>(args)...))
+ async_initiate<
+ conditional_t<
+ is_const<remove_reference_t<RawCompletionToken>>::value, const T, T>,
+ Signature>(
+ declval<init_wrapper<decay_t<Initiation>>>(),
+ token.get(), token.get_executor(), static_cast<Args&&>(args)...))
{
- return async_initiate<T, Signature>(
+ return async_initiate<
+ conditional_t<
+ is_const<remove_reference_t<RawCompletionToken>>::value, const T, T>,
+ Signature>(
init_wrapper<decay_t<Initiation>>(
- token.get_executor(), static_cast<Initiation&&>(initiation)),
- token.get(), static_cast<Args&&>(args)...);
+ static_cast<Initiation&&>(initiation)),
+ token.get(), token.get_executor(), static_cast<Args&&>(args)...);
}
private:
@@ -542,6 +599,31 @@ private:
async_result& operator=(const async_result&) = delete;
};
+template <typename Executor, typename... Signatures>
+struct async_result<partial_executor_binder<Executor>, Signatures...>
+{
+ template <typename Initiation, typename RawCompletionToken, typename... Args>
+ static auto initiate(Initiation&& initiation,
+ RawCompletionToken&& token, Args&&... args)
+ -> decltype(
+ async_initiate<Signatures...>(
+ static_cast<Initiation&&>(initiation),
+ executor_binder<
+ default_completion_token_t<associated_executor_t<Initiation>>,
+ Executor>(executor_arg_t(), token.executor_,
+ default_completion_token_t<associated_executor_t<Initiation>>{}),
+ static_cast<Args&&>(args)...))
+ {
+ return async_initiate<Signatures...>(
+ static_cast<Initiation&&>(initiation),
+ executor_binder<
+ default_completion_token_t<associated_executor_t<Initiation>>,
+ Executor>(executor_arg_t(), token.executor_,
+ default_completion_token_t<associated_executor_t<Initiation>>{}),
+ static_cast<Args&&>(args)...);
+ }
+};
+
template <template <typename, typename> class Associator,
typename T, typename Executor, typename DefaultCandidate>
struct associator<Associator, executor_binder<T, Executor>, DefaultCandidate>
diff --git a/contrib/restricted/boost/asio/include/boost/asio/bind_immediate_executor.hpp b/contrib/restricted/boost/asio/include/boost/asio/bind_immediate_executor.hpp
index b54288779be..fbf8c47325f 100644
--- a/contrib/restricted/boost/asio/include/boost/asio/bind_immediate_executor.hpp
+++ b/contrib/restricted/boost/asio/include/boost/asio/bind_immediate_executor.hpp
@@ -16,10 +16,12 @@
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
#include <boost/asio/detail/config.hpp>
-#include <boost/asio/detail/type_traits.hpp>
+#include <boost/asio/associated_executor.hpp>
#include <boost/asio/associated_immediate_executor.hpp>
#include <boost/asio/associator.hpp>
#include <boost/asio/async_result.hpp>
+#include <boost/asio/detail/initiation_base.hpp>
+#include <boost/asio/detail/type_traits.hpp>
#include <boost/asio/detail/push_options.hpp>
@@ -366,6 +368,46 @@ private:
T target_;
};
+/// A function object type that adapts a @ref completion_token to specify that
+/// the completion handler should have the supplied executor as its associated
+/// immediate executor.
+/**
+ * May also be used directly as a completion token, in which case it adapts the
+ * asynchronous operation's default completion token (or boost::asio::deferred
+ * if no default is available).
+ */
+template <typename Executor>
+struct partial_immediate_executor_binder
+{
+ /// Constructor that specifies associated executor.
+ explicit partial_immediate_executor_binder(const Executor& ex)
+ : executor_(ex)
+ {
+ }
+
+ /// Adapt a @ref completion_token to specify that the completion handler
+ /// should have the executor as its associated immediate executor.
+ template <typename CompletionToken>
+ BOOST_ASIO_NODISCARD inline
+ constexpr immediate_executor_binder<decay_t<CompletionToken>, Executor>
+ operator()(CompletionToken&& completion_token) const
+ {
+ return immediate_executor_binder<decay_t<CompletionToken>, Executor>(
+ static_cast<CompletionToken&&>(completion_token), executor_);
+ }
+
+//private:
+ Executor executor_;
+};
+
+/// Create a partial completion token that associates an executor.
+template <typename Executor>
+BOOST_ASIO_NODISCARD inline partial_immediate_executor_binder<Executor>
+bind_immediate_executor(const Executor& ex)
+{
+ return partial_immediate_executor_binder<Executor>(ex);
+}
+
/// Associate an object of type @c T with a immediate executor of type
/// @c Executor.
template <typename Executor, typename T>
@@ -450,52 +492,52 @@ public:
}
template <typename Initiation>
- struct init_wrapper
+ struct init_wrapper : detail::initiation_base<Initiation>
{
- template <typename Init>
- init_wrapper(const Executor& e, Init&& init)
- : executor_(e),
- initiation_(static_cast<Init&&>(init))
- {
- }
+ using detail::initiation_base<Initiation>::initiation_base;
template <typename Handler, typename... Args>
- void operator()(Handler&& handler, Args&&... args)
+ void operator()(Handler&& handler, const Executor& e, Args&&... args) &&
{
- static_cast<Initiation&&>(initiation_)(
+ static_cast<Initiation&&>(*this)(
immediate_executor_binder<
decay_t<Handler>, Executor>(
- executor_, static_cast<Handler&&>(handler)),
+ e, static_cast<Handler&&>(handler)),
static_cast<Args&&>(args)...);
}
template <typename Handler, typename... Args>
- void operator()(Handler&& handler, Args&&... args) const
+ void operator()(Handler&& handler,
+ const Executor& e, Args&&... args) const &
{
- initiation_(
+ static_cast<const Initiation&>(*this)(
immediate_executor_binder<
decay_t<Handler>, Executor>(
- executor_, static_cast<Handler&&>(handler)),
+ e, static_cast<Handler&&>(handler)),
static_cast<Args&&>(args)...);
}
-
- Executor executor_;
- Initiation initiation_;
};
template <typename Initiation, typename RawCompletionToken, typename... Args>
static auto initiate(Initiation&& initiation,
RawCompletionToken&& token, Args&&... args)
-> decltype(
- async_initiate<T, Signature>(
- declval<init_wrapper<decay_t<Initiation>>>(),
- token.get(), static_cast<Args&&>(args)...))
+ async_initiate<
+ conditional_t<
+ is_const<remove_reference_t<RawCompletionToken>>::value, const T, T>,
+ Signature>(
+ declval<init_wrapper<decay_t<Initiation>>>(),
+ token.get(), token.get_immediate_executor(),
+ static_cast<Args&&>(args)...))
{
- return async_initiate<T, Signature>(
+ return async_initiate<
+ conditional_t<
+ is_const<remove_reference_t<RawCompletionToken>>::value, const T, T>,
+ Signature>(
init_wrapper<decay_t<Initiation>>(
- token.get_immediate_executor(),
static_cast<Initiation&&>(initiation)),
- token.get(), static_cast<Args&&>(args)...);
+ token.get(), token.get_immediate_executor(),
+ static_cast<Args&&>(args)...);
}
private:
@@ -505,6 +547,31 @@ private:
async_result<T, Signature> target_;
};
+template <typename Executor, typename... Signatures>
+struct async_result<partial_immediate_executor_binder<Executor>, Signatures...>
+{
+ template <typename Initiation, typename RawCompletionToken, typename... Args>
+ static auto initiate(Initiation&& initiation,
+ RawCompletionToken&& token, Args&&... args)
+ -> decltype(
+ async_initiate<Signatures...>(
+ static_cast<Initiation&&>(initiation),
+ immediate_executor_binder<
+ default_completion_token_t<associated_executor_t<Initiation>>,
+ Executor>(token.executor_,
+ default_completion_token_t<associated_executor_t<Initiation>>{}),
+ static_cast<Args&&>(args)...))
+ {
+ return async_initiate<Signatures...>(
+ static_cast<Initiation&&>(initiation),
+ immediate_executor_binder<
+ default_completion_token_t<associated_executor_t<Initiation>>,
+ Executor>(token.executor_,
+ default_completion_token_t<associated_executor_t<Initiation>>{}),
+ static_cast<Args&&>(args)...);
+ }
+};
+
template <template <typename, typename> class Associator,
typename T, typename Executor, typename DefaultCandidate>
struct associator<Associator,
diff --git a/contrib/restricted/boost/asio/include/boost/asio/buffer.hpp b/contrib/restricted/boost/asio/include/boost/asio/buffer.hpp
index f149eb075ad..c82507c67af 100644
--- a/contrib/restricted/boost/asio/include/boost/asio/buffer.hpp
+++ b/contrib/restricted/boost/asio/include/boost/asio/buffer.hpp
@@ -950,7 +950,7 @@ BOOST_ASIO_NODISCARD inline BOOST_ASIO_MUTABLE_BUFFER buffer(
{
return BOOST_ASIO_MUTABLE_BUFFER(data, N * sizeof(PodType));
}
-
+
/// Create a new modifiable buffer that represents the given POD array.
/**
* @returns A mutable_buffer value equivalent to:
@@ -967,7 +967,7 @@ BOOST_ASIO_NODISCARD inline BOOST_ASIO_MUTABLE_BUFFER buffer(
N * sizeof(PodType) < max_size_in_bytes
? N * sizeof(PodType) : max_size_in_bytes);
}
-
+
/// Create a new non-modifiable buffer that represents the given POD array.
/**
* @returns A const_buffer value equivalent to:
diff --git a/contrib/restricted/boost/asio/include/boost/asio/buffer_registration.hpp b/contrib/restricted/boost/asio/include/boost/asio/buffer_registration.hpp
index fbab223688a..6b412ca6054 100644
--- a/contrib/restricted/boost/asio/include/boost/asio/buffer_registration.hpp
+++ b/contrib/restricted/boost/asio/include/boost/asio/buffer_registration.hpp
@@ -130,7 +130,7 @@ public:
service_->unregister_buffers();
#endif // defined(BOOST_ASIO_HAS_IO_URING)
}
-
+
/// Move assignment.
buffer_registration& operator=(buffer_registration&& other) noexcept
{
diff --git a/contrib/restricted/boost/asio/include/boost/asio/cancel_after.hpp b/contrib/restricted/boost/asio/include/boost/asio/cancel_after.hpp
new file mode 100644
index 00000000000..220402b9dcf
--- /dev/null
+++ b/contrib/restricted/boost/asio/include/boost/asio/cancel_after.hpp
@@ -0,0 +1,303 @@
+//
+// cancel_after.hpp
+// ~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+
+#ifndef BOOST_ASIO_CANCEL_AFTER_HPP
+#define BOOST_ASIO_CANCEL_AFTER_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include <boost/asio/detail/config.hpp>
+#include <boost/asio/basic_waitable_timer.hpp>
+#include <boost/asio/cancellation_type.hpp>
+#include <boost/asio/detail/chrono.hpp>
+#include <boost/asio/detail/type_traits.hpp>
+#include <boost/asio/wait_traits.hpp>
+
+#include <boost/asio/detail/push_options.hpp>
+
+namespace boost {
+namespace asio {
+
+/// A @ref completion_token adapter that cancels an operation after a timeout.
+/**
+ * The cancel_after_t class is used to indicate that an asynchronous operation
+ * should be cancelled if not complete before the specified duration has
+ * elapsed.
+ */
+template <typename CompletionToken, typename Clock,
+ typename WaitTraits = boost::asio::wait_traits<Clock>>
+class cancel_after_t
+{
+public:
+ /// Constructor.
+ template <typename T>
+ cancel_after_t(T&& completion_token, const typename Clock::duration& timeout,
+ cancellation_type_t cancel_type = cancellation_type::terminal)
+ : token_(static_cast<T&&>(completion_token)),
+ timeout_(timeout),
+ cancel_type_(cancel_type)
+ {
+ }
+
+//private:
+ CompletionToken token_;
+ typename Clock::duration timeout_;
+ cancellation_type_t cancel_type_;
+};
+
+/// A @ref completion_token adapter that cancels an operation after a timeout.
+/**
+ * The cancel_after_timer class is used to indicate that an asynchronous
+ * operation should be cancelled if not complete before the specified duration
+ * has elapsed.
+ */
+template <typename CompletionToken, typename Clock,
+ typename WaitTraits = boost::asio::wait_traits<Clock>,
+ typename Executor = any_io_executor>
+class cancel_after_timer
+{
+public:
+ /// Constructor.
+ template <typename T>
+ cancel_after_timer(T&& completion_token,
+ basic_waitable_timer<Clock, WaitTraits, Executor>& timer,
+ const typename Clock::duration& timeout,
+ cancellation_type_t cancel_type = cancellation_type::terminal)
+ : token_(static_cast<T&&>(completion_token)),
+ timer_(timer),
+ timeout_(timeout),
+ cancel_type_(cancel_type)
+ {
+ }
+
+//private:
+ CompletionToken token_;
+ basic_waitable_timer<Clock, WaitTraits, Executor>& timer_;
+ typename Clock::duration timeout_;
+ cancellation_type_t cancel_type_;
+};
+
+/// A function object type that adapts a @ref completion_token to cancel an
+/// operation after a timeout.
+/**
+ * May also be used directly as a completion token, in which case it adapts the
+ * asynchronous operation's default completion token (or boost::asio::deferred
+ * if no default is available).
+ */
+template <typename Clock, typename WaitTraits = boost::asio::wait_traits<Clock>>
+class partial_cancel_after
+{
+public:
+ /// Constructor that specifies the timeout duration and cancellation type.
+ explicit partial_cancel_after(const typename Clock::duration& timeout,
+ cancellation_type_t cancel_type = cancellation_type::terminal)
+ : timeout_(timeout),
+ cancel_type_(cancel_type)
+ {
+ }
+
+ /// Adapt a @ref completion_token to specify that the completion handler
+ /// arguments should be combined into a single tuple argument.
+ template <typename CompletionToken>
+ BOOST_ASIO_NODISCARD inline
+ cancel_after_t<decay_t<CompletionToken>, Clock, WaitTraits>
+ operator()(CompletionToken&& completion_token) const
+ {
+ return cancel_after_t<decay_t<CompletionToken>, Clock, WaitTraits>(
+ static_cast<CompletionToken&&>(completion_token),
+ timeout_, cancel_type_);
+ }
+
+//private:
+ typename Clock::duration timeout_;
+ cancellation_type_t cancel_type_;
+};
+
+/// A function object type that adapts a @ref completion_token to cancel an
+/// operation after a timeout.
+/**
+ * May also be used directly as a completion token, in which case it adapts the
+ * asynchronous operation's default completion token (or boost::asio::deferred
+ * if no default is available).
+ */
+template <typename Clock, typename WaitTraits = boost::asio::wait_traits<Clock>,
+ typename Executor = any_io_executor>
+class partial_cancel_after_timer
+{
+public:
+ /// Constructor that specifies the timeout duration and cancellation type.
+ explicit partial_cancel_after_timer(
+ basic_waitable_timer<Clock, WaitTraits, Executor>& timer,
+ const typename Clock::duration& timeout,
+ cancellation_type_t cancel_type = cancellation_type::terminal)
+ : timer_(timer),
+ timeout_(timeout),
+ cancel_type_(cancel_type)
+ {
+ }
+
+ /// Adapt a @ref completion_token to specify that the completion handler
+ /// arguments should be combined into a single tuple argument.
+ template <typename CompletionToken>
+ BOOST_ASIO_NODISCARD inline
+ cancel_after_timer<decay_t<CompletionToken>, Clock, WaitTraits, Executor>
+ operator()(CompletionToken&& completion_token) const
+ {
+ return cancel_after_timer<decay_t<CompletionToken>,
+ Clock, WaitTraits, Executor>(
+ static_cast<CompletionToken&&>(completion_token),
+ timeout_, cancel_type_);
+ }
+
+//private:
+ basic_waitable_timer<Clock, WaitTraits, Executor>& timer_;
+ typename Clock::duration timeout_;
+ cancellation_type_t cancel_type_;
+};
+
+/// Create a partial completion token adapter that cancels an operation if not
+/// complete before the specified relative timeout has elapsed.
+/**
+ * @par Thread Safety
+ * When an asynchronous operation is used with cancel_after, a timer async_wait
+ * operation is performed in parallel to the main operation. If this parallel
+ * async_wait completes first, a cancellation request is emitted to cancel the
+ * main operation. Consequently, the application must ensure that the
+ * asynchronous operation is performed within an implicit or explicit strand.
+ */
+template <typename Rep, typename Period>
+BOOST_ASIO_NODISCARD inline partial_cancel_after<chrono::steady_clock>
+cancel_after(const chrono::duration<Rep, Period>& timeout,
+ cancellation_type_t cancel_type = cancellation_type::terminal)
+{
+ return partial_cancel_after<chrono::steady_clock>(timeout, cancel_type);
+}
+
+/// Create a partial completion token adapter that cancels an operation if not
+/// complete before the specified relative timeout has elapsed.
+/**
+ * @par Thread Safety
+ * When an asynchronous operation is used with cancel_after, a timer async_wait
+ * operation is performed in parallel to the main operation. If this parallel
+ * async_wait completes first, a cancellation request is emitted to cancel the
+ * main operation. Consequently, the application must ensure that the
+ * asynchronous operation is performed within an implicit or explicit strand.
+ */
+template <typename Clock, typename WaitTraits,
+ typename Executor, typename Rep, typename Period>
+BOOST_ASIO_NODISCARD inline
+partial_cancel_after_timer<Clock, WaitTraits, Executor>
+cancel_after(basic_waitable_timer<Clock, WaitTraits, Executor>& timer,
+ const chrono::duration<Rep, Period>& timeout,
+ cancellation_type_t cancel_type = cancellation_type::terminal)
+{
+ return partial_cancel_after_timer<Clock, WaitTraits, Executor>(
+ timer, timeout, cancel_type);
+}
+
+/// Adapt a @ref completion_token to cancel an operation if not complete before
+/// the specified relative timeout has elapsed.
+/**
+ * @par Thread Safety
+ * When an asynchronous operation is used with cancel_after, a timer async_wait
+ * operation is performed in parallel to the main operation. If this parallel
+ * async_wait completes first, a cancellation request is emitted to cancel the
+ * main operation. Consequently, the application must ensure that the
+ * asynchronous operation is performed within an implicit or explicit strand.
+ */
+template <typename Rep, typename Period, typename CompletionToken>
+BOOST_ASIO_NODISCARD inline
+cancel_after_t<decay_t<CompletionToken>, chrono::steady_clock>
+cancel_after(const chrono::duration<Rep, Period>& timeout,
+ CompletionToken&& completion_token)
+{
+ return cancel_after_t<decay_t<CompletionToken>, chrono::steady_clock>(
+ static_cast<CompletionToken&&>(completion_token),
+ timeout, cancellation_type::terminal);
+}
+
+/// Adapt a @ref completion_token to cancel an operation if not complete before
+/// the specified relative timeout has elapsed.
+/**
+ * @par Thread Safety
+ * When an asynchronous operation is used with cancel_after, a timer async_wait
+ * operation is performed in parallel to the main operation. If this parallel
+ * async_wait completes first, a cancellation request is emitted to cancel the
+ * main operation. Consequently, the application must ensure that the
+ * asynchronous operation is performed within an implicit or explicit strand.
+ */
+template <typename Rep, typename Period, typename CompletionToken>
+BOOST_ASIO_NODISCARD inline
+cancel_after_t<decay_t<CompletionToken>, chrono::steady_clock>
+cancel_after(const chrono::duration<Rep, Period>& timeout,
+ cancellation_type_t cancel_type, CompletionToken&& completion_token)
+{
+ return cancel_after_t<decay_t<CompletionToken>, chrono::steady_clock>(
+ static_cast<CompletionToken&&>(completion_token), timeout, cancel_type);
+}
+
+/// Adapt a @ref completion_token to cancel an operation if not complete before
+/// the specified relative timeout has elapsed.
+/**
+ * @par Thread Safety
+ * When an asynchronous operation is used with cancel_after, a timer async_wait
+ * operation is performed in parallel to the main operation. If this parallel
+ * async_wait completes first, a cancellation request is emitted to cancel the
+ * main operation. Consequently, the application must ensure that the
+ * asynchronous operation is performed within an implicit or explicit strand.
+ */
+template <typename Clock, typename WaitTraits, typename Executor,
+ typename Rep, typename Period, typename CompletionToken>
+BOOST_ASIO_NODISCARD inline
+cancel_after_timer<decay_t<CompletionToken>, Clock, WaitTraits, Executor>
+cancel_after(basic_waitable_timer<Clock, WaitTraits, Executor>& timer,
+ const chrono::duration<Rep, Period>& timeout,
+ CompletionToken&& completion_token)
+{
+ return cancel_after_timer<decay_t<CompletionToken>,
+ Clock, WaitTraits, Executor>(
+ static_cast<CompletionToken&&>(completion_token),
+ timer, timeout, cancellation_type::terminal);
+}
+
+/// Adapt a @ref completion_token to cancel an operation if not complete before
+/// the specified relative timeout has elapsed.
+/**
+ * @par Thread Safety
+ * When an asynchronous operation is used with cancel_after, a timer async_wait
+ * operation is performed in parallel to the main operation. If this parallel
+ * async_wait completes first, a cancellation request is emitted to cancel the
+ * main operation. Consequently, the application must ensure that the
+ * asynchronous operation is performed within an implicit or explicit strand.
+ */
+template <typename Clock, typename WaitTraits, typename Executor,
+ typename Rep, typename Period, typename CompletionToken>
+BOOST_ASIO_NODISCARD inline
+cancel_after_timer<decay_t<CompletionToken>, chrono::steady_clock>
+cancel_after(basic_waitable_timer<Clock, WaitTraits, Executor>& timer,
+ const chrono::duration<Rep, Period>& timeout,
+ cancellation_type_t cancel_type, CompletionToken&& completion_token)
+{
+ return cancel_after_timer<decay_t<CompletionToken>,
+ Clock, WaitTraits, Executor>(
+ static_cast<CompletionToken&&>(completion_token),
+ timer, timeout, cancel_type);
+}
+
+} // namespace asio
+} // namespace boost
+
+#include <boost/asio/detail/pop_options.hpp>
+
+#include <boost/asio/impl/cancel_after.hpp>
+
+#endif // BOOST_ASIO_CANCEL_AFTER_HPP
diff --git a/contrib/restricted/boost/asio/include/boost/asio/cancel_at.hpp b/contrib/restricted/boost/asio/include/boost/asio/cancel_at.hpp
new file mode 100644
index 00000000000..c9d39b13e56
--- /dev/null
+++ b/contrib/restricted/boost/asio/include/boost/asio/cancel_at.hpp
@@ -0,0 +1,296 @@
+//
+// cancel_at.hpp
+// ~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+
+#ifndef BOOST_ASIO_CANCEL_AT_HPP
+#define BOOST_ASIO_CANCEL_AT_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include <boost/asio/detail/config.hpp>
+#include <boost/asio/basic_waitable_timer.hpp>
+#include <boost/asio/cancellation_type.hpp>
+#include <boost/asio/detail/chrono.hpp>
+#include <boost/asio/detail/type_traits.hpp>
+#include <boost/asio/wait_traits.hpp>
+
+#include <boost/asio/detail/push_options.hpp>
+
+namespace boost {
+namespace asio {
+
+/// A @ref completion_token adapter that cancels an operation at a given time.
+/**
+ * The cancel_at_t class is used to indicate that an asynchronous operation
+ * should be cancelled if not complete at the specified absolute time.
+ */
+template <typename CompletionToken, typename Clock,
+ typename WaitTraits = boost::asio::wait_traits<Clock>>
+class cancel_at_t
+{
+public:
+ /// Constructor.
+ template <typename T>
+ cancel_at_t(T&& completion_token, const typename Clock::time_point& expiry,
+ cancellation_type_t cancel_type = cancellation_type::terminal)
+ : token_(static_cast<T&&>(completion_token)),
+ expiry_(expiry),
+ cancel_type_(cancel_type)
+ {
+ }
+
+//private:
+ CompletionToken token_;
+ typename Clock::time_point expiry_;
+ cancellation_type_t cancel_type_;
+};
+
+/// A @ref completion_token adapter that cancels an operation at a given time.
+/**
+ * The cancel_at_timer class is used to indicate that an asynchronous operation
+ * should be cancelled if not complete at the specified absolute time.
+ */
+template <typename CompletionToken, typename Clock,
+ typename WaitTraits = boost::asio::wait_traits<Clock>,
+ typename Executor = any_io_executor>
+class cancel_at_timer
+{
+public:
+ /// Constructor.
+ template <typename T>
+ cancel_at_timer(T&& completion_token,
+ basic_waitable_timer<Clock, WaitTraits, Executor>& timer,
+ const typename Clock::time_point& expiry,
+ cancellation_type_t cancel_type = cancellation_type::terminal)
+ : token_(static_cast<T&&>(completion_token)),
+ timer_(timer),
+ expiry_(expiry),
+ cancel_type_(cancel_type)
+ {
+ }
+
+//private:
+ CompletionToken token_;
+ basic_waitable_timer<Clock, WaitTraits, Executor>& timer_;
+ typename Clock::time_point expiry_;
+ cancellation_type_t cancel_type_;
+};
+
+/// A function object type that adapts a @ref completion_token to cancel an
+/// operation at a given time.
+/**
+ * May also be used directly as a completion token, in which case it adapts the
+ * asynchronous operation's default completion token (or boost::asio::deferred
+ * if no default is available).
+ */
+template <typename Clock, typename WaitTraits = boost::asio::wait_traits<Clock>>
+class partial_cancel_at
+{
+public:
+ /// Constructor that specifies the expiry and cancellation type.
+ explicit partial_cancel_at(const typename Clock::time_point& expiry,
+ cancellation_type_t cancel_type = cancellation_type::terminal)
+ : expiry_(expiry),
+ cancel_type_(cancel_type)
+ {
+ }
+
+ /// Adapt a @ref completion_token to specify that the completion handler
+ /// arguments should be combined into a single tuple argument.
+ template <typename CompletionToken>
+ BOOST_ASIO_NODISCARD inline
+ constexpr cancel_at_t<decay_t<CompletionToken>, Clock, WaitTraits>
+ operator()(CompletionToken&& completion_token) const
+ {
+ return cancel_at_t<decay_t<CompletionToken>, Clock, WaitTraits>(
+ static_cast<CompletionToken&&>(completion_token),
+ expiry_, cancel_type_);
+ }
+
+//private:
+ typename Clock::time_point expiry_;
+ cancellation_type_t cancel_type_;
+};
+
+/// A function object type that adapts a @ref completion_token to cancel an
+/// operation at a given time.
+/**
+ * May also be used directly as a completion token, in which case it adapts the
+ * asynchronous operation's default completion token (or boost::asio::deferred
+ * if no default is available).
+ */
+template <typename Clock, typename WaitTraits = boost::asio::wait_traits<Clock>,
+ typename Executor = any_io_executor>
+class partial_cancel_at_timer
+{
+public:
+ /// Constructor that specifies the expiry and cancellation type.
+ explicit partial_cancel_at_timer(
+ basic_waitable_timer<Clock, WaitTraits, Executor>& timer,
+ const typename Clock::time_point& expiry,
+ cancellation_type_t cancel_type = cancellation_type::terminal)
+ : timer_(timer),
+ expiry_(expiry),
+ cancel_type_(cancel_type)
+ {
+ }
+
+ /// Adapt a @ref completion_token to specify that the completion handler
+ /// arguments should be combined into a single tuple argument.
+ template <typename CompletionToken>
+ BOOST_ASIO_NODISCARD inline
+ cancel_at_timer<decay_t<CompletionToken>, Clock, WaitTraits, Executor>
+ operator()(CompletionToken&& completion_token) const
+ {
+ return cancel_at_timer<decay_t<CompletionToken>,
+ Clock, WaitTraits, Executor>(
+ static_cast<CompletionToken&&>(completion_token),
+ timer_, expiry_, cancel_type_);
+ }
+
+//private:
+ basic_waitable_timer<Clock, WaitTraits, Executor>& timer_;
+ typename Clock::time_point expiry_;
+ cancellation_type_t cancel_type_;
+};
+
+/// Create a partial completion token adapter that cancels an operation if not
+/// complete by the specified absolute time.
+/**
+ * @par Thread Safety
+ * When an asynchronous operation is used with cancel_at, a timer async_wait
+ * operation is performed in parallel to the main operation. If this parallel
+ * async_wait completes first, a cancellation request is emitted to cancel the
+ * main operation. Consequently, the application must ensure that the
+ * asynchronous operation is performed within an implicit or explicit strand.
+ */
+template <typename Clock, typename Duration>
+BOOST_ASIO_NODISCARD inline partial_cancel_at<Clock>
+cancel_at(const chrono::time_point<Clock, Duration>& expiry,
+ cancellation_type_t cancel_type = cancellation_type::terminal)
+{
+ return partial_cancel_at<Clock>(expiry, cancel_type);
+}
+
+/// Create a partial completion token adapter that cancels an operation if not
+/// complete by the specified absolute time.
+/**
+ * @par Thread Safety
+ * When an asynchronous operation is used with cancel_at, a timer async_wait
+ * operation is performed in parallel to the main operation. If this parallel
+ * async_wait completes first, a cancellation request is emitted to cancel the
+ * main operation. Consequently, the application must ensure that the
+ * asynchronous operation is performed within an implicit or explicit strand.
+ */
+template <typename Clock, typename WaitTraits,
+ typename Executor, typename Duration>
+BOOST_ASIO_NODISCARD inline partial_cancel_at_timer<Clock, WaitTraits, Executor>
+cancel_at(basic_waitable_timer<Clock, WaitTraits, Executor>& timer,
+ const chrono::time_point<Clock, Duration>& expiry,
+ cancellation_type_t cancel_type = cancellation_type::terminal)
+{
+ return partial_cancel_at_timer<Clock, WaitTraits, Executor>(
+ timer, expiry, cancel_type);
+}
+
+/// Adapt a @ref completion_token to cancel an operation if not complete by the
+/// specified absolute time.
+/**
+ * @par Thread Safety
+ * When an asynchronous operation is used with cancel_at, a timer async_wait
+ * operation is performed in parallel to the main operation. If this parallel
+ * async_wait completes first, a cancellation request is emitted to cancel the
+ * main operation. Consequently, the application must ensure that the
+ * asynchronous operation is performed within an implicit or explicit strand.
+ */
+template <typename CompletionToken, typename Clock, typename Duration>
+BOOST_ASIO_NODISCARD inline cancel_at_t<decay_t<CompletionToken>, Clock>
+cancel_at(const chrono::time_point<Clock, Duration>& expiry,
+ CompletionToken&& completion_token)
+{
+ return cancel_at_t<decay_t<CompletionToken>, Clock>(
+ static_cast<CompletionToken&&>(completion_token),
+ expiry, cancellation_type::terminal);
+}
+
+/// Adapt a @ref completion_token to cancel an operation if not complete by the
+/// specified absolute time.
+/**
+ * @par Thread Safety
+ * When an asynchronous operation is used with cancel_at, a timer async_wait
+ * operation is performed in parallel to the main operation. If this parallel
+ * async_wait completes first, a cancellation request is emitted to cancel the
+ * main operation. Consequently, the application must ensure that the
+ * asynchronous operation is performed within an implicit or explicit strand.
+ */
+template <typename CompletionToken, typename Clock, typename Duration>
+BOOST_ASIO_NODISCARD inline cancel_at_t<decay_t<CompletionToken>, Clock>
+cancel_at(const chrono::time_point<Clock, Duration>& expiry,
+ cancellation_type_t cancel_type, CompletionToken&& completion_token)
+{
+ return cancel_at_t<decay_t<CompletionToken>, Clock>(
+ static_cast<CompletionToken&&>(completion_token), expiry, cancel_type);
+}
+
+/// Adapt a @ref completion_token to cancel an operation if not complete by the
+/// specified absolute time.
+/**
+ * @par Thread Safety
+ * When an asynchronous operation is used with cancel_at, a timer async_wait
+ * operation is performed in parallel to the main operation. If this parallel
+ * async_wait completes first, a cancellation request is emitted to cancel the
+ * main operation. Consequently, the application must ensure that the
+ * asynchronous operation is performed within an implicit or explicit strand.
+ */
+template <typename CompletionToken, typename Clock,
+ typename WaitTraits, typename Executor, typename Duration>
+BOOST_ASIO_NODISCARD inline
+cancel_at_timer<decay_t<CompletionToken>, Clock, WaitTraits, Executor>
+cancel_at(basic_waitable_timer<Clock, WaitTraits, Executor>& timer,
+ const chrono::time_point<Clock, Duration>& expiry,
+ CompletionToken&& completion_token)
+{
+ return cancel_at_timer<decay_t<CompletionToken>, Clock, WaitTraits, Executor>(
+ static_cast<CompletionToken&&>(completion_token),
+ timer, expiry, cancellation_type::terminal);
+}
+
+/// Adapt a @ref completion_token to cancel an operation if not complete by the
+/// specified absolute time.
+/**
+ * @par Thread Safety
+ * When an asynchronous operation is used with cancel_at, a timer async_wait
+ * operation is performed in parallel to the main operation. If this parallel
+ * async_wait completes first, a cancellation request is emitted to cancel the
+ * main operation. Consequently, the application must ensure that the
+ * asynchronous operation is performed within an implicit or explicit strand.
+ */
+template <typename CompletionToken, typename Clock,
+ typename WaitTraits, typename Executor, typename Duration>
+BOOST_ASIO_NODISCARD inline
+cancel_at_timer<decay_t<CompletionToken>, Clock, WaitTraits, Executor>
+cancel_at(basic_waitable_timer<Clock, WaitTraits, Executor>& timer,
+ const chrono::time_point<Clock, Duration>& expiry,
+ cancellation_type_t cancel_type, CompletionToken&& completion_token)
+{
+ return cancel_at_timer<decay_t<CompletionToken>, Clock, WaitTraits, Executor>(
+ static_cast<CompletionToken&&>(completion_token),
+ timer, expiry, cancel_type);
+}
+
+} // namespace asio
+} // namespace boost
+
+#include <boost/asio/detail/pop_options.hpp>
+
+#include <boost/asio/impl/cancel_at.hpp>
+
+#endif // BOOST_ASIO_CANCEL_AT_HPP
diff --git a/contrib/restricted/boost/asio/include/boost/asio/experimental/impl/co_composed.hpp b/contrib/restricted/boost/asio/include/boost/asio/co_composed.hpp
index 54d95aa8f04..e75377d47e5 100644
--- a/contrib/restricted/boost/asio/include/boost/asio/experimental/impl/co_composed.hpp
+++ b/contrib/restricted/boost/asio/include/boost/asio/co_composed.hpp
@@ -1,6 +1,6 @@
//
-// experimental/impl/co_composed.hpp
-// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+// co_composed.hpp
+// ~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
@@ -8,14 +8,17 @@
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
-#ifndef BOOST_ASIO_IMPL_EXPERIMENTAL_CO_COMPOSED_HPP
-#define BOOST_ASIO_IMPL_EXPERIMENTAL_CO_COMPOSED_HPP
+#ifndef BOOST_ASIO_CO_COMPOSED_HPP
+#define BOOST_ASIO_CO_COMPOSED_HPP
#if defined(_MSC_VER) && (_MSC_VER >= 1200)
# pragma once
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
#include <boost/asio/detail/config.hpp>
+
+#if defined(BOOST_ASIO_HAS_CO_AWAIT) || defined(GENERATING_DOCUMENTATION)
+
#include <new>
#include <tuple>
#include <variant>
@@ -45,7 +48,6 @@
namespace boost {
namespace asio {
-namespace experimental {
namespace detail {
#if defined(BOOST_ASIO_HAS_STD_COROUTINE)
@@ -75,7 +77,7 @@ class co_composed_handler_base;
template <typename Executors, typename Handler, typename Return>
class co_composed_promise;
-template <completion_signature... Signatures>
+template <BOOST_ASIO_COMPLETION_SIGNATURE... Signatures>
class co_composed_returns
{
};
@@ -91,7 +93,7 @@ struct co_composed_completion : std::tuple<T&&...>
{
template <typename... U>
co_composed_completion(U&&... u) noexcept
- : std::tuple<T&&...>(std::forward<U>(u)...)
+ : std::tuple<T&&...>(static_cast<U&&>(u)...)
{
}
};
@@ -313,8 +315,8 @@ public:
(get_associated_cancellation_slot)(
static_cast<co_composed_state<Executors, Handler, Return>*>(
this)->handler()),
- std::forward<InFilter>(in_filter),
- std::forward<OutFilter>(out_filter));
+ static_cast<InFilter&&>(in_filter),
+ static_cast<OutFilter&&>(out_filter));
}
cancellation_type_t cancelled() const noexcept
@@ -469,7 +471,7 @@ public:
co_composed_state(composed_io_executors<Executors>&& executors,
H&& h, co_composed_on_suspend& on_suspend)
: work_(std::move(executors)),
- handler_(std::forward<H>(h)),
+ handler_(static_cast<H&&>(h)),
on_suspend_(&on_suspend)
{
this->reset_cancellation_state(enable_terminal_cancellation());
@@ -482,9 +484,9 @@ public:
template <typename... Args>
[[nodiscard]] co_composed_completion<Args...> complete(Args&&... args)
- requires requires { declval<Handler>()(std::forward<Args>(args)...); }
+ requires requires { declval<Handler>()(static_cast<Args&&>(args)...); }
{
- return co_composed_completion<Args...>(std::forward<Args>(args)...);
+ return co_composed_completion<Args...>(static_cast<Args&&>(args)...);
}
const Handler& handler() const noexcept
@@ -593,7 +595,7 @@ public:
template <typename... T>
void operator()(T&&... args)
{
- result_type result(std::forward<T>(args)...);
+ result_type result(static_cast<T&&>(args)...);
this->resume(&result);
}
@@ -625,7 +627,7 @@ public:
template <typename... T>
void operator()(const boost::system::error_code& ec, T&&... args)
{
- result_type result(ec, args_type(std::forward<T>(args)...));
+ result_type result(ec, args_type(static_cast<T&&>(args)...));
this->resume(&result);
}
@@ -658,7 +660,7 @@ public:
template <typename... T>
void operator()(std::exception_ptr ex, T&&... args)
{
- result_type result(std::move(ex), args_type(std::forward<T>(args)...));
+ result_type result(std::move(ex), args_type(static_cast<T&&>(args)...));
this->resume(&result);
}
@@ -864,7 +866,7 @@ public:
# endif // defined(BOOST_ASIO_HAS_SOURCE_LOCATION)
#endif // defined(BOOST_ASIO_ENABLE_HANDLER_TRACKING)
)
- : op_(std::forward<Op>(op)),
+ : op_(static_cast<Op&&>(op)),
promise_(promise)
#if defined(BOOST_ASIO_ENABLE_HANDLER_TRACKING)
# if defined(BOOST_ASIO_HAS_SOURCE_LOCATION)
@@ -895,7 +897,7 @@ public:
static_cast<awaitable*>(p)->location_.function_name()));
# endif // defined(BOOST_ASIO_HAS_SOURCE_LOCATION)
#endif // defined(BOOST_ASIO_ENABLE_HANDLER_TRACKING)
- std::forward<Op>(static_cast<awaitable*>(p)->op_)(
+ static_cast<Op&&>(static_cast<awaitable*>(p)->op_)(
co_composed_handler<Executors, Handler,
Return, completion_signature_of_t<Op>>(
static_cast<awaitable*>(p)->promise_));
@@ -920,7 +922,7 @@ public:
};
state_.check_for_cancellation_on_transform();
- return awaitable{std::forward<Op>(op), *this
+ return awaitable{static_cast<Op&&>(op), *this
#if defined(BOOST_ASIO_ENABLE_HANDLER_TRACKING)
# if defined(BOOST_ASIO_HAS_SOURCE_LOCATION)
, location
@@ -961,7 +963,7 @@ public:
Handler handler(std::move(a.promise_.state_.handler_));
std::tuple<decay_t<Args>...> result(
- std::move(static_cast<std::tuple<Args&&...>>(a.result_)));
+ std::move(static_cast<std::tuple<Args&&...>&>(a.result_)));
co_composed_handler_base<Executors, Handler,
Return>(std::move(composed_handler));
@@ -1014,7 +1016,7 @@ public:
template <typename I>
initiate_co_composed(I&& impl, composed_io_executors<Executors>&& executors)
- : implementation_(std::forward<I>(impl)),
+ : implementation_(static_cast<I&&>(impl)),
executors_(std::move(executors))
{
}
@@ -1032,8 +1034,8 @@ public:
co_composed_on_suspend on_suspend{};
implementation_(
co_composed_state<Executors, handler_type, returns_type>(
- executors_, std::forward<Handler>(handler), on_suspend),
- std::forward<InitArgs>(init_args)...);
+ executors_, static_cast<Handler&&>(handler), on_suspend),
+ static_cast<InitArgs&&>(init_args)...);
if (on_suspend.fn_)
on_suspend.fn_(on_suspend.arg_);
}
@@ -1046,8 +1048,8 @@ public:
co_composed_on_suspend on_suspend{};
std::move(implementation_)(
co_composed_state<Executors, handler_type, returns_type>(
- std::move(executors_), std::forward<Handler>(handler), on_suspend),
- std::forward<InitArgs>(init_args)...);
+ std::move(executors_), static_cast<Handler&&>(handler), on_suspend),
+ static_cast<InitArgs&&>(init_args)...);
if (on_suspend.fn_)
on_suspend.fn_(on_suspend.arg_);
}
@@ -1057,46 +1059,74 @@ private:
composed_io_executors<Executors> executors_;
};
+template <typename Implementation, typename... Signatures>
+class initiate_co_composed<Implementation, void(), Signatures...>
+{
+public:
+ template <typename I>
+ initiate_co_composed(I&& impl, composed_io_executors<void()>&&)
+ : implementation_(static_cast<I&&>(impl))
+ {
+ }
+
+ template <typename Handler, typename... InitArgs>
+ void operator()(Handler&& handler, InitArgs&&... init_args) const &
+ {
+ using handler_type = decay_t<Handler>;
+ using returns_type = co_composed_returns<Signatures...>;
+ co_composed_on_suspend on_suspend{};
+ implementation_(
+ co_composed_state<void(), handler_type, returns_type>(
+ composed_io_executors<void()>(),
+ static_cast<Handler&&>(handler), on_suspend),
+ static_cast<InitArgs&&>(init_args)...);
+ if (on_suspend.fn_)
+ on_suspend.fn_(on_suspend.arg_);
+ }
+
+ template <typename Handler, typename... InitArgs>
+ void operator()(Handler&& handler, InitArgs&&... init_args) &&
+ {
+ using handler_type = decay_t<Handler>;
+ using returns_type = co_composed_returns<Signatures...>;
+ co_composed_on_suspend on_suspend{};
+ std::move(implementation_)(
+ co_composed_state<void(), handler_type, returns_type>(
+ composed_io_executors<void()>(),
+ static_cast<Handler&&>(handler), on_suspend),
+ static_cast<InitArgs&&>(init_args)...);
+ if (on_suspend.fn_)
+ on_suspend.fn_(on_suspend.arg_);
+ }
+
+private:
+ Implementation implementation_;
+};
+
template <typename... Signatures, typename Implementation, typename Executors>
-inline initiate_co_composed<Implementation, Executors, Signatures...>
+inline initiate_co_composed<decay_t<Implementation>, Executors, Signatures...>
make_initiate_co_composed(Implementation&& implementation,
composed_io_executors<Executors>&& executors)
{
return initiate_co_composed<
decay_t<Implementation>, Executors, Signatures...>(
- std::forward<Implementation>(implementation), std::move(executors));
+ static_cast<Implementation&&>(implementation), std::move(executors));
}
} // namespace detail
-template <completion_signature... Signatures,
- typename Implementation, typename... IoObjectsOrExecutors>
-inline auto co_composed(Implementation&& implementation,
- IoObjectsOrExecutors&&... io_objects_or_executors)
-{
- return detail::make_initiate_co_composed<Signatures...>(
- std::forward<Implementation>(implementation),
- detail::make_composed_io_executors(
- detail::get_composed_io_executor(
- std::forward<IoObjectsOrExecutors>(
- io_objects_or_executors))...));
-}
-
-} // namespace experimental
-
#if !defined(GENERATING_DOCUMENTATION)
template <template <typename, typename> class Associator,
typename Executors, typename Handler, typename Return,
typename Signature, typename DefaultCandidate>
struct associator<Associator,
- experimental::detail::co_composed_handler<
- Executors, Handler, Return, Signature>,
+ detail::co_composed_handler<Executors, Handler, Return, Signature>,
DefaultCandidate>
: Associator<Handler, DefaultCandidate>
{
static typename Associator<Handler, DefaultCandidate>::type get(
- const experimental::detail::co_composed_handler<
+ const detail::co_composed_handler<
Executors, Handler, Return, Signature>& h) noexcept
{
return Associator<Handler, DefaultCandidate>::get(
@@ -1104,7 +1134,7 @@ struct associator<Associator,
}
static auto get(
- const experimental::detail::co_composed_handler<
+ const detail::co_composed_handler<
Executors, Handler, Return, Signature>& h,
const DefaultCandidate& c) noexcept
-> decltype(
@@ -1131,37 +1161,28 @@ namespace std { namespace experimental {
template <typename C, typename Executors,
typename Handler, typename Return, typename... Args>
struct coroutine_traits<void, C&,
- boost::asio::experimental::detail::co_composed_state<
- Executors, Handler, Return>,
- Args...>
+ boost::asio::detail::co_composed_state<Executors, Handler, Return>, Args...>
{
using promise_type =
- boost::asio::experimental::detail::co_composed_promise<
- Executors, Handler, Return>;
+ boost::asio::detail::co_composed_promise<Executors, Handler, Return>;
};
template <typename C, typename Executors,
typename Handler, typename Return, typename... Args>
struct coroutine_traits<void, C&&,
- boost::asio::experimental::detail::co_composed_state<
- Executors, Handler, Return>,
- Args...>
+ boost::asio::detail::co_composed_state<Executors, Handler, Return>, Args...>
{
using promise_type =
- boost::asio::experimental::detail::co_composed_promise<
- Executors, Handler, Return>;
+ boost::asio::detail::co_composed_promise<Executors, Handler, Return>;
};
template <typename Executors, typename Handler,
typename Return, typename... Args>
struct coroutine_traits<void,
- boost::asio::experimental::detail::co_composed_state<
- Executors, Handler, Return>,
- Args...>
+ boost::asio::detail::co_composed_state<Executors, Handler, Return>, Args...>
{
using promise_type =
- boost::asio::experimental::detail::co_composed_promise<
- Executors, Handler, Return>;
+ boost::asio::detail::co_composed_promise<Executors, Handler, Return>;
};
# if defined(BOOST_ASIO_HAS_STD_COROUTINE)
@@ -1171,6 +1192,132 @@ struct coroutine_traits<void,
# endif // defined(BOOST_ASIO_HAS_STD_COROUTINE)
#endif // !defined(GENERATING_DOCUMENTATION)
+namespace boost {
+namespace asio {
+
+/// Creates an initiation function object that may be used to launch a
+/// coroutine-based composed asynchronous operation.
+/**
+ * The co_composed utility simplifies the implementation of composed
+ * asynchronous operations by automatically adapting a coroutine to be an
+ * initiation function object for use with @c async_initiate. When awaiting
+ * asynchronous operations, the coroutine automatically uses a conforming
+ * intermediate completion handler.
+ *
+ * @param implementation A function object that contains the coroutine-based
+ * implementation of the composed asynchronous operation. The first argument to
+ * the function object represents the state of the operation, and may be used
+ * to test for cancellation. The remaining arguments are those passed to @c
+ * async_initiate after the completion token.
+ *
+ * @param io_objects_or_executors Zero or more I/O objects or I/O executors for
+ * which outstanding work must be maintained while the operation is incomplete.
+ *
+ * @par Per-Operation Cancellation
+ * By default, terminal per-operation cancellation is enabled for composed
+ * operations that use co_composed. To disable cancellation for the composed
+ * operation, or to alter its supported cancellation types, call the state's
+ * @c reset_cancellation_state function.
+ *
+ * @par Examples
+ * The following example illustrates manual error handling and explicit checks
+ * for cancellation. The completion handler is invoked via a @c co_yield to the
+ * state's @c complete function, which never returns.
+ *
+ * @code template <typename CompletionToken>
+ * auto async_echo(tcp::socket& socket,
+ * CompletionToken&& token)
+ * {
+ * return boost::asio::async_initiate<
+ * CompletionToken, void(boost::system::error_code)>(
+ * boost::asio::co_composed(
+ * [](auto state, tcp::socket& socket) -> void
+ * {
+ * state.reset_cancellation_state(
+ * boost::asio::enable_terminal_cancellation());
+ *
+ * while (!state.cancelled())
+ * {
+ * char data[1024];
+ * auto [e1, n1] =
+ * co_await socket.async_read_some(
+ * boost::asio::buffer(data));
+ *
+ * if (e1)
+ * co_yield state.complete(e1);
+ *
+ * if (!!state.cancelled())
+ * co_yield state.complete(
+ * make_error_code(boost::asio::error::operation_aborted));
+ *
+ * auto [e2, n2] =
+ * co_await boost::asio::async_write(socket,
+ * boost::asio::buffer(data, n1));
+ *
+ * if (e2)
+ * co_yield state.complete(e2);
+ * }
+ * }, socket),
+ * token, std::ref(socket));
+ * } @endcode
+ *
+ * This next example shows exception-based error handling and implicit checks
+ * for cancellation. The completion handler is invoked after returning from the
+ * coroutine via @c co_return. Valid @c co_return values are specified using
+ * completion signatures passed to the @c co_composed function.
+ *
+ * @code template <typename CompletionToken>
+ * auto async_echo(tcp::socket& socket,
+ * CompletionToken&& token)
+ * {
+ * return boost::asio::async_initiate<
+ * CompletionToken, void(boost::system::error_code)>(
+ * boost::asio::co_composed<
+ * void(boost::system::error_code)>(
+ * [](auto state, tcp::socket& socket) -> void
+ * {
+ * try
+ * {
+ * state.throw_if_cancelled(true);
+ * state.reset_cancellation_state(
+ * boost::asio::enable_terminal_cancellation());
+ *
+ * for (;;)
+ * {
+ * char data[1024];
+ * std::size_t n = co_await socket.async_read_some(
+ * boost::asio::buffer(data));
+ *
+ * co_await boost::asio::async_write(socket,
+ * boost::asio::buffer(data, n));
+ * }
+ * }
+ * catch (const boost::system::system_error& e)
+ * {
+ * co_return {e.code()};
+ * }
+ * }, socket),
+ * token, std::ref(socket));
+ * } @endcode
+ */
+template <BOOST_ASIO_COMPLETION_SIGNATURE... Signatures,
+ typename Implementation, typename... IoObjectsOrExecutors>
+inline auto co_composed(Implementation&& implementation,
+ IoObjectsOrExecutors&&... io_objects_or_executors)
+{
+ return detail::make_initiate_co_composed<Signatures...>(
+ static_cast<Implementation&&>(implementation),
+ detail::make_composed_io_executors(
+ detail::get_composed_io_executor(
+ static_cast<IoObjectsOrExecutors&&>(
+ io_objects_or_executors))...));
+}
+
+} // namespace asio
+} // namespace boost
+
#include <boost/asio/detail/pop_options.hpp>
-#endif // BOOST_ASIO_IMPL_EXPERIMENTAL_CO_COMPOSED_HPP
+#endif // defined(BOOST_ASIO_HAS_CO_AWAIT) || defined(GENERATING_DOCUMENTATION)
+
+#endif // BOOST_ASIO_CO_COMPOSED_HPP
diff --git a/contrib/restricted/boost/asio/include/boost/asio/completion_condition.hpp b/contrib/restricted/boost/asio/include/boost/asio/completion_condition.hpp
index 8ad47d7c302..4cd94109240 100644
--- a/contrib/restricted/boost/asio/include/boost/asio/completion_condition.hpp
+++ b/contrib/restricted/boost/asio/include/boost/asio/completion_condition.hpp
@@ -17,6 +17,8 @@
#include <boost/asio/detail/config.hpp>
#include <cstddef>
+#include <boost/asio/detail/type_traits.hpp>
+#include <boost/system/error_code.hpp>
#include <boost/asio/detail/push_options.hpp>
@@ -98,8 +100,55 @@ private:
std::size_t size_;
};
+template <typename T, typename = void>
+struct is_completion_condition_helper : false_type
+{
+};
+
+template <typename T>
+struct is_completion_condition_helper<T,
+ enable_if_t<
+ is_same<
+ result_of_t<T(boost::system::error_code, std::size_t)>,
+ bool
+ >::value
+ >
+ > : true_type
+{
+};
+
+template <typename T>
+struct is_completion_condition_helper<T,
+ enable_if_t<
+ is_same<
+ result_of_t<T(boost::system::error_code, std::size_t)>,
+ std::size_t
+ >::value
+ >
+ > : true_type
+{
+};
+
} // namespace detail
+#if defined(GENERATING_DOCUMENTATION)
+
+/// Trait for determining whether a function object is a completion condition.
+template <typename T>
+struct is_completion_condition
+{
+ static constexpr bool value = automatically_determined;
+};
+
+#else // defined(GENERATING_DOCUMENTATION)
+
+template <typename T>
+struct is_completion_condition : detail::is_completion_condition_helper<T>
+{
+};
+
+#endif // defined(GENERATING_DOCUMENTATION)
+
/**
* @defgroup completion_condition Completion Condition Function Objects
*
diff --git a/contrib/restricted/boost/asio/include/boost/asio/compose.hpp b/contrib/restricted/boost/asio/include/boost/asio/compose.hpp
index b539850fb69..f23bd79e614 100644
--- a/contrib/restricted/boost/asio/include/boost/asio/compose.hpp
+++ b/contrib/restricted/boost/asio/include/boost/asio/compose.hpp
@@ -16,197 +16,12 @@
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
#include <boost/asio/detail/config.hpp>
-#include <boost/asio/associated_executor.hpp>
-#include <boost/asio/async_result.hpp>
-#include <boost/asio/detail/base_from_cancellation_state.hpp>
-#include <boost/asio/detail/composed_work.hpp>
-#include <boost/asio/detail/handler_cont_helpers.hpp>
-#include <boost/asio/detail/type_traits.hpp>
+#include <boost/asio/composed.hpp>
#include <boost/asio/detail/push_options.hpp>
namespace boost {
namespace asio {
-namespace detail {
-
-template <typename Impl, typename Work, typename Handler, typename Signature>
-class composed_op;
-
-template <typename Impl, typename Work, typename Handler,
- typename R, typename... Args>
-class composed_op<Impl, Work, Handler, R(Args...)>
- : public base_from_cancellation_state<Handler>
-{
-public:
- template <typename I, typename W, typename H>
- composed_op(I&& impl,
- W&& work,
- H&& handler)
- : base_from_cancellation_state<Handler>(
- handler, enable_terminal_cancellation()),
- impl_(static_cast<I&&>(impl)),
- work_(static_cast<W&&>(work)),
- handler_(static_cast<H&&>(handler)),
- invocations_(0)
- {
- }
-
- composed_op(composed_op&& other)
- : base_from_cancellation_state<Handler>(
- static_cast<base_from_cancellation_state<Handler>&&>(other)),
- impl_(static_cast<Impl&&>(other.impl_)),
- work_(static_cast<Work&&>(other.work_)),
- handler_(static_cast<Handler&&>(other.handler_)),
- invocations_(other.invocations_)
- {
- }
-
- typedef typename composed_work_guard<
- typename Work::head_type>::executor_type io_executor_type;
-
- io_executor_type get_io_executor() const noexcept
- {
- return work_.head_.get_executor();
- }
-
- typedef associated_executor_t<Handler, io_executor_type> executor_type;
-
- executor_type get_executor() const noexcept
- {
- return (get_associated_executor)(handler_, work_.head_.get_executor());
- }
-
- typedef associated_allocator_t<Handler, std::allocator<void>> allocator_type;
-
- allocator_type get_allocator() const noexcept
- {
- return (get_associated_allocator)(handler_, std::allocator<void>());
- }
-
- template<typename... T>
- void operator()(T&&... t)
- {
- if (invocations_ < ~0u)
- ++invocations_;
- this->get_cancellation_state().slot().clear();
- impl_(*this, static_cast<T&&>(t)...);
- }
-
- void complete(Args... args)
- {
- this->work_.reset();
- static_cast<Handler&&>(this->handler_)(static_cast<Args&&>(args)...);
- }
-
- void reset_cancellation_state()
- {
- base_from_cancellation_state<Handler>::reset_cancellation_state(handler_);
- }
-
- template <typename Filter>
- void reset_cancellation_state(Filter&& filter)
- {
- base_from_cancellation_state<Handler>::reset_cancellation_state(handler_,
- static_cast<Filter&&>(filter));
- }
-
- template <typename InFilter, typename OutFilter>
- void reset_cancellation_state(InFilter&& in_filter,
- OutFilter&& out_filter)
- {
- base_from_cancellation_state<Handler>::reset_cancellation_state(handler_,
- static_cast<InFilter&&>(in_filter),
- static_cast<OutFilter&&>(out_filter));
- }
-
- cancellation_type_t cancelled() const noexcept
- {
- return base_from_cancellation_state<Handler>::cancelled();
- }
-
-//private:
- Impl impl_;
- Work work_;
- Handler handler_;
- unsigned invocations_;
-};
-
-template <typename Impl, typename Work, typename Handler, typename Signature>
-inline bool asio_handler_is_continuation(
- composed_op<Impl, Work, Handler, Signature>* this_handler)
-{
- return this_handler->invocations_ > 1 ? true
- : boost_asio_handler_cont_helpers::is_continuation(
- this_handler->handler_);
-}
-
-template <typename Signature, typename Executors>
-class initiate_composed_op
-{
-public:
- typedef typename composed_io_executors<Executors>::head_type executor_type;
-
- template <typename T>
- explicit initiate_composed_op(int, T&& executors)
- : executors_(static_cast<T&&>(executors))
- {
- }
-
- executor_type get_executor() const noexcept
- {
- return executors_.head_;
- }
-
- template <typename Handler, typename Impl>
- void operator()(Handler&& handler,
- Impl&& impl) const
- {
- composed_op<decay_t<Impl>, composed_work<Executors>,
- decay_t<Handler>, Signature>(
- static_cast<Impl&&>(impl),
- composed_work<Executors>(executors_),
- static_cast<Handler&&>(handler))();
- }
-
-private:
- composed_io_executors<Executors> executors_;
-};
-
-template <typename Signature, typename Executors>
-inline initiate_composed_op<Signature, Executors> make_initiate_composed_op(
- composed_io_executors<Executors>&& executors)
-{
- return initiate_composed_op<Signature, Executors>(0,
- static_cast<composed_io_executors<Executors>&&>(executors));
-}
-
-} // namespace detail
-
-#if !defined(GENERATING_DOCUMENTATION)
-
-template <template <typename, typename> class Associator,
- typename Impl, typename Work, typename Handler,
- typename Signature, typename DefaultCandidate>
-struct associator<Associator,
- detail::composed_op<Impl, Work, Handler, Signature>,
- DefaultCandidate>
- : Associator<Handler, DefaultCandidate>
-{
- static typename Associator<Handler, DefaultCandidate>::type get(
- const detail::composed_op<Impl, Work, Handler, Signature>& h) noexcept
- {
- return Associator<Handler, DefaultCandidate>::get(h.handler_);
- }
-
- static auto get(const detail::composed_op<Impl, Work, Handler, Signature>& h,
- const DefaultCandidate& c) noexcept
- -> decltype(Associator<Handler, DefaultCandidate>::get(h.handler_, c))
- {
- return Associator<Handler, DefaultCandidate>::get(h.handler_, c);
- }
-};
-
-#endif // !defined(GENERATING_DOCUMENTATION)
/// Launch an asynchronous operation with a stateful implementation.
/**
@@ -276,8 +91,8 @@ struct associator<Associator,
* template <typename CompletionToken>
* auto async_echo(tcp::socket& socket,
* boost::asio::mutable_buffer buffer,
- * CompletionToken&& token) ->
- * decltype(
+ * CompletionToken&& token)
+ * -> decltype(
* boost::asio::async_compose<CompletionToken,
* void(boost::system::error_code, std::size_t)>(
* std::declval<async_echo_implementation>(),
@@ -292,25 +107,19 @@ struct associator<Associator,
*/
template <typename CompletionToken, typename Signature,
typename Implementation, typename... IoObjectsOrExecutors>
-auto async_compose(Implementation&& implementation,
+inline auto async_compose(Implementation&& implementation,
type_identity_t<CompletionToken>& token,
IoObjectsOrExecutors&&... io_objects_or_executors)
-> decltype(
async_initiate<CompletionToken, Signature>(
- detail::make_initiate_composed_op<Signature>(
- detail::make_composed_io_executors(
- detail::get_composed_io_executor(
- static_cast<IoObjectsOrExecutors&&>(
- io_objects_or_executors))...)),
- token, static_cast<Implementation&&>(implementation)))
+ composed<Signature>(static_cast<Implementation&&>(implementation),
+ static_cast<IoObjectsOrExecutors&&>(io_objects_or_executors)...),
+ token))
{
return async_initiate<CompletionToken, Signature>(
- detail::make_initiate_composed_op<Signature>(
- detail::make_composed_io_executors(
- detail::get_composed_io_executor(
- static_cast<IoObjectsOrExecutors&&>(
- io_objects_or_executors))...)),
- token, static_cast<Implementation&&>(implementation));
+ composed<Signature>(static_cast<Implementation&&>(implementation),
+ static_cast<IoObjectsOrExecutors&&>(io_objects_or_executors)...),
+ token);
}
} // namespace asio
diff --git a/contrib/restricted/boost/asio/include/boost/asio/composed.hpp b/contrib/restricted/boost/asio/include/boost/asio/composed.hpp
new file mode 100644
index 00000000000..bda14877593
--- /dev/null
+++ b/contrib/restricted/boost/asio/include/boost/asio/composed.hpp
@@ -0,0 +1,415 @@
+//
+// composed.hpp
+// ~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+
+#ifndef BOOST_ASIO_COMPOSED_HPP
+#define BOOST_ASIO_COMPOSED_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include <boost/asio/detail/config.hpp>
+#include <boost/asio/associated_executor.hpp>
+#include <boost/asio/async_result.hpp>
+#include <boost/asio/detail/base_from_cancellation_state.hpp>
+#include <boost/asio/detail/composed_work.hpp>
+#include <boost/asio/detail/handler_cont_helpers.hpp>
+#include <boost/asio/detail/type_traits.hpp>
+
+#include <boost/asio/detail/push_options.hpp>
+
+namespace boost {
+namespace asio {
+namespace detail {
+
+template <typename Impl, typename Work,
+ typename Handler, typename... Signatures>
+class composed_op;
+
+template <typename Impl, typename Work, typename Handler>
+class composed_op<Impl, Work, Handler>
+ : public base_from_cancellation_state<Handler>
+{
+public:
+ template <typename I, typename W, typename H>
+ composed_op(I&& impl,
+ W&& work,
+ H&& handler)
+ : base_from_cancellation_state<Handler>(
+ handler, enable_terminal_cancellation()),
+ impl_(static_cast<I&&>(impl)),
+ work_(static_cast<W&&>(work)),
+ handler_(static_cast<H&&>(handler)),
+ invocations_(0)
+ {
+ }
+
+ composed_op(composed_op&& other)
+ : base_from_cancellation_state<Handler>(
+ static_cast<base_from_cancellation_state<Handler>&&>(other)),
+ impl_(static_cast<Impl&&>(other.impl_)),
+ work_(static_cast<Work&&>(other.work_)),
+ handler_(static_cast<Handler&&>(other.handler_)),
+ invocations_(other.invocations_)
+ {
+ }
+
+ typedef typename composed_work_guard<
+ typename Work::head_type>::executor_type io_executor_type;
+
+ io_executor_type get_io_executor() const noexcept
+ {
+ return work_.head_.get_executor();
+ }
+
+ typedef associated_executor_t<Handler, io_executor_type> executor_type;
+
+ executor_type get_executor() const noexcept
+ {
+ return (get_associated_executor)(handler_, work_.head_.get_executor());
+ }
+
+ typedef associated_allocator_t<Handler, std::allocator<void>> allocator_type;
+
+ allocator_type get_allocator() const noexcept
+ {
+ return (get_associated_allocator)(handler_, std::allocator<void>());
+ }
+
+ template <typename... T>
+ void operator()(T&&... t)
+ {
+ if (invocations_ < ~0u)
+ ++invocations_;
+ this->get_cancellation_state().slot().clear();
+ impl_(*this, static_cast<T&&>(t)...);
+ }
+
+ template <typename... Args>
+ auto complete(Args&&... args)
+ -> decltype(declval<Handler>()(static_cast<Args&&>(args)...))
+ {
+ return static_cast<Handler&&>(this->handler_)(static_cast<Args&&>(args)...);
+ }
+
+ void reset_cancellation_state()
+ {
+ base_from_cancellation_state<Handler>::reset_cancellation_state(handler_);
+ }
+
+ template <typename Filter>
+ void reset_cancellation_state(Filter&& filter)
+ {
+ base_from_cancellation_state<Handler>::reset_cancellation_state(handler_,
+ static_cast<Filter&&>(filter));
+ }
+
+ template <typename InFilter, typename OutFilter>
+ void reset_cancellation_state(InFilter&& in_filter,
+ OutFilter&& out_filter)
+ {
+ base_from_cancellation_state<Handler>::reset_cancellation_state(handler_,
+ static_cast<InFilter&&>(in_filter),
+ static_cast<OutFilter&&>(out_filter));
+ }
+
+ cancellation_type_t cancelled() const noexcept
+ {
+ return base_from_cancellation_state<Handler>::cancelled();
+ }
+
+//private:
+ Impl impl_;
+ Work work_;
+ Handler handler_;
+ unsigned invocations_;
+};
+
+template <typename Impl, typename Work, typename Handler,
+ typename R, typename... Args>
+class composed_op<Impl, Work, Handler, R(Args...)>
+ : public composed_op<Impl, Work, Handler>
+{
+public:
+ using composed_op<Impl, Work, Handler>::composed_op;
+
+ template <typename... T>
+ void operator()(T&&... t)
+ {
+ if (this->invocations_ < ~0u)
+ ++this->invocations_;
+ this->get_cancellation_state().slot().clear();
+ this->impl_(*this, static_cast<T&&>(t)...);
+ }
+
+ void complete(Args... args)
+ {
+ this->work_.reset();
+ static_cast<Handler&&>(this->handler_)(static_cast<Args&&>(args)...);
+ }
+};
+
+template <typename Impl, typename Work, typename Handler,
+ typename R, typename... Args, typename... Signatures>
+class composed_op<Impl, Work, Handler, R(Args...), Signatures...>
+ : public composed_op<Impl, Work, Handler, Signatures...>
+{
+public:
+ using composed_op<Impl, Work, Handler, Signatures...>::composed_op;
+
+ template <typename... T>
+ void operator()(T&&... t)
+ {
+ if (this->invocations_ < ~0u)
+ ++this->invocations_;
+ this->get_cancellation_state().slot().clear();
+ this->impl_(*this, static_cast<T&&>(t)...);
+ }
+
+ using composed_op<Impl, Work, Handler, Signatures...>::complete;
+
+ void complete(Args... args)
+ {
+ this->work_.reset();
+ static_cast<Handler&&>(this->handler_)(static_cast<Args&&>(args)...);
+ }
+};
+
+template <typename Impl, typename Work, typename Handler, typename Signature>
+inline bool asio_handler_is_continuation(
+ composed_op<Impl, Work, Handler, Signature>* this_handler)
+{
+ return this_handler->invocations_ > 1 ? true
+ : boost_asio_handler_cont_helpers::is_continuation(
+ this_handler->handler_);
+}
+
+template <typename Implementation, typename Executors, typename... Signatures>
+class initiate_composed
+{
+public:
+ typedef typename composed_io_executors<Executors>::head_type executor_type;
+
+ template <typename I>
+ initiate_composed(I&& impl, composed_io_executors<Executors>&& executors)
+ : implementation_(std::forward<I>(impl)),
+ executors_(std::move(executors))
+ {
+ }
+
+ executor_type get_executor() const noexcept
+ {
+ return executors_.head_;
+ }
+
+ template <typename Handler, typename... Args>
+ void operator()(Handler&& handler, Args&&... args) const &
+ {
+ composed_op<decay_t<Implementation>, composed_work<Executors>,
+ decay_t<Handler>, Signatures...>(implementation_,
+ composed_work<Executors>(executors_),
+ static_cast<Handler&&>(handler))(static_cast<Args&&>(args)...);
+ }
+
+ template <typename Handler, typename... Args>
+ void operator()(Handler&& handler, Args&&... args) &&
+ {
+ composed_op<decay_t<Implementation>, composed_work<Executors>,
+ decay_t<Handler>, Signatures...>(
+ static_cast<Implementation&&>(implementation_),
+ composed_work<Executors>(executors_),
+ static_cast<Handler&&>(handler))(static_cast<Args&&>(args)...);
+ }
+
+private:
+ Implementation implementation_;
+ composed_io_executors<Executors> executors_;
+};
+
+template <typename Implementation, typename... Signatures>
+class initiate_composed<Implementation, void(), Signatures...>
+{
+public:
+ template <typename I>
+ initiate_composed(I&& impl, composed_io_executors<void()>&&)
+ : implementation_(std::forward<I>(impl))
+ {
+ }
+
+ template <typename Handler, typename... Args>
+ void operator()(Handler&& handler, Args&&... args) const &
+ {
+ composed_op<decay_t<Implementation>, composed_work<void()>,
+ decay_t<Handler>, Signatures...>(implementation_,
+ composed_work<void()>(composed_io_executors<void()>()),
+ static_cast<Handler&&>(handler))(static_cast<Args&&>(args)...);
+ }
+
+ template <typename Handler, typename... Args>
+ void operator()(Handler&& handler, Args&&... args) &&
+ {
+ composed_op<decay_t<Implementation>, composed_work<void()>,
+ decay_t<Handler>, Signatures...>(
+ static_cast<Implementation&&>(implementation_),
+ composed_work<void()>(composed_io_executors<void()>()),
+ static_cast<Handler&&>(handler))(static_cast<Args&&>(args)...);
+ }
+
+private:
+ Implementation implementation_;
+};
+
+template <typename... Signatures, typename Implementation, typename Executors>
+inline initiate_composed<Implementation, Executors, Signatures...>
+make_initiate_composed(Implementation&& implementation,
+ composed_io_executors<Executors>&& executors)
+{
+ return initiate_composed<decay_t<Implementation>, Executors, Signatures...>(
+ static_cast<Implementation&&>(implementation),
+ static_cast<composed_io_executors<Executors>&&>(executors));
+}
+
+} // namespace detail
+
+#if !defined(GENERATING_DOCUMENTATION)
+
+template <template <typename, typename> class Associator,
+ typename Impl, typename Work, typename Handler,
+ typename Signature, typename DefaultCandidate>
+struct associator<Associator,
+ detail::composed_op<Impl, Work, Handler, Signature>,
+ DefaultCandidate>
+ : Associator<Handler, DefaultCandidate>
+{
+ static typename Associator<Handler, DefaultCandidate>::type get(
+ const detail::composed_op<Impl, Work, Handler, Signature>& h) noexcept
+ {
+ return Associator<Handler, DefaultCandidate>::get(h.handler_);
+ }
+
+ static auto get(const detail::composed_op<Impl, Work, Handler, Signature>& h,
+ const DefaultCandidate& c) noexcept
+ -> decltype(Associator<Handler, DefaultCandidate>::get(h.handler_, c))
+ {
+ return Associator<Handler, DefaultCandidate>::get(h.handler_, c);
+ }
+};
+
+#endif // !defined(GENERATING_DOCUMENTATION)
+
+/// Creates an initiation function object that may be used to launch an
+/// asynchronous operation with a stateful implementation.
+/**
+ * The @c composed function simplifies the implementation of composed
+ * asynchronous operations automatically by wrapping a stateful function object
+ * for use as an initiation function object.
+ *
+ * @param implementation A function object that contains the implementation of
+ * the composed asynchronous operation. The first argument to the function
+ * object is a non-const reference to the enclosing intermediate completion
+ * handler. The remaining arguments are any arguments that originate from the
+ * completion handlers of any asynchronous operations performed by the
+ * implementation.
+ *
+ * @param io_objects_or_executors Zero or more I/O objects or I/O executors for
+ * which outstanding work must be maintained.
+ *
+ * @par Per-Operation Cancellation
+ * By default, terminal per-operation cancellation is enabled for composed
+ * operations that are implemented using @c composed. To disable cancellation
+ * for the composed operation, or to alter its supported cancellation types,
+ * call the @c self object's @c reset_cancellation_state function.
+ *
+ * @par Example:
+ *
+ * @code struct async_echo_implementation
+ * {
+ * tcp::socket& socket_;
+ * boost::asio::mutable_buffer buffer_;
+ * enum { starting, reading, writing } state_;
+ *
+ * template <typename Self>
+ * void operator()(Self& self,
+ * boost::system::error_code error,
+ * std::size_t n)
+ * {
+ * switch (state_)
+ * {
+ * case starting:
+ * state_ = reading;
+ * socket_.async_read_some(
+ * buffer_, std::move(self));
+ * break;
+ * case reading:
+ * if (error)
+ * {
+ * self.complete(error, 0);
+ * }
+ * else
+ * {
+ * state_ = writing;
+ * boost::asio::async_write(socket_, buffer_,
+ * boost::asio::transfer_exactly(n),
+ * std::move(self));
+ * }
+ * break;
+ * case writing:
+ * self.complete(error, n);
+ * break;
+ * }
+ * }
+ * };
+ *
+ * template <typename CompletionToken>
+ * auto async_echo(tcp::socket& socket,
+ * boost::asio::mutable_buffer buffer,
+ * CompletionToken&& token)
+ * -> decltype(
+ * boost::asio::async_initiate<CompletionToken,
+ * void(boost::system::error_code, std::size_t)>(
+ * boost::asio::composed(
+ * async_echo_implementation{socket, buffer,
+ * async_echo_implementation::starting}, socket),
+ * token))
+ * {
+ * return boost::asio::async_initiate<CompletionToken,
+ * void(boost::system::error_code, std::size_t)>(
+ * boost::asio::composed(
+ * async_echo_implementation{socket, buffer,
+ * async_echo_implementation::starting}, socket),
+ * token, boost::system::error_code{}, 0);
+ * } @endcode
+ */
+template <BOOST_ASIO_COMPLETION_SIGNATURE... Signatures,
+ typename Implementation, typename... IoObjectsOrExecutors>
+inline auto composed(Implementation&& implementation,
+ IoObjectsOrExecutors&&... io_objects_or_executors)
+ -> decltype(
+ detail::make_initiate_composed<Signatures...>(
+ static_cast<Implementation&&>(implementation),
+ detail::make_composed_io_executors(
+ detail::get_composed_io_executor(
+ static_cast<IoObjectsOrExecutors&&>(
+ io_objects_or_executors))...)))
+{
+ return detail::make_initiate_composed<Signatures...>(
+ static_cast<Implementation&&>(implementation),
+ detail::make_composed_io_executors(
+ detail::get_composed_io_executor(
+ static_cast<IoObjectsOrExecutors&&>(
+ io_objects_or_executors))...));
+}
+
+} // namespace asio
+} // namespace boost
+
+#include <boost/asio/detail/pop_options.hpp>
+
+#endif // BOOST_ASIO_COMPOSE_HPP
diff --git a/contrib/restricted/boost/asio/include/boost/asio/connect.hpp b/contrib/restricted/boost/asio/include/boost/asio/connect.hpp
index 5e8f5efc170..3d135750a55 100644
--- a/contrib/restricted/boost/asio/include/boost/asio/connect.hpp
+++ b/contrib/restricted/boost/asio/include/boost/asio/connect.hpp
@@ -32,34 +32,97 @@ namespace detail
template <typename, typename> class initiate_async_range_connect;
template <typename, typename> class initiate_async_iterator_connect;
- char (&has_iterator_helper(...))[2];
+ template <typename T, typename = void, typename = void>
+ struct is_endpoint_sequence_helper : false_type
+ {
+ };
template <typename T>
- char has_iterator_helper(T*, typename T::iterator* = 0);
+ struct is_endpoint_sequence_helper<T,
+ void_t<
+ decltype(declval<T>().begin())
+ >,
+ void_t<
+ decltype(declval<T>().end())
+ >
+ > : true_type
+ {
+ };
- template <typename T>
- struct has_iterator_typedef
+ template <typename T, typename Iterator, typename = void>
+ struct is_connect_condition_helper : false_type
+ {
+ };
+
+ template <typename T, typename Iterator>
+ struct is_connect_condition_helper<T, Iterator,
+ enable_if_t<
+ is_same<
+ result_of_t<T(boost::system::error_code, Iterator)>,
+ Iterator
+ >::value
+ >
+ > : true_type
+ {
+ };
+
+ template <typename T, typename Iterator>
+ struct is_connect_condition_helper<T, Iterator,
+ enable_if_t<
+ is_same<
+ result_of_t<T(boost::system::error_code,
+ decltype(*declval<Iterator>()))>,
+ bool
+ >::value
+ >
+ > : true_type
{
- enum { value = (sizeof((has_iterator_helper)((T*)(0))) == 1) };
+ };
+
+ struct default_connect_condition
+ {
+ template <typename Endpoint>
+ bool operator()(const boost::system::error_code&, const Endpoint&)
+ {
+ return true;
+ }
};
} // namespace detail
+#if defined(GENERATING_DOCUMENTATION)
+
/// Type trait used to determine whether a type is an endpoint sequence that can
/// be used with with @c connect and @c async_connect.
template <typename T>
struct is_endpoint_sequence
{
-#if defined(GENERATING_DOCUMENTATION)
/// The value member is true if the type may be used as an endpoint sequence.
- static const bool value;
-#else
- enum
- {
- value = detail::has_iterator_typedef<T>::value
- };
-#endif
+ static const bool value = automatically_determined;
+};
+
+/// Trait for determining whether a function object is a connect condition that
+/// can be used with @c connect and @c async_connect.
+template <typename T, typename Iterator>
+struct is_connect_condition
+{
+ /// The value member is true if the type may be used as a connect condition.
+ static constexpr bool value = automatically_determined;
+};
+
+#else // defined(GENERATING_DOCUMENTATION)
+
+template <typename T>
+struct is_endpoint_sequence : detail::is_endpoint_sequence_helper<T>
+{
+};
+
+template <typename T, typename Iterator>
+struct is_connect_condition : detail::is_connect_condition_helper<T, Iterator>
+{
};
+#endif // defined(GENERATING_DOCUMENTATION)
+
/**
* @defgroup connect boost::asio::connect
*
@@ -95,7 +158,9 @@ struct is_endpoint_sequence
template <typename Protocol, typename Executor, typename EndpointSequence>
typename Protocol::endpoint connect(basic_socket<Protocol, Executor>& s,
const EndpointSequence& endpoints,
- constraint_t<is_endpoint_sequence<EndpointSequence>::value> = 0);
+ constraint_t<
+ is_endpoint_sequence<EndpointSequence>::value
+ > = 0);
/// Establishes a socket connection by trying each endpoint in a sequence.
/**
@@ -130,7 +195,9 @@ typename Protocol::endpoint connect(basic_socket<Protocol, Executor>& s,
template <typename Protocol, typename Executor, typename EndpointSequence>
typename Protocol::endpoint connect(basic_socket<Protocol, Executor>& s,
const EndpointSequence& endpoints, boost::system::error_code& ec,
- constraint_t<is_endpoint_sequence<EndpointSequence>::value> = 0);
+ constraint_t<
+ is_endpoint_sequence<EndpointSequence>::value
+ > = 0);
#if !defined(BOOST_ASIO_NO_DEPRECATED)
/// (Deprecated: Use range overload.) Establishes a socket connection by trying
@@ -159,7 +226,9 @@ typename Protocol::endpoint connect(basic_socket<Protocol, Executor>& s,
*/
template <typename Protocol, typename Executor, typename Iterator>
Iterator connect(basic_socket<Protocol, Executor>& s, Iterator begin,
- constraint_t<!is_endpoint_sequence<Iterator>::value> = 0);
+ constraint_t<
+ !is_endpoint_sequence<Iterator>::value
+ > = 0);
/// (Deprecated: Use range overload.) Establishes a socket connection by trying
/// each endpoint in a sequence.
@@ -188,7 +257,9 @@ Iterator connect(basic_socket<Protocol, Executor>& s, Iterator begin,
template <typename Protocol, typename Executor, typename Iterator>
Iterator connect(basic_socket<Protocol, Executor>& s,
Iterator begin, boost::system::error_code& ec,
- constraint_t<!is_endpoint_sequence<Iterator>::value> = 0);
+ constraint_t<
+ !is_endpoint_sequence<Iterator>::value
+ > = 0);
#endif // !defined(BOOST_ASIO_NO_DEPRECATED)
/// Establishes a socket connection by trying each endpoint in a sequence.
@@ -314,7 +385,13 @@ template <typename Protocol, typename Executor,
typename EndpointSequence, typename ConnectCondition>
typename Protocol::endpoint connect(basic_socket<Protocol, Executor>& s,
const EndpointSequence& endpoints, ConnectCondition connect_condition,
- constraint_t<is_endpoint_sequence<EndpointSequence>::value> = 0);
+ constraint_t<
+ is_endpoint_sequence<EndpointSequence>::value
+ > = 0,
+ constraint_t<
+ is_connect_condition<ConnectCondition,
+ decltype(declval<const EndpointSequence&>().begin())>::value
+ > = 0);
/// Establishes a socket connection by trying each endpoint in a sequence.
/**
@@ -381,7 +458,13 @@ template <typename Protocol, typename Executor,
typename Protocol::endpoint connect(basic_socket<Protocol, Executor>& s,
const EndpointSequence& endpoints, ConnectCondition connect_condition,
boost::system::error_code& ec,
- constraint_t<is_endpoint_sequence<EndpointSequence>::value> = 0);
+ constraint_t<
+ is_endpoint_sequence<EndpointSequence>::value
+ > = 0,
+ constraint_t<
+ is_connect_condition<ConnectCondition,
+ decltype(declval<const EndpointSequence&>().begin())>::value
+ > = 0);
#if !defined(BOOST_ASIO_NO_DEPRECATED)
/// (Deprecated: Use range overload.) Establishes a socket connection by trying
@@ -423,7 +506,12 @@ template <typename Protocol, typename Executor,
typename Iterator, typename ConnectCondition>
Iterator connect(basic_socket<Protocol, Executor>& s,
Iterator begin, ConnectCondition connect_condition,
- constraint_t<!is_endpoint_sequence<Iterator>::value> = 0);
+ constraint_t<
+ !is_endpoint_sequence<Iterator>::value
+ > = 0,
+ constraint_t<
+ is_connect_condition<ConnectCondition, Iterator>::value
+ > = 0);
/// (Deprecated: Use range overload.) Establishes a socket connection by trying
/// each endpoint in a sequence.
@@ -464,7 +552,12 @@ template <typename Protocol, typename Executor,
typename Iterator, typename ConnectCondition>
Iterator connect(basic_socket<Protocol, Executor>& s, Iterator begin,
ConnectCondition connect_condition, boost::system::error_code& ec,
- constraint_t<!is_endpoint_sequence<Iterator>::value> = 0);
+ constraint_t<
+ !is_endpoint_sequence<Iterator>::value
+ > = 0,
+ constraint_t<
+ is_connect_condition<ConnectCondition, Iterator>::value
+ > = 0);
#endif // !defined(BOOST_ASIO_NO_DEPRECATED)
/// Establishes a socket connection by trying each endpoint in a sequence.
@@ -524,7 +617,10 @@ Iterator connect(basic_socket<Protocol, Executor>& s, Iterator begin,
template <typename Protocol, typename Executor,
typename Iterator, typename ConnectCondition>
Iterator connect(basic_socket<Protocol, Executor>& s, Iterator begin,
- Iterator end, ConnectCondition connect_condition);
+ Iterator end, ConnectCondition connect_condition,
+ constraint_t<
+ is_connect_condition<ConnectCondition, Iterator>::value
+ > = 0);
/// Establishes a socket connection by trying each endpoint in a sequence.
/**
@@ -593,7 +689,10 @@ template <typename Protocol, typename Executor,
typename Iterator, typename ConnectCondition>
Iterator connect(basic_socket<Protocol, Executor>& s,
Iterator begin, Iterator end, ConnectCondition connect_condition,
- boost::system::error_code& ec);
+ boost::system::error_code& ec,
+ constraint_t<
+ is_connect_condition<ConnectCondition, Iterator>::value
+ > = 0);
/*@}*/
@@ -637,7 +736,7 @@ Iterator connect(basic_socket<Protocol, Executor>& s,
* Regardless of whether the asynchronous operation completes immediately or
* not, the completion handler will not be invoked from within this function.
* On immediate completion, invocation of the handler will be performed in a
- * manner equivalent to using boost::asio::post().
+ * manner equivalent to using boost::asio::async_immediate().
*
* @par Completion Signature
* @code void(boost::system::error_code, typename Protocol::endpoint) @endcode
@@ -686,15 +785,27 @@ template <typename Protocol, typename Executor, typename EndpointSequence,
BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
typename Protocol::endpoint)) RangeConnectToken
= default_completion_token_t<Executor>>
-auto async_connect(basic_socket<Protocol, Executor>& s,
+inline auto async_connect(basic_socket<Protocol, Executor>& s,
const EndpointSequence& endpoints,
RangeConnectToken&& token = default_completion_token_t<Executor>(),
- constraint_t<is_endpoint_sequence<EndpointSequence>::value> = 0)
+ constraint_t<
+ is_endpoint_sequence<EndpointSequence>::value
+ > = 0,
+ constraint_t<
+ !is_connect_condition<RangeConnectToken,
+ decltype(declval<const EndpointSequence&>().begin())>::value
+ > = 0)
-> decltype(
async_initiate<RangeConnectToken,
void (boost::system::error_code, typename Protocol::endpoint)>(
declval<detail::initiate_async_range_connect<Protocol, Executor>>(),
- token, endpoints, declval<detail::default_connect_condition>()));
+ token, endpoints, declval<detail::default_connect_condition>()))
+{
+ return async_initiate<RangeConnectToken,
+ void (boost::system::error_code, typename Protocol::endpoint)>(
+ detail::initiate_async_range_connect<Protocol, Executor>(s),
+ token, endpoints, detail::default_connect_condition());
+}
#if !defined(BOOST_ASIO_NO_DEPRECATED)
/// (Deprecated: Use range overload.) Asynchronously establishes a socket
@@ -729,7 +840,7 @@ auto async_connect(basic_socket<Protocol, Executor>& s,
* Regardless of whether the asynchronous operation completes immediately or
* not, the completion handler will not be invoked from within this function.
* On immediate completion, invocation of the handler will be performed in a
- * manner equivalent to using boost::asio::post().
+ * manner equivalent to using boost::asio::async_immediate().
*
* @par Completion Signature
* @code void(boost::system::error_code, Iterator) @endcode
@@ -751,15 +862,29 @@ auto async_connect(basic_socket<Protocol, Executor>& s,
template <typename Protocol, typename Executor, typename Iterator,
BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
Iterator)) IteratorConnectToken = default_completion_token_t<Executor>>
-auto async_connect(basic_socket<Protocol, Executor>& s, Iterator begin,
+inline auto async_connect(basic_socket<Protocol, Executor>& s, Iterator begin,
IteratorConnectToken&& token = default_completion_token_t<Executor>(),
- constraint_t<!is_endpoint_sequence<Iterator>::value> = 0)
+ constraint_t<
+ !is_endpoint_sequence<Iterator>::value
+ > = 0,
+ constraint_t<
+ !is_same<Iterator, decay_t<IteratorConnectToken>>::value
+ > = 0,
+ constraint_t<
+ !is_connect_condition<IteratorConnectToken, Iterator>::value
+ > = 0)
-> decltype(
async_initiate<IteratorConnectToken,
void (boost::system::error_code, Iterator)>(
declval<detail::initiate_async_iterator_connect<Protocol, Executor>>(),
token, begin, Iterator(),
- declval<detail::default_connect_condition>()));
+ declval<detail::default_connect_condition>()))
+{
+ return async_initiate<IteratorConnectToken,
+ void (boost::system::error_code, Iterator)>(
+ detail::initiate_async_iterator_connect<Protocol, Executor>(s),
+ token, begin, Iterator(), detail::default_connect_condition());
+}
#endif // !defined(BOOST_ASIO_NO_DEPRECATED)
/// Asynchronously establishes a socket connection by trying each endpoint in a
@@ -796,7 +921,7 @@ auto async_connect(basic_socket<Protocol, Executor>& s, Iterator begin,
* Regardless of whether the asynchronous operation completes immediately or
* not, the completion handler will not be invoked from within this function.
* On immediate completion, invocation of the handler will be performed in a
- * manner equivalent to using boost::asio::post().
+ * manner equivalent to using boost::asio::async_immediate().
*
* @par Completion Signature
* @code void(boost::system::error_code, Iterator) @endcode
@@ -830,14 +955,23 @@ auto async_connect(basic_socket<Protocol, Executor>& s, Iterator begin,
template <typename Protocol, typename Executor, typename Iterator,
BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
Iterator)) IteratorConnectToken = default_completion_token_t<Executor>>
-auto async_connect(
+inline auto async_connect(
basic_socket<Protocol, Executor>& s, Iterator begin, Iterator end,
- IteratorConnectToken&& token = default_completion_token_t<Executor>())
+ IteratorConnectToken&& token = default_completion_token_t<Executor>(),
+ constraint_t<
+ !is_connect_condition<IteratorConnectToken, Iterator>::value
+ > = 0)
-> decltype(
async_initiate<IteratorConnectToken,
void (boost::system::error_code, Iterator)>(
declval<detail::initiate_async_iterator_connect<Protocol, Executor>>(),
- token, begin, end, declval<detail::default_connect_condition>()));
+ token, begin, end, declval<detail::default_connect_condition>()))
+{
+ return async_initiate<IteratorConnectToken,
+ void (boost::system::error_code, Iterator)>(
+ detail::initiate_async_iterator_connect<Protocol, Executor>(s),
+ token, begin, end, detail::default_connect_condition());
+}
/// Asynchronously establishes a socket connection by trying each endpoint in a
/// sequence.
@@ -882,7 +1016,7 @@ auto async_connect(
* Regardless of whether the asynchronous operation completes immediately or
* not, the completion handler will not be invoked from within this function.
* On immediate completion, invocation of the handler will be performed in a
- * manner equivalent to using boost::asio::post().
+ * manner equivalent to using boost::asio::async_immediate().
*
* @par Completion Signature
* @code void(boost::system::error_code, typename Protocol::endpoint) @endcode
@@ -955,15 +1089,27 @@ template <typename Protocol, typename Executor,
BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
typename Protocol::endpoint)) RangeConnectToken
= default_completion_token_t<Executor>>
-auto async_connect(basic_socket<Protocol, Executor>& s,
+inline auto async_connect(basic_socket<Protocol, Executor>& s,
const EndpointSequence& endpoints, ConnectCondition connect_condition,
RangeConnectToken&& token = default_completion_token_t<Executor>(),
- constraint_t<is_endpoint_sequence<EndpointSequence>::value> = 0)
+ constraint_t<
+ is_endpoint_sequence<EndpointSequence>::value
+ > = 0,
+ constraint_t<
+ is_connect_condition<ConnectCondition,
+ decltype(declval<const EndpointSequence&>().begin())>::value
+ > = 0)
-> decltype(
async_initiate<RangeConnectToken,
void (boost::system::error_code, typename Protocol::endpoint)>(
declval<detail::initiate_async_range_connect<Protocol, Executor>>(),
- token, endpoints, connect_condition));
+ token, endpoints, connect_condition))
+{
+ return async_initiate<RangeConnectToken,
+ void (boost::system::error_code, typename Protocol::endpoint)>(
+ detail::initiate_async_range_connect<Protocol, Executor>(s),
+ token, endpoints, connect_condition);
+}
#if !defined(BOOST_ASIO_NO_DEPRECATED)
/// (Deprecated: Use range overload.) Asynchronously establishes a socket
@@ -1009,7 +1155,7 @@ auto async_connect(basic_socket<Protocol, Executor>& s,
* Regardless of whether the asynchronous operation completes immediately or
* not, the completion handler will not be invoked from within this function.
* On immediate completion, invocation of the handler will be performed in a
- * manner equivalent to using boost::asio::post().
+ * manner equivalent to using boost::asio::async_immediate().
*
* @par Completion Signature
* @code void(boost::system::error_code, Iterator) @endcode
@@ -1032,15 +1178,26 @@ template <typename Protocol, typename Executor,
typename Iterator, typename ConnectCondition,
BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
Iterator)) IteratorConnectToken = default_completion_token_t<Executor>>
-auto async_connect(basic_socket<Protocol, Executor>& s,
+inline auto async_connect(basic_socket<Protocol, Executor>& s,
Iterator begin, ConnectCondition connect_condition,
IteratorConnectToken&& token = default_completion_token_t<Executor>(),
- constraint_t<!is_endpoint_sequence<Iterator>::value> = 0)
+ constraint_t<
+ !is_endpoint_sequence<Iterator>::value
+ > = 0,
+ constraint_t<
+ is_connect_condition<ConnectCondition, Iterator>::value
+ > = 0)
-> decltype(
async_initiate<IteratorConnectToken,
void (boost::system::error_code, Iterator)>(
declval<detail::initiate_async_iterator_connect<Protocol, Executor>>(),
- token, begin, Iterator(), connect_condition));
+ token, begin, Iterator(), connect_condition))
+{
+ return async_initiate<IteratorConnectToken,
+ void (boost::system::error_code, Iterator)>(
+ detail::initiate_async_iterator_connect<Protocol, Executor>(s),
+ token, begin, Iterator(), connect_condition);
+}
#endif // !defined(BOOST_ASIO_NO_DEPRECATED)
/// Asynchronously establishes a socket connection by trying each endpoint in a
@@ -1088,7 +1245,7 @@ auto async_connect(basic_socket<Protocol, Executor>& s,
* Regardless of whether the asynchronous operation completes immediately or
* not, the completion handler will not be invoked from within this function.
* On immediate completion, invocation of the handler will be performed in a
- * manner equivalent to using boost::asio::post().
+ * manner equivalent to using boost::asio::async_immediate().
*
* @par Completion Signature
* @code void(boost::system::error_code, Iterator) @endcode
@@ -1161,14 +1318,23 @@ template <typename Protocol, typename Executor,
typename Iterator, typename ConnectCondition,
BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
Iterator)) IteratorConnectToken = default_completion_token_t<Executor>>
-auto async_connect(basic_socket<Protocol, Executor>& s,
+inline auto async_connect(basic_socket<Protocol, Executor>& s,
Iterator begin, Iterator end, ConnectCondition connect_condition,
- IteratorConnectToken&& token = default_completion_token_t<Executor>())
+ IteratorConnectToken&& token = default_completion_token_t<Executor>(),
+ constraint_t<
+ is_connect_condition<ConnectCondition, Iterator>::value
+ > = 0)
-> decltype(
async_initiate<IteratorConnectToken,
void (boost::system::error_code, Iterator)>(
declval<detail::initiate_async_iterator_connect<Protocol, Executor>>(),
- token, begin, end, connect_condition));
+ token, begin, end, connect_condition))
+{
+ return async_initiate<IteratorConnectToken,
+ void (boost::system::error_code, Iterator)>(
+ detail::initiate_async_iterator_connect<Protocol, Executor>(s),
+ token, begin, end, connect_condition);
+}
/*@}*/
@@ -1179,4 +1345,4 @@ auto async_connect(basic_socket<Protocol, Executor>& s,
#include <boost/asio/impl/connect.hpp>
-#endif
+#endif // BOOST_ASIO_CONNECT_HPP
diff --git a/contrib/restricted/boost/asio/include/boost/asio/coroutine.hpp b/contrib/restricted/boost/asio/include/boost/asio/coroutine.hpp
index 72ddd21e5ca..7f37866c20b 100644
--- a/contrib/restricted/boost/asio/include/boost/asio/coroutine.hpp
+++ b/contrib/restricted/boost/asio/include/boost/asio/coroutine.hpp
@@ -201,7 +201,7 @@ class coroutine_ref;
* The @c fork pseudo-keyword is used when "forking" a coroutine, i.e. splitting
* it into two (or more) copies. One use of @c fork is in a server, where a new
* coroutine is created to handle each client connection:
- *
+ *
* @code reenter (this)
* {
* do
@@ -212,9 +212,9 @@ class coroutine_ref;
* } while (is_parent());
* ... client-specific handling follows ...
* } @endcode
- *
+ *
* The logical steps involved in a @c fork are:
- *
+ *
* @li @c fork saves the current state of the coroutine.
* @li The statement creates a copy of the coroutine and either executes it
* immediately or schedules it for later execution.
@@ -259,7 +259,6 @@ private:
int value_;
};
-
namespace detail {
class coroutine_ref
diff --git a/contrib/restricted/boost/asio/include/boost/asio/default_completion_token.hpp b/contrib/restricted/boost/asio/include/boost/asio/default_completion_token.hpp
new file mode 100644
index 00000000000..f7a41ccff71
--- /dev/null
+++ b/contrib/restricted/boost/asio/include/boost/asio/default_completion_token.hpp
@@ -0,0 +1,91 @@
+//
+// default_completion_token.hpp
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+
+#ifndef BOOST_ASIO_DEFAULT_COMPLETION_TOKEN_HPP
+#define BOOST_ASIO_DEFAULT_COMPLETION_TOKEN_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include <boost/asio/detail/config.hpp>
+#include <boost/asio/detail/type_traits.hpp>
+
+#include <boost/asio/detail/push_options.hpp>
+
+namespace boost {
+namespace asio {
+
+class deferred_t;
+
+namespace detail {
+
+template <typename T, typename = void>
+struct default_completion_token_impl
+{
+ typedef deferred_t type;
+};
+
+template <typename T>
+struct default_completion_token_impl<T,
+ void_t<typename T::default_completion_token_type>
+ >
+{
+ typedef typename T::default_completion_token_type type;
+};
+
+} // namespace detail
+
+#if defined(GENERATING_DOCUMENTATION)
+
+/// Traits type used to determine the default completion token type associated
+/// with a type (such as an executor).
+/**
+ * A program may specialise this traits type if the @c T template parameter in
+ * the specialisation is a user-defined type.
+ *
+ * Specialisations of this trait may provide a nested typedef @c type, which is
+ * a default-constructible completion token type.
+ *
+ * If not otherwise specialised, the default completion token type is
+ * boost::asio::deferred_t.
+ */
+template <typename T>
+struct default_completion_token
+{
+ /// If @c T has a nested type @c default_completion_token_type,
+ /// <tt>T::default_completion_token_type</tt>. Otherwise the typedef @c type
+ /// is boost::asio::deferred_t.
+ typedef see_below type;
+};
+#else
+template <typename T>
+struct default_completion_token
+ : detail::default_completion_token_impl<T>
+{
+};
+#endif
+
+template <typename T>
+using default_completion_token_t = typename default_completion_token<T>::type;
+
+#define BOOST_ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(e) \
+ = typename ::boost::asio::default_completion_token<e>::type
+#define BOOST_ASIO_DEFAULT_COMPLETION_TOKEN(e) \
+ = typename ::boost::asio::default_completion_token<e>::type()
+
+} // namespace asio
+} // namespace boost
+
+#include <boost/asio/detail/pop_options.hpp>
+
+#include <boost/asio/deferred.hpp>
+
+#endif // BOOST_ASIO_DEFAULT_COMPLETION_TOKEN_HPP
diff --git a/contrib/restricted/boost/asio/include/boost/asio/deferred.hpp b/contrib/restricted/boost/asio/include/boost/asio/deferred.hpp
index 4e69a494fc5..dfb8e51febf 100644
--- a/contrib/restricted/boost/asio/include/boost/asio/deferred.hpp
+++ b/contrib/restricted/boost/asio/include/boost/asio/deferred.hpp
@@ -185,7 +185,7 @@ template <typename Function>
class deferred_function
{
public:
- /// Constructor.
+ /// Constructor.
template <typename F>
constexpr explicit deferred_function(deferred_init_tag, F&& function)
: function_(static_cast<F&&>(function))
@@ -326,7 +326,8 @@ private:
detail::index_sequence<I...>) const &
-> decltype(
async_initiate<CompletionToken, Signature>(
- initiation_t(initiation_), token, std::get<I>(init_args_)...))
+ conditional_t<true, initiation_t, CompletionToken>(initiation_),
+ token, std::get<I>(init_args_)...))
{
return async_initiate<CompletionToken, Signature>(
initiation_t(initiation_), token, std::get<I>(init_args_)...);
@@ -593,8 +594,11 @@ struct is_deferred<deferred_conditional<OnTrue, OnFalse>> : true_type
* The deferred_t class is used to indicate that an asynchronous operation
* should return a function object which is itself an initiation function. A
* deferred_t object may be passed as a completion token to an asynchronous
- * operation, typically using the special value @c boost::asio::deferred. For
- * example:
+ * operation, typically as the default completion token:
+ *
+ * @code auto my_deferred_op = my_socket.async_read_some(my_buffer); @endcode
+ *
+ * or by explicitly passing the special value @c boost::asio::deferred:
*
* @code auto my_deferred_op
* = my_socket.async_read_some(my_buffer,
@@ -705,7 +709,7 @@ inline auto operator|(Head head, Tail&& tail)
/**
* See the documentation for boost::asio::deferred_t for a usage example.
*/
-constexpr deferred_t deferred;
+BOOST_ASIO_INLINE_VARIABLE constexpr deferred_t deferred;
} // namespace asio
} // namespace boost
diff --git a/contrib/restricted/boost/asio/include/boost/asio/detached.hpp b/contrib/restricted/boost/asio/include/boost/asio/detached.hpp
index 82062e942e0..d0dfce729df 100644
--- a/contrib/restricted/boost/asio/include/boost/asio/detached.hpp
+++ b/contrib/restricted/boost/asio/include/boost/asio/detached.hpp
@@ -39,7 +39,7 @@ namespace asio {
class detached_t
{
public:
- /// Constructor.
+ /// Constructor.
constexpr detached_t()
{
}
@@ -95,7 +95,7 @@ public:
/**
* See the documentation for boost::asio::detached_t for a usage example.
*/
-constexpr detached_t detached;
+BOOST_ASIO_INLINE_VARIABLE constexpr detached_t detached;
} // namespace asio
} // namespace boost
diff --git a/contrib/restricted/boost/asio/include/boost/asio/detail/buffered_stream_storage.hpp b/contrib/restricted/boost/asio/include/boost/asio/detail/buffered_stream_storage.hpp
index e828232deb0..096efc82f8b 100644
--- a/contrib/restricted/boost/asio/include/boost/asio/detail/buffered_stream_storage.hpp
+++ b/contrib/restricted/boost/asio/include/boost/asio/detail/buffered_stream_storage.hpp
@@ -114,7 +114,7 @@ private:
// The offset to the end of the unread data.
size_type end_offset_;
-
+
// The data in the buffer.
std::vector<byte_type> buffer_;
};
diff --git a/contrib/restricted/boost/asio/include/boost/asio/experimental/detail/channel_message.hpp b/contrib/restricted/boost/asio/include/boost/asio/detail/completion_message.hpp
index c3a7b131821..345deb21065 100644
--- a/contrib/restricted/boost/asio/include/boost/asio/experimental/detail/channel_message.hpp
+++ b/contrib/restricted/boost/asio/include/boost/asio/detail/completion_message.hpp
@@ -1,6 +1,6 @@
//
-// experimental/detail/channel_message.hpp
-// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+// detail/completion_message.hpp
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
@@ -8,8 +8,8 @@
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
-#ifndef BOOST_ASIO_EXPERIMENTAL_DETAIL_CHANNEL_MESSAGE_HPP
-#define BOOST_ASIO_EXPERIMENTAL_DETAIL_CHANNEL_MESSAGE_HPP
+#ifndef BOOST_ASIO_DETAIL_COMPLETION_MESSAGE_HPP
+#define BOOST_ASIO_DETAIL_COMPLETION_MESSAGE_HPP
#if defined(_MSC_VER) && (_MSC_VER >= 1200)
# pragma once
@@ -24,17 +24,16 @@
namespace boost {
namespace asio {
-namespace experimental {
namespace detail {
template <typename Signature>
-class channel_message;
+class completion_message;
template <typename R>
-class channel_message<R()>
+class completion_message<R()>
{
public:
- channel_message(int)
+ completion_message(int)
{
}
@@ -46,11 +45,11 @@ public:
};
template <typename R, typename Arg0>
-class channel_message<R(Arg0)>
+class completion_message<R(Arg0)>
{
public:
template <typename T0>
- channel_message(int, T0&& t0)
+ completion_message(int, T0&& t0)
: arg0_(static_cast<T0&&>(t0))
{
}
@@ -68,11 +67,11 @@ private:
};
template <typename R, typename Arg0, typename Arg1>
-class channel_message<R(Arg0, Arg1)>
+class completion_message<R(Arg0, Arg1)>
{
public:
template <typename T0, typename T1>
- channel_message(int, T0&& t0, T1&& t1)
+ completion_message(int, T0&& t0, T1&& t1)
: arg0_(static_cast<T0&&>(t0)),
arg1_(static_cast<T1&&>(t1))
{
@@ -94,11 +93,11 @@ private:
};
template <typename R, typename... Args>
-class channel_message<R(Args...)>
+class completion_message<R(Args...)>
{
public:
template <typename... T>
- channel_message(int, T&&... t)
+ completion_message(int, T&&... t)
: args_(static_cast<T&&>(t)...)
{
}
@@ -122,10 +121,9 @@ private:
};
} // namespace detail
-} // namespace experimental
} // namespace asio
} // namespace boost
#include <boost/asio/detail/pop_options.hpp>
-#endif // BOOST_ASIO_EXPERIMENTAL_DETAIL_CHANNEL_MESSAGE_HPP
+#endif // BOOST_ASIO_DETAIL_COMPLETION_MESSAGE_HPP
diff --git a/contrib/restricted/boost/asio/include/boost/asio/experimental/detail/channel_payload.hpp b/contrib/restricted/boost/asio/include/boost/asio/detail/completion_payload.hpp
index 544c3d154e8..1135bff3fe5 100644
--- a/contrib/restricted/boost/asio/include/boost/asio/experimental/detail/channel_payload.hpp
+++ b/contrib/restricted/boost/asio/include/boost/asio/detail/completion_payload.hpp
@@ -1,6 +1,6 @@
//
-// experimental/detail/channel_payload.hpp
-// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+// detail/completion_payload.hpp
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
@@ -8,8 +8,8 @@
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
-#ifndef BOOST_ASIO_EXPERIMENTAL_DETAIL_CHANNEL_PAYLOAD_HPP
-#define BOOST_ASIO_EXPERIMENTAL_DETAIL_CHANNEL_PAYLOAD_HPP
+#ifndef BOOST_ASIO_DETAIL_COMPLETION_PAYLOAD_HPP
+#define BOOST_ASIO_DETAIL_COMPLETION_PAYLOAD_HPP
#if defined(_MSC_VER) && (_MSC_VER >= 1200)
# pragma once
@@ -18,7 +18,7 @@
#include <boost/asio/detail/config.hpp>
#include <boost/asio/detail/type_traits.hpp>
#include <boost/system/error_code.hpp>
-#include <boost/asio/experimental/detail/channel_message.hpp>
+#include <boost/asio/detail/completion_message.hpp>
#if defined(BOOST_ASIO_HAS_STD_VARIANT)
# include <variant>
@@ -30,17 +30,16 @@
namespace boost {
namespace asio {
-namespace experimental {
namespace detail {
template <typename... Signatures>
-class channel_payload;
+class completion_payload;
template <typename R>
-class channel_payload<R()>
+class completion_payload<R()>
{
public:
- explicit channel_payload(channel_message<R()>)
+ explicit completion_payload(completion_message<R()>)
{
}
@@ -52,11 +51,11 @@ public:
};
template <typename Signature>
-class channel_payload<Signature>
+class completion_payload<Signature>
{
public:
- channel_payload(channel_message<Signature>&& m)
- : message_(static_cast<channel_message<Signature>&&>(m))
+ completion_payload(completion_message<Signature>&& m)
+ : message_(static_cast<completion_message<Signature>&&>(m))
{
}
@@ -67,18 +66,18 @@ public:
}
private:
- channel_message<Signature> message_;
+ completion_message<Signature> message_;
};
#if defined(BOOST_ASIO_HAS_STD_VARIANT)
template <typename... Signatures>
-class channel_payload
+class completion_payload
{
public:
template <typename Signature>
- channel_payload(channel_message<Signature>&& m)
- : message_(static_cast<channel_message<Signature>&&>(m))
+ completion_payload(completion_message<Signature>&& m)
+ : message_(static_cast<completion_message<Signature>&&>(m))
{
}
@@ -93,25 +92,25 @@ public:
}
private:
- std::variant<channel_message<Signatures>...> message_;
+ std::variant<completion_message<Signatures>...> message_;
};
#else // defined(BOOST_ASIO_HAS_STD_VARIANT)
template <typename R1, typename R2>
-class channel_payload<R1(), R2(boost::system::error_code)>
+class completion_payload<R1(), R2(boost::system::error_code)>
{
public:
- typedef channel_message<R1()> void_message_type;
- typedef channel_message<R2(boost::system::error_code)> error_message_type;
+ typedef completion_message<R1()> void_message_type;
+ typedef completion_message<R2(boost::system::error_code)> error_message_type;
- channel_payload(void_message_type&&)
+ completion_payload(void_message_type&&)
: message_(0, boost::system::error_code()),
empty_(true)
{
}
- channel_payload(error_message_type&& m)
+ completion_payload(error_message_type&& m)
: message_(static_cast<error_message_type&&>(m)),
empty_(false)
{
@@ -121,7 +120,7 @@ public:
void receive(Handler& handler)
{
if (empty_)
- channel_message<R1()>(0).receive(handler);
+ completion_message<R1()>(0).receive(handler);
else
message_.receive(handler);
}
@@ -132,25 +131,25 @@ private:
};
template <typename Sig1, typename Sig2>
-class channel_payload<Sig1, Sig2>
+class completion_payload<Sig1, Sig2>
{
public:
- typedef channel_message<Sig1> message_1_type;
- typedef channel_message<Sig2> message_2_type;
+ typedef completion_message<Sig1> message_1_type;
+ typedef completion_message<Sig2> message_2_type;
- channel_payload(message_1_type&& m)
+ completion_payload(message_1_type&& m)
: index_(1)
{
new (&storage_.message_1_) message_1_type(static_cast<message_1_type&&>(m));
}
- channel_payload(message_2_type&& m)
+ completion_payload(message_2_type&& m)
: index_(2)
{
new (&storage_.message_2_) message_2_type(static_cast<message_2_type&&>(m));
}
- channel_payload(channel_payload&& other)
+ completion_payload(completion_payload&& other)
: index_(other.index_)
{
switch (index_)
@@ -168,7 +167,7 @@ public:
}
}
- ~channel_payload()
+ ~completion_payload()
{
switch (index_)
{
@@ -215,10 +214,9 @@ private:
#endif // defined(BOOST_ASIO_HAS_STD_VARIANT)
} // namespace detail
-} // namespace experimental
} // namespace asio
} // namespace boost
#include <boost/asio/detail/pop_options.hpp>
-#endif // BOOST_ASIO_EXPERIMENTAL_DETAIL_CHANNEL_PAYLOAD_HPP
+#endif // BOOST_ASIO_DETAIL_COMPLETION_PAYLOAD_HPP
diff --git a/contrib/restricted/boost/asio/include/boost/asio/experimental/detail/channel_handler.hpp b/contrib/restricted/boost/asio/include/boost/asio/detail/completion_payload_handler.hpp
index 09eafad2332..db08b250138 100644
--- a/contrib/restricted/boost/asio/include/boost/asio/experimental/detail/channel_handler.hpp
+++ b/contrib/restricted/boost/asio/include/boost/asio/detail/completion_payload_handler.hpp
@@ -1,6 +1,6 @@
//
-// experimental/detail/channel_handler.hpp
-// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+// detail/completion_payload_handler.hpp
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
@@ -8,8 +8,8 @@
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
-#ifndef BOOST_ASIO_EXPERIMENTAL_DETAIL_CHANNEL_HANDLER_HPP
-#define BOOST_ASIO_EXPERIMENTAL_DETAIL_CHANNEL_HANDLER_HPP
+#ifndef BOOST_ASIO_DETAIL_COMPLETION_PAYLOAD_HANDLER_HPP
+#define BOOST_ASIO_DETAIL_COMPLETION_PAYLOAD_HANDLER_HPP
#if defined(_MSC_VER) && (_MSC_VER >= 1200)
# pragma once
@@ -17,20 +17,18 @@
#include <boost/asio/detail/config.hpp>
#include <boost/asio/associator.hpp>
-#include <boost/asio/experimental/detail/channel_payload.hpp>
#include <boost/asio/detail/push_options.hpp>
namespace boost {
namespace asio {
-namespace experimental {
namespace detail {
template <typename Payload, typename Handler>
-class channel_handler
+class completion_payload_handler
{
public:
- channel_handler(Payload&& p, Handler& h)
+ completion_payload_handler(Payload&& p, Handler& h)
: payload_(static_cast<Payload&&>(p)),
handler_(static_cast<Handler&&>(h))
{
@@ -41,29 +39,33 @@ public:
payload_.receive(handler_);
}
+ Handler& handler()
+ {
+ return handler_;
+ }
+
//private:
Payload payload_;
Handler handler_;
};
} // namespace detail
-} // namespace experimental
template <template <typename, typename> class Associator,
typename Payload, typename Handler, typename DefaultCandidate>
struct associator<Associator,
- experimental::detail::channel_handler<Payload, Handler>,
+ detail::completion_payload_handler<Payload, Handler>,
DefaultCandidate>
: Associator<Handler, DefaultCandidate>
{
static typename Associator<Handler, DefaultCandidate>::type get(
- const experimental::detail::channel_handler<Payload, Handler>& h) noexcept
+ const detail::completion_payload_handler<Payload, Handler>& h) noexcept
{
return Associator<Handler, DefaultCandidate>::get(h.handler_);
}
static auto get(
- const experimental::detail::channel_handler<Payload, Handler>& h,
+ const detail::completion_payload_handler<Payload, Handler>& h,
const DefaultCandidate& c) noexcept
-> decltype(Associator<Handler, DefaultCandidate>::get(h.handler_, c))
{
@@ -76,4 +78,4 @@ struct associator<Associator,
#include <boost/asio/detail/pop_options.hpp>
-#endif // BOOST_ASIO_EXPERIMENTAL_DETAIL_CHANNEL_HANDLER_HPP
+#endif // BOOST_ASIO_DETAIL_COMPLETION_PAYLOAD_HANDLER_HPP
diff --git a/contrib/restricted/boost/asio/include/boost/asio/detail/config.hpp b/contrib/restricted/boost/asio/include/boost/asio/detail/config.hpp
index 42cce009052..1f02721999d 100644
--- a/contrib/restricted/boost/asio/include/boost/asio/detail/config.hpp
+++ b/contrib/restricted/boost/asio/include/boost/asio/detail/config.hpp
@@ -341,6 +341,19 @@
# endif // !defined(BOOST_ASIO_DISABLE_VARIADIC_LAMBDA_CAPTURES)
#endif // !defined(BOOST_ASIO_HAS_VARIADIC_LAMBDA_CAPTURES)
+// Support for inline variables.
+#if !defined(BOOST_ASIO_HAS_INLINE_VARIABLES)
+# if !defined(BOOST_ASIO_DISABLE_INLINE_VARIABLES)
+# if (__cplusplus >= 201703) && (__cpp_inline_variables >= 201606)
+# define BOOST_ASIO_HAS_INLINE_VARIABLES 1
+# define BOOST_ASIO_INLINE_VARIABLE inline
+# endif // (__cplusplus >= 201703) && (__cpp_inline_variables >= 201606)
+# endif // !defined(BOOST_ASIO_DISABLE_INLINE_VARIABLES)
+#endif // !defined(BOOST_ASIO_HAS_INLINE_VARIABLES)
+#if !defined(BOOST_ASIO_INLINE_VARIABLE)
+# define BOOST_ASIO_INLINE_VARIABLE
+#endif // !defined(BOOST_ASIO_INLINE_VARIABLE)
+
// Default alignment.
#if defined(__STDCPP_DEFAULT_NEW_ALIGNMENT__)
# define BOOST_ASIO_DEFAULT_ALIGN __STDCPP_DEFAULT_NEW_ALIGNMENT__
@@ -362,7 +375,9 @@
# if defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
# if (_LIBCPP_STD_VER > 14) && defined(_LIBCPP_HAS_ALIGNED_ALLOC) \
&& !defined(_LIBCPP_MSVCRT) && !defined(__MINGW32__)
-# if defined(__APPLE__)
+# if defined(__ANDROID__) && (__ANDROID_API__ >= 28)
+# define BOOST_ASIO_HAS_STD_ALIGNED_ALLOC 1
+# elif defined(__APPLE__)
# if defined(__MAC_OS_X_VERSION_MIN_REQUIRED)
# if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 101500)
# define BOOST_ASIO_HAS_STD_ALIGNED_ALLOC 1
@@ -532,9 +547,9 @@
# define BOOST_ASIO_HAS_STD_INVOKE_RESULT 1
# endif // (_MSC_VER >= 1911 && _MSVC_LANG >= 201703)
# else // defined(BOOST_ASIO_MSVC)
-# if (__cplusplus >= 201703)
+# if (__cplusplus >= 201703) && (__cpp_lib_is_invocable >= 201703)
# define BOOST_ASIO_HAS_STD_INVOKE_RESULT 1
-# endif // (__cplusplus >= 201703)
+# endif // (__cplusplus >= 201703) && (__cpp_lib_is_invocable >= 201703)
# endif // defined(BOOST_ASIO_MSVC)
# endif // !defined(BOOST_ASIO_DISABLE_STD_INVOKE_RESULT)
#endif // !defined(BOOST_ASIO_HAS_STD_INVOKE_RESULT)
@@ -1275,7 +1290,10 @@
// Support the co_await keyword on compilers known to allow it.
#if !defined(BOOST_ASIO_HAS_CO_AWAIT)
# if !defined(BOOST_ASIO_DISABLE_CO_AWAIT)
-# if defined(BOOST_ASIO_MSVC)
+# if (__cplusplus >= 202002) \
+ && (__cpp_impl_coroutine >= 201902) && (__cpp_lib_coroutine >= 201902)
+# define BOOST_ASIO_HAS_CO_AWAIT 1
+# elif defined(BOOST_ASIO_MSVC)
# if (_MSC_VER >= 1928) && (_MSVC_LANG >= 201705) && !defined(__clang__)
# define BOOST_ASIO_HAS_CO_AWAIT 1
# elif (_MSC_FULL_VER >= 190023506)
@@ -1387,10 +1405,8 @@
#if !defined(BOOST_ASIO_HAS_SNPRINTF)
# if !defined(BOOST_ASIO_DISABLE_SNPRINTF)
# if defined(__APPLE__)
-# if (__clang_major__ >= 14)
-# define BOOST_ASIO_HAS_SNPRINTF 1
-# endif // (__clang_major__ >= 14)
-# endif // defined(__apple_build_version__)
+# define BOOST_ASIO_HAS_SNPRINTF 1
+# endif // defined(__APPLE__)
# endif // !defined(BOOST_ASIO_DISABLE_SNPRINTF)
#endif // !defined(BOOST_ASIO_HAS_SNPRINTF)
diff --git a/contrib/restricted/boost/asio/include/boost/asio/detail/deadline_timer_service.hpp b/contrib/restricted/boost/asio/include/boost/asio/detail/deadline_timer_service.hpp
index ee7fa97a691..72059ce725c 100644
--- a/contrib/restricted/boost/asio/include/boost/asio/detail/deadline_timer_service.hpp
+++ b/contrib/restricted/boost/asio/include/boost/asio/detail/deadline_timer_service.hpp
@@ -104,7 +104,11 @@ public:
void move_construct(implementation_type& impl,
implementation_type& other_impl)
{
- scheduler_.move_timer(timer_queue_, impl.timer_data, other_impl.timer_data);
+ if (other_impl.might_have_pending_waits)
+ {
+ scheduler_.move_timer(timer_queue_,
+ impl.timer_data, other_impl.timer_data);
+ }
impl.expiry = other_impl.expiry;
other_impl.expiry = time_type();
diff --git a/contrib/restricted/boost/asio/include/boost/asio/detail/handler_alloc_helpers.hpp b/contrib/restricted/boost/asio/include/boost/asio/detail/handler_alloc_helpers.hpp
index 7b999085db9..6c0a37ca35a 100644
--- a/contrib/restricted/boost/asio/include/boost/asio/detail/handler_alloc_helpers.hpp
+++ b/contrib/restricted/boost/asio/include/boost/asio/detail/handler_alloc_helpers.hpp
@@ -17,121 +17,12 @@
#include <boost/asio/detail/config.hpp>
#include <boost/asio/detail/memory.hpp>
-#include <boost/asio/detail/noncopyable.hpp>
#include <boost/asio/detail/recycling_allocator.hpp>
-#include <boost/asio/detail/thread_info_base.hpp>
#include <boost/asio/associated_allocator.hpp>
#include <boost/asio/detail/push_options.hpp>
-namespace boost {
-namespace asio {
-namespace detail {
-
-inline void* default_allocate(std::size_t s,
- std::size_t align = BOOST_ASIO_DEFAULT_ALIGN)
-{
-#if !defined(BOOST_ASIO_DISABLE_SMALL_BLOCK_RECYCLING)
- return boost::asio::detail::thread_info_base::allocate(
- boost::asio::detail::thread_context::top_of_thread_call_stack(),
- s, align);
-#else // !defined(BOOST_ASIO_DISABLE_SMALL_BLOCK_RECYCLING)
- return boost::asio::aligned_new(align, s);
-#endif // !defined(BOOST_ASIO_DISABLE_SMALL_BLOCK_RECYCLING)
-}
-
-inline void default_deallocate(void* p, std::size_t s)
-{
-#if !defined(BOOST_ASIO_DISABLE_SMALL_BLOCK_RECYCLING)
- boost::asio::detail::thread_info_base::deallocate(
- boost::asio::detail::thread_context::top_of_thread_call_stack(), p, s);
-#else // !defined(BOOST_ASIO_DISABLE_SMALL_BLOCK_RECYCLING)
- (void)s;
- boost::asio::aligned_delete(p);
-#endif // !defined(BOOST_ASIO_DISABLE_SMALL_BLOCK_RECYCLING)
-}
-
-template <typename T>
-class default_allocator
-{
-public:
- typedef T value_type;
-
- template <typename U>
- struct rebind
- {
- typedef default_allocator<U> other;
- };
-
- default_allocator() noexcept
- {
- }
-
- template <typename U>
- default_allocator(const default_allocator<U>&) noexcept
- {
- }
-
- T* allocate(std::size_t n)
- {
- return static_cast<T*>(default_allocate(sizeof(T) * n, alignof(T)));
- }
-
- void deallocate(T* p, std::size_t n)
- {
- default_deallocate(p, sizeof(T) * n);
- }
-};
-
-template <>
-class default_allocator<void>
-{
-public:
- typedef void value_type;
-
- template <typename U>
- struct rebind
- {
- typedef default_allocator<U> other;
- };
-
- default_allocator() noexcept
- {
- }
-
- template <typename U>
- default_allocator(const default_allocator<U>&) noexcept
- {
- }
-};
-
-template <typename Allocator>
-struct get_default_allocator
-{
- typedef Allocator type;
-
- static type get(const Allocator& a)
- {
- return a;
- }
-};
-
-template <typename T>
-struct get_default_allocator<std::allocator<T>>
-{
- typedef default_allocator<T> type;
-
- static type get(const std::allocator<T>&)
- {
- return type();
- }
-};
-
-} // namespace detail
-} // namespace asio
-} // namespace boost
-
-#define BOOST_ASIO_DEFINE_HANDLER_PTR(op) \
+#define BOOST_ASIO_DEFINE_TAGGED_HANDLER_PTR(purpose, op) \
struct ptr \
{ \
Handler* h; \
@@ -145,11 +36,11 @@ struct get_default_allocator<std::allocator<T>>
{ \
typedef typename ::boost::asio::associated_allocator< \
Handler>::type associated_allocator_type; \
- typedef typename ::boost::asio::detail::get_default_allocator< \
- associated_allocator_type>::type default_allocator_type; \
+ typedef typename ::boost::asio::detail::get_recycling_allocator< \
+ associated_allocator_type, purpose>::type default_allocator_type; \
BOOST_ASIO_REBIND_ALLOC(default_allocator_type, op) a( \
- ::boost::asio::detail::get_default_allocator< \
- associated_allocator_type>::get( \
+ ::boost::asio::detail::get_recycling_allocator< \
+ associated_allocator_type, purpose>::get( \
::boost::asio::get_associated_allocator(handler))); \
return a.allocate(1); \
} \
@@ -164,11 +55,11 @@ struct get_default_allocator<std::allocator<T>>
{ \
typedef typename ::boost::asio::associated_allocator< \
Handler>::type associated_allocator_type; \
- typedef typename ::boost::asio::detail::get_default_allocator< \
- associated_allocator_type>::type default_allocator_type; \
+ typedef typename ::boost::asio::detail::get_recycling_allocator< \
+ associated_allocator_type, purpose>::type default_allocator_type; \
BOOST_ASIO_REBIND_ALLOC(default_allocator_type, op) a( \
- ::boost::asio::detail::get_default_allocator< \
- associated_allocator_type>::get( \
+ ::boost::asio::detail::get_recycling_allocator< \
+ associated_allocator_type, purpose>::get( \
::boost::asio::get_associated_allocator(*h))); \
a.deallocate(static_cast<op*>(v), 1); \
v = 0; \
@@ -177,6 +68,11 @@ struct get_default_allocator<std::allocator<T>>
} \
/**/
+#define BOOST_ASIO_DEFINE_HANDLER_PTR(op) \
+ BOOST_ASIO_DEFINE_TAGGED_HANDLER_PTR( \
+ ::boost::asio::detail::thread_info_base::default_tag, op ) \
+ /**/
+
#define BOOST_ASIO_DEFINE_TAGGED_HANDLER_ALLOCATOR_PTR(purpose, op) \
struct ptr \
{ \
diff --git a/contrib/restricted/boost/asio/include/boost/asio/detail/impl/descriptor_ops.ipp b/contrib/restricted/boost/asio/include/boost/asio/detail/impl/descriptor_ops.ipp
index 204fe60005b..b60835bc0cd 100644
--- a/contrib/restricted/boost/asio/include/boost/asio/detail/impl/descriptor_ops.ipp
+++ b/contrib/restricted/boost/asio/include/boost/asio/detail/impl/descriptor_ops.ipp
@@ -70,25 +70,24 @@ int close(int d, state_type& state, boost::system::error_code& ec)
::fcntl(d, F_SETFL, flags & ~O_NONBLOCK);
#else // defined(__SYMBIAN32__) || defined(__EMSCRIPTEN__)
ioctl_arg_type arg = 0;
-# if defined(ENOTTY) || defined(ENOTCAPABLE)
- result = ::ioctl(d, FIONBIO, &arg);
- get_last_error(ec, result < 0);
- if (false
-# if defined(ENOTTY)
+ if ((state & possible_dup) == 0)
+ {
+ result = ::ioctl(d, FIONBIO, &arg);
+ get_last_error(ec, result < 0);
+ }
+ if ((state & possible_dup) != 0
+# if defined(ENOTTY)
|| ec.value() == ENOTTY
-# endif // defined(ENOTTY)
-# if defined(ENOTCAPABLE)
+# endif // defined(ENOTTY)
+# if defined(ENOTCAPABLE)
|| ec.value() == ENOTCAPABLE
-# endif // defined(ENOTCAPABLE)
+# endif // defined(ENOTCAPABLE)
)
{
int flags = ::fcntl(d, F_GETFL, 0);
if (flags >= 0)
::fcntl(d, F_SETFL, flags & ~O_NONBLOCK);
}
-# else // defined(ENOTTY) || defined(ENOTCAPABLE)
- ::ioctl(d, FIONBIO, &arg);
-# endif // defined(ENOTTY) || defined(ENOTCAPABLE)
#endif // defined(__SYMBIAN32__) || defined(__EMSCRIPTEN__)
state &= ~non_blocking;
@@ -115,21 +114,24 @@ bool set_user_non_blocking(int d, state_type& state,
if (result >= 0)
{
int flag = (value ? (result | O_NONBLOCK) : (result & ~O_NONBLOCK));
- result = ::fcntl(d, F_SETFL, flag);
+ result = (flag != result) ? ::fcntl(d, F_SETFL, flag) : 0;
get_last_error(ec, result < 0);
}
#else // defined(__SYMBIAN32__) || defined(__EMSCRIPTEN__)
ioctl_arg_type arg = (value ? 1 : 0);
- int result = ::ioctl(d, FIONBIO, &arg);
- get_last_error(ec, result < 0);
-# if defined(ENOTTY) || defined(ENOTCAPABLE)
- if (false
-# if defined(ENOTTY)
+ int result = 0;
+ if ((state & possible_dup) == 0)
+ {
+ result = ::ioctl(d, FIONBIO, &arg);
+ get_last_error(ec, result < 0);
+ }
+ if ((state & possible_dup) != 0
+# if defined(ENOTTY)
|| ec.value() == ENOTTY
-# endif // defined(ENOTTY)
-# if defined(ENOTCAPABLE)
+# endif // defined(ENOTTY)
+# if defined(ENOTCAPABLE)
|| ec.value() == ENOTCAPABLE
-# endif // defined(ENOTCAPABLE)
+# endif // defined(ENOTCAPABLE)
)
{
result = ::fcntl(d, F_GETFL, 0);
@@ -137,11 +139,10 @@ bool set_user_non_blocking(int d, state_type& state,
if (result >= 0)
{
int flag = (value ? (result | O_NONBLOCK) : (result & ~O_NONBLOCK));
- result = ::fcntl(d, F_SETFL, flag);
+ result = (flag != result) ? ::fcntl(d, F_SETFL, flag) : 0;
get_last_error(ec, result < 0);
}
}
-# endif // defined(ENOTTY) || defined(ENOTCAPABLE)
#endif // defined(__SYMBIAN32__) || defined(__EMSCRIPTEN__)
if (result >= 0)
@@ -185,21 +186,24 @@ bool set_internal_non_blocking(int d, state_type& state,
if (result >= 0)
{
int flag = (value ? (result | O_NONBLOCK) : (result & ~O_NONBLOCK));
- result = ::fcntl(d, F_SETFL, flag);
+ result = (flag != result) ? ::fcntl(d, F_SETFL, flag) : 0;
get_last_error(ec, result < 0);
}
#else // defined(__SYMBIAN32__) || defined(__EMSCRIPTEN__)
ioctl_arg_type arg = (value ? 1 : 0);
- int result = ::ioctl(d, FIONBIO, &arg);
- get_last_error(ec, result < 0);
-# if defined(ENOTTY) || defined(ENOTCAPABLE)
- if (false
-# if defined(ENOTTY)
+ int result = 0;
+ if ((state & possible_dup) == 0)
+ {
+ result = ::ioctl(d, FIONBIO, &arg);
+ get_last_error(ec, result < 0);
+ }
+ if ((state & possible_dup) != 0
+# if defined(ENOTTY)
|| ec.value() == ENOTTY
-# endif // defined(ENOTTY)
-# if defined(ENOTCAPABLE)
+# endif // defined(ENOTTY)
+# if defined(ENOTCAPABLE)
|| ec.value() == ENOTCAPABLE
-# endif // defined(ENOTCAPABLE)
+# endif // defined(ENOTCAPABLE)
)
{
result = ::fcntl(d, F_GETFL, 0);
@@ -207,11 +211,10 @@ bool set_internal_non_blocking(int d, state_type& state,
if (result >= 0)
{
int flag = (value ? (result | O_NONBLOCK) : (result & ~O_NONBLOCK));
- result = ::fcntl(d, F_SETFL, flag);
+ result = (flag != result) ? ::fcntl(d, F_SETFL, flag) : 0;
get_last_error(ec, result < 0);
}
}
-# endif // defined(ENOTTY) || defined(ENOTCAPABLE)
#endif // defined(__SYMBIAN32__) || defined(__EMSCRIPTEN__)
if (result >= 0)
diff --git a/contrib/restricted/boost/asio/include/boost/asio/detail/impl/dev_poll_reactor.ipp b/contrib/restricted/boost/asio/include/boost/asio/detail/impl/dev_poll_reactor.ipp
index 30647d6d40c..e50f696d486 100644
--- a/contrib/restricted/boost/asio/include/boost/asio/detail/impl/dev_poll_reactor.ipp
+++ b/contrib/restricted/boost/asio/include/boost/asio/detail/impl/dev_poll_reactor.ipp
@@ -67,7 +67,7 @@ void dev_poll_reactor::shutdown()
timer_queues_.get_all_timers(ops);
scheduler_.abandon_operations(ops);
-}
+}
void dev_poll_reactor::notify_fork(
boost::asio::execution_context::fork_event fork_ev)
diff --git a/contrib/restricted/boost/asio/include/boost/asio/detail/impl/reactive_descriptor_service.ipp b/contrib/restricted/boost/asio/include/boost/asio/detail/impl/reactive_descriptor_service.ipp
index 292c60de7b9..858a135b382 100644
--- a/contrib/restricted/boost/asio/include/boost/asio/detail/impl/reactive_descriptor_service.ipp
+++ b/contrib/restricted/boost/asio/include/boost/asio/detail/impl/reactive_descriptor_service.ipp
@@ -199,18 +199,20 @@ boost::system::error_code reactive_descriptor_service::cancel(
}
void reactive_descriptor_service::do_start_op(implementation_type& impl,
- int op_type, reactor_op* op, bool is_continuation, bool is_non_blocking,
- bool noop, void (*on_immediate)(operation* op, bool, const void*),
+ int op_type, reactor_op* op, bool is_continuation,
+ bool allow_speculative, bool noop, bool needs_non_blocking,
+ void (*on_immediate)(operation* op, bool, const void*),
const void* immediate_arg)
{
if (!noop)
{
- if ((impl.state_ & descriptor_ops::non_blocking) ||
- descriptor_ops::set_internal_non_blocking(
+ if ((impl.state_ & descriptor_ops::non_blocking)
+ || !needs_non_blocking
+ || descriptor_ops::set_internal_non_blocking(
impl.descriptor_, impl.state_, true, op->ec_))
{
reactor_.start_op(op_type, impl.descriptor_, impl.reactor_data_, op,
- is_continuation, is_non_blocking, on_immediate, immediate_arg);
+ is_continuation, allow_speculative, on_immediate, immediate_arg);
return;
}
}
diff --git a/contrib/restricted/boost/asio/include/boost/asio/detail/impl/reactive_socket_service_base.ipp b/contrib/restricted/boost/asio/include/boost/asio/detail/impl/reactive_socket_service_base.ipp
index 6cf1197eae8..22f6ba3a6d5 100644
--- a/contrib/restricted/boost/asio/include/boost/asio/detail/impl/reactive_socket_service_base.ipp
+++ b/contrib/restricted/boost/asio/include/boost/asio/detail/impl/reactive_socket_service_base.ipp
@@ -235,19 +235,21 @@ boost::system::error_code reactive_socket_service_base::do_assign(
}
void reactive_socket_service_base::do_start_op(
- reactive_socket_service_base::base_implementation_type& impl, int op_type,
- reactor_op* op, bool is_continuation, bool is_non_blocking, bool noop,
+ reactive_socket_service_base::base_implementation_type& impl,
+ int op_type, reactor_op* op, bool is_continuation,
+ bool allow_speculative, bool noop, bool needs_non_blocking,
void (*on_immediate)(operation* op, bool, const void*),
const void* immediate_arg)
{
if (!noop)
{
if ((impl.state_ & socket_ops::non_blocking)
+ || !needs_non_blocking
|| socket_ops::set_internal_non_blocking(
impl.socket_, impl.state_, true, op->ec_))
{
reactor_.start_op(op_type, impl.socket_, impl.reactor_data_, op,
- is_continuation, is_non_blocking, on_immediate, immediate_arg);
+ is_continuation, allow_speculative, on_immediate, immediate_arg);
return;
}
}
@@ -264,7 +266,7 @@ void reactive_socket_service_base::do_start_accept_op(
if (!peer_is_open)
{
do_start_op(impl, reactor::read_op, op, is_continuation,
- true, false, on_immediate, immediate_arg);
+ true, false, true, on_immediate, immediate_arg);
}
else
{
diff --git a/contrib/restricted/boost/asio/include/boost/asio/detail/impl/socket_ops.ipp b/contrib/restricted/boost/asio/include/boost/asio/detail/impl/socket_ops.ipp
index 74b4ecc770e..2548c2987dc 100644
--- a/contrib/restricted/boost/asio/include/boost/asio/detail/impl/socket_ops.ipp
+++ b/contrib/restricted/boost/asio/include/boost/asio/detail/impl/socket_ops.ipp
@@ -41,6 +41,10 @@
#endif // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
// || defined(__MACH__) && defined(__APPLE__)
+#if defined(_MSC_VER) && (_MSC_VER >= 1800)
+# include <malloc.h>
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1800)
+
#include <boost/asio/detail/push_options.hpp>
namespace boost {
@@ -340,25 +344,24 @@ int close(socket_type s, state_type& state,
::fcntl(s, F_SETFL, flags & ~O_NONBLOCK);
# else // defined(__SYMBIAN32__) || defined(__EMSCRIPTEN__)
ioctl_arg_type arg = 0;
-# if defined(ENOTTY) || defined(ENOTCAPABLE)
- result = ::ioctl(s, FIONBIO, &arg);
- get_last_error(ec, result < 0);
- if (false
-# if defined(ENOTTY)
+ if ((state & possible_dup) == 0)
+ {
+ result = ::ioctl(s, FIONBIO, &arg);
+ get_last_error(ec, result < 0);
+ }
+ if ((state & possible_dup) != 0
+# if defined(ENOTTY)
|| ec.value() == ENOTTY
-# endif // defined(ENOTTY)
-# if defined(ENOTCAPABLE)
+# endif // defined(ENOTTY)
+# if defined(ENOTCAPABLE)
|| ec.value() == ENOTCAPABLE
-# endif // defined(ENOTCAPABLE)
+# endif // defined(ENOTCAPABLE)
)
{
int flags = ::fcntl(s, F_GETFL, 0);
if (flags >= 0)
::fcntl(s, F_SETFL, flags & ~O_NONBLOCK);
}
-# else // defined(ENOTTY) || defined(ENOTCAPABLE)
- ::ioctl(s, FIONBIO, &arg);
-# endif // defined(ENOTTY) || defined(ENOTCAPABLE)
# endif // defined(__SYMBIAN32__) || defined(__EMSCRIPTEN__)
#endif // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
state &= ~non_blocking;
@@ -394,21 +397,24 @@ bool set_user_non_blocking(socket_type s,
if (result >= 0)
{
int flag = (value ? (result | O_NONBLOCK) : (result & ~O_NONBLOCK));
- result = ::fcntl(s, F_SETFL, flag);
+ result = (flag != result) ? ::fcntl(s, F_SETFL, flag) : 0;
get_last_error(ec, result < 0);
}
#else // defined(__SYMBIAN32__) || defined(__EMSCRIPTEN__)
ioctl_arg_type arg = (value ? 1 : 0);
- int result = ::ioctl(s, FIONBIO, &arg);
- get_last_error(ec, result < 0);
-# if defined(ENOTTY) || defined(ENOTCAPABLE)
- if (false
-# if defined(ENOTTY)
+ int result = 0;
+ if ((state & possible_dup) == 0)
+ {
+ result = ::ioctl(s, FIONBIO, &arg);
+ get_last_error(ec, result < 0);
+ }
+ if ((state & possible_dup) != 0
+# if defined(ENOTTY)
|| ec.value() == ENOTTY
-# endif // defined(ENOTTY)
-# if defined(ENOTCAPABLE)
+# endif // defined(ENOTTY)
+# if defined(ENOTCAPABLE)
|| ec.value() == ENOTCAPABLE
-# endif // defined(ENOTCAPABLE)
+# endif // defined(ENOTCAPABLE)
)
{
result = ::fcntl(s, F_GETFL, 0);
@@ -416,11 +422,10 @@ bool set_user_non_blocking(socket_type s,
if (result >= 0)
{
int flag = (value ? (result | O_NONBLOCK) : (result & ~O_NONBLOCK));
- result = ::fcntl(s, F_SETFL, flag);
+ result = (flag != result) ? ::fcntl(s, F_SETFL, flag) : 0;
get_last_error(ec, result < 0);
}
}
-# endif // defined(ENOTTY) || defined(ENOTCAPABLE)
#endif // defined(__SYMBIAN32__) || defined(__EMSCRIPTEN__)
if (result >= 0)
@@ -468,21 +473,24 @@ bool set_internal_non_blocking(socket_type s,
if (result >= 0)
{
int flag = (value ? (result | O_NONBLOCK) : (result & ~O_NONBLOCK));
- result = ::fcntl(s, F_SETFL, flag);
+ result = (flag != result) ? ::fcntl(s, F_SETFL, flag) : 0;
get_last_error(ec, result < 0);
}
#else // defined(__SYMBIAN32__) || defined(__EMSCRIPTEN__)
ioctl_arg_type arg = (value ? 1 : 0);
- int result = ::ioctl(s, FIONBIO, &arg);
- get_last_error(ec, result < 0);
-# if defined(ENOTTY) || defined(ENOTCAPABLE)
- if (false
-# if defined(ENOTTY)
+ int result = 0;
+ if ((state & possible_dup) == 0)
+ {
+ result = ::ioctl(s, FIONBIO, &arg);
+ get_last_error(ec, result < 0);
+ }
+ if ((state & possible_dup) != 0
+# if defined(ENOTTY)
|| ec.value() == ENOTTY
-# endif // defined(ENOTTY)
-# if defined(ENOTCAPABLE)
+# endif // defined(ENOTTY)
+# if defined(ENOTCAPABLE)
|| ec.value() == ENOTCAPABLE
-# endif // defined(ENOTCAPABLE)
+# endif // defined(ENOTCAPABLE)
)
{
result = ::fcntl(s, F_GETFL, 0);
@@ -490,11 +498,10 @@ bool set_internal_non_blocking(socket_type s,
if (result >= 0)
{
int flag = (value ? (result | O_NONBLOCK) : (result & ~O_NONBLOCK));
- result = ::fcntl(s, F_SETFL, flag);
+ result = (flag != result) ? ::fcntl(s, F_SETFL, flag) : 0;
get_last_error(ec, result < 0);
}
}
-# endif // defined(ENOTTY) || defined(ENOTCAPABLE)
#endif // defined(__SYMBIAN32__) || defined(__EMSCRIPTEN__)
if (result >= 0)
@@ -2580,9 +2587,11 @@ const char* inet_ntop(int af, const void* src, char* dest, size_t length,
|| if_indextoname(static_cast<unsigned>(scope_id), if_name + 1) == 0)
#if defined(BOOST_ASIO_HAS_SNPRINTF)
snprintf(if_name + 1, sizeof(if_name) - 1, "%lu", scope_id);
-#else // defined(BOOST_ASIO_HAS_SNPRINTF)
+#elif defined(BOOST_ASIO_HAS_SECURE_RTL)
+ sprintf_s(if_name + 1, sizeof(if_name) -1, "%lu", scope_id);
+#else // defined(BOOST_ASIO_HAS_SECURE_RTL)
sprintf(if_name + 1, "%lu", scope_id);
-#endif // defined(BOOST_ASIO_HAS_SNPRINTF)
+#endif // defined(BOOST_ASIO_HAS_SECURE_RTL)
strcat(dest, if_name);
}
return result;
diff --git a/contrib/restricted/boost/asio/include/boost/asio/detail/impl/socket_select_interrupter.ipp b/contrib/restricted/boost/asio/include/boost/asio/detail/impl/socket_select_interrupter.ipp
index 58c7daad8f4..cb62e147176 100644
--- a/contrib/restricted/boost/asio/include/boost/asio/detail/impl/socket_select_interrupter.ipp
+++ b/contrib/restricted/boost/asio/include/boost/asio/detail/impl/socket_select_interrupter.ipp
@@ -91,7 +91,7 @@ void socket_select_interrupter::open_descriptors()
socket_holder server(socket_ops::accept(acceptor.get(), 0, 0, ec));
if (server.get() == invalid_socket)
boost::asio::detail::throw_error(ec, "socket_select_interrupter");
-
+
ioctl_arg_type non_blocking = 1;
socket_ops::state_type client_state = 0;
if (socket_ops::ioctl(client.get(), client_state,
diff --git a/contrib/restricted/boost/asio/include/boost/asio/detail/impl/win_iocp_file_service.ipp b/contrib/restricted/boost/asio/include/boost/asio/detail/impl/win_iocp_file_service.ipp
index 7f2289efb12..9d34f1e2513 100644
--- a/contrib/restricted/boost/asio/include/boost/asio/detail/impl/win_iocp_file_service.ipp
+++ b/contrib/restricted/boost/asio/include/boost/asio/detail/impl/win_iocp_file_service.ipp
@@ -95,6 +95,7 @@ boost::system::error_code win_iocp_file_service::open(
if ((open_flags & file_base::sync_all_on_write) != 0)
flags |= FILE_FLAG_WRITE_THROUGH;
+ impl.offset_ = 0;
HANDLE handle = ::CreateFileA(path, access, share, 0, disposition, flags, 0);
if (handle != INVALID_HANDLE_VALUE)
{
@@ -111,10 +112,18 @@ boost::system::error_code win_iocp_file_service::open(
return ec;
}
}
- else if ((open_flags & file_base::append) != 0)
+ }
+ if (disposition == OPEN_ALWAYS || disposition == OPEN_EXISTING)
+ {
+ if ((open_flags & file_base::append) != 0)
{
- if (::SetFilePointer(handle, 0, 0, FILE_END)
- == INVALID_SET_FILE_POINTER)
+ LARGE_INTEGER distance, new_offset;
+ distance.QuadPart = 0;
+ if (::SetFilePointerEx(handle, distance, &new_offset, FILE_END))
+ {
+ impl.offset_ = static_cast<uint64_t>(new_offset.QuadPart);
+ }
+ else
{
DWORD last_error = ::GetLastError();
::CloseHandle(handle);
@@ -128,7 +137,6 @@ boost::system::error_code win_iocp_file_service::open(
handle_service_.assign(impl, handle, ec);
if (ec)
::CloseHandle(handle);
- impl.offset_ = 0;
BOOST_ASIO_ERROR_LOCATION(ec);
return ec;
}
diff --git a/contrib/restricted/boost/asio/include/boost/asio/detail/impl/win_iocp_handle_service.ipp b/contrib/restricted/boost/asio/include/boost/asio/detail/impl/win_iocp_handle_service.ipp
index 6cbcd337133..9354570fe69 100644
--- a/contrib/restricted/boost/asio/include/boost/asio/detail/impl/win_iocp_handle_service.ipp
+++ b/contrib/restricted/boost/asio/include/boost/asio/detail/impl/win_iocp_handle_service.ipp
@@ -164,7 +164,7 @@ void win_iocp_handle_service::destroy(
win_iocp_handle_service::implementation_type& impl)
{
close_for_destruction(impl);
-
+
// Remove implementation from linked list of all implementations.
boost::asio::detail::mutex::scoped_lock lock(mutex_);
if (impl_list_ == &impl)
@@ -366,12 +366,12 @@ size_t win_iocp_handle_service::do_write(
return 0;
}
- // Write the data.
+ // Write the data.
overlapped.Offset = offset & 0xFFFFFFFF;
overlapped.OffsetHigh = (offset >> 32) & 0xFFFFFFFF;
BOOL ok = ::WriteFile(impl.handle_, buffer.data(),
static_cast<DWORD>(buffer.size()), 0, &overlapped);
- if (!ok)
+ if (!ok)
{
DWORD last_error = ::GetLastError();
if (last_error != ERROR_IO_PENDING)
@@ -447,7 +447,7 @@ size_t win_iocp_handle_service::do_read(
BOOST_ASIO_ERROR_LOCATION(ec);
return 0;
}
-
+
// A request to read 0 bytes on a stream handle is a no-op.
if (buffer.size() == 0)
{
@@ -467,7 +467,7 @@ size_t win_iocp_handle_service::do_read(
overlapped.OffsetHigh = (offset >> 32) & 0xFFFFFFFF;
BOOL ok = ::ReadFile(impl.handle_, buffer.data(),
static_cast<DWORD>(buffer.size()), 0, &overlapped);
- if (!ok)
+ if (!ok)
{
DWORD last_error = ::GetLastError();
if (last_error != ERROR_IO_PENDING && last_error != ERROR_MORE_DATA)
diff --git a/contrib/restricted/boost/asio/include/boost/asio/detail/initiation_base.hpp b/contrib/restricted/boost/asio/include/boost/asio/detail/initiation_base.hpp
new file mode 100644
index 00000000000..9c1597b24eb
--- /dev/null
+++ b/contrib/restricted/boost/asio/include/boost/asio/detail/initiation_base.hpp
@@ -0,0 +1,64 @@
+//
+// detail/initiation_base.hpp
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+
+#ifndef BOOST_ASIO_DETAIL_INITIATION_BASE_HPP
+#define BOOST_ASIO_DETAIL_INITIATION_BASE_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include <boost/asio/detail/config.hpp>
+#include <boost/asio/detail/type_traits.hpp>
+
+#include <boost/asio/detail/push_options.hpp>
+
+namespace boost {
+namespace asio {
+namespace detail {
+
+template <typename Initiation, typename = void>
+class initiation_base : public Initiation
+{
+public:
+ template <typename I>
+ explicit initiation_base(I&& initiation)
+ : Initiation(static_cast<I&&>(initiation))
+ {
+ }
+};
+
+template <typename Initiation>
+class initiation_base<Initiation, enable_if_t<!is_class<Initiation>::value>>
+{
+public:
+ template <typename I>
+ explicit initiation_base(I&& initiation)
+ : initiation_(static_cast<I&&>(initiation))
+ {
+ }
+
+ template <typename... Args>
+ void operator()(Args&&... args) const
+ {
+ initiation_(static_cast<Args&&>(args)...);
+ }
+
+private:
+ Initiation initiation_;
+};
+
+} // namespace detail
+} // namespace asio
+} // namespace boost
+
+#include <boost/asio/detail/pop_options.hpp>
+
+#endif // BOOST_ASIO_DETAIL_INITIATION_BASE_HPP
diff --git a/contrib/restricted/boost/asio/include/boost/asio/detail/reactive_descriptor_service.hpp b/contrib/restricted/boost/asio/include/boost/asio/detail/reactive_descriptor_service.hpp
index 8af1a038bff..301c7c478bd 100644
--- a/contrib/restricted/boost/asio/include/boost/asio/detail/reactive_descriptor_service.hpp
+++ b/contrib/restricted/boost/asio/include/boost/asio/detail/reactive_descriptor_service.hpp
@@ -240,7 +240,7 @@ public:
default:
p.p->ec_ = boost::asio::error::invalid_argument;
start_op(impl, reactor::read_op, p.p,
- is_continuation, false, true, &io_ex, 0);
+ is_continuation, false, true, false, &io_ex, 0);
p.v = p.p = 0;
return;
}
@@ -253,7 +253,8 @@ public:
&reactor_, &impl.reactor_data_, impl.descriptor_, op_type);
}
- start_op(impl, op_type, p.p, is_continuation, false, false, &io_ex, 0);
+ start_op(impl, op_type, p.p, is_continuation,
+ false, false, false, &io_ex, 0);
p.v = p.p = 0;
}
@@ -327,7 +328,7 @@ public:
start_op(impl, reactor::write_op, p.p, is_continuation, true,
buffer_sequence_adapter<boost::asio::const_buffer,
- ConstBufferSequence>::all_empty(buffers), &io_ex, 0);
+ ConstBufferSequence>::all_empty(buffers), true, &io_ex, 0);
p.v = p.p = 0;
}
@@ -361,7 +362,7 @@ public:
&impl, impl.descriptor_, "async_write_some(null_buffers)"));
start_op(impl, reactor::write_op, p.p,
- is_continuation, false, false, &io_ex, 0);
+ is_continuation, false, false, false, &io_ex, 0);
p.v = p.p = 0;
}
@@ -436,7 +437,7 @@ public:
start_op(impl, reactor::read_op, p.p, is_continuation, true,
buffer_sequence_adapter<boost::asio::mutable_buffer,
- MutableBufferSequence>::all_empty(buffers), &io_ex, 0);
+ MutableBufferSequence>::all_empty(buffers), true, &io_ex, 0);
p.v = p.p = 0;
}
@@ -470,14 +471,15 @@ public:
&impl, impl.descriptor_, "async_read_some(null_buffers)"));
start_op(impl, reactor::read_op, p.p,
- is_continuation, false, false, &io_ex, 0);
+ is_continuation, false, false, false, &io_ex, 0);
p.v = p.p = 0;
}
private:
// Start the asynchronous operation.
- BOOST_ASIO_DECL void do_start_op(implementation_type& impl, int op_type,
- reactor_op* op, bool is_continuation, bool is_non_blocking, bool noop,
+ BOOST_ASIO_DECL void do_start_op(implementation_type& impl,
+ int op_type, reactor_op* op, bool is_continuation,
+ bool allow_speculative, bool noop, bool needs_non_blocking,
void (*on_immediate)(operation* op, bool, const void*),
const void* immediate_arg);
@@ -485,18 +487,19 @@ private:
// immediate completion.
template <typename Op>
void start_op(implementation_type& impl, int op_type, Op* op,
- bool is_continuation, bool is_non_blocking, bool noop,
- const void* io_ex, ...)
+ bool is_continuation, bool allow_speculative, bool noop,
+ bool needs_non_blocking, const void* io_ex, ...)
{
- return do_start_op(impl, op_type, op, is_continuation,
- is_non_blocking, noop, &Op::do_immediate, io_ex);
+ return do_start_op(impl, op_type, op, is_continuation, allow_speculative,
+ noop, needs_non_blocking, &Op::do_immediate, io_ex);
}
// Start the asynchronous operation for handlers that are not specialised for
// immediate completion.
template <typename Op>
- void start_op(implementation_type& impl, int op_type, Op* op,
- bool is_continuation, bool is_non_blocking, bool noop, const void*,
+ void start_op(implementation_type& impl, int op_type,
+ Op* op, bool is_continuation, bool allow_speculative,
+ bool noop, bool needs_non_blocking, const void*,
enable_if_t<
is_same<
typename associated_immediate_executor<
@@ -507,8 +510,9 @@ private:
>::value
>*)
{
- return do_start_op(impl, op_type, op, is_continuation, is_non_blocking,
- noop, &reactor::call_post_immediate_completion, &reactor_);
+ return do_start_op(impl, op_type, op, is_continuation,
+ allow_speculative, noop, needs_non_blocking,
+ &reactor::call_post_immediate_completion, &reactor_);
}
// Helper class used to implement per-operation cancellation
diff --git a/contrib/restricted/boost/asio/include/boost/asio/detail/reactive_socket_send_op.hpp b/contrib/restricted/boost/asio/include/boost/asio/detail/reactive_socket_send_op.hpp
index 778c811c1d2..09740564aa7 100644
--- a/contrib/restricted/boost/asio/include/boost/asio/detail/reactive_socket_send_op.hpp
+++ b/contrib/restricted/boost/asio/include/boost/asio/detail/reactive_socket_send_op.hpp
@@ -188,7 +188,6 @@ public:
BOOST_ASIO_HANDLER_INVOCATION_END;
}
-
private:
Handler handler_;
handler_work<Handler, IoExecutor> work_;
diff --git a/contrib/restricted/boost/asio/include/boost/asio/detail/reactive_socket_service.hpp b/contrib/restricted/boost/asio/include/boost/asio/detail/reactive_socket_service.hpp
index ff051f979ec..85e92e6b4f2 100644
--- a/contrib/restricted/boost/asio/include/boost/asio/detail/reactive_socket_service.hpp
+++ b/contrib/restricted/boost/asio/include/boost/asio/detail/reactive_socket_service.hpp
@@ -308,7 +308,7 @@ public:
&impl, impl.socket_, "async_send_to"));
start_op(impl, reactor::write_op, p.p,
- is_continuation, true, false, &io_ex, 0);
+ is_continuation, true, false, true, &io_ex, 0);
p.v = p.p = 0;
}
@@ -342,7 +342,7 @@ public:
&impl, impl.socket_, "async_send_to(null_buffers)"));
start_op(impl, reactor::write_op, p.p,
- is_continuation, false, false, &io_ex, 0);
+ is_continuation, false, false, false, &io_ex, 0);
p.v = p.p = 0;
}
@@ -433,7 +433,7 @@ public:
start_op(impl,
(flags & socket_base::message_out_of_band)
? reactor::except_op : reactor::read_op,
- p.p, is_continuation, true, false, &io_ex, 0);
+ p.p, is_continuation, true, false, true, &io_ex, 0);
p.v = p.p = 0;
}
@@ -472,7 +472,7 @@ public:
start_op(impl,
(flags & socket_base::message_out_of_band)
? reactor::except_op : reactor::read_op,
- p.p, is_continuation, false, false, &io_ex, 0);
+ p.p, is_continuation, false, false, false, &io_ex, 0);
p.v = p.p = 0;
}
diff --git a/contrib/restricted/boost/asio/include/boost/asio/detail/reactive_socket_service_base.hpp b/contrib/restricted/boost/asio/include/boost/asio/detail/reactive_socket_service_base.hpp
index e2d92190fdf..0de10a94de4 100644
--- a/contrib/restricted/boost/asio/include/boost/asio/detail/reactive_socket_service_base.hpp
+++ b/contrib/restricted/boost/asio/include/boost/asio/detail/reactive_socket_service_base.hpp
@@ -230,7 +230,7 @@ public:
default:
p.p->ec_ = boost::asio::error::invalid_argument;
start_op(impl, reactor::read_op, p.p,
- is_continuation, false, true, &io_ex, 0);
+ is_continuation, false, true, false, &io_ex, 0);
p.v = p.p = 0;
return;
}
@@ -243,7 +243,8 @@ public:
&reactor_, &impl.reactor_data_, impl.socket_, op_type);
}
- start_op(impl, op_type, p.p, is_continuation, false, false, &io_ex, 0);
+ start_op(impl, op_type, p.p, is_continuation,
+ false, false, false, &io_ex, 0);
p.v = p.p = 0;
}
@@ -315,7 +316,7 @@ public:
start_op(impl, reactor::write_op, p.p, is_continuation, true,
((impl.state_ & socket_ops::stream_oriented)
&& buffer_sequence_adapter<boost::asio::const_buffer,
- ConstBufferSequence>::all_empty(buffers)), &io_ex, 0);
+ ConstBufferSequence>::all_empty(buffers)), true, &io_ex, 0);
p.v = p.p = 0;
}
@@ -348,7 +349,7 @@ public:
&impl, impl.socket_, "async_send(null_buffers)"));
start_op(impl, reactor::write_op, p.p,
- is_continuation, false, false, &io_ex, 0);
+ is_continuation, false, false, false, &io_ex, 0);
p.v = p.p = 0;
}
@@ -425,7 +426,7 @@ public:
(flags & socket_base::message_out_of_band) == 0,
((impl.state_ & socket_ops::stream_oriented)
&& buffer_sequence_adapter<boost::asio::mutable_buffer,
- MutableBufferSequence>::all_empty(buffers)), &io_ex, 0);
+ MutableBufferSequence>::all_empty(buffers)), true, &io_ex, 0);
p.v = p.p = 0;
}
@@ -461,7 +462,7 @@ public:
start_op(impl,
(flags & socket_base::message_out_of_band)
? reactor::except_op : reactor::read_op,
- p.p, is_continuation, false, false, &io_ex, 0);
+ p.p, is_continuation, false, false, false, &io_ex, 0);
p.v = p.p = 0;
}
@@ -533,7 +534,8 @@ public:
(in_flags & socket_base::message_out_of_band)
? reactor::except_op : reactor::read_op,
p.p, is_continuation,
- (in_flags & socket_base::message_out_of_band) == 0, false, &io_ex, 0);
+ (in_flags & socket_base::message_out_of_band) == 0,
+ false, true, &io_ex, 0);
p.v = p.p = 0;
}
@@ -574,7 +576,7 @@ public:
start_op(impl,
(in_flags & socket_base::message_out_of_band)
? reactor::except_op : reactor::read_op,
- p.p, is_continuation, false, false, &io_ex, 0);
+ p.p, is_continuation, false, false, false, &io_ex, 0);
p.v = p.p = 0;
}
@@ -590,8 +592,9 @@ protected:
const native_handle_type& native_socket, boost::system::error_code& ec);
// Start the asynchronous read or write operation.
- BOOST_ASIO_DECL void do_start_op(base_implementation_type& impl, int op_type,
- reactor_op* op, bool is_continuation, bool is_non_blocking, bool noop,
+ BOOST_ASIO_DECL void do_start_op(base_implementation_type& impl,
+ int op_type, reactor_op* op, bool is_continuation,
+ bool allow_speculative, bool noop, bool needs_non_blocking,
void (*on_immediate)(operation* op, bool, const void*),
const void* immediate_arg);
@@ -599,18 +602,19 @@ protected:
// immediate completion.
template <typename Op>
void start_op(base_implementation_type& impl, int op_type, Op* op,
- bool is_continuation, bool is_non_blocking, bool noop,
- const void* io_ex, ...)
+ bool is_continuation, bool allow_speculative, bool noop,
+ bool needs_non_blocking, const void* io_ex, ...)
{
- return do_start_op(impl, op_type, op, is_continuation,
- is_non_blocking, noop, &Op::do_immediate, io_ex);
+ return do_start_op(impl, op_type, op, is_continuation, allow_speculative,
+ noop, needs_non_blocking, &Op::do_immediate, io_ex);
}
// Start the asynchronous operation for handlers that are not specialised for
// immediate completion.
template <typename Op>
- void start_op(base_implementation_type& impl, int op_type, Op* op,
- bool is_continuation, bool is_non_blocking, bool noop, const void*,
+ void start_op(base_implementation_type& impl, int op_type,
+ Op* op, bool is_continuation, bool allow_speculative,
+ bool noop, bool needs_non_blocking, const void*,
enable_if_t<
is_same<
typename associated_immediate_executor<
@@ -621,8 +625,9 @@ protected:
>::value
>*)
{
- return do_start_op(impl, op_type, op, is_continuation, is_non_blocking,
- noop, &reactor::call_post_immediate_completion, &reactor_);
+ return do_start_op(impl, op_type, op, is_continuation,
+ allow_speculative, noop, needs_non_blocking,
+ &reactor::call_post_immediate_completion, &reactor_);
}
// Start the asynchronous accept operation.
diff --git a/contrib/restricted/boost/asio/include/boost/asio/detail/recycling_allocator.hpp b/contrib/restricted/boost/asio/include/boost/asio/detail/recycling_allocator.hpp
index 376df6f9865..6089db4abde 100644
--- a/contrib/restricted/boost/asio/include/boost/asio/detail/recycling_allocator.hpp
+++ b/contrib/restricted/boost/asio/include/boost/asio/detail/recycling_allocator.hpp
@@ -49,16 +49,25 @@ public:
T* allocate(std::size_t n)
{
+#if !defined(BOOST_ASIO_DISABLE_SMALL_BLOCK_RECYCLING)
void* p = thread_info_base::allocate(Purpose(),
thread_context::top_of_thread_call_stack(),
sizeof(T) * n, alignof(T));
+#else // !defined(BOOST_ASIO_DISABLE_SMALL_BLOCK_RECYCLING)
+ void* p = boost::asio::aligned_new(align, s);
+#endif // !defined(BOOST_ASIO_DISABLE_SMALL_BLOCK_RECYCLING)
return static_cast<T*>(p);
}
void deallocate(T* p, std::size_t n)
{
+#if !defined(BOOST_ASIO_DISABLE_SMALL_BLOCK_RECYCLING)
thread_info_base::deallocate(Purpose(),
thread_context::top_of_thread_call_stack(), p, sizeof(T) * n);
+#else // !defined(BOOST_ASIO_DISABLE_SMALL_BLOCK_RECYCLING)
+ (void)n;
+ boost::asio::aligned_delete(p);
+#endif // !defined(BOOST_ASIO_DISABLE_SMALL_BLOCK_RECYCLING)
}
};
diff --git a/contrib/restricted/boost/asio/include/boost/asio/detail/resolve_endpoint_op.hpp b/contrib/restricted/boost/asio/include/boost/asio/detail/resolve_endpoint_op.hpp
index bf2af514d5e..74f19855d85 100644
--- a/contrib/restricted/boost/asio/include/boost/asio/detail/resolve_endpoint_op.hpp
+++ b/contrib/restricted/boost/asio/include/boost/asio/detail/resolve_endpoint_op.hpp
@@ -78,7 +78,7 @@ public:
{
// The operation is being run on the worker io_context. Time to perform
// the resolver operation.
-
+
// Perform the blocking endpoint resolution operation.
char host_name[NI_MAXHOST] = "";
char service_name[NI_MAXSERV] = "";
diff --git a/contrib/restricted/boost/asio/include/boost/asio/detail/resolve_query_op.hpp b/contrib/restricted/boost/asio/include/boost/asio/detail/resolve_query_op.hpp
index d5e229634e8..369131da4e8 100644
--- a/contrib/restricted/boost/asio/include/boost/asio/detail/resolve_query_op.hpp
+++ b/contrib/restricted/boost/asio/include/boost/asio/detail/resolve_query_op.hpp
@@ -86,7 +86,7 @@ public:
{
// The operation is being run on the worker io_context. Time to perform
// the resolver operation.
-
+
// Perform the blocking host resolution operation.
socket_ops::background_getaddrinfo(o->cancel_token_,
o->query_.host_name().c_str(), o->query_.service_name().c_str(),
diff --git a/contrib/restricted/boost/asio/include/boost/asio/detail/thread_info_base.hpp b/contrib/restricted/boost/asio/include/boost/asio/detail/thread_info_base.hpp
index 6f33a815db2..8676ccc50f2 100644
--- a/contrib/restricted/boost/asio/include/boost/asio/detail/thread_info_base.hpp
+++ b/contrib/restricted/boost/asio/include/boost/asio/detail/thread_info_base.hpp
@@ -90,7 +90,17 @@ public:
};
};
- enum { max_mem_index = parallel_group_tag::end_mem_index };
+ struct timed_cancel_tag
+ {
+ enum
+ {
+ cache_size = BOOST_ASIO_RECYCLING_ALLOCATOR_CACHE_SIZE,
+ begin_mem_index = parallel_group_tag::end_mem_index,
+ end_mem_index = begin_mem_index + cache_size
+ };
+ };
+
+ enum { max_mem_index = timed_cancel_tag::end_mem_index };
thread_info_base()
#if !defined(BOOST_ASIO_NO_EXCEPTIONS)
diff --git a/contrib/restricted/boost/asio/include/boost/asio/detail/timed_cancel_op.hpp b/contrib/restricted/boost/asio/include/boost/asio/detail/timed_cancel_op.hpp
new file mode 100644
index 00000000000..3464e48bc42
--- /dev/null
+++ b/contrib/restricted/boost/asio/include/boost/asio/detail/timed_cancel_op.hpp
@@ -0,0 +1,363 @@
+//
+// detail/timed_cancel_op.hpp
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+
+#ifndef BOOST_ASIO_DETAIL_TIMED_CANCEL_OP_HPP
+#define BOOST_ASIO_DETAIL_TIMED_CANCEL_OP_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include <boost/asio/detail/config.hpp>
+#include <boost/asio/associated_cancellation_slot.hpp>
+#include <boost/asio/associator.hpp>
+#include <boost/asio/basic_waitable_timer.hpp>
+#include <boost/asio/cancellation_signal.hpp>
+#include <boost/asio/detail/atomic_count.hpp>
+#include <boost/asio/detail/completion_payload.hpp>
+#include <boost/asio/detail/completion_payload_handler.hpp>
+#include <boost/asio/detail/handler_alloc_helpers.hpp>
+#include <boost/asio/detail/type_traits.hpp>
+
+#include <boost/asio/detail/push_options.hpp>
+
+namespace boost {
+namespace asio {
+namespace detail {
+
+template <typename Op, typename... Signatures>
+class timed_cancel_op_handler;
+
+template <typename Op>
+class timed_cancel_timer_handler;
+
+template <typename Handler, typename Timer, typename... Signatures>
+class timed_cancel_op
+{
+public:
+ using handler_type = Handler;
+
+ BOOST_ASIO_DEFINE_TAGGED_HANDLER_PTR(
+ thread_info_base::timed_cancel_tag, timed_cancel_op);
+
+ timed_cancel_op(Handler& handler, Timer timer,
+ cancellation_type_t cancel_type)
+ : ref_count_(2),
+ handler_(static_cast<Handler&&>(handler)),
+ timer_(static_cast<Timer&&>(timer)),
+ cancellation_type_(cancel_type),
+ cancel_proxy_(nullptr),
+ has_payload_(false),
+ has_pending_timer_wait_(true)
+ {
+ }
+
+ ~timed_cancel_op()
+ {
+ if (has_payload_)
+ payload_storage_.payload_.~payload_type();
+ }
+
+ cancellation_slot get_cancellation_slot() noexcept
+ {
+ return cancellation_signal_.slot();
+ }
+
+ template <typename Initiation, typename... Args>
+ void start(Initiation&& initiation, Args&&... args)
+ {
+ using op_handler_type =
+ timed_cancel_op_handler<timed_cancel_op, Signatures...>;
+ op_handler_type op_handler(this);
+
+ using timer_handler_type =
+ timed_cancel_timer_handler<timed_cancel_op>;
+ timer_handler_type timer_handler(this);
+
+ associated_cancellation_slot_t<Handler> slot
+ = (get_associated_cancellation_slot)(handler_);
+ if (slot.is_connected())
+ cancel_proxy_ = &slot.template emplace<cancel_proxy>(this);
+
+ timer_.async_wait(static_cast<timer_handler_type&&>(timer_handler));
+ async_initiate<op_handler_type, Signatures...>(
+ static_cast<Initiation&&>(initiation),
+ static_cast<op_handler_type&>(op_handler),
+ static_cast<Args&&>(args)...);
+ }
+
+ template <typename Message>
+ void handle_op(Message&& message)
+ {
+ if (cancel_proxy_)
+ cancel_proxy_->op_ = nullptr;
+
+ new (&payload_storage_.payload_) payload_type(
+ static_cast<Message&&>(message));
+ has_payload_ = true;
+
+ if (has_pending_timer_wait_)
+ {
+ timer_.cancel();
+ release();
+ }
+ else
+ {
+ complete();
+ }
+ }
+
+ void handle_timer()
+ {
+ has_pending_timer_wait_ = false;
+
+ if (has_payload_)
+ {
+ complete();
+ }
+ else
+ {
+ cancellation_signal_.emit(cancellation_type_);
+ release();
+ }
+ }
+
+ void release()
+ {
+ if (--ref_count_ == 0)
+ {
+ ptr p = { boost::asio::detail::addressof(handler_), this, this };
+ Handler handler(static_cast<Handler&&>(handler_));
+ p.h = boost::asio::detail::addressof(handler);
+ p.reset();
+ }
+ }
+
+ void complete()
+ {
+ if (--ref_count_ == 0)
+ {
+ ptr p = { boost::asio::detail::addressof(handler_), this, this };
+ completion_payload_handler<payload_type, Handler> handler(
+ static_cast<payload_type&&>(payload_storage_.payload_), handler_);
+ p.h = boost::asio::detail::addressof(handler.handler());
+ p.reset();
+ handler();
+ }
+ }
+
+//private:
+ typedef completion_payload<Signatures...> payload_type;
+
+ struct cancel_proxy
+ {
+ cancel_proxy(timed_cancel_op* op)
+ : op_(op)
+ {
+ }
+
+ void operator()(cancellation_type_t type)
+ {
+ if (op_)
+ op_->cancellation_signal_.emit(type);
+ }
+
+ timed_cancel_op* op_;
+ };
+
+ // The number of handlers that share a reference to the state.
+ atomic_count ref_count_;
+
+ // The handler to be called when the operation completes.
+ Handler handler_;
+
+ // The timer used to determine when to cancel the pending operation.
+ Timer timer_;
+
+ // The cancellation signal and type used to cancel the pending operation.
+ cancellation_signal cancellation_signal_;
+ cancellation_type_t cancellation_type_;
+
+ // A proxy cancel handler used to allow cancellation of the timed operation.
+ cancel_proxy* cancel_proxy_;
+
+ // Arguments to be passed to the completion handler.
+ union payload_storage
+ {
+ payload_storage() {}
+ ~payload_storage() {}
+
+ char dummy_;
+ payload_type payload_;
+ } payload_storage_;
+
+ // Whether the payload storage contains a valid payload.
+ bool has_payload_;
+
+ // Whether the asynchronous wait on the timer is still pending
+ bool has_pending_timer_wait_;
+};
+
+template <typename Op, typename R, typename... Args>
+class timed_cancel_op_handler<Op, R(Args...)>
+{
+public:
+ using cancellation_slot_type = cancellation_slot;
+
+ explicit timed_cancel_op_handler(Op* op)
+ : op_(op)
+ {
+ }
+
+ timed_cancel_op_handler(timed_cancel_op_handler&& other) noexcept
+ : op_(other.op_)
+ {
+ other.op_ = nullptr;
+ }
+
+ ~timed_cancel_op_handler()
+ {
+ if (op_)
+ op_->release();
+ }
+
+ cancellation_slot_type get_cancellation_slot() const noexcept
+ {
+ return op_->get_cancellation_slot();
+ }
+
+ template <typename... Args2>
+ enable_if_t<
+ is_constructible<completion_message<R(Args...)>, int, Args2...>::value
+ > operator()(Args2&&... args)
+ {
+ Op* op = op_;
+ op_ = nullptr;
+ typedef completion_message<R(Args...)> message_type;
+ op->handle_op(message_type(0, static_cast<Args2&&>(args)...));
+ }
+
+//protected:
+ Op* op_;
+};
+
+template <typename Op, typename R, typename... Args, typename... Signatures>
+class timed_cancel_op_handler<Op, R(Args...), Signatures...> :
+ public timed_cancel_op_handler<Op, Signatures...>
+{
+public:
+ using timed_cancel_op_handler<Op, Signatures...>::timed_cancel_op_handler;
+ using timed_cancel_op_handler<Op, Signatures...>::operator();
+
+ template <typename... Args2>
+ enable_if_t<
+ is_constructible<completion_message<R(Args...)>, int, Args2...>::value
+ > operator()(Args2&&... args)
+ {
+ Op* op = this->op_;
+ this->op_ = nullptr;
+ typedef completion_message<R(Args...)> message_type;
+ op->handle_op(message_type(0, static_cast<Args2&&>(args)...));
+ }
+};
+
+template <typename Op>
+class timed_cancel_timer_handler
+{
+public:
+ using cancellation_slot_type = cancellation_slot;
+
+ explicit timed_cancel_timer_handler(Op* op)
+ : op_(op)
+ {
+ }
+
+ timed_cancel_timer_handler(timed_cancel_timer_handler&& other) noexcept
+ : op_(other.op_)
+ {
+ other.op_ = nullptr;
+ }
+
+ ~timed_cancel_timer_handler()
+ {
+ if (op_)
+ op_->release();
+ }
+
+ cancellation_slot_type get_cancellation_slot() const noexcept
+ {
+ return cancellation_slot_type();
+ }
+
+ void operator()(const boost::system::error_code&)
+ {
+ Op* op = op_;
+ op_ = nullptr;
+ op->handle_timer();
+ }
+
+//private:
+ Op* op_;
+};
+
+} // namespace detail
+
+template <template <typename, typename> class Associator,
+ typename Op, typename... Signatures, typename DefaultCandidate>
+struct associator<Associator,
+ detail::timed_cancel_op_handler<Op, Signatures...>, DefaultCandidate>
+ : Associator<typename Op::handler_type, DefaultCandidate>
+{
+ static typename Associator<typename Op::handler_type, DefaultCandidate>::type
+ get(const detail::timed_cancel_op_handler<Op, Signatures...>& h) noexcept
+ {
+ return Associator<typename Op::handler_type, DefaultCandidate>::get(
+ h.op_->handler_);
+ }
+
+ static auto get(const detail::timed_cancel_op_handler<Op, Signatures...>& h,
+ const DefaultCandidate& c) noexcept
+ -> decltype(Associator<typename Op::handler_type, DefaultCandidate>::get(
+ h.op_->handler_, c))
+ {
+ return Associator<typename Op::handler_type, DefaultCandidate>::get(
+ h.op_->handler_, c);
+ }
+};
+
+template <template <typename, typename> class Associator,
+ typename Op, typename DefaultCandidate>
+struct associator<Associator,
+ detail::timed_cancel_timer_handler<Op>, DefaultCandidate>
+ : Associator<typename Op::handler_type, DefaultCandidate>
+{
+ static typename Associator<typename Op::handler_type, DefaultCandidate>::type
+ get(const detail::timed_cancel_timer_handler<Op>& h) noexcept
+ {
+ return Associator<typename Op::handler_type, DefaultCandidate>::get(
+ h.op_->handler_);
+ }
+
+ static auto get(const detail::timed_cancel_timer_handler<Op>& h,
+ const DefaultCandidate& c) noexcept
+ -> decltype(Associator<typename Op::handler_type, DefaultCandidate>::get(
+ h.op_->handler_, c))
+ {
+ return Associator<typename Op::handler_type, DefaultCandidate>::get(
+ h.op_->handler_, c);
+ }
+};
+
+} // namespace asio
+} // namespace boost
+
+#include <boost/asio/detail/pop_options.hpp>
+
+#endif // BOOST_ASIO_DETAIL_TIMED_CANCEL_OP_HPP
diff --git a/contrib/restricted/boost/asio/include/boost/asio/detail/win_iocp_socket_service_base.hpp b/contrib/restricted/boost/asio/include/boost/asio/detail/win_iocp_socket_service_base.hpp
index 08bbed93eaf..a518375dd03 100644
--- a/contrib/restricted/boost/asio/include/boost/asio/detail/win_iocp_socket_service_base.hpp
+++ b/contrib/restricted/boost/asio/include/boost/asio/detail/win_iocp_socket_service_base.hpp
@@ -809,7 +809,7 @@ protected:
// Pointer to NtSetInformationFile implementation.
void* nt_set_info_;
- // Mutex to protect access to the linked list of implementations.
+ // Mutex to protect access to the linked list of implementations.
boost::asio::detail::mutex mutex_;
// The head of a linked list of all implementations.
diff --git a/contrib/restricted/boost/asio/include/boost/asio/detail/winrt_ssocket_service_base.hpp b/contrib/restricted/boost/asio/include/boost/asio/detail/winrt_ssocket_service_base.hpp
index a2733660af5..a94451075ae 100644
--- a/contrib/restricted/boost/asio/include/boost/asio/detail/winrt_ssocket_service_base.hpp
+++ b/contrib/restricted/boost/asio/include/boost/asio/detail/winrt_ssocket_service_base.hpp
@@ -342,7 +342,7 @@ protected:
// The manager that keeps track of outstanding operations.
winrt_async_manager& async_manager_;
- // Mutex to protect access to the linked list of implementations.
+ // Mutex to protect access to the linked list of implementations.
boost::asio::detail::mutex mutex_;
// The head of a linked list of all implementations.
diff --git a/contrib/restricted/boost/asio/include/boost/asio/detail/wrapped_handler.hpp b/contrib/restricted/boost/asio/include/boost/asio/detail/wrapped_handler.hpp
index 02691c0ec31..4643b71e2d9 100644
--- a/contrib/restricted/boost/asio/include/boost/asio/detail/wrapped_handler.hpp
+++ b/contrib/restricted/boost/asio/include/boost/asio/detail/wrapped_handler.hpp
@@ -42,12 +42,36 @@ struct is_continuation_if_running
}
};
+template <typename Dispatcher, typename = void>
+struct wrapped_executor
+{
+ typedef Dispatcher executor_type;
+
+ static const Dispatcher& get(const Dispatcher& dispatcher) noexcept
+ {
+ return dispatcher;
+ }
+};
+
+template <typename Dispatcher>
+struct wrapped_executor<Dispatcher,
+ void_type<typename Dispatcher::executor_type>>
+{
+ typedef typename Dispatcher::executor_type executor_type;
+
+ static executor_type get(const Dispatcher& dispatcher) noexcept
+ {
+ return dispatcher.get_executor();
+ }
+};
+
template <typename Dispatcher, typename Handler,
typename IsContinuation = is_continuation_delegated>
class wrapped_handler
{
public:
typedef void result_type;
+ typedef typename wrapped_executor<Dispatcher>::executor_type executor_type;
wrapped_handler(Dispatcher dispatcher, Handler& handler)
: dispatcher_(dispatcher),
@@ -67,6 +91,11 @@ public:
{
}
+ executor_type get_executor() const noexcept
+ {
+ return wrapped_executor<Dispatcher>::get(dispatcher_);
+ }
+
void operator()()
{
dispatcher_.dispatch(static_cast<Handler&&>(handler_));
@@ -152,49 +181,6 @@ public:
Handler handler_;
};
-template <typename Handler, typename Context>
-class rewrapped_handler
-{
-public:
- explicit rewrapped_handler(Handler& handler, const Context& context)
- : context_(context),
- handler_(static_cast<Handler&&>(handler))
- {
- }
-
- explicit rewrapped_handler(const Handler& handler, const Context& context)
- : context_(context),
- handler_(handler)
- {
- }
-
- rewrapped_handler(const rewrapped_handler& other)
- : context_(other.context_),
- handler_(other.handler_)
- {
- }
-
- rewrapped_handler(rewrapped_handler&& other)
- : context_(static_cast<Context&&>(other.context_)),
- handler_(static_cast<Handler&&>(other.handler_))
- {
- }
-
- void operator()()
- {
- handler_();
- }
-
- void operator()() const
- {
- handler_();
- }
-
-//private:
- Context context_;
- Handler handler_;
-};
-
template <typename Dispatcher, typename Handler, typename IsContinuation>
inline bool asio_handler_is_continuation(
wrapped_handler<Dispatcher, Handler, IsContinuation>* this_handler)
@@ -202,14 +188,6 @@ inline bool asio_handler_is_continuation(
return IsContinuation()(this_handler->dispatcher_, this_handler->handler_);
}
-template <typename Dispatcher, typename Context>
-inline bool asio_handler_is_continuation(
- rewrapped_handler<Dispatcher, Context>* this_handler)
-{
- return boost_asio_handler_cont_helpers::is_continuation(
- this_handler->context_);
-}
-
} // namespace detail
} // namespace asio
} // namespace boost
diff --git a/contrib/restricted/boost/asio/include/boost/asio/execution/allocator.hpp b/contrib/restricted/boost/asio/include/boost/asio/execution/allocator.hpp
index d48f055b87e..9fc9c35bb1f 100644
--- a/contrib/restricted/boost/asio/include/boost/asio/execution/allocator.hpp
+++ b/contrib/restricted/boost/asio/include/boost/asio/execution/allocator.hpp
@@ -226,7 +226,7 @@ const T allocator_t<void>::static_query_v;
#endif // defined(BOOST_ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT)
// && defined(BOOST_ASIO_HAS_SFINAE_VARIABLE_TEMPLATES)
-constexpr allocator_t<void> allocator;
+BOOST_ASIO_INLINE_VARIABLE constexpr allocator_t<void> allocator;
} // namespace execution
diff --git a/contrib/restricted/boost/asio/include/boost/asio/execution/blocking.hpp b/contrib/restricted/boost/asio/include/boost/asio/execution/blocking.hpp
index 44d32b24a0e..7501aecbc3e 100644
--- a/contrib/restricted/boost/asio/include/boost/asio/execution/blocking.hpp
+++ b/contrib/restricted/boost/asio/include/boost/asio/execution/blocking.hpp
@@ -893,7 +893,7 @@ const T never_t<I>::static_query_v;
typedef detail::blocking_t<> blocking_t;
-constexpr blocking_t blocking;
+BOOST_ASIO_INLINE_VARIABLE constexpr blocking_t blocking;
} // namespace execution
diff --git a/contrib/restricted/boost/asio/include/boost/asio/execution/blocking_adaptation.hpp b/contrib/restricted/boost/asio/include/boost/asio/execution/blocking_adaptation.hpp
index 8973a2eb5dc..3c641219f43 100644
--- a/contrib/restricted/boost/asio/include/boost/asio/execution/blocking_adaptation.hpp
+++ b/contrib/restricted/boost/asio/include/boost/asio/execution/blocking_adaptation.hpp
@@ -719,7 +719,7 @@ void blocking_execute(
typedef detail::blocking_adaptation_t<> blocking_adaptation_t;
-constexpr blocking_adaptation_t blocking_adaptation;
+BOOST_ASIO_INLINE_VARIABLE constexpr blocking_adaptation_t blocking_adaptation;
} // namespace execution
diff --git a/contrib/restricted/boost/asio/include/boost/asio/execution/context.hpp b/contrib/restricted/boost/asio/include/boost/asio/execution/context.hpp
index 5d8a81b70b5..6c9fd9a13d2 100644
--- a/contrib/restricted/boost/asio/include/boost/asio/execution/context.hpp
+++ b/contrib/restricted/boost/asio/include/boost/asio/execution/context.hpp
@@ -139,7 +139,7 @@ const T context_t<I>::static_query_v;
typedef detail::context_t<> context_t;
-constexpr context_t context;
+BOOST_ASIO_INLINE_VARIABLE constexpr context_t context;
} // namespace execution
diff --git a/contrib/restricted/boost/asio/include/boost/asio/execution/mapping.hpp b/contrib/restricted/boost/asio/include/boost/asio/execution/mapping.hpp
index 5c668dbb971..769ad8c2830 100644
--- a/contrib/restricted/boost/asio/include/boost/asio/execution/mapping.hpp
+++ b/contrib/restricted/boost/asio/include/boost/asio/execution/mapping.hpp
@@ -734,7 +734,7 @@ const T other_t<I>::static_query_v;
typedef detail::mapping_t<> mapping_t;
-constexpr mapping_t mapping;
+BOOST_ASIO_INLINE_VARIABLE constexpr mapping_t mapping;
} // namespace execution
diff --git a/contrib/restricted/boost/asio/include/boost/asio/execution/occupancy.hpp b/contrib/restricted/boost/asio/include/boost/asio/execution/occupancy.hpp
index dddcd84939e..20bc40a3956 100644
--- a/contrib/restricted/boost/asio/include/boost/asio/execution/occupancy.hpp
+++ b/contrib/restricted/boost/asio/include/boost/asio/execution/occupancy.hpp
@@ -132,7 +132,7 @@ const T occupancy_t<I>::static_query_v;
typedef detail::occupancy_t<> occupancy_t;
-constexpr occupancy_t occupancy;
+BOOST_ASIO_INLINE_VARIABLE constexpr occupancy_t occupancy;
} // namespace execution
diff --git a/contrib/restricted/boost/asio/include/boost/asio/execution/outstanding_work.hpp b/contrib/restricted/boost/asio/include/boost/asio/execution/outstanding_work.hpp
index b8d96777767..f5ea64cebf6 100644
--- a/contrib/restricted/boost/asio/include/boost/asio/execution/outstanding_work.hpp
+++ b/contrib/restricted/boost/asio/include/boost/asio/execution/outstanding_work.hpp
@@ -545,7 +545,7 @@ const T tracked_t<I>::static_query_v;
typedef detail::outstanding_work_t<> outstanding_work_t;
-constexpr outstanding_work_t outstanding_work;
+BOOST_ASIO_INLINE_VARIABLE constexpr outstanding_work_t outstanding_work;
} // namespace execution
diff --git a/contrib/restricted/boost/asio/include/boost/asio/execution/relationship.hpp b/contrib/restricted/boost/asio/include/boost/asio/execution/relationship.hpp
index 4ccda00bc24..9cc0fe4f1da 100644
--- a/contrib/restricted/boost/asio/include/boost/asio/execution/relationship.hpp
+++ b/contrib/restricted/boost/asio/include/boost/asio/execution/relationship.hpp
@@ -543,7 +543,7 @@ const T continuation_t<I>::static_query_v;
typedef detail::relationship_t<> relationship_t;
-constexpr relationship_t relationship;
+BOOST_ASIO_INLINE_VARIABLE constexpr relationship_t relationship;
} // namespace execution
diff --git a/contrib/restricted/boost/asio/include/boost/asio/experimental/basic_channel.hpp b/contrib/restricted/boost/asio/include/boost/asio/experimental/basic_channel.hpp
index c1fc5e0ad2c..682884023f2 100644
--- a/contrib/restricted/boost/asio/include/boost/asio/experimental/basic_channel.hpp
+++ b/contrib/restricted/boost/asio/include/boost/asio/experimental/basic_channel.hpp
@@ -111,7 +111,8 @@ private:
template <typename... PayloadSignatures,
BOOST_ASIO_COMPLETION_TOKEN_FOR(PayloadSignatures...) CompletionToken>
- auto do_async_receive(detail::channel_payload<PayloadSignatures...>*,
+ auto do_async_receive(
+ boost::asio::detail::completion_payload<PayloadSignatures...>*,
CompletionToken&& token)
-> decltype(
async_initiate<CompletionToken, PayloadSignatures...>(
diff --git a/contrib/restricted/boost/asio/include/boost/asio/experimental/basic_concurrent_channel.hpp b/contrib/restricted/boost/asio/include/boost/asio/experimental/basic_concurrent_channel.hpp
index 33ccef1357b..dabab3ecc9b 100644
--- a/contrib/restricted/boost/asio/include/boost/asio/experimental/basic_concurrent_channel.hpp
+++ b/contrib/restricted/boost/asio/include/boost/asio/experimental/basic_concurrent_channel.hpp
@@ -111,7 +111,8 @@ private:
template <typename... PayloadSignatures,
BOOST_ASIO_COMPLETION_TOKEN_FOR(PayloadSignatures...) CompletionToken>
- auto do_async_receive(detail::channel_payload<PayloadSignatures...>*,
+ auto do_async_receive(
+ boost::asio::detail::completion_payload<PayloadSignatures...>*,
CompletionToken&& token)
-> decltype(
async_initiate<CompletionToken, PayloadSignatures...>(
diff --git a/contrib/restricted/boost/asio/include/boost/asio/experimental/co_composed.hpp b/contrib/restricted/boost/asio/include/boost/asio/experimental/co_composed.hpp
index faa0221ee06..f227631ee63 100644
--- a/contrib/restricted/boost/asio/include/boost/asio/experimental/co_composed.hpp
+++ b/contrib/restricted/boost/asio/include/boost/asio/experimental/co_composed.hpp
@@ -16,7 +16,7 @@
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
#include <boost/asio/detail/config.hpp>
-#include <boost/asio/async_result.hpp>
+#include <boost/asio/co_composed.hpp>
#include <boost/asio/detail/push_options.hpp>
@@ -24,117 +24,7 @@ namespace boost {
namespace asio {
namespace experimental {
-/// Creates an initiation function object that may be used to launch a
-/// coroutine-based composed asynchronous operation.
-/**
- * The experimental::co_composed utility simplifies the implementation of
- * composed asynchronous operations by automatically adapting a coroutine to be
- * an initiation function object for use with @c async_initiate. When awaiting
- * asynchronous operations, the coroutine automatically uses a conforming
- * intermediate completion handler.
- *
- * @param implementation A function object that contains the coroutine-based
- * implementation of the composed asynchronous operation. The first argument to
- * the function object represents the state of the operation, and may be used
- * to test for cancellation. The remaining arguments are those passed to @c
- * async_initiate after the completion token.
- *
- * @param io_objects_or_executors Zero or more I/O objects or I/O executors for
- * which outstanding work must be maintained while the operation is incomplete.
- *
- * @par Per-Operation Cancellation
- * By default, terminal per-operation cancellation is enabled for composed
- * operations that use experimental::co_composed. To disable cancellation for
- * the composed operation, or to alter its supported cancellation types, call
- * the state's @c reset_cancellation_state function.
- *
- * @par Examples
- * The following example illustrates manual error handling and explicit checks
- * for cancellation. The completion handler is invoked via a @c co_yield to the
- * state's @c complete function, which never returns.
- *
- * @code template <typename CompletionToken>
- * auto async_echo(tcp::socket& socket,
- * CompletionToken&& token)
- * {
- * return boost::asio::async_initiate<
- * CompletionToken, void(boost::system::error_code)>(
- * boost::asio::experimental::co_composed(
- * [](auto state, tcp::socket& socket) -> void
- * {
- * state.reset_cancellation_state(
- * boost::asio::enable_terminal_cancellation());
- *
- * while (!state.cancelled())
- * {
- * char data[1024];
- * auto [e1, n1] =
- * co_await socket.async_read_some(
- * boost::asio::buffer(data),
- * boost::asio::as_tuple(boost::asio::deferred));
- *
- * if (e1)
- * co_yield state.complete(e1);
- *
- * if (!!state.cancelled())
- * co_yield state.complete(
- * make_error_code(boost::asio::error::operation_aborted));
- *
- * auto [e2, n2] =
- * co_await boost::asio::async_write(socket,
- * boost::asio::buffer(data, n1),
- * boost::asio::as_tuple(boost::asio::deferred));
- *
- * if (e2)
- * co_yield state.complete(e2);
- * }
- * }, socket),
- * token, std::ref(socket));
- * } @endcode
- *
- * This next example shows exception-based error handling and implicit checks
- * for cancellation. The completion handler is invoked after returning from the
- * coroutine via @c co_return. Valid @c co_return values are specified using
- * completion signatures passed to the @c co_composed function.
- *
- * @code template <typename CompletionToken>
- * auto async_echo(tcp::socket& socket,
- * CompletionToken&& token)
- * {
- * return boost::asio::async_initiate<
- * CompletionToken, void(boost::system::error_code)>(
- * boost::asio::experimental::co_composed<
- * void(boost::system::error_code)>(
- * [](auto state, tcp::socket& socket) -> void
- * {
- * try
- * {
- * state.throw_if_cancelled(true);
- * state.reset_cancellation_state(
- * boost::asio::enable_terminal_cancellation());
- *
- * for (;;)
- * {
- * char data[1024];
- * std::size_t n = co_await socket.async_read_some(
- * boost::asio::buffer(data), boost::asio::deferred);
- *
- * co_await boost::asio::async_write(socket,
- * boost::asio::buffer(data, n), boost::asio::deferred);
- * }
- * }
- * catch (const boost::system::system_error& e)
- * {
- * co_return {e.code()};
- * }
- * }, socket),
- * token, std::ref(socket));
- * } @endcode
- */
-template <completion_signature... Signatures,
- typename Implementation, typename... IoObjectsOrExecutors>
-auto co_composed(Implementation&& implementation,
- IoObjectsOrExecutors&&... io_objects_or_executors);
+using boost::asio::co_composed;
} // namespace experimental
} // namespace asio
@@ -142,6 +32,4 @@ auto co_composed(Implementation&& implementation,
#include <boost/asio/detail/pop_options.hpp>
-#include <boost/asio/experimental/impl/co_composed.hpp>
-
#endif // BOOST_ASIO_EXPERIMENTAL_CO_COMPOSED_HPP
diff --git a/contrib/restricted/boost/asio/include/boost/asio/experimental/detail/channel_receive_op.hpp b/contrib/restricted/boost/asio/include/boost/asio/experimental/detail/channel_receive_op.hpp
index 76a09a4d36b..5ed64e445b7 100644
--- a/contrib/restricted/boost/asio/include/boost/asio/experimental/detail/channel_receive_op.hpp
+++ b/contrib/restricted/boost/asio/include/boost/asio/experimental/detail/channel_receive_op.hpp
@@ -17,11 +17,10 @@
#include <boost/asio/detail/config.hpp>
#include <boost/asio/detail/bind_handler.hpp>
+#include <boost/asio/detail/completion_handler.hpp>
#include <boost/asio/detail/handler_alloc_helpers.hpp>
#include <boost/asio/error.hpp>
-#include <boost/asio/experimental/detail/channel_handler.hpp>
#include <boost/asio/experimental/detail/channel_operation.hpp>
-#include <boost/asio/experimental/detail/channel_payload.hpp>
#include <boost/asio/detail/push_options.hpp>
@@ -93,7 +92,7 @@ public:
if (a != channel_operation::destroy_op)
{
Payload* payload = static_cast<Payload*>(v);
- channel_handler<Payload, Handler> handler(
+ boost::asio::detail::completion_payload_handler<Payload, Handler> handler(
static_cast<Payload&&>(*payload), o->handler_);
p.h = boost::asio::detail::addressof(handler.handler_);
p.reset();
diff --git a/contrib/restricted/boost/asio/include/boost/asio/experimental/detail/channel_send_functions.hpp b/contrib/restricted/boost/asio/include/boost/asio/experimental/detail/channel_send_functions.hpp
index 4587ae3f6ef..b748f8ba5aa 100644
--- a/contrib/restricted/boost/asio/include/boost/asio/experimental/detail/channel_send_functions.hpp
+++ b/contrib/restricted/boost/asio/include/boost/asio/experimental/detail/channel_send_functions.hpp
@@ -17,9 +17,9 @@
#include <boost/asio/detail/config.hpp>
#include <boost/asio/async_result.hpp>
+#include <boost/asio/detail/completion_message.hpp>
#include <boost/asio/detail/type_traits.hpp>
#include <boost/system/error_code.hpp>
-#include <boost/asio/experimental/detail/channel_message.hpp>
#include <boost/asio/detail/push_options.hpp>
@@ -37,11 +37,12 @@ class channel_send_functions<Derived, Executor, R(Args...)>
public:
template <typename... Args2>
enable_if_t<
- is_constructible<detail::channel_message<R(Args...)>, int, Args2...>::value,
+ is_constructible<boost::asio::detail::completion_message<R(Args...)>,
+ int, Args2...>::value,
bool
> try_send(Args2&&... args)
{
- typedef typename detail::channel_message<R(Args...)> message_type;
+ typedef boost::asio::detail::completion_message<R(Args...)> message_type;
Derived* self = static_cast<Derived*>(this);
return self->service_->template try_send<message_type>(
self->impl_, false, static_cast<Args2&&>(args)...);
@@ -49,11 +50,12 @@ public:
template <typename... Args2>
enable_if_t<
- is_constructible<detail::channel_message<R(Args...)>, int, Args2...>::value,
+ is_constructible<boost::asio::detail::completion_message<R(Args...)>,
+ int, Args2...>::value,
bool
> try_send_via_dispatch(Args2&&... args)
{
- typedef typename detail::channel_message<R(Args...)> message_type;
+ typedef boost::asio::detail::completion_message<R(Args...)> message_type;
Derived* self = static_cast<Derived*>(this);
return self->service_->template try_send<message_type>(
self->impl_, true, static_cast<Args2&&>(args)...);
@@ -61,11 +63,12 @@ public:
template <typename... Args2>
enable_if_t<
- is_constructible<detail::channel_message<R(Args...)>, int, Args2...>::value,
+ is_constructible<boost::asio::detail::completion_message<R(Args...)>,
+ int, Args2...>::value,
std::size_t
> try_send_n(std::size_t count, Args2&&... args)
{
- typedef typename detail::channel_message<R(Args...)> message_type;
+ typedef boost::asio::detail::completion_message<R(Args...)> message_type;
Derived* self = static_cast<Derived*>(this);
return self->service_->template try_send_n<message_type>(
self->impl_, count, false, static_cast<Args2&&>(args)...);
@@ -73,11 +76,12 @@ public:
template <typename... Args2>
enable_if_t<
- is_constructible<detail::channel_message<R(Args...)>, int, Args2...>::value,
+ is_constructible<boost::asio::detail::completion_message<R(Args...)>,
+ int, Args2...>::value,
std::size_t
> try_send_n_via_dispatch(std::size_t count, Args2&&... args)
{
- typedef typename detail::channel_message<R(Args...)> message_type;
+ typedef boost::asio::detail::completion_message<R(Args...)> message_type;
Derived* self = static_cast<Derived*>(this);
return self->service_->template try_send_n<message_type>(
self->impl_, count, true, static_cast<Args2&&>(args)...);
@@ -97,7 +101,7 @@ public:
Derived>::payload_type>()))
{
typedef typename Derived::payload_type payload_type;
- typedef typename detail::channel_message<R(Args...)> message_type;
+ typedef boost::asio::detail::completion_message<R(Args...)> message_type;
Derived* self = static_cast<Derived*>(this);
return async_initiate<CompletionToken, void (boost::system::error_code)>(
typename Derived::initiate_async_send(self), token,
@@ -116,11 +120,12 @@ public:
template <typename... Args2>
enable_if_t<
- is_constructible<detail::channel_message<R(Args...)>, int, Args2...>::value,
+ is_constructible<boost::asio::detail::completion_message<R(Args...)>,
+ int, Args2...>::value,
bool
> try_send(Args2&&... args)
{
- typedef typename detail::channel_message<R(Args...)> message_type;
+ typedef boost::asio::detail::completion_message<R(Args...)> message_type;
Derived* self = static_cast<Derived*>(this);
return self->service_->template try_send<message_type>(
self->impl_, false, static_cast<Args2&&>(args)...);
@@ -128,11 +133,12 @@ public:
template <typename... Args2>
enable_if_t<
- is_constructible<detail::channel_message<R(Args...)>, int, Args2...>::value,
+ is_constructible<boost::asio::detail::completion_message<R(Args...)>,
+ int, Args2...>::value,
bool
> try_send_via_dispatch(Args2&&... args)
{
- typedef typename detail::channel_message<R(Args...)> message_type;
+ typedef boost::asio::detail::completion_message<R(Args...)> message_type;
Derived* self = static_cast<Derived*>(this);
return self->service_->template try_send<message_type>(
self->impl_, true, static_cast<Args2&&>(args)...);
@@ -140,11 +146,12 @@ public:
template <typename... Args2>
enable_if_t<
- is_constructible<detail::channel_message<R(Args...)>, int, Args2...>::value,
+ is_constructible<boost::asio::detail::completion_message<R(Args...)>,
+ int, Args2...>::value,
std::size_t
> try_send_n(std::size_t count, Args2&&... args)
{
- typedef typename detail::channel_message<R(Args...)> message_type;
+ typedef boost::asio::detail::completion_message<R(Args...)> message_type;
Derived* self = static_cast<Derived*>(this);
return self->service_->template try_send_n<message_type>(
self->impl_, count, false, static_cast<Args2&&>(args)...);
@@ -152,11 +159,12 @@ public:
template <typename... Args2>
enable_if_t<
- is_constructible<detail::channel_message<R(Args...)>, int, Args2...>::value,
+ is_constructible<boost::asio::detail::completion_message<R(Args...)>,
+ int, Args2...>::value,
std::size_t
> try_send_n_via_dispatch(std::size_t count, Args2&&... args)
{
- typedef typename detail::channel_message<R(Args...)> message_type;
+ typedef boost::asio::detail::completion_message<R(Args...)> message_type;
Derived* self = static_cast<Derived*>(this);
return self->service_->template try_send_n<message_type>(
self->impl_, count, true, static_cast<Args2&&>(args)...);
@@ -176,7 +184,7 @@ public:
Derived>::payload_type>()))
{
typedef typename Derived::payload_type payload_type;
- typedef typename detail::channel_message<R(Args...)> message_type;
+ typedef boost::asio::detail::completion_message<R(Args...)> message_type;
Derived* self = static_cast<Derived*>(this);
return async_initiate<CompletionToken, void (boost::system::error_code)>(
typename Derived::initiate_async_send(self), token,
diff --git a/contrib/restricted/boost/asio/include/boost/asio/experimental/detail/channel_send_op.hpp b/contrib/restricted/boost/asio/include/boost/asio/experimental/detail/channel_send_op.hpp
index aca8de826d8..49b444c19b0 100644
--- a/contrib/restricted/boost/asio/include/boost/asio/experimental/detail/channel_send_op.hpp
+++ b/contrib/restricted/boost/asio/include/boost/asio/experimental/detail/channel_send_op.hpp
@@ -21,7 +21,6 @@
#include <boost/asio/error.hpp>
#include <boost/asio/experimental/channel_error.hpp>
#include <boost/asio/experimental/detail/channel_operation.hpp>
-#include <boost/asio/experimental/detail/channel_payload.hpp>
#include <boost/asio/detail/push_options.hpp>
diff --git a/contrib/restricted/boost/asio/include/boost/asio/experimental/detail/channel_service.hpp b/contrib/restricted/boost/asio/include/boost/asio/experimental/detail/channel_service.hpp
index 819aad114b0..341797f1b6b 100644
--- a/contrib/restricted/boost/asio/include/boost/asio/experimental/detail/channel_service.hpp
+++ b/contrib/restricted/boost/asio/include/boost/asio/experimental/detail/channel_service.hpp
@@ -18,10 +18,12 @@
#include <boost/asio/detail/config.hpp>
#include <boost/asio/associated_cancellation_slot.hpp>
#include <boost/asio/cancellation_type.hpp>
+#include <boost/asio/detail/completion_message.hpp>
+#include <boost/asio/detail/completion_payload.hpp>
+#include <boost/asio/detail/completion_payload_handler.hpp>
#include <boost/asio/detail/mutex.hpp>
#include <boost/asio/detail/op_queue.hpp>
#include <boost/asio/execution_context.hpp>
-#include <boost/asio/experimental/detail/channel_message.hpp>
#include <boost/asio/experimental/detail/channel_receive_op.hpp>
#include <boost/asio/experimental/detail/channel_send_op.hpp>
#include <boost/asio/experimental/detail/has_signature.hpp>
@@ -232,7 +234,7 @@ private:
void operator()(Args&&... args)
{
op_->post(
- channel_message<Signature>(0,
+ boost::asio::detail::completion_message<Signature>(0,
static_cast<Args&&>(args)...));
}
@@ -308,8 +310,8 @@ struct channel_service<Mutex>::implementation_type : base_implementation_type
typename traits_type::receive_closed_signature,
Signatures...
>::value,
- channel_payload<Signatures...>,
- channel_payload<
+ boost::asio::detail::completion_payload<Signatures...>,
+ boost::asio::detail::completion_payload<
Signatures...,
typename traits_type::receive_closed_signature
>
@@ -320,11 +322,11 @@ struct channel_service<Mutex>::implementation_type : base_implementation_type
Signatures...,
typename traits_type::receive_cancelled_signature
>::value,
- channel_payload<
+ boost::asio::detail::completion_payload<
Signatures...,
typename traits_type::receive_cancelled_signature
>,
- channel_payload<
+ boost::asio::detail::completion_payload<
Signatures...,
typename traits_type::receive_cancelled_signature,
typename traits_type::receive_closed_signature
@@ -405,8 +407,8 @@ struct channel_service<Mutex>::implementation_type<Traits, R()>
typename traits_type::receive_closed_signature,
R()
>::value,
- channel_payload<R()>,
- channel_payload<
+ boost::asio::detail::completion_payload<R()>,
+ boost::asio::detail::completion_payload<
R(),
typename traits_type::receive_closed_signature
>
@@ -417,11 +419,11 @@ struct channel_service<Mutex>::implementation_type<Traits, R()>
R(),
typename traits_type::receive_cancelled_signature
>::value,
- channel_payload<
+ boost::asio::detail::completion_payload<
R(),
typename traits_type::receive_cancelled_signature
>,
- channel_payload<
+ boost::asio::detail::completion_payload<
R(),
typename traits_type::receive_cancelled_signature,
typename traits_type::receive_closed_signature
@@ -466,7 +468,7 @@ struct channel_service<Mutex>::implementation_type<Traits, R()>
// Get the element at the front of the buffer.
payload_type buffer_front()
{
- return payload_type(channel_message<R()>(0));
+ return payload_type(boost::asio::detail::completion_message<R()>(0));
}
// Pop a value from the front of the buffer.
@@ -508,8 +510,8 @@ struct channel_service<Mutex>::implementation_type<
typename traits_type::receive_closed_signature,
R(boost::system::error_code)
>::value,
- channel_payload<R(boost::system::error_code)>,
- channel_payload<
+ boost::asio::detail::completion_payload<R(boost::system::error_code)>,
+ boost::asio::detail::completion_payload<
R(boost::system::error_code),
typename traits_type::receive_closed_signature
>
@@ -520,11 +522,11 @@ struct channel_service<Mutex>::implementation_type<
R(boost::system::error_code),
typename traits_type::receive_cancelled_signature
>::value,
- channel_payload<
+ boost::asio::detail::completion_payload<
R(boost::system::error_code),
typename traits_type::receive_cancelled_signature
>,
- channel_payload<
+ boost::asio::detail::completion_payload<
R(boost::system::error_code),
typename traits_type::receive_cancelled_signature,
typename traits_type::receive_closed_signature
diff --git a/contrib/restricted/boost/asio/include/boost/asio/experimental/detail/coro_promise_allocator.hpp b/contrib/restricted/boost/asio/include/boost/asio/experimental/detail/coro_promise_allocator.hpp
index 322ecbbef2c..c4e534fda1e 100644
--- a/contrib/restricted/boost/asio/include/boost/asio/experimental/detail/coro_promise_allocator.hpp
+++ b/contrib/restricted/boost/asio/include/boost/asio/experimental/detail/coro_promise_allocator.hpp
@@ -65,7 +65,6 @@ constexpr std::size_t variadic_first(std::size_t = 0u)
return std::numeric_limits<std::size_t>::max();
}
-
template <typename T, typename First, typename... Args>
constexpr std::size_t variadic_first(std::size_t pos = 0u)
{
@@ -95,14 +94,14 @@ struct coro_promise_allocator
allocator_type get_allocator() const {return alloc_;}
template <typename... Args>
- void* operator new(const std::size_t size, Args & ... args)
+ void* operator new(std::size_t size, Args & ... args)
{
return allocate_coroutine(size,
get_variadic<variadic_first<std::allocator_arg_t,
std::decay_t<Args>...>() + 1u>(args...));
}
- void operator delete(void* raw, const std::size_t size)
+ void operator delete(void* raw, std::size_t size)
{
deallocate_coroutine<allocator_type>(raw, size);
}
diff --git a/contrib/restricted/boost/asio/include/boost/asio/experimental/detail/impl/channel_service.hpp b/contrib/restricted/boost/asio/include/boost/asio/experimental/detail/impl/channel_service.hpp
index 8b7b2e22734..eb672be5114 100644
--- a/contrib/restricted/boost/asio/include/boost/asio/experimental/detail/impl/channel_service.hpp
+++ b/contrib/restricted/boost/asio/include/boost/asio/experimental/detail/impl/channel_service.hpp
@@ -518,7 +518,8 @@ bool channel_service<Mutex>::try_receive(
}
lock.unlock();
boost::asio::detail::non_const_lvalue<Handler> handler2(handler);
- channel_handler<payload_type, decay_t<Handler>>(
+ boost::asio::detail::completion_payload_handler<
+ payload_type, decay_t<Handler>>(
static_cast<payload_type&&>(payload), handler2.value)();
return true;
}
@@ -533,7 +534,8 @@ bool channel_service<Mutex>::try_receive(
send_op->post();
lock.unlock();
boost::asio::detail::non_const_lvalue<Handler> handler2(handler);
- channel_handler<payload_type, decay_t<Handler>>(
+ boost::asio::detail::completion_payload_handler<
+ payload_type, decay_t<Handler>>(
static_cast<payload_type&&>(payload), handler2.value)();
return true;
}
diff --git a/contrib/restricted/boost/asio/include/boost/asio/experimental/detail/partial_promise.hpp b/contrib/restricted/boost/asio/include/boost/asio/experimental/detail/partial_promise.hpp
index 48c8496609d..2c128f8b517 100644
--- a/contrib/restricted/boost/asio/include/boost/asio/experimental/detail/partial_promise.hpp
+++ b/contrib/restricted/boost/asio/include/boost/asio/experimental/detail/partial_promise.hpp
@@ -55,12 +55,12 @@ template <typename Allocator>
struct partial_promise_base
{
template <typename Executor, typename Token, typename... Args>
- void* operator new(const std::size_t size, Executor&, Token& tk, Args&...)
+ void* operator new(std::size_t size, Executor&, Token& tk, Args&...)
{
return allocate_coroutine<Allocator>(size, get_associated_allocator(tk));
}
- void operator delete(void* raw, const std::size_t size)
+ void operator delete(void* raw, std::size_t size)
{
deallocate_coroutine<Allocator>(raw, size);
}
@@ -111,9 +111,7 @@ struct partial_promise : partial_promise_base<Allocator>
}
};
-
-
-}; // namespace detail
+} // namespace detail
} // namespace experimental
} // namespace asio
} // namespace boost
diff --git a/contrib/restricted/boost/asio/include/boost/asio/experimental/impl/as_single.hpp b/contrib/restricted/boost/asio/include/boost/asio/experimental/impl/as_single.hpp
index 81841fb3bea..14a822ae666 100644
--- a/contrib/restricted/boost/asio/include/boost/asio/experimental/impl/as_single.hpp
+++ b/contrib/restricted/boost/asio/include/boost/asio/experimental/impl/as_single.hpp
@@ -20,6 +20,7 @@
#include <boost/asio/associator.hpp>
#include <boost/asio/async_result.hpp>
#include <boost/asio/detail/handler_cont_helpers.hpp>
+#include <boost/asio/detail/initiation_base.hpp>
#include <boost/asio/detail/type_traits.hpp>
#include <boost/asio/detail/push_options.hpp>
@@ -111,23 +112,27 @@ template <typename CompletionToken, typename Signature>
struct async_result<experimental::as_single_t<CompletionToken>, Signature>
{
template <typename Initiation>
- struct init_wrapper
+ struct init_wrapper : detail::initiation_base<Initiation>
{
- init_wrapper(Initiation init)
- : initiation_(static_cast<Initiation&&>(init))
+ using detail::initiation_base<Initiation>::initiation_base;
+
+ template <typename Handler, typename... Args>
+ void operator()(Handler&& handler, Args&&... args) &&
{
+ static_cast<Initiation&&>(*this)(
+ experimental::detail::as_single_handler<decay_t<Handler>>(
+ static_cast<Handler&&>(handler)),
+ static_cast<Args&&>(args)...);
}
template <typename Handler, typename... Args>
- void operator()(Handler&& handler, Args&&... args)
+ void operator()(Handler&& handler, Args&&... args) const &
{
- static_cast<Initiation&&>(initiation_)(
+ static_cast<const Initiation&>(*this)(
experimental::detail::as_single_handler<decay_t<Handler>>(
static_cast<Handler&&>(handler)),
static_cast<Args&&>(args)...);
}
-
- Initiation initiation_;
};
template <typename Initiation, typename RawCompletionToken, typename... Args>
diff --git a/contrib/restricted/boost/asio/include/boost/asio/experimental/impl/coro.hpp b/contrib/restricted/boost/asio/include/boost/asio/experimental/impl/coro.hpp
index 6e0bf0cc77d..80f2b4e3fb2 100644
--- a/contrib/restricted/boost/asio/include/boost/asio/experimental/impl/coro.hpp
+++ b/contrib/restricted/boost/asio/include/boost/asio/experimental/impl/coro.hpp
@@ -601,7 +601,7 @@ struct coro_promise final :
cancellation_slot_type get_cancellation_slot() const noexcept
{
- return cancel ? cancel->slot : cancellation_slot_type{};
+ return cancel ? cancel->state.slot() : cancellation_slot_type{};
}
using allocator_type =
diff --git a/contrib/restricted/boost/asio/include/boost/asio/experimental/parallel_group.hpp b/contrib/restricted/boost/asio/include/boost/asio/experimental/parallel_group.hpp
index cdaa7533773..e283e3fb1e7 100644
--- a/contrib/restricted/boost/asio/include/boost/asio/experimental/parallel_group.hpp
+++ b/contrib/restricted/boost/asio/include/boost/asio/experimental/parallel_group.hpp
@@ -208,6 +208,36 @@ public:
/**
* For example:
* @code boost::asio::experimental::make_parallel_group(
+ * in.async_read_some(boost::asio::buffer(data)),
+ * timer.async_wait()
+ * ).async_wait(
+ * boost::asio::experimental::wait_for_all(),
+ * [](
+ * std::array<std::size_t, 2> completion_order,
+ * boost::system::error_code ec1, std::size_t n1,
+ * boost::system::error_code ec2
+ * )
+ * {
+ * switch (completion_order[0])
+ * {
+ * case 0:
+ * {
+ * std::cout << "descriptor finished: " << ec1 << ", " << n1 << "\n";
+ * }
+ * break;
+ * case 1:
+ * {
+ * std::cout << "timer finished: " << ec2 << "\n";
+ * }
+ * break;
+ * }
+ * }
+ * );
+ * @endcode
+ *
+ * If preferred, the asynchronous operations may be explicitly packaged as
+ * function objects:
+ * @code boost::asio::experimental::make_parallel_group(
* [&](auto token)
* {
* return in.async_read_some(boost::asio::buffer(data), token);
@@ -333,28 +363,12 @@ public:
*
* For example:
* @code
- * using op_type = decltype(
- * socket1.async_read_some(
- * boost::asio::buffer(data1),
- * boost::asio::deferred
- * )
- * );
+ * using op_type =
+ * decltype(socket1.async_read_some(boost::asio::buffer(data1)));
*
* std::vector<op_type> ops;
- *
- * ops.push_back(
- * socket1.async_read_some(
- * boost::asio::buffer(data1),
- * boost::asio::deferred
- * )
- * );
- *
- * ops.push_back(
- * socket2.async_read_some(
- * boost::asio::buffer(data2),
- * boost::asio::deferred
- * )
- * );
+ * ops.push_back(socket1.async_read_some(boost::asio::buffer(data1)));
+ * ops.push_back(socket2.async_read_some(boost::asio::buffer(data2)));
*
* boost::asio::experimental::make_parallel_group(ops).async_wait(
* boost::asio::experimental::wait_for_all(),
@@ -392,28 +406,12 @@ make_parallel_group(Range&& range,
*
* For example:
* @code
- * using op_type = decltype(
- * socket1.async_read_some(
- * boost::asio::buffer(data1),
- * boost::asio::deferred
- * )
- * );
+ * using op_type =
+ * decltype(socket1.async_read_some(boost::asio::buffer(data1)));
*
* std::vector<op_type> ops;
- *
- * ops.push_back(
- * socket1.async_read_some(
- * boost::asio::buffer(data1),
- * boost::asio::deferred
- * )
- * );
- *
- * ops.push_back(
- * socket2.async_read_some(
- * boost::asio::buffer(data2),
- * boost::asio::deferred
- * )
- * );
+ * ops.push_back(socket1.async_read_some(boost::asio::buffer(data1)));
+ * ops.push_back(socket2.async_read_some(boost::asio::buffer(data2)));
*
* boost::asio::experimental::make_parallel_group(
* std::allocator_arg_t,
diff --git a/contrib/restricted/boost/asio/include/boost/asio/experimental/promise.hpp b/contrib/restricted/boost/asio/include/boost/asio/experimental/promise.hpp
index 205d7954569..e118007b5e2 100644
--- a/contrib/restricted/boost/asio/include/boost/asio/experimental/promise.hpp
+++ b/contrib/restricted/boost/asio/include/boost/asio/experimental/promise.hpp
@@ -85,8 +85,9 @@ struct promise_value_type<>
* awaitable<void> read_write_some(boost::asio::ip::tcp::socket & sock,
* boost::asio::mutable_buffer read_buf, boost::asio::const_buffer to_write)
* {
- * auto p = boost::asio::async_read(read_buf, boost::asio::use_awaitable);
- * co_await boost::asio::async_write_some(to_write, boost::asio::deferred);
+ * auto p = boost::asio::async_read(read_buf,
+ * boost::asio::experimental::use_promise);
+ * co_await boost::asio::async_write_some(to_write);
* co_await p;
* }
* @endcode
@@ -140,7 +141,6 @@ struct promise<void(Ts...), Executor, Allocator>
*/
~promise() { cancel(); }
-
private:
#if !defined(GENERATING_DOCUMENTATION)
template <typename, typename, typename> friend struct promise;
diff --git a/contrib/restricted/boost/asio/include/boost/asio/experimental/use_coro.hpp b/contrib/restricted/boost/asio/include/boost/asio/experimental/use_coro.hpp
index 133a23aa21a..d8d0d355852 100644
--- a/contrib/restricted/boost/asio/include/boost/asio/experimental/use_coro.hpp
+++ b/contrib/restricted/boost/asio/include/boost/asio/experimental/use_coro.hpp
@@ -48,8 +48,9 @@ namespace experimental {
* the asynchronous operation completes, and the result of the operation is
* returned.
*
- * Note that this token is not the most efficient (use @c boost::asio::deferred
- * for that) but does provide type erasure, as it will always return a @c coro.
+ * Note that this token is not the most efficient (use the default completion
+ * token @c boost::asio::deferred for that) but does provide type erasure, as it
+ * will always return a @c coro.
*/
template <typename Allocator = std::allocator<void>>
struct use_coro_t
@@ -84,7 +85,6 @@ struct use_coro_t
{
}
-
/// Specify an alternate allocator.
template <typename OtherAllocator>
use_coro_t<OtherAllocator> rebind(const OtherAllocator& allocator) const
@@ -174,9 +174,9 @@ private:
* See the documentation for boost::asio::use_coro_t for a usage example.
*/
#if defined(GENERATING_DOCUMENTATION)
-constexpr use_coro_t<> use_coro;
+BOOST_ASIO_INLINE_VARIABLE constexpr use_coro_t<> use_coro;
#else
-constexpr use_coro_t<> use_coro(0, 0, 0);
+BOOST_ASIO_INLINE_VARIABLE constexpr use_coro_t<> use_coro(0, 0, 0);
#endif
} // namespace experimental
diff --git a/contrib/restricted/boost/asio/include/boost/asio/experimental/use_promise.hpp b/contrib/restricted/boost/asio/include/boost/asio/experimental/use_promise.hpp
index a2fa9d51bc7..e78921a4125 100644
--- a/contrib/restricted/boost/asio/include/boost/asio/experimental/use_promise.hpp
+++ b/contrib/restricted/boost/asio/include/boost/asio/experimental/use_promise.hpp
@@ -100,7 +100,7 @@ private:
Allocator allocator_;
};
-constexpr use_promise_t<> use_promise;
+BOOST_ASIO_INLINE_VARIABLE constexpr use_promise_t<> use_promise;
} // namespace experimental
} // namespace asio
diff --git a/contrib/restricted/boost/asio/include/boost/asio/immediate.hpp b/contrib/restricted/boost/asio/include/boost/asio/immediate.hpp
new file mode 100644
index 00000000000..c5ff2f67adf
--- /dev/null
+++ b/contrib/restricted/boost/asio/include/boost/asio/immediate.hpp
@@ -0,0 +1,144 @@
+//
+// immediate.hpp
+// ~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+
+#ifndef BOOST_ASIO_IMMEDIATE_HPP
+#define BOOST_ASIO_IMMEDIATE_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include <boost/asio/detail/config.hpp>
+#include <boost/asio/associated_immediate_executor.hpp>
+#include <boost/asio/async_result.hpp>
+#include <boost/asio/dispatch.hpp>
+
+#include <boost/asio/detail/push_options.hpp>
+
+namespace boost {
+namespace asio {
+namespace detail {
+
+template <typename Executor>
+class initiate_immediate
+{
+public:
+ typedef Executor executor_type;
+
+ explicit initiate_immediate(const Executor& ex)
+ : ex_(ex)
+ {
+ }
+
+ executor_type get_executor() const noexcept
+ {
+ return ex_;
+ }
+
+ template <typename CompletionHandler>
+ void operator()(CompletionHandler&& handler) const
+ {
+ typename associated_immediate_executor<
+ CompletionHandler, executor_type>::type ex =
+ (get_associated_immediate_executor)(handler, ex_);
+ (dispatch)(ex, static_cast<CompletionHandler&&>(handler));
+ }
+
+private:
+ Executor ex_;
+};
+
+} // namespace detail
+
+/// Launch a trivial asynchronous operation that completes immediately.
+/**
+ * The async_immediate function is intended for use by composed operations,
+ * which can delegate to this operation in order to implement the correct
+ * semantics for immediate completion.
+ *
+ * @param ex The asynchronous operation's I/O executor.
+ *
+ * @param token The completion token.
+ *
+ * The completion handler is immediately submitted for execution by calling
+ * boost::asio::dispatch() on the handler's associated immediate executor.
+ *
+ * If the completion handler does not have a customised associated immediate
+ * executor, then the handler is submitted as if by calling boost::asio::post()
+ * on the supplied I/O executor.
+ *
+ * @par Completion Signature
+ * @code void() @endcode
+ */
+template <typename Executor,
+ BOOST_ASIO_COMPLETION_TOKEN_FOR(void()) NullaryToken
+ = default_completion_token_t<Executor>>
+inline auto async_immediate(const Executor& ex,
+ NullaryToken&& token = default_completion_token_t<Executor>(),
+ constraint_t<
+ (execution::is_executor<Executor>::value
+ && can_require<Executor, execution::blocking_t::never_t>::value)
+ || is_executor<Executor>::value
+ > = 0)
+ -> decltype(
+ async_initiate<NullaryToken, void()>(
+ declval<detail::initiate_immediate<Executor>>(), token))
+{
+ return async_initiate<NullaryToken, void()>(
+ detail::initiate_immediate<Executor>(ex), token);
+}
+
+/// Launch a trivial asynchronous operation that completes immediately.
+/**
+ * The async_immediate function is intended for use by composed operations,
+ * which can delegate to this operation in order to implement the correct
+ * semantics for immediate completion.
+ *
+ * @param ex The execution context used to obtain the asynchronous operation's
+ * I/O executor.
+ *
+ * @param token The completion token.
+ *
+ * The completion handler is immediately submitted for execution by calling
+ * boost::asio::dispatch() on the handler's associated immediate executor.
+ *
+ * If the completion handler does not have a customised associated immediate
+ * executor, then the handler is submitted as if by calling boost::asio::post()
+ * on the I/O executor obtained from the supplied execution context.
+ *
+ * @par Completion Signature
+ * @code void() @endcode
+ */
+template <typename ExecutionContext,
+ BOOST_ASIO_COMPLETION_TOKEN_FOR(void()) NullaryToken
+ = default_completion_token_t<typename ExecutionContext::executor_type>>
+inline auto async_immediate(ExecutionContext& ctx,
+ NullaryToken&& token = default_completion_token_t<
+ typename ExecutionContext::executor_type>(),
+ constraint_t<
+ is_convertible<ExecutionContext&, execution_context&>::value
+ > = 0)
+ -> decltype(
+ async_initiate<NullaryToken, void()>(
+ declval<detail::initiate_immediate<
+ typename ExecutionContext::executor_type>>(), token))
+{
+ return async_initiate<NullaryToken, void()>(
+ detail::initiate_immediate<
+ typename ExecutionContext::executor_type>(
+ ctx.get_executor()), token);
+}
+
+} // namespace asio
+} // namespace boost
+
+#include <boost/asio/detail/pop_options.hpp>
+
+#endif // BOOST_ASIO_IMMEDIATE_HPP
diff --git a/contrib/restricted/boost/asio/include/boost/asio/impl/append.hpp b/contrib/restricted/boost/asio/include/boost/asio/impl/append.hpp
index 2e409e0dfe0..e358ea2b072 100644
--- a/contrib/restricted/boost/asio/include/boost/asio/impl/append.hpp
+++ b/contrib/restricted/boost/asio/include/boost/asio/impl/append.hpp
@@ -19,6 +19,7 @@
#include <boost/asio/associator.hpp>
#include <boost/asio/async_result.hpp>
#include <boost/asio/detail/handler_cont_helpers.hpp>
+#include <boost/asio/detail/initiation_base.hpp>
#include <boost/asio/detail/type_traits.hpp>
#include <boost/asio/detail/utility.hpp>
@@ -94,25 +95,31 @@ struct async_result<append_t<CompletionToken, Values...>, Signature>
Signature, Values...>::type signature;
template <typename Initiation>
- struct init_wrapper
+ struct init_wrapper : detail::initiation_base<Initiation>
{
- init_wrapper(Initiation init)
- : initiation_(static_cast<Initiation&&>(init))
+ using detail::initiation_base<Initiation>::initiation_base;
+
+ template <typename Handler, typename... Args>
+ void operator()(Handler&& handler,
+ std::tuple<Values...> values, Args&&... args) &&
{
+ static_cast<Initiation&&>(*this)(
+ detail::append_handler<decay_t<Handler>, Values...>(
+ static_cast<Handler&&>(handler),
+ static_cast<std::tuple<Values...>&&>(values)),
+ static_cast<Args&&>(args)...);
}
template <typename Handler, typename... Args>
void operator()(Handler&& handler,
- std::tuple<Values...> values, Args&&... args)
+ std::tuple<Values...> values, Args&&... args) const &
{
- static_cast<Initiation&&>(initiation_)(
+ static_cast<const Initiation&>(*this)(
detail::append_handler<decay_t<Handler>, Values...>(
static_cast<Handler&&>(handler),
static_cast<std::tuple<Values...>&&>(values)),
static_cast<Args&&>(args)...);
}
-
- Initiation initiation_;
};
template <typename Initiation, typename RawCompletionToken, typename... Args>
diff --git a/contrib/restricted/boost/asio/include/boost/asio/impl/as_tuple.hpp b/contrib/restricted/boost/asio/include/boost/asio/impl/as_tuple.hpp
index 780b271d051..912e2666f98 100644
--- a/contrib/restricted/boost/asio/include/boost/asio/impl/as_tuple.hpp
+++ b/contrib/restricted/boost/asio/include/boost/asio/impl/as_tuple.hpp
@@ -17,9 +17,11 @@
#include <boost/asio/detail/config.hpp>
#include <tuple>
+#include <boost/asio/associated_executor.hpp>
#include <boost/asio/associator.hpp>
#include <boost/asio/async_result.hpp>
#include <boost/asio/detail/handler_cont_helpers.hpp>
+#include <boost/asio/detail/initiation_base.hpp>
#include <boost/asio/detail/type_traits.hpp>
#include <boost/asio/detail/push_options.hpp>
@@ -119,23 +121,27 @@ struct async_result<as_tuple_t<CompletionToken>, Signatures...>
typename detail::as_tuple_signature<Signatures>::type...>
{
template <typename Initiation>
- struct init_wrapper
+ struct init_wrapper : detail::initiation_base<Initiation>
{
- init_wrapper(Initiation init)
- : initiation_(static_cast<Initiation&&>(init))
+ using detail::initiation_base<Initiation>::initiation_base;
+
+ template <typename Handler, typename... Args>
+ void operator()(Handler&& handler, Args&&... args) &&
{
+ static_cast<Initiation&&>(*this)(
+ detail::as_tuple_handler<decay_t<Handler>>(
+ static_cast<Handler&&>(handler)),
+ static_cast<Args&&>(args)...);
}
template <typename Handler, typename... Args>
- void operator()(Handler&& handler, Args&&... args)
+ void operator()(Handler&& handler, Args&&... args) const &
{
- static_cast<Initiation&&>(initiation_)(
+ static_cast<const Initiation&>(*this)(
detail::as_tuple_handler<decay_t<Handler>>(
static_cast<Handler&&>(handler)),
static_cast<Args&&>(args)...);
}
-
- Initiation initiation_;
};
template <typename Initiation, typename RawCompletionToken, typename... Args>
@@ -172,23 +178,27 @@ struct async_result<as_tuple_t<CompletionToken>, Signature>
typename detail::as_tuple_signature<Signature>::type>
{
template <typename Initiation>
- struct init_wrapper
+ struct init_wrapper : detail::initiation_base<Initiation>
{
- init_wrapper(Initiation init)
- : initiation_(static_cast<Initiation&&>(init))
+ using detail::initiation_base<Initiation>::initiation_base;
+
+ template <typename Handler, typename... Args>
+ void operator()(Handler&& handler, Args&&... args) &&
{
+ static_cast<Initiation&&>(*this)(
+ detail::as_tuple_handler<decay_t<Handler>>(
+ static_cast<Handler&&>(handler)),
+ static_cast<Args&&>(args)...);
}
template <typename Handler, typename... Args>
- void operator()(Handler&& handler, Args&&... args)
+ void operator()(Handler&& handler, Args&&... args) const &
{
- static_cast<Initiation&&>(initiation_)(
+ static_cast<const Initiation&>(*this)(
detail::as_tuple_handler<decay_t<Handler>>(
static_cast<Handler&&>(handler)),
static_cast<Args&&>(args)...);
}
-
- Initiation initiation_;
};
template <typename Initiation, typename RawCompletionToken, typename... Args>
@@ -237,6 +247,27 @@ struct associator<Associator,
}
};
+template <typename... Signatures>
+struct async_result<partial_as_tuple, Signatures...>
+{
+ template <typename Initiation, typename RawCompletionToken, typename... Args>
+ static auto initiate(Initiation&& initiation,
+ RawCompletionToken&&, Args&&... args)
+ -> decltype(
+ async_initiate<Signatures...>(
+ static_cast<Initiation&&>(initiation),
+ as_tuple_t<
+ default_completion_token_t<associated_executor_t<Initiation>>>{},
+ static_cast<Args&&>(args)...))
+ {
+ return async_initiate<Signatures...>(
+ static_cast<Initiation&&>(initiation),
+ as_tuple_t<
+ default_completion_token_t<associated_executor_t<Initiation>>>{},
+ static_cast<Args&&>(args)...);
+ }
+};
+
#endif // !defined(GENERATING_DOCUMENTATION)
} // namespace asio
diff --git a/contrib/restricted/boost/asio/include/boost/asio/impl/awaitable.hpp b/contrib/restricted/boost/asio/include/boost/asio/impl/awaitable.hpp
index 09833ead276..477a45acffa 100644
--- a/contrib/restricted/boost/asio/include/boost/asio/impl/awaitable.hpp
+++ b/contrib/restricted/boost/asio/include/boost/asio/impl/awaitable.hpp
@@ -546,7 +546,7 @@ public:
{
this->coro_ = coroutine_handle<awaitable_frame>::from_promise(*this);
return awaitable<T, Executor>(this);
- };
+ }
template <typename U>
void return_value(U&& u)
@@ -583,7 +583,7 @@ public:
{
this->coro_ = coroutine_handle<awaitable_frame>::from_promise(*this);
return awaitable<void, Executor>(this);
- };
+ }
void return_void()
{
@@ -621,7 +621,7 @@ public:
{
this->coro_ = coroutine_handle<awaitable_frame>::from_promise(*this);
return awaitable<awaitable_thread_entry_point, Executor>(this);
- };
+ }
void return_void()
{
diff --git a/contrib/restricted/boost/asio/include/boost/asio/impl/cancel_after.hpp b/contrib/restricted/boost/asio/include/boost/asio/impl/cancel_after.hpp
new file mode 100644
index 00000000000..1a89a558920
--- /dev/null
+++ b/contrib/restricted/boost/asio/include/boost/asio/impl/cancel_after.hpp
@@ -0,0 +1,270 @@
+//
+// impl/cancel_after.hpp
+// ~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+
+#ifndef BOOST_ASIO_IMPL_CANCEL_AFTER_HPP
+#define BOOST_ASIO_IMPL_CANCEL_AFTER_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include <boost/asio/detail/config.hpp>
+#include <boost/asio/associated_executor.hpp>
+#include <boost/asio/async_result.hpp>
+#include <boost/asio/detail/initiation_base.hpp>
+#include <boost/asio/detail/timed_cancel_op.hpp>
+
+#include <boost/asio/detail/push_options.hpp>
+
+namespace boost {
+namespace asio {
+namespace detail {
+
+template <typename Initiation, typename Clock,
+ typename WaitTraits, typename... Signatures>
+struct initiate_cancel_after : initiation_base<Initiation>
+{
+ using initiation_base<Initiation>::initiation_base;
+
+ template <typename Handler, typename Rep, typename Period, typename... Args>
+ void operator()(Handler&& handler,
+ const chrono::duration<Rep, Period>& timeout,
+ cancellation_type_t cancel_type, Args&&... args) &&
+ {
+ using op = detail::timed_cancel_op<decay_t<Handler>,
+ basic_waitable_timer<Clock, WaitTraits>, Signatures...>;
+
+ non_const_lvalue<Handler> handler2(handler);
+ typename op::ptr p = { boost::asio::detail::addressof(handler2.value),
+ op::ptr::allocate(handler2.value), 0 };
+ p.p = new (p.v) op(handler2.value,
+ basic_waitable_timer<Clock, WaitTraits,
+ typename Initiation::executor_type>(this->get_executor(), timeout),
+ cancel_type);
+
+ op* o = p.p;
+ p.v = p.p = 0;
+ o->start(static_cast<Initiation&&>(*this), static_cast<Args&&>(args)...);
+ }
+
+ template <typename Handler, typename Rep, typename Period, typename... Args>
+ void operator()(Handler&& handler,
+ const chrono::duration<Rep, Period>& timeout,
+ cancellation_type_t cancel_type, Args&&... args) const &
+ {
+ using op = detail::timed_cancel_op<decay_t<Handler>,
+ basic_waitable_timer<Clock, WaitTraits>, Signatures...>;
+
+ non_const_lvalue<Handler> handler2(handler);
+ typename op::ptr p = { boost::asio::detail::addressof(handler2.value),
+ op::ptr::allocate(handler2.value), 0 };
+ p.p = new (p.v) op(handler2.value,
+ basic_waitable_timer<Clock, WaitTraits,
+ typename Initiation::executor_type>(this->get_executor(), timeout),
+ cancel_type);
+
+ op* o = p.p;
+ p.v = p.p = 0;
+ o->start(static_cast<const Initiation&>(*this),
+ static_cast<Args&&>(args)...);
+ }
+};
+
+template <typename Initiation, typename Clock,
+ typename WaitTraits, typename Executor, typename... Signatures>
+struct initiate_cancel_after_timer : initiation_base<Initiation>
+{
+ using initiation_base<Initiation>::initiation_base;
+
+ template <typename Handler, typename Rep, typename Period, typename... Args>
+ void operator()(Handler&& handler,
+ basic_waitable_timer<Clock, WaitTraits, Executor>* timer,
+ const chrono::duration<Rep, Period>& timeout,
+ cancellation_type_t cancel_type, Args&&... args) &&
+ {
+ using op = detail::timed_cancel_op<decay_t<Handler>,
+ basic_waitable_timer<Clock, WaitTraits, Executor>&, Signatures...>;
+
+ non_const_lvalue<Handler> handler2(handler);
+ typename op::ptr p = { boost::asio::detail::addressof(handler2.value),
+ op::ptr::allocate(handler2.value), 0 };
+ timer->expires_after(timeout);
+ p.p = new (p.v) op(handler2.value, *timer, cancel_type);
+
+ op* o = p.p;
+ p.v = p.p = 0;
+ o->start(static_cast<Initiation&&>(*this), static_cast<Args&&>(args)...);
+ }
+
+ template <typename Handler, typename Rep, typename Period, typename... Args>
+ void operator()(Handler&& handler,
+ basic_waitable_timer<Clock, WaitTraits, Executor>* timer,
+ const chrono::duration<Rep, Period>& timeout,
+ cancellation_type_t cancel_type, Args&&... args) const &
+ {
+ using op = detail::timed_cancel_op<decay_t<Handler>,
+ basic_waitable_timer<Clock, WaitTraits, Executor>&, Signatures...>;
+
+ non_const_lvalue<Handler> handler2(handler);
+ typename op::ptr p = { boost::asio::detail::addressof(handler2.value),
+ op::ptr::allocate(handler2.value), 0 };
+ timer->expires_after(timeout);
+ p.p = new (p.v) op(handler2.value, *timer, cancel_type);
+
+ op* o = p.p;
+ p.v = p.p = 0;
+ o->start(static_cast<const Initiation&>(*this),
+ static_cast<Args&&>(args)...);
+ }
+};
+
+} // namespace detail
+
+#if !defined(GENERATING_DOCUMENTATION)
+
+template <typename CompletionToken, typename Clock,
+ typename WaitTraits, typename... Signatures>
+struct async_result<
+ cancel_after_t<CompletionToken, Clock, WaitTraits>, Signatures...>
+ : async_result<CompletionToken, Signatures...>
+{
+ template <typename Initiation, typename RawCompletionToken, typename... Args>
+ static auto initiate(Initiation&& initiation,
+ RawCompletionToken&& token, Args&&... args)
+ -> decltype(
+ async_initiate<
+ conditional_t<
+ is_const<remove_reference_t<RawCompletionToken>>::value,
+ const CompletionToken, CompletionToken>,
+ Signatures...>(
+ declval<detail::initiate_cancel_after<
+ decay_t<Initiation>, Clock, WaitTraits, Signatures...>>(),
+ token.token_, token.timeout_, token.cancel_type_,
+ static_cast<Args&&>(args)...))
+ {
+ return async_initiate<
+ conditional_t<
+ is_const<remove_reference_t<RawCompletionToken>>::value,
+ const CompletionToken, CompletionToken>,
+ Signatures...>(
+ detail::initiate_cancel_after<
+ decay_t<Initiation>, Clock, WaitTraits, Signatures...>(
+ static_cast<Initiation&&>(initiation)),
+ token.token_, token.timeout_, token.cancel_type_,
+ static_cast<Args&&>(args)...);
+ }
+};
+
+template <typename CompletionToken, typename Clock,
+ typename WaitTraits, typename Executor, typename... Signatures>
+struct async_result<
+ cancel_after_timer<CompletionToken, Clock, WaitTraits, Executor>,
+ Signatures...>
+ : async_result<CompletionToken, Signatures...>
+{
+ template <typename Initiation, typename RawCompletionToken, typename... Args>
+ static auto initiate(Initiation&& initiation,
+ RawCompletionToken&& token, Args&&... args)
+ -> decltype(
+ async_initiate<
+ conditional_t<
+ is_const<remove_reference_t<RawCompletionToken>>::value,
+ const CompletionToken, CompletionToken>,
+ Signatures...>(
+ declval<detail::initiate_cancel_after_timer<
+ decay_t<Initiation>, Clock, WaitTraits, Executor, Signatures...>>(),
+ token.token_, &token.timer_, token.timeout_,
+ token.cancel_type_, static_cast<Args&&>(args)...))
+ {
+ return async_initiate<
+ conditional_t<
+ is_const<remove_reference_t<RawCompletionToken>>::value,
+ const CompletionToken, CompletionToken>,
+ Signatures...>(
+ detail::initiate_cancel_after_timer<
+ decay_t<Initiation>, Clock, WaitTraits, Executor, Signatures...>(
+ static_cast<Initiation&&>(initiation)),
+ token.token_, &token.timer_, token.timeout_,
+ token.cancel_type_, static_cast<Args&&>(args)...);
+ }
+};
+
+template <typename Clock, typename WaitTraits, typename... Signatures>
+struct async_result<partial_cancel_after<Clock, WaitTraits>, Signatures...>
+{
+ template <typename Initiation, typename RawCompletionToken, typename... Args>
+ static auto initiate(Initiation&& initiation,
+ RawCompletionToken&& token, Args&&... args)
+ -> decltype(
+ async_initiate<
+ const cancel_after_t<
+ default_completion_token_t<associated_executor_t<Initiation>>,
+ Clock, WaitTraits>&,
+ Signatures...>(
+ static_cast<Initiation&&>(initiation),
+ cancel_after_t<
+ default_completion_token_t<associated_executor_t<Initiation>>,
+ Clock, WaitTraits>(
+ default_completion_token_t<associated_executor_t<Initiation>>{},
+ token.timeout_, token.cancel_type_),
+ static_cast<Args&&>(args)...))
+ {
+ return async_initiate<
+ const cancel_after_t<
+ default_completion_token_t<associated_executor_t<Initiation>>,
+ Clock, WaitTraits>&,
+ Signatures...>(
+ static_cast<Initiation&&>(initiation),
+ cancel_after_t<
+ default_completion_token_t<associated_executor_t<Initiation>>,
+ Clock, WaitTraits>(
+ default_completion_token_t<associated_executor_t<Initiation>>{},
+ token.timeout_, token.cancel_type_),
+ static_cast<Args&&>(args)...);
+ }
+};
+
+template <typename Clock, typename WaitTraits,
+ typename Executor, typename... Signatures>
+struct async_result<
+ partial_cancel_after_timer<Clock, WaitTraits, Executor>, Signatures...>
+{
+ template <typename Initiation, typename RawCompletionToken, typename... Args>
+ static auto initiate(Initiation&& initiation,
+ RawCompletionToken&& token, Args&&... args)
+ -> decltype(
+ async_initiate<Signatures...>(
+ static_cast<Initiation&&>(initiation),
+ cancel_after_timer<
+ default_completion_token_t<associated_executor_t<Initiation>>,
+ Clock, WaitTraits, Executor>(
+ default_completion_token_t<associated_executor_t<Initiation>>{},
+ token.timer_, token.timeout_, token.cancel_type_),
+ static_cast<Args&&>(args)...))
+ {
+ return async_initiate<Signatures...>(
+ static_cast<Initiation&&>(initiation),
+ cancel_after_timer<
+ default_completion_token_t<associated_executor_t<Initiation>>,
+ Clock, WaitTraits, Executor>(
+ default_completion_token_t<associated_executor_t<Initiation>>{},
+ token.timer_, token.timeout_, token.cancel_type_),
+ static_cast<Args&&>(args)...);
+ }
+};
+
+#endif // !defined(GENERATING_DOCUMENTATION)
+
+} // namespace asio
+} // namespace boost
+
+#include <boost/asio/detail/pop_options.hpp>
+
+#endif // BOOST_ASIO_IMPL_CANCEL_AFTER_HPP
diff --git a/contrib/restricted/boost/asio/include/boost/asio/impl/cancel_at.hpp b/contrib/restricted/boost/asio/include/boost/asio/impl/cancel_at.hpp
new file mode 100644
index 00000000000..7634b5da03e
--- /dev/null
+++ b/contrib/restricted/boost/asio/include/boost/asio/impl/cancel_at.hpp
@@ -0,0 +1,270 @@
+//
+// impl/cancel_at.hpp
+// ~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+
+#ifndef BOOST_ASIO_IMPL_CANCEL_AT_HPP
+#define BOOST_ASIO_IMPL_CANCEL_AT_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include <boost/asio/detail/config.hpp>
+#include <boost/asio/associated_executor.hpp>
+#include <boost/asio/async_result.hpp>
+#include <boost/asio/detail/initiation_base.hpp>
+#include <boost/asio/detail/timed_cancel_op.hpp>
+
+#include <boost/asio/detail/push_options.hpp>
+
+namespace boost {
+namespace asio {
+namespace detail {
+
+template <typename Initiation, typename Clock,
+ typename WaitTraits, typename... Signatures>
+struct initiate_cancel_at : initiation_base<Initiation>
+{
+ using initiation_base<Initiation>::initiation_base;
+
+ template <typename Handler, typename Duration, typename... Args>
+ void operator()(Handler&& handler,
+ const chrono::time_point<Clock, Duration>& expiry,
+ cancellation_type_t cancel_type, Args&&... args) &&
+ {
+ using op = detail::timed_cancel_op<decay_t<Handler>,
+ basic_waitable_timer<Clock, WaitTraits>, Signatures...>;
+
+ non_const_lvalue<Handler> handler2(handler);
+ typename op::ptr p = { boost::asio::detail::addressof(handler2.value),
+ op::ptr::allocate(handler2.value), 0 };
+ p.p = new (p.v) op(handler2.value,
+ basic_waitable_timer<Clock, WaitTraits,
+ typename Initiation::executor_type>(this->get_executor(), expiry),
+ cancel_type);
+
+ op* o = p.p;
+ p.v = p.p = 0;
+ o->start(static_cast<Initiation&&>(*this), static_cast<Args&&>(args)...);
+ }
+
+ template <typename Handler, typename Duration, typename... Args>
+ void operator()(Handler&& handler,
+ const chrono::time_point<Clock, Duration>& expiry,
+ cancellation_type_t cancel_type, Args&&... args) const &
+ {
+ using op = detail::timed_cancel_op<decay_t<Handler>,
+ basic_waitable_timer<Clock, WaitTraits>, Signatures...>;
+
+ non_const_lvalue<Handler> handler2(handler);
+ typename op::ptr p = { boost::asio::detail::addressof(handler2.value),
+ op::ptr::allocate(handler2.value), 0 };
+ p.p = new (p.v) op(handler2.value,
+ basic_waitable_timer<Clock, WaitTraits,
+ typename Initiation::executor_type>(this->get_executor(), expiry),
+ cancel_type);
+
+ op* o = p.p;
+ p.v = p.p = 0;
+ o->start(static_cast<const Initiation&>(*this),
+ static_cast<Args&&>(args)...);
+ }
+};
+
+template <typename Initiation, typename Clock,
+ typename WaitTraits, typename Executor, typename... Signatures>
+struct initiate_cancel_at_timer : initiation_base<Initiation>
+{
+ using initiation_base<Initiation>::initiation_base;
+
+ template <typename Handler, typename Duration, typename... Args>
+ void operator()(Handler&& handler,
+ basic_waitable_timer<Clock, WaitTraits, Executor>* timer,
+ const chrono::time_point<Clock, Duration>& expiry,
+ cancellation_type_t cancel_type, Args&&... args) &&
+ {
+ using op = detail::timed_cancel_op<decay_t<Handler>,
+ basic_waitable_timer<Clock, WaitTraits, Executor>&, Signatures...>;
+
+ non_const_lvalue<Handler> handler2(handler);
+ typename op::ptr p = { boost::asio::detail::addressof(handler2.value),
+ op::ptr::allocate(handler2.value), 0 };
+ timer->expires_at(expiry);
+ p.p = new (p.v) op(handler2.value, *timer, cancel_type);
+
+ op* o = p.p;
+ p.v = p.p = 0;
+ o->start(static_cast<Initiation&&>(*this), static_cast<Args&&>(args)...);
+ }
+
+ template <typename Handler, typename Duration, typename... Args>
+ void operator()(Handler&& handler,
+ basic_waitable_timer<Clock, WaitTraits, Executor>* timer,
+ const chrono::time_point<Clock, Duration>& expiry,
+ cancellation_type_t cancel_type, Args&&... args) const &
+ {
+ using op = detail::timed_cancel_op<decay_t<Handler>,
+ basic_waitable_timer<Clock, WaitTraits, Executor>&, Signatures...>;
+
+ non_const_lvalue<Handler> handler2(handler);
+ typename op::ptr p = { boost::asio::detail::addressof(handler2.value),
+ op::ptr::allocate(handler2.value), 0 };
+ timer->expires_at(expiry);
+ p.p = new (p.v) op(handler2.value, *timer, cancel_type);
+
+ op* o = p.p;
+ p.v = p.p = 0;
+ o->start(static_cast<const Initiation&>(*this),
+ static_cast<Args&&>(args)...);
+ }
+};
+
+} // namespace detail
+
+#if !defined(GENERATING_DOCUMENTATION)
+
+template <typename CompletionToken, typename Clock,
+ typename WaitTraits, typename... Signatures>
+struct async_result<
+ cancel_at_t<CompletionToken, Clock, WaitTraits>, Signatures...>
+ : async_result<CompletionToken, Signatures...>
+{
+ template <typename Initiation, typename RawCompletionToken, typename... Args>
+ static auto initiate(Initiation&& initiation,
+ RawCompletionToken&& token, Args&&... args)
+ -> decltype(
+ async_initiate<
+ conditional_t<
+ is_const<remove_reference_t<RawCompletionToken>>::value,
+ const CompletionToken, CompletionToken>,
+ Signatures...>(
+ declval<detail::initiate_cancel_at<
+ decay_t<Initiation>, Clock, WaitTraits, Signatures...>>(),
+ token.token_, token.expiry_, token.cancel_type_,
+ static_cast<Args&&>(args)...))
+ {
+ return async_initiate<
+ conditional_t<
+ is_const<remove_reference_t<RawCompletionToken>>::value,
+ const CompletionToken, CompletionToken>,
+ Signatures...>(
+ detail::initiate_cancel_at<
+ decay_t<Initiation>, Clock, WaitTraits, Signatures...>(
+ static_cast<Initiation&&>(initiation)),
+ token.token_, token.expiry_, token.cancel_type_,
+ static_cast<Args&&>(args)...);
+ }
+};
+
+template <typename CompletionToken, typename Clock,
+ typename WaitTraits, typename Executor, typename... Signatures>
+struct async_result<
+ cancel_at_timer<CompletionToken, Clock, WaitTraits, Executor>,
+ Signatures...>
+ : async_result<CompletionToken, Signatures...>
+{
+ template <typename Initiation, typename RawCompletionToken, typename... Args>
+ static auto initiate(Initiation&& initiation,
+ RawCompletionToken&& token, Args&&... args)
+ -> decltype(
+ async_initiate<
+ conditional_t<
+ is_const<remove_reference_t<RawCompletionToken>>::value,
+ const CompletionToken, CompletionToken>,
+ Signatures...>(
+ declval<detail::initiate_cancel_at_timer<
+ decay_t<Initiation>, Clock, WaitTraits, Executor, Signatures...>>(),
+ token.token_, &token.timer_, token.expiry_, token.cancel_type_,
+ static_cast<Args&&>(args)...))
+ {
+ return async_initiate<
+ conditional_t<
+ is_const<remove_reference_t<RawCompletionToken>>::value,
+ const CompletionToken, CompletionToken>,
+ Signatures...>(
+ detail::initiate_cancel_at_timer<
+ decay_t<Initiation>, Clock, WaitTraits, Executor, Signatures...>(
+ static_cast<Initiation&&>(initiation)),
+ token.token_, &token.timer_, token.expiry_, token.cancel_type_,
+ static_cast<Args&&>(args)...);
+ }
+};
+
+template <typename Clock, typename WaitTraits, typename... Signatures>
+struct async_result<partial_cancel_at<Clock, WaitTraits>, Signatures...>
+{
+ template <typename Initiation, typename RawCompletionToken, typename... Args>
+ static auto initiate(Initiation&& initiation,
+ RawCompletionToken&& token, Args&&... args)
+ -> decltype(
+ async_initiate<
+ const cancel_at_t<
+ default_completion_token_t<associated_executor_t<Initiation>>,
+ Clock, WaitTraits>&,
+ Signatures...>(
+ static_cast<Initiation&&>(initiation),
+ cancel_at_t<
+ default_completion_token_t<associated_executor_t<Initiation>>,
+ Clock, WaitTraits>(
+ default_completion_token_t<associated_executor_t<Initiation>>{},
+ token.expiry_, token.cancel_type_),
+ static_cast<Args&&>(args)...))
+ {
+ return async_initiate<
+ const cancel_at_t<
+ default_completion_token_t<associated_executor_t<Initiation>>,
+ Clock, WaitTraits>&,
+ Signatures...>(
+ static_cast<Initiation&&>(initiation),
+ cancel_at_t<
+ default_completion_token_t<associated_executor_t<Initiation>>,
+ Clock, WaitTraits>(
+ default_completion_token_t<associated_executor_t<Initiation>>{},
+ token.expiry_, token.cancel_type_),
+ static_cast<Args&&>(args)...);
+ }
+};
+
+template <typename Clock, typename WaitTraits,
+ typename Executor, typename... Signatures>
+struct async_result<
+ partial_cancel_at_timer<Clock, WaitTraits, Executor>, Signatures...>
+{
+ template <typename Initiation, typename RawCompletionToken, typename... Args>
+ static auto initiate(Initiation&& initiation,
+ RawCompletionToken&& token, Args&&... args)
+ -> decltype(
+ async_initiate<Signatures...>(
+ static_cast<Initiation&&>(initiation),
+ cancel_at_timer<
+ default_completion_token_t<associated_executor_t<Initiation>>,
+ Clock, WaitTraits, Executor>(
+ default_completion_token_t<associated_executor_t<Initiation>>{},
+ token.timer_, token.expiry_, token.cancel_type_),
+ static_cast<Args&&>(args)...))
+ {
+ return async_initiate<Signatures...>(
+ static_cast<Initiation&&>(initiation),
+ cancel_at_timer<
+ default_completion_token_t<associated_executor_t<Initiation>>,
+ Clock, WaitTraits, Executor>(
+ default_completion_token_t<associated_executor_t<Initiation>>{},
+ token.timer_, token.expiry_, token.cancel_type_),
+ static_cast<Args&&>(args)...);
+ }
+};
+
+#endif // !defined(GENERATING_DOCUMENTATION)
+
+} // namespace asio
+} // namespace boost
+
+#include <boost/asio/detail/pop_options.hpp>
+
+#endif // BOOST_ASIO_IMPL_CANCEL_AT_HPP
diff --git a/contrib/restricted/boost/asio/include/boost/asio/impl/co_spawn.hpp b/contrib/restricted/boost/asio/include/boost/asio/impl/co_spawn.hpp
index f2b5137f877..31d3311c003 100644
--- a/contrib/restricted/boost/asio/include/boost/asio/impl/co_spawn.hpp
+++ b/contrib/restricted/boost/asio/include/boost/asio/impl/co_spawn.hpp
@@ -143,7 +143,9 @@ awaitable<awaitable_thread_entry_point, Executor> co_spawn_entry_point(
(co_await awaitable_thread_has_context_switched{}) = false;
std::exception_ptr e = nullptr;
bool done = false;
+#if !defined(BOOST_ASIO_NO_EXCEPTIONS)
try
+#endif // !defined(BOOST_ASIO_NO_EXCEPTIONS)
{
T t = co_await s.function();
@@ -164,6 +166,7 @@ awaitable<awaitable_thread_entry_point, Executor> co_spawn_entry_point(
co_return;
}
+#if !defined(BOOST_ASIO_NO_EXCEPTIONS)
catch (...)
{
if (done)
@@ -171,6 +174,7 @@ awaitable<awaitable_thread_entry_point, Executor> co_spawn_entry_point(
e = std::current_exception();
}
+#endif // !defined(BOOST_ASIO_NO_EXCEPTIONS)
bool switched = (co_await awaitable_thread_has_context_switched{});
if (!switched)
@@ -194,14 +198,18 @@ awaitable<awaitable_thread_entry_point, Executor> co_spawn_entry_point(
(co_await awaitable_thread_has_context_switched{}) = false;
std::exception_ptr e = nullptr;
+#if !defined(BOOST_ASIO_NO_EXCEPTIONS)
try
+#endif // !defined(BOOST_ASIO_NO_EXCEPTIONS)
{
co_await s.function();
}
+#if !defined(BOOST_ASIO_NO_EXCEPTIONS)
catch (...)
{
e = std::current_exception();
}
+#endif // !defined(BOOST_ASIO_NO_EXCEPTIONS)
bool switched = (co_await awaitable_thread_has_context_switched{});
if (!switched)
diff --git a/contrib/restricted/boost/asio/include/boost/asio/impl/connect.hpp b/contrib/restricted/boost/asio/include/boost/asio/impl/connect.hpp
index 29138f648b5..ab06b04c884 100644
--- a/contrib/restricted/boost/asio/include/boost/asio/impl/connect.hpp
+++ b/contrib/restricted/boost/asio/include/boost/asio/impl/connect.hpp
@@ -35,15 +35,6 @@ namespace asio {
namespace detail
{
- struct default_connect_condition
- {
- template <typename Endpoint>
- bool operator()(const boost::system::error_code&, const Endpoint&)
- {
- return true;
- }
- };
-
template <typename Protocol, typename Iterator>
inline typename Protocol::endpoint deref_connect_result(
Iterator iter, boost::system::error_code& ec)
@@ -51,38 +42,15 @@ namespace detail
return ec ? typename Protocol::endpoint() : *iter;
}
- template <typename T, typename Iterator>
- struct legacy_connect_condition_helper : T
- {
- typedef char (*fallback_func_type)(...);
- operator fallback_func_type() const;
- };
-
- template <typename R, typename Arg1, typename Arg2, typename Iterator>
- struct legacy_connect_condition_helper<R (*)(Arg1, Arg2), Iterator>
- {
- R operator()(Arg1, Arg2) const;
- char operator()(...) const;
- };
-
- template <typename T, typename Iterator>
- struct is_legacy_connect_condition
- {
- static char asio_connect_condition_check(char);
- static char (&asio_connect_condition_check(Iterator))[2];
-
- static const bool value =
- sizeof(asio_connect_condition_check(
- (declval<legacy_connect_condition_helper<T, Iterator>>())(
- declval<const boost::system::error_code>(),
- declval<const Iterator>()))) != 1;
- };
-
template <typename ConnectCondition, typename Iterator>
inline Iterator call_connect_condition(ConnectCondition& connect_condition,
const boost::system::error_code& ec, Iterator next, Iterator end,
- enable_if_t<is_legacy_connect_condition<
- ConnectCondition, Iterator>::value>* = 0)
+ constraint_t<
+ is_same<
+ result_of_t<ConnectCondition(boost::system::error_code, Iterator)>,
+ Iterator
+ >::value
+ > = 0)
{
if (next != end)
return connect_condition(ec, next);
@@ -92,20 +60,27 @@ namespace detail
template <typename ConnectCondition, typename Iterator>
inline Iterator call_connect_condition(ConnectCondition& connect_condition,
const boost::system::error_code& ec, Iterator next, Iterator end,
- enable_if_t<!is_legacy_connect_condition<
- ConnectCondition, Iterator>::value>* = 0)
+ constraint_t<
+ is_same<
+ result_of_t<ConnectCondition(boost::system::error_code,
+ decltype(*declval<Iterator>()))>,
+ bool
+ >::value
+ > = 0)
{
for (;next != end; ++next)
if (connect_condition(ec, *next))
return next;
return end;
}
-}
+} // namespace detail
template <typename Protocol, typename Executor, typename EndpointSequence>
typename Protocol::endpoint connect(basic_socket<Protocol, Executor>& s,
const EndpointSequence& endpoints,
- constraint_t<is_endpoint_sequence<EndpointSequence>::value>)
+ constraint_t<
+ is_endpoint_sequence<EndpointSequence>::value
+ >)
{
boost::system::error_code ec;
typename Protocol::endpoint result = connect(s, endpoints, ec);
@@ -116,7 +91,9 @@ typename Protocol::endpoint connect(basic_socket<Protocol, Executor>& s,
template <typename Protocol, typename Executor, typename EndpointSequence>
typename Protocol::endpoint connect(basic_socket<Protocol, Executor>& s,
const EndpointSequence& endpoints, boost::system::error_code& ec,
- constraint_t<is_endpoint_sequence<EndpointSequence>::value>)
+ constraint_t<
+ is_endpoint_sequence<EndpointSequence>::value
+ >)
{
return detail::deref_connect_result<Protocol>(
connect(s, endpoints.begin(), endpoints.end(),
@@ -126,7 +103,9 @@ typename Protocol::endpoint connect(basic_socket<Protocol, Executor>& s,
#if !defined(BOOST_ASIO_NO_DEPRECATED)
template <typename Protocol, typename Executor, typename Iterator>
Iterator connect(basic_socket<Protocol, Executor>& s, Iterator begin,
- constraint_t<!is_endpoint_sequence<Iterator>::value>)
+ constraint_t<
+ !is_endpoint_sequence<Iterator>::value
+ >)
{
boost::system::error_code ec;
Iterator result = connect(s, begin, ec);
@@ -137,7 +116,9 @@ Iterator connect(basic_socket<Protocol, Executor>& s, Iterator begin,
template <typename Protocol, typename Executor, typename Iterator>
inline Iterator connect(basic_socket<Protocol, Executor>& s,
Iterator begin, boost::system::error_code& ec,
- constraint_t<!is_endpoint_sequence<Iterator>::value>)
+ constraint_t<
+ !is_endpoint_sequence<Iterator>::value
+ >)
{
return connect(s, begin, Iterator(), detail::default_connect_condition(), ec);
}
@@ -164,7 +145,13 @@ template <typename Protocol, typename Executor,
typename EndpointSequence, typename ConnectCondition>
typename Protocol::endpoint connect(basic_socket<Protocol, Executor>& s,
const EndpointSequence& endpoints, ConnectCondition connect_condition,
- constraint_t<is_endpoint_sequence<EndpointSequence>::value>)
+ constraint_t<
+ is_endpoint_sequence<EndpointSequence>::value
+ >,
+ constraint_t<
+ is_connect_condition<ConnectCondition,
+ decltype(declval<const EndpointSequence&>().begin())>::value
+ >)
{
boost::system::error_code ec;
typename Protocol::endpoint result = connect(
@@ -178,7 +165,13 @@ template <typename Protocol, typename Executor,
typename Protocol::endpoint connect(basic_socket<Protocol, Executor>& s,
const EndpointSequence& endpoints, ConnectCondition connect_condition,
boost::system::error_code& ec,
- constraint_t<is_endpoint_sequence<EndpointSequence>::value>)
+ constraint_t<
+ is_endpoint_sequence<EndpointSequence>::value
+ >,
+ constraint_t<
+ is_connect_condition<ConnectCondition,
+ decltype(declval<const EndpointSequence&>().begin())>::value
+ >)
{
return detail::deref_connect_result<Protocol>(
connect(s, endpoints.begin(), endpoints.end(),
@@ -190,7 +183,12 @@ template <typename Protocol, typename Executor,
typename Iterator, typename ConnectCondition>
Iterator connect(basic_socket<Protocol, Executor>& s,
Iterator begin, ConnectCondition connect_condition,
- constraint_t<!is_endpoint_sequence<Iterator>::value>)
+ constraint_t<
+ !is_endpoint_sequence<Iterator>::value
+ >,
+ constraint_t<
+ is_connect_condition<ConnectCondition, Iterator>::value
+ >)
{
boost::system::error_code ec;
Iterator result = connect(s, begin, connect_condition, ec);
@@ -203,7 +201,12 @@ template <typename Protocol, typename Executor,
inline Iterator connect(basic_socket<Protocol, Executor>& s,
Iterator begin, ConnectCondition connect_condition,
boost::system::error_code& ec,
- constraint_t<!is_endpoint_sequence<Iterator>::value>)
+ constraint_t<
+ !is_endpoint_sequence<Iterator>::value
+ >,
+ constraint_t<
+ is_connect_condition<ConnectCondition, Iterator>::value
+ >)
{
return connect(s, begin, Iterator(), connect_condition, ec);
}
@@ -212,7 +215,10 @@ inline Iterator connect(basic_socket<Protocol, Executor>& s,
template <typename Protocol, typename Executor,
typename Iterator, typename ConnectCondition>
Iterator connect(basic_socket<Protocol, Executor>& s, Iterator begin,
- Iterator end, ConnectCondition connect_condition)
+ Iterator end, ConnectCondition connect_condition,
+ constraint_t<
+ is_connect_condition<ConnectCondition, Iterator>::value
+ >)
{
boost::system::error_code ec;
Iterator result = connect(s, begin, end, connect_condition, ec);
@@ -224,7 +230,10 @@ template <typename Protocol, typename Executor,
typename Iterator, typename ConnectCondition>
Iterator connect(basic_socket<Protocol, Executor>& s, Iterator begin,
Iterator end, ConnectCondition connect_condition,
- boost::system::error_code& ec)
+ boost::system::error_code& ec,
+ constraint_t<
+ is_connect_condition<ConnectCondition, Iterator>::value
+ >)
{
ec = boost::system::error_code();
@@ -688,121 +697,6 @@ struct associator<Associator,
#endif // !defined(GENERATING_DOCUMENTATION)
-template <typename Protocol, typename Executor, typename EndpointSequence,
- BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
- typename Protocol::endpoint)) RangeConnectToken>
-inline auto async_connect(basic_socket<Protocol, Executor>& s,
- const EndpointSequence& endpoints, RangeConnectToken&& token,
- constraint_t<is_endpoint_sequence<EndpointSequence>::value>)
- -> decltype(
- async_initiate<RangeConnectToken,
- void (boost::system::error_code, typename Protocol::endpoint)>(
- declval<detail::initiate_async_range_connect<Protocol, Executor>>(),
- token, endpoints, declval<detail::default_connect_condition>()))
-{
- return async_initiate<RangeConnectToken,
- void (boost::system::error_code, typename Protocol::endpoint)>(
- detail::initiate_async_range_connect<Protocol, Executor>(s),
- token, endpoints, detail::default_connect_condition());
-}
-
-#if !defined(BOOST_ASIO_NO_DEPRECATED)
-template <typename Protocol, typename Executor, typename Iterator,
- BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
- Iterator)) IteratorConnectToken>
-inline auto async_connect(basic_socket<Protocol, Executor>& s,
- Iterator begin, IteratorConnectToken&& token,
- constraint_t<!is_endpoint_sequence<Iterator>::value>)
- -> decltype(
- async_initiate<IteratorConnectToken,
- void (boost::system::error_code, Iterator)>(
- declval<detail::initiate_async_iterator_connect<Protocol, Executor>>(),
- token, begin, Iterator(), declval<detail::default_connect_condition>()))
-{
- return async_initiate<IteratorConnectToken,
- void (boost::system::error_code, Iterator)>(
- detail::initiate_async_iterator_connect<Protocol, Executor>(s),
- token, begin, Iterator(), detail::default_connect_condition());
-}
-#endif // !defined(BOOST_ASIO_NO_DEPRECATED)
-
-template <typename Protocol, typename Executor, typename Iterator,
- BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
- Iterator)) IteratorConnectToken>
-inline auto async_connect(basic_socket<Protocol, Executor>& s,
- Iterator begin, Iterator end, IteratorConnectToken&& token)
- -> decltype(
- async_initiate<IteratorConnectToken,
- void (boost::system::error_code, Iterator)>(
- declval<detail::initiate_async_iterator_connect<Protocol, Executor>>(),
- token, begin, end, declval<detail::default_connect_condition>()))
-{
- return async_initiate<IteratorConnectToken,
- void (boost::system::error_code, Iterator)>(
- detail::initiate_async_iterator_connect<Protocol, Executor>(s),
- token, begin, end, detail::default_connect_condition());
-}
-
-template <typename Protocol, typename Executor,
- typename EndpointSequence, typename ConnectCondition,
- BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
- typename Protocol::endpoint)) RangeConnectToken>
-inline auto async_connect(basic_socket<Protocol, Executor>& s,
- const EndpointSequence& endpoints, ConnectCondition connect_condition,
- RangeConnectToken&& token,
- constraint_t<is_endpoint_sequence<EndpointSequence>::value>)
- -> decltype(
- async_initiate<RangeConnectToken,
- void (boost::system::error_code, typename Protocol::endpoint)>(
- declval<detail::initiate_async_range_connect<Protocol, Executor>>(),
- token, endpoints, connect_condition))
-{
- return async_initiate<RangeConnectToken,
- void (boost::system::error_code, typename Protocol::endpoint)>(
- detail::initiate_async_range_connect<Protocol, Executor>(s),
- token, endpoints, connect_condition);
-}
-
-#if !defined(BOOST_ASIO_NO_DEPRECATED)
-template <typename Protocol, typename Executor,
- typename Iterator, typename ConnectCondition,
- BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
- Iterator)) IteratorConnectToken>
-inline auto async_connect(basic_socket<Protocol, Executor>& s, Iterator begin,
- ConnectCondition connect_condition, IteratorConnectToken&& token,
- constraint_t<!is_endpoint_sequence<Iterator>::value>)
- -> decltype(
- async_initiate<IteratorConnectToken,
- void (boost::system::error_code, Iterator)>(
- declval<detail::initiate_async_iterator_connect<Protocol, Executor>>(),
- token, begin, Iterator(), connect_condition))
-{
- return async_initiate<IteratorConnectToken,
- void (boost::system::error_code, Iterator)>(
- detail::initiate_async_iterator_connect<Protocol, Executor>(s),
- token, begin, Iterator(), connect_condition);
-}
-#endif // !defined(BOOST_ASIO_NO_DEPRECATED)
-
-template <typename Protocol, typename Executor,
- typename Iterator, typename ConnectCondition,
- BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
- Iterator)) IteratorConnectToken>
-inline auto async_connect(basic_socket<Protocol, Executor>& s,
- Iterator begin, Iterator end, ConnectCondition connect_condition,
- IteratorConnectToken&& token)
- -> decltype(
- async_initiate<IteratorConnectToken,
- void (boost::system::error_code, Iterator)>(
- declval<detail::initiate_async_iterator_connect<Protocol, Executor>>(),
- token, begin, end, connect_condition))
-{
- return async_initiate<IteratorConnectToken,
- void (boost::system::error_code, Iterator)>(
- detail::initiate_async_iterator_connect<Protocol, Executor>(s),
- token, begin, end, connect_condition);
-}
-
} // namespace asio
} // namespace boost
diff --git a/contrib/restricted/boost/asio/include/boost/asio/impl/consign.hpp b/contrib/restricted/boost/asio/include/boost/asio/impl/consign.hpp
index 59e977d5450..03942963c68 100644
--- a/contrib/restricted/boost/asio/include/boost/asio/impl/consign.hpp
+++ b/contrib/restricted/boost/asio/include/boost/asio/impl/consign.hpp
@@ -19,6 +19,7 @@
#include <boost/asio/associator.hpp>
#include <boost/asio/async_result.hpp>
#include <boost/asio/detail/handler_cont_helpers.hpp>
+#include <boost/asio/detail/initiation_base.hpp>
#include <boost/asio/detail/type_traits.hpp>
#include <boost/asio/detail/utility.hpp>
@@ -70,25 +71,31 @@ struct async_result<consign_t<CompletionToken, Values...>, Signatures...>
: async_result<CompletionToken, Signatures...>
{
template <typename Initiation>
- struct init_wrapper
+ struct init_wrapper : detail::initiation_base<Initiation>
{
- init_wrapper(Initiation init)
- : initiation_(static_cast<Initiation&&>(init))
+ using detail::initiation_base<Initiation>::initiation_base;
+
+ template <typename Handler, typename... Args>
+ void operator()(Handler&& handler,
+ std::tuple<Values...> values, Args&&... args) &&
{
+ static_cast<Initiation&&>(*this)(
+ detail::consign_handler<decay_t<Handler>, Values...>(
+ static_cast<Handler&&>(handler),
+ static_cast<std::tuple<Values...>&&>(values)),
+ static_cast<Args&&>(args)...);
}
template <typename Handler, typename... Args>
void operator()(Handler&& handler,
- std::tuple<Values...> values, Args&&... args)
+ std::tuple<Values...> values, Args&&... args) const &
{
- static_cast<Initiation&&>(initiation_)(
+ static_cast<const Initiation&>(*this)(
detail::consign_handler<decay_t<Handler>, Values...>(
static_cast<Handler&&>(handler),
static_cast<std::tuple<Values...>&&>(values)),
static_cast<Args&&>(args)...);
}
-
- Initiation initiation_;
};
template <typename Initiation, typename RawCompletionToken, typename... Args>
diff --git a/contrib/restricted/boost/asio/include/boost/asio/impl/detached.hpp b/contrib/restricted/boost/asio/include/boost/asio/impl/detached.hpp
index 8fdcfc6d549..2ad31cb29bf 100644
--- a/contrib/restricted/boost/asio/include/boost/asio/impl/detached.hpp
+++ b/contrib/restricted/boost/asio/include/boost/asio/impl/detached.hpp
@@ -44,8 +44,8 @@ namespace detail {
#if !defined(GENERATING_DOCUMENTATION)
-template <typename Signature>
-struct async_result<detached_t, Signature>
+template <typename... Signatures>
+struct async_result<detached_t, Signatures...>
{
typedef boost::asio::detail::detached_handler completion_handler_type;
diff --git a/contrib/restricted/boost/asio/include/boost/asio/impl/prepend.hpp b/contrib/restricted/boost/asio/include/boost/asio/impl/prepend.hpp
index 841fb890943..7db1bf2f1b9 100644
--- a/contrib/restricted/boost/asio/include/boost/asio/impl/prepend.hpp
+++ b/contrib/restricted/boost/asio/include/boost/asio/impl/prepend.hpp
@@ -19,6 +19,7 @@
#include <boost/asio/associator.hpp>
#include <boost/asio/async_result.hpp>
#include <boost/asio/detail/handler_cont_helpers.hpp>
+#include <boost/asio/detail/initiation_base.hpp>
#include <boost/asio/detail/type_traits.hpp>
#include <boost/asio/detail/utility.hpp>
@@ -95,25 +96,31 @@ struct async_result<
Signature, Values...>::type signature;
template <typename Initiation>
- struct init_wrapper
+ struct init_wrapper : detail::initiation_base<Initiation>
{
- init_wrapper(Initiation init)
- : initiation_(static_cast<Initiation&&>(init))
+ using detail::initiation_base<Initiation>::initiation_base;
+
+ template <typename Handler, typename... Args>
+ void operator()(Handler&& handler,
+ std::tuple<Values...> values, Args&&... args) &&
{
+ static_cast<Initiation&&>(*this)(
+ detail::prepend_handler<decay_t<Handler>, Values...>(
+ static_cast<Handler&&>(handler),
+ static_cast<std::tuple<Values...>&&>(values)),
+ static_cast<Args&&>(args)...);
}
template <typename Handler, typename... Args>
void operator()(Handler&& handler,
- std::tuple<Values...> values, Args&&... args)
+ std::tuple<Values...> values, Args&&... args) const &
{
- static_cast<Initiation&&>(initiation_)(
+ static_cast<const Initiation&>(*this)(
detail::prepend_handler<decay_t<Handler>, Values...>(
static_cast<Handler&&>(handler),
static_cast<std::tuple<Values...>&&>(values)),
static_cast<Args&&>(args)...);
}
-
- Initiation initiation_;
};
template <typename Initiation, typename RawCompletionToken, typename... Args>
diff --git a/contrib/restricted/boost/asio/include/boost/asio/impl/read.hpp b/contrib/restricted/boost/asio/include/boost/asio/impl/read.hpp
index 28465873989..9b05a671fbe 100644
--- a/contrib/restricted/boost/asio/include/boost/asio/impl/read.hpp
+++ b/contrib/restricted/boost/asio/include/boost/asio/impl/read.hpp
@@ -65,6 +65,9 @@ std::size_t read(SyncReadStream& s, const MutableBufferSequence& buffers,
CompletionCondition completion_condition, boost::system::error_code& ec,
constraint_t<
is_mutable_buffer_sequence<MutableBufferSequence>::value
+ >,
+ constraint_t<
+ is_completion_condition<CompletionCondition>::value
>)
{
return detail::read_buffer_seq(s, buffers,
@@ -100,6 +103,9 @@ inline std::size_t read(SyncReadStream& s, const MutableBufferSequence& buffers,
CompletionCondition completion_condition,
constraint_t<
is_mutable_buffer_sequence<MutableBufferSequence>::value
+ >,
+ constraint_t<
+ is_completion_condition<CompletionCondition>::value
>)
{
boost::system::error_code ec;
@@ -121,6 +127,9 @@ std::size_t read(SyncReadStream& s,
>,
constraint_t<
!is_dynamic_buffer_v2<decay_t<DynamicBuffer_v1>>::value
+ >,
+ constraint_t<
+ is_completion_condition<CompletionCondition>::value
>)
{
decay_t<DynamicBuffer_v1> b(
@@ -189,6 +198,9 @@ inline std::size_t read(SyncReadStream& s,
>,
constraint_t<
!is_dynamic_buffer_v2<decay_t<DynamicBuffer_v1>>::value
+ >,
+ constraint_t<
+ is_completion_condition<CompletionCondition>::value
>)
{
boost::system::error_code ec;
@@ -206,7 +218,10 @@ template <typename SyncReadStream, typename Allocator,
typename CompletionCondition>
inline std::size_t read(SyncReadStream& s,
boost::asio::basic_streambuf<Allocator>& b,
- CompletionCondition completion_condition, boost::system::error_code& ec)
+ CompletionCondition completion_condition, boost::system::error_code& ec,
+ constraint_t<
+ is_completion_condition<CompletionCondition>::value
+ >)
{
return read(s, basic_streambuf_ref<Allocator>(b),
static_cast<CompletionCondition&&>(completion_condition), ec);
@@ -231,7 +246,10 @@ template <typename SyncReadStream, typename Allocator,
typename CompletionCondition>
inline std::size_t read(SyncReadStream& s,
boost::asio::basic_streambuf<Allocator>& b,
- CompletionCondition completion_condition)
+ CompletionCondition completion_condition,
+ constraint_t<
+ is_completion_condition<CompletionCondition>::value
+ >)
{
return read(s, basic_streambuf_ref<Allocator>(b),
static_cast<CompletionCondition&&>(completion_condition));
@@ -247,6 +265,9 @@ std::size_t read(SyncReadStream& s, DynamicBuffer_v2 buffers,
CompletionCondition completion_condition, boost::system::error_code& ec,
constraint_t<
is_dynamic_buffer_v2<DynamicBuffer_v2>::value
+ >,
+ constraint_t<
+ is_completion_condition<CompletionCondition>::value
>)
{
DynamicBuffer_v2& b = buffers;
@@ -305,6 +326,9 @@ inline std::size_t read(SyncReadStream& s, DynamicBuffer_v2 buffers,
CompletionCondition completion_condition,
constraint_t<
is_dynamic_buffer_v2<DynamicBuffer_v2>::value
+ >,
+ constraint_t<
+ is_completion_condition<CompletionCondition>::value
>)
{
boost::system::error_code ec;
@@ -498,47 +522,6 @@ struct associator<Associator,
#endif // !defined(GENERATING_DOCUMENTATION)
-template <typename AsyncReadStream,
- typename MutableBufferSequence, typename CompletionCondition,
- BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
- std::size_t)) ReadToken>
-inline auto async_read(AsyncReadStream& s, const MutableBufferSequence& buffers,
- CompletionCondition completion_condition, ReadToken&& token,
- constraint_t<
- is_mutable_buffer_sequence<MutableBufferSequence>::value
- >)
- -> decltype(
- async_initiate<ReadToken,
- void (boost::system::error_code, std::size_t)>(
- declval<detail::initiate_async_read<AsyncReadStream>>(), token, buffers,
- static_cast<CompletionCondition&&>(completion_condition)))
-{
- return async_initiate<ReadToken,
- void (boost::system::error_code, std::size_t)>(
- detail::initiate_async_read<AsyncReadStream>(s), token, buffers,
- static_cast<CompletionCondition&&>(completion_condition));
-}
-
-template <typename AsyncReadStream, typename MutableBufferSequence,
- BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
- std::size_t)) ReadToken>
-inline auto async_read(AsyncReadStream& s,
- const MutableBufferSequence& buffers, ReadToken&& token,
- constraint_t<
- is_mutable_buffer_sequence<MutableBufferSequence>::value
- >)
- -> decltype(
- async_initiate<ReadToken,
- void (boost::system::error_code, std::size_t)>(
- declval<detail::initiate_async_read<AsyncReadStream>>(),
- token, buffers, transfer_all()))
-{
- return async_initiate<ReadToken,
- void (boost::system::error_code, std::size_t)>(
- detail::initiate_async_read<AsyncReadStream>(s),
- token, buffers, transfer_all());
-}
-
#if !defined(BOOST_ASIO_NO_DYNAMIC_BUFFER_V1)
namespace detail
@@ -723,97 +706,6 @@ struct associator<Associator,
#endif // !defined(GENERATING_DOCUMENTATION)
-template <typename AsyncReadStream, typename DynamicBuffer_v1,
- BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
- std::size_t)) ReadToken>
-inline auto async_read(AsyncReadStream& s,
- DynamicBuffer_v1&& buffers, ReadToken&& token,
- constraint_t<
- is_dynamic_buffer_v1<decay_t<DynamicBuffer_v1>>::value
- >,
- constraint_t<
- !is_dynamic_buffer_v2<decay_t<DynamicBuffer_v1>>::value
- >)
- -> decltype(
- async_initiate<ReadToken,
- void (boost::system::error_code, std::size_t)>(
- declval<detail::initiate_async_read_dynbuf_v1<AsyncReadStream>>(),
- token, static_cast<DynamicBuffer_v1&&>(buffers), transfer_all()))
-{
- return async_initiate<ReadToken,
- void (boost::system::error_code, std::size_t)>(
- detail::initiate_async_read_dynbuf_v1<AsyncReadStream>(s),
- token, static_cast<DynamicBuffer_v1&&>(buffers), transfer_all());
-}
-
-template <typename AsyncReadStream,
- typename DynamicBuffer_v1, typename CompletionCondition,
- BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
- std::size_t)) ReadToken>
-inline auto async_read(AsyncReadStream& s, DynamicBuffer_v1&& buffers,
- CompletionCondition completion_condition, ReadToken&& token,
- constraint_t<
- is_dynamic_buffer_v1<decay_t<DynamicBuffer_v1>>::value
- >,
- constraint_t<
- !is_dynamic_buffer_v2<decay_t<DynamicBuffer_v1>>::value
- >)
- -> decltype(
- async_initiate<ReadToken,
- void (boost::system::error_code, std::size_t)>(
- declval<detail::initiate_async_read_dynbuf_v1<AsyncReadStream>>(),
- token, static_cast<DynamicBuffer_v1&&>(buffers),
- static_cast<CompletionCondition&&>(completion_condition)))
-{
- return async_initiate<ReadToken,
- void (boost::system::error_code, std::size_t)>(
- detail::initiate_async_read_dynbuf_v1<AsyncReadStream>(s),
- token, static_cast<DynamicBuffer_v1&&>(buffers),
- static_cast<CompletionCondition&&>(completion_condition));
-}
-
-#if !defined(BOOST_ASIO_NO_EXTENSIONS)
-#if !defined(BOOST_ASIO_NO_IOSTREAM)
-
-template <typename AsyncReadStream, typename Allocator,
- BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
- std::size_t)) ReadToken>
-inline auto async_read(AsyncReadStream& s,
- basic_streambuf<Allocator>& b, ReadToken&& token)
- -> decltype(
- async_initiate<ReadToken,
- void (boost::system::error_code, std::size_t)>(
- declval<detail::initiate_async_read_dynbuf_v1<AsyncReadStream>>(),
- token, basic_streambuf_ref<Allocator>(b), transfer_all()))
-{
- return async_initiate<ReadToken,
- void (boost::system::error_code, std::size_t)>(
- detail::initiate_async_read_dynbuf_v1<AsyncReadStream>(s),
- token, basic_streambuf_ref<Allocator>(b), transfer_all());
-}
-
-template <typename AsyncReadStream,
- typename Allocator, typename CompletionCondition,
- BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
- std::size_t)) ReadToken>
-inline auto async_read(AsyncReadStream& s, basic_streambuf<Allocator>& b,
- CompletionCondition completion_condition, ReadToken&& token)
- -> decltype(
- async_initiate<ReadToken,
- void (boost::system::error_code, std::size_t)>(
- declval<detail::initiate_async_read_dynbuf_v1<AsyncReadStream>>(),
- token, basic_streambuf_ref<Allocator>(b),
- static_cast<CompletionCondition&&>(completion_condition)))
-{
- return async_initiate<ReadToken,
- void (boost::system::error_code, std::size_t)>(
- detail::initiate_async_read_dynbuf_v1<AsyncReadStream>(s),
- token, basic_streambuf_ref<Allocator>(b),
- static_cast<CompletionCondition&&>(completion_condition));
-}
-
-#endif // !defined(BOOST_ASIO_NO_IOSTREAM)
-#endif // !defined(BOOST_ASIO_NO_EXTENSIONS)
#endif // !defined(BOOST_ASIO_NO_DYNAMIC_BUFFER_V1)
namespace detail
@@ -1004,49 +896,6 @@ struct associator<Associator,
#endif // !defined(GENERATING_DOCUMENTATION)
-template <typename AsyncReadStream, typename DynamicBuffer_v2,
- BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
- std::size_t)) ReadToken>
-inline auto async_read(AsyncReadStream& s,
- DynamicBuffer_v2 buffers, ReadToken&& token,
- constraint_t<
- is_dynamic_buffer_v2<DynamicBuffer_v2>::value
- >)
- -> decltype(
- async_initiate<ReadToken,
- void (boost::system::error_code, std::size_t)>(
- declval<detail::initiate_async_read_dynbuf_v2<AsyncReadStream>>(),
- token, static_cast<DynamicBuffer_v2&&>(buffers), transfer_all()))
-{
- return async_initiate<ReadToken,
- void (boost::system::error_code, std::size_t)>(
- detail::initiate_async_read_dynbuf_v2<AsyncReadStream>(s),
- token, static_cast<DynamicBuffer_v2&&>(buffers), transfer_all());
-}
-
-template <typename AsyncReadStream,
- typename DynamicBuffer_v2, typename CompletionCondition,
- BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
- std::size_t)) ReadToken>
-inline auto async_read(AsyncReadStream& s, DynamicBuffer_v2 buffers,
- CompletionCondition completion_condition, ReadToken&& token,
- constraint_t<
- is_dynamic_buffer_v2<DynamicBuffer_v2>::value
- >)
- -> decltype(
- async_initiate<ReadToken,
- void (boost::system::error_code, std::size_t)>(
- declval<detail::initiate_async_read_dynbuf_v2<AsyncReadStream>>(),
- token, static_cast<DynamicBuffer_v2&&>(buffers),
- static_cast<CompletionCondition&&>(completion_condition)))
-{
- return async_initiate<ReadToken,
- void (boost::system::error_code, std::size_t)>(
- detail::initiate_async_read_dynbuf_v2<AsyncReadStream>(s),
- token, static_cast<DynamicBuffer_v2&&>(buffers),
- static_cast<CompletionCondition&&>(completion_condition));
-}
-
} // namespace asio
} // namespace boost
diff --git a/contrib/restricted/boost/asio/include/boost/asio/impl/read_at.hpp b/contrib/restricted/boost/asio/include/boost/asio/impl/read_at.hpp
index 77246f39c72..44cc717d3de 100644
--- a/contrib/restricted/boost/asio/include/boost/asio/impl/read_at.hpp
+++ b/contrib/restricted/boost/asio/include/boost/asio/impl/read_at.hpp
@@ -67,7 +67,10 @@ template <typename SyncRandomAccessReadDevice, typename MutableBufferSequence,
typename CompletionCondition>
std::size_t read_at(SyncRandomAccessReadDevice& d,
uint64_t offset, const MutableBufferSequence& buffers,
- CompletionCondition completion_condition, boost::system::error_code& ec)
+ CompletionCondition completion_condition, boost::system::error_code& ec,
+ constraint_t<
+ is_completion_condition<CompletionCondition>::value
+ >)
{
return detail::read_at_buffer_sequence(d, offset, buffers,
boost::asio::buffer_sequence_begin(buffers),
@@ -97,7 +100,10 @@ template <typename SyncRandomAccessReadDevice, typename MutableBufferSequence,
typename CompletionCondition>
inline std::size_t read_at(SyncRandomAccessReadDevice& d,
uint64_t offset, const MutableBufferSequence& buffers,
- CompletionCondition completion_condition)
+ CompletionCondition completion_condition,
+ constraint_t<
+ is_completion_condition<CompletionCondition>::value
+ >)
{
boost::system::error_code ec;
std::size_t bytes_transferred = read_at(d, offset, buffers,
@@ -113,7 +119,10 @@ template <typename SyncRandomAccessReadDevice, typename Allocator,
typename CompletionCondition>
std::size_t read_at(SyncRandomAccessReadDevice& d,
uint64_t offset, boost::asio::basic_streambuf<Allocator>& b,
- CompletionCondition completion_condition, boost::system::error_code& ec)
+ CompletionCondition completion_condition, boost::system::error_code& ec,
+ constraint_t<
+ is_completion_condition<CompletionCondition>::value
+ >)
{
ec = boost::system::error_code();
std::size_t total_transferred = 0;
@@ -156,7 +165,10 @@ template <typename SyncRandomAccessReadDevice, typename Allocator,
typename CompletionCondition>
inline std::size_t read_at(SyncRandomAccessReadDevice& d,
uint64_t offset, boost::asio::basic_streambuf<Allocator>& b,
- CompletionCondition completion_condition)
+ CompletionCondition completion_condition,
+ constraint_t<
+ is_completion_condition<CompletionCondition>::value
+ >)
{
boost::system::error_code ec;
std::size_t bytes_transferred = read_at(d, offset, b,
@@ -360,44 +372,6 @@ struct associator<Associator,
#endif // !defined(GENERATING_DOCUMENTATION)
-template <typename AsyncRandomAccessReadDevice,
- typename MutableBufferSequence, typename CompletionCondition,
- BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
- std::size_t)) ReadToken>
-inline auto async_read_at(AsyncRandomAccessReadDevice& d,
- uint64_t offset, const MutableBufferSequence& buffers,
- CompletionCondition completion_condition, ReadToken&& token)
- -> decltype(
- async_initiate<ReadToken,
- void (boost::system::error_code, std::size_t)>(
- declval<detail::initiate_async_read_at<AsyncRandomAccessReadDevice>>(),
- token, offset, buffers,
- static_cast<CompletionCondition&&>(completion_condition)))
-{
- return async_initiate<ReadToken,
- void (boost::system::error_code, std::size_t)>(
- detail::initiate_async_read_at<AsyncRandomAccessReadDevice>(d),
- token, offset, buffers,
- static_cast<CompletionCondition&&>(completion_condition));
-}
-
-template <typename AsyncRandomAccessReadDevice, typename MutableBufferSequence,
- BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
- std::size_t)) ReadToken>
-inline auto async_read_at(AsyncRandomAccessReadDevice& d,
- uint64_t offset, const MutableBufferSequence& buffers, ReadToken&& token)
- -> decltype(
- async_initiate<ReadToken,
- void (boost::system::error_code, std::size_t)>(
- declval<detail::initiate_async_read_at<AsyncRandomAccessReadDevice>>(),
- token, offset, buffers, transfer_all()))
-{
- return async_initiate<ReadToken,
- void (boost::system::error_code, std::size_t)>(
- detail::initiate_async_read_at<AsyncRandomAccessReadDevice>(d),
- token, offset, buffers, transfer_all());
-}
-
#if !defined(BOOST_ASIO_NO_EXTENSIONS)
#if !defined(BOOST_ASIO_NO_IOSTREAM)
@@ -579,46 +553,6 @@ struct associator<Associator,
#endif // !defined(GENERATING_DOCUMENTATION)
-template <typename AsyncRandomAccessReadDevice,
- typename Allocator, typename CompletionCondition,
- BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
- std::size_t)) ReadToken>
-inline auto async_read_at(AsyncRandomAccessReadDevice& d,
- uint64_t offset, boost::asio::basic_streambuf<Allocator>& b,
- CompletionCondition completion_condition, ReadToken&& token)
- -> decltype(
- async_initiate<ReadToken,
- void (boost::system::error_code, std::size_t)>(
- declval<detail::initiate_async_read_at_streambuf<
- AsyncRandomAccessReadDevice>>(),
- token, offset, &b,
- static_cast<CompletionCondition&&>(completion_condition)))
-{
- return async_initiate<ReadToken,
- void (boost::system::error_code, std::size_t)>(
- detail::initiate_async_read_at_streambuf<AsyncRandomAccessReadDevice>(d),
- token, offset, &b,
- static_cast<CompletionCondition&&>(completion_condition));
-}
-
-template <typename AsyncRandomAccessReadDevice, typename Allocator,
- BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
- std::size_t)) ReadToken>
-inline auto async_read_at(AsyncRandomAccessReadDevice& d, uint64_t offset,
- boost::asio::basic_streambuf<Allocator>& b, ReadToken&& token)
- -> decltype(
- async_initiate<ReadToken,
- void (boost::system::error_code, std::size_t)>(
- declval<detail::initiate_async_read_at_streambuf<
- AsyncRandomAccessReadDevice>>(),
- token, offset, &b, transfer_all()))
-{
- return async_initiate<ReadToken,
- void (boost::system::error_code, std::size_t)>(
- detail::initiate_async_read_at_streambuf<AsyncRandomAccessReadDevice>(d),
- token, offset, &b, transfer_all());
-}
-
#endif // !defined(BOOST_ASIO_NO_IOSTREAM)
#endif // !defined(BOOST_ASIO_NO_EXTENSIONS)
diff --git a/contrib/restricted/boost/asio/include/boost/asio/impl/read_until.hpp b/contrib/restricted/boost/asio/include/boost/asio/impl/read_until.hpp
index 322c9d1d86f..08e51ecc486 100644
--- a/contrib/restricted/boost/asio/include/boost/asio/impl/read_until.hpp
+++ b/contrib/restricted/boost/asio/include/boost/asio/impl/read_until.hpp
@@ -69,6 +69,19 @@ namespace detail
}
return std::make_pair(last1, false);
}
+
+#if !defined(BOOST_ASIO_NO_EXTENSIONS)
+#if defined(BOOST_ASIO_HAS_BOOST_REGEX)
+ struct regex_match_flags
+ {
+ template <typename T>
+ operator T() const
+ {
+ return T::match_default | T::match_partial;
+ }
+ };
+#endif // !defined(BOOST_ASIO_NO_EXTENSIONS)
+#endif // defined(BOOST_ASIO_HAS_BOOST_REGEX)
} // namespace detail
#if !defined(BOOST_ASIO_NO_DYNAMIC_BUFFER_V1)
@@ -232,19 +245,6 @@ std::size_t read_until(SyncReadStream& s,
#if !defined(BOOST_ASIO_NO_EXTENSIONS)
#if defined(BOOST_ASIO_HAS_BOOST_REGEX)
-namespace detail {
-
-struct regex_match_flags
-{
- template <typename T>
- operator T() const
- {
- return T::match_default | T::match_partial;
- }
-};
-
-} // namespace detail
-
template <typename SyncReadStream, typename DynamicBuffer_v1, typename Traits>
inline std::size_t read_until(SyncReadStream& s, DynamicBuffer_v1&& buffers,
const boost::basic_regex<char, Traits>& expr,
@@ -1029,29 +1029,6 @@ struct associator<Associator,
#endif // !defined(GENERATING_DOCUMENTATION)
-template <typename AsyncReadStream, typename DynamicBuffer_v1,
- BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
- std::size_t)) ReadToken>
-inline auto async_read_until(AsyncReadStream& s,
- DynamicBuffer_v1&& buffers, char delim, ReadToken&& token,
- constraint_t<
- is_dynamic_buffer_v1<decay_t<DynamicBuffer_v1>>::value
- >,
- constraint_t<
- !is_dynamic_buffer_v2<decay_t<DynamicBuffer_v1>>::value
- >)
- -> decltype(
- async_initiate<ReadToken,
- void (boost::system::error_code, std::size_t)>(
- declval<detail::initiate_async_read_until_delim_v1<AsyncReadStream>>(),
- token, static_cast<DynamicBuffer_v1&&>(buffers), delim))
-{
- return async_initiate<ReadToken,
- void (boost::system::error_code, std::size_t)>(
- detail::initiate_async_read_until_delim_v1<AsyncReadStream>(s),
- token, static_cast<DynamicBuffer_v1&&>(buffers), delim);
-}
-
namespace detail
{
template <typename AsyncReadStream,
@@ -1280,32 +1257,6 @@ struct associator<Associator,
#endif // !defined(GENERATING_DOCUMENTATION)
-template <typename AsyncReadStream, typename DynamicBuffer_v1,
- BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
- std::size_t)) ReadToken>
-inline auto async_read_until(AsyncReadStream& s, DynamicBuffer_v1&& buffers,
- BOOST_ASIO_STRING_VIEW_PARAM delim, ReadToken&& token,
- constraint_t<
- is_dynamic_buffer_v1<decay_t<DynamicBuffer_v1>>::value
- >,
- constraint_t<
- !is_dynamic_buffer_v2<decay_t<DynamicBuffer_v1>>::value
- >)
- -> decltype(
- async_initiate<ReadToken,
- void (boost::system::error_code, std::size_t)>(
- declval<detail::initiate_async_read_until_delim_string_v1<
- AsyncReadStream>>(),
- token, static_cast<DynamicBuffer_v1&&>(buffers),
- static_cast<std::string>(delim)))
-{
- return async_initiate<ReadToken,
- void (boost::system::error_code, std::size_t)>(
- detail::initiate_async_read_until_delim_string_v1<AsyncReadStream>(s),
- token, static_cast<DynamicBuffer_v1&&>(buffers),
- static_cast<std::string>(delim));
-}
-
#if !defined(BOOST_ASIO_NO_EXTENSIONS)
#if defined(BOOST_ASIO_HAS_BOOST_REGEX)
@@ -1538,29 +1489,6 @@ struct associator<Associator,
#endif // !defined(GENERATING_DOCUMENTATION)
-template <typename AsyncReadStream, typename DynamicBuffer_v1, typename Traits,
- BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
- std::size_t)) ReadToken>
-inline auto async_read_until(AsyncReadStream& s, DynamicBuffer_v1&& buffers,
- const boost::basic_regex<char, Traits>& expr, ReadToken&& token,
- constraint_t<
- is_dynamic_buffer_v1<decay_t<DynamicBuffer_v1>>::value
- >,
- constraint_t<
- !is_dynamic_buffer_v2<decay_t<DynamicBuffer_v1>>::value
- >)
- -> decltype(
- async_initiate<ReadToken,
- void (boost::system::error_code, std::size_t)>(
- declval<detail::initiate_async_read_until_expr_v1<AsyncReadStream>>(),
- token, static_cast<DynamicBuffer_v1&&>(buffers), expr))
-{
- return async_initiate<ReadToken,
- void (boost::system::error_code, std::size_t)>(
- detail::initiate_async_read_until_expr_v1<AsyncReadStream>(s),
- token, static_cast<DynamicBuffer_v1&&>(buffers), expr);
-}
-
#endif // defined(BOOST_ASIO_HAS_BOOST_REGEX)
namespace detail
@@ -1791,117 +1719,6 @@ struct associator<Associator,
#endif // !defined(GENERATING_DOCUMENTATION)
-template <typename AsyncReadStream,
- typename DynamicBuffer_v1, typename MatchCondition,
- BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
- std::size_t)) ReadToken>
-inline auto async_read_until(AsyncReadStream& s, DynamicBuffer_v1&& buffers,
- MatchCondition match_condition, ReadToken&& token,
- constraint_t<
- is_match_condition<MatchCondition>::value
- >,
- constraint_t<
- is_dynamic_buffer_v1<decay_t<DynamicBuffer_v1>>::value
- >,
- constraint_t<
- !is_dynamic_buffer_v2<decay_t<DynamicBuffer_v1>>::value
- >)
- -> decltype(
- async_initiate<ReadToken,
- void (boost::system::error_code, std::size_t)>(
- declval<detail::initiate_async_read_until_match_v1<AsyncReadStream>>(),
- token, static_cast<DynamicBuffer_v1&&>(buffers),
- match_condition))
-{
- return async_initiate<ReadToken,
- void (boost::system::error_code, std::size_t)>(
- detail::initiate_async_read_until_match_v1<AsyncReadStream>(s),
- token, static_cast<DynamicBuffer_v1&&>(buffers),
- match_condition);
-}
-
-#if !defined(BOOST_ASIO_NO_IOSTREAM)
-
-template <typename AsyncReadStream, typename Allocator,
- BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
- std::size_t)) ReadToken>
-inline auto async_read_until(AsyncReadStream& s,
- boost::asio::basic_streambuf<Allocator>& b, char delim, ReadToken&& token)
- -> decltype(
- async_initiate<ReadToken,
- void (boost::system::error_code, std::size_t)>(
- declval<detail::initiate_async_read_until_delim_v1<AsyncReadStream>>(),
- token, basic_streambuf_ref<Allocator>(b), delim))
-{
- return async_initiate<ReadToken,
- void (boost::system::error_code, std::size_t)>(
- detail::initiate_async_read_until_delim_v1<AsyncReadStream>(s),
- token, basic_streambuf_ref<Allocator>(b), delim);
-}
-
-template <typename AsyncReadStream, typename Allocator,
- BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
- std::size_t)) ReadToken>
-inline auto async_read_until(AsyncReadStream& s,
- boost::asio::basic_streambuf<Allocator>& b,
- BOOST_ASIO_STRING_VIEW_PARAM delim, ReadToken&& token)
- -> decltype(
- async_initiate<ReadToken,
- void (boost::system::error_code, std::size_t)>(
- declval<detail::initiate_async_read_until_delim_string_v1<
- AsyncReadStream>>(),
- token, basic_streambuf_ref<Allocator>(b),
- static_cast<std::string>(delim)))
-{
- return async_initiate<ReadToken,
- void (boost::system::error_code, std::size_t)>(
- detail::initiate_async_read_until_delim_string_v1<AsyncReadStream>(s),
- token, basic_streambuf_ref<Allocator>(b),
- static_cast<std::string>(delim));
-}
-
-#if defined(BOOST_ASIO_HAS_BOOST_REGEX)
-
-template <typename AsyncReadStream, typename Allocator, typename Traits,
- BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
- std::size_t)) ReadToken>
-inline auto async_read_until(AsyncReadStream& s,
- boost::asio::basic_streambuf<Allocator>& b,
- const boost::basic_regex<char, Traits>& expr, ReadToken&& token)
- -> decltype(
- async_initiate<ReadToken,
- void (boost::system::error_code, std::size_t)>(
- declval<detail::initiate_async_read_until_expr_v1<AsyncReadStream>>(),
- token, basic_streambuf_ref<Allocator>(b), expr))
-{
- return async_initiate<ReadToken,
- void (boost::system::error_code, std::size_t)>(
- detail::initiate_async_read_until_expr_v1<AsyncReadStream>(s),
- token, basic_streambuf_ref<Allocator>(b), expr);
-}
-
-#endif // defined(BOOST_ASIO_HAS_BOOST_REGEX)
-
-template <typename AsyncReadStream, typename Allocator, typename MatchCondition,
- BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
- std::size_t)) ReadToken>
-inline auto async_read_until(AsyncReadStream& s,
- boost::asio::basic_streambuf<Allocator>& b,
- MatchCondition match_condition, ReadToken&& token,
- constraint_t<is_match_condition<MatchCondition>::value>)
- -> decltype(
- async_initiate<ReadToken,
- void (boost::system::error_code, std::size_t)>(
- declval<detail::initiate_async_read_until_match_v1<AsyncReadStream>>(),
- token, basic_streambuf_ref<Allocator>(b), match_condition))
-{
- return async_initiate<ReadToken,
- void (boost::system::error_code, std::size_t)>(
- detail::initiate_async_read_until_match_v1<AsyncReadStream>(s),
- token, basic_streambuf_ref<Allocator>(b), match_condition);
-}
-
-#endif // !defined(BOOST_ASIO_NO_IOSTREAM)
#endif // !defined(BOOST_ASIO_NO_EXTENSIONS)
#endif // !defined(BOOST_ASIO_NO_DYNAMIC_BUFFER_V1)
@@ -2129,26 +1946,6 @@ struct associator<Associator,
#endif // !defined(GENERATING_DOCUMENTATION)
-template <typename AsyncReadStream, typename DynamicBuffer_v2,
- BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
- std::size_t)) ReadToken>
-inline auto async_read_until(AsyncReadStream& s,
- DynamicBuffer_v2 buffers, char delim, ReadToken&& token,
- constraint_t<
- is_dynamic_buffer_v2<DynamicBuffer_v2>::value
- >)
- -> decltype(
- async_initiate<ReadToken,
- void (boost::system::error_code, std::size_t)>(
- declval<detail::initiate_async_read_until_delim_v2<AsyncReadStream>>(),
- token, static_cast<DynamicBuffer_v2&&>(buffers), delim))
-{
- return async_initiate<ReadToken,
- void (boost::system::error_code, std::size_t)>(
- detail::initiate_async_read_until_delim_v2<AsyncReadStream>(s),
- token, static_cast<DynamicBuffer_v2&&>(buffers), delim);
-}
-
namespace detail
{
template <typename AsyncReadStream,
@@ -2385,30 +2182,6 @@ struct associator<Associator,
#endif // !defined(GENERATING_DOCUMENTATION)
-template <typename AsyncReadStream,
- typename DynamicBuffer_v2,
- BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
- std::size_t)) ReadToken>
-inline auto async_read_until(AsyncReadStream& s, DynamicBuffer_v2 buffers,
- BOOST_ASIO_STRING_VIEW_PARAM delim, ReadToken&& token,
- constraint_t<
- is_dynamic_buffer_v2<DynamicBuffer_v2>::value
- >)
- -> decltype(
- async_initiate<ReadToken,
- void (boost::system::error_code, std::size_t)>(
- declval<detail::initiate_async_read_until_delim_string_v2<
- AsyncReadStream>>(),
- token, static_cast<DynamicBuffer_v2&&>(buffers),
- static_cast<std::string>(delim)))
-{
- return async_initiate<ReadToken,
- void (boost::system::error_code, std::size_t)>(
- detail::initiate_async_read_until_delim_string_v2<AsyncReadStream>(s),
- token, static_cast<DynamicBuffer_v2&&>(buffers),
- static_cast<std::string>(delim));
-}
-
#if !defined(BOOST_ASIO_NO_EXTENSIONS)
#if defined(BOOST_ASIO_HAS_BOOST_REGEX)
@@ -2650,26 +2423,6 @@ struct associator<Associator,
#endif // !defined(GENERATING_DOCUMENTATION)
-template <typename AsyncReadStream, typename DynamicBuffer_v2, typename Traits,
- BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
- std::size_t)) ReadToken>
-inline auto async_read_until(AsyncReadStream& s, DynamicBuffer_v2 buffers,
- const boost::basic_regex<char, Traits>& expr, ReadToken&& token,
- constraint_t<
- is_dynamic_buffer_v2<DynamicBuffer_v2>::value
- >)
- -> decltype(
- async_initiate<ReadToken,
- void (boost::system::error_code, std::size_t)>(
- declval<detail::initiate_async_read_until_expr_v2<AsyncReadStream>>(),
- token, static_cast<DynamicBuffer_v2&&>(buffers), expr))
-{
- return async_initiate<ReadToken,
- void (boost::system::error_code, std::size_t)>(
- detail::initiate_async_read_until_expr_v2<AsyncReadStream>(s),
- token, static_cast<DynamicBuffer_v2&&>(buffers), expr);
-}
-
#endif // defined(BOOST_ASIO_HAS_BOOST_REGEX)
namespace detail
@@ -2907,32 +2660,6 @@ struct associator<Associator,
#endif // !defined(GENERATING_DOCUMENTATION)
-template <typename AsyncReadStream,
- typename DynamicBuffer_v2, typename MatchCondition,
- BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
- std::size_t)) ReadToken>
-inline auto async_read_until(AsyncReadStream& s, DynamicBuffer_v2 buffers,
- MatchCondition match_condition, ReadToken&& token,
- constraint_t<
- is_match_condition<MatchCondition>::value
- >,
- constraint_t<
- is_dynamic_buffer_v2<DynamicBuffer_v2>::value
- >)
- -> decltype(
- async_initiate<ReadToken,
- void (boost::system::error_code, std::size_t)>(
- declval<detail::initiate_async_read_until_match_v2<AsyncReadStream>>(),
- token, static_cast<DynamicBuffer_v2&&>(buffers),
- match_condition))
-{
- return async_initiate<ReadToken,
- void (boost::system::error_code, std::size_t)>(
- detail::initiate_async_read_until_match_v2<AsyncReadStream>(s),
- token, static_cast<DynamicBuffer_v2&&>(buffers),
- match_condition);
-}
-
#endif // !defined(BOOST_ASIO_NO_EXTENSIONS)
} // namespace asio
diff --git a/contrib/restricted/boost/asio/include/boost/asio/impl/redirect_error.hpp b/contrib/restricted/boost/asio/include/boost/asio/impl/redirect_error.hpp
index f97a96b14e6..b2f8ac7f398 100644
--- a/contrib/restricted/boost/asio/include/boost/asio/impl/redirect_error.hpp
+++ b/contrib/restricted/boost/asio/include/boost/asio/impl/redirect_error.hpp
@@ -16,9 +16,11 @@
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
#include <boost/asio/detail/config.hpp>
+#include <boost/asio/associated_executor.hpp>
#include <boost/asio/associator.hpp>
#include <boost/asio/async_result.hpp>
#include <boost/asio/detail/handler_cont_helpers.hpp>
+#include <boost/asio/detail/initiation_base.hpp>
#include <boost/asio/detail/type_traits.hpp>
#include <boost/system/system_error.hpp>
@@ -183,42 +185,52 @@ struct async_result<redirect_error_t<CompletionToken>, Signature>
: async_result<CompletionToken,
typename detail::redirect_error_signature<Signature>::type>
{
-
- struct init_wrapper
+ template <typename Initiation>
+ struct init_wrapper : detail::initiation_base<Initiation>
{
- explicit init_wrapper(boost::system::error_code& ec)
- : ec_(ec)
+ using detail::initiation_base<Initiation>::initiation_base;
+
+ template <typename Handler, typename... Args>
+ void operator()(Handler&& handler,
+ boost::system::error_code* ec, Args&&... args) &&
{
+ static_cast<Initiation&&>(*this)(
+ detail::redirect_error_handler<decay_t<Handler>>(
+ *ec, static_cast<Handler&&>(handler)),
+ static_cast<Args&&>(args)...);
}
- template <typename Handler, typename Initiation, typename... Args>
+ template <typename Handler, typename... Args>
void operator()(Handler&& handler,
- Initiation&& initiation, Args&&... args) const
+ boost::system::error_code* ec, Args&&... args) const &
{
- static_cast<Initiation&&>(initiation)(
+ static_cast<const Initiation&>(*this)(
detail::redirect_error_handler<decay_t<Handler>>(
- ec_, static_cast<Handler&&>(handler)),
+ *ec, static_cast<Handler&&>(handler)),
static_cast<Args&&>(args)...);
}
-
- boost::system::error_code& ec_;
};
template <typename Initiation, typename RawCompletionToken, typename... Args>
static auto initiate(Initiation&& initiation,
RawCompletionToken&& token, Args&&... args)
-> decltype(
- async_initiate<CompletionToken,
+ async_initiate<
+ conditional_t<
+ is_const<remove_reference_t<RawCompletionToken>>::value,
+ const CompletionToken, CompletionToken>,
typename detail::redirect_error_signature<Signature>::type>(
- declval<init_wrapper>(), token.token_,
- static_cast<Initiation&&>(initiation),
- static_cast<Args&&>(args)...))
+ declval<init_wrapper<decay_t<Initiation>>>(),
+ token.token_, &token.ec_, static_cast<Args&&>(args)...))
{
- return async_initiate<CompletionToken,
+ return async_initiate<
+ conditional_t<
+ is_const<remove_reference_t<RawCompletionToken>>::value,
+ const CompletionToken, CompletionToken>,
typename detail::redirect_error_signature<Signature>::type>(
- init_wrapper(token.ec_), token.token_,
- static_cast<Initiation&&>(initiation),
- static_cast<Args&&>(args)...);
+ init_wrapper<decay_t<Initiation>>(
+ static_cast<Initiation&&>(initiation)),
+ token.token_, &token.ec_, static_cast<Args&&>(args)...);
}
};
@@ -242,6 +254,31 @@ struct associator<Associator,
}
};
+template <typename... Signatures>
+struct async_result<partial_redirect_error, Signatures...>
+{
+ template <typename Initiation, typename RawCompletionToken, typename... Args>
+ static auto initiate(Initiation&& initiation,
+ RawCompletionToken&& token, Args&&... args)
+ -> decltype(
+ async_initiate<Signatures...>(
+ static_cast<Initiation&&>(initiation),
+ redirect_error_t<
+ default_completion_token_t<associated_executor_t<Initiation>>>(
+ default_completion_token_t<associated_executor_t<Initiation>>{},
+ token.ec_),
+ static_cast<Args&&>(args)...))
+ {
+ return async_initiate<Signatures...>(
+ static_cast<Initiation&&>(initiation),
+ redirect_error_t<
+ default_completion_token_t<associated_executor_t<Initiation>>>(
+ default_completion_token_t<associated_executor_t<Initiation>>{},
+ token.ec_),
+ static_cast<Args&&>(args)...);
+ }
+};
+
#endif // !defined(GENERATING_DOCUMENTATION)
} // namespace asio
diff --git a/contrib/restricted/boost/asio/include/boost/asio/impl/spawn.hpp b/contrib/restricted/boost/asio/include/boost/asio/impl/spawn.hpp
index 04b6710ae48..03800c5ca59 100644
--- a/contrib/restricted/boost/asio/include/boost/asio/impl/spawn.hpp
+++ b/contrib/restricted/boost/asio/include/boost/asio/impl/spawn.hpp
@@ -29,6 +29,7 @@
#include <boost/asio/detail/noncopyable.hpp>
#include <boost/asio/detail/type_traits.hpp>
#include <boost/asio/detail/utility.hpp>
+#include <boost/asio/error.hpp>
#include <boost/system/system_error.hpp>
#if defined(BOOST_ASIO_HAS_BOOST_CONTEXT_FIBER)
@@ -976,7 +977,6 @@ private:
Executor ex_;
};
-
template <typename Handler, typename Executor>
class spawn_cancellation_handler<Handler, Executor,
enable_if_t<
diff --git a/contrib/restricted/boost/asio/include/boost/asio/impl/write.hpp b/contrib/restricted/boost/asio/include/boost/asio/impl/write.hpp
index e859f38c881..ff26e1773f0 100644
--- a/contrib/restricted/boost/asio/include/boost/asio/impl/write.hpp
+++ b/contrib/restricted/boost/asio/include/boost/asio/impl/write.hpp
@@ -63,6 +63,9 @@ inline std::size_t write(SyncWriteStream& s, const ConstBufferSequence& buffers,
CompletionCondition completion_condition, boost::system::error_code& ec,
constraint_t<
is_const_buffer_sequence<ConstBufferSequence>::value
+ >,
+ constraint_t<
+ is_completion_condition<CompletionCondition>::value
>)
{
return detail::write(s, buffers,
@@ -98,6 +101,9 @@ inline std::size_t write(SyncWriteStream& s, const ConstBufferSequence& buffers,
CompletionCondition completion_condition,
constraint_t<
is_const_buffer_sequence<ConstBufferSequence>::value
+ >,
+ constraint_t<
+ is_completion_condition<CompletionCondition>::value
>)
{
boost::system::error_code ec;
@@ -119,6 +125,9 @@ std::size_t write(SyncWriteStream& s,
>,
constraint_t<
!is_dynamic_buffer_v2<decay_t<DynamicBuffer_v1>>::value
+ >,
+ constraint_t<
+ is_completion_condition<CompletionCondition>::value
>)
{
decay_t<DynamicBuffer_v1> b(
@@ -173,6 +182,9 @@ inline std::size_t write(SyncWriteStream& s,
>,
constraint_t<
!is_dynamic_buffer_v2<decay_t<DynamicBuffer_v1>>::value
+ >,
+ constraint_t<
+ is_completion_condition<CompletionCondition>::value
>)
{
boost::system::error_code ec;
@@ -190,7 +202,10 @@ template <typename SyncWriteStream, typename Allocator,
typename CompletionCondition>
inline std::size_t write(SyncWriteStream& s,
boost::asio::basic_streambuf<Allocator>& b,
- CompletionCondition completion_condition, boost::system::error_code& ec)
+ CompletionCondition completion_condition, boost::system::error_code& ec,
+ constraint_t<
+ is_completion_condition<CompletionCondition>::value
+ >)
{
return write(s, basic_streambuf_ref<Allocator>(b),
static_cast<CompletionCondition&&>(completion_condition), ec);
@@ -215,7 +230,10 @@ template <typename SyncWriteStream, typename Allocator,
typename CompletionCondition>
inline std::size_t write(SyncWriteStream& s,
boost::asio::basic_streambuf<Allocator>& b,
- CompletionCondition completion_condition)
+ CompletionCondition completion_condition,
+ constraint_t<
+ is_completion_condition<CompletionCondition>::value
+ >)
{
return write(s, basic_streambuf_ref<Allocator>(b),
static_cast<CompletionCondition&&>(completion_condition));
@@ -231,6 +249,9 @@ std::size_t write(SyncWriteStream& s, DynamicBuffer_v2 buffers,
CompletionCondition completion_condition, boost::system::error_code& ec,
constraint_t<
is_dynamic_buffer_v2<DynamicBuffer_v2>::value
+ >,
+ constraint_t<
+ is_completion_condition<CompletionCondition>::value
>)
{
std::size_t bytes_transferred = write(s, buffers.data(0, buffers.size()),
@@ -270,6 +291,9 @@ inline std::size_t write(SyncWriteStream& s, DynamicBuffer_v2 buffers,
CompletionCondition completion_condition,
constraint_t<
is_dynamic_buffer_v2<DynamicBuffer_v2>::value
+ >,
+ constraint_t<
+ is_completion_condition<CompletionCondition>::value
>)
{
boost::system::error_code ec;
@@ -463,49 +487,6 @@ struct associator<Associator,
#endif // !defined(GENERATING_DOCUMENTATION)
-template <typename AsyncWriteStream,
- typename ConstBufferSequence, typename CompletionCondition,
- BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
- std::size_t)) WriteToken>
-inline auto async_write(AsyncWriteStream& s, const ConstBufferSequence& buffers,
- CompletionCondition completion_condition, WriteToken&& token,
- constraint_t<
- is_const_buffer_sequence<ConstBufferSequence>::value
- >)
- -> decltype(
- async_initiate<WriteToken,
- void (boost::system::error_code, std::size_t)>(
- declval<detail::initiate_async_write<AsyncWriteStream>>(),
- token, buffers,
- static_cast<CompletionCondition&&>(completion_condition)))
-{
- return async_initiate<WriteToken,
- void (boost::system::error_code, std::size_t)>(
- detail::initiate_async_write<AsyncWriteStream>(s),
- token, buffers,
- static_cast<CompletionCondition&&>(completion_condition));
-}
-
-template <typename AsyncWriteStream, typename ConstBufferSequence,
- BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
- std::size_t)) WriteToken>
-inline auto async_write(AsyncWriteStream& s,
- const ConstBufferSequence& buffers, WriteToken&& token,
- constraint_t<
- is_const_buffer_sequence<ConstBufferSequence>::value
- >)
- -> decltype(
- async_initiate<WriteToken,
- void (boost::system::error_code, std::size_t)>(
- declval<detail::initiate_async_write<AsyncWriteStream>>(),
- token, buffers, transfer_all()))
-{
- return async_initiate<WriteToken,
- void (boost::system::error_code, std::size_t)>(
- detail::initiate_async_write<AsyncWriteStream>(s),
- token, buffers, transfer_all());
-}
-
#if !defined(BOOST_ASIO_NO_DYNAMIC_BUFFER_V1)
namespace detail
@@ -650,101 +631,6 @@ struct associator<Associator,
#endif // !defined(GENERATING_DOCUMENTATION)
-template <typename AsyncWriteStream, typename DynamicBuffer_v1,
- BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
- std::size_t)) WriteToken>
-inline auto async_write(AsyncWriteStream& s,
- DynamicBuffer_v1&& buffers, WriteToken&& token,
- constraint_t<
- is_dynamic_buffer_v1<decay_t<DynamicBuffer_v1>>::value
- >,
- constraint_t<
- !is_dynamic_buffer_v2<decay_t<DynamicBuffer_v1>>::value
- >)
- -> decltype(
- async_initiate<WriteToken,
- void (boost::system::error_code, std::size_t)>(
- declval<detail::initiate_async_write_dynbuf_v1<AsyncWriteStream>>(),
- token, static_cast<DynamicBuffer_v1&&>(buffers),
- transfer_all()))
-{
- return async_initiate<WriteToken,
- void (boost::system::error_code, std::size_t)>(
- detail::initiate_async_write_dynbuf_v1<AsyncWriteStream>(s),
- token, static_cast<DynamicBuffer_v1&&>(buffers),
- transfer_all());
-}
-
-template <typename AsyncWriteStream,
- typename DynamicBuffer_v1, typename CompletionCondition,
- BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
- std::size_t)) WriteToken>
-inline auto async_write(AsyncWriteStream& s, DynamicBuffer_v1&& buffers,
- CompletionCondition completion_condition, WriteToken&& token,
- constraint_t<
- is_dynamic_buffer_v1<decay_t<DynamicBuffer_v1>>::value
- >,
- constraint_t<
- !is_dynamic_buffer_v2<decay_t<DynamicBuffer_v1>>::value
- >)
- -> decltype(
- async_initiate<WriteToken,
- void (boost::system::error_code, std::size_t)>(
- declval<detail::initiate_async_write_dynbuf_v1<AsyncWriteStream>>(),
- token, static_cast<DynamicBuffer_v1&&>(buffers),
- static_cast<CompletionCondition&&>(completion_condition)))
-{
- return async_initiate<WriteToken,
- void (boost::system::error_code, std::size_t)>(
- detail::initiate_async_write_dynbuf_v1<AsyncWriteStream>(s),
- token, static_cast<DynamicBuffer_v1&&>(buffers),
- static_cast<CompletionCondition&&>(completion_condition));
-}
-
-#if !defined(BOOST_ASIO_NO_EXTENSIONS)
-#if !defined(BOOST_ASIO_NO_IOSTREAM)
-
-template <typename AsyncWriteStream, typename Allocator,
- BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
- std::size_t)) WriteToken>
-inline auto async_write(AsyncWriteStream& s,
- boost::asio::basic_streambuf<Allocator>& b,
- WriteToken&& token)
- -> decltype(
- async_initiate<WriteToken,
- void (boost::system::error_code, std::size_t)>(
- declval<detail::initiate_async_write_dynbuf_v1<AsyncWriteStream>>(),
- token, basic_streambuf_ref<Allocator>(b), transfer_all()))
-{
- return async_initiate<WriteToken,
- void (boost::system::error_code, std::size_t)>(
- detail::initiate_async_write_dynbuf_v1<AsyncWriteStream>(s),
- token, basic_streambuf_ref<Allocator>(b), transfer_all());
-}
-
-template <typename AsyncWriteStream,
- typename Allocator, typename CompletionCondition,
- BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
- std::size_t)) WriteToken>
-inline auto async_write(AsyncWriteStream& s,
- boost::asio::basic_streambuf<Allocator>& b,
- CompletionCondition completion_condition, WriteToken&& token)
- -> decltype(
- async_initiate<WriteToken,
- void (boost::system::error_code, std::size_t)>(
- declval<detail::initiate_async_write_dynbuf_v1<AsyncWriteStream>>(),
- token, basic_streambuf_ref<Allocator>(b),
- static_cast<CompletionCondition&&>(completion_condition)))
-{
- return async_initiate<WriteToken,
- void (boost::system::error_code, std::size_t)>(
- detail::initiate_async_write_dynbuf_v1<AsyncWriteStream>(s),
- token, basic_streambuf_ref<Allocator>(b),
- static_cast<CompletionCondition&&>(completion_condition));
-}
-
-#endif // !defined(BOOST_ASIO_NO_IOSTREAM)
-#endif // !defined(BOOST_ASIO_NO_EXTENSIONS)
#endif // !defined(BOOST_ASIO_NO_DYNAMIC_BUFFER_V1)
namespace detail
@@ -888,51 +774,6 @@ struct associator<Associator,
#endif // !defined(GENERATING_DOCUMENTATION)
-template <typename AsyncWriteStream, typename DynamicBuffer_v2,
- BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
- std::size_t)) WriteToken>
-inline auto async_write(AsyncWriteStream& s,
- DynamicBuffer_v2 buffers, WriteToken&& token,
- constraint_t<
- is_dynamic_buffer_v2<DynamicBuffer_v2>::value
- >)
- -> decltype(
- async_initiate<WriteToken,
- void (boost::system::error_code, std::size_t)>(
- declval<detail::initiate_async_write_dynbuf_v2<AsyncWriteStream>>(),
- token, static_cast<DynamicBuffer_v2&&>(buffers),
- transfer_all()))
-{
- return async_initiate<WriteToken,
- void (boost::system::error_code, std::size_t)>(
- detail::initiate_async_write_dynbuf_v2<AsyncWriteStream>(s),
- token, static_cast<DynamicBuffer_v2&&>(buffers),
- transfer_all());
-}
-
-template <typename AsyncWriteStream,
- typename DynamicBuffer_v2, typename CompletionCondition,
- BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
- std::size_t)) WriteToken>
-inline auto async_write(AsyncWriteStream& s, DynamicBuffer_v2 buffers,
- CompletionCondition completion_condition, WriteToken&& token,
- constraint_t<
- is_dynamic_buffer_v2<DynamicBuffer_v2>::value
- >)
- -> decltype(
- async_initiate<WriteToken,
- void (boost::system::error_code, std::size_t)>(
- declval<detail::initiate_async_write_dynbuf_v2<AsyncWriteStream>>(),
- token, static_cast<DynamicBuffer_v2&&>(buffers),
- static_cast<CompletionCondition&&>(completion_condition)))
-{
- return async_initiate<WriteToken,
- void (boost::system::error_code, std::size_t)>(
- detail::initiate_async_write_dynbuf_v2<AsyncWriteStream>(s),
- token, static_cast<DynamicBuffer_v2&&>(buffers),
- static_cast<CompletionCondition&&>(completion_condition));
-}
-
} // namespace asio
} // namespace boost
diff --git a/contrib/restricted/boost/asio/include/boost/asio/impl/write_at.hpp b/contrib/restricted/boost/asio/include/boost/asio/impl/write_at.hpp
index f516b88a657..faa0ed2cc99 100644
--- a/contrib/restricted/boost/asio/include/boost/asio/impl/write_at.hpp
+++ b/contrib/restricted/boost/asio/include/boost/asio/impl/write_at.hpp
@@ -65,7 +65,10 @@ template <typename SyncRandomAccessWriteDevice, typename ConstBufferSequence,
typename CompletionCondition>
std::size_t write_at(SyncRandomAccessWriteDevice& d,
uint64_t offset, const ConstBufferSequence& buffers,
- CompletionCondition completion_condition, boost::system::error_code& ec)
+ CompletionCondition completion_condition, boost::system::error_code& ec,
+ constraint_t<
+ is_completion_condition<CompletionCondition>::value
+ >)
{
return detail::write_at_buffer_sequence(d, offset, buffers,
boost::asio::buffer_sequence_begin(buffers),
@@ -95,7 +98,10 @@ template <typename SyncRandomAccessWriteDevice, typename ConstBufferSequence,
typename CompletionCondition>
inline std::size_t write_at(SyncRandomAccessWriteDevice& d,
uint64_t offset, const ConstBufferSequence& buffers,
- CompletionCondition completion_condition)
+ CompletionCondition completion_condition,
+ constraint_t<
+ is_completion_condition<CompletionCondition>::value
+ >)
{
boost::system::error_code ec;
std::size_t bytes_transferred = write_at(d, offset, buffers,
@@ -111,7 +117,10 @@ template <typename SyncRandomAccessWriteDevice, typename Allocator,
typename CompletionCondition>
std::size_t write_at(SyncRandomAccessWriteDevice& d,
uint64_t offset, boost::asio::basic_streambuf<Allocator>& b,
- CompletionCondition completion_condition, boost::system::error_code& ec)
+ CompletionCondition completion_condition, boost::system::error_code& ec,
+ constraint_t<
+ is_completion_condition<CompletionCondition>::value
+ >)
{
std::size_t bytes_transferred = write_at(d, offset, b.data(),
static_cast<CompletionCondition&&>(completion_condition), ec);
@@ -141,7 +150,10 @@ template <typename SyncRandomAccessWriteDevice, typename Allocator,
typename CompletionCondition>
inline std::size_t write_at(SyncRandomAccessWriteDevice& d,
uint64_t offset, boost::asio::basic_streambuf<Allocator>& b,
- CompletionCondition completion_condition)
+ CompletionCondition completion_condition,
+ constraint_t<
+ is_completion_condition<CompletionCondition>::value
+ >)
{
boost::system::error_code ec;
std::size_t bytes_transferred = write_at(d, offset, b,
@@ -345,46 +357,6 @@ struct associator<Associator,
#endif // !defined(GENERATING_DOCUMENTATION)
-template <typename AsyncRandomAccessWriteDevice,
- typename ConstBufferSequence, typename CompletionCondition,
- BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
- std::size_t)) WriteToken>
-inline auto async_write_at(AsyncRandomAccessWriteDevice& d,
- uint64_t offset, const ConstBufferSequence& buffers,
- CompletionCondition completion_condition, WriteToken&& token)
- -> decltype(
- async_initiate<WriteToken,
- void (boost::system::error_code, std::size_t)>(
- declval<detail::initiate_async_write_at<
- AsyncRandomAccessWriteDevice>>(),
- token, offset, buffers,
- static_cast<CompletionCondition&&>(completion_condition)))
-{
- return async_initiate<WriteToken,
- void (boost::system::error_code, std::size_t)>(
- detail::initiate_async_write_at<AsyncRandomAccessWriteDevice>(d),
- token, offset, buffers,
- static_cast<CompletionCondition&&>(completion_condition));
-}
-
-template <typename AsyncRandomAccessWriteDevice, typename ConstBufferSequence,
- BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
- std::size_t)) WriteToken>
-inline auto async_write_at(AsyncRandomAccessWriteDevice& d,
- uint64_t offset, const ConstBufferSequence& buffers, WriteToken&& token)
- -> decltype(
- async_initiate<WriteToken,
- void (boost::system::error_code, std::size_t)>(
- declval<detail::initiate_async_write_at<
- AsyncRandomAccessWriteDevice>>(),
- token, offset, buffers, transfer_all()))
-{
- return async_initiate<WriteToken,
- void (boost::system::error_code, std::size_t)>(
- detail::initiate_async_write_at<AsyncRandomAccessWriteDevice>(d),
- token, offset, buffers, transfer_all());
-}
-
#if !defined(BOOST_ASIO_NO_EXTENSIONS)
#if !defined(BOOST_ASIO_NO_IOSTREAM)
@@ -499,49 +471,6 @@ struct associator<Associator,
#endif // !defined(GENERATING_DOCUMENTATION)
-template <typename AsyncRandomAccessWriteDevice,
- typename Allocator, typename CompletionCondition,
- BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
- std::size_t)) WriteToken>
-inline auto async_write_at(AsyncRandomAccessWriteDevice& d,
- uint64_t offset, boost::asio::basic_streambuf<Allocator>& b,
- CompletionCondition completion_condition, WriteToken&& token)
- -> decltype(
- async_initiate<WriteToken,
- void (boost::system::error_code, std::size_t)>(
- declval<detail::initiate_async_write_at_streambuf<
- AsyncRandomAccessWriteDevice>>(),
- token, offset, &b,
- static_cast<CompletionCondition&&>(completion_condition)))
-{
- return async_initiate<WriteToken,
- void (boost::system::error_code, std::size_t)>(
- detail::initiate_async_write_at_streambuf<
- AsyncRandomAccessWriteDevice>(d),
- token, offset, &b,
- static_cast<CompletionCondition&&>(completion_condition));
-}
-
-template <typename AsyncRandomAccessWriteDevice, typename Allocator,
- BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
- std::size_t)) WriteToken>
-inline auto async_write_at(AsyncRandomAccessWriteDevice& d,
- uint64_t offset, boost::asio::basic_streambuf<Allocator>& b,
- WriteToken&& token)
- -> decltype(
- async_initiate<WriteToken,
- void (boost::system::error_code, std::size_t)>(
- declval<detail::initiate_async_write_at_streambuf<
- AsyncRandomAccessWriteDevice>>(),
- token, offset, &b, transfer_all()))
-{
- return async_initiate<WriteToken,
- void (boost::system::error_code, std::size_t)>(
- detail::initiate_async_write_at_streambuf<
- AsyncRandomAccessWriteDevice>(d),
- token, offset, &b, transfer_all());
-}
-
#endif // !defined(BOOST_ASIO_NO_IOSTREAM)
#endif // !defined(BOOST_ASIO_NO_EXTENSIONS)
diff --git a/contrib/restricted/boost/asio/include/boost/asio/io_context_strand.hpp b/contrib/restricted/boost/asio/include/boost/asio/io_context_strand.hpp
index e2864763a1b..c612584e52d 100644
--- a/contrib/restricted/boost/asio/include/boost/asio/io_context_strand.hpp
+++ b/contrib/restricted/boost/asio/include/boost/asio/io_context_strand.hpp
@@ -55,18 +55,18 @@ namespace asio {
* if any of the following conditions are true:
*
* @li @c s.post(a) happens-before @c s.post(b)
- *
+ *
* @li @c s.post(a) happens-before @c s.dispatch(b), where the latter is
* performed outside the strand
- *
+ *
* @li @c s.dispatch(a) happens-before @c s.post(b), where the former is
* performed outside the strand
- *
+ *
* @li @c s.dispatch(a) happens-before @c s.dispatch(b), where both are
* performed outside the strand
- *
+ *
* then @c a() happens-before @c b()
- *
+ *
* Note that in the following case:
* @code async_op_1(..., s.wrap(a));
* async_op_2(..., s.wrap(b)); @endcode
diff --git a/contrib/restricted/boost/asio/include/boost/asio/ip/basic_resolver.hpp b/contrib/restricted/boost/asio/include/boost/asio/ip/basic_resolver.hpp
index e46a8333dd6..9ed8578005f 100644
--- a/contrib/restricted/boost/asio/include/boost/asio/ip/basic_resolver.hpp
+++ b/contrib/restricted/boost/asio/include/boost/asio/ip/basic_resolver.hpp
@@ -663,7 +663,7 @@ public:
* Regardless of whether the asynchronous operation completes immediately or
* not, the completion handler will not be invoked from within this function.
* On immediate completion, invocation of the handler will be performed in a
- * manner equivalent to using boost::asio::post().
+ * manner equivalent to using boost::asio::async_immediate().
*
* A successful resolve operation is guaranteed to pass a non-empty range to
* the handler.
@@ -715,7 +715,7 @@ public:
* Regardless of whether the asynchronous operation completes immediately or
* not, the completion handler will not be invoked from within this function.
* On immediate completion, invocation of the handler will be performed in a
- * manner equivalent to using boost::asio::post().
+ * manner equivalent to using boost::asio::async_immediate().
*
* A successful resolve operation is guaranteed to pass a non-empty range to
* the handler.
@@ -784,7 +784,7 @@ public:
* Regardless of whether the asynchronous operation completes immediately or
* not, the completion handler will not be invoked from within this function.
* On immediate completion, invocation of the handler will be performed in a
- * manner equivalent to using boost::asio::post().
+ * manner equivalent to using boost::asio::async_immediate().
*
* A successful resolve operation is guaranteed to pass a non-empty range to
* the handler.
@@ -855,7 +855,7 @@ public:
* Regardless of whether the asynchronous operation completes immediately or
* not, the completion handler will not be invoked from within this function.
* On immediate completion, invocation of the handler will be performed in a
- * manner equivalent to using boost::asio::post().
+ * manner equivalent to using boost::asio::async_immediate().
*
* A successful resolve operation is guaranteed to pass a non-empty range to
* the handler.
@@ -927,7 +927,7 @@ public:
* Regardless of whether the asynchronous operation completes immediately or
* not, the completion handler will not be invoked from within this function.
* On immediate completion, invocation of the handler will be performed in a
- * manner equivalent to using boost::asio::post().
+ * manner equivalent to using boost::asio::async_immediate().
*
* A successful resolve operation is guaranteed to pass a non-empty range to
* the handler.
@@ -1032,7 +1032,7 @@ public:
* Regardless of whether the asynchronous operation completes immediately or
* not, the completion handler will not be invoked from within this function.
* On immediate completion, invocation of the handler will be performed in a
- * manner equivalent to using boost::asio::post().
+ * manner equivalent to using boost::asio::async_immediate().
*
* A successful resolve operation is guaranteed to pass a non-empty range to
* the handler.
diff --git a/contrib/restricted/boost/asio/include/boost/asio/ip/detail/socket_option.hpp b/contrib/restricted/boost/asio/include/boost/asio/ip/detail/socket_option.hpp
index a806d344fd1..3ae928c7f68 100644
--- a/contrib/restricted/boost/asio/include/boost/asio/ip/detail/socket_option.hpp
+++ b/contrib/restricted/boost/asio/include/boost/asio/ip/detail/socket_option.hpp
@@ -40,7 +40,7 @@ public:
#if defined(__sun) || defined(__osf__)
typedef unsigned char ipv4_value_type;
typedef unsigned char ipv6_value_type;
-#elif defined(_AIX) || defined(__hpux) || defined(__QNXNTO__)
+#elif defined(_AIX) || defined(__hpux) || defined(__QNXNTO__)
typedef unsigned char ipv4_value_type;
typedef unsigned int ipv6_value_type;
#else
diff --git a/contrib/restricted/boost/asio/include/boost/asio/ip/impl/address_v6.ipp b/contrib/restricted/boost/asio/include/boost/asio/ip/impl/address_v6.ipp
index cf81cca410c..adb7ae1d4e6 100644
--- a/contrib/restricted/boost/asio/include/boost/asio/ip/impl/address_v6.ipp
+++ b/contrib/restricted/boost/asio/include/boost/asio/ip/impl/address_v6.ipp
@@ -282,7 +282,7 @@ address_v6 make_address_v6(const char* str,
if (boost::asio::detail::socket_ops::inet_pton(
BOOST_ASIO_OS_DEF(AF_INET6), str, &bytes[0], &scope_id, ec) <= 0)
return address_v6();
- return address_v6(bytes, scope_id);
+ return address_v6(bytes, static_cast<scope_id_type>(scope_id));
}
address_v6 make_address_v6(const std::string& str)
diff --git a/contrib/restricted/boost/asio/include/boost/asio/placeholders.hpp b/contrib/restricted/boost/asio/include/boost/asio/placeholders.hpp
index eacc28c7271..5476c800ce2 100644
--- a/contrib/restricted/boost/asio/include/boost/asio/placeholders.hpp
+++ b/contrib/restricted/boost/asio/include/boost/asio/placeholders.hpp
@@ -59,12 +59,18 @@ unspecified signal_number;
#else
-static constexpr auto& error = std::placeholders::_1;
-static constexpr auto& bytes_transferred = std::placeholders::_2;
-static constexpr auto& iterator = std::placeholders::_2;
-static constexpr auto& results = std::placeholders::_2;
-static constexpr auto& endpoint = std::placeholders::_2;
-static constexpr auto& signal_number = std::placeholders::_2;
+static BOOST_ASIO_INLINE_VARIABLE constexpr auto& error
+ = std::placeholders::_1;
+static BOOST_ASIO_INLINE_VARIABLE constexpr auto& bytes_transferred
+ = std::placeholders::_2;
+static BOOST_ASIO_INLINE_VARIABLE constexpr auto& iterator
+ = std::placeholders::_2;
+static BOOST_ASIO_INLINE_VARIABLE constexpr auto& results
+ = std::placeholders::_2;
+static BOOST_ASIO_INLINE_VARIABLE constexpr auto& endpoint
+ = std::placeholders::_2;
+static BOOST_ASIO_INLINE_VARIABLE constexpr auto& signal_number
+ = std::placeholders::_2;
#endif
diff --git a/contrib/restricted/boost/asio/include/boost/asio/posix/basic_descriptor.hpp b/contrib/restricted/boost/asio/include/boost/asio/posix/basic_descriptor.hpp
index 8e22760ec48..82ea554dfcb 100644
--- a/contrib/restricted/boost/asio/include/boost/asio/posix/basic_descriptor.hpp
+++ b/contrib/restricted/boost/asio/include/boost/asio/posix/basic_descriptor.hpp
@@ -661,7 +661,7 @@ public:
* Regardless of whether the asynchronous operation completes immediately or
* not, the completion handler will not be invoked from within this function.
* On immediate completion, invocation of the handler will be performed in a
- * manner equivalent to using boost::asio::post().
+ * manner equivalent to using boost::asio::async_immediate().
*
* @par Completion Signature
* @code void(boost::system::error_code) @endcode
diff --git a/contrib/restricted/boost/asio/include/boost/asio/posix/basic_stream_descriptor.hpp b/contrib/restricted/boost/asio/include/boost/asio/posix/basic_stream_descriptor.hpp
index 882f27c71dd..149e85db397 100644
--- a/contrib/restricted/boost/asio/include/boost/asio/posix/basic_stream_descriptor.hpp
+++ b/contrib/restricted/boost/asio/include/boost/asio/posix/basic_stream_descriptor.hpp
@@ -308,7 +308,7 @@ public:
* Regardless of whether the asynchronous operation completes immediately or
* not, the completion handler will not be invoked from within this function.
* On immediate completion, invocation of the handler will be performed in a
- * manner equivalent to using boost::asio::post().
+ * manner equivalent to using boost::asio::async_immediate().
*
* @par Completion Signature
* @code void(boost::system::error_code, std::size_t) @endcode
@@ -437,7 +437,7 @@ public:
* Regardless of whether the asynchronous operation completes immediately or
* not, the completion handler will not be invoked from within this function.
* On immediate completion, invocation of the handler will be performed in a
- * manner equivalent to using boost::asio::post().
+ * manner equivalent to using boost::asio::async_immediate().
*
* @par Completion Signature
* @code void(boost::system::error_code, std::size_t) @endcode
diff --git a/contrib/restricted/boost/asio/include/boost/asio/read.hpp b/contrib/restricted/boost/asio/include/boost/asio/read.hpp
index b66c79e17eb..6e1733d60c6 100644
--- a/contrib/restricted/boost/asio/include/boost/asio/read.hpp
+++ b/contrib/restricted/boost/asio/include/boost/asio/read.hpp
@@ -185,6 +185,9 @@ std::size_t read(SyncReadStream& s, const MutableBufferSequence& buffers,
CompletionCondition completion_condition,
constraint_t<
is_mutable_buffer_sequence<MutableBufferSequence>::value
+ > = 0,
+ constraint_t<
+ is_completion_condition<CompletionCondition>::value
> = 0);
/// Attempt to read a certain amount of data from a stream before returning.
@@ -232,6 +235,9 @@ std::size_t read(SyncReadStream& s, const MutableBufferSequence& buffers,
CompletionCondition completion_condition, boost::system::error_code& ec,
constraint_t<
is_mutable_buffer_sequence<MutableBufferSequence>::value
+ > = 0,
+ constraint_t<
+ is_completion_condition<CompletionCondition>::value
> = 0);
#if !defined(BOOST_ASIO_NO_DYNAMIC_BUFFER_V1)
@@ -356,6 +362,9 @@ std::size_t read(SyncReadStream& s,
> = 0,
constraint_t<
!is_dynamic_buffer_v2<decay_t<DynamicBuffer_v1>>::value
+ > = 0,
+ constraint_t<
+ is_completion_condition<CompletionCondition>::value
> = 0);
/// Attempt to read a certain amount of data from a stream before returning.
@@ -405,6 +414,9 @@ std::size_t read(SyncReadStream& s,
> = 0,
constraint_t<
!is_dynamic_buffer_v2<decay_t<DynamicBuffer_v1>>::value
+ > = 0,
+ constraint_t<
+ is_completion_condition<CompletionCondition>::value
> = 0);
#if !defined(BOOST_ASIO_NO_EXTENSIONS)
@@ -507,7 +519,10 @@ std::size_t read(SyncReadStream& s, basic_streambuf<Allocator>& b,
template <typename SyncReadStream, typename Allocator,
typename CompletionCondition>
std::size_t read(SyncReadStream& s, basic_streambuf<Allocator>& b,
- CompletionCondition completion_condition);
+ CompletionCondition completion_condition,
+ constraint_t<
+ is_completion_condition<CompletionCondition>::value
+ > = 0);
/// Attempt to read a certain amount of data from a stream before returning.
/**
@@ -548,7 +563,10 @@ std::size_t read(SyncReadStream& s, basic_streambuf<Allocator>& b,
template <typename SyncReadStream, typename Allocator,
typename CompletionCondition>
std::size_t read(SyncReadStream& s, basic_streambuf<Allocator>& b,
- CompletionCondition completion_condition, boost::system::error_code& ec);
+ CompletionCondition completion_condition, boost::system::error_code& ec,
+ constraint_t<
+ is_completion_condition<CompletionCondition>::value
+ > = 0);
#endif // !defined(BOOST_ASIO_NO_IOSTREAM)
#endif // !defined(BOOST_ASIO_NO_EXTENSIONS)
@@ -662,6 +680,9 @@ std::size_t read(SyncReadStream& s, DynamicBuffer_v2 buffers,
CompletionCondition completion_condition,
constraint_t<
is_dynamic_buffer_v2<DynamicBuffer_v2>::value
+ > = 0,
+ constraint_t<
+ is_completion_condition<CompletionCondition>::value
> = 0);
/// Attempt to read a certain amount of data from a stream before returning.
@@ -707,6 +728,9 @@ std::size_t read(SyncReadStream& s, DynamicBuffer_v2 buffers,
CompletionCondition completion_condition, boost::system::error_code& ec,
constraint_t<
is_dynamic_buffer_v2<DynamicBuffer_v2>::value
+ > = 0,
+ constraint_t<
+ is_completion_condition<CompletionCondition>::value
> = 0);
/*@}*/
@@ -763,7 +787,7 @@ std::size_t read(SyncReadStream& s, DynamicBuffer_v2 buffers,
* Regardless of whether the asynchronous operation completes immediately or
* not, the completion handler will not be invoked from within this function.
* On immediate completion, invocation of the handler will be performed in a
- * manner equivalent to using boost::asio::post().
+ * manner equivalent to using boost::asio::async_immediate().
*
* @par Completion Signature
* @code void(boost::system::error_code, std::size_t) @endcode
@@ -798,17 +822,26 @@ template <typename AsyncReadStream, typename MutableBufferSequence,
BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
std::size_t)) ReadToken = default_completion_token_t<
typename AsyncReadStream::executor_type>>
-auto async_read(AsyncReadStream& s, const MutableBufferSequence& buffers,
+inline auto async_read(AsyncReadStream& s, const MutableBufferSequence& buffers,
ReadToken&& token = default_completion_token_t<
typename AsyncReadStream::executor_type>(),
constraint_t<
is_mutable_buffer_sequence<MutableBufferSequence>::value
+ > = 0,
+ constraint_t<
+ !is_completion_condition<ReadToken>::value
> = 0)
-> decltype(
async_initiate<ReadToken,
void (boost::system::error_code, std::size_t)>(
declval<detail::initiate_async_read<AsyncReadStream>>(),
- token, buffers, transfer_all()));
+ token, buffers, transfer_all()))
+{
+ return async_initiate<ReadToken,
+ void (boost::system::error_code, std::size_t)>(
+ detail::initiate_async_read<AsyncReadStream>(s),
+ token, buffers, transfer_all());
+}
/// Start an asynchronous operation to read a certain amount of data from a
/// stream.
@@ -863,7 +896,7 @@ auto async_read(AsyncReadStream& s, const MutableBufferSequence& buffers,
* Regardless of whether the asynchronous operation completes immediately or
* not, the completion handler will not be invoked from within this function.
* On immediate completion, invocation of the handler will be performed in a
- * manner equivalent to using boost::asio::post().
+ * manner equivalent to using boost::asio::async_immediate().
*
* @par Completion Signature
* @code void(boost::system::error_code, std::size_t) @endcode
@@ -894,19 +927,28 @@ template <typename AsyncReadStream,
BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
std::size_t)) ReadToken = default_completion_token_t<
typename AsyncReadStream::executor_type>>
-auto async_read(AsyncReadStream& s, const MutableBufferSequence& buffers,
+inline auto async_read(AsyncReadStream& s, const MutableBufferSequence& buffers,
CompletionCondition completion_condition,
ReadToken&& token = default_completion_token_t<
typename AsyncReadStream::executor_type>(),
constraint_t<
is_mutable_buffer_sequence<MutableBufferSequence>::value
+ > = 0,
+ constraint_t<
+ is_completion_condition<CompletionCondition>::value
> = 0)
-> decltype(
async_initiate<ReadToken,
void (boost::system::error_code, std::size_t)>(
declval<detail::initiate_async_read<AsyncReadStream>>(),
token, buffers,
- static_cast<CompletionCondition&&>(completion_condition)));
+ static_cast<CompletionCondition&&>(completion_condition)))
+{
+ return async_initiate<ReadToken,
+ void (boost::system::error_code, std::size_t)>(
+ detail::initiate_async_read<AsyncReadStream>(s), token, buffers,
+ static_cast<CompletionCondition&&>(completion_condition));
+}
#if !defined(BOOST_ASIO_NO_DYNAMIC_BUFFER_V1)
@@ -954,7 +996,7 @@ auto async_read(AsyncReadStream& s, const MutableBufferSequence& buffers,
* Regardless of whether the asynchronous operation completes immediately or
* not, the completion handler will not be invoked from within this function.
* On immediate completion, invocation of the handler will be performed in a
- * manner equivalent to using boost::asio::post().
+ * manner equivalent to using boost::asio::async_immediate().
*
* @par Completion Signature
* @code void(boost::system::error_code, std::size_t) @endcode
@@ -980,7 +1022,7 @@ template <typename AsyncReadStream, typename DynamicBuffer_v1,
BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
std::size_t)) ReadToken = default_completion_token_t<
typename AsyncReadStream::executor_type>>
-auto async_read(AsyncReadStream& s, DynamicBuffer_v1&& buffers,
+inline auto async_read(AsyncReadStream& s, DynamicBuffer_v1&& buffers,
ReadToken&& token = default_completion_token_t<
typename AsyncReadStream::executor_type>(),
constraint_t<
@@ -988,12 +1030,21 @@ auto async_read(AsyncReadStream& s, DynamicBuffer_v1&& buffers,
> = 0,
constraint_t<
!is_dynamic_buffer_v2<decay_t<DynamicBuffer_v1>>::value
+ > = 0,
+ constraint_t<
+ !is_completion_condition<ReadToken>::value
> = 0)
-> decltype(
async_initiate<ReadToken,
void (boost::system::error_code, std::size_t)>(
declval<detail::initiate_async_read_dynbuf_v1<AsyncReadStream>>(),
- token, static_cast<DynamicBuffer_v1&&>(buffers), transfer_all()));
+ token, static_cast<DynamicBuffer_v1&&>(buffers), transfer_all()))
+{
+ return async_initiate<ReadToken,
+ void (boost::system::error_code, std::size_t)>(
+ detail::initiate_async_read_dynbuf_v1<AsyncReadStream>(s),
+ token, static_cast<DynamicBuffer_v1&&>(buffers), transfer_all());
+}
/// Start an asynchronous operation to read a certain amount of data from a
/// stream.
@@ -1053,7 +1104,7 @@ auto async_read(AsyncReadStream& s, DynamicBuffer_v1&& buffers,
* Regardless of whether the asynchronous operation completes immediately or
* not, the completion handler will not be invoked from within this function.
* On immediate completion, invocation of the handler will be performed in a
- * manner equivalent to using boost::asio::post().
+ * manner equivalent to using boost::asio::async_immediate().
*
* @par Completion Signature
* @code void(boost::system::error_code, std::size_t) @endcode
@@ -1074,7 +1125,7 @@ template <typename AsyncReadStream,
BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
std::size_t)) ReadToken = default_completion_token_t<
typename AsyncReadStream::executor_type>>
-auto async_read(AsyncReadStream& s, DynamicBuffer_v1&& buffers,
+inline auto async_read(AsyncReadStream& s, DynamicBuffer_v1&& buffers,
CompletionCondition completion_condition,
ReadToken&& token = default_completion_token_t<
typename AsyncReadStream::executor_type>(),
@@ -1083,13 +1134,23 @@ auto async_read(AsyncReadStream& s, DynamicBuffer_v1&& buffers,
> = 0,
constraint_t<
!is_dynamic_buffer_v2<decay_t<DynamicBuffer_v1>>::value
+ > = 0,
+ constraint_t<
+ is_completion_condition<CompletionCondition>::value
> = 0)
-> decltype(
async_initiate<ReadToken,
void (boost::system::error_code, std::size_t)>(
declval<detail::initiate_async_read_dynbuf_v1<AsyncReadStream>>(),
token, static_cast<DynamicBuffer_v1&&>(buffers),
- static_cast<CompletionCondition&&>(completion_condition)));
+ static_cast<CompletionCondition&&>(completion_condition)))
+{
+ return async_initiate<ReadToken,
+ void (boost::system::error_code, std::size_t)>(
+ detail::initiate_async_read_dynbuf_v1<AsyncReadStream>(s),
+ token, static_cast<DynamicBuffer_v1&&>(buffers),
+ static_cast<CompletionCondition&&>(completion_condition));
+}
#if !defined(BOOST_ASIO_NO_EXTENSIONS)
#if !defined(BOOST_ASIO_NO_IOSTREAM)
@@ -1136,7 +1197,7 @@ auto async_read(AsyncReadStream& s, DynamicBuffer_v1&& buffers,
* Regardless of whether the asynchronous operation completes immediately or
* not, the completion handler will not be invoked from within this function.
* On immediate completion, invocation of the handler will be performed in a
- * manner equivalent to using boost::asio::post().
+ * manner equivalent to using boost::asio::async_immediate().
*
* @par Completion Signature
* @code void(boost::system::error_code, std::size_t) @endcode
@@ -1162,14 +1223,23 @@ template <typename AsyncReadStream, typename Allocator,
BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
std::size_t)) ReadToken = default_completion_token_t<
typename AsyncReadStream::executor_type>>
-auto async_read(AsyncReadStream& s, basic_streambuf<Allocator>& b,
+inline auto async_read(AsyncReadStream& s, basic_streambuf<Allocator>& b,
ReadToken&& token = default_completion_token_t<
- typename AsyncReadStream::executor_type>())
+ typename AsyncReadStream::executor_type>(),
+ constraint_t<
+ !is_completion_condition<ReadToken>::value
+ > = 0)
-> decltype(
async_initiate<ReadToken,
void (boost::system::error_code, std::size_t)>(
declval<detail::initiate_async_read_dynbuf_v1<AsyncReadStream>>(),
- token, basic_streambuf_ref<Allocator>(b), transfer_all()));
+ token, basic_streambuf_ref<Allocator>(b), transfer_all()))
+{
+ return async_initiate<ReadToken,
+ void (boost::system::error_code, std::size_t)>(
+ detail::initiate_async_read_dynbuf_v1<AsyncReadStream>(s),
+ token, basic_streambuf_ref<Allocator>(b), transfer_all());
+}
/// Start an asynchronous operation to read a certain amount of data from a
/// stream.
@@ -1227,7 +1297,7 @@ auto async_read(AsyncReadStream& s, basic_streambuf<Allocator>& b,
* Regardless of whether the asynchronous operation completes immediately or
* not, the completion handler will not be invoked from within this function.
* On immediate completion, invocation of the handler will be performed in a
- * manner equivalent to using boost::asio::post().
+ * manner equivalent to using boost::asio::async_immediate().
*
* @par Completion Signature
* @code void(boost::system::error_code, std::size_t) @endcode
@@ -1248,16 +1318,26 @@ template <typename AsyncReadStream,
BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
std::size_t)) ReadToken = default_completion_token_t<
typename AsyncReadStream::executor_type>>
-auto async_read(AsyncReadStream& s, basic_streambuf<Allocator>& b,
+inline auto async_read(AsyncReadStream& s, basic_streambuf<Allocator>& b,
CompletionCondition completion_condition,
ReadToken&& token = default_completion_token_t<
- typename AsyncReadStream::executor_type>())
+ typename AsyncReadStream::executor_type>(),
+ constraint_t<
+ is_completion_condition<CompletionCondition>::value
+ > = 0)
-> decltype(
async_initiate<ReadToken,
void (boost::system::error_code, std::size_t)>(
declval<detail::initiate_async_read_dynbuf_v1<AsyncReadStream>>(),
token, basic_streambuf_ref<Allocator>(b),
- static_cast<CompletionCondition&&>(completion_condition)));
+ static_cast<CompletionCondition&&>(completion_condition)))
+{
+ return async_initiate<ReadToken,
+ void (boost::system::error_code, std::size_t)>(
+ detail::initiate_async_read_dynbuf_v1<AsyncReadStream>(s),
+ token, basic_streambuf_ref<Allocator>(b),
+ static_cast<CompletionCondition&&>(completion_condition));
+}
#endif // !defined(BOOST_ASIO_NO_IOSTREAM)
#endif // !defined(BOOST_ASIO_NO_EXTENSIONS)
@@ -1307,7 +1387,7 @@ auto async_read(AsyncReadStream& s, basic_streambuf<Allocator>& b,
* Regardless of whether the asynchronous operation completes immediately or
* not, the completion handler will not be invoked from within this function.
* On immediate completion, invocation of the handler will be performed in a
- * manner equivalent to using boost::asio::post().
+ * manner equivalent to using boost::asio::async_immediate().
*
* @par Completion Signature
* @code void(boost::system::error_code, std::size_t) @endcode
@@ -1333,17 +1413,26 @@ template <typename AsyncReadStream, typename DynamicBuffer_v2,
BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
std::size_t)) ReadToken = default_completion_token_t<
typename AsyncReadStream::executor_type>>
-auto async_read(AsyncReadStream& s, DynamicBuffer_v2 buffers,
+inline auto async_read(AsyncReadStream& s, DynamicBuffer_v2 buffers,
ReadToken&& token = default_completion_token_t<
typename AsyncReadStream::executor_type>(),
constraint_t<
is_dynamic_buffer_v2<DynamicBuffer_v2>::value
+ > = 0,
+ constraint_t<
+ !is_completion_condition<ReadToken>::value
> = 0)
-> decltype(
async_initiate<ReadToken,
void (boost::system::error_code, std::size_t)>(
declval<detail::initiate_async_read_dynbuf_v2<AsyncReadStream>>(),
- token, static_cast<DynamicBuffer_v2&&>(buffers), transfer_all()));
+ token, static_cast<DynamicBuffer_v2&&>(buffers), transfer_all()))
+{
+ return async_initiate<ReadToken,
+ void (boost::system::error_code, std::size_t)>(
+ detail::initiate_async_read_dynbuf_v2<AsyncReadStream>(s),
+ token, static_cast<DynamicBuffer_v2&&>(buffers), transfer_all());
+}
/// Start an asynchronous operation to read a certain amount of data from a
/// stream.
@@ -1403,7 +1492,7 @@ auto async_read(AsyncReadStream& s, DynamicBuffer_v2 buffers,
* Regardless of whether the asynchronous operation completes immediately or
* not, the completion handler will not be invoked from within this function.
* On immediate completion, invocation of the handler will be performed in a
- * manner equivalent to using boost::asio::post().
+ * manner equivalent to using boost::asio::async_immediate().
*
* @par Completion Signature
* @code void(boost::system::error_code, std::size_t) @endcode
@@ -1424,19 +1513,29 @@ template <typename AsyncReadStream,
BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
std::size_t)) ReadToken = default_completion_token_t<
typename AsyncReadStream::executor_type>>
-auto async_read(AsyncReadStream& s, DynamicBuffer_v2 buffers,
+inline auto async_read(AsyncReadStream& s, DynamicBuffer_v2 buffers,
CompletionCondition completion_condition,
ReadToken&& token = default_completion_token_t<
typename AsyncReadStream::executor_type>(),
constraint_t<
is_dynamic_buffer_v2<DynamicBuffer_v2>::value
+ > = 0,
+ constraint_t<
+ is_completion_condition<CompletionCondition>::value
> = 0)
-> decltype(
async_initiate<ReadToken,
void (boost::system::error_code, std::size_t)>(
declval<detail::initiate_async_read_dynbuf_v2<AsyncReadStream>>(),
token, static_cast<DynamicBuffer_v2&&>(buffers),
- static_cast<CompletionCondition&&>(completion_condition)));
+ static_cast<CompletionCondition&&>(completion_condition)))
+{
+ return async_initiate<ReadToken,
+ void (boost::system::error_code, std::size_t)>(
+ detail::initiate_async_read_dynbuf_v2<AsyncReadStream>(s),
+ token, static_cast<DynamicBuffer_v2&&>(buffers),
+ static_cast<CompletionCondition&&>(completion_condition));
+}
/*@}*/
diff --git a/contrib/restricted/boost/asio/include/boost/asio/read_at.hpp b/contrib/restricted/boost/asio/include/boost/asio/read_at.hpp
index 482d169bf49..ee6f267fcbd 100644
--- a/contrib/restricted/boost/asio/include/boost/asio/read_at.hpp
+++ b/contrib/restricted/boost/asio/include/boost/asio/read_at.hpp
@@ -191,7 +191,10 @@ template <typename SyncRandomAccessReadDevice, typename MutableBufferSequence,
typename CompletionCondition>
std::size_t read_at(SyncRandomAccessReadDevice& d,
uint64_t offset, const MutableBufferSequence& buffers,
- CompletionCondition completion_condition);
+ CompletionCondition completion_condition,
+ constraint_t<
+ is_completion_condition<CompletionCondition>::value
+ > = 0);
/// Attempt to read a certain amount of data at the specified offset before
/// returning.
@@ -240,7 +243,10 @@ template <typename SyncRandomAccessReadDevice, typename MutableBufferSequence,
typename CompletionCondition>
std::size_t read_at(SyncRandomAccessReadDevice& d,
uint64_t offset, const MutableBufferSequence& buffers,
- CompletionCondition completion_condition, boost::system::error_code& ec);
+ CompletionCondition completion_condition, boost::system::error_code& ec,
+ constraint_t<
+ is_completion_condition<CompletionCondition>::value
+ > = 0);
#if !defined(BOOST_ASIO_NO_EXTENSIONS)
#if !defined(BOOST_ASIO_NO_IOSTREAM)
@@ -351,7 +357,10 @@ template <typename SyncRandomAccessReadDevice, typename Allocator,
typename CompletionCondition>
std::size_t read_at(SyncRandomAccessReadDevice& d,
uint64_t offset, basic_streambuf<Allocator>& b,
- CompletionCondition completion_condition);
+ CompletionCondition completion_condition,
+ constraint_t<
+ is_completion_condition<CompletionCondition>::value
+ > = 0);
/// Attempt to read a certain amount of data at the specified offset before
/// returning.
@@ -395,7 +404,10 @@ template <typename SyncRandomAccessReadDevice, typename Allocator,
typename CompletionCondition>
std::size_t read_at(SyncRandomAccessReadDevice& d,
uint64_t offset, basic_streambuf<Allocator>& b,
- CompletionCondition completion_condition, boost::system::error_code& ec);
+ CompletionCondition completion_condition, boost::system::error_code& ec,
+ constraint_t<
+ is_completion_condition<CompletionCondition>::value
+ > = 0);
#endif // !defined(BOOST_ASIO_NO_IOSTREAM)
#endif // !defined(BOOST_ASIO_NO_EXTENSIONS)
@@ -454,7 +466,7 @@ std::size_t read_at(SyncRandomAccessReadDevice& d,
* Regardless of whether the asynchronous operation completes immediately or
* not, the completion handler will not be invoked from within this function.
* On immediate completion, invocation of the handler will be performed in a
- * manner equivalent to using boost::asio::post().
+ * manner equivalent to using boost::asio::async_immediate().
*
* @par Completion Signature
* @code void(boost::system::error_code, std::size_t) @endcode
@@ -489,15 +501,24 @@ template <typename AsyncRandomAccessReadDevice, typename MutableBufferSequence,
BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
std::size_t)) ReadToken = default_completion_token_t<
typename AsyncRandomAccessReadDevice::executor_type>>
-auto async_read_at(AsyncRandomAccessReadDevice& d,
+inline auto async_read_at(AsyncRandomAccessReadDevice& d,
uint64_t offset, const MutableBufferSequence& buffers,
ReadToken&& token = default_completion_token_t<
- typename AsyncRandomAccessReadDevice::executor_type>())
+ typename AsyncRandomAccessReadDevice::executor_type>(),
+ constraint_t<
+ !is_completion_condition<ReadToken>::value
+ > = 0)
-> decltype(
async_initiate<ReadToken,
void (boost::system::error_code, std::size_t)>(
declval<detail::initiate_async_read_at<AsyncRandomAccessReadDevice>>(),
- token, offset, buffers, transfer_all()));
+ token, offset, buffers, transfer_all()))
+{
+ return async_initiate<ReadToken,
+ void (boost::system::error_code, std::size_t)>(
+ detail::initiate_async_read_at<AsyncRandomAccessReadDevice>(d),
+ token, offset, buffers, transfer_all());
+}
/// Start an asynchronous operation to read a certain amount of data at the
/// specified offset.
@@ -555,7 +576,7 @@ auto async_read_at(AsyncRandomAccessReadDevice& d,
* Regardless of whether the asynchronous operation completes immediately or
* not, the completion handler will not be invoked from within this function.
* On immediate completion, invocation of the handler will be performed in a
- * manner equivalent to using boost::asio::post().
+ * manner equivalent to using boost::asio::async_immediate().
*
* @par Completion Signature
* @code void(boost::system::error_code, std::size_t) @endcode
@@ -586,17 +607,27 @@ template <typename AsyncRandomAccessReadDevice,
BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
std::size_t)) ReadToken = default_completion_token_t<
typename AsyncRandomAccessReadDevice::executor_type>>
-auto async_read_at(AsyncRandomAccessReadDevice& d,
+inline auto async_read_at(AsyncRandomAccessReadDevice& d,
uint64_t offset, const MutableBufferSequence& buffers,
CompletionCondition completion_condition,
ReadToken&& token = default_completion_token_t<
- typename AsyncRandomAccessReadDevice::executor_type>())
+ typename AsyncRandomAccessReadDevice::executor_type>(),
+ constraint_t<
+ is_completion_condition<CompletionCondition>::value
+ > = 0)
-> decltype(
async_initiate<ReadToken,
void (boost::system::error_code, std::size_t)>(
declval<detail::initiate_async_read_at<AsyncRandomAccessReadDevice>>(),
token, offset, buffers,
- static_cast<CompletionCondition&&>(completion_condition)));
+ static_cast<CompletionCondition&&>(completion_condition)))
+{
+ return async_initiate<ReadToken,
+ void (boost::system::error_code, std::size_t)>(
+ detail::initiate_async_read_at<AsyncRandomAccessReadDevice>(d),
+ token, offset, buffers,
+ static_cast<CompletionCondition&&>(completion_condition));
+}
#if !defined(BOOST_ASIO_NO_EXTENSIONS)
#if !defined(BOOST_ASIO_NO_IOSTREAM)
@@ -641,7 +672,7 @@ auto async_read_at(AsyncRandomAccessReadDevice& d,
* Regardless of whether the asynchronous operation completes immediately or
* not, the completion handler will not be invoked from within this function.
* On immediate completion, invocation of the handler will be performed in a
- * manner equivalent to using boost::asio::post().
+ * manner equivalent to using boost::asio::async_immediate().
*
* @par Completion Signature
* @code void(boost::system::error_code, std::size_t) @endcode
@@ -667,16 +698,25 @@ template <typename AsyncRandomAccessReadDevice, typename Allocator,
BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
std::size_t)) ReadToken = default_completion_token_t<
typename AsyncRandomAccessReadDevice::executor_type>>
-auto async_read_at(AsyncRandomAccessReadDevice& d,
+inline auto async_read_at(AsyncRandomAccessReadDevice& d,
uint64_t offset, basic_streambuf<Allocator>& b,
ReadToken&& token = default_completion_token_t<
- typename AsyncRandomAccessReadDevice::executor_type>())
+ typename AsyncRandomAccessReadDevice::executor_type>(),
+ constraint_t<
+ !is_completion_condition<ReadToken>::value
+ > = 0)
-> decltype(
async_initiate<ReadToken,
void (boost::system::error_code, std::size_t)>(
declval<detail::initiate_async_read_at_streambuf<
AsyncRandomAccessReadDevice>>(),
- token, offset, &b, transfer_all()));
+ token, offset, &b, transfer_all()))
+{
+ return async_initiate<ReadToken,
+ void (boost::system::error_code, std::size_t)>(
+ detail::initiate_async_read_at_streambuf<AsyncRandomAccessReadDevice>(d),
+ token, offset, &b, transfer_all());
+}
/// Start an asynchronous operation to read a certain amount of data at the
/// specified offset.
@@ -732,7 +772,7 @@ auto async_read_at(AsyncRandomAccessReadDevice& d,
* Regardless of whether the asynchronous operation completes immediately or
* not, the completion handler will not be invoked from within this function.
* On immediate completion, invocation of the handler will be performed in a
- * manner equivalent to using boost::asio::post().
+ * manner equivalent to using boost::asio::async_immediate().
*
* @par Completion Signature
* @code void(boost::system::error_code, std::size_t) @endcode
@@ -753,17 +793,27 @@ template <typename AsyncRandomAccessReadDevice,
BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
std::size_t)) ReadToken = default_completion_token_t<
typename AsyncRandomAccessReadDevice::executor_type>>
-auto async_read_at(AsyncRandomAccessReadDevice& d, uint64_t offset,
+inline auto async_read_at(AsyncRandomAccessReadDevice& d, uint64_t offset,
basic_streambuf<Allocator>& b, CompletionCondition completion_condition,
ReadToken&& token = default_completion_token_t<
- typename AsyncRandomAccessReadDevice::executor_type>())
+ typename AsyncRandomAccessReadDevice::executor_type>(),
+ constraint_t<
+ is_completion_condition<CompletionCondition>::value
+ > = 0)
-> decltype(
async_initiate<ReadToken,
void (boost::system::error_code, std::size_t)>(
declval<detail::initiate_async_read_at_streambuf<
AsyncRandomAccessReadDevice>>(),
token, offset, &b,
- static_cast<CompletionCondition&&>(completion_condition)));
+ static_cast<CompletionCondition&&>(completion_condition)))
+{
+ return async_initiate<ReadToken,
+ void (boost::system::error_code, std::size_t)>(
+ detail::initiate_async_read_at_streambuf<AsyncRandomAccessReadDevice>(d),
+ token, offset, &b,
+ static_cast<CompletionCondition&&>(completion_condition));
+}
#endif // !defined(BOOST_ASIO_NO_IOSTREAM)
#endif // !defined(BOOST_ASIO_NO_EXTENSIONS)
diff --git a/contrib/restricted/boost/asio/include/boost/asio/read_until.hpp b/contrib/restricted/boost/asio/include/boost/asio/read_until.hpp
index 091a5424e2c..0075c3220a3 100644
--- a/contrib/restricted/boost/asio/include/boost/asio/read_until.hpp
+++ b/contrib/restricted/boost/asio/include/boost/asio/read_until.hpp
@@ -1603,7 +1603,7 @@ std::size_t read_until(SyncReadStream& s, DynamicBuffer_v2 buffers,
* Regardless of whether the asynchronous operation completes immediately or
* not, the completion handler will not be invoked from within this function.
* On immediate completion, invocation of the handler will be performed in a
- * manner equivalent to using boost::asio::post().
+ * manner equivalent to using boost::asio::async_immediate().
*
* @par Completion Signature
* @code void(boost::system::error_code, std::size_t) @endcode
@@ -1656,7 +1656,7 @@ template <typename AsyncReadStream, typename DynamicBuffer_v1,
BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
std::size_t)) ReadToken = default_completion_token_t<
typename AsyncReadStream::executor_type>>
-auto async_read_until(AsyncReadStream& s,
+inline auto async_read_until(AsyncReadStream& s,
DynamicBuffer_v1&& buffers, char delim,
ReadToken&& token = default_completion_token_t<
typename AsyncReadStream::executor_type>(),
@@ -1670,7 +1670,13 @@ auto async_read_until(AsyncReadStream& s,
async_initiate<ReadToken,
void (boost::system::error_code, std::size_t)>(
declval<detail::initiate_async_read_until_delim_v1<AsyncReadStream>>(),
- token, static_cast<DynamicBuffer_v1&&>(buffers), delim));
+ token, static_cast<DynamicBuffer_v1&&>(buffers), delim))
+{
+ return async_initiate<ReadToken,
+ void (boost::system::error_code, std::size_t)>(
+ detail::initiate_async_read_until_delim_v1<AsyncReadStream>(s),
+ token, static_cast<DynamicBuffer_v1&&>(buffers), delim);
+}
/// Start an asynchronous operation to read data into a dynamic buffer sequence
/// until it contains a specified delimiter.
@@ -1720,7 +1726,7 @@ auto async_read_until(AsyncReadStream& s,
* Regardless of whether the asynchronous operation completes immediately or
* not, the completion handler will not be invoked from within this function.
* On immediate completion, invocation of the handler will be performed in a
- * manner equivalent to using boost::asio::post().
+ * manner equivalent to using boost::asio::async_immediate().
*
* @par Completion Signature
* @code void(boost::system::error_code, std::size_t) @endcode
@@ -1773,7 +1779,7 @@ template <typename AsyncReadStream, typename DynamicBuffer_v1,
BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
std::size_t)) ReadToken = default_completion_token_t<
typename AsyncReadStream::executor_type>>
-auto async_read_until(AsyncReadStream& s,
+inline auto async_read_until(AsyncReadStream& s,
DynamicBuffer_v1&& buffers,
BOOST_ASIO_STRING_VIEW_PARAM delim,
ReadToken&& token = default_completion_token_t<
@@ -1790,7 +1796,14 @@ auto async_read_until(AsyncReadStream& s,
declval<detail::initiate_async_read_until_delim_string_v1<
AsyncReadStream>>(),
token, static_cast<DynamicBuffer_v1&&>(buffers),
- static_cast<std::string>(delim)));
+ static_cast<std::string>(delim)))
+{
+ return async_initiate<ReadToken,
+ void (boost::system::error_code, std::size_t)>(
+ detail::initiate_async_read_until_delim_string_v1<AsyncReadStream>(s),
+ token, static_cast<DynamicBuffer_v1&&>(buffers),
+ static_cast<std::string>(delim));
+}
#if !defined(BOOST_ASIO_NO_EXTENSIONS)
#if defined(BOOST_ASIO_HAS_BOOST_REGEX) \
@@ -1848,7 +1861,7 @@ auto async_read_until(AsyncReadStream& s,
* Regardless of whether the asynchronous operation completes immediately or
* not, the completion handler will not be invoked from within this function.
* On immediate completion, invocation of the handler will be performed in a
- * manner equivalent to using boost::asio::post().
+ * manner equivalent to using boost::asio::async_immediate().
*
* @par Completion Signature
* @code void(boost::system::error_code, std::size_t) @endcode
@@ -1902,7 +1915,7 @@ template <typename AsyncReadStream, typename DynamicBuffer_v1, typename Traits,
BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
std::size_t)) ReadToken = default_completion_token_t<
typename AsyncReadStream::executor_type>>
-auto async_read_until(AsyncReadStream& s, DynamicBuffer_v1&& buffers,
+inline auto async_read_until(AsyncReadStream& s, DynamicBuffer_v1&& buffers,
const boost::basic_regex<char, Traits>& expr,
ReadToken&& token = default_completion_token_t<
typename AsyncReadStream::executor_type>(),
@@ -1916,7 +1929,13 @@ auto async_read_until(AsyncReadStream& s, DynamicBuffer_v1&& buffers,
async_initiate<ReadToken,
void (boost::system::error_code, std::size_t)>(
declval<detail::initiate_async_read_until_expr_v1<AsyncReadStream>>(),
- token, static_cast<DynamicBuffer_v1&&>(buffers), expr));
+ token, static_cast<DynamicBuffer_v1&&>(buffers), expr))
+{
+ return async_initiate<ReadToken,
+ void (boost::system::error_code, std::size_t)>(
+ detail::initiate_async_read_until_expr_v1<AsyncReadStream>(s),
+ token, static_cast<DynamicBuffer_v1&&>(buffers), expr);
+}
#endif // defined(BOOST_ASIO_HAS_BOOST_REGEX)
// || defined(GENERATING_DOCUMENTATION)
@@ -1984,7 +2003,7 @@ auto async_read_until(AsyncReadStream& s, DynamicBuffer_v1&& buffers,
* Regardless of whether the asynchronous operation completes immediately or
* not, the completion handler will not be invoked from within this function.
* On immediate completion, invocation of the handler will be performed in a
- * manner equivalent to using boost::asio::post().
+ * manner equivalent to using boost::asio::async_immediate().
*
* @note After a successful async_read_until operation, the dynamic buffer
* sequence may contain additional data beyond that which matched the function
@@ -2070,7 +2089,7 @@ template <typename AsyncReadStream,
BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
std::size_t)) ReadToken = default_completion_token_t<
typename AsyncReadStream::executor_type>>
-auto async_read_until(AsyncReadStream& s,
+inline auto async_read_until(AsyncReadStream& s,
DynamicBuffer_v1&& buffers, MatchCondition match_condition,
ReadToken&& token = default_completion_token_t<
typename AsyncReadStream::executor_type>(),
@@ -2088,7 +2107,14 @@ auto async_read_until(AsyncReadStream& s,
void (boost::system::error_code, std::size_t)>(
declval<detail::initiate_async_read_until_match_v1<AsyncReadStream>>(),
token, static_cast<DynamicBuffer_v1&&>(buffers),
- match_condition));
+ match_condition))
+{
+ return async_initiate<ReadToken,
+ void (boost::system::error_code, std::size_t)>(
+ detail::initiate_async_read_until_match_v1<AsyncReadStream>(s),
+ token, static_cast<DynamicBuffer_v1&&>(buffers),
+ match_condition);
+}
#if !defined(BOOST_ASIO_NO_IOSTREAM)
@@ -2139,7 +2165,7 @@ auto async_read_until(AsyncReadStream& s,
* Regardless of whether the asynchronous operation completes immediately or
* not, the completion handler will not be invoked from within this function.
* On immediate completion, invocation of the handler will be performed in a
- * manner equivalent to using boost::asio::post().
+ * manner equivalent to using boost::asio::async_immediate().
*
* @par Completion Signature
* @code void(boost::system::error_code, std::size_t) @endcode
@@ -2191,7 +2217,7 @@ template <typename AsyncReadStream, typename Allocator,
BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
std::size_t)) ReadToken = default_completion_token_t<
typename AsyncReadStream::executor_type>>
-auto async_read_until(AsyncReadStream& s,
+inline auto async_read_until(AsyncReadStream& s,
boost::asio::basic_streambuf<Allocator>& b, char delim,
ReadToken&& token = default_completion_token_t<
typename AsyncReadStream::executor_type>())
@@ -2199,7 +2225,13 @@ auto async_read_until(AsyncReadStream& s,
async_initiate<ReadToken,
void (boost::system::error_code, std::size_t)>(
declval<detail::initiate_async_read_until_delim_v1<AsyncReadStream>>(),
- token, basic_streambuf_ref<Allocator>(b), delim));
+ token, basic_streambuf_ref<Allocator>(b), delim))
+{
+ return async_initiate<ReadToken,
+ void (boost::system::error_code, std::size_t)>(
+ detail::initiate_async_read_until_delim_v1<AsyncReadStream>(s),
+ token, basic_streambuf_ref<Allocator>(b), delim);
+}
/// Start an asynchronous operation to read data into a streambuf until it
/// contains a specified delimiter.
@@ -2248,7 +2280,7 @@ auto async_read_until(AsyncReadStream& s,
* Regardless of whether the asynchronous operation completes immediately or
* not, the completion handler will not be invoked from within this function.
* On immediate completion, invocation of the handler will be performed in a
- * manner equivalent to using boost::asio::post().
+ * manner equivalent to using boost::asio::async_immediate().
*
* @par Completion Signature
* @code void(boost::system::error_code, std::size_t) @endcode
@@ -2300,7 +2332,7 @@ template <typename AsyncReadStream, typename Allocator,
BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
std::size_t)) ReadToken = default_completion_token_t<
typename AsyncReadStream::executor_type>>
-auto async_read_until(AsyncReadStream& s,
+inline auto async_read_until(AsyncReadStream& s,
boost::asio::basic_streambuf<Allocator>& b,
BOOST_ASIO_STRING_VIEW_PARAM delim,
ReadToken&& token = default_completion_token_t<
@@ -2311,7 +2343,14 @@ auto async_read_until(AsyncReadStream& s,
declval<detail::initiate_async_read_until_delim_string_v1<
AsyncReadStream>>(),
token, basic_streambuf_ref<Allocator>(b),
- static_cast<std::string>(delim)));
+ static_cast<std::string>(delim)))
+{
+ return async_initiate<ReadToken,
+ void (boost::system::error_code, std::size_t)>(
+ detail::initiate_async_read_until_delim_string_v1<AsyncReadStream>(s),
+ token, basic_streambuf_ref<Allocator>(b),
+ static_cast<std::string>(delim));
+}
#if defined(BOOST_ASIO_HAS_BOOST_REGEX) \
|| defined(GENERATING_DOCUMENTATION)
@@ -2365,7 +2404,7 @@ auto async_read_until(AsyncReadStream& s,
* Regardless of whether the asynchronous operation completes immediately or
* not, the completion handler will not be invoked from within this function.
* On immediate completion, invocation of the handler will be performed in a
- * manner equivalent to using boost::asio::post().
+ * manner equivalent to using boost::asio::async_immediate().
*
* @par Completion Signature
* @code void(boost::system::error_code, std::size_t) @endcode
@@ -2418,7 +2457,7 @@ template <typename AsyncReadStream, typename Allocator, typename Traits,
BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
std::size_t)) ReadToken = default_completion_token_t<
typename AsyncReadStream::executor_type>>
-auto async_read_until(AsyncReadStream& s,
+inline auto async_read_until(AsyncReadStream& s,
boost::asio::basic_streambuf<Allocator>& b,
const boost::basic_regex<char, Traits>& expr,
ReadToken&& token = default_completion_token_t<
@@ -2427,7 +2466,13 @@ auto async_read_until(AsyncReadStream& s,
async_initiate<ReadToken,
void (boost::system::error_code, std::size_t)>(
declval<detail::initiate_async_read_until_expr_v1<AsyncReadStream>>(),
- token, basic_streambuf_ref<Allocator>(b), expr));
+ token, basic_streambuf_ref<Allocator>(b), expr))
+{
+ return async_initiate<ReadToken,
+ void (boost::system::error_code, std::size_t)>(
+ detail::initiate_async_read_until_expr_v1<AsyncReadStream>(s),
+ token, basic_streambuf_ref<Allocator>(b), expr);
+}
#endif // defined(BOOST_ASIO_HAS_BOOST_REGEX)
// || defined(GENERATING_DOCUMENTATION)
@@ -2492,7 +2537,7 @@ auto async_read_until(AsyncReadStream& s,
* Regardless of whether the asynchronous operation completes immediately or
* not, the completion handler will not be invoked from within this function.
* On immediate completion, invocation of the handler will be performed in a
- * manner equivalent to using boost::asio::post().
+ * manner equivalent to using boost::asio::async_immediate().
*
* @note After a successful async_read_until operation, the streambuf may
* contain additional data beyond that which matched the function object. An
@@ -2576,7 +2621,7 @@ template <typename AsyncReadStream, typename Allocator, typename MatchCondition,
BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
std::size_t)) ReadToken = default_completion_token_t<
typename AsyncReadStream::executor_type>>
-auto async_read_until(AsyncReadStream& s,
+inline auto async_read_until(AsyncReadStream& s,
boost::asio::basic_streambuf<Allocator>& b, MatchCondition match_condition,
ReadToken&& token = default_completion_token_t<
typename AsyncReadStream::executor_type>(),
@@ -2585,7 +2630,13 @@ auto async_read_until(AsyncReadStream& s,
async_initiate<ReadToken,
void (boost::system::error_code, std::size_t)>(
declval<detail::initiate_async_read_until_match_v1<AsyncReadStream>>(),
- token, basic_streambuf_ref<Allocator>(b), match_condition));
+ token, basic_streambuf_ref<Allocator>(b), match_condition))
+{
+ return async_initiate<ReadToken,
+ void (boost::system::error_code, std::size_t)>(
+ detail::initiate_async_read_until_match_v1<AsyncReadStream>(s),
+ token, basic_streambuf_ref<Allocator>(b), match_condition);
+}
#endif // !defined(BOOST_ASIO_NO_IOSTREAM)
#endif // !defined(BOOST_ASIO_NO_EXTENSIONS)
@@ -2640,7 +2691,7 @@ auto async_read_until(AsyncReadStream& s,
* Regardless of whether the asynchronous operation completes immediately or
* not, the completion handler will not be invoked from within this function.
* On immediate completion, invocation of the handler will be performed in a
- * manner equivalent to using boost::asio::post().
+ * manner equivalent to using boost::asio::async_immediate().
*
* @par Completion Signature
* @code void(boost::system::error_code, std::size_t) @endcode
@@ -2693,7 +2744,8 @@ template <typename AsyncReadStream, typename DynamicBuffer_v2,
BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
std::size_t)) ReadToken = default_completion_token_t<
typename AsyncReadStream::executor_type>>
-auto async_read_until(AsyncReadStream& s, DynamicBuffer_v2 buffers, char delim,
+inline auto async_read_until(AsyncReadStream& s,
+ DynamicBuffer_v2 buffers, char delim,
ReadToken&& token = default_completion_token_t<
typename AsyncReadStream::executor_type>(),
constraint_t<
@@ -2703,7 +2755,13 @@ auto async_read_until(AsyncReadStream& s, DynamicBuffer_v2 buffers, char delim,
async_initiate<ReadToken,
void (boost::system::error_code, std::size_t)>(
declval<detail::initiate_async_read_until_delim_v2<AsyncReadStream>>(),
- token, static_cast<DynamicBuffer_v2&&>(buffers), delim));
+ token, static_cast<DynamicBuffer_v2&&>(buffers), delim))
+{
+ return async_initiate<ReadToken,
+ void (boost::system::error_code, std::size_t)>(
+ detail::initiate_async_read_until_delim_v2<AsyncReadStream>(s),
+ token, static_cast<DynamicBuffer_v2&&>(buffers), delim);
+}
/// Start an asynchronous operation to read data into a dynamic buffer sequence
/// until it contains a specified delimiter.
@@ -2753,7 +2811,7 @@ auto async_read_until(AsyncReadStream& s, DynamicBuffer_v2 buffers, char delim,
* Regardless of whether the asynchronous operation completes immediately or
* not, the completion handler will not be invoked from within this function.
* On immediate completion, invocation of the handler will be performed in a
- * manner equivalent to using boost::asio::post().
+ * manner equivalent to using boost::asio::async_immediate().
*
* @par Completion Signature
* @code void(boost::system::error_code, std::size_t) @endcode
@@ -2806,7 +2864,7 @@ template <typename AsyncReadStream, typename DynamicBuffer_v2,
BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
std::size_t)) ReadToken = default_completion_token_t<
typename AsyncReadStream::executor_type>>
-auto async_read_until(AsyncReadStream& s, DynamicBuffer_v2 buffers,
+inline auto async_read_until(AsyncReadStream& s, DynamicBuffer_v2 buffers,
BOOST_ASIO_STRING_VIEW_PARAM delim,
ReadToken&& token = default_completion_token_t<
typename AsyncReadStream::executor_type>(),
@@ -2819,7 +2877,14 @@ auto async_read_until(AsyncReadStream& s, DynamicBuffer_v2 buffers,
declval<detail::initiate_async_read_until_delim_string_v2<
AsyncReadStream>>(),
token, static_cast<DynamicBuffer_v2&&>(buffers),
- static_cast<std::string>(delim)));
+ static_cast<std::string>(delim)))
+{
+ return async_initiate<ReadToken,
+ void (boost::system::error_code, std::size_t)>(
+ detail::initiate_async_read_until_delim_string_v2<AsyncReadStream>(s),
+ token, static_cast<DynamicBuffer_v2&&>(buffers),
+ static_cast<std::string>(delim));
+}
#if !defined(BOOST_ASIO_NO_EXTENSIONS)
#if defined(BOOST_ASIO_HAS_BOOST_REGEX) \
@@ -2877,7 +2942,7 @@ auto async_read_until(AsyncReadStream& s, DynamicBuffer_v2 buffers,
* Regardless of whether the asynchronous operation completes immediately or
* not, the completion handler will not be invoked from within this function.
* On immediate completion, invocation of the handler will be performed in a
- * manner equivalent to using boost::asio::post().
+ * manner equivalent to using boost::asio::async_immediate().
*
* @par Completion Signature
* @code void(boost::system::error_code, std::size_t) @endcode
@@ -2931,7 +2996,7 @@ template <typename AsyncReadStream, typename DynamicBuffer_v2, typename Traits,
BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
std::size_t)) ReadToken = default_completion_token_t<
typename AsyncReadStream::executor_type>>
-auto async_read_until(AsyncReadStream& s, DynamicBuffer_v2 buffers,
+inline auto async_read_until(AsyncReadStream& s, DynamicBuffer_v2 buffers,
const boost::basic_regex<char, Traits>& expr,
ReadToken&& token = default_completion_token_t<
typename AsyncReadStream::executor_type>(),
@@ -2942,7 +3007,13 @@ auto async_read_until(AsyncReadStream& s, DynamicBuffer_v2 buffers,
async_initiate<ReadToken,
void (boost::system::error_code, std::size_t)>(
declval<detail::initiate_async_read_until_expr_v2<AsyncReadStream>>(),
- token, static_cast<DynamicBuffer_v2&&>(buffers), expr));
+ token, static_cast<DynamicBuffer_v2&&>(buffers), expr))
+{
+ return async_initiate<ReadToken,
+ void (boost::system::error_code, std::size_t)>(
+ detail::initiate_async_read_until_expr_v2<AsyncReadStream>(s),
+ token, static_cast<DynamicBuffer_v2&&>(buffers), expr);
+}
#endif // defined(BOOST_ASIO_HAS_BOOST_REGEX)
// || defined(GENERATING_DOCUMENTATION)
@@ -3010,7 +3081,7 @@ auto async_read_until(AsyncReadStream& s, DynamicBuffer_v2 buffers,
* Regardless of whether the asynchronous operation completes immediately or
* not, the completion handler will not be invoked from within this function.
* On immediate completion, invocation of the handler will be performed in a
- * manner equivalent to using boost::asio::post().
+ * manner equivalent to using boost::asio::async_immediate().
*
* @note After a successful async_read_until operation, the dynamic buffer
* sequence may contain additional data beyond that which matched the function
@@ -3096,7 +3167,7 @@ template <typename AsyncReadStream,
BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
std::size_t)) ReadToken = default_completion_token_t<
typename AsyncReadStream::executor_type>>
-auto async_read_until(AsyncReadStream& s,
+inline auto async_read_until(AsyncReadStream& s,
DynamicBuffer_v2 buffers, MatchCondition match_condition,
ReadToken&& token = default_completion_token_t<
typename AsyncReadStream::executor_type>(),
@@ -3110,7 +3181,14 @@ auto async_read_until(AsyncReadStream& s,
async_initiate<ReadToken,
void (boost::system::error_code, std::size_t)>(
declval<detail::initiate_async_read_until_match_v2<AsyncReadStream>>(),
- token, static_cast<DynamicBuffer_v2&&>(buffers), match_condition));
+ token, static_cast<DynamicBuffer_v2&&>(buffers), match_condition))
+{
+ return async_initiate<ReadToken,
+ void (boost::system::error_code, std::size_t)>(
+ detail::initiate_async_read_until_match_v2<AsyncReadStream>(s),
+ token, static_cast<DynamicBuffer_v2&&>(buffers),
+ match_condition);
+}
#endif // !defined(BOOST_ASIO_NO_EXTENSIONS)
diff --git a/contrib/restricted/boost/asio/include/boost/asio/redirect_error.hpp b/contrib/restricted/boost/asio/include/boost/asio/redirect_error.hpp
index ac01bd856e5..af62e2803dd 100644
--- a/contrib/restricted/boost/asio/include/boost/asio/redirect_error.hpp
+++ b/contrib/restricted/boost/asio/include/boost/asio/redirect_error.hpp
@@ -34,7 +34,7 @@ template <typename CompletionToken>
class redirect_error_t
{
public:
- /// Constructor.
+ /// Constructor.
template <typename T>
redirect_error_t(T&& completion_token, boost::system::error_code& ec)
: token_(static_cast<T&&>(completion_token)),
@@ -47,10 +47,50 @@ public:
boost::system::error_code& ec_;
};
+/// A function object type that adapts a @ref completion_token to capture
+/// error_code values to a variable.
+/**
+ * May also be used directly as a completion token, in which case it adapts the
+ * asynchronous operation's default completion token (or boost::asio::deferred
+ * if no default is available).
+ */
+class partial_redirect_error
+{
+public:
+ /// Constructor that specifies the variable used to capture error_code values.
+ explicit partial_redirect_error(boost::system::error_code& ec)
+ : ec_(ec)
+ {
+ }
+
+ /// Adapt a @ref completion_token to specify that the completion handler
+ /// should capture error_code values to a variable.
+ template <typename CompletionToken>
+ BOOST_ASIO_NODISCARD inline
+ constexpr redirect_error_t<decay_t<CompletionToken>>
+ operator()(CompletionToken&& completion_token) const
+ {
+ return redirect_error_t<decay_t<CompletionToken>>(
+ static_cast<CompletionToken&&>(completion_token), ec_);
+ }
+
+//private:
+ boost::system::error_code& ec_;
+};
+
+/// Create a partial completion token adapter that captures error_code values
+/// to a variable.
+BOOST_ASIO_NODISCARD inline partial_redirect_error
+redirect_error(boost::system::error_code& ec)
+{
+ return partial_redirect_error(ec);
+}
+
/// Adapt a @ref completion_token to capture error_code values to a variable.
template <typename CompletionToken>
-inline redirect_error_t<decay_t<CompletionToken>> redirect_error(
- CompletionToken&& completion_token, boost::system::error_code& ec)
+BOOST_ASIO_NODISCARD inline redirect_error_t<decay_t<CompletionToken>>
+redirect_error(CompletionToken&& completion_token,
+ boost::system::error_code& ec)
{
return redirect_error_t<decay_t<CompletionToken>>(
static_cast<CompletionToken&&>(completion_token), ec);
diff --git a/contrib/restricted/boost/asio/include/boost/asio/registered_buffer.hpp b/contrib/restricted/boost/asio/include/boost/asio/registered_buffer.hpp
index b2c78363cbd..1396b20e70c 100644
--- a/contrib/restricted/boost/asio/include/boost/asio/registered_buffer.hpp
+++ b/contrib/restricted/boost/asio/include/boost/asio/registered_buffer.hpp
@@ -79,7 +79,7 @@ private:
};
/// Holds a registered buffer over modifiable data.
-/**
+/**
* Satisfies the @c MutableBufferSequence type requirements.
*/
class mutable_registered_buffer
@@ -150,7 +150,7 @@ private:
};
/// Holds a registered buffer over non-modifiable data.
-/**
+/**
* Satisfies the @c ConstBufferSequence type requirements.
*/
class const_registered_buffer
diff --git a/contrib/restricted/boost/asio/include/boost/asio/spawn.hpp b/contrib/restricted/boost/asio/include/boost/asio/spawn.hpp
index 765518e025a..d7c508a4e47 100644
--- a/contrib/restricted/boost/asio/include/boost/asio/spawn.hpp
+++ b/contrib/restricted/boost/asio/include/boost/asio/spawn.hpp
@@ -146,7 +146,6 @@ private:
}
};
-
template <typename T>
struct spawn_signature
{
diff --git a/contrib/restricted/boost/asio/include/boost/asio/ssl/detail/impl/openssl_init.ipp b/contrib/restricted/boost/asio/include/boost/asio/ssl/detail/impl/openssl_init.ipp
index 23be3b66725..ea10e242fb0 100644
--- a/contrib/restricted/boost/asio/include/boost/asio/ssl/detail/impl/openssl_init.ipp
+++ b/contrib/restricted/boost/asio/include/boost/asio/ssl/detail/impl/openssl_init.ipp
@@ -38,7 +38,7 @@ public:
{
#if (OPENSSL_VERSION_NUMBER < 0x10100000L)
::SSL_library_init();
- ::SSL_load_error_strings();
+ ::SSL_load_error_strings();
::OpenSSL_add_all_algorithms();
mutexes_.resize(::CRYPTO_num_locks());
@@ -124,7 +124,7 @@ private:
#endif // (OPENSSL_VERSION_NUMBER < 0x10000000L)
#if (OPENSSL_VERSION_NUMBER < 0x10100000L)
- static void openssl_locking_func(int mode, int n,
+ static void openssl_locking_func(int mode, int n,
const char* /*file*/, int /*line*/)
{
if (mode & CRYPTO_LOCK)
diff --git a/contrib/restricted/boost/asio/include/boost/asio/ssl/impl/context.ipp b/contrib/restricted/boost/asio/include/boost/asio/ssl/impl/context.ipp
index 86f97447e1d..3b1b7f53603 100644
--- a/contrib/restricted/boost/asio/include/boost/asio/ssl/impl/context.ipp
+++ b/contrib/restricted/boost/asio/include/boost/asio/ssl/impl/context.ipp
@@ -270,8 +270,9 @@ context::context(context::method m)
#endif // defined(SSL_TXT_TLSV1_2)
// TLS v1.3.
-#if (OPENSSL_VERSION_NUMBER >= 0x10101000L) \
- && !defined(LIBRESSL_VERSION_NUMBER)
+#if ((OPENSSL_VERSION_NUMBER >= 0x10101000L) \
+ && !defined(LIBRESSL_VERSION_NUMBER)) \
+ || defined(BOOST_ASIO_USE_WOLFSSL)
case context::tlsv13:
handle_ = ::SSL_CTX_new(::TLS_method());
if (handle_)
@@ -296,16 +297,18 @@ context::context(context::method m)
SSL_CTX_set_max_proto_version(handle_, TLS1_3_VERSION);
}
break;
-#else // (OPENSSL_VERSION_NUMBER >= 0x10101000L)
- // && !defined(LIBRESSL_VERSION_NUMBER)
+#else // ((OPENSSL_VERSION_NUMBER >= 0x10101000L)
+ // && !defined(LIBRESSL_VERSION_NUMBER))
+ // || defined(BOOST_ASIO_USE_WOLFSSL)
case context::tlsv13:
case context::tlsv13_client:
case context::tlsv13_server:
boost::asio::detail::throw_error(
boost::asio::error::invalid_argument, "context");
break;
-#endif // (OPENSSL_VERSION_NUMBER >= 0x10101000L)
- // && !defined(LIBRESSL_VERSION_NUMBER)
+#endif // ((OPENSSL_VERSION_NUMBER >= 0x10101000L)
+ // && !defined(LIBRESSL_VERSION_NUMBER))
+ // || defined(BOOST_ASIO_USE_WOLFSSL)
// Any supported SSL/TLS version.
case context::sslv23:
@@ -795,7 +798,7 @@ BOOST_ASIO_SYNC_OP_VOID context::use_certificate_chain(
BOOST_ASIO_SYNC_OP_VOID_RETURN(ec);
}
}
-
+
result = ::ERR_peek_last_error();
if ((ERR_GET_LIB(result) == ERR_LIB_PEM)
&& (ERR_GET_REASON(result) == PEM_R_NO_START_LINE))
diff --git a/contrib/restricted/boost/asio/include/boost/asio/ssl/stream.hpp b/contrib/restricted/boost/asio/include/boost/asio/ssl/stream.hpp
index 30660c8a88c..de2559beace 100644
--- a/contrib/restricted/boost/asio/include/boost/asio/ssl/stream.hpp
+++ b/contrib/restricted/boost/asio/include/boost/asio/ssl/stream.hpp
@@ -482,7 +482,7 @@ public:
* Regardless of whether the asynchronous operation completes immediately or
* not, the completion handler will not be invoked from within this function.
* On immediate completion, invocation of the handler will be performed in a
- * manner equivalent to using boost::asio::post().
+ * manner equivalent to using boost::asio::async_immediate().
*
* @par Completion Signature
* @code void(boost::system::error_code) @endcode
@@ -539,7 +539,7 @@ public:
* Regardless of whether the asynchronous operation completes immediately or
* not, the completion handler will not be invoked from within this function.
* On immediate completion, invocation of the handler will be performed in a
- * manner equivalent to using boost::asio::post().
+ * manner equivalent to using boost::asio::async_immediate().
*
* @par Completion Signature
* @code void(boost::system::error_code, std::size_t) @endcode
@@ -619,7 +619,7 @@ public:
* Regardless of whether the asynchronous operation completes immediately or
* not, the completion handler will not be invoked from within this function.
* On immediate completion, invocation of the handler will be performed in a
- * manner equivalent to using boost::asio::post().
+ * manner equivalent to using boost::asio::async_immediate().
*
* @par Completion Signature
* @code void(boost::system::error_code) @endcode
@@ -723,7 +723,7 @@ public:
* Regardless of whether the asynchronous operation completes immediately or
* not, the completion handler will not be invoked from within this function.
* On immediate completion, invocation of the handler will be performed in a
- * manner equivalent to using boost::asio::post().
+ * manner equivalent to using boost::asio::async_immediate().
*
* @par Completion Signature
* @code void(boost::system::error_code, std::size_t) @endcode
@@ -831,7 +831,7 @@ public:
* Regardless of whether the asynchronous operation completes immediately or
* not, the completion handler will not be invoked from within this function.
* On immediate completion, invocation of the handler will be performed in a
- * manner equivalent to using boost::asio::post().
+ * manner equivalent to using boost::asio::async_immediate().
*
* @par Completion Signature
* @code void(boost::system::error_code, std::size_t) @endcode
diff --git a/contrib/restricted/boost/asio/include/boost/asio/this_coro.hpp b/contrib/restricted/boost/asio/include/boost/asio/this_coro.hpp
index 936d360b6b1..02accdf787a 100644
--- a/contrib/restricted/boost/asio/include/boost/asio/this_coro.hpp
+++ b/contrib/restricted/boost/asio/include/boost/asio/this_coro.hpp
@@ -33,7 +33,7 @@ struct executor_t
};
/// Awaitable object that returns the executor of the current coroutine.
-constexpr executor_t executor;
+BOOST_ASIO_INLINE_VARIABLE constexpr executor_t executor;
/// Awaitable type that returns the cancellation state of the current coroutine.
struct cancellation_state_t
@@ -58,7 +58,7 @@ struct cancellation_state_t
* // ...
* } @endcode
*/
-constexpr cancellation_state_t cancellation_state;
+BOOST_ASIO_INLINE_VARIABLE constexpr cancellation_state_t cancellation_state;
#if defined(GENERATING_DOCUMENTATION)
diff --git a/contrib/restricted/boost/asio/include/boost/asio/use_awaitable.hpp b/contrib/restricted/boost/asio/include/boost/asio/use_awaitable.hpp
index cbb8dc52cc7..5e0e95a9c76 100644
--- a/contrib/restricted/boost/asio/include/boost/asio/use_awaitable.hpp
+++ b/contrib/restricted/boost/asio/include/boost/asio/use_awaitable.hpp
@@ -146,9 +146,9 @@ struct use_awaitable_t
* See the documentation for boost::asio::use_awaitable_t for a usage example.
*/
#if defined(GENERATING_DOCUMENTATION)
-constexpr use_awaitable_t<> use_awaitable;
+BOOST_ASIO_INLINE_VARIABLE constexpr use_awaitable_t<> use_awaitable;
#else
-constexpr use_awaitable_t<> use_awaitable(0, 0, 0);
+BOOST_ASIO_INLINE_VARIABLE constexpr use_awaitable_t<> use_awaitable(0, 0, 0);
#endif
} // namespace asio
diff --git a/contrib/restricted/boost/asio/include/boost/asio/use_future.hpp b/contrib/restricted/boost/asio/include/boost/asio/use_future.hpp
index 973bcfec6c5..9f7bd777cfd 100644
--- a/contrib/restricted/boost/asio/include/boost/asio/use_future.hpp
+++ b/contrib/restricted/boost/asio/include/boost/asio/use_future.hpp
@@ -146,7 +146,7 @@ private:
/**
* See the documentation for boost::asio::use_future_t for a usage example.
*/
-constexpr use_future_t<> use_future;
+BOOST_ASIO_INLINE_VARIABLE constexpr use_future_t<> use_future;
} // namespace asio
} // namespace boost
diff --git a/contrib/restricted/boost/asio/include/boost/asio/uses_executor.hpp b/contrib/restricted/boost/asio/include/boost/asio/uses_executor.hpp
index 4105c3b2a4c..d91f2178117 100644
--- a/contrib/restricted/boost/asio/include/boost/asio/uses_executor.hpp
+++ b/contrib/restricted/boost/asio/include/boost/asio/uses_executor.hpp
@@ -46,7 +46,7 @@ struct executor_arg_t
* See boost::asio::executor_arg_t and boost::asio::uses_executor
* for more information.
*/
-constexpr executor_arg_t executor_arg;
+BOOST_ASIO_INLINE_VARIABLE constexpr executor_arg_t executor_arg;
/// The uses_executor trait detects whether a type T has an associated executor
/// that is convertible from type Executor.
diff --git a/contrib/restricted/boost/asio/include/boost/asio/version.hpp b/contrib/restricted/boost/asio/include/boost/asio/version.hpp
index dbb6d2d8cb0..671e1c60db2 100644
--- a/contrib/restricted/boost/asio/include/boost/asio/version.hpp
+++ b/contrib/restricted/boost/asio/include/boost/asio/version.hpp
@@ -18,6 +18,6 @@
// BOOST_ASIO_VERSION % 100 is the sub-minor version
// BOOST_ASIO_VERSION / 100 % 1000 is the minor version
// BOOST_ASIO_VERSION / 100000 is the major version
-#define BOOST_ASIO_VERSION 103002 // 1.30.2
+#define BOOST_ASIO_VERSION 103200 // 1.32.0
#endif // BOOST_ASIO_VERSION_HPP
diff --git a/contrib/restricted/boost/asio/include/boost/asio/windows/basic_object_handle.hpp b/contrib/restricted/boost/asio/include/boost/asio/windows/basic_object_handle.hpp
index e429f75a3b3..d019e9b06a1 100644
--- a/contrib/restricted/boost/asio/include/boost/asio/windows/basic_object_handle.hpp
+++ b/contrib/restricted/boost/asio/include/boost/asio/windows/basic_object_handle.hpp
@@ -416,7 +416,7 @@ public:
* Regardless of whether the asynchronous operation completes immediately or
* not, the completion handler will not be invoked from within this function.
* On immediate completion, invocation of the handler will be performed in a
- * manner equivalent to using boost::asio::post().
+ * manner equivalent to using boost::asio::async_immediate().
*
* @par Completion Signature
* @code void(boost::system::error_code) @endcode
diff --git a/contrib/restricted/boost/asio/include/boost/asio/windows/basic_random_access_handle.hpp b/contrib/restricted/boost/asio/include/boost/asio/windows/basic_random_access_handle.hpp
index 88498ce18cb..7f191ca7d31 100644
--- a/contrib/restricted/boost/asio/include/boost/asio/windows/basic_random_access_handle.hpp
+++ b/contrib/restricted/boost/asio/include/boost/asio/windows/basic_random_access_handle.hpp
@@ -309,7 +309,7 @@ public:
* Regardless of whether the asynchronous operation completes immediately or
* not, the completion handler will not be invoked from within this function.
* On immediate completion, invocation of the handler will be performed in a
- * manner equivalent to using boost::asio::post().
+ * manner equivalent to using boost::asio::async_immediate().
*
* @par Completion Signature
* @code void(boost::system::error_code, std::size_t) @endcode
@@ -445,7 +445,7 @@ public:
* Regardless of whether the asynchronous operation completes immediately or
* not, the completion handler will not be invoked from within this function.
* On immediate completion, invocation of the handler will be performed in a
- * manner equivalent to using boost::asio::post().
+ * manner equivalent to using boost::asio::async_immediate().
*
* @par Completion Signature
* @code void(boost::system::error_code, std::size_t) @endcode
diff --git a/contrib/restricted/boost/asio/include/boost/asio/windows/basic_stream_handle.hpp b/contrib/restricted/boost/asio/include/boost/asio/windows/basic_stream_handle.hpp
index bf8e407453e..68cc7fac5ff 100644
--- a/contrib/restricted/boost/asio/include/boost/asio/windows/basic_stream_handle.hpp
+++ b/contrib/restricted/boost/asio/include/boost/asio/windows/basic_stream_handle.hpp
@@ -300,7 +300,7 @@ public:
* Regardless of whether the asynchronous operation completes immediately or
* not, the completion handler will not be invoked from within this function.
* On immediate completion, invocation of the handler will be performed in a
- * manner equivalent to using boost::asio::post().
+ * manner equivalent to using boost::asio::async_immediate().
*
* @par Completion Signature
* @code void(boost::system::error_code, std::size_t) @endcode
@@ -429,7 +429,7 @@ public:
* Regardless of whether the asynchronous operation completes immediately or
* not, the completion handler will not be invoked from within this function.
* On immediate completion, invocation of the handler will be performed in a
- * manner equivalent to using boost::asio::post().
+ * manner equivalent to using boost::asio::async_immediate().
*
* @par Completion Signature
* @code void(boost::system::error_code, std::size_t) @endcode
diff --git a/contrib/restricted/boost/asio/include/boost/asio/write.hpp b/contrib/restricted/boost/asio/include/boost/asio/write.hpp
index 0fb866b5d5a..9888f79db63 100644
--- a/contrib/restricted/boost/asio/include/boost/asio/write.hpp
+++ b/contrib/restricted/boost/asio/include/boost/asio/write.hpp
@@ -185,6 +185,9 @@ std::size_t write(SyncWriteStream& s, const ConstBufferSequence& buffers,
CompletionCondition completion_condition,
constraint_t<
is_const_buffer_sequence<ConstBufferSequence>::value
+ > = 0,
+ constraint_t<
+ is_completion_condition<CompletionCondition>::value
> = 0);
/// Write a certain amount of data to a stream before returning.
@@ -232,6 +235,9 @@ std::size_t write(SyncWriteStream& s, const ConstBufferSequence& buffers,
CompletionCondition completion_condition, boost::system::error_code& ec,
constraint_t<
is_const_buffer_sequence<ConstBufferSequence>::value
+ > = 0,
+ constraint_t<
+ is_completion_condition<CompletionCondition>::value
> = 0);
#if !defined(BOOST_ASIO_NO_DYNAMIC_BUFFER_V1)
@@ -357,6 +363,9 @@ std::size_t write(SyncWriteStream& s,
> = 0,
constraint_t<
!is_dynamic_buffer_v2<decay_t<DynamicBuffer_v1>>::value
+ > = 0,
+ constraint_t<
+ is_completion_condition<CompletionCondition>::value
> = 0);
/// Write a certain amount of data to a stream before returning.
@@ -406,6 +415,9 @@ std::size_t write(SyncWriteStream& s,
> = 0,
constraint_t<
!is_dynamic_buffer_v2<decay_t<DynamicBuffer_v1>>::value
+ > = 0,
+ constraint_t<
+ is_completion_condition<CompletionCondition>::value
> = 0);
#if !defined(BOOST_ASIO_NO_EXTENSIONS)
@@ -508,7 +520,10 @@ std::size_t write(SyncWriteStream& s, basic_streambuf<Allocator>& b,
template <typename SyncWriteStream, typename Allocator,
typename CompletionCondition>
std::size_t write(SyncWriteStream& s, basic_streambuf<Allocator>& b,
- CompletionCondition completion_condition);
+ CompletionCondition completion_condition,
+ constraint_t<
+ is_completion_condition<CompletionCondition>::value
+ > = 0);
/// Write a certain amount of data to a stream before returning.
/**
@@ -549,7 +564,10 @@ std::size_t write(SyncWriteStream& s, basic_streambuf<Allocator>& b,
template <typename SyncWriteStream, typename Allocator,
typename CompletionCondition>
std::size_t write(SyncWriteStream& s, basic_streambuf<Allocator>& b,
- CompletionCondition completion_condition, boost::system::error_code& ec);
+ CompletionCondition completion_condition, boost::system::error_code& ec,
+ constraint_t<
+ is_completion_condition<CompletionCondition>::value
+ > = 0);
#endif // !defined(BOOST_ASIO_NO_IOSTREAM)
#endif // !defined(BOOST_ASIO_NO_EXTENSIONS)
@@ -664,6 +682,9 @@ std::size_t write(SyncWriteStream& s, DynamicBuffer_v2 buffers,
CompletionCondition completion_condition,
constraint_t<
is_dynamic_buffer_v2<DynamicBuffer_v2>::value
+ > = 0,
+ constraint_t<
+ is_completion_condition<CompletionCondition>::value
> = 0);
/// Write a certain amount of data to a stream before returning.
@@ -709,6 +730,9 @@ std::size_t write(SyncWriteStream& s, DynamicBuffer_v2 buffers,
CompletionCondition completion_condition, boost::system::error_code& ec,
constraint_t<
is_dynamic_buffer_v2<DynamicBuffer_v2>::value
+ > = 0,
+ constraint_t<
+ is_completion_condition<CompletionCondition>::value
> = 0);
/*@}*/
@@ -763,7 +787,7 @@ std::size_t write(SyncWriteStream& s, DynamicBuffer_v2 buffers,
* Regardless of whether the asynchronous operation completes immediately or
* not, the completion handler will not be invoked from within this function.
* On immediate completion, invocation of the handler will be performed in a
- * manner equivalent to using boost::asio::post().
+ * manner equivalent to using boost::asio::async_immediate().
*
* @par Completion Signature
* @code void(boost::system::error_code, std::size_t) @endcode
@@ -792,17 +816,26 @@ template <typename AsyncWriteStream, typename ConstBufferSequence,
BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
std::size_t)) WriteToken
= default_completion_token_t<typename AsyncWriteStream::executor_type>>
-auto async_write(AsyncWriteStream& s, const ConstBufferSequence& buffers,
+inline auto async_write(AsyncWriteStream& s, const ConstBufferSequence& buffers,
WriteToken&& token
= default_completion_token_t<typename AsyncWriteStream::executor_type>(),
constraint_t<
is_const_buffer_sequence<ConstBufferSequence>::value
+ > = 0,
+ constraint_t<
+ !is_completion_condition<decay_t<WriteToken>>::value
> = 0)
-> decltype(
async_initiate<WriteToken,
void (boost::system::error_code, std::size_t)>(
declval<detail::initiate_async_write<AsyncWriteStream>>(),
- token, buffers, transfer_all()));
+ token, buffers, transfer_all()))
+{
+ return async_initiate<WriteToken,
+ void (boost::system::error_code, std::size_t)>(
+ detail::initiate_async_write<AsyncWriteStream>(s),
+ token, buffers, transfer_all());
+}
/// Start an asynchronous operation to write a certain amount of data to a
/// stream.
@@ -861,7 +894,7 @@ auto async_write(AsyncWriteStream& s, const ConstBufferSequence& buffers,
* Regardless of whether the asynchronous operation completes immediately or
* not, the completion handler will not be invoked from within this function.
* On immediate completion, invocation of the handler will be performed in a
- * manner equivalent to using boost::asio::post().
+ * manner equivalent to using boost::asio::async_immediate().
*
* @par Completion Signature
* @code void(boost::system::error_code, std::size_t) @endcode
@@ -890,19 +923,31 @@ auto async_write(AsyncWriteStream& s, const ConstBufferSequence& buffers,
template <typename AsyncWriteStream,
typename ConstBufferSequence, typename CompletionCondition,
BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
- std::size_t)) WriteToken>
-auto async_write(AsyncWriteStream& s, const ConstBufferSequence& buffers,
+ std::size_t)) WriteToken
+ = default_completion_token_t<typename AsyncWriteStream::executor_type>>
+inline auto async_write(AsyncWriteStream& s, const ConstBufferSequence& buffers,
CompletionCondition completion_condition,
- WriteToken&& token,
+ WriteToken&& token
+ = default_completion_token_t<typename AsyncWriteStream::executor_type>(),
constraint_t<
is_const_buffer_sequence<ConstBufferSequence>::value
+ > = 0,
+ constraint_t<
+ is_completion_condition<CompletionCondition>::value
> = 0)
-> decltype(
async_initiate<WriteToken,
void (boost::system::error_code, std::size_t)>(
declval<detail::initiate_async_write<AsyncWriteStream>>(),
token, buffers,
- static_cast<CompletionCondition&&>(completion_condition)));
+ static_cast<CompletionCondition&&>(completion_condition)))
+{
+ return async_initiate<WriteToken,
+ void (boost::system::error_code, std::size_t)>(
+ detail::initiate_async_write<AsyncWriteStream>(s),
+ token, buffers,
+ static_cast<CompletionCondition&&>(completion_condition));
+}
#if !defined(BOOST_ASIO_NO_DYNAMIC_BUFFER_V1)
@@ -949,7 +994,7 @@ auto async_write(AsyncWriteStream& s, const ConstBufferSequence& buffers,
* Regardless of whether the asynchronous operation completes immediately or
* not, the completion handler will not be invoked from within this function.
* On immediate completion, invocation of the handler will be performed in a
- * manner equivalent to using boost::asio::post().
+ * manner equivalent to using boost::asio::async_immediate().
*
* @par Completion Signature
* @code void(boost::system::error_code, std::size_t) @endcode
@@ -969,7 +1014,7 @@ template <typename AsyncWriteStream, typename DynamicBuffer_v1,
BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
std::size_t)) WriteToken
= default_completion_token_t<typename AsyncWriteStream::executor_type>>
-auto async_write(AsyncWriteStream& s, DynamicBuffer_v1&& buffers,
+inline auto async_write(AsyncWriteStream& s, DynamicBuffer_v1&& buffers,
WriteToken&& token
= default_completion_token_t<typename AsyncWriteStream::executor_type>(),
constraint_t<
@@ -977,13 +1022,23 @@ auto async_write(AsyncWriteStream& s, DynamicBuffer_v1&& buffers,
> = 0,
constraint_t<
!is_dynamic_buffer_v2<decay_t<DynamicBuffer_v1>>::value
+ > = 0,
+ constraint_t<
+ !is_completion_condition<decay_t<WriteToken>>::value
> = 0)
-> decltype(
async_initiate<WriteToken,
void (boost::system::error_code, std::size_t)>(
declval<detail::initiate_async_write_dynbuf_v1<AsyncWriteStream>>(),
token, static_cast<DynamicBuffer_v1&&>(buffers),
- transfer_all()));
+ transfer_all()))
+{
+ return async_initiate<WriteToken,
+ void (boost::system::error_code, std::size_t)>(
+ detail::initiate_async_write_dynbuf_v1<AsyncWriteStream>(s),
+ token, static_cast<DynamicBuffer_v1&&>(buffers),
+ transfer_all());
+}
/// Start an asynchronous operation to write a certain amount of data to a
/// stream.
@@ -1042,7 +1097,7 @@ auto async_write(AsyncWriteStream& s, DynamicBuffer_v1&& buffers,
* Regardless of whether the asynchronous operation completes immediately or
* not, the completion handler will not be invoked from within this function.
* On immediate completion, invocation of the handler will be performed in a
- * manner equivalent to using boost::asio::post().
+ * manner equivalent to using boost::asio::async_immediate().
*
* @par Completion Signature
* @code void(boost::system::error_code, std::size_t) @endcode
@@ -1061,21 +1116,34 @@ auto async_write(AsyncWriteStream& s, DynamicBuffer_v1&& buffers,
template <typename AsyncWriteStream,
typename DynamicBuffer_v1, typename CompletionCondition,
BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
- std::size_t)) WriteToken>
-auto async_write(AsyncWriteStream& s, DynamicBuffer_v1&& buffers,
- CompletionCondition completion_condition, WriteToken&& token,
+ std::size_t)) WriteToken
+ = default_completion_token_t<typename AsyncWriteStream::executor_type>>
+inline auto async_write(AsyncWriteStream& s, DynamicBuffer_v1&& buffers,
+ CompletionCondition completion_condition,
+ WriteToken&& token
+ = default_completion_token_t<typename AsyncWriteStream::executor_type>(),
constraint_t<
is_dynamic_buffer_v1<decay_t<DynamicBuffer_v1>>::value
> = 0,
constraint_t<
!is_dynamic_buffer_v2<decay_t<DynamicBuffer_v1>>::value
+ > = 0,
+ constraint_t<
+ is_completion_condition<CompletionCondition>::value
> = 0)
-> decltype(
async_initiate<WriteToken,
void (boost::system::error_code, std::size_t)>(
declval<detail::initiate_async_write_dynbuf_v1<AsyncWriteStream>>(),
token, static_cast<DynamicBuffer_v1&&>(buffers),
- static_cast<CompletionCondition&&>(completion_condition)));
+ static_cast<CompletionCondition&&>(completion_condition)))
+{
+ return async_initiate<WriteToken,
+ void (boost::system::error_code, std::size_t)>(
+ detail::initiate_async_write_dynbuf_v1<AsyncWriteStream>(s),
+ token, static_cast<DynamicBuffer_v1&&>(buffers),
+ static_cast<CompletionCondition&&>(completion_condition));
+}
#if !defined(BOOST_ASIO_NO_EXTENSIONS)
#if !defined(BOOST_ASIO_NO_IOSTREAM)
@@ -1121,7 +1189,7 @@ auto async_write(AsyncWriteStream& s, DynamicBuffer_v1&& buffers,
* Regardless of whether the asynchronous operation completes immediately or
* not, the completion handler will not be invoked from within this function.
* On immediate completion, invocation of the handler will be performed in a
- * manner equivalent to using boost::asio::post().
+ * manner equivalent to using boost::asio::async_immediate().
*
* @par Completion Signature
* @code void(boost::system::error_code, std::size_t) @endcode
@@ -1141,14 +1209,23 @@ template <typename AsyncWriteStream, typename Allocator,
BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
std::size_t)) WriteToken
= default_completion_token_t<typename AsyncWriteStream::executor_type>>
-auto async_write(AsyncWriteStream& s, basic_streambuf<Allocator>& b,
+inline auto async_write(AsyncWriteStream& s, basic_streambuf<Allocator>& b,
WriteToken&& token
- = default_completion_token_t<typename AsyncWriteStream::executor_type>())
+ = default_completion_token_t<typename AsyncWriteStream::executor_type>(),
+ constraint_t<
+ !is_completion_condition<decay_t<WriteToken>>::value
+ > = 0)
-> decltype(
async_initiate<WriteToken,
void (boost::system::error_code, std::size_t)>(
declval<detail::initiate_async_write_dynbuf_v1<AsyncWriteStream>>(),
- token, basic_streambuf_ref<Allocator>(b), transfer_all()));
+ token, basic_streambuf_ref<Allocator>(b), transfer_all()))
+{
+ return async_initiate<WriteToken,
+ void (boost::system::error_code, std::size_t)>(
+ detail::initiate_async_write_dynbuf_v1<AsyncWriteStream>(s),
+ token, basic_streambuf_ref<Allocator>(b), transfer_all());
+}
/// Start an asynchronous operation to write a certain amount of data to a
/// stream.
@@ -1205,7 +1282,7 @@ auto async_write(AsyncWriteStream& s, basic_streambuf<Allocator>& b,
* Regardless of whether the asynchronous operation completes immediately or
* not, the completion handler will not be invoked from within this function.
* On immediate completion, invocation of the handler will be performed in a
- * manner equivalent to using boost::asio::post().
+ * manner equivalent to using boost::asio::async_immediate().
*
* @par Completion Signature
* @code void(boost::system::error_code, std::size_t) @endcode
@@ -1224,15 +1301,28 @@ auto async_write(AsyncWriteStream& s, basic_streambuf<Allocator>& b,
template <typename AsyncWriteStream,
typename Allocator, typename CompletionCondition,
BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
- std::size_t)) WriteToken>
-auto async_write(AsyncWriteStream& s, basic_streambuf<Allocator>& b,
- CompletionCondition completion_condition, WriteToken&& token)
+ std::size_t)) WriteToken
+ = default_completion_token_t<typename AsyncWriteStream::executor_type>>
+inline auto async_write(AsyncWriteStream& s, basic_streambuf<Allocator>& b,
+ CompletionCondition completion_condition,
+ WriteToken&& token
+ = default_completion_token_t<typename AsyncWriteStream::executor_type>(),
+ constraint_t<
+ is_completion_condition<CompletionCondition>::value
+ > = 0)
-> decltype(
async_initiate<WriteToken,
void (boost::system::error_code, std::size_t)>(
declval<detail::initiate_async_write_dynbuf_v1<AsyncWriteStream>>(),
token, basic_streambuf_ref<Allocator>(b),
- static_cast<CompletionCondition&&>(completion_condition)));
+ static_cast<CompletionCondition&&>(completion_condition)))
+{
+ return async_initiate<WriteToken,
+ void (boost::system::error_code, std::size_t)>(
+ detail::initiate_async_write_dynbuf_v1<AsyncWriteStream>(s),
+ token, basic_streambuf_ref<Allocator>(b),
+ static_cast<CompletionCondition&&>(completion_condition));
+}
#endif // !defined(BOOST_ASIO_NO_IOSTREAM)
#endif // !defined(BOOST_ASIO_NO_EXTENSIONS)
@@ -1281,7 +1371,7 @@ auto async_write(AsyncWriteStream& s, basic_streambuf<Allocator>& b,
* Regardless of whether the asynchronous operation completes immediately or
* not, the completion handler will not be invoked from within this function.
* On immediate completion, invocation of the handler will be performed in a
- * manner equivalent to using boost::asio::post().
+ * manner equivalent to using boost::asio::async_immediate().
*
* @par Completion Signature
* @code void(boost::system::error_code, std::size_t) @endcode
@@ -1301,18 +1391,28 @@ template <typename AsyncWriteStream, typename DynamicBuffer_v2,
BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
std::size_t)) WriteToken
= default_completion_token_t<typename AsyncWriteStream::executor_type>>
-auto async_write(AsyncWriteStream& s, DynamicBuffer_v2 buffers,
+inline auto async_write(AsyncWriteStream& s, DynamicBuffer_v2 buffers,
WriteToken&& token
= default_completion_token_t<typename AsyncWriteStream::executor_type>(),
constraint_t<
is_dynamic_buffer_v2<DynamicBuffer_v2>::value
+ > = 0,
+ constraint_t<
+ !is_completion_condition<decay_t<WriteToken>>::value
> = 0)
-> decltype(
async_initiate<WriteToken,
void (boost::system::error_code, std::size_t)>(
declval<detail::initiate_async_write_dynbuf_v2<AsyncWriteStream>>(),
token, static_cast<DynamicBuffer_v2&&>(buffers),
- transfer_all()));
+ transfer_all()))
+{
+ return async_initiate<WriteToken,
+ void (boost::system::error_code, std::size_t)>(
+ detail::initiate_async_write_dynbuf_v2<AsyncWriteStream>(s),
+ token, static_cast<DynamicBuffer_v2&&>(buffers),
+ transfer_all());
+}
/// Start an asynchronous operation to write a certain amount of data to a
/// stream.
@@ -1371,7 +1471,7 @@ auto async_write(AsyncWriteStream& s, DynamicBuffer_v2 buffers,
* Regardless of whether the asynchronous operation completes immediately or
* not, the completion handler will not be invoked from within this function.
* On immediate completion, invocation of the handler will be performed in a
- * manner equivalent to using boost::asio::post().
+ * manner equivalent to using boost::asio::async_immediate().
*
* @par Completion Signature
* @code void(boost::system::error_code, std::size_t) @endcode
@@ -1390,19 +1490,31 @@ auto async_write(AsyncWriteStream& s, DynamicBuffer_v2 buffers,
template <typename AsyncWriteStream,
typename DynamicBuffer_v2, typename CompletionCondition,
BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
- std::size_t)) WriteToken>
-auto async_write(AsyncWriteStream& s, DynamicBuffer_v2 buffers,
+ std::size_t)) WriteToken
+ = default_completion_token_t<typename AsyncWriteStream::executor_type>>
+inline auto async_write(AsyncWriteStream& s, DynamicBuffer_v2 buffers,
CompletionCondition completion_condition,
- WriteToken&& token,
+ WriteToken&& token
+ = default_completion_token_t<typename AsyncWriteStream::executor_type>(),
constraint_t<
is_dynamic_buffer_v2<DynamicBuffer_v2>::value
+ > = 0,
+ constraint_t<
+ is_completion_condition<CompletionCondition>::value
> = 0)
-> decltype(
async_initiate<WriteToken,
void (boost::system::error_code, std::size_t)>(
declval<detail::initiate_async_write_dynbuf_v2<AsyncWriteStream>>(),
token, static_cast<DynamicBuffer_v2&&>(buffers),
- static_cast<CompletionCondition&&>(completion_condition)));
+ static_cast<CompletionCondition&&>(completion_condition)))
+{
+ return async_initiate<WriteToken,
+ void (boost::system::error_code, std::size_t)>(
+ detail::initiate_async_write_dynbuf_v2<AsyncWriteStream>(s),
+ token, static_cast<DynamicBuffer_v2&&>(buffers),
+ static_cast<CompletionCondition&&>(completion_condition));
+}
/*@}*/
diff --git a/contrib/restricted/boost/asio/include/boost/asio/write_at.hpp b/contrib/restricted/boost/asio/include/boost/asio/write_at.hpp
index 9c17a581183..504a2d1e974 100644
--- a/contrib/restricted/boost/asio/include/boost/asio/write_at.hpp
+++ b/contrib/restricted/boost/asio/include/boost/asio/write_at.hpp
@@ -188,7 +188,10 @@ template <typename SyncRandomAccessWriteDevice, typename ConstBufferSequence,
typename CompletionCondition>
std::size_t write_at(SyncRandomAccessWriteDevice& d,
uint64_t offset, const ConstBufferSequence& buffers,
- CompletionCondition completion_condition);
+ CompletionCondition completion_condition,
+ constraint_t<
+ is_completion_condition<CompletionCondition>::value
+ > = 0);
/// Write a certain amount of data at a specified offset before returning.
/**
@@ -236,7 +239,10 @@ template <typename SyncRandomAccessWriteDevice, typename ConstBufferSequence,
typename CompletionCondition>
std::size_t write_at(SyncRandomAccessWriteDevice& d,
uint64_t offset, const ConstBufferSequence& buffers,
- CompletionCondition completion_condition, boost::system::error_code& ec);
+ CompletionCondition completion_condition, boost::system::error_code& ec,
+ constraint_t<
+ is_completion_condition<CompletionCondition>::value
+ > = 0);
#if !defined(BOOST_ASIO_NO_EXTENSIONS)
#if !defined(BOOST_ASIO_NO_IOSTREAM)
@@ -349,7 +355,10 @@ std::size_t write_at(SyncRandomAccessWriteDevice& d,
template <typename SyncRandomAccessWriteDevice, typename Allocator,
typename CompletionCondition>
std::size_t write_at(SyncRandomAccessWriteDevice& d, uint64_t offset,
- basic_streambuf<Allocator>& b, CompletionCondition completion_condition);
+ basic_streambuf<Allocator>& b, CompletionCondition completion_condition,
+ constraint_t<
+ is_completion_condition<CompletionCondition>::value
+ > = 0);
/// Write a certain amount of data at a specified offset before returning.
/**
@@ -392,9 +401,12 @@ std::size_t write_at(SyncRandomAccessWriteDevice& d, uint64_t offset,
*/
template <typename SyncRandomAccessWriteDevice, typename Allocator,
typename CompletionCondition>
-std::size_t write_at(SyncRandomAccessWriteDevice& d, uint64_t offset,
- basic_streambuf<Allocator>& b, CompletionCondition completion_condition,
- boost::system::error_code& ec);
+std::size_t write_at(SyncRandomAccessWriteDevice& d,
+ uint64_t offset, basic_streambuf<Allocator>& b,
+ CompletionCondition completion_condition, boost::system::error_code& ec,
+ constraint_t<
+ is_completion_condition<CompletionCondition>::value
+ > = 0);
#endif // !defined(BOOST_ASIO_NO_IOSTREAM)
#endif // !defined(BOOST_ASIO_NO_EXTENSIONS)
@@ -457,7 +469,7 @@ std::size_t write_at(SyncRandomAccessWriteDevice& d, uint64_t offset,
* Regardless of whether the asynchronous operation completes immediately or
* not, the completion handler will not be invoked from within this function.
* On immediate completion, invocation of the handler will be performed in a
- * manner equivalent to using boost::asio::post().
+ * manner equivalent to using boost::asio::async_immediate().
*
* @par Completion Signature
* @code void(boost::system::error_code, std::size_t) @endcode
@@ -486,16 +498,25 @@ template <typename AsyncRandomAccessWriteDevice, typename ConstBufferSequence,
BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
std::size_t)) WriteToken = default_completion_token_t<
typename AsyncRandomAccessWriteDevice::executor_type>>
-auto async_write_at(AsyncRandomAccessWriteDevice& d,
+inline auto async_write_at(AsyncRandomAccessWriteDevice& d,
uint64_t offset, const ConstBufferSequence& buffers,
WriteToken&& token = default_completion_token_t<
- typename AsyncRandomAccessWriteDevice::executor_type>())
+ typename AsyncRandomAccessWriteDevice::executor_type>(),
+ constraint_t<
+ !is_completion_condition<WriteToken>::value
+ > = 0)
-> decltype(
async_initiate<WriteToken,
void (boost::system::error_code, std::size_t)>(
declval<detail::initiate_async_write_at<
AsyncRandomAccessWriteDevice>>(),
- token, offset, buffers, transfer_all()));
+ token, offset, buffers, transfer_all()))
+{
+ return async_initiate<WriteToken,
+ void (boost::system::error_code, std::size_t)>(
+ detail::initiate_async_write_at<AsyncRandomAccessWriteDevice>(d),
+ token, offset, buffers, transfer_all());
+}
/// Start an asynchronous operation to write a certain amount of data at the
/// specified offset.
@@ -559,7 +580,7 @@ auto async_write_at(AsyncRandomAccessWriteDevice& d,
* Regardless of whether the asynchronous operation completes immediately or
* not, the completion handler will not be invoked from within this function.
* On immediate completion, invocation of the handler will be performed in a
- * manner equivalent to using boost::asio::post().
+ * manner equivalent to using boost::asio::async_immediate().
*
* @par Completion Signature
* @code void(boost::system::error_code, std::size_t) @endcode
@@ -590,18 +611,28 @@ template <typename AsyncRandomAccessWriteDevice,
BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
std::size_t)) WriteToken = default_completion_token_t<
typename AsyncRandomAccessWriteDevice::executor_type>>
-auto async_write_at(AsyncRandomAccessWriteDevice& d,
+inline auto async_write_at(AsyncRandomAccessWriteDevice& d,
uint64_t offset, const ConstBufferSequence& buffers,
CompletionCondition completion_condition,
WriteToken&& token = default_completion_token_t<
- typename AsyncRandomAccessWriteDevice::executor_type>())
+ typename AsyncRandomAccessWriteDevice::executor_type>(),
+ constraint_t<
+ is_completion_condition<CompletionCondition>::value
+ > = 0)
-> decltype(
async_initiate<WriteToken,
void (boost::system::error_code, std::size_t)>(
declval<detail::initiate_async_write_at<
AsyncRandomAccessWriteDevice>>(),
token, offset, buffers,
- static_cast<CompletionCondition&&>(completion_condition)));
+ static_cast<CompletionCondition&&>(completion_condition)))
+{
+ return async_initiate<WriteToken,
+ void (boost::system::error_code, std::size_t)>(
+ detail::initiate_async_write_at<AsyncRandomAccessWriteDevice>(d),
+ token, offset, buffers,
+ static_cast<CompletionCondition&&>(completion_condition));
+}
#if !defined(BOOST_ASIO_NO_EXTENSIONS)
#if !defined(BOOST_ASIO_NO_IOSTREAM)
@@ -652,7 +683,7 @@ auto async_write_at(AsyncRandomAccessWriteDevice& d,
* Regardless of whether the asynchronous operation completes immediately or
* not, the completion handler will not be invoked from within this function.
* On immediate completion, invocation of the handler will be performed in a
- * manner equivalent to using boost::asio::post().
+ * manner equivalent to using boost::asio::async_immediate().
*
* @par Completion Signature
* @code void(boost::system::error_code, std::size_t) @endcode
@@ -672,16 +703,26 @@ template <typename AsyncRandomAccessWriteDevice, typename Allocator,
BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
std::size_t)) WriteToken = default_completion_token_t<
typename AsyncRandomAccessWriteDevice::executor_type>>
-auto async_write_at(AsyncRandomAccessWriteDevice& d,
+inline auto async_write_at(AsyncRandomAccessWriteDevice& d,
uint64_t offset, basic_streambuf<Allocator>& b,
WriteToken&& token = default_completion_token_t<
- typename AsyncRandomAccessWriteDevice::executor_type>())
+ typename AsyncRandomAccessWriteDevice::executor_type>(),
+ constraint_t<
+ !is_completion_condition<WriteToken>::value
+ > = 0)
-> decltype(
async_initiate<WriteToken,
void (boost::system::error_code, std::size_t)>(
declval<detail::initiate_async_write_at_streambuf<
AsyncRandomAccessWriteDevice>>(),
- token, offset, &b, transfer_all()));
+ token, offset, &b, transfer_all()))
+{
+ return async_initiate<WriteToken,
+ void (boost::system::error_code, std::size_t)>(
+ detail::initiate_async_write_at_streambuf<
+ AsyncRandomAccessWriteDevice>(d),
+ token, offset, &b, transfer_all());
+}
/// Start an asynchronous operation to write a certain amount of data at the
/// specified offset.
@@ -743,7 +784,7 @@ auto async_write_at(AsyncRandomAccessWriteDevice& d,
* Regardless of whether the asynchronous operation completes immediately or
* not, the completion handler will not be invoked from within this function.
* On immediate completion, invocation of the handler will be performed in a
- * manner equivalent to using boost::asio::post().
+ * manner equivalent to using boost::asio::async_immediate().
*
* @par Completion Signature
* @code void(boost::system::error_code, std::size_t) @endcode
@@ -764,17 +805,28 @@ template <typename AsyncRandomAccessWriteDevice,
BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
std::size_t)) WriteToken = default_completion_token_t<
typename AsyncRandomAccessWriteDevice::executor_type>>
-auto async_write_at(AsyncRandomAccessWriteDevice& d, uint64_t offset,
+inline auto async_write_at(AsyncRandomAccessWriteDevice& d, uint64_t offset,
basic_streambuf<Allocator>& b, CompletionCondition completion_condition,
WriteToken&& token = default_completion_token_t<
- typename AsyncRandomAccessWriteDevice::executor_type>())
+ typename AsyncRandomAccessWriteDevice::executor_type>(),
+ constraint_t<
+ is_completion_condition<CompletionCondition>::value
+ > = 0)
-> decltype(
async_initiate<WriteToken,
void (boost::system::error_code, std::size_t)>(
declval<detail::initiate_async_write_at_streambuf<
AsyncRandomAccessWriteDevice>>(),
token, offset, &b,
- static_cast<CompletionCondition&&>(completion_condition)));
+ static_cast<CompletionCondition&&>(completion_condition)))
+{
+ return async_initiate<WriteToken,
+ void (boost::system::error_code, std::size_t)>(
+ detail::initiate_async_write_at_streambuf<
+ AsyncRandomAccessWriteDevice>(d),
+ token, offset, &b,
+ static_cast<CompletionCondition&&>(completion_condition));
+}
#endif // !defined(BOOST_ASIO_NO_IOSTREAM)
#endif // !defined(BOOST_ASIO_NO_EXTENSIONS)
diff --git a/contrib/restricted/boost/asio/ya.make b/contrib/restricted/boost/asio/ya.make
index f5f8e8c7664..f33aefc30bb 100644
--- a/contrib/restricted/boost/asio/ya.make
+++ b/contrib/restricted/boost/asio/ya.make
@@ -9,9 +9,9 @@ LICENSE(
LICENSE_TEXTS(.yandex_meta/licenses.list.txt)
-VERSION(1.85.0)
+VERSION(1.86.0)
-ORIGINAL_SOURCE(https://github.com/boostorg/asio/archive/boost-1.85.0.tar.gz)
+ORIGINAL_SOURCE(https://github.com/boostorg/asio/archive/boost-1.86.0.tar.gz)
PEERDIR(
contrib/libs/openssl