From 1fdad89c8da4e72d80941fc08bd601bc424e03cf Mon Sep 17 00:00:00 2001 From: bruce Date: Wed, 17 Apr 2024 23:08:35 +0800 Subject: [PATCH] update asio version 1.30.2 --- third/asio.hpp | 25 +- third/asio/any_completion_executor.hpp | 58 +- third/asio/any_completion_handler.hpp | 250 ++- third/asio/any_io_executor.hpp | 76 +- third/asio/append.hpp | 33 +- third/asio/as_tuple.hpp | 55 +- third/asio/associated_allocator.hpp | 71 +- third/asio/associated_cancellation_slot.hpp | 69 +- third/asio/associated_executor.hpp | 82 +- third/asio/associated_immediate_executor.hpp | 280 ++++ third/asio/associator.hpp | 2 +- third/asio/async_result.hpp | 1041 ++---------- third/asio/awaitable.hpp | 2 +- third/asio/basic_datagram_socket.hpp | 162 +- third/asio/basic_deadline_timer.hpp | 39 +- third/asio/basic_file.hpp | 41 +- third/asio/basic_io_object.hpp | 12 +- third/asio/basic_random_access_file.hpp | 72 +- third/asio/basic_raw_socket.hpp | 161 +- third/asio/basic_readable_pipe.hpp | 49 +- third/asio/basic_seq_packet_socket.hpp | 84 +- third/asio/basic_serial_port.hpp | 75 +- third/asio/basic_signal_set.hpp | 96 +- third/asio/basic_socket.hpp | 79 +- third/asio/basic_socket_acceptor.hpp | 259 ++- third/asio/basic_socket_iostream.hpp | 88 +- third/asio/basic_socket_streambuf.hpp | 57 +- third/asio/basic_stream_file.hpp | 70 +- third/asio/basic_stream_socket.hpp | 126 +- third/asio/basic_streambuf.hpp | 28 +- third/asio/basic_streambuf_fwd.hpp | 6 +- third/asio/basic_waitable_timer.hpp | 55 +- third/asio/basic_writable_pipe.hpp | 49 +- third/asio/bind_allocator.hpp | 396 ++--- third/asio/bind_cancellation_slot.hpp | 385 ++--- third/asio/bind_executor.hpp | 378 ++--- third/asio/bind_immediate_executor.hpp | 549 +++++++ third/asio/buffer.hpp | 651 ++++---- third/asio/buffer_registration.hpp | 68 +- third/asio/buffered_read_stream.hpp | 66 +- third/asio/buffered_read_stream_fwd.hpp | 2 +- third/asio/buffered_stream.hpp | 82 +- third/asio/buffered_stream_fwd.hpp | 2 +- third/asio/buffered_write_stream.hpp | 66 +- third/asio/buffered_write_stream_fwd.hpp | 2 +- third/asio/buffers_iterator.hpp | 8 +- third/asio/cancellation_signal.hpp | 110 +- third/asio/cancellation_state.hpp | 32 +- third/asio/cancellation_type.hpp | 33 +- third/asio/co_spawn.hpp | 34 +- third/asio/completion_condition.hpp | 2 +- third/asio/compose.hpp | 332 +--- third/asio/connect.hpp | 131 +- third/asio/connect_pipe.hpp | 2 +- third/asio/consign.hpp | 35 +- third/asio/coroutine.hpp | 3 +- third/asio/deadline_timer.hpp | 2 +- third/asio/defer.hpp | 71 +- third/asio/deferred.hpp | 564 ++++--- third/asio/detached.hpp | 32 +- third/asio/detail/array.hpp | 12 +- third/asio/detail/array_fwd.hpp | 6 +- third/asio/detail/assert.hpp | 2 +- third/asio/detail/atomic_count.hpp | 18 +- .../detail/base_from_cancellation_state.hpp | 41 +- .../asio/detail/base_from_completion_cond.hpp | 4 +- third/asio/detail/bind_handler.hpp | 692 ++------ third/asio/detail/blocking_executor_op.hpp | 6 +- third/asio/detail/buffer_resize_guard.hpp | 2 +- third/asio/detail/buffer_sequence_adapter.hpp | 10 +- third/asio/detail/buffered_stream_storage.hpp | 2 +- third/asio/detail/bulk_executor_op.hpp | 88 - third/asio/detail/call_stack.hpp | 2 +- third/asio/detail/chrono.hpp | 25 +- third/asio/detail/chrono_time_traits.hpp | 2 +- third/asio/detail/completion_handler.hpp | 8 +- third/asio/detail/composed_work.hpp | 118 +- third/asio/detail/concurrency_hint.hpp | 2 +- .../detail/conditionally_enabled_event.hpp | 2 +- .../detail/conditionally_enabled_mutex.hpp | 2 +- third/asio/detail/config.hpp | 1112 ++----------- third/asio/detail/consuming_buffers.hpp | 14 +- third/asio/detail/cstddef.hpp | 6 +- third/asio/detail/cstdint.hpp | 26 +- third/asio/detail/date_time_fwd.hpp | 2 +- third/asio/detail/deadline_timer_service.hpp | 8 +- third/asio/detail/dependent_type.hpp | 2 +- third/asio/detail/descriptor_ops.hpp | 2 +- third/asio/detail/descriptor_read_op.hpp | 44 +- third/asio/detail/descriptor_write_op.hpp | 43 +- third/asio/detail/dev_poll_reactor.hpp | 23 +- third/asio/detail/epoll_reactor.hpp | 23 +- third/asio/detail/event.hpp | 8 +- .../detail/eventfd_select_interrupter.hpp | 2 +- third/asio/detail/exception.hpp | 15 +- third/asio/detail/executor_function.hpp | 68 +- third/asio/detail/executor_op.hpp | 12 +- third/asio/detail/fd_set_adapter.hpp | 2 +- third/asio/detail/fenced_block.hpp | 46 +- third/asio/detail/functional.hpp | 13 +- third/asio/detail/future.hpp | 19 +- third/asio/detail/gcc_arm_fenced_block.hpp | 91 -- third/asio/detail/gcc_hppa_fenced_block.hpp | 68 - third/asio/detail/gcc_sync_fenced_block.hpp | 65 - third/asio/detail/gcc_x86_fenced_block.hpp | 99 -- third/asio/detail/global.hpp | 8 +- third/asio/detail/handler_alloc_helpers.hpp | 143 +- third/asio/detail/handler_cont_helpers.hpp | 2 +- third/asio/detail/handler_invoke_helpers.hpp | 80 - third/asio/detail/handler_tracking.hpp | 6 +- .../asio/detail/handler_type_requirements.hpp | 24 +- third/asio/detail/handler_work.hpp | 224 ++- third/asio/detail/hash_map.hpp | 2 +- .../detail/impl/buffer_sequence_adapter.ipp | 2 +- third/asio/detail/impl/descriptor_ops.ipp | 51 +- third/asio/detail/impl/dev_poll_reactor.hpp | 4 +- third/asio/detail/impl/dev_poll_reactor.ipp | 17 +- third/asio/detail/impl/epoll_reactor.hpp | 4 +- third/asio/detail/impl/epoll_reactor.ipp | 25 +- .../impl/eventfd_select_interrupter.ipp | 2 +- third/asio/detail/impl/handler_tracking.ipp | 10 +- .../impl/io_uring_descriptor_service.ipp | 4 +- .../detail/impl/io_uring_file_service.ipp | 2 +- third/asio/detail/impl/io_uring_service.hpp | 2 +- third/asio/detail/impl/io_uring_service.ipp | 104 +- .../impl/io_uring_socket_service_base.ipp | 4 +- third/asio/detail/impl/kqueue_reactor.hpp | 4 +- third/asio/detail/impl/kqueue_reactor.ipp | 21 +- third/asio/detail/impl/null_event.ipp | 2 +- .../detail/impl/pipe_select_interrupter.ipp | 2 +- third/asio/detail/impl/posix_event.ipp | 2 +- third/asio/detail/impl/posix_mutex.ipp | 2 +- .../detail/impl/posix_serial_port_service.ipp | 2 +- third/asio/detail/impl/posix_thread.ipp | 2 +- third/asio/detail/impl/posix_tss_ptr.ipp | 2 +- .../impl/reactive_descriptor_service.ipp | 18 +- .../impl/reactive_socket_service_base.ipp | 44 +- .../detail/impl/resolver_service_base.ipp | 6 +- third/asio/detail/impl/scheduler.ipp | 3 +- third/asio/detail/impl/select_reactor.hpp | 4 +- third/asio/detail/impl/select_reactor.ipp | 16 +- third/asio/detail/impl/service_registry.hpp | 5 +- third/asio/detail/impl/service_registry.ipp | 2 +- third/asio/detail/impl/signal_set_service.ipp | 61 +- third/asio/detail/impl/socket_ops.ipp | 68 +- .../detail/impl/socket_select_interrupter.ipp | 2 +- .../detail/impl/strand_executor_service.hpp | 115 +- .../detail/impl/strand_executor_service.ipp | 2 +- third/asio/detail/impl/strand_service.hpp | 5 +- third/asio/detail/impl/strand_service.ipp | 2 +- third/asio/detail/impl/thread_context.ipp | 2 +- third/asio/detail/impl/throw_error.ipp | 23 +- third/asio/detail/impl/timer_queue_ptime.ipp | 24 +- third/asio/detail/impl/timer_queue_set.ipp | 2 +- third/asio/detail/impl/win_event.ipp | 2 +- .../detail/impl/win_iocp_file_service.ipp | 34 +- .../detail/impl/win_iocp_handle_service.ipp | 2 +- .../asio/detail/impl/win_iocp_io_context.hpp | 3 +- .../asio/detail/impl/win_iocp_io_context.ipp | 12 +- .../impl/win_iocp_serial_port_service.ipp | 2 +- .../impl/win_iocp_socket_service_base.ipp | 4 +- third/asio/detail/impl/win_mutex.ipp | 2 +- .../detail/impl/win_object_handle_service.ipp | 2 +- third/asio/detail/impl/win_static_mutex.ipp | 2 +- third/asio/detail/impl/win_thread.ipp | 2 +- third/asio/detail/impl/win_tss_ptr.ipp | 2 +- .../impl/winrt_ssocket_service_base.ipp | 4 +- .../detail/impl/winrt_timer_scheduler.hpp | 2 +- .../detail/impl/winrt_timer_scheduler.ipp | 2 +- third/asio/detail/impl/winsock_init.ipp | 2 +- third/asio/detail/initiate_defer.hpp | 207 +++ third/asio/detail/initiate_dispatch.hpp | 193 +++ third/asio/detail/initiate_post.hpp | 207 +++ third/asio/detail/io_control.hpp | 2 +- third/asio/detail/io_object_impl.hpp | 16 +- .../detail/io_uring_descriptor_read_at_op.hpp | 9 +- .../detail/io_uring_descriptor_read_op.hpp | 9 +- .../detail/io_uring_descriptor_service.hpp | 26 +- .../io_uring_descriptor_write_at_op.hpp | 9 +- .../detail/io_uring_descriptor_write_op.hpp | 9 +- third/asio/detail/io_uring_file_service.hpp | 5 +- .../asio/detail/io_uring_null_buffers_op.hpp | 9 +- third/asio/detail/io_uring_operation.hpp | 2 +- third/asio/detail/io_uring_service.hpp | 7 +- .../asio/detail/io_uring_socket_accept_op.hpp | 23 +- .../detail/io_uring_socket_connect_op.hpp | 9 +- third/asio/detail/io_uring_socket_recv_op.hpp | 9 +- .../detail/io_uring_socket_recvfrom_op.hpp | 11 +- .../detail/io_uring_socket_recvmsg_op.hpp | 9 +- third/asio/detail/io_uring_socket_send_op.hpp | 9 +- .../asio/detail/io_uring_socket_sendto_op.hpp | 9 +- third/asio/detail/io_uring_socket_service.hpp | 24 +- .../detail/io_uring_socket_service_base.hpp | 18 +- third/asio/detail/io_uring_wait_op.hpp | 9 +- third/asio/detail/is_buffer_sequence.hpp | 56 +- third/asio/detail/is_executor.hpp | 2 +- third/asio/detail/keyword_tss_ptr.hpp | 2 +- third/asio/detail/kqueue_reactor.hpp | 23 +- third/asio/detail/limits.hpp | 7 +- .../asio/detail/local_free_on_block_exit.hpp | 2 +- third/asio/detail/macos_fenced_block.hpp | 62 - third/asio/detail/memory.hpp | 67 +- third/asio/detail/mutex.hpp | 8 +- third/asio/detail/non_const_lvalue.hpp | 19 +- third/asio/detail/noncopyable.hpp | 2 +- third/asio/detail/null_event.hpp | 2 +- third/asio/detail/null_fenced_block.hpp | 2 +- third/asio/detail/null_global.hpp | 2 +- third/asio/detail/null_mutex.hpp | 2 +- third/asio/detail/null_reactor.hpp | 2 +- third/asio/detail/null_signal_blocker.hpp | 2 +- third/asio/detail/null_socket_service.hpp | 6 +- third/asio/detail/null_static_mutex.hpp | 2 +- third/asio/detail/null_thread.hpp | 2 +- third/asio/detail/null_tss_ptr.hpp | 2 +- third/asio/detail/object_pool.hpp | 2 +- third/asio/detail/old_win_sdk_compat.hpp | 2 +- third/asio/detail/op_queue.hpp | 2 +- third/asio/detail/operation.hpp | 2 +- third/asio/detail/pipe_select_interrupter.hpp | 2 +- third/asio/detail/pop_options.hpp | 2 +- third/asio/detail/posix_event.hpp | 2 +- third/asio/detail/posix_fd_set_adapter.hpp | 2 +- third/asio/detail/posix_global.hpp | 2 +- third/asio/detail/posix_mutex.hpp | 2 +- .../asio/detail/posix_serial_port_service.hpp | 2 +- third/asio/detail/posix_signal_blocker.hpp | 2 +- third/asio/detail/posix_static_mutex.hpp | 2 +- third/asio/detail/posix_thread.hpp | 2 +- third/asio/detail/posix_tss_ptr.hpp | 2 +- third/asio/detail/push_options.hpp | 2 +- .../detail/reactive_descriptor_service.hpp | 86 +- .../asio/detail/reactive_null_buffers_op.hpp | 41 +- .../asio/detail/reactive_socket_accept_op.hpp | 101 +- .../detail/reactive_socket_connect_op.hpp | 45 +- third/asio/detail/reactive_socket_recv_op.hpp | 44 +- .../detail/reactive_socket_recvfrom_op.hpp | 45 +- .../detail/reactive_socket_recvmsg_op.hpp | 45 +- third/asio/detail/reactive_socket_send_op.hpp | 45 +- .../asio/detail/reactive_socket_sendto_op.hpp | 44 +- third/asio/detail/reactive_socket_service.hpp | 40 +- .../detail/reactive_socket_service_base.hpp | 173 +- third/asio/detail/reactive_wait_op.hpp | 41 +- third/asio/detail/reactor.hpp | 2 +- third/asio/detail/reactor_op.hpp | 2 +- third/asio/detail/reactor_op_queue.hpp | 2 +- third/asio/detail/recycling_allocator.hpp | 4 +- third/asio/detail/regex_fwd.hpp | 17 +- third/asio/detail/resolve_endpoint_op.hpp | 8 +- third/asio/detail/resolve_op.hpp | 2 +- third/asio/detail/resolve_query_op.hpp | 8 +- third/asio/detail/resolver_service.hpp | 6 +- third/asio/detail/resolver_service_base.hpp | 2 +- third/asio/detail/scheduler.hpp | 2 +- third/asio/detail/scheduler_operation.hpp | 2 +- third/asio/detail/scheduler_task.hpp | 2 +- third/asio/detail/scheduler_thread_info.hpp | 2 +- third/asio/detail/scoped_lock.hpp | 2 +- third/asio/detail/scoped_ptr.hpp | 2 +- third/asio/detail/select_interrupter.hpp | 2 +- third/asio/detail/select_reactor.hpp | 23 +- third/asio/detail/service_registry.hpp | 5 +- third/asio/detail/signal_blocker.hpp | 2 +- third/asio/detail/signal_handler.hpp | 6 +- third/asio/detail/signal_init.hpp | 2 +- third/asio/detail/signal_op.hpp | 2 +- third/asio/detail/signal_set_service.hpp | 15 +- third/asio/detail/socket_holder.hpp | 2 +- third/asio/detail/socket_ops.hpp | 2 +- third/asio/detail/socket_option.hpp | 2 +- .../asio/detail/socket_select_interrupter.hpp | 2 +- third/asio/detail/socket_types.hpp | 12 +- third/asio/detail/solaris_fenced_block.hpp | 62 - third/asio/detail/source_location.hpp | 2 +- third/asio/detail/static_mutex.hpp | 8 +- third/asio/detail/std_event.hpp | 7 +- third/asio/detail/std_fenced_block.hpp | 7 +- third/asio/detail/std_global.hpp | 7 +- third/asio/detail/std_mutex.hpp | 7 +- third/asio/detail/std_static_mutex.hpp | 7 +- third/asio/detail/std_thread.hpp | 7 +- third/asio/detail/strand_executor_service.hpp | 26 +- third/asio/detail/strand_service.hpp | 2 +- third/asio/detail/string_view.hpp | 2 +- third/asio/detail/thread.hpp | 8 +- third/asio/detail/thread_context.hpp | 2 +- third/asio/detail/thread_group.hpp | 2 +- third/asio/detail/thread_info_base.hpp | 34 +- third/asio/detail/throw_error.hpp | 2 +- third/asio/detail/throw_exception.hpp | 2 +- third/asio/detail/timer_queue.hpp | 2 +- third/asio/detail/timer_queue_base.hpp | 2 +- third/asio/detail/timer_queue_ptime.hpp | 4 +- third/asio/detail/timer_queue_set.hpp | 2 +- third/asio/detail/timer_scheduler.hpp | 2 +- third/asio/detail/timer_scheduler_fwd.hpp | 2 +- third/asio/detail/tss_ptr.hpp | 2 +- third/asio/detail/type_traits.hpp | 194 +-- third/asio/detail/utility.hpp | 8 +- third/asio/detail/variadic_templates.hpp | 294 ---- third/asio/detail/wait_handler.hpp | 6 +- third/asio/detail/wait_op.hpp | 2 +- third/asio/detail/win_event.hpp | 2 +- third/asio/detail/win_fd_set_adapter.hpp | 2 +- third/asio/detail/win_fenced_block.hpp | 90 -- third/asio/detail/win_global.hpp | 2 +- third/asio/detail/win_iocp_file_service.hpp | 2 +- third/asio/detail/win_iocp_handle_read_op.hpp | 8 +- third/asio/detail/win_iocp_handle_service.hpp | 10 +- .../asio/detail/win_iocp_handle_write_op.hpp | 8 +- third/asio/detail/win_iocp_io_context.hpp | 4 +- .../asio/detail/win_iocp_null_buffers_op.hpp | 8 +- third/asio/detail/win_iocp_operation.hpp | 2 +- third/asio/detail/win_iocp_overlapped_op.hpp | 8 +- third/asio/detail/win_iocp_overlapped_ptr.hpp | 14 +- .../detail/win_iocp_serial_port_service.hpp | 2 +- .../asio/detail/win_iocp_socket_accept_op.hpp | 21 +- .../detail/win_iocp_socket_connect_op.hpp | 9 +- third/asio/detail/win_iocp_socket_recv_op.hpp | 8 +- .../detail/win_iocp_socket_recvfrom_op.hpp | 8 +- .../detail/win_iocp_socket_recvmsg_op.hpp | 10 +- third/asio/detail/win_iocp_socket_send_op.hpp | 8 +- third/asio/detail/win_iocp_socket_service.hpp | 23 +- .../detail/win_iocp_socket_service_base.hpp | 17 +- third/asio/detail/win_iocp_thread_info.hpp | 2 +- third/asio/detail/win_iocp_wait_op.hpp | 8 +- third/asio/detail/win_mutex.hpp | 2 +- .../asio/detail/win_object_handle_service.hpp | 3 +- third/asio/detail/win_static_mutex.hpp | 2 +- third/asio/detail/win_thread.hpp | 2 +- third/asio/detail/win_tss_ptr.hpp | 2 +- third/asio/detail/winapp_thread.hpp | 2 +- third/asio/detail/wince_thread.hpp | 2 +- third/asio/detail/winrt_async_manager.hpp | 2 +- third/asio/detail/winrt_async_op.hpp | 2 +- third/asio/detail/winrt_resolve_op.hpp | 8 +- third/asio/detail/winrt_resolver_service.hpp | 6 +- third/asio/detail/winrt_socket_connect_op.hpp | 8 +- third/asio/detail/winrt_socket_recv_op.hpp | 8 +- third/asio/detail/winrt_socket_send_op.hpp | 8 +- third/asio/detail/winrt_ssocket_service.hpp | 8 +- .../detail/winrt_ssocket_service_base.hpp | 4 +- third/asio/detail/winrt_timer_scheduler.hpp | 2 +- third/asio/detail/winrt_utils.hpp | 2 +- third/asio/detail/winsock_init.hpp | 4 +- third/asio/detail/work_dispatcher.hpp | 54 +- third/asio/detail/wrapped_handler.hpp | 124 +- third/asio/dispatch.hpp | 70 +- third/asio/error.hpp | 4 +- third/asio/error_code.hpp | 169 +- third/asio/execution.hpp | 17 +- third/asio/execution/allocator.hpp | 146 +- third/asio/execution/any_executor.hpp | 1259 ++++----------- third/asio/execution/bad_executor.hpp | 7 +- third/asio/execution/blocking.hpp | 832 ++++------ third/asio/execution/blocking_adaptation.hpp | 641 +++----- third/asio/execution/bulk_execute.hpp | 402 ----- third/asio/execution/bulk_guarantee.hpp | 1252 --------------- third/asio/execution/connect.hpp | 494 ------ third/asio/execution/context.hpp | 93 +- third/asio/execution/context_as.hpp | 102 +- third/asio/execution/detail/as_invocable.hpp | 152 -- third/asio/execution/detail/as_operation.hpp | 109 -- third/asio/execution/detail/as_receiver.hpp | 128 -- third/asio/execution/detail/bulk_sender.hpp | 261 --- .../asio/execution/detail/submit_receiver.hpp | 233 --- third/asio/execution/detail/void_receiver.hpp | 90 -- third/asio/execution/execute.hpp | 290 ---- third/asio/execution/executor.hpp | 194 +-- third/asio/execution/impl/bad_executor.ipp | 6 +- .../impl/receiver_invocation_error.ipp | 36 - third/asio/execution/invocable_archetype.hpp | 32 +- third/asio/execution/mapping.hpp | 638 +++----- third/asio/execution/occupancy.hpp | 93 +- third/asio/execution/operation_state.hpp | 99 -- third/asio/execution/outstanding_work.hpp | 445 ++--- third/asio/execution/prefer_only.hpp | 115 +- third/asio/execution/receiver.hpp | 285 ---- .../execution/receiver_invocation_error.hpp | 48 - third/asio/execution/relationship.hpp | 445 ++--- third/asio/execution/schedule.hpp | 292 ---- third/asio/execution/scheduler.hpp | 91 -- third/asio/execution/sender.hpp | 316 ---- third/asio/execution/set_done.hpp | 255 --- third/asio/execution/set_error.hpp | 255 --- third/asio/execution/set_value.hpp | 488 ------ third/asio/execution/start.hpp | 252 --- third/asio/execution/submit.hpp | 455 ------ third/asio/execution_context.hpp | 26 +- third/asio/executor.hpp | 102 +- third/asio/executor_work_guard.hpp | 117 +- third/asio/experimental/append.hpp | 2 +- third/asio/experimental/as_single.hpp | 44 +- third/asio/experimental/as_tuple.hpp | 2 +- .../asio/experimental/awaitable_operators.hpp | 14 +- third/asio/experimental/basic_channel.hpp | 90 +- .../experimental/basic_concurrent_channel.hpp | 90 +- .../experimental/cancellation_condition.hpp | 53 +- third/asio/experimental/channel.hpp | 6 +- third/asio/experimental/channel_error.hpp | 4 +- third/asio/experimental/channel_traits.hpp | 30 +- third/asio/experimental/co_composed.hpp | 7 +- third/asio/experimental/co_spawn.hpp | 2 +- .../asio/experimental/concurrent_channel.hpp | 6 +- third/asio/experimental/coro.hpp | 2 +- third/asio/experimental/coro_traits.hpp | 2 +- third/asio/experimental/deferred.hpp | 2 +- .../experimental/detail/channel_handler.hpp | 23 +- .../experimental/detail/channel_message.hpp | 47 +- .../experimental/detail/channel_operation.hpp | 231 ++- .../experimental/detail/channel_payload.hpp | 157 +- .../detail/channel_receive_op.hpp | 33 +- .../detail/channel_send_functions.hpp | 94 +- .../experimental/detail/channel_send_op.hpp | 32 +- .../experimental/detail/channel_service.hpp | 100 +- .../detail/coro_completion_handler.hpp | 6 +- .../detail/coro_promise_allocator.hpp | 2 +- .../experimental/detail/has_signature.hpp | 2 +- .../detail/impl/channel_service.hpp | 80 +- .../experimental/detail/partial_promise.hpp | 2 +- third/asio/experimental/impl/as_single.hpp | 129 +- .../asio/experimental/impl/channel_error.ipp | 4 +- third/asio/experimental/impl/co_composed.hpp | 82 +- third/asio/experimental/impl/coro.hpp | 93 +- .../asio/experimental/impl/parallel_group.hpp | 116 +- third/asio/experimental/impl/promise.hpp | 22 +- third/asio/experimental/impl/use_coro.hpp | 10 +- third/asio/experimental/impl/use_promise.hpp | 6 +- third/asio/experimental/parallel_group.hpp | 58 +- third/asio/experimental/prepend.hpp | 2 +- third/asio/experimental/promise.hpp | 2 +- third/asio/experimental/use_coro.hpp | 36 +- third/asio/experimental/use_promise.hpp | 26 +- third/asio/file_base.hpp | 2 +- third/asio/generic/basic_endpoint.hpp | 8 +- third/asio/generic/datagram_protocol.hpp | 8 +- third/asio/generic/detail/endpoint.hpp | 2 +- third/asio/generic/detail/impl/endpoint.ipp | 2 +- third/asio/generic/raw_protocol.hpp | 8 +- third/asio/generic/seq_packet_protocol.hpp | 8 +- third/asio/generic/stream_protocol.hpp | 8 +- third/asio/handler_alloc_hook.hpp | 104 -- third/asio/handler_continuation_hook.hpp | 2 +- third/asio/handler_invoke_hook.hpp | 111 -- third/asio/high_resolution_timer.hpp | 7 +- third/asio/impl/any_completion_executor.ipp | 24 +- third/asio/impl/any_io_executor.ipp | 27 +- third/asio/impl/append.hpp | 137 +- third/asio/impl/as_tuple.hpp | 206 ++- third/asio/impl/awaitable.hpp | 91 +- third/asio/impl/buffered_read_stream.hpp | 233 +-- third/asio/impl/buffered_write_stream.hpp | 233 +-- third/asio/impl/cancellation_signal.ipp | 2 +- third/asio/impl/co_spawn.hpp | 196 ++- third/asio/impl/connect.hpp | 318 +--- third/asio/impl/connect_pipe.hpp | 2 +- third/asio/impl/connect_pipe.ipp | 2 +- third/asio/impl/consign.hpp | 129 +- third/asio/impl/defer.hpp | 298 ---- third/asio/impl/deferred.hpp | 104 +- third/asio/impl/detached.hpp | 63 +- third/asio/impl/dispatch.hpp | 273 ---- third/asio/impl/error.ipp | 8 +- third/asio/impl/error_code.ipp | 6 +- third/asio/impl/execution_context.hpp | 38 +- third/asio/impl/execution_context.ipp | 2 +- third/asio/impl/executor.hpp | 103 +- third/asio/impl/executor.ipp | 6 +- third/asio/impl/handler_alloc_hook.ipp | 62 - third/asio/impl/io_context.hpp | 95 +- third/asio/impl/io_context.ipp | 3 +- third/asio/impl/multiple_exceptions.ipp | 12 +- third/asio/impl/post.hpp | 298 ---- third/asio/impl/prepend.hpp | 134 +- third/asio/impl/read.hpp | 635 +++----- third/asio/impl/read_at.hpp | 266 +-- third/asio/impl/read_until.hpp | 1426 ++++++----------- third/asio/impl/redirect_error.hpp | 454 +----- third/asio/impl/serial_port_base.hpp | 2 +- third/asio/impl/serial_port_base.ipp | 2 +- third/asio/impl/spawn.hpp | 630 +++----- third/asio/impl/src.hpp | 4 +- third/asio/impl/system_context.hpp | 4 +- third/asio/impl/system_context.ipp | 4 +- third/asio/impl/system_executor.hpp | 44 +- third/asio/impl/thread_pool.hpp | 141 +- third/asio/impl/thread_pool.ipp | 9 +- third/asio/impl/use_awaitable.hpp | 4 +- third/asio/impl/use_future.hpp | 504 +----- third/asio/impl/write.hpp | 640 +++----- third/asio/impl/write_at.hpp | 252 +-- third/asio/io_context.hpp | 211 ++- third/asio/io_context_strand.hpp | 58 +- third/asio/io_service.hpp | 2 +- third/asio/io_service_strand.hpp | 2 +- third/asio/ip/address.hpp | 61 +- third/asio/ip/address_v4.hpp | 64 +- third/asio/ip/address_v4_iterator.hpp | 32 +- third/asio/ip/address_v4_range.hpp | 38 +- third/asio/ip/address_v6.hpp | 75 +- third/asio/ip/address_v6_iterator.hpp | 31 +- third/asio/ip/address_v6_range.hpp | 35 +- third/asio/ip/bad_address_cast.hpp | 16 +- third/asio/ip/basic_endpoint.hpp | 61 +- third/asio/ip/basic_resolver.hpp | 122 +- third/asio/ip/basic_resolver_entry.hpp | 2 +- third/asio/ip/basic_resolver_iterator.hpp | 12 +- third/asio/ip/basic_resolver_query.hpp | 18 +- third/asio/ip/basic_resolver_results.hpp | 22 +- third/asio/ip/detail/endpoint.hpp | 34 +- third/asio/ip/detail/impl/endpoint.ipp | 24 +- third/asio/ip/detail/socket_option.hpp | 2 +- third/asio/ip/host_name.hpp | 2 +- third/asio/ip/icmp.hpp | 14 +- third/asio/ip/impl/address.hpp | 2 +- third/asio/ip/impl/address.ipp | 40 +- third/asio/ip/impl/address_v4.hpp | 2 +- third/asio/ip/impl/address_v4.ipp | 22 +- third/asio/ip/impl/address_v6.hpp | 2 +- third/asio/ip/impl/address_v6.ipp | 56 +- third/asio/ip/impl/basic_endpoint.hpp | 2 +- third/asio/ip/impl/host_name.ipp | 2 +- third/asio/ip/impl/network_v4.hpp | 2 +- third/asio/ip/impl/network_v4.ipp | 6 +- third/asio/ip/impl/network_v6.hpp | 2 +- third/asio/ip/impl/network_v6.ipp | 6 +- third/asio/ip/multicast.hpp | 2 +- third/asio/ip/network_v4.hpp | 36 +- third/asio/ip/network_v6.hpp | 32 +- third/asio/ip/resolver_base.hpp | 2 +- third/asio/ip/resolver_query_base.hpp | 2 +- third/asio/ip/tcp.hpp | 14 +- third/asio/ip/udp.hpp | 14 +- third/asio/ip/unicast.hpp | 2 +- third/asio/ip/v6_only.hpp | 2 +- third/asio/is_applicable_property.hpp | 12 +- third/asio/is_contiguous_iterator.hpp | 4 +- third/asio/is_executor.hpp | 2 +- third/asio/is_read_buffered.hpp | 2 +- third/asio/is_write_buffered.hpp | 2 +- third/asio/local/basic_endpoint.hpp | 8 +- third/asio/local/connect_pair.hpp | 2 +- third/asio/local/datagram_protocol.hpp | 8 +- third/asio/local/detail/endpoint.hpp | 2 +- third/asio/local/detail/impl/endpoint.ipp | 2 +- third/asio/local/seq_packet_protocol.hpp | 84 + third/asio/local/stream_protocol.hpp | 8 +- third/asio/multiple_exceptions.hpp | 12 +- third/asio/packaged_task.hpp | 62 +- third/asio/placeholders.hpp | 134 +- third/asio/posix/basic_descriptor.hpp | 50 +- third/asio/posix/basic_stream_descriptor.hpp | 58 +- third/asio/posix/descriptor.hpp | 2 +- third/asio/posix/descriptor_base.hpp | 2 +- third/asio/posix/stream_descriptor.hpp | 2 +- third/asio/post.hpp | 70 +- third/asio/prefer.hpp | 509 ++---- third/asio/prepend.hpp | 34 +- third/asio/query.hpp | 127 +- third/asio/random_access_file.hpp | 2 +- third/asio/read.hpp | 304 ++-- third/asio/read_at.hpp | 87 +- third/asio/read_until.hpp | 554 +++---- third/asio/readable_pipe.hpp | 2 +- third/asio/recycling_allocator.hpp | 30 +- third/asio/redirect_error.hpp | 16 +- third/asio/registered_buffer.hpp | 82 +- third/asio/require.hpp | 354 ++-- third/asio/require_concept.hpp | 149 +- third/asio/serial_port.hpp | 2 +- third/asio/serial_port_base.hpp | 2 +- third/asio/signal_set.hpp | 2 +- third/asio/signal_set_base.hpp | 171 ++ third/asio/socket_base.hpp | 2 +- third/asio/spawn.hpp | 288 ++-- third/asio/ssl.hpp | 2 +- third/asio/ssl/context.hpp | 4 +- third/asio/ssl/context_base.hpp | 48 +- .../asio/ssl/detail/buffered_handshake_op.hpp | 6 +- third/asio/ssl/detail/engine.hpp | 10 +- third/asio/ssl/detail/handshake_op.hpp | 6 +- third/asio/ssl/detail/impl/engine.ipp | 10 +- third/asio/ssl/detail/impl/openssl_init.ipp | 4 +- third/asio/ssl/detail/io.hpp | 91 +- third/asio/ssl/detail/openssl_init.hpp | 2 +- third/asio/ssl/detail/openssl_types.hpp | 2 +- third/asio/ssl/detail/password_callback.hpp | 2 +- third/asio/ssl/detail/read_op.hpp | 6 +- third/asio/ssl/detail/shutdown_op.hpp | 8 +- third/asio/ssl/detail/stream_core.hpp | 34 +- third/asio/ssl/detail/verify_callback.hpp | 4 +- third/asio/ssl/detail/write_op.hpp | 6 +- third/asio/ssl/error.hpp | 4 +- third/asio/ssl/host_name_verification.hpp | 2 +- third/asio/ssl/impl/context.hpp | 2 +- third/asio/ssl/impl/context.ipp | 6 +- third/asio/ssl/impl/error.ipp | 6 +- .../asio/ssl/impl/host_name_verification.ipp | 2 +- third/asio/ssl/impl/rfc2818_verification.ipp | 2 +- third/asio/ssl/impl/src.hpp | 2 +- third/asio/ssl/rfc2818_verification.hpp | 2 +- third/asio/ssl/stream.hpp | 133 +- third/asio/ssl/stream_base.hpp | 2 +- third/asio/ssl/verify_context.hpp | 2 +- third/asio/ssl/verify_mode.hpp | 2 +- third/asio/static_thread_pool.hpp | 2 +- third/asio/steady_timer.hpp | 7 +- third/asio/strand.hpp | 209 ++- third/asio/stream_file.hpp | 2 +- third/asio/streambuf.hpp | 2 +- third/asio/system_context.hpp | 6 +- third/asio/system_error.hpp | 104 +- third/asio/system_executor.hpp | 124 +- third/asio/system_timer.hpp | 7 +- third/asio/this_coro.hpp | 83 +- third/asio/thread.hpp | 2 +- third/asio/thread_pool.hpp | 364 ++--- third/asio/time_traits.hpp | 2 +- third/asio/traits/bulk_execute_free.hpp | 114 -- third/asio/traits/bulk_execute_member.hpp | 114 -- third/asio/traits/connect_free.hpp | 112 -- third/asio/traits/connect_member.hpp | 112 -- third/asio/traits/equality_comparable.hpp | 32 +- third/asio/traits/execute_free.hpp | 108 -- third/asio/traits/execute_member.hpp | 36 +- third/asio/traits/prefer_free.hpp | 36 +- third/asio/traits/prefer_member.hpp | 36 +- third/asio/traits/query_free.hpp | 36 +- third/asio/traits/query_member.hpp | 36 +- .../traits/query_static_constexpr_member.hpp | 37 +- third/asio/traits/require_concept_free.hpp | 36 +- third/asio/traits/require_concept_member.hpp | 36 +- third/asio/traits/require_free.hpp | 36 +- third/asio/traits/require_member.hpp | 36 +- third/asio/traits/schedule_free.hpp | 108 -- third/asio/traits/schedule_member.hpp | 108 -- third/asio/traits/set_done_free.hpp | 108 -- third/asio/traits/set_done_member.hpp | 108 -- third/asio/traits/set_error_free.hpp | 112 -- third/asio/traits/set_error_member.hpp | 112 -- third/asio/traits/set_value_free.hpp | 234 --- third/asio/traits/set_value_member.hpp | 234 --- third/asio/traits/start_free.hpp | 108 -- third/asio/traits/start_member.hpp | 108 -- third/asio/traits/static_query.hpp | 46 +- third/asio/traits/static_require.hpp | 52 +- third/asio/traits/static_require_concept.hpp | 52 +- third/asio/traits/submit_free.hpp | 112 -- third/asio/traits/submit_member.hpp | 112 -- third/asio/ts/buffer.hpp | 2 +- third/asio/ts/executor.hpp | 2 +- third/asio/ts/internet.hpp | 2 +- third/asio/ts/io_context.hpp | 2 +- third/asio/ts/net.hpp | 2 +- third/asio/ts/netfwd.hpp | 30 +- third/asio/ts/socket.hpp | 2 +- third/asio/ts/timer.hpp | 2 +- third/asio/unyield.hpp | 2 +- third/asio/use_awaitable.hpp | 36 +- third/asio/use_future.hpp | 20 +- third/asio/uses_executor.hpp | 8 +- third/asio/version.hpp | 4 +- third/asio/wait_traits.hpp | 2 +- third/asio/windows/basic_object_handle.hpp | 48 +- .../asio/windows/basic_overlapped_handle.hpp | 31 +- .../windows/basic_random_access_handle.hpp | 58 +- third/asio/windows/basic_stream_handle.hpp | 56 +- third/asio/windows/object_handle.hpp | 2 +- third/asio/windows/overlapped_handle.hpp | 2 +- third/asio/windows/overlapped_ptr.hpp | 34 +- third/asio/windows/random_access_handle.hpp | 2 +- third/asio/windows/stream_handle.hpp | 2 +- third/asio/writable_pipe.hpp | 2 +- third/asio/write.hpp | 268 ++-- third/asio/write_at.hpp | 84 +- third/asio/yield.hpp | 2 +- 676 files changed, 14258 insertions(+), 31930 deletions(-) create mode 100644 third/asio/associated_immediate_executor.hpp create mode 100644 third/asio/bind_immediate_executor.hpp delete mode 100644 third/asio/detail/bulk_executor_op.hpp delete mode 100644 third/asio/detail/gcc_arm_fenced_block.hpp delete mode 100644 third/asio/detail/gcc_hppa_fenced_block.hpp delete mode 100644 third/asio/detail/gcc_sync_fenced_block.hpp delete mode 100644 third/asio/detail/gcc_x86_fenced_block.hpp delete mode 100644 third/asio/detail/handler_invoke_helpers.hpp create mode 100644 third/asio/detail/initiate_defer.hpp create mode 100644 third/asio/detail/initiate_dispatch.hpp create mode 100644 third/asio/detail/initiate_post.hpp delete mode 100644 third/asio/detail/macos_fenced_block.hpp delete mode 100644 third/asio/detail/solaris_fenced_block.hpp delete mode 100644 third/asio/detail/variadic_templates.hpp delete mode 100644 third/asio/detail/win_fenced_block.hpp delete mode 100644 third/asio/execution/bulk_execute.hpp delete mode 100644 third/asio/execution/bulk_guarantee.hpp delete mode 100644 third/asio/execution/connect.hpp delete mode 100644 third/asio/execution/detail/as_invocable.hpp delete mode 100644 third/asio/execution/detail/as_operation.hpp delete mode 100644 third/asio/execution/detail/as_receiver.hpp delete mode 100644 third/asio/execution/detail/bulk_sender.hpp delete mode 100644 third/asio/execution/detail/submit_receiver.hpp delete mode 100644 third/asio/execution/detail/void_receiver.hpp delete mode 100644 third/asio/execution/execute.hpp delete mode 100644 third/asio/execution/impl/receiver_invocation_error.ipp delete mode 100644 third/asio/execution/operation_state.hpp delete mode 100644 third/asio/execution/receiver.hpp delete mode 100644 third/asio/execution/receiver_invocation_error.hpp delete mode 100644 third/asio/execution/schedule.hpp delete mode 100644 third/asio/execution/scheduler.hpp delete mode 100644 third/asio/execution/sender.hpp delete mode 100644 third/asio/execution/set_done.hpp delete mode 100644 third/asio/execution/set_error.hpp delete mode 100644 third/asio/execution/set_value.hpp delete mode 100644 third/asio/execution/start.hpp delete mode 100644 third/asio/execution/submit.hpp delete mode 100644 third/asio/handler_alloc_hook.hpp delete mode 100644 third/asio/handler_invoke_hook.hpp delete mode 100644 third/asio/impl/defer.hpp delete mode 100644 third/asio/impl/dispatch.hpp delete mode 100644 third/asio/impl/handler_alloc_hook.ipp delete mode 100644 third/asio/impl/post.hpp create mode 100644 third/asio/local/seq_packet_protocol.hpp create mode 100644 third/asio/signal_set_base.hpp delete mode 100644 third/asio/traits/bulk_execute_free.hpp delete mode 100644 third/asio/traits/bulk_execute_member.hpp delete mode 100644 third/asio/traits/connect_free.hpp delete mode 100644 third/asio/traits/connect_member.hpp delete mode 100644 third/asio/traits/execute_free.hpp delete mode 100644 third/asio/traits/schedule_free.hpp delete mode 100644 third/asio/traits/schedule_member.hpp delete mode 100644 third/asio/traits/set_done_free.hpp delete mode 100644 third/asio/traits/set_done_member.hpp delete mode 100644 third/asio/traits/set_error_free.hpp delete mode 100644 third/asio/traits/set_error_member.hpp delete mode 100644 third/asio/traits/set_value_free.hpp delete mode 100644 third/asio/traits/set_value_member.hpp delete mode 100644 third/asio/traits/start_free.hpp delete mode 100644 third/asio/traits/start_member.hpp delete mode 100644 third/asio/traits/submit_free.hpp delete mode 100644 third/asio/traits/submit_member.hpp diff --git a/third/asio.hpp b/third/asio.hpp index 36fa9b2d2..3421b58bd 100644 --- a/third/asio.hpp +++ b/third/asio.hpp @@ -2,7 +2,7 @@ // asio.hpp // ~~~~~~~~ // -// Copyright (c) 2003-2022 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// 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) @@ -21,8 +21,9 @@ #include "asio/append.hpp" #include "asio/as_tuple.hpp" #include "asio/associated_allocator.hpp" -#include "asio/associated_executor.hpp" #include "asio/associated_cancellation_slot.hpp" +#include "asio/associated_executor.hpp" +#include "asio/associated_immediate_executor.hpp" #include "asio/associator.hpp" #include "asio/async_result.hpp" #include "asio/awaitable.hpp" @@ -48,6 +49,7 @@ #include "asio/bind_allocator.hpp" #include "asio/bind_cancellation_slot.hpp" #include "asio/bind_executor.hpp" +#include "asio/bind_immediate_executor.hpp" #include "asio/buffer.hpp" #include "asio/buffer_registration.hpp" #include "asio/buffered_read_stream_fwd.hpp" @@ -79,30 +81,15 @@ #include "asio/execution/any_executor.hpp" #include "asio/execution/blocking.hpp" #include "asio/execution/blocking_adaptation.hpp" -#include "asio/execution/bulk_execute.hpp" -#include "asio/execution/bulk_guarantee.hpp" -#include "asio/execution/connect.hpp" #include "asio/execution/context.hpp" #include "asio/execution/context_as.hpp" -#include "asio/execution/execute.hpp" #include "asio/execution/executor.hpp" #include "asio/execution/invocable_archetype.hpp" #include "asio/execution/mapping.hpp" #include "asio/execution/occupancy.hpp" -#include "asio/execution/operation_state.hpp" #include "asio/execution/outstanding_work.hpp" #include "asio/execution/prefer_only.hpp" -#include "asio/execution/receiver.hpp" -#include "asio/execution/receiver_invocation_error.hpp" #include "asio/execution/relationship.hpp" -#include "asio/execution/schedule.hpp" -#include "asio/execution/scheduler.hpp" -#include "asio/execution/sender.hpp" -#include "asio/execution/set_done.hpp" -#include "asio/execution/set_error.hpp" -#include "asio/execution/set_value.hpp" -#include "asio/execution/start.hpp" -#include "asio/execution_context.hpp" #include "asio/executor.hpp" #include "asio/executor_work_guard.hpp" #include "asio/file_base.hpp" @@ -111,9 +98,7 @@ #include "asio/generic/raw_protocol.hpp" #include "asio/generic/seq_packet_protocol.hpp" #include "asio/generic/stream_protocol.hpp" -#include "asio/handler_alloc_hook.hpp" #include "asio/handler_continuation_hook.hpp" -#include "asio/handler_invoke_hook.hpp" #include "asio/high_resolution_timer.hpp" #include "asio/io_context.hpp" #include "asio/io_context_strand.hpp" @@ -151,6 +136,7 @@ #include "asio/local/basic_endpoint.hpp" #include "asio/local/connect_pair.hpp" #include "asio/local/datagram_protocol.hpp" +#include "asio/local/seq_packet_protocol.hpp" #include "asio/local/stream_protocol.hpp" #include "asio/multiple_exceptions.hpp" #include "asio/packaged_task.hpp" @@ -177,6 +163,7 @@ #include "asio/serial_port.hpp" #include "asio/serial_port_base.hpp" #include "asio/signal_set.hpp" +#include "asio/signal_set_base.hpp" #include "asio/socket_base.hpp" #include "asio/static_thread_pool.hpp" #include "asio/steady_timer.hpp" diff --git a/third/asio/any_completion_executor.hpp b/third/asio/any_completion_executor.hpp index 5fdb6917c..650ff7baf 100644 --- a/third/asio/any_completion_executor.hpp +++ b/third/asio/any_completion_executor.hpp @@ -2,7 +2,7 @@ // any_completion_executor.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2022 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// 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) @@ -75,20 +75,18 @@ class any_completion_executor : #endif // !defined(GENERATING_DOCUMENTATION) /// Default constructor. - ASIO_DECL any_completion_executor() ASIO_NOEXCEPT; + ASIO_DECL any_completion_executor() noexcept; /// Construct in an empty state. Equivalent effects to default constructor. - ASIO_DECL any_completion_executor(nullptr_t) ASIO_NOEXCEPT; + ASIO_DECL any_completion_executor(nullptr_t) noexcept; /// Copy constructor. ASIO_DECL any_completion_executor( - const any_completion_executor& e) ASIO_NOEXCEPT; + const any_completion_executor& e) noexcept; -#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) /// Move constructor. ASIO_DECL any_completion_executor( - any_completion_executor&& e) ASIO_NOEXCEPT; -#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) + any_completion_executor&& e) noexcept; /// Construct to point to the same target as another any_executor. #if defined(GENERATING_DOCUMENTATION) @@ -98,7 +96,7 @@ class any_completion_executor : #else // defined(GENERATING_DOCUMENTATION) template any_completion_executor(OtherAnyExecutor e, - typename constraint< + constraint_t< conditional< !is_same::value && is_base_of, false_type >::type::value - >::type = 0) - : base_type(ASIO_MOVE_CAST(OtherAnyExecutor)(e)) + > = 0) + : base_type(static_cast(e)) { } #endif // defined(GENERATING_DOCUMENTATION) @@ -122,7 +120,7 @@ class any_completion_executor : #else // defined(GENERATING_DOCUMENTATION) template any_completion_executor(std::nothrow_t, OtherAnyExecutor e, - typename constraint< + constraint_t< conditional< !is_same::value && is_base_of, false_type >::type::value - >::type = 0) ASIO_NOEXCEPT - : base_type(std::nothrow, ASIO_MOVE_CAST(OtherAnyExecutor)(e)) + > = 0) noexcept + : base_type(std::nothrow, static_cast(e)) { } #endif // defined(GENERATING_DOCUMENTATION) /// Construct to point to the same target as another any_executor. ASIO_DECL any_completion_executor(std::nothrow_t, - const any_completion_executor& e) ASIO_NOEXCEPT; + const any_completion_executor& e) noexcept; -#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) /// Construct to point to the same target as another any_executor. ASIO_DECL any_completion_executor(std::nothrow_t, - any_completion_executor&& e) ASIO_NOEXCEPT; -#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) + any_completion_executor&& e) noexcept; /// Construct a polymorphic wrapper for the specified executor. #if defined(GENERATING_DOCUMENTATION) @@ -155,7 +151,7 @@ class any_completion_executor : #else // defined(GENERATING_DOCUMENTATION) template any_completion_executor(Executor e, - typename constraint< + constraint_t< conditional< !is_same::value && !is_base_of, false_type >::type::value - >::type = 0) - : base_type(ASIO_MOVE_CAST(Executor)(e)) + > = 0) + : base_type(static_cast(e)) { } #endif // defined(GENERATING_DOCUMENTATION) @@ -177,7 +173,7 @@ class any_completion_executor : #else // defined(GENERATING_DOCUMENTATION) template any_completion_executor(std::nothrow_t, Executor e, - typename constraint< + constraint_t< conditional< !is_same::value && !is_base_of, false_type >::type::value - >::type = 0) ASIO_NOEXCEPT - : base_type(std::nothrow, ASIO_MOVE_CAST(Executor)(e)) + > = 0) noexcept + : base_type(std::nothrow, static_cast(e)) { } #endif // defined(GENERATING_DOCUMENTATION) /// Assignment operator. ASIO_DECL any_completion_executor& operator=( - const any_completion_executor& e) ASIO_NOEXCEPT; + const any_completion_executor& e) noexcept; -#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) /// Move assignment operator. ASIO_DECL any_completion_executor& operator=( - any_completion_executor&& e) ASIO_NOEXCEPT; -#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) + any_completion_executor&& e) noexcept; /// Assignment operator that sets the polymorphic wrapper to the empty state. ASIO_DECL any_completion_executor& operator=(nullptr_t); @@ -209,7 +203,7 @@ class any_completion_executor : ASIO_DECL ~any_completion_executor(); /// Swap targets with another polymorphic wrapper. - ASIO_DECL void swap(any_completion_executor& other) ASIO_NOEXCEPT; + ASIO_DECL void swap(any_completion_executor& other) noexcept; /// Obtain a polymorphic wrapper with the specified property. /** @@ -222,9 +216,9 @@ class any_completion_executor : */ template any_completion_executor require(const Property& p, - typename constraint< + constraint_t< traits::require_member::is_valid - >::type = 0) const + > = 0) const { return static_cast(*this).require(p); } @@ -240,9 +234,9 @@ class any_completion_executor : */ template any_completion_executor prefer(const Property& p, - typename constraint< + constraint_t< traits::prefer_member::is_valid - >::type = 0) const + > = 0) const { return static_cast(*this).prefer(p); } diff --git a/third/asio/any_completion_handler.hpp b/third/asio/any_completion_handler.hpp index d7522bd2c..45b3e75fe 100644 --- a/third/asio/any_completion_handler.hpp +++ b/third/asio/any_completion_handler.hpp @@ -2,7 +2,7 @@ // any_completion_handler.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2022 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// 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) @@ -12,20 +12,16 @@ #define ASIO_ANY_COMPLETION_HANDLER_HPP #include "asio/detail/config.hpp" - -#if (defined(ASIO_HAS_STD_TUPLE) \ - && defined(ASIO_HAS_MOVE) \ - && defined(ASIO_HAS_VARIADIC_TEMPLATES)) \ - || defined(GENERATING_DOCUMENTATION) - #include #include #include #include #include "asio/any_completion_executor.hpp" +#include "asio/any_io_executor.hpp" #include "asio/associated_allocator.hpp" #include "asio/associated_cancellation_slot.hpp" #include "asio/associated_executor.hpp" +#include "asio/associated_immediate_executor.hpp" #include "asio/cancellation_state.hpp" #include "asio/recycling_allocator.hpp" @@ -39,11 +35,11 @@ class any_completion_handler_impl_base public: template explicit any_completion_handler_impl_base(S&& slot) - : cancel_state_(ASIO_MOVE_CAST(S)(slot), enable_total_cancellation()) + : cancel_state_(static_cast(slot), enable_total_cancellation()) { } - cancellation_slot get_cancellation_slot() const ASIO_NOEXCEPT + cancellation_slot get_cancellation_slot() const noexcept { return cancel_state_.slot(); } @@ -59,8 +55,8 @@ class any_completion_handler_impl : public: template any_completion_handler_impl(S&& slot, H&& h) - : any_completion_handler_impl_base(ASIO_MOVE_CAST(S)(slot)), - handler_(ASIO_MOVE_CAST(H)(h)) + : any_completion_handler_impl_base(static_cast(slot)), + handler_(static_cast(h)) { } @@ -103,7 +99,7 @@ class any_completion_handler_impl : any_completion_handler_impl* ptr = new (uninit_ptr.get()) any_completion_handler_impl( - ASIO_MOVE_CAST(S)(slot), ASIO_MOVE_CAST(H)(h)); + static_cast(slot), static_cast(h)); uninit_ptr.release(); return ptr; @@ -119,12 +115,19 @@ class any_completion_handler_impl : } any_completion_executor executor( - const any_completion_executor& candidate) const ASIO_NOEXCEPT + const any_completion_executor& candidate) const noexcept { return any_completion_executor(std::nothrow, (get_associated_executor)(handler_, candidate)); } + any_completion_executor immediate_executor( + const any_io_executor& candidate) const noexcept + { + return any_completion_executor(std::nothrow, + (get_associated_immediate_executor)(handler_, candidate)); + } + void* allocate(std::size_t size, std::size_t align) const { typename std::allocator_traits< @@ -180,11 +183,11 @@ class any_completion_handler_impl : asio::recycling_allocator())}; std::unique_ptr ptr(this, d); - Handler handler(ASIO_MOVE_CAST(Handler)(handler_)); + Handler handler(static_cast(handler_)); ptr.reset(); - ASIO_MOVE_CAST(Handler)(handler)( - ASIO_MOVE_CAST(Args)(args)...); + static_cast(handler)( + static_cast(args)...); } private: @@ -207,14 +210,14 @@ class any_completion_handler_call_fn void call(any_completion_handler_impl_base* impl, Args... args) const { - call_fn_(impl, ASIO_MOVE_CAST(Args)(args)...); + call_fn_(impl, static_cast(args)...); } template static void impl(any_completion_handler_impl_base* impl, Args... args) { static_cast*>(impl)->call( - ASIO_MOVE_CAST(Args)(args)...); + static_cast(args)...); } private: @@ -305,6 +308,36 @@ class any_completion_handler_executor_fn type executor_fn_; }; +class any_completion_handler_immediate_executor_fn +{ +public: + using type = any_completion_executor(*)( + any_completion_handler_impl_base*, const any_io_executor&); + + constexpr any_completion_handler_immediate_executor_fn(type fn) + : immediate_executor_fn_(fn) + { + } + + any_completion_executor immediate_executor( + any_completion_handler_impl_base* impl, + const any_io_executor& candidate) const + { + return immediate_executor_fn_(impl, candidate); + } + + template + static any_completion_executor impl(any_completion_handler_impl_base* impl, + const any_io_executor& candidate) + { + return static_cast*>( + impl)->immediate_executor(candidate); + } + +private: + type immediate_executor_fn_; +}; + class any_completion_handler_allocate_fn { public: @@ -367,6 +400,7 @@ template class any_completion_handler_fn_table : private any_completion_handler_destroy_fn, private any_completion_handler_executor_fn, + private any_completion_handler_immediate_executor_fn, private any_completion_handler_allocate_fn, private any_completion_handler_deallocate_fn, private any_completion_handler_call_fns @@ -376,11 +410,13 @@ class any_completion_handler_fn_table constexpr any_completion_handler_fn_table( any_completion_handler_destroy_fn::type destroy_fn, any_completion_handler_executor_fn::type executor_fn, + any_completion_handler_immediate_executor_fn::type immediate_executor_fn, any_completion_handler_allocate_fn::type allocate_fn, any_completion_handler_deallocate_fn::type deallocate_fn, CallFns... call_fns) : any_completion_handler_destroy_fn(destroy_fn), any_completion_handler_executor_fn(executor_fn), + any_completion_handler_immediate_executor_fn(immediate_executor_fn), any_completion_handler_allocate_fn(allocate_fn), any_completion_handler_deallocate_fn(deallocate_fn), any_completion_handler_call_fns(call_fns...) @@ -389,6 +425,7 @@ class any_completion_handler_fn_table using any_completion_handler_destroy_fn::destroy; using any_completion_handler_executor_fn::executor; + using any_completion_handler_immediate_executor_fn::immediate_executor; using any_completion_handler_allocate_fn::allocate; using any_completion_handler_deallocate_fn::deallocate; using any_completion_handler_call_fns::call; @@ -401,6 +438,7 @@ struct any_completion_handler_fn_table_instance value = any_completion_handler_fn_table( &any_completion_handler_destroy_fn::impl, &any_completion_handler_executor_fn::impl, + &any_completion_handler_immediate_executor_fn::impl, &any_completion_handler_allocate_fn::impl, &any_completion_handler_deallocate_fn::impl, &any_completion_handler_call_fn::template impl...); @@ -415,6 +453,8 @@ any_completion_handler_fn_table_instance::value; template class any_completion_handler; +/// An allocator type that forwards memory allocation operations through an +/// instance of @c any_completion_handler. template class any_completion_handler_allocator { @@ -429,55 +469,72 @@ class any_completion_handler_allocator detail::any_completion_handler_impl_base* impl_; constexpr any_completion_handler_allocator(int, - const any_completion_handler& h) ASIO_NOEXCEPT + const any_completion_handler& h) noexcept : fn_table_(h.fn_table_), impl_(h.impl_) { } public: + /// The type of objects that may be allocated by the allocator. typedef T value_type; + /// Rebinds an allocator to another value type. template struct rebind { + /// Specifies the type of the rebound allocator. typedef any_completion_handler_allocator other; }; + /// Construct from another @c any_completion_handler_allocator. template constexpr any_completion_handler_allocator( const any_completion_handler_allocator& a) - ASIO_NOEXCEPT + noexcept : fn_table_(a.fn_table_), impl_(a.impl_) { } + /// Equality operator. constexpr bool operator==( - const any_completion_handler_allocator& other) const ASIO_NOEXCEPT + const any_completion_handler_allocator& other) const noexcept { return fn_table_ == other.fn_table_ && impl_ == other.impl_; } + /// Inequality operator. constexpr bool operator!=( - const any_completion_handler_allocator& other) const ASIO_NOEXCEPT + const any_completion_handler_allocator& other) const noexcept { return fn_table_ != other.fn_table_ || impl_ != other.impl_; } + /// Allocate space for @c n objects of the allocator's value type. T* allocate(std::size_t n) const { - return static_cast( - fn_table_->allocate( - impl_, sizeof(T) * n, alignof(T))); + if (fn_table_) + { + return static_cast( + fn_table_->allocate( + impl_, sizeof(T) * n, alignof(T))); + } + std::bad_alloc ex; + asio::detail::throw_exception(ex); + return nullptr; } + /// Deallocate space for @c n objects of the allocator's value type. void deallocate(T* p, std::size_t n) const { fn_table_->deallocate(impl_, p, sizeof(T) * n, alignof(T)); } }; +/// A protoco-allocator type that may be rebound to obtain an allocator that +/// forwards memory allocation operations through an instance of +/// @c any_completion_handler. template class any_completion_handler_allocator { @@ -492,46 +549,70 @@ class any_completion_handler_allocator detail::any_completion_handler_impl_base* impl_; constexpr any_completion_handler_allocator(int, - const any_completion_handler& h) ASIO_NOEXCEPT + const any_completion_handler& h) noexcept : fn_table_(h.fn_table_), impl_(h.impl_) { } public: + /// @c void as no objects can be allocated through a proto-allocator. typedef void value_type; + /// Rebinds an allocator to another value type. template struct rebind { + /// Specifies the type of the rebound allocator. typedef any_completion_handler_allocator other; }; + /// Construct from another @c any_completion_handler_allocator. template constexpr any_completion_handler_allocator( const any_completion_handler_allocator& a) - ASIO_NOEXCEPT + noexcept : fn_table_(a.fn_table_), impl_(a.impl_) { } + /// Equality operator. constexpr bool operator==( - const any_completion_handler_allocator& other) const ASIO_NOEXCEPT + const any_completion_handler_allocator& other) const noexcept { return fn_table_ == other.fn_table_ && impl_ == other.impl_; } + /// Inequality operator. constexpr bool operator!=( - const any_completion_handler_allocator& other) const ASIO_NOEXCEPT + const any_completion_handler_allocator& other) const noexcept { return fn_table_ != other.fn_table_ || impl_ != other.impl_; } }; +/// Polymorphic wrapper for completion handlers. +/** + * The @c any_completion_handler class template is a polymorphic wrapper for + * completion handlers that propagates the associated executor, associated + * allocator, and associated cancellation slot through a type-erasing interface. + * + * When using @c any_completion_handler, specify one or more completion + * signatures as template parameters. These will dictate the arguments that may + * be passed to the handler through the polymorphic interface. + * + * Typical uses for @c any_completion_handler include: + * + * @li Separate compilation of asynchronous operation implementations. + * + * @li Enabling interoperability between asynchronous operations and virtual + * functions. + */ template class any_completion_handler { +#if !defined(GENERATING_DOCUMENTATION) private: template friend class any_completion_handler_allocator; @@ -539,36 +620,55 @@ class any_completion_handler template friend struct associated_executor; + template + friend struct associated_immediate_executor; + const detail::any_completion_handler_fn_table* fn_table_; detail::any_completion_handler_impl_base* impl_; +#endif // !defined(GENERATING_DOCUMENTATION) public: + /// The associated allocator type. using allocator_type = any_completion_handler_allocator; + + /// The associated cancellation slot type. using cancellation_slot_type = cancellation_slot; + /// Construct an @c any_completion_handler in an empty state, without a target + /// object. constexpr any_completion_handler() : fn_table_(nullptr), impl_(nullptr) { } + /// Construct an @c any_completion_handler in an empty state, without a target + /// object. constexpr any_completion_handler(nullptr_t) : fn_table_(nullptr), impl_(nullptr) { } - template ::type> - any_completion_handler(H&& h) + /// Construct an @c any_completion_handler to contain the specified target. + template > + any_completion_handler(H&& h, + constraint_t< + !is_same, any_completion_handler>::value + > = 0) : fn_table_( &detail::any_completion_handler_fn_table_instance< Handler, Signatures...>::value), impl_(detail::any_completion_handler_impl::create( - (get_associated_cancellation_slot)(h), ASIO_MOVE_CAST(H)(h))) + (get_associated_cancellation_slot)(h), static_cast(h))) { } - any_completion_handler(any_completion_handler&& other) ASIO_NOEXCEPT + /// Move-construct an @c any_completion_handler from another. + /** + * After the operation, the moved-from object @c other has no target. + */ + any_completion_handler(any_completion_handler&& other) noexcept : fn_table_(other.fn_table_), impl_(other.impl_) { @@ -576,84 +676,109 @@ class any_completion_handler other.impl_ = nullptr; } + /// Move-assign an @c any_completion_handler from another. + /** + * After the operation, the moved-from object @c other has no target. + */ any_completion_handler& operator=( - any_completion_handler&& other) ASIO_NOEXCEPT + any_completion_handler&& other) noexcept { - any_completion_handler(other).swap(*this); + any_completion_handler( + static_cast(other)).swap(*this); return *this; } - any_completion_handler& operator=(nullptr_t) ASIO_NOEXCEPT + /// Assignment operator that sets the polymorphic wrapper to the empty state. + any_completion_handler& operator=(nullptr_t) noexcept { any_completion_handler().swap(*this); return *this; } + /// Destructor. ~any_completion_handler() { if (impl_) fn_table_->destroy(impl_); } - constexpr explicit operator bool() const ASIO_NOEXCEPT + /// Test if the polymorphic wrapper is empty. + constexpr explicit operator bool() const noexcept { return impl_ != nullptr; } - constexpr bool operator!() const ASIO_NOEXCEPT + /// Test if the polymorphic wrapper is non-empty. + constexpr bool operator!() const noexcept { return impl_ == nullptr; } - void swap(any_completion_handler& other) ASIO_NOEXCEPT + /// Swap the content of an @c any_completion_handler with another. + void swap(any_completion_handler& other) noexcept { std::swap(fn_table_, other.fn_table_); std::swap(impl_, other.impl_); } - allocator_type get_allocator() const ASIO_NOEXCEPT + /// Get the associated allocator. + allocator_type get_allocator() const noexcept { return allocator_type(0, *this); } - cancellation_slot_type get_cancellation_slot() const ASIO_NOEXCEPT + /// Get the associated cancellation slot. + cancellation_slot_type get_cancellation_slot() const noexcept { - return impl_->get_cancellation_slot(); + return impl_ ? impl_->get_cancellation_slot() : cancellation_slot_type(); } + /// Function call operator. + /** + * Invokes target completion handler with the supplied arguments. + * + * This function may only be called once, as the target handler is moved from. + * The polymorphic wrapper is left in an empty state. + * + * Throws @c std::bad_function_call if the polymorphic wrapper is empty. + */ template auto operator()(Args&&... args) - -> decltype(fn_table_->call(impl_, ASIO_MOVE_CAST(Args)(args)...)) + -> decltype(fn_table_->call(impl_, static_cast(args)...)) { if (detail::any_completion_handler_impl_base* impl = impl_) { impl_ = nullptr; - return fn_table_->call(impl, ASIO_MOVE_CAST(Args)(args)...); + return fn_table_->call(impl, static_cast(args)...); } std::bad_function_call ex; asio::detail::throw_exception(ex); } + /// Equality operator. friend constexpr bool operator==( - const any_completion_handler& a, nullptr_t) ASIO_NOEXCEPT + const any_completion_handler& a, nullptr_t) noexcept { return a.impl_ == nullptr; } + /// Equality operator. friend constexpr bool operator==( - nullptr_t, const any_completion_handler& b) ASIO_NOEXCEPT + nullptr_t, const any_completion_handler& b) noexcept { return nullptr == b.impl_; } + /// Inequality operator. friend constexpr bool operator!=( - const any_completion_handler& a, nullptr_t) ASIO_NOEXCEPT + const any_completion_handler& a, nullptr_t) noexcept { return a.impl_ != nullptr; } + /// Inequality operator. friend constexpr bool operator!=( - nullptr_t, const any_completion_handler& b) ASIO_NOEXCEPT + nullptr_t, const any_completion_handler& b) noexcept { return nullptr != b.impl_; } @@ -665,10 +790,28 @@ struct associated_executor, Candidate> using type = any_completion_executor; static type get(const any_completion_handler& handler, - const Candidate& candidate = Candidate()) ASIO_NOEXCEPT + const Candidate& candidate = Candidate()) noexcept { - return handler.fn_table_->executor(handler.impl_, - any_completion_executor(std::nothrow, candidate)); + any_completion_executor any_candidate(std::nothrow, candidate); + return handler.fn_table_ + ? handler.fn_table_->executor(handler.impl_, any_candidate) + : any_candidate; + } +}; + +template +struct associated_immediate_executor< + any_completion_handler, Candidate> +{ + using type = any_completion_executor; + + static type get(const any_completion_handler& handler, + const Candidate& candidate = Candidate()) noexcept + { + any_io_executor any_candidate(std::nothrow, candidate); + return handler.fn_table_ + ? handler.fn_table_->immediate_executor(handler.impl_, any_candidate) + : any_candidate; } }; @@ -676,9 +819,4 @@ struct associated_executor, Candidate> #include "asio/detail/pop_options.hpp" -#endif // (defined(ASIO_HAS_STD_TUPLE) - // && defined(ASIO_HAS_MOVE) - // && defined(ASIO_HAS_VARIADIC_TEMPLATES)) - // || defined(GENERATING_DOCUMENTATION) - #endif // ASIO_ANY_COMPLETION_HANDLER_HPP diff --git a/third/asio/any_io_executor.hpp b/third/asio/any_io_executor.hpp index 829b968e7..d35acf44a 100644 --- a/third/asio/any_io_executor.hpp +++ b/third/asio/any_io_executor.hpp @@ -2,7 +2,7 @@ // any_io_executor.hpp // ~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2022 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// 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) @@ -87,18 +87,16 @@ class any_io_executor : #endif // !defined(GENERATING_DOCUMENTATION) /// Default constructor. - ASIO_DECL any_io_executor() ASIO_NOEXCEPT; + ASIO_DECL any_io_executor() noexcept; /// Construct in an empty state. Equivalent effects to default constructor. - ASIO_DECL any_io_executor(nullptr_t) ASIO_NOEXCEPT; + ASIO_DECL any_io_executor(nullptr_t) noexcept; /// Copy constructor. - ASIO_DECL any_io_executor(const any_io_executor& e) ASIO_NOEXCEPT; + ASIO_DECL any_io_executor(const any_io_executor& e) noexcept; -#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) /// Move constructor. - ASIO_DECL any_io_executor(any_io_executor&& e) ASIO_NOEXCEPT; -#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) + ASIO_DECL any_io_executor(any_io_executor&& e) noexcept; /// Construct to point to the same target as another any_executor. #if defined(GENERATING_DOCUMENTATION) @@ -107,8 +105,8 @@ class any_io_executor : #else // defined(GENERATING_DOCUMENTATION) template any_io_executor(OtherAnyExecutor e, - typename constraint< - conditional< + constraint_t< + conditional_t< !is_same::value && is_base_of::value, @@ -116,9 +114,9 @@ class any_io_executor : 0, supportable_properties_type>::template is_valid_target, false_type - >::type::value - >::type = 0) - : base_type(ASIO_MOVE_CAST(OtherAnyExecutor)(e)) + >::value + > = 0) + : base_type(static_cast(e)) { } #endif // defined(GENERATING_DOCUMENTATION) @@ -131,8 +129,8 @@ class any_io_executor : #else // defined(GENERATING_DOCUMENTATION) template any_io_executor(std::nothrow_t, OtherAnyExecutor e, - typename constraint< - conditional< + constraint_t< + conditional_t< !is_same::value && is_base_of::value, @@ -140,22 +138,19 @@ class any_io_executor : 0, supportable_properties_type>::template is_valid_target, false_type - >::type::value - >::type = 0) ASIO_NOEXCEPT - : base_type(std::nothrow, ASIO_MOVE_CAST(OtherAnyExecutor)(e)) + >::value + > = 0) noexcept + : base_type(std::nothrow, static_cast(e)) { } #endif // defined(GENERATING_DOCUMENTATION) /// Construct to point to the same target as another any_executor. ASIO_DECL any_io_executor(std::nothrow_t, - const any_io_executor& e) ASIO_NOEXCEPT; + const any_io_executor& e) noexcept; -#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) /// Construct to point to the same target as another any_executor. - ASIO_DECL any_io_executor(std::nothrow_t, - any_io_executor&& e) ASIO_NOEXCEPT; -#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) + ASIO_DECL any_io_executor(std::nothrow_t, any_io_executor&& e) noexcept; /// Construct a polymorphic wrapper for the specified executor. #if defined(GENERATING_DOCUMENTATION) @@ -164,17 +159,17 @@ class any_io_executor : #else // defined(GENERATING_DOCUMENTATION) template any_io_executor(Executor e, - typename constraint< - conditional< + constraint_t< + conditional_t< !is_same::value && !is_base_of::value, execution::detail::is_valid_target_executor< Executor, supportable_properties_type>, false_type - >::type::value - >::type = 0) - : base_type(ASIO_MOVE_CAST(Executor)(e)) + >::value + > = 0) + : base_type(static_cast(e)) { } #endif // defined(GENERATING_DOCUMENTATION) @@ -186,30 +181,27 @@ class any_io_executor : #else // defined(GENERATING_DOCUMENTATION) template any_io_executor(std::nothrow_t, Executor e, - typename constraint< - conditional< + constraint_t< + conditional_t< !is_same::value && !is_base_of::value, execution::detail::is_valid_target_executor< Executor, supportable_properties_type>, false_type - >::type::value - >::type = 0) ASIO_NOEXCEPT - : base_type(std::nothrow, ASIO_MOVE_CAST(Executor)(e)) + >::value + > = 0) noexcept + : base_type(std::nothrow, static_cast(e)) { } #endif // defined(GENERATING_DOCUMENTATION) /// Assignment operator. ASIO_DECL any_io_executor& operator=( - const any_io_executor& e) ASIO_NOEXCEPT; + const any_io_executor& e) noexcept; -#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) /// Move assignment operator. - ASIO_DECL any_io_executor& operator=( - any_io_executor&& e) ASIO_NOEXCEPT; -#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) + ASIO_DECL any_io_executor& operator=(any_io_executor&& e) noexcept; /// Assignment operator that sets the polymorphic wrapper to the empty state. ASIO_DECL any_io_executor& operator=(nullptr_t); @@ -218,7 +210,7 @@ class any_io_executor : ASIO_DECL ~any_io_executor(); /// Swap targets with another polymorphic wrapper. - ASIO_DECL void swap(any_io_executor& other) ASIO_NOEXCEPT; + ASIO_DECL void swap(any_io_executor& other) noexcept; /// Obtain a polymorphic wrapper with the specified property. /** @@ -231,9 +223,9 @@ class any_io_executor : */ template any_io_executor require(const Property& p, - typename constraint< + constraint_t< traits::require_member::is_valid - >::type = 0) const + > = 0) const { return static_cast(*this).require(p); } @@ -249,9 +241,9 @@ class any_io_executor : */ template any_io_executor prefer(const Property& p, - typename constraint< + constraint_t< traits::prefer_member::is_valid - >::type = 0) const + > = 0) const { return static_cast(*this).prefer(p); } diff --git a/third/asio/append.hpp b/third/asio/append.hpp index 227de90ff..046089242 100644 --- a/third/asio/append.hpp +++ b/third/asio/append.hpp @@ -2,7 +2,7 @@ // append.hpp // ~~~~~~~~~~ // -// Copyright (c) 2003-2022 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// 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) @@ -16,11 +16,6 @@ #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) #include "asio/detail/config.hpp" - -#if (defined(ASIO_HAS_STD_TUPLE) \ - && defined(ASIO_HAS_VARIADIC_TEMPLATES)) \ - || defined(GENERATING_DOCUMENTATION) - #include #include "asio/detail/type_traits.hpp" @@ -37,11 +32,9 @@ class append_t public: /// Constructor. template - ASIO_CONSTEXPR explicit append_t( - ASIO_MOVE_ARG(T) completion_token, - ASIO_MOVE_ARG(V)... values) - : token_(ASIO_MOVE_CAST(T)(completion_token)), - values_(ASIO_MOVE_CAST(V)(values)...) + constexpr explicit append_t(T&& completion_token, V&&... values) + : token_(static_cast(completion_token)), + values_(static_cast(values)...) { } @@ -54,15 +47,13 @@ class append_t /// arguments should be passed additional values after the results of the /// operation. template -ASIO_NODISCARD inline ASIO_CONSTEXPR append_t< - typename decay::type, typename decay::type...> -append(ASIO_MOVE_ARG(CompletionToken) completion_token, - ASIO_MOVE_ARG(Values)... values) +ASIO_NODISCARD inline constexpr +append_t, decay_t...> +append(CompletionToken&& completion_token, Values&&... values) { - return append_t< - typename decay::type, typename decay::type...>( - ASIO_MOVE_CAST(CompletionToken)(completion_token), - ASIO_MOVE_CAST(Values)(values)...); + return append_t, decay_t...>( + static_cast(completion_token), + static_cast(values)...); } } // namespace asio @@ -71,8 +62,4 @@ append(ASIO_MOVE_ARG(CompletionToken) completion_token, #include "asio/impl/append.hpp" -#endif // (defined(ASIO_HAS_STD_TUPLE) - // && defined(ASIO_HAS_VARIADIC_TEMPLATES)) - // || defined(GENERATING_DOCUMENTATION) - #endif // ASIO_APPEND_HPP diff --git a/third/asio/as_tuple.hpp b/third/asio/as_tuple.hpp index 0629033b8..60008bda5 100644 --- a/third/asio/as_tuple.hpp +++ b/third/asio/as_tuple.hpp @@ -2,7 +2,7 @@ // as_tuple.hpp // ~~~~~~~~~~~~ // -// Copyright (c) 2003-2022 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// 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) @@ -16,11 +16,6 @@ #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) #include "asio/detail/config.hpp" - -#if (defined(ASIO_HAS_STD_TUPLE) \ - && defined(ASIO_HAS_VARIADIC_TEMPLATES)) \ - || defined(GENERATING_DOCUMENTATION) - #include "asio/detail/type_traits.hpp" #include "asio/detail/push_options.hpp" @@ -50,18 +45,18 @@ class as_tuple_t * token is itself defaulted as an argument to allow it to capture a source * location. */ - ASIO_CONSTEXPR as_tuple_t( + constexpr as_tuple_t( default_constructor_tag = default_constructor_tag(), CompletionToken token = CompletionToken()) - : token_(ASIO_MOVE_CAST(CompletionToken)(token)) + : token_(static_cast(token)) { } /// Constructor. template - ASIO_CONSTEXPR explicit as_tuple_t( - ASIO_MOVE_ARG(T) completion_token) - : token_(ASIO_MOVE_CAST(T)(completion_token)) + constexpr explicit as_tuple_t( + T&& completion_token) + : token_(static_cast(completion_token)) { } @@ -76,13 +71,13 @@ class as_tuple_t /// Construct the adapted executor from the inner executor type. template executor_with_default(const InnerExecutor1& ex, - typename constraint< - conditional< + constraint_t< + conditional_t< !is_same::value, is_convertible, false_type - >::type::value - >::type = 0) ASIO_NOEXCEPT + >::value + > = 0) noexcept : InnerExecutor(ex) { } @@ -90,25 +85,21 @@ class as_tuple_t /// Type alias to adapt an I/O object to use @c as_tuple_t as its /// default completion token type. -#if defined(ASIO_HAS_ALIAS_TEMPLATES) \ - || defined(GENERATING_DOCUMENTATION) template using as_default_on_t = typename T::template rebind_executor< - executor_with_default >::other; -#endif // defined(ASIO_HAS_ALIAS_TEMPLATES) - // || defined(GENERATING_DOCUMENTATION) + executor_with_default>::other; /// Function helper to adapt an I/O object to use @c as_tuple_t as its /// default completion token type. template - static typename decay::type::template rebind_executor< - executor_with_default::type::executor_type> + static typename decay_t::template rebind_executor< + executor_with_default::executor_type> >::other - as_default_on(ASIO_MOVE_ARG(T) object) + as_default_on(T&& object) { - return typename decay::type::template rebind_executor< - executor_with_default::type::executor_type> - >::other(ASIO_MOVE_CAST(T)(object)); + return typename decay_t::template rebind_executor< + executor_with_default::executor_type> + >::other(static_cast(object)); } //private: @@ -119,11 +110,11 @@ class as_tuple_t /// arguments should be combined into a single tuple argument. template ASIO_NODISCARD inline -ASIO_CONSTEXPR as_tuple_t::type> -as_tuple(ASIO_MOVE_ARG(CompletionToken) completion_token) +constexpr as_tuple_t> +as_tuple(CompletionToken&& completion_token) { - return as_tuple_t::type>( - ASIO_MOVE_CAST(CompletionToken)(completion_token)); + return as_tuple_t>( + static_cast(completion_token)); } } // namespace asio @@ -132,8 +123,4 @@ as_tuple(ASIO_MOVE_ARG(CompletionToken) completion_token) #include "asio/impl/as_tuple.hpp" -#endif // (defined(ASIO_HAS_STD_TUPLE) - // && defined(ASIO_HAS_VARIADIC_TEMPLATES)) - // || defined(GENERATING_DOCUMENTATION) - #endif // ASIO_AS_TUPLE_HPP diff --git a/third/asio/associated_allocator.hpp b/third/asio/associated_allocator.hpp index f4e978032..f21ea250e 100644 --- a/third/asio/associated_allocator.hpp +++ b/third/asio/associated_allocator.hpp @@ -2,7 +2,7 @@ // associated_allocator.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2022 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// 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) @@ -36,9 +36,7 @@ struct has_allocator_type : false_type }; template -struct has_allocator_type::type> - : true_type +struct has_allocator_type> : true_type { }; @@ -49,33 +47,30 @@ struct associated_allocator_impl typedef A type; - static type get(const T&) ASIO_NOEXCEPT + static type get(const T&) noexcept { return type(); } - static const type& get(const T&, const A& a) ASIO_NOEXCEPT + static const type& get(const T&, const A& a) noexcept { return a; } }; template -struct associated_allocator_impl::type> +struct associated_allocator_impl> { typedef typename T::allocator_type type; - static ASIO_AUTO_RETURN_TYPE_PREFIX(type) get( - const T& t) ASIO_NOEXCEPT - ASIO_AUTO_RETURN_TYPE_SUFFIX((t.get_allocator())) + static auto get(const T& t) noexcept + -> decltype(t.get_allocator()) { return t.get_allocator(); } - static ASIO_AUTO_RETURN_TYPE_PREFIX(type) get( - const T& t, const A&) ASIO_NOEXCEPT - ASIO_AUTO_RETURN_TYPE_SUFFIX((t.get_allocator())) + static auto get(const T& t, const A&) noexcept + -> decltype(t.get_allocator()) { return t.get_allocator(); } @@ -83,12 +78,12 @@ struct associated_allocator_impl struct associated_allocator_impl::value - >::type, - typename void_type< + >, + void_t< typename associator::type - >::type> : associator + >> : associator { }; @@ -115,7 +110,7 @@ struct associated_allocator_impl > +template > struct associated_allocator #if !defined(GENERATING_DOCUMENTATION) : detail::associated_allocator_impl @@ -128,11 +123,11 @@ struct associated_allocator /// If @c T has a nested type @c allocator_type, returns /// t.get_allocator(). Otherwise returns @c type(). - static decltype(auto) get(const T& t) ASIO_NOEXCEPT; + static decltype(auto) get(const T& t) noexcept; /// If @c T has a nested type @c allocator_type, returns /// t.get_allocator(). Otherwise returns @c a. - static decltype(auto) get(const T& t, const Allocator& a) ASIO_NOEXCEPT; + static decltype(auto) get(const T& t, const Allocator& a) noexcept; #endif // defined(GENERATING_DOCUMENTATION) }; @@ -142,7 +137,7 @@ struct associated_allocator */ template ASIO_NODISCARD inline typename associated_allocator::type -get_associated_allocator(const T& t) ASIO_NOEXCEPT +get_associated_allocator(const T& t) noexcept { return associated_allocator::get(t); } @@ -152,23 +147,17 @@ get_associated_allocator(const T& t) ASIO_NOEXCEPT * @returns associated_allocator::get(t, a) */ template -ASIO_NODISCARD inline ASIO_AUTO_RETURN_TYPE_PREFIX2( - typename associated_allocator::type) -get_associated_allocator(const T& t, const Allocator& a) ASIO_NOEXCEPT - ASIO_AUTO_RETURN_TYPE_SUFFIX(( - associated_allocator::get(t, a))) +ASIO_NODISCARD inline auto get_associated_allocator( + const T& t, const Allocator& a) noexcept + -> decltype(associated_allocator::get(t, a)) { return associated_allocator::get(t, a); } -#if defined(ASIO_HAS_ALIAS_TEMPLATES) - -template > +template > using associated_allocator_t = typename associated_allocator::type; -#endif // defined(ASIO_HAS_ALIAS_TEMPLATES) - namespace detail { template @@ -178,22 +167,19 @@ struct associated_allocator_forwarding_base template struct associated_allocator_forwarding_base::asio_associated_allocator_is_unspecialised, void >::value - >::type> + >> { typedef void asio_associated_allocator_is_unspecialised; }; } // namespace detail -#if defined(ASIO_HAS_STD_REFERENCE_WRAPPER) \ - || defined(GENERATING_DOCUMENTATION) - /// Specialisation of associated_allocator for @c std::reference_wrapper. template struct associated_allocator, Allocator> @@ -207,25 +193,20 @@ struct associated_allocator, Allocator> /// Forwards the request to get the allocator to the associator specialisation /// for the unwrapped type @c T. - static type get(reference_wrapper t) ASIO_NOEXCEPT + static type get(reference_wrapper t) noexcept { return associated_allocator::get(t.get()); } /// Forwards the request to get the allocator to the associator specialisation /// for the unwrapped type @c T. - static ASIO_AUTO_RETURN_TYPE_PREFIX(type) get( - reference_wrapper t, const Allocator& a) ASIO_NOEXCEPT - ASIO_AUTO_RETURN_TYPE_SUFFIX(( - associated_allocator::get(t.get(), a))) + static auto get(reference_wrapper t, const Allocator& a) noexcept + -> decltype(associated_allocator::get(t.get(), a)) { return associated_allocator::get(t.get(), a); } }; -#endif // defined(ASIO_HAS_STD_REFERENCE_WRAPPER) - // || defined(GENERATING_DOCUMENTATION) - } // namespace asio #include "asio/detail/pop_options.hpp" diff --git a/third/asio/associated_cancellation_slot.hpp b/third/asio/associated_cancellation_slot.hpp index d5b802db8..518bd881e 100644 --- a/third/asio/associated_cancellation_slot.hpp +++ b/third/asio/associated_cancellation_slot.hpp @@ -2,7 +2,7 @@ // associated_cancellation_slot.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2022 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// 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) @@ -36,9 +36,8 @@ struct has_cancellation_slot_type : false_type }; template -struct has_cancellation_slot_type::type> - : true_type +struct has_cancellation_slot_type> + : true_type { }; @@ -49,12 +48,12 @@ struct associated_cancellation_slot_impl typedef S type; - static type get(const T&) ASIO_NOEXCEPT + static type get(const T&) noexcept { return type(); } - static const type& get(const T&, const S& s) ASIO_NOEXCEPT + static const type& get(const T&, const S& s) noexcept { return s; } @@ -62,20 +61,18 @@ struct associated_cancellation_slot_impl template struct associated_cancellation_slot_impl::type> + void_t> { typedef typename T::cancellation_slot_type type; - static ASIO_AUTO_RETURN_TYPE_PREFIX(type) get( - const T& t) ASIO_NOEXCEPT - ASIO_AUTO_RETURN_TYPE_SUFFIX((t.get_cancellation_slot())) + static auto get(const T& t) noexcept + -> decltype(t.get_cancellation_slot()) { return t.get_cancellation_slot(); } - static ASIO_AUTO_RETURN_TYPE_PREFIX(type) get( - const T& t, const S&) ASIO_NOEXCEPT - ASIO_AUTO_RETURN_TYPE_SUFFIX((t.get_cancellation_slot())) + static auto get(const T& t, const S&) noexcept + -> decltype(t.get_cancellation_slot()) { return t.get_cancellation_slot(); } @@ -83,12 +80,12 @@ struct associated_cancellation_slot_impl struct associated_cancellation_slot_impl::value - >::type, - typename void_type< + >, + void_t< typename associator::type - >::type> : associator + >> : associator { }; @@ -129,12 +126,12 @@ struct associated_cancellation_slot /// If @c T has a nested type @c cancellation_slot_type, returns /// t.get_cancellation_slot(). Otherwise returns @c type(). - static decltype(auto) get(const T& t) ASIO_NOEXCEPT; + static decltype(auto) get(const T& t) noexcept; /// If @c T has a nested type @c cancellation_slot_type, returns /// t.get_cancellation_slot(). Otherwise returns @c s. static decltype(auto) get(const T& t, - const CancellationSlot& s) ASIO_NOEXCEPT; + const CancellationSlot& s) noexcept; #endif // defined(GENERATING_DOCUMENTATION) }; @@ -144,7 +141,7 @@ struct associated_cancellation_slot */ template ASIO_NODISCARD inline typename associated_cancellation_slot::type -get_associated_cancellation_slot(const T& t) ASIO_NOEXCEPT +get_associated_cancellation_slot(const T& t) noexcept { return associated_cancellation_slot::get(t); } @@ -155,24 +152,17 @@ get_associated_cancellation_slot(const T& t) ASIO_NOEXCEPT * CancellationSlot>::get(t, st) */ template -ASIO_NODISCARD inline ASIO_AUTO_RETURN_TYPE_PREFIX2( - typename associated_cancellation_slot::type) -get_associated_cancellation_slot(const T& t, - const CancellationSlot& st) ASIO_NOEXCEPT - ASIO_AUTO_RETURN_TYPE_SUFFIX(( - associated_cancellation_slot::get(t, st))) +ASIO_NODISCARD inline auto get_associated_cancellation_slot( + const T& t, const CancellationSlot& st) noexcept + -> decltype(associated_cancellation_slot::get(t, st)) { return associated_cancellation_slot::get(t, st); } -#if defined(ASIO_HAS_ALIAS_TEMPLATES) - template using associated_cancellation_slot_t = typename associated_cancellation_slot::type; -#endif // defined(ASIO_HAS_ALIAS_TEMPLATES) - namespace detail { template @@ -182,22 +172,19 @@ struct associated_cancellation_slot_forwarding_base template struct associated_cancellation_slot_forwarding_base::asio_associated_cancellation_slot_is_unspecialised, void >::value - >::type> + >> { typedef void asio_associated_cancellation_slot_is_unspecialised; }; } // namespace detail -#if defined(ASIO_HAS_STD_REFERENCE_WRAPPER) \ - || defined(GENERATING_DOCUMENTATION) - /// Specialisation of associated_cancellation_slot for @c /// std::reference_wrapper. template @@ -212,25 +199,21 @@ struct associated_cancellation_slot, CancellationSlot> /// Forwards the request to get the cancellation slot to the associator /// specialisation for the unwrapped type @c T. - static type get(reference_wrapper t) ASIO_NOEXCEPT + static type get(reference_wrapper t) noexcept { return associated_cancellation_slot::get(t.get()); } /// Forwards the request to get the cancellation slot to the associator /// specialisation for the unwrapped type @c T. - static ASIO_AUTO_RETURN_TYPE_PREFIX(type) get(reference_wrapper t, - const CancellationSlot& s = CancellationSlot()) ASIO_NOEXCEPT - ASIO_AUTO_RETURN_TYPE_SUFFIX(( - associated_cancellation_slot::get(t.get(), s))) + static auto get(reference_wrapper t, const CancellationSlot& s) noexcept + -> decltype( + associated_cancellation_slot::get(t.get(), s)) { return associated_cancellation_slot::get(t.get(), s); } }; -#endif // defined(ASIO_HAS_STD_REFERENCE_WRAPPER) - // || defined(GENERATING_DOCUMENTATION) - } // namespace asio #include "asio/detail/pop_options.hpp" diff --git a/third/asio/associated_executor.hpp b/third/asio/associated_executor.hpp index b76c204e5..4ca7ba149 100644 --- a/third/asio/associated_executor.hpp +++ b/third/asio/associated_executor.hpp @@ -2,7 +2,7 @@ // associated_executor.hpp // ~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2022 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// 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) @@ -38,8 +38,7 @@ struct has_executor_type : false_type }; template -struct has_executor_type::type> +struct has_executor_type> : true_type { }; @@ -51,33 +50,30 @@ struct associated_executor_impl typedef E type; - static type get(const T&) ASIO_NOEXCEPT + static type get(const T&) noexcept { return type(); } - static const type& get(const T&, const E& e) ASIO_NOEXCEPT + static const type& get(const T&, const E& e) noexcept { return e; } }; template -struct associated_executor_impl::type> +struct associated_executor_impl> { typedef typename T::executor_type type; - static ASIO_AUTO_RETURN_TYPE_PREFIX(type) get( - const T& t) ASIO_NOEXCEPT - ASIO_AUTO_RETURN_TYPE_SUFFIX((t.get_executor())) + static auto get(const T& t) noexcept + -> decltype(t.get_executor()) { return t.get_executor(); } - static ASIO_AUTO_RETURN_TYPE_PREFIX(type) get( - const T& t, const E&) ASIO_NOEXCEPT - ASIO_AUTO_RETURN_TYPE_SUFFIX((t.get_executor())) + static auto get(const T& t, const E&) noexcept + -> decltype(t.get_executor()) { return t.get_executor(); } @@ -85,12 +81,12 @@ struct associated_executor_impl struct associated_executor_impl::value - >::type, - typename void_type< + >, + void_t< typename associator::type - >::type> : associator + >> : associator { }; @@ -130,11 +126,11 @@ struct associated_executor /// If @c T has a nested type @c executor_type, returns /// t.get_executor(). Otherwise returns @c type(). - static decltype(auto) get(const T& t) ASIO_NOEXCEPT; + static decltype(auto) get(const T& t) noexcept; /// If @c T has a nested type @c executor_type, returns /// t.get_executor(). Otherwise returns @c ex. - static decltype(auto) get(const T& t, const Executor& ex) ASIO_NOEXCEPT; + static decltype(auto) get(const T& t, const Executor& ex) noexcept; #endif // defined(GENERATING_DOCUMENTATION) }; @@ -144,7 +140,7 @@ struct associated_executor */ template ASIO_NODISCARD inline typename associated_executor::type -get_associated_executor(const T& t) ASIO_NOEXCEPT +get_associated_executor(const T& t) noexcept { return associated_executor::get(t); } @@ -154,14 +150,12 @@ get_associated_executor(const T& t) ASIO_NOEXCEPT * @returns associated_executor::get(t, ex) */ template -ASIO_NODISCARD inline ASIO_AUTO_RETURN_TYPE_PREFIX2( - typename associated_executor::type) -get_associated_executor(const T& t, const Executor& ex, - typename constraint< +ASIO_NODISCARD inline auto get_associated_executor( + const T& t, const Executor& ex, + constraint_t< is_executor::value || execution::is_executor::value - >::type = 0) ASIO_NOEXCEPT - ASIO_AUTO_RETURN_TYPE_SUFFIX(( - associated_executor::get(t, ex))) + > = 0) noexcept + -> decltype(associated_executor::get(t, ex)) { return associated_executor::get(t, ex); } @@ -172,27 +166,19 @@ get_associated_executor(const T& t, const Executor& ex, * ExecutionContext::executor_type>::get(t, ctx.get_executor()) */ template -ASIO_NODISCARD inline ASIO_AUTO_RETURN_TYPE_PREFIX2( - typename associated_executor::type) +ASIO_NODISCARD inline typename associated_executor::type get_associated_executor(const T& t, ExecutionContext& ctx, - typename constraint::value>::type = 0) ASIO_NOEXCEPT - ASIO_AUTO_RETURN_TYPE_SUFFIX(( - associated_executor::get(t, ctx.get_executor()))) + constraint_t::value> = 0) noexcept { return associated_executor::get(t, ctx.get_executor()); } -#if defined(ASIO_HAS_ALIAS_TEMPLATES) - template using associated_executor_t = typename associated_executor::type; -#endif // defined(ASIO_HAS_ALIAS_TEMPLATES) - namespace detail { template @@ -202,22 +188,19 @@ struct associated_executor_forwarding_base template struct associated_executor_forwarding_base::asio_associated_executor_is_unspecialised, void >::value - >::type> + >> { typedef void asio_associated_executor_is_unspecialised; }; } // namespace detail -#if defined(ASIO_HAS_STD_REFERENCE_WRAPPER) \ - || defined(GENERATING_DOCUMENTATION) - /// Specialisation of associated_executor for @c std::reference_wrapper. template struct associated_executor, Executor> @@ -231,25 +214,20 @@ struct associated_executor, Executor> /// Forwards the request to get the executor to the associator specialisation /// for the unwrapped type @c T. - static type get(reference_wrapper t) ASIO_NOEXCEPT + static type get(reference_wrapper t) noexcept { return associated_executor::get(t.get()); } /// Forwards the request to get the executor to the associator specialisation /// for the unwrapped type @c T. - static ASIO_AUTO_RETURN_TYPE_PREFIX(type) get( - reference_wrapper t, const Executor& ex) ASIO_NOEXCEPT - ASIO_AUTO_RETURN_TYPE_SUFFIX(( - associated_executor::get(t.get(), ex))) + static auto get(reference_wrapper t, const Executor& ex) noexcept + -> decltype(associated_executor::get(t.get(), ex)) { return associated_executor::get(t.get(), ex); } }; -#endif // defined(ASIO_HAS_STD_REFERENCE_WRAPPER) - // || defined(GENERATING_DOCUMENTATION) - } // namespace asio #include "asio/detail/pop_options.hpp" diff --git a/third/asio/associated_immediate_executor.hpp b/third/asio/associated_immediate_executor.hpp new file mode 100644 index 000000000..aa6e0fcfe --- /dev/null +++ b/third/asio/associated_immediate_executor.hpp @@ -0,0 +1,280 @@ +// +// associated_immediate_executor.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 ASIO_ASSOCIATED_IMMEDIATE_EXECUTOR_HPP +#define ASIO_ASSOCIATED_IMMEDIATE_EXECUTOR_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#include "asio/associator.hpp" +#include "asio/detail/functional.hpp" +#include "asio/detail/type_traits.hpp" +#include "asio/execution/blocking.hpp" +#include "asio/execution/executor.hpp" +#include "asio/execution_context.hpp" +#include "asio/is_executor.hpp" +#include "asio/require.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { + +template +struct associated_immediate_executor; + +namespace detail { + +template +struct has_immediate_executor_type : false_type +{ +}; + +template +struct has_immediate_executor_type> + : true_type +{ +}; + +template +struct default_immediate_executor +{ + typedef require_result_t type; + + static type get(const E& e) noexcept + { + return asio::require(e, execution::blocking.never); + } +}; + +template +struct default_immediate_executor::value + >, + enable_if_t< + is_executor::value + >> +{ + class type : public E + { + public: + template + explicit type(const Executor1& e, + constraint_t< + conditional_t< + !is_same::value, + is_convertible, + false_type + >::value + > = 0) noexcept + : E(e) + { + } + + type(const type& other) noexcept + : E(static_cast(other)) + { + } + + type(type&& other) noexcept + : E(static_cast(other)) + { + } + + template + void dispatch(Function&& f, const Allocator& a) const + { + this->post(static_cast(f), a); + } + + friend bool operator==(const type& a, const type& b) noexcept + { + return static_cast(a) == static_cast(b); + } + + friend bool operator!=(const type& a, const type& b) noexcept + { + return static_cast(a) != static_cast(b); + } + }; + + static type get(const E& e) noexcept + { + return type(e); + } +}; + +template +struct associated_immediate_executor_impl +{ + typedef void asio_associated_immediate_executor_is_unspecialised; + + typedef typename default_immediate_executor::type type; + + static auto get(const T&, const E& e) noexcept + -> decltype(default_immediate_executor::get(e)) + { + return default_immediate_executor::get(e); + } +}; + +template +struct associated_immediate_executor_impl> +{ + typedef typename T::immediate_executor_type type; + + static auto get(const T& t, const E&) noexcept + -> decltype(t.get_immediate_executor()) + { + return t.get_immediate_executor(); + } +}; + +template +struct associated_immediate_executor_impl::value + >, + void_t< + typename associator::type + >> : associator +{ +}; + +} // namespace detail + +/// Traits type used to obtain the immediate executor associated with an object. +/** + * A program may specialise this traits type if the @c T template parameter in + * the specialisation is a user-defined type. The template parameter @c + * Executor shall be a type meeting the Executor requirements. + * + * Specialisations shall meet the following requirements, where @c t is a const + * reference to an object of type @c T, and @c e is an object of type @c + * Executor. + * + * @li Provide a nested typedef @c type that identifies a type meeting the + * Executor requirements. + * + * @li Provide a noexcept static member function named @c get, callable as @c + * get(t) and with return type @c type or a (possibly const) reference to @c + * type. + * + * @li Provide a noexcept static member function named @c get, callable as @c + * get(t,e) and with return type @c type or a (possibly const) reference to @c + * type. + */ +template +struct associated_immediate_executor +#if !defined(GENERATING_DOCUMENTATION) + : detail::associated_immediate_executor_impl +#endif // !defined(GENERATING_DOCUMENTATION) +{ +#if defined(GENERATING_DOCUMENTATION) + /// If @c T has a nested type @c immediate_executor_type, + // T::immediate_executor_type. Otherwise @c Executor. + typedef see_below type; + + /// If @c T has a nested type @c immediate_executor_type, returns + /// t.get_immediate_executor(). Otherwise returns + /// asio::require(ex, asio::execution::blocking.never). + static decltype(auto) get(const T& t, const Executor& ex) noexcept; +#endif // defined(GENERATING_DOCUMENTATION) +}; + +/// Helper function to obtain an object's associated executor. +/** + * @returns associated_immediate_executor::get(t, ex) + */ +template +ASIO_NODISCARD inline auto get_associated_immediate_executor( + const T& t, const Executor& ex, + constraint_t< + is_executor::value || execution::is_executor::value + > = 0) noexcept + -> decltype(associated_immediate_executor::get(t, ex)) +{ + return associated_immediate_executor::get(t, ex); +} + +/// Helper function to obtain an object's associated executor. +/** + * @returns associated_immediate_executor::get(t, ctx.get_executor()) + */ +template +ASIO_NODISCARD inline typename associated_immediate_executor::type +get_associated_immediate_executor(const T& t, ExecutionContext& ctx, + constraint_t< + is_convertible::value + > = 0) noexcept +{ + return associated_immediate_executor::get(t, ctx.get_executor()); +} + +template +using associated_immediate_executor_t = + typename associated_immediate_executor::type; + +namespace detail { + +template +struct associated_immediate_executor_forwarding_base +{ +}; + +template +struct associated_immediate_executor_forwarding_base::asio_associated_immediate_executor_is_unspecialised, + void + >::value + >> +{ + typedef void asio_associated_immediate_executor_is_unspecialised; +}; + +} // namespace detail + +/// Specialisation of associated_immediate_executor for +/// @c std::reference_wrapper. +template +struct associated_immediate_executor, Executor> +#if !defined(GENERATING_DOCUMENTATION) + : detail::associated_immediate_executor_forwarding_base +#endif // !defined(GENERATING_DOCUMENTATION) +{ + /// Forwards @c type to the associator specialisation for the unwrapped type + /// @c T. + typedef typename associated_immediate_executor::type type; + + /// Forwards the request to get the executor to the associator specialisation + /// for the unwrapped type @c T. + static auto get(reference_wrapper t, const Executor& ex) noexcept + -> decltype(associated_immediate_executor::get(t.get(), ex)) + { + return associated_immediate_executor::get(t.get(), ex); + } +}; + +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // ASIO_ASSOCIATED_IMMEDIATE_EXECUTOR_HPP diff --git a/third/asio/associator.hpp b/third/asio/associator.hpp index 1452de6a2..7952fcc51 100644 --- a/third/asio/associator.hpp +++ b/third/asio/associator.hpp @@ -2,7 +2,7 @@ // associator.hpp // ~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2022 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// 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) diff --git a/third/asio/async_result.hpp b/third/asio/async_result.hpp index 47fde00f5..cdae9ede6 100644 --- a/third/asio/async_result.hpp +++ b/third/asio/async_result.hpp @@ -2,7 +2,7 @@ // async_result.hpp // ~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2022 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// 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) @@ -17,15 +17,12 @@ #include "asio/detail/config.hpp" #include "asio/detail/type_traits.hpp" -#include "asio/detail/variadic_templates.hpp" #include "asio/detail/push_options.hpp" namespace asio { -#if defined(ASIO_HAS_CONCEPTS) \ - && defined(ASIO_HAS_VARIADIC_TEMPLATES) \ - && defined(ASIO_HAS_DECLTYPE) +#if defined(ASIO_HAS_CONCEPTS) namespace detail { @@ -39,8 +36,6 @@ struct is_completion_signature : true_type { }; -#if defined(ASIO_HAS_REF_QUALIFIED_FUNCTIONS) - template struct is_completion_signature : true_type { @@ -69,7 +64,6 @@ struct is_completion_signature : true_type }; # endif // defined(ASIO_HAS_NOEXCEPT_FUNCTION_TYPE) -#endif // defined(ASIO_HAS_REF_QUALIFIED_FUNCTIONS) template struct are_completion_signatures : false_type @@ -103,21 +97,19 @@ struct is_completion_handler_for : false_type template struct is_completion_handler_for - : integral_constant)> + : integral_constant, Args...>)> { }; -#if defined(ASIO_HAS_REF_QUALIFIED_FUNCTIONS) - template struct is_completion_handler_for - : integral_constant)> + : integral_constant&, Args...>)> { }; template struct is_completion_handler_for - : integral_constant)> + : integral_constant&&, Args...>)> { }; @@ -125,24 +117,23 @@ struct is_completion_handler_for template struct is_completion_handler_for - : integral_constant)> + : integral_constant, Args...>)> { }; template struct is_completion_handler_for - : integral_constant)> + : integral_constant&, Args...>)> { }; template struct is_completion_handler_for - : integral_constant)> + : integral_constant&&, Args...>)> { }; # endif // defined(ASIO_HAS_NOEXCEPT_FUNCTION_TYPE) -#endif // defined(ASIO_HAS_REF_QUALIFIED_FUNCTIONS) template struct is_completion_handler_for @@ -174,8 +165,6 @@ ASIO_CONCEPT completion_handler_for = ::asio::completion_handler_for #else // defined(ASIO_HAS_CONCEPTS) - // && defined(ASIO_HAS_VARIADIC_TEMPLATES) - // && defined(ASIO_HAS_DECLTYPE) #define ASIO_COMPLETION_SIGNATURE typename #define ASIO_COMPLETION_HANDLER_FOR(sig) typename @@ -183,277 +172,130 @@ ASIO_CONCEPT completion_handler_for = #define ASIO_COMPLETION_HANDLER_FOR3(sig0, sig1, sig2) typename #endif // defined(ASIO_HAS_CONCEPTS) - // && defined(ASIO_HAS_VARIADIC_TEMPLATES) - // && defined(ASIO_HAS_DECLTYPE) namespace detail { template -struct is_simple_completion_signature : false_type +struct is_lvalue_completion_signature : false_type { }; -template -struct simple_completion_signature; +template +struct is_lvalue_completion_signature : true_type +{ +}; -#if defined(ASIO_HAS_VARIADIC_TEMPLATES) +# if defined(ASIO_HAS_NOEXCEPT_FUNCTION_TYPE) template -struct is_simple_completion_signature : true_type +struct is_lvalue_completion_signature : true_type { }; +# endif // defined(ASIO_HAS_NOEXCEPT_FUNCTION_TYPE) + template -struct are_simple_completion_signatures : false_type +struct are_any_lvalue_completion_signatures : false_type { }; template -struct are_simple_completion_signatures - : is_simple_completion_signature +struct are_any_lvalue_completion_signatures + : is_lvalue_completion_signature { }; template -struct are_simple_completion_signatures +struct are_any_lvalue_completion_signatures : integral_constant::value - && are_simple_completion_signatures::value)> -{ -}; - -template -struct simple_completion_signature + is_lvalue_completion_signature::value + || are_any_lvalue_completion_signatures::value)> { - typedef R type(Args...); }; -#if defined(ASIO_HAS_REF_QUALIFIED_FUNCTIONS) - -template -struct simple_completion_signature +template +struct is_rvalue_completion_signature : false_type { - typedef R type(Args...); }; template -struct simple_completion_signature +struct is_rvalue_completion_signature : true_type { - typedef R type(Args...); }; # if defined(ASIO_HAS_NOEXCEPT_FUNCTION_TYPE) template -struct simple_completion_signature +struct is_rvalue_completion_signature : true_type { - typedef R type(Args...); -}; - -template -struct simple_completion_signature -{ - typedef R type(Args...); -}; - -template -struct simple_completion_signature -{ - typedef R type(Args...); }; # endif // defined(ASIO_HAS_NOEXCEPT_FUNCTION_TYPE) -#endif // defined(ASIO_HAS_REF_QUALIFIED_FUNCTIONS) -#else // defined(ASIO_HAS_VARIADIC_TEMPLATES) - -template -struct is_simple_completion_signature : true_type -{ -}; - -#define ASIO_PRIVATE_SIMPLE_SIG_DEF(n) \ - template \ - struct is_simple_completion_signature \ - : true_type \ - { \ - }; \ - /**/ - ASIO_VARIADIC_GENERATE(ASIO_PRIVATE_SIMPLE_SIG_DEF) -#undef ASIO_PRIVATE_SIMPLE_SIG_DEF - -template -struct are_simple_completion_signatures : false_type +template +struct are_any_rvalue_completion_signatures : false_type { }; template -struct are_simple_completion_signatures - : is_simple_completion_signature +struct are_any_rvalue_completion_signatures + : is_rvalue_completion_signature { }; -template -struct are_simple_completion_signatures - : integral_constant::value - && is_simple_completion_signature::value)> -{ -}; - -template -struct are_simple_completion_signatures - : integral_constant::value - && is_simple_completion_signature::value - && is_simple_completion_signature::value)> +template +struct are_any_rvalue_completion_signatures + : integral_constant::value + || are_any_rvalue_completion_signatures::value)> { }; -template <> -struct simple_completion_signature -{ - typedef void type; -}; +template +struct simple_completion_signature; -template -struct simple_completion_signature +template +struct simple_completion_signature { - typedef R type(); + typedef R type(Args...); }; -#define ASIO_PRIVATE_SIMPLE_SIG_DEF(n) \ - template \ - struct simple_completion_signature \ - { \ - typedef R type(ASIO_VARIADIC_TARGS(n)); \ - }; \ - /**/ - ASIO_VARIADIC_GENERATE(ASIO_PRIVATE_SIMPLE_SIG_DEF) -#undef ASIO_PRIVATE_SIMPLE_SIG_DEF - -#if defined(ASIO_HAS_REF_QUALIFIED_FUNCTIONS) - -template -struct simple_completion_signature +template +struct simple_completion_signature { - typedef R type(); + typedef R type(Args...); }; -template -struct simple_completion_signature +template +struct simple_completion_signature { - typedef R type(); + typedef R type(Args...); }; -#define ASIO_PRIVATE_SIMPLE_SIG_DEF(n) \ - template \ - struct simple_completion_signature< \ - R(ASIO_VARIADIC_TARGS(n)) &> \ - { \ - typedef R type(ASIO_VARIADIC_TARGS(n)); \ - }; \ - \ - template \ - struct simple_completion_signature< \ - R(ASIO_VARIADIC_TARGS(n)) &&> \ - { \ - typedef R type(ASIO_VARIADIC_TARGS(n)); \ - }; \ - /**/ - ASIO_VARIADIC_GENERATE(ASIO_PRIVATE_SIMPLE_SIG_DEF) -#undef ASIO_PRIVATE_SIMPLE_SIG_DEF - # if defined(ASIO_HAS_NOEXCEPT_FUNCTION_TYPE) -template -struct simple_completion_signature +template +struct simple_completion_signature { - typedef R type(); + typedef R type(Args...); }; -template -struct simple_completion_signature +template +struct simple_completion_signature { - typedef R type(); + typedef R type(Args...); }; -template -struct simple_completion_signature +template +struct simple_completion_signature { - typedef R type(); + typedef R type(Args...); }; -#define ASIO_PRIVATE_SIMPLE_SIG_DEF(n) \ - template \ - struct simple_completion_signature< \ - R(ASIO_VARIADIC_TARGS(n)) noexcept> \ - { \ - typedef R type(ASIO_VARIADIC_TARGS(n)); \ - }; \ - \ - template \ - struct simple_completion_signature< \ - R(ASIO_VARIADIC_TARGS(n)) & noexcept> \ - { \ - typedef R type(ASIO_VARIADIC_TARGS(n)); \ - }; \ - \ - template \ - struct simple_completion_signature< \ - R(ASIO_VARIADIC_TARGS(n)) && noexcept> \ - { \ - typedef R type(ASIO_VARIADIC_TARGS(n)); \ - }; \ - /**/ - ASIO_VARIADIC_GENERATE(ASIO_PRIVATE_SIMPLE_SIG_DEF) -#undef ASIO_PRIVATE_SIMPLE_SIG_DEF - # endif // defined(ASIO_HAS_NOEXCEPT_FUNCTION_TYPE) -#endif // defined(ASIO_HAS_REF_QUALIFIED_FUNCTIONS) - -#endif // defined(ASIO_HAS_VARIADIC_TEMPLATES) - -#if defined(ASIO_HAS_VARIADIC_TEMPLATES) \ - || defined(GENERATING_DOCUMENTATION) - -# define ASIO_COMPLETION_SIGNATURES_TPARAMS \ - ASIO_COMPLETION_SIGNATURE... Signatures - -# define ASIO_COMPLETION_SIGNATURES_TSPECPARAMS \ - ASIO_COMPLETION_SIGNATURE... Signatures - -# define ASIO_COMPLETION_SIGNATURES_TARGS Signatures... - -# define ASIO_COMPLETION_SIGNATURES_TSIMPLEARGS \ - typename asio::detail::simple_completion_signature< \ - Signatures>::type... - -#else // defined(ASIO_HAS_VARIADIC_TEMPLATES) - // || defined(GENERATING_DOCUMENTATION) - -# define ASIO_COMPLETION_SIGNATURES_TPARAMS \ - typename Sig0 = void, \ - typename Sig1 = void, \ - typename Sig2 = void -# define ASIO_COMPLETION_SIGNATURES_TSPECPARAMS \ - typename Sig0, \ - typename Sig1, \ - typename Sig2 - -# define ASIO_COMPLETION_SIGNATURES_TARGS Sig0, Sig1, Sig2 - -# define ASIO_COMPLETION_SIGNATURES_TSIMPLEARGS \ - typename ::asio::detail::simple_completion_signature::type, \ - typename ::asio::detail::simple_completion_signature::type, \ - typename ::asio::detail::simple_completion_signature::type - -#endif // defined(ASIO_HAS_VARIADIC_TEMPLATES) - // || defined(GENERATING_DOCUMENTATION) - -template +template class completion_handler_async_result { public: @@ -468,56 +310,22 @@ class completion_handler_async_result { } -#if defined(ASIO_HAS_VARIADIC_TEMPLATES) - template - static return_type initiate( - ASIO_MOVE_ARG(Initiation) initiation, - ASIO_MOVE_ARG(RawCompletionToken) token, - ASIO_MOVE_ARG(Args)... args) + static return_type initiate(Initiation&& initiation, + RawCompletionToken&& token, Args&&... args) { - ASIO_MOVE_CAST(Initiation)(initiation)( - ASIO_MOVE_CAST(RawCompletionToken)(token), - ASIO_MOVE_CAST(Args)(args)...); + static_cast(initiation)( + static_cast(token), + static_cast(args)...); } -#else // defined(ASIO_HAS_VARIADIC_TEMPLATES) - - template - static return_type initiate( - ASIO_MOVE_ARG(Initiation) initiation, - ASIO_MOVE_ARG(RawCompletionToken) token) - { - ASIO_MOVE_CAST(Initiation)(initiation)( - ASIO_MOVE_CAST(RawCompletionToken)(token)); - } - -#define ASIO_PRIVATE_INITIATE_DEF(n) \ - template \ - static return_type initiate( \ - ASIO_MOVE_ARG(Initiation) initiation, \ - ASIO_MOVE_ARG(RawCompletionToken) token, \ - ASIO_VARIADIC_MOVE_PARAMS(n)) \ - { \ - ASIO_MOVE_CAST(Initiation)(initiation)( \ - ASIO_MOVE_CAST(RawCompletionToken)(token), \ - ASIO_VARIADIC_MOVE_ARGS(n)); \ - } \ - /**/ - ASIO_VARIADIC_GENERATE(ASIO_PRIVATE_INITIATE_DEF) -#undef ASIO_PRIVATE_INITIATE_DEF - -#endif // defined(ASIO_HAS_VARIADIC_TEMPLATES) - private: completion_handler_async_result( - const completion_handler_async_result&) ASIO_DELETED; + const completion_handler_async_result&) = delete; completion_handler_async_result& operator=( - const completion_handler_async_result&) ASIO_DELETED; + const completion_handler_async_result&) = delete; }; } // namespace detail @@ -542,7 +350,8 @@ class completion_handler_async_result * The primary template assumes that the CompletionToken is the completion * handler. */ -template +template class async_result { public: @@ -567,70 +376,46 @@ class async_result /// obtain the value to be returned from the initiating function. template static return_type initiate( - ASIO_MOVE_ARG(Initiation) initiation, - ASIO_MOVE_ARG(RawCompletionToken) token, - ASIO_MOVE_ARG(Args)... args); + Initiation&& initiation, + RawCompletionToken&& token, + Args&&... args); private: - async_result(const async_result&) ASIO_DELETED; - async_result& operator=(const async_result&) ASIO_DELETED; + async_result(const async_result&) = delete; + async_result& operator=(const async_result&) = delete; }; #else // defined(GENERATING_DOCUMENTATION) -#if defined(ASIO_HAS_REF_QUALIFIED_FUNCTIONS) - -template +template class async_result : - public conditional< - detail::are_simple_completion_signatures< - ASIO_COMPLETION_SIGNATURES_TARGS>::value, - detail::completion_handler_async_result< - CompletionToken, ASIO_COMPLETION_SIGNATURES_TARGS>, + public conditional_t< + detail::are_any_lvalue_completion_signatures::value + || !detail::are_any_rvalue_completion_signatures::value, + detail::completion_handler_async_result, async_result - >::type + typename detail::simple_completion_signature::type...> + > { public: - typedef typename conditional< - detail::are_simple_completion_signatures< - ASIO_COMPLETION_SIGNATURES_TARGS>::value, - detail::completion_handler_async_result< - CompletionToken, ASIO_COMPLETION_SIGNATURES_TARGS>, + typedef conditional_t< + detail::are_any_lvalue_completion_signatures::value + || !detail::are_any_rvalue_completion_signatures::value, + detail::completion_handler_async_result, async_result - >::type base_type; + typename detail::simple_completion_signature::type...> + > base_type; using base_type::base_type; private: - async_result(const async_result&) ASIO_DELETED; - async_result& operator=(const async_result&) ASIO_DELETED; + async_result(const async_result&) = delete; + async_result& operator=(const async_result&) = delete; }; -#else // defined(ASIO_HAS_REF_QUALIFIED_FUNCTIONS) - -template -class async_result : - public detail::completion_handler_async_result< - CompletionToken, ASIO_COMPLETION_SIGNATURES_TARGS> -{ -public: - explicit async_result(CompletionToken& h) - : detail::completion_handler_async_result< - CompletionToken, ASIO_COMPLETION_SIGNATURES_TARGS>(h) - { - } - -private: - async_result(const async_result&) ASIO_DELETED; - async_result& operator=(const async_result&) ASIO_DELETED; -}; - -#endif // defined(ASIO_HAS_REF_QUALIFIED_FUNCTIONS) - -template -class async_result +template +class async_result { // Empty. }; @@ -640,65 +425,39 @@ class async_result /// Helper template to deduce the handler type from a CompletionToken, capture /// a local copy of the handler, and then create an async_result for the /// handler. -template +template struct async_completion { /// The real handler type to be used for the asynchronous operation. typedef typename asio::async_result< - typename decay::type, - ASIO_COMPLETION_SIGNATURES_TARGS>::completion_handler_type - completion_handler_type; + decay_t, Signatures...>::completion_handler_type + completion_handler_type; -#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) /// Constructor. /** * The constructor creates the concrete completion handler and makes the link * between the handler and the asynchronous result. */ explicit async_completion(CompletionToken& token) - : completion_handler(static_cast::value, - completion_handler_type&, CompletionToken&&>::type>(token)), - result(completion_handler) - { - } -#else // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) - explicit async_completion(typename decay::type& token) - : completion_handler(token), + completion_handler_type&, CompletionToken&&>>(token)), result(completion_handler) { } - explicit async_completion(const typename decay::type& token) - : completion_handler(token), - result(completion_handler) - { - } -#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) - /// A copy of, or reference to, a real handler object. -#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) - typename conditional< + conditional_t< is_same::value, - completion_handler_type&, completion_handler_type>::type completion_handler; -#else // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) - completion_handler_type completion_handler; -#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) + completion_handler_type&, completion_handler_type> completion_handler; /// The result of the asynchronous operation's initiating function. - async_result::type, - ASIO_COMPLETION_SIGNATURES_TARGS> result; + async_result, Signatures...> result; }; namespace detail { -template -struct async_result_helper - : async_result::type, - ASIO_COMPLETION_SIGNATURES_TARGS> -{ -}; - struct async_result_memfns_base { void initiate(); @@ -724,11 +483,11 @@ char async_result_initiate_memfn_helper( void (async_result_memfns_base::*)(), &async_result_memfns_derived::initiate>*); -template +template struct async_result_has_initiate_memfn : integral_constant::type, - ASIO_COMPLETION_SIGNATURES_TARGS> + async_result, Signatures...> >(0)) != 1> { }; @@ -742,25 +501,6 @@ struct async_result_has_initiate_memfn void_or_deduced # define ASIO_INITFN_RESULT_TYPE3(ct, sig0, sig1, sig2) \ void_or_deduced -#elif defined(_MSC_VER) && (_MSC_VER < 1500) -# define ASIO_INITFN_RESULT_TYPE(ct, sig) \ - typename ::asio::detail::async_result_helper< \ - ct, sig>::return_type -# define ASIO_INITFN_RESULT_TYPE2(ct, sig0, sig1) \ - typename ::asio::detail::async_result_helper< \ - ct, sig0, sig1>::return_type -# define ASIO_INITFN_RESULT_TYPE3(ct, sig0, sig1, sig2) \ - typename ::asio::detail::async_result_helper< \ - ct, sig0, sig1, sig2>::return_type -#define ASIO_HANDLER_TYPE(ct, sig) \ - typename ::asio::detail::async_result_helper< \ - ct, sig>::completion_handler_type -#define ASIO_HANDLER_TYPE2(ct, sig0, sig1) \ - typename ::asio::detail::async_result_helper< \ - ct, sig0, sig1>::completion_handler_type -#define ASIO_HANDLER_TYPE3(ct, sig0, sig1, sig2) \ - typename ::asio::detail::async_result_helper< \ - ct, sig0, sig1, sig2>::completion_handler_type #else # define ASIO_INITFN_RESULT_TYPE(ct, sig) \ typename ::asio::async_result< \ @@ -823,7 +563,7 @@ struct async_result_has_initiate_memfn # define ASIO_INITFN_AUTO_RESULT_TYPE_PREFIX3(ct, sig0, sig1, sig2) \ auto # define ASIO_INITFN_AUTO_RESULT_TYPE_SUFFIX(expr) -#elif defined(ASIO_HAS_DECLTYPE) +#else # define ASIO_INITFN_AUTO_RESULT_TYPE_PREFIX(ct, sig) \ auto # define ASIO_INITFN_AUTO_RESULT_TYPE_PREFIX2(ct, sig0, sig1) \ @@ -831,14 +571,6 @@ struct async_result_has_initiate_memfn # define ASIO_INITFN_AUTO_RESULT_TYPE_PREFIX3(ct, sig0, sig1, sig2) \ auto # define ASIO_INITFN_AUTO_RESULT_TYPE_SUFFIX(expr) -> decltype expr -#else -# define ASIO_INITFN_AUTO_RESULT_TYPE_PREFIX(ct, sig) \ - ASIO_INITFN_RESULT_TYPE(ct, sig) -# define ASIO_INITFN_AUTO_RESULT_TYPE_PREFIX2(ct, sig0, sig1) \ - ASIO_INITFN_RESULT_TYPE2(ct, sig0, sig1) -# define ASIO_INITFN_AUTO_RESULT_TYPE_PREFIX3(ct, sig0, sig1, sig2) \ - ASIO_INITFN_RESULT_TYPE3(ct, sig0, sig1, sig2) -# define ASIO_INITFN_AUTO_RESULT_TYPE_SUFFIX(expr) #endif #if defined(GENERATING_DOCUMENTATION) @@ -848,20 +580,13 @@ struct async_result_has_initiate_memfn void_or_deduced # define ASIO_INITFN_DEDUCED_RESULT_TYPE3(ct, sig0, sig1, sig2, expr) \ void_or_deduced -#elif defined(ASIO_HAS_DECLTYPE) +#else # define ASIO_INITFN_DEDUCED_RESULT_TYPE(ct, sig, expr) \ decltype expr # define ASIO_INITFN_DEDUCED_RESULT_TYPE2(ct, sig0, sig1, expr) \ decltype expr # define ASIO_INITFN_DEDUCED_RESULT_TYPE3(ct, sig0, sig1, sig2, expr) \ decltype expr -#else -# define ASIO_INITFN_DEDUCED_RESULT_TYPE(ct, sig, expr) \ - ASIO_INITFN_RESULT_TYPE(ct, sig) -# define ASIO_INITFN_DEDUCED_RESULT_TYPE2(ct, sig0, sig1, expr) \ - ASIO_INITFN_RESULT_TYPE2(ct, sig0, sig1) -# define ASIO_INITFN_DEDUCED_RESULT_TYPE3(ct, sig0, sig1, sig2, expr) \ - ASIO_INITFN_RESULT_TYPE3(ct, sig0, sig1, sig2) #endif #if defined(GENERATING_DOCUMENTATION) @@ -870,326 +595,57 @@ template void_or_deduced async_initiate( - ASIO_MOVE_ARG(Initiation) initiation, - ASIO_NONDEDUCED_MOVE_ARG(CompletionToken), - ASIO_MOVE_ARG(Args)... args); + Initiation&& initiation, + type_identity_t& token, + Args&&... args); -#elif defined(ASIO_HAS_VARIADIC_TEMPLATES) +#else // defined(GENERATING_DOCUMENTATION) template -inline typename constraint< +inline auto async_initiate(Initiation&& initiation, + type_identity_t& token, Args&&... args) + -> constraint_t< detail::async_result_has_initiate_memfn< CompletionToken, Signatures...>::value, - ASIO_INITFN_DEDUCED_RESULT_TYPE(CompletionToken, Signatures..., - (async_result::type, - Signatures...>::initiate(declval(), - declval(), - declval()...)))>::type -async_initiate(ASIO_MOVE_ARG(Initiation) initiation, - ASIO_NONDEDUCED_MOVE_ARG(CompletionToken) token, - ASIO_MOVE_ARG(Args)... args) -{ - return async_result::type, - Signatures...>::initiate(ASIO_MOVE_CAST(Initiation)(initiation), - ASIO_MOVE_CAST(CompletionToken)(token), - ASIO_MOVE_CAST(Args)(args)...); + decltype( + async_result, Signatures...>::initiate( + static_cast(initiation), + static_cast(token), + static_cast(args)...))> +{ + return async_result, Signatures...>::initiate( + static_cast(initiation), + static_cast(token), + static_cast(args)...); } template -inline typename constraint< +inline constraint_t< !detail::async_result_has_initiate_memfn< CompletionToken, Signatures...>::value, - ASIO_INITFN_RESULT_TYPE(CompletionToken, Signatures...)>::type -async_initiate(ASIO_MOVE_ARG(Initiation) initiation, - ASIO_NONDEDUCED_MOVE_ARG(CompletionToken) token, - ASIO_MOVE_ARG(Args)... args) + typename async_result, Signatures...>::return_type> +async_initiate(Initiation&& initiation, + type_identity_t& token, Args&&... args) { async_completion completion(token); - ASIO_MOVE_CAST(Initiation)(initiation)( - ASIO_MOVE_CAST(ASIO_HANDLER_TYPE(CompletionToken, - Signatures...))(completion.completion_handler), - ASIO_MOVE_CAST(Args)(args)...); - - return completion.result.get(); -} - -#else // defined(ASIO_HAS_VARIADIC_TEMPLATES) - -template -inline typename constraint< - detail::async_result_has_initiate_memfn< - CompletionToken, Sig0>::value, - ASIO_INITFN_DEDUCED_RESULT_TYPE(CompletionToken, Sig0, - (async_result::type, - Sig0>::initiate(declval(), - declval())))>::type -async_initiate(ASIO_MOVE_ARG(Initiation) initiation, - ASIO_NONDEDUCED_MOVE_ARG(CompletionToken) token) -{ - return async_result::type, - Sig0>::initiate(ASIO_MOVE_CAST(Initiation)(initiation), - ASIO_MOVE_CAST(CompletionToken)(token)); -} - -template -inline typename constraint< - detail::async_result_has_initiate_memfn< - CompletionToken, Sig0, Sig1>::value, - ASIO_INITFN_DEDUCED_RESULT_TYPE2(CompletionToken, Sig0, Sig1, - (async_result::type, - Sig0, Sig1>::initiate(declval(), - declval())))>::type -async_initiate(ASIO_MOVE_ARG(Initiation) initiation, - ASIO_NONDEDUCED_MOVE_ARG(CompletionToken) token) -{ - return async_result::type, - Sig0, Sig1>::initiate(ASIO_MOVE_CAST(Initiation)(initiation), - ASIO_MOVE_CAST(CompletionToken)(token)); -} - -template -inline typename constraint< - detail::async_result_has_initiate_memfn< - CompletionToken, Sig0, Sig1, Sig2>::value, - ASIO_INITFN_DEDUCED_RESULT_TYPE3(CompletionToken, Sig0, Sig1, Sig2, - (async_result::type, - Sig0, Sig1, Sig2>::initiate(declval(), - declval())))>::type -async_initiate(ASIO_MOVE_ARG(Initiation) initiation, - ASIO_NONDEDUCED_MOVE_ARG(CompletionToken) token) -{ - return async_result::type, - Sig0, Sig1, Sig2>::initiate(ASIO_MOVE_CAST(Initiation)(initiation), - ASIO_MOVE_CAST(CompletionToken)(token)); -} - -template -inline typename constraint< - !detail::async_result_has_initiate_memfn< - CompletionToken, Sig0>::value, - ASIO_INITFN_RESULT_TYPE(CompletionToken, Sig0)>::type -async_initiate(ASIO_MOVE_ARG(Initiation) initiation, - ASIO_NONDEDUCED_MOVE_ARG(CompletionToken) token) -{ - async_completion completion(token); - - ASIO_MOVE_CAST(Initiation)(initiation)( - ASIO_MOVE_CAST(ASIO_HANDLER_TYPE(CompletionToken, - Sig0))(completion.completion_handler)); + static_cast(initiation)( + static_cast< + typename async_result, + Signatures...>::completion_handler_type&&>( + completion.completion_handler), + static_cast(args)...); return completion.result.get(); } -template -inline typename constraint< - !detail::async_result_has_initiate_memfn< - CompletionToken, Sig0, Sig1>::value, - ASIO_INITFN_RESULT_TYPE2(CompletionToken, Sig0, Sig1)>::type -async_initiate(ASIO_MOVE_ARG(Initiation) initiation, - ASIO_NONDEDUCED_MOVE_ARG(CompletionToken) token) -{ - async_completion completion(token); - - ASIO_MOVE_CAST(Initiation)(initiation)( - ASIO_MOVE_CAST(ASIO_HANDLER_TYPE2(CompletionToken, - Sig0, Sig1))(completion.completion_handler)); - - return completion.result.get(); -} - -template -inline typename constraint< - !detail::async_result_has_initiate_memfn< - CompletionToken, Sig0, Sig1, Sig2>::value, - ASIO_INITFN_RESULT_TYPE3(CompletionToken, Sig0, Sig1, Sig2)>::type -async_initiate(ASIO_MOVE_ARG(Initiation) initiation, - ASIO_NONDEDUCED_MOVE_ARG(CompletionToken) token) -{ - async_completion completion(token); - - ASIO_MOVE_CAST(Initiation)(initiation)( - ASIO_MOVE_CAST(ASIO_HANDLER_TYPE3(CompletionToken, - Sig0, Sig1, Sig2))(completion.completion_handler)); - - return completion.result.get(); -} +#endif // defined(GENERATING_DOCUMENTATION) -#define ASIO_PRIVATE_INITIATE_DEF(n) \ - template \ - inline typename constraint< \ - detail::async_result_has_initiate_memfn< \ - CompletionToken, Sig0>::value, \ - ASIO_INITFN_DEDUCED_RESULT_TYPE( \ - CompletionToken, Sig0, \ - (async_result::type, \ - Sig0>::initiate( \ - declval(), \ - declval(), \ - ASIO_VARIADIC_MOVE_DECLVAL(n))))>::type \ - async_initiate(ASIO_MOVE_ARG(Initiation) initiation, \ - ASIO_NONDEDUCED_MOVE_ARG(CompletionToken) token, \ - ASIO_VARIADIC_MOVE_PARAMS(n)) \ - { \ - return async_result::type, \ - Sig0>::initiate( \ - ASIO_MOVE_CAST(Initiation)(initiation), \ - ASIO_MOVE_CAST(CompletionToken)(token), \ - ASIO_VARIADIC_MOVE_ARGS(n)); \ - } \ - \ - template \ - inline typename constraint< \ - detail::async_result_has_initiate_memfn< \ - CompletionToken, Sig0, Sig1>::value, \ - ASIO_INITFN_DEDUCED_RESULT_TYPE2( \ - CompletionToken, Sig0, Sig1, \ - (async_result::type, \ - Sig0, Sig1>::initiate( \ - declval(), \ - declval(), \ - ASIO_VARIADIC_MOVE_DECLVAL(n))))>::type \ - async_initiate(ASIO_MOVE_ARG(Initiation) initiation, \ - ASIO_NONDEDUCED_MOVE_ARG(CompletionToken) token, \ - ASIO_VARIADIC_MOVE_PARAMS(n)) \ - { \ - return async_result::type, \ - Sig0, Sig1>::initiate( \ - ASIO_MOVE_CAST(Initiation)(initiation), \ - ASIO_MOVE_CAST(CompletionToken)(token), \ - ASIO_VARIADIC_MOVE_ARGS(n)); \ - } \ - \ - template \ - inline typename constraint< \ - detail::async_result_has_initiate_memfn< \ - CompletionToken, Sig0, Sig1, Sig2>::value, \ - ASIO_INITFN_DEDUCED_RESULT_TYPE3( \ - CompletionToken, Sig0, Sig1, Sig2, \ - (async_result::type, \ - Sig0, Sig1, Sig2>::initiate( \ - declval(), \ - declval(), \ - ASIO_VARIADIC_MOVE_DECLVAL(n))))>::type \ - async_initiate(ASIO_MOVE_ARG(Initiation) initiation, \ - ASIO_NONDEDUCED_MOVE_ARG(CompletionToken) token, \ - ASIO_VARIADIC_MOVE_PARAMS(n)) \ - { \ - return async_result::type, \ - Sig0, Sig1, Sig2>::initiate( \ - ASIO_MOVE_CAST(Initiation)(initiation), \ - ASIO_MOVE_CAST(CompletionToken)(token), \ - ASIO_VARIADIC_MOVE_ARGS(n)); \ - } \ - \ - template \ - inline typename constraint< \ - !detail::async_result_has_initiate_memfn< \ - CompletionToken, Sig0>::value, \ - ASIO_INITFN_RESULT_TYPE(CompletionToken, Sig0)>::type \ - async_initiate(ASIO_MOVE_ARG(Initiation) initiation, \ - ASIO_NONDEDUCED_MOVE_ARG(CompletionToken) token, \ - ASIO_VARIADIC_MOVE_PARAMS(n)) \ - { \ - async_completion completion(token); \ - \ - ASIO_MOVE_CAST(Initiation)(initiation)( \ - ASIO_MOVE_CAST(ASIO_HANDLER_TYPE(CompletionToken, \ - Sig0))(completion.completion_handler), \ - ASIO_VARIADIC_MOVE_ARGS(n)); \ - \ - return completion.result.get(); \ - } \ - \ - template \ - inline typename constraint< \ - !detail::async_result_has_initiate_memfn< \ - CompletionToken, Sig0, Sig1>::value, \ - ASIO_INITFN_RESULT_TYPE2(CompletionToken, Sig0, Sig1)>::type \ - async_initiate(ASIO_MOVE_ARG(Initiation) initiation, \ - ASIO_NONDEDUCED_MOVE_ARG(CompletionToken) token, \ - ASIO_VARIADIC_MOVE_PARAMS(n)) \ - { \ - async_completion completion(token); \ - \ - ASIO_MOVE_CAST(Initiation)(initiation)( \ - ASIO_MOVE_CAST(ASIO_HANDLER_TYPE2(CompletionToken, \ - Sig0, Sig1))(completion.completion_handler), \ - ASIO_VARIADIC_MOVE_ARGS(n)); \ - \ - return completion.result.get(); \ - } \ - \ - template \ - inline typename constraint< \ - !detail::async_result_has_initiate_memfn< \ - CompletionToken, Sig0, Sig1, Sig2>::value, \ - ASIO_INITFN_RESULT_TYPE3(CompletionToken, Sig0, Sig1, Sig2)>::type \ - async_initiate(ASIO_MOVE_ARG(Initiation) initiation, \ - ASIO_NONDEDUCED_MOVE_ARG(CompletionToken) token, \ - ASIO_VARIADIC_MOVE_PARAMS(n)) \ - { \ - async_completion completion(token); \ - \ - ASIO_MOVE_CAST(Initiation)(initiation)( \ - ASIO_MOVE_CAST(ASIO_HANDLER_TYPE3(CompletionToken, \ - Sig0, Sig1, Sig2))(completion.completion_handler), \ - ASIO_VARIADIC_MOVE_ARGS(n)); \ - \ - return completion.result.get(); \ - } \ - /**/ - ASIO_VARIADIC_GENERATE(ASIO_PRIVATE_INITIATE_DEF) -#undef ASIO_PRIVATE_INITIATE_DEF - -#endif // defined(ASIO_HAS_VARIADIC_TEMPLATES) - -#if defined(ASIO_HAS_CONCEPTS) \ - && defined(ASIO_HAS_VARIADIC_TEMPLATES) \ - && defined(ASIO_HAS_DECLTYPE) +#if defined(ASIO_HAS_CONCEPTS) namespace detail { @@ -1222,16 +678,12 @@ ASIO_CONCEPT completion_token_for = ::asio::completion_token_for #else // defined(ASIO_HAS_CONCEPTS) - // && defined(ASIO_HAS_VARIADIC_TEMPLATES) - // && defined(ASIO_HAS_DECLTYPE) #define ASIO_COMPLETION_TOKEN_FOR(sig) typename #define ASIO_COMPLETION_TOKEN_FOR2(sig0, sig1) typename #define ASIO_COMPLETION_TOKEN_FOR3(sig0, sig1, sig2) typename #endif // defined(ASIO_HAS_CONCEPTS) - // && defined(ASIO_HAS_VARIADIC_TEMPLATES) - // && defined(ASIO_HAS_DECLTYPE) namespace detail { @@ -1245,21 +697,21 @@ struct is_async_operation_call : false_type template struct is_async_operation_call::type, + result_of_t, async_operation_probe_result >::value - >::type - >::type> : true_type + > + > + > : true_type { }; } // namespace detail #if !defined(GENERATING_DOCUMENTATION) -#if defined(ASIO_HAS_VARIADIC_TEMPLATES) template class async_result @@ -1268,59 +720,16 @@ class async_result typedef detail::async_operation_probe_result return_type; template - static return_type initiate(ASIO_MOVE_ARG(Initiation), - detail::async_operation_probe, ASIO_MOVE_ARG(InitArgs)...) + static return_type initiate(Initiation&&, + detail::async_operation_probe, InitArgs&&...) { return return_type(); } }; -#else // defined(ASIO_HAS_VARIADIC_TEMPLATES) - -namespace detail { - -struct async_result_probe_base -{ - typedef detail::async_operation_probe_result return_type; - - template - static return_type initiate(ASIO_MOVE_ARG(Initiation), - detail::async_operation_probe) - { - return return_type(); - } - -#define ASIO_PRIVATE_INITIATE_DEF(n) \ - template \ - static return_type initiate(ASIO_MOVE_ARG(Initiation), \ - detail::async_operation_probe, \ - ASIO_VARIADIC_UNNAMED_MOVE_PARAMS(n)) \ - { \ - return return_type(); \ - } \ - /**/ - ASIO_VARIADIC_GENERATE(ASIO_PRIVATE_INITIATE_DEF) -#undef ASIO_PRIVATE_INITIATE_DEF -}; - -} // namespace detail - -template -class async_result - : public detail::async_result_probe_base {}; - -template -class async_result - : public detail::async_result_probe_base {}; - -template -class async_result - : public detail::async_result_probe_base {}; - -#endif // defined(ASIO_HAS_VARIADIC_TEMPLATES) #endif // !defined(GENERATING_DOCUMENTATION) -#if defined(GENERATION_DOCUMENTATION) +#if defined(GENERATING_DOCUMENTATION) /// The is_async_operation trait detects whether a type @c T and arguments /// @c Args... may be used to initiate an asynchronous operation. @@ -1335,7 +744,7 @@ struct is_async_operation : integral_constant { }; -#elif defined(ASIO_HAS_VARIADIC_TEMPLATES) +#else // defined(GENERATING_DOCUMENTATION) template struct is_async_operation : @@ -1344,32 +753,9 @@ struct is_async_operation : { }; -#else // defined(ASIO_HAS_VARIADIC_TEMPLATES) - -template -struct is_async_operation : - detail::is_async_operation_call< - T(detail::async_operation_probe)> -{ -}; - -#define ASIO_PRIVATE_IS_ASYNC_OP_DEF(n) \ - template \ - struct is_async_operation : \ - detail::is_async_operation_call< \ - T(ASIO_VARIADIC_TARGS(n), detail::async_operation_probe)> \ - { \ - }; \ - /**/ - ASIO_VARIADIC_GENERATE(ASIO_PRIVATE_IS_ASYNC_OP_DEF) -#undef ASIO_PRIVATE_IS_ASYNC_OP_DEF - -#endif // defined(ASIO_HAS_VARIADIC_TEMPLATES) +#endif // defined(GENERATING_DOCUMENTATION) -#if defined(ASIO_HAS_CONCEPTS) \ - && defined(ASIO_HAS_VARIADIC_TEMPLATES) +#if defined(ASIO_HAS_CONCEPTS) template ASIO_CONCEPT async_operation = is_async_operation::value; @@ -1384,7 +770,6 @@ ASIO_CONCEPT async_operation = is_async_operation::value; ::asio::async_operation #else // defined(ASIO_HAS_CONCEPTS) - // && defined(ASIO_HAS_VARIADIC_TEMPLATES) #define ASIO_ASYNC_OPERATION(t) typename #define ASIO_ASYNC_OPERATION1(t, a0) typename @@ -1392,37 +777,56 @@ ASIO_CONCEPT async_operation = is_async_operation::value; #define ASIO_ASYNC_OPERATION3(t, a0, a1, a2) typename #endif // defined(ASIO_HAS_CONCEPTS) - // && defined(ASIO_HAS_VARIADIC_TEMPLATES) namespace detail { struct completion_signature_probe {}; -template +template struct completion_signature_probe_result +{ + template