From a7826d8f57b5070874c3c522b4789f046bc2476e Mon Sep 17 00:00:00 2001 From: FearlessTobi Date: Sat, 7 Sep 2019 17:55:51 +0200 Subject: [PATCH] Update boost to 1.71 --- Readme.md | 2 +- boost/algorithm/string/finder.hpp | 4 - boost/array.hpp | 2 +- boost/asio.hpp | 29 +- boost/asio/associated_allocator.hpp | 2 +- boost/asio/associated_executor.hpp | 2 +- boost/asio/async_result.hpp | 273 +- boost/asio/awaitable.hpp | 125 + boost/asio/basic_datagram_socket.hpp | 539 +-- boost/asio/basic_deadline_timer.hpp | 258 +- boost/asio/basic_io_object.hpp | 2 +- boost/asio/basic_raw_socket.hpp | 541 +-- boost/asio/basic_seq_packet_socket.hpp | 360 +- boost/asio/basic_serial_port.hpp | 353 +- boost/asio/basic_signal_set.hpp | 272 +- boost/asio/basic_socket.hpp | 539 +-- boost/asio/basic_socket_acceptor.hpp | 1256 ++++--- boost/asio/basic_socket_iostream.hpp | 65 +- boost/asio/basic_socket_streambuf.hpp | 50 +- boost/asio/basic_stream_socket.hpp | 428 ++- boost/asio/basic_streambuf.hpp | 2 +- boost/asio/basic_streambuf_fwd.hpp | 2 +- boost/asio/basic_waitable_timer.hpp | 267 +- boost/asio/bind_executor.hpp | 33 +- boost/asio/buffer.hpp | 574 +++- boost/asio/buffered_read_stream.hpp | 19 +- boost/asio/buffered_read_stream_fwd.hpp | 2 +- boost/asio/buffered_stream.hpp | 19 +- boost/asio/buffered_stream_fwd.hpp | 2 +- boost/asio/buffered_write_stream.hpp | 19 +- boost/asio/buffered_write_stream_fwd.hpp | 2 +- boost/asio/buffers_iterator.hpp | 2 +- boost/asio/co_spawn.hpp | 90 + boost/asio/completion_condition.hpp | 2 +- boost/asio/compose.hpp | 138 + boost/asio/connect.hpp | 196 +- boost/asio/coroutine.hpp | 6 +- boost/asio/datagram_socket_service.hpp | 468 --- boost/asio/deadline_timer.hpp | 2 +- boost/asio/deadline_timer_service.hpp | 175 - boost/asio/defer.hpp | 12 +- boost/asio/detached.hpp | 64 + boost/asio/detail/array.hpp | 2 +- boost/asio/detail/array_fwd.hpp | 2 +- boost/asio/detail/assert.hpp | 2 +- boost/asio/detail/atomic_count.hpp | 2 +- .../asio/detail/base_from_completion_cond.hpp | 7 +- boost/asio/detail/bind_handler.hpp | 2 +- boost/asio/detail/buffer_resize_guard.hpp | 2 +- boost/asio/detail/buffer_sequence_adapter.hpp | 2 +- boost/asio/detail/buffered_stream_storage.hpp | 2 +- boost/asio/detail/call_stack.hpp | 2 +- boost/asio/detail/chrono.hpp | 2 +- boost/asio/detail/chrono_time_traits.hpp | 2 +- boost/asio/detail/completion_handler.hpp | 2 +- boost/asio/detail/concurrency_hint.hpp | 2 +- .../detail/conditionally_enabled_event.hpp | 2 +- .../detail/conditionally_enabled_mutex.hpp | 2 +- boost/asio/detail/config.hpp | 149 +- boost/asio/detail/consuming_buffers.hpp | 2 +- boost/asio/detail/cstddef.hpp | 2 +- boost/asio/detail/cstdint.hpp | 2 +- boost/asio/detail/date_time_fwd.hpp | 2 +- boost/asio/detail/deadline_timer_service.hpp | 22 +- boost/asio/detail/dependent_type.hpp | 2 +- boost/asio/detail/descriptor_ops.hpp | 2 +- boost/asio/detail/descriptor_read_op.hpp | 16 +- boost/asio/detail/descriptor_write_op.hpp | 16 +- boost/asio/detail/dev_poll_reactor.hpp | 2 +- boost/asio/detail/epoll_reactor.hpp | 2 +- boost/asio/detail/event.hpp | 2 +- .../detail/eventfd_select_interrupter.hpp | 2 +- boost/asio/detail/executor_function.hpp | 106 + boost/asio/detail/executor_op.hpp | 2 +- boost/asio/detail/fd_set_adapter.hpp | 2 +- boost/asio/detail/fenced_block.hpp | 2 +- boost/asio/detail/functional.hpp | 2 +- boost/asio/detail/future.hpp | 33 + boost/asio/detail/gcc_arm_fenced_block.hpp | 2 +- boost/asio/detail/gcc_hppa_fenced_block.hpp | 2 +- boost/asio/detail/gcc_sync_fenced_block.hpp | 2 +- boost/asio/detail/gcc_x86_fenced_block.hpp | 2 +- boost/asio/detail/global.hpp | 2 +- boost/asio/detail/handler_alloc_helpers.hpp | 19 +- boost/asio/detail/handler_cont_helpers.hpp | 2 +- boost/asio/detail/handler_invoke_helpers.hpp | 2 +- boost/asio/detail/handler_tracking.hpp | 2 +- .../asio/detail/handler_type_requirements.hpp | 2 +- boost/asio/detail/handler_work.hpp | 34 +- boost/asio/detail/hash_map.hpp | 2 +- .../detail/impl/buffer_sequence_adapter.ipp | 2 +- boost/asio/detail/impl/descriptor_ops.ipp | 2 +- boost/asio/detail/impl/dev_poll_reactor.hpp | 2 +- boost/asio/detail/impl/dev_poll_reactor.ipp | 2 +- boost/asio/detail/impl/epoll_reactor.hpp | 2 +- boost/asio/detail/impl/epoll_reactor.ipp | 2 +- .../impl/eventfd_select_interrupter.ipp | 2 +- boost/asio/detail/impl/handler_tracking.ipp | 2 +- boost/asio/detail/impl/kqueue_reactor.hpp | 2 +- boost/asio/detail/impl/kqueue_reactor.ipp | 2 +- boost/asio/detail/impl/null_event.ipp | 2 +- .../detail/impl/pipe_select_interrupter.ipp | 2 +- boost/asio/detail/impl/posix_event.ipp | 2 +- boost/asio/detail/impl/posix_mutex.ipp | 2 +- boost/asio/detail/impl/posix_thread.ipp | 2 +- boost/asio/detail/impl/posix_tss_ptr.ipp | 2 +- .../impl/reactive_descriptor_service.ipp | 8 +- .../impl/reactive_serial_port_service.ipp | 8 +- .../impl/reactive_socket_service_base.ipp | 7 +- .../detail/impl/resolver_service_base.ipp | 64 +- boost/asio/detail/impl/scheduler.ipp | 54 +- boost/asio/detail/impl/select_reactor.hpp | 2 +- boost/asio/detail/impl/select_reactor.ipp | 2 +- boost/asio/detail/impl/service_registry.hpp | 2 +- boost/asio/detail/impl/service_registry.ipp | 2 +- boost/asio/detail/impl/signal_set_service.ipp | 42 +- boost/asio/detail/impl/socket_ops.ipp | 11 +- .../detail/impl/socket_select_interrupter.ipp | 2 +- .../detail/impl/strand_executor_service.hpp | 2 +- .../detail/impl/strand_executor_service.ipp | 2 +- boost/asio/detail/impl/strand_service.hpp | 2 +- boost/asio/detail/impl/strand_service.ipp | 2 +- boost/asio/detail/impl/throw_error.ipp | 2 +- boost/asio/detail/impl/timer_queue_ptime.ipp | 2 +- boost/asio/detail/impl/timer_queue_set.ipp | 2 +- boost/asio/detail/impl/win_event.ipp | 2 +- .../detail/impl/win_iocp_handle_service.ipp | 12 +- .../asio/detail/impl/win_iocp_io_context.hpp | 2 +- .../asio/detail/impl/win_iocp_io_context.ipp | 43 +- .../impl/win_iocp_serial_port_service.ipp | 23 +- .../impl/win_iocp_socket_service_base.ipp | 13 +- boost/asio/detail/impl/win_mutex.ipp | 2 +- .../detail/impl/win_object_handle_service.ipp | 35 +- boost/asio/detail/impl/win_static_mutex.ipp | 2 +- boost/asio/detail/impl/win_thread.ipp | 2 +- boost/asio/detail/impl/win_tss_ptr.ipp | 2 +- .../impl/winrt_ssocket_service_base.ipp | 631 ---- .../detail/impl/winrt_timer_scheduler.hpp | 8 +- .../detail/impl/winrt_timer_scheduler.ipp | 15 +- boost/asio/detail/impl/winsock_init.ipp | 2 +- boost/asio/detail/io_control.hpp | 2 +- boost/asio/detail/io_object_executor.hpp | 169 + boost/asio/detail/io_object_impl.hpp | 195 ++ boost/asio/detail/is_buffer_sequence.hpp | 111 +- boost/asio/detail/is_executor.hpp | 2 +- boost/asio/detail/keyword_tss_ptr.hpp | 2 +- boost/asio/detail/kqueue_reactor.hpp | 2 +- boost/asio/detail/macos_fenced_block.hpp | 2 +- boost/asio/detail/memory.hpp | 2 +- boost/asio/detail/mutex.hpp | 2 +- boost/asio/detail/non_const_lvalue.hpp | 56 + boost/asio/detail/noncopyable.hpp | 2 +- boost/asio/detail/null_event.hpp | 2 +- boost/asio/detail/null_fenced_block.hpp | 2 +- boost/asio/detail/null_global.hpp | 2 +- boost/asio/detail/null_mutex.hpp | 2 +- boost/asio/detail/null_reactor.hpp | 2 +- boost/asio/detail/null_signal_blocker.hpp | 2 +- boost/asio/detail/null_socket_service.hpp | 115 +- boost/asio/detail/null_static_mutex.hpp | 2 +- boost/asio/detail/null_thread.hpp | 2 +- boost/asio/detail/null_tss_ptr.hpp | 2 +- boost/asio/detail/object_pool.hpp | 2 +- boost/asio/detail/old_win_sdk_compat.hpp | 2 +- boost/asio/detail/op_queue.hpp | 2 +- boost/asio/detail/operation.hpp | 2 +- boost/asio/detail/pipe_select_interrupter.hpp | 2 +- boost/asio/detail/pop_options.hpp | 14 +- boost/asio/detail/posix_event.hpp | 4 +- boost/asio/detail/posix_fd_set_adapter.hpp | 2 +- boost/asio/detail/posix_global.hpp | 2 +- boost/asio/detail/posix_mutex.hpp | 2 +- boost/asio/detail/posix_signal_blocker.hpp | 2 +- boost/asio/detail/posix_static_mutex.hpp | 2 +- boost/asio/detail/posix_thread.hpp | 2 +- boost/asio/detail/posix_tss_ptr.hpp | 2 +- boost/asio/detail/push_options.hpp | 14 +- .../detail/reactive_descriptor_service.hpp | 53 +- .../asio/detail/reactive_null_buffers_op.hpp | 14 +- .../detail/reactive_serial_port_service.hpp | 24 +- .../asio/detail/reactive_socket_accept_op.hpp | 51 +- .../detail/reactive_socket_connect_op.hpp | 15 +- boost/asio/detail/reactive_socket_recv_op.hpp | 18 +- .../detail/reactive_socket_recvfrom_op.hpp | 16 +- .../detail/reactive_socket_recvmsg_op.hpp | 15 +- boost/asio/detail/reactive_socket_send_op.hpp | 18 +- .../asio/detail/reactive_socket_sendto_op.hpp | 16 +- boost/asio/detail/reactive_socket_service.hpp | 115 +- .../detail/reactive_socket_service_base.hpp | 83 +- boost/asio/detail/reactive_wait_op.hpp | 14 +- boost/asio/detail/reactor.hpp | 2 +- boost/asio/detail/reactor_fwd.hpp | 2 +- boost/asio/detail/reactor_op.hpp | 2 +- boost/asio/detail/reactor_op_queue.hpp | 2 +- boost/asio/detail/recycling_allocator.hpp | 30 +- boost/asio/detail/regex_fwd.hpp | 2 +- boost/asio/detail/resolve_endpoint_op.hpp | 36 +- boost/asio/detail/resolve_op.hpp | 2 +- boost/asio/detail/resolve_query_op.hpp | 34 +- boost/asio/detail/resolver_service.hpp | 36 +- boost/asio/detail/resolver_service_base.hpp | 41 +- boost/asio/detail/scheduler.hpp | 15 +- boost/asio/detail/scheduler_operation.hpp | 2 +- boost/asio/detail/scheduler_thread_info.hpp | 2 +- boost/asio/detail/scoped_lock.hpp | 2 +- boost/asio/detail/scoped_ptr.hpp | 2 +- boost/asio/detail/select_interrupter.hpp | 2 +- boost/asio/detail/select_reactor.hpp | 2 +- boost/asio/detail/service_registry.hpp | 2 +- boost/asio/detail/signal_blocker.hpp | 2 +- boost/asio/detail/signal_handler.hpp | 14 +- boost/asio/detail/signal_init.hpp | 2 +- boost/asio/detail/signal_op.hpp | 2 +- boost/asio/detail/signal_set_service.hpp | 36 +- boost/asio/detail/socket_holder.hpp | 2 +- boost/asio/detail/socket_ops.hpp | 2 +- boost/asio/detail/socket_option.hpp | 2 +- .../asio/detail/socket_select_interrupter.hpp | 2 +- boost/asio/detail/socket_types.hpp | 2 +- boost/asio/detail/solaris_fenced_block.hpp | 2 +- boost/asio/detail/static_mutex.hpp | 2 +- boost/asio/detail/std_event.hpp | 2 +- boost/asio/detail/std_fenced_block.hpp | 2 +- boost/asio/detail/std_global.hpp | 2 +- boost/asio/detail/std_mutex.hpp | 2 +- boost/asio/detail/std_static_mutex.hpp | 2 +- boost/asio/detail/std_thread.hpp | 2 +- boost/asio/detail/strand_executor_service.hpp | 2 +- boost/asio/detail/strand_service.hpp | 2 +- boost/asio/detail/string_view.hpp | 2 +- boost/asio/detail/thread.hpp | 2 +- boost/asio/detail/thread_context.hpp | 2 +- boost/asio/detail/thread_group.hpp | 8 +- boost/asio/detail/thread_info_base.hpp | 11 +- boost/asio/detail/throw_error.hpp | 2 +- boost/asio/detail/throw_exception.hpp | 2 +- boost/asio/detail/timer_queue.hpp | 4 +- boost/asio/detail/timer_queue_base.hpp | 2 +- boost/asio/detail/timer_queue_ptime.hpp | 2 +- boost/asio/detail/timer_queue_set.hpp | 2 +- boost/asio/detail/timer_scheduler.hpp | 2 +- boost/asio/detail/timer_scheduler_fwd.hpp | 2 +- boost/asio/detail/tss_ptr.hpp | 2 +- boost/asio/detail/type_traits.hpp | 2 +- boost/asio/detail/variadic_templates.hpp | 16 +- boost/asio/detail/wait_handler.hpp | 16 +- boost/asio/detail/wait_op.hpp | 2 +- boost/asio/detail/win_event.hpp | 2 +- boost/asio/detail/win_fd_set_adapter.hpp | 2 +- boost/asio/detail/win_fenced_block.hpp | 2 +- boost/asio/detail/win_global.hpp | 12 +- boost/asio/detail/win_iocp_handle_read_op.hpp | 16 +- boost/asio/detail/win_iocp_handle_service.hpp | 72 +- .../asio/detail/win_iocp_handle_write_op.hpp | 15 +- boost/asio/detail/win_iocp_io_context.hpp | 14 +- .../asio/detail/win_iocp_null_buffers_op.hpp | 14 +- boost/asio/detail/win_iocp_operation.hpp | 2 +- boost/asio/detail/win_iocp_overlapped_op.hpp | 14 +- boost/asio/detail/win_iocp_overlapped_ptr.hpp | 42 +- .../detail/win_iocp_serial_port_service.hpp | 24 +- .../asio/detail/win_iocp_socket_accept_op.hpp | 41 +- .../detail/win_iocp_socket_connect_op.hpp | 15 +- boost/asio/detail/win_iocp_socket_recv_op.hpp | 15 +- .../detail/win_iocp_socket_recvfrom_op.hpp | 16 +- .../detail/win_iocp_socket_recvmsg_op.hpp | 15 +- boost/asio/detail/win_iocp_socket_send_op.hpp | 15 +- boost/asio/detail/win_iocp_socket_service.hpp | 132 +- .../detail/win_iocp_socket_service_base.hpp | 101 +- boost/asio/detail/win_iocp_thread_info.hpp | 2 +- boost/asio/detail/win_iocp_wait_op.hpp | 14 +- boost/asio/detail/win_mutex.hpp | 2 +- .../asio/detail/win_object_handle_service.hpp | 35 +- boost/asio/detail/win_static_mutex.hpp | 2 +- boost/asio/detail/win_thread.hpp | 2 +- boost/asio/detail/win_tss_ptr.hpp | 2 +- boost/asio/detail/winapp_thread.hpp | 2 +- boost/asio/detail/wince_thread.hpp | 2 +- boost/asio/detail/winrt_async_manager.hpp | 39 +- boost/asio/detail/winrt_async_op.hpp | 2 +- boost/asio/detail/winrt_resolve_op.hpp | 15 +- boost/asio/detail/winrt_resolver_service.hpp | 54 +- boost/asio/detail/winrt_socket_connect_op.hpp | 94 - boost/asio/detail/winrt_socket_recv_op.hpp | 114 - boost/asio/detail/winrt_socket_send_op.hpp | 105 - boost/asio/detail/winrt_ssocket_service.hpp | 243 -- .../detail/winrt_ssocket_service_base.hpp | 361 --- boost/asio/detail/winrt_timer_scheduler.hpp | 26 +- boost/asio/detail/winrt_utils.hpp | 2 +- boost/asio/detail/winsock_init.hpp | 2 +- boost/asio/detail/work_dispatcher.hpp | 7 +- boost/asio/detail/wrapped_handler.hpp | 2 +- boost/asio/dispatch.hpp | 10 +- boost/asio/error.hpp | 2 +- boost/asio/execution_context.hpp | 5 +- boost/asio/executor.hpp | 2 +- boost/asio/executor_work_guard.hpp | 4 +- boost/asio/generic/basic_endpoint.hpp | 2 +- boost/asio/generic/datagram_protocol.hpp | 2 +- boost/asio/generic/detail/endpoint.hpp | 2 +- boost/asio/generic/detail/impl/endpoint.ipp | 2 +- boost/asio/generic/raw_protocol.hpp | 2 +- boost/asio/generic/seq_packet_protocol.hpp | 2 +- boost/asio/generic/stream_protocol.hpp | 2 +- boost/asio/handler_alloc_hook.hpp | 2 +- boost/asio/handler_continuation_hook.hpp | 2 +- boost/asio/handler_invoke_hook.hpp | 2 +- boost/asio/handler_type.hpp | 52 - boost/asio/high_resolution_timer.hpp | 2 +- boost/asio/impl/awaitable.hpp | 424 +++ boost/asio/impl/buffered_read_stream.hpp | 107 +- boost/asio/impl/buffered_write_stream.hpp | 99 +- boost/asio/impl/co_spawn.hpp | 140 + boost/asio/impl/compose.hpp | 421 +++ boost/asio/impl/connect.hpp | 414 ++- boost/asio/impl/defer.hpp | 62 +- boost/asio/impl/detached.hpp | 132 + boost/asio/impl/dispatch.hpp | 63 +- boost/asio/impl/error.ipp | 2 +- boost/asio/impl/execution_context.hpp | 14 +- boost/asio/impl/execution_context.ipp | 2 +- boost/asio/impl/executor.hpp | 31 +- boost/asio/impl/executor.ipp | 2 +- boost/asio/impl/handler_alloc_hook.ipp | 2 +- boost/asio/impl/io_context.hpp | 132 +- boost/asio/impl/io_context.ipp | 7 +- boost/asio/impl/post.hpp | 62 +- boost/asio/impl/read.hpp | 570 +++- boost/asio/impl/read_at.hpp | 147 +- boost/asio/impl/read_until.hpp | 2074 ++++++++++-- boost/asio/impl/redirect_error.hpp | 374 +++ boost/asio/impl/serial_port_base.hpp | 2 +- boost/asio/impl/serial_port_base.ipp | 2 +- boost/asio/impl/system_context.hpp | 2 +- boost/asio/impl/system_context.ipp | 11 +- boost/asio/impl/system_executor.hpp | 2 +- boost/asio/impl/thread_pool.hpp | 2 +- boost/asio/impl/thread_pool.ipp | 21 +- boost/asio/impl/use_awaitable.hpp | 278 ++ boost/asio/impl/use_future.hpp | 53 +- boost/asio/impl/write.hpp | 520 ++- boost/asio/impl/write_at.hpp | 146 +- boost/asio/io_context.hpp | 16 +- boost/asio/io_context_strand.hpp | 92 +- boost/asio/io_service.hpp | 2 +- boost/asio/io_service_strand.hpp | 2 +- boost/asio/ip/address.hpp | 62 +- boost/asio/ip/address_v4.hpp | 58 +- boost/asio/ip/address_v4_iterator.hpp | 2 +- boost/asio/ip/address_v4_range.hpp | 2 +- boost/asio/ip/address_v6.hpp | 77 +- boost/asio/ip/address_v6_iterator.hpp | 2 +- boost/asio/ip/address_v6_range.hpp | 2 +- boost/asio/ip/bad_address_cast.hpp | 9 +- boost/asio/ip/basic_endpoint.hpp | 47 +- boost/asio/ip/basic_resolver.hpp | 320 +- boost/asio/ip/basic_resolver_entry.hpp | 2 +- boost/asio/ip/basic_resolver_iterator.hpp | 2 +- boost/asio/ip/basic_resolver_query.hpp | 2 +- boost/asio/ip/basic_resolver_results.hpp | 10 +- boost/asio/ip/detail/endpoint.hpp | 40 +- boost/asio/ip/detail/impl/endpoint.ipp | 20 +- boost/asio/ip/detail/socket_option.hpp | 2 +- boost/asio/ip/host_name.hpp | 2 +- boost/asio/ip/icmp.hpp | 2 +- boost/asio/ip/impl/address.hpp | 2 +- boost/asio/ip/impl/address.ipp | 41 +- boost/asio/ip/impl/address_v4.hpp | 2 +- boost/asio/ip/impl/address_v4.ipp | 22 +- boost/asio/ip/impl/address_v6.hpp | 2 +- boost/asio/ip/impl/address_v6.ipp | 52 +- boost/asio/ip/impl/basic_endpoint.hpp | 2 +- boost/asio/ip/impl/host_name.ipp | 2 +- boost/asio/ip/impl/network_v4.hpp | 56 + boost/asio/ip/impl/network_v4.ipp | 218 ++ boost/asio/ip/impl/network_v6.hpp | 55 + boost/asio/ip/impl/network_v6.ipp | 187 ++ boost/asio/ip/multicast.hpp | 16 +- boost/asio/ip/network_v4.hpp | 263 ++ boost/asio/ip/network_v6.hpp | 237 ++ boost/asio/ip/resolver_base.hpp | 2 +- boost/asio/ip/resolver_query_base.hpp | 2 +- boost/asio/ip/resolver_service.hpp | 202 -- boost/asio/ip/tcp.hpp | 6 +- boost/asio/ip/udp.hpp | 2 +- boost/asio/ip/unicast.hpp | 6 +- boost/asio/ip/v6_only.hpp | 6 +- boost/asio/is_executor.hpp | 2 +- boost/asio/is_read_buffered.hpp | 2 +- boost/asio/is_write_buffered.hpp | 2 +- boost/asio/local/basic_endpoint.hpp | 10 +- boost/asio/local/connect_pair.hpp | 31 +- boost/asio/local/datagram_protocol.hpp | 2 +- boost/asio/local/detail/endpoint.hpp | 8 +- boost/asio/local/detail/impl/endpoint.ipp | 9 +- boost/asio/local/stream_protocol.hpp | 2 +- boost/asio/packaged_task.hpp | 8 +- boost/asio/placeholders.hpp | 2 +- boost/asio/posix/basic_descriptor.hpp | 228 +- boost/asio/posix/basic_stream_descriptor.hpp | 192 +- boost/asio/posix/descriptor.hpp | 617 +--- boost/asio/posix/descriptor_base.hpp | 4 +- boost/asio/posix/stream_descriptor.hpp | 329 +- .../asio/posix/stream_descriptor_service.hpp | 281 -- boost/asio/post.hpp | 8 +- boost/asio/raw_socket_service.hpp | 468 --- boost/asio/read.hpp | 378 ++- boost/asio/read_at.hpp | 34 +- boost/asio/read_until.hpp | 1109 ++++++- boost/asio/redirect_error.hpp | 68 + boost/asio/seq_packet_socket_service.hpp | 418 --- boost/asio/serial_port.hpp | 739 +---- boost/asio/serial_port_base.hpp | 2 +- boost/asio/serial_port_service.hpp | 251 -- boost/asio/signal_set.hpp | 425 +-- boost/asio/signal_set_service.hpp | 144 - boost/asio/socket_acceptor_service.hpp | 374 --- boost/asio/socket_base.hpp | 52 +- boost/asio/steady_timer.hpp | 2 +- boost/asio/strand.hpp | 29 +- boost/asio/stream_socket_service.hpp | 414 --- boost/asio/streambuf.hpp | 2 +- boost/asio/system_context.hpp | 5 +- boost/asio/system_executor.hpp | 2 +- boost/asio/system_timer.hpp | 2 +- boost/asio/this_coro.hpp | 47 + boost/asio/thread_pool.hpp | 7 +- boost/asio/time_traits.hpp | 2 +- boost/asio/use_awaitable.hpp | 73 + boost/asio/use_future.hpp | 7 +- boost/asio/uses_executor.hpp | 2 +- boost/asio/version.hpp | 4 +- boost/asio/wait_traits.hpp | 2 +- boost/asio/waitable_timer_service.hpp | 212 -- boost/asio/windows/basic_handle.hpp | 275 -- boost/asio/windows/basic_object_handle.hpp | 294 +- .../asio/windows/basic_overlapped_handle.hpp | 355 ++ .../windows/basic_random_access_handle.hpp | 173 +- boost/asio/windows/basic_stream_handle.hpp | 174 +- boost/asio/windows/object_handle.hpp | 349 +- boost/asio/windows/object_handle_service.hpp | 185 -- boost/asio/windows/overlapped_handle.hpp | 300 +- boost/asio/windows/overlapped_ptr.hpp | 45 +- boost/asio/windows/random_access_handle.hpp | 347 +- .../windows/random_access_handle_service.hpp | 216 -- boost/asio/windows/stream_handle.hpp | 331 +- boost/asio/windows/stream_handle_service.hpp | 212 -- boost/asio/write.hpp | 370 ++- boost/asio/write_at.hpp | 34 +- boost/bind/bind.hpp | 10 +- boost/bind/mem_fn.hpp | 22 +- boost/blank.hpp | 8 +- boost/chrono/detail/inlined/mac/chrono.hpp | 20 +- .../detail/inlined/mac/process_cpu_clocks.hpp | 68 +- .../detail/inlined/mac/thread_clock.hpp | 8 +- boost/chrono/detail/inlined/posix/chrono.hpp | 48 +- .../inlined/posix/process_cpu_clocks.hpp | 54 +- .../detail/inlined/posix/thread_clock.hpp | 8 +- boost/chrono/detail/inlined/win/chrono.hpp | 40 +- .../detail/inlined/win/process_cpu_clocks.hpp | 28 +- .../detail/inlined/win/thread_clock.hpp | 8 +- boost/chrono/detail/system.hpp | 9 +- boost/chrono/system_clocks.hpp | 4 +- boost/concept/assert.hpp | 2 +- boost/concept/detail/general.hpp | 6 +- boost/concept/detail/has_constraints.hpp | 6 +- boost/concept/detail/msvc.hpp | 4 +- boost/concept/usage.hpp | 2 +- boost/concept_check.hpp | 38 +- boost/config/auto_link.hpp | 27 +- boost/config/compiler/borland.hpp | 7 +- boost/config/compiler/clang.hpp | 14 +- boost/config/compiler/codegear.hpp | 8 +- boost/config/compiler/comeau.hpp | 2 +- boost/config/compiler/common_edg.hpp | 4 + boost/config/compiler/cray.hpp | 420 ++- boost/config/compiler/digitalmars.hpp | 5 +- boost/config/compiler/gcc.hpp | 19 +- boost/config/compiler/gcc_xml.hpp | 3 + boost/config/compiler/greenhills.hpp | 2 +- boost/config/compiler/hp_acc.hpp | 2 +- boost/config/compiler/intel.hpp | 7 +- boost/config/compiler/kai.hpp | 2 +- boost/config/compiler/metrowerks.hpp | 5 +- boost/config/compiler/mpw.hpp | 5 +- boost/config/compiler/nvcc.hpp | 6 +- boost/config/compiler/pathscale.hpp | 3 + boost/config/compiler/sunpro_cc.hpp | 3 + boost/config/compiler/vacpp.hpp | 5 +- boost/config/compiler/visualc.hpp | 25 +- boost/config/compiler/xlcpp.hpp | 4 + boost/config/compiler/xlcpp_zos.hpp | 1 + .../config/detail/select_compiler_config.hpp | 3 +- boost/config/detail/suffix.hpp | 34 + boost/config/platform/cygwin.hpp | 3 + boost/config/platform/vxworks.hpp | 135 +- boost/config/stdlib/dinkumware.hpp | 7 +- boost/config/stdlib/libcpp.hpp | 19 +- boost/config/stdlib/libstdcpp3.hpp | 9 +- boost/container/allocator_traits.hpp | 24 +- boost/container/container_fwd.hpp | 63 +- .../container/detail/advanced_insert_int.hpp | 40 +- .../detail/allocator_version_traits.hpp | 3 +- boost/container/detail/compare_functors.hpp | 70 +- .../detail/container_or_allocator_rebind.hpp | 4 + boost/container/detail/container_rebind.hpp | 149 +- boost/container/detail/copy_move_algo.hpp | 44 +- boost/container/detail/flat_tree.hpp | 227 +- boost/container/detail/is_container.hpp | 7 + boost/container/detail/iterator.hpp | 16 + boost/container/detail/iterators.hpp | 250 +- boost/container/detail/mpl.hpp | 62 +- .../detail/multiallocation_chain.hpp | 51 +- boost/container/detail/node_alloc_holder.hpp | 282 +- boost/container/detail/pair.hpp | 156 +- boost/container/detail/std_fwd.hpp | 3 + boost/container/detail/tree.hpp | 364 ++- boost/container/detail/type_traits.hpp | 2 + .../detail/variadic_templates_tools.hpp | 2 +- boost/container/detail/version_type.hpp | 15 +- boost/container/detail/workaround.hpp | 22 + boost/container/flat_map.hpp | 426 ++- boost/container/flat_set.hpp | 280 +- boost/container/map.hpp | 485 ++- boost/container/new_allocator.hpp | 19 +- boost/container/options.hpp | 280 +- boost/container/set.hpp | 412 ++- boost/container/small_vector.hpp | 281 +- boost/container/static_vector.hpp | 217 +- boost/container/throw_exception.hpp | 20 +- boost/container/vector.hpp | 467 +-- boost/core/checked_delete.hpp | 10 +- boost/core/explicit_operator_bool.hpp | 9 + boost/core/no_exceptions_support.hpp | 14 +- boost/core/noncopyable.hpp | 17 +- boost/core/ref.hpp | 3 +- boost/core/swap.hpp | 11 +- boost/core/typeinfo.hpp | 36 +- boost/core/use_default.hpp | 17 + boost/crc.hpp | 2258 ++++++++++--- boost/current_function.hpp | 6 +- boost/date_time/compiler_config.hpp | 5 + boost/date_time/date_generators.hpp | 4 +- boost/date_time/dst_rules.hpp | 6 +- boost/date_time/gregorian/greg_date.hpp | 2 +- boost/date_time/gregorian_calendar.hpp | 4 +- .../posix_time/posix_time_duration.hpp | 6 +- boost/date_time/time_duration.hpp | 6 +- boost/detail/basic_pointerbuf.hpp | 2 +- boost/detail/endian.hpp | 11 - boost/detail/indirect_traits.hpp | 85 +- boost/detail/is_incrementable.hpp | 4 - boost/detail/lcast_precision.hpp | 10 +- boost/detail/reference_content.hpp | 14 +- boost/detail/select_type.hpp | 36 + boost/detail/sp_typeinfo.hpp | 36 - boost/detail/winapi/time.hpp | 20 - boost/detail/winapi/timers.hpp | 20 - boost/exception/exception.hpp | 134 +- boost/function.hpp | 2 +- boost/function/function_base.hpp | 74 +- boost/function/function_template.hpp | 78 +- boost/icl/concept/element_associator.hpp | 168 +- boost/icl/concept/interval.hpp | 353 +- boost/icl/concept/interval_associator.hpp | 25 + boost/icl/interval_base_map.hpp | 1 + boost/icl/interval_base_set.hpp | 140 +- boost/icl/iterator.hpp | 10 +- boost/icl/map.hpp | 141 +- boost/icl/type_traits/rep_type_of.hpp | 17 +- boost/icl/type_traits/value_size.hpp | 10 +- boost/integer/common_factor_rt.hpp | 64 +- boost/intrusive/avltree.hpp | 22 +- boost/intrusive/avltree_algorithms.hpp | 88 +- boost/intrusive/bstree.hpp | 22 +- boost/intrusive/bstree_algorithms.hpp | 82 +- boost/intrusive/circular_slist_algorithms.hpp | 14 +- boost/intrusive/detail/avltree_node.hpp | 18 +- .../detail/common_slist_algorithms.hpp | 14 +- boost/intrusive/detail/ebo_functor_holder.hpp | 6 +- boost/intrusive/detail/generic_hook.hpp | 18 +- boost/intrusive/detail/hook_traits.hpp | 16 +- boost/intrusive/detail/iterator.hpp | 20 +- boost/intrusive/detail/key_nodeptr_comp.hpp | 2 +- boost/intrusive/detail/math.hpp | 4 +- boost/intrusive/detail/mpl.hpp | 1 + .../intrusive/detail/node_cloner_disposer.hpp | 4 +- boost/intrusive/detail/rbtree_node.hpp | 12 +- boost/intrusive/detail/simple_disposers.hpp | 2 +- boost/intrusive/detail/slist_iterator.hpp | 16 +- boost/intrusive/detail/slist_node.hpp | 2 +- boost/intrusive/detail/tree_iterator.hpp | 34 +- boost/intrusive/detail/tree_node.hpp | 6 +- boost/intrusive/detail/tree_value_compare.hpp | 47 +- boost/intrusive/detail/workaround.hpp | 7 +- boost/intrusive/intrusive_fwd.hpp | 3 + boost/intrusive/linear_slist_algorithms.hpp | 8 +- boost/intrusive/options.hpp | 10 +- boost/intrusive/pack_options.hpp | 6 + boost/intrusive/pointer_plus_bits.hpp | 3 + boost/intrusive/pointer_traits.hpp | 28 +- boost/intrusive/rbtree.hpp | 22 +- boost/intrusive/rbtree_algorithms.hpp | 78 +- boost/intrusive/sgtree.hpp | 22 +- boost/intrusive/sgtree_algorithms.hpp | 122 +- boost/intrusive/slist.hpp | 30 +- boost/intrusive/splaytree.hpp | 22 +- boost/intrusive/splaytree_algorithms.hpp | 132 +- boost/iterator/advance.hpp | 2 +- .../detail/facade_iterator_category.hpp | 5 +- boost/iterator/distance.hpp | 65 + boost/iterator/iterator_adaptor.hpp | 6 +- boost/iterator/iterator_facade.hpp | 2 +- boost/lexical_cast.hpp | 2 +- boost/lexical_cast/bad_lexical_cast.hpp | 2 +- .../lexical_cast/detail/converter_lexical.hpp | 46 +- .../detail/converter_lexical_streams.hpp | 8 +- .../lexical_cast/detail/converter_numeric.hpp | 26 +- boost/lexical_cast/detail/inf_nan.hpp | 2 +- boost/lexical_cast/detail/is_character.hpp | 9 +- .../detail/lcast_char_constants.hpp | 2 +- .../detail/lcast_unsigned_converters.hpp | 10 +- boost/lexical_cast/detail/widest_char.hpp | 7 +- boost/lexical_cast/try_lexical_convert.hpp | 31 +- .../special_functions/detail/fp_traits.hpp | 26 +- boost/math/special_functions/math_fwd.hpp | 27 + boost/math/tools/config.hpp | 4 +- boost/move/algo/adaptive_merge.hpp | 96 +- boost/move/algo/adaptive_sort.hpp | 45 +- .../move/algo/detail/adaptive_sort_merge.hpp | 423 +-- boost/move/algo/detail/merge.hpp | 447 ++- boost/move/algo/detail/merge_sort.hpp | 68 + boost/move/algo/detail/set_difference.hpp | 2 +- boost/move/algo/move.hpp | 2 +- boost/move/algo/predicate.hpp | 15 + boost/move/algorithm.hpp | 2 +- boost/move/core.hpp | 16 +- boost/move/detail/meta_utils.hpp | 2 + boost/move/detail/meta_utils_core.hpp | 17 +- boost/move/detail/type_traits.hpp | 6 +- boost/mpl/assert.hpp | 26 +- boost/mpl/if.hpp | 2 +- .../numeric/conversion/converter_policies.hpp | 7 +- .../detail/old_optional_implementation.hpp | 21 +- .../detail/optional_reference_spec.hpp | 21 +- .../optional_trivially_copyable_base.hpp | 6 +- boost/optional/optional.hpp | 312 +- boost/predef/architecture.h | 1 + boost/predef/architecture/arm.h | 84 +- boost/predef/architecture/ptx.h | 44 + boost/predef/compiler.h | 1 + boost/predef/compiler/compaq.h | 2 +- boost/predef/compiler/nvcc.h | 73 + boost/predef/detail/endian_compat.h | 26 - boost/predef/language.h | 1 + boost/predef/language/cuda.h | 52 + boost/predef/make.h | 4 + boost/predef/os.h | 3 +- boost/predef/os/android.h | 3 + boost/predef/os/bsd.h | 4 +- boost/predef/os/bsd/net.h | 2 +- boost/predef/os/cygwin.h | 7 +- boost/predef/os/linux.h | 5 +- boost/predef/other/endian.h | 3 +- boost/predef/platform.h | 1 + boost/predef/platform/android.h | 43 + boost/predef/platform/ios.h | 6 +- boost/predef/version.h | 2 +- boost/preprocessor/config/config.hpp | 25 +- boost/preprocessor/stringize.hpp | 4 + boost/range/algorithm/max_element.hpp | 40 +- boost/range/algorithm/min_element.hpp | 40 +- boost/range/algorithm/random_shuffle.hpp | 81 +- boost/range/algorithm_ext/insert.hpp | 1 + boost/range/as_literal.hpp | 43 + boost/range/begin.hpp | 18 +- boost/range/concepts.hpp | 2 +- boost/range/detail/begin.hpp | 8 +- boost/range/detail/common.hpp | 4 +- boost/range/detail/end.hpp | 8 +- boost/range/detail/implementation_help.hpp | 4 +- boost/range/detail/less.hpp | 26 + boost/range/distance.hpp | 16 +- boost/range/end.hpp | 20 +- boost/range/has_range_iterator.hpp | 6 +- boost/ratio/config.hpp | 8 +- boost/rational.hpp | 132 +- boost/regex/config.hpp | 16 +- boost/regex/icu.hpp | 39 +- boost/regex/v4/basic_regex.hpp | 8 +- boost/regex/v4/basic_regex_creator.hpp | 4 +- boost/regex/v4/basic_regex_parser.hpp | 7 +- boost/regex/v4/fileiter.hpp | 3 - boost/regex/v4/instances.hpp | 19 +- boost/regex/v4/match_flags.hpp | 3 +- boost/regex/v4/match_results.hpp | 15 +- boost/regex/v4/perl_matcher.hpp | 9 +- boost/regex/v4/perl_matcher_common.hpp | 10 +- boost/regex/v4/perl_matcher_non_recursive.hpp | 8 +- boost/regex/v4/regex_format.hpp | 5 - boost/regex/v4/regex_iterator.hpp | 8 - boost/regex/v4/regex_raw_buffer.hpp | 6 +- boost/regex/v4/regex_split.hpp | 4 +- boost/regex/v4/regex_token_iterator.hpp | 8 - boost/regex/v4/regex_traits_defaults.hpp | 23 +- boost/regex/v4/regex_workaround.hpp | 11 +- boost/regex/v4/u32regex_iterator.hpp | 10 +- boost/regex/v4/u32regex_token_iterator.hpp | 12 +- boost/regex/v4/w32_regex_traits.hpp | 2 + boost/smart_ptr/bad_weak_ptr.hpp | 2 +- .../detail/atomic_count_std_atomic.hpp | 2 +- boost/smart_ptr/detail/local_counted_base.hpp | 10 +- boost/smart_ptr/detail/local_sp_deleter.hpp | 6 +- boost/smart_ptr/detail/lwm_win32_cs.hpp | 16 +- boost/smart_ptr/detail/shared_count.hpp | 61 +- .../detail/sp_counted_base_acc_ia64.hpp | 9 +- .../smart_ptr/detail/sp_counted_base_aix.hpp | 9 +- .../detail/sp_counted_base_clang.hpp | 38 +- .../detail/sp_counted_base_cw_ppc.hpp | 9 +- .../detail/sp_counted_base_gcc_ia64.hpp | 9 +- .../detail/sp_counted_base_gcc_mips.hpp | 9 +- .../detail/sp_counted_base_gcc_ppc.hpp | 9 +- .../detail/sp_counted_base_gcc_sparc.hpp | 9 +- .../detail/sp_counted_base_gcc_x86.hpp | 9 +- boost/smart_ptr/detail/sp_counted_base_nt.hpp | 37 +- boost/smart_ptr/detail/sp_counted_base_pt.hpp | 20 +- .../detail/sp_counted_base_snc_ps3.hpp | 9 +- .../smart_ptr/detail/sp_counted_base_spin.hpp | 9 +- .../detail/sp_counted_base_std_atomic.hpp | 38 +- .../smart_ptr/detail/sp_counted_base_sync.hpp | 9 +- .../detail/sp_counted_base_vacpp_ppc.hpp | 9 +- .../smart_ptr/detail/sp_counted_base_w32.hpp | 9 +- boost/smart_ptr/detail/sp_counted_impl.hpp | 45 +- boost/smart_ptr/detail/sp_interlocked.hpp | 10 + boost/smart_ptr/detail/sp_typeinfo_.hpp | 58 + .../smart_ptr/detail/spinlock_std_atomic.hpp | 11 +- boost/smart_ptr/detail/yield_k.hpp | 28 +- boost/smart_ptr/intrusive_ptr.hpp | 27 + boost/smart_ptr/shared_ptr.hpp | 14 +- boost/smart_ptr/weak_ptr.hpp | 29 +- boost/static_assert.hpp | 4 +- boost/system/config.hpp | 28 +- boost/system/detail/config.hpp | 51 + boost/system/detail/error_code.ipp | 496 --- boost/system/detail/generic_category.hpp | 101 + .../detail/local_free_on_destruction.hpp | 42 - boost/system/detail/std_interoperability.hpp | 180 + boost/system/detail/system_category_posix.hpp | 132 + boost/system/detail/system_category_win32.hpp | 341 ++ boost/system/error_code.hpp | 1469 +++++---- boost/system/system_error.hpp | 8 +- boost/throw_exception.hpp | 19 +- boost/token_functions.hpp | 1 + boost/type_index.hpp | 2 +- boost/type_index/ctti_type_index.hpp | 2 +- .../detail/compile_time_type_info.hpp | 72 +- .../type_index/detail/ctti_register_class.hpp | 2 +- .../type_index/detail/stl_register_class.hpp | 2 +- boost/type_index/stl_type_index.hpp | 42 +- boost/type_index/type_index_facade.hpp | 2 +- boost/type_traits.hpp | 3 + boost/type_traits/copy_cv_ref.hpp | 31 + boost/type_traits/copy_reference.hpp | 35 + .../detail/common_arithmetic_type.hpp | 4 +- boost/type_traits/detail/config.hpp | 30 + .../detail/has_binary_operator.hpp | 12 +- .../detail/has_postfix_operator.hpp | 55 + .../detail/has_prefix_operator.hpp | 72 + .../type_traits/detail/is_function_cxx_03.hpp | 108 + .../type_traits/detail/is_function_cxx_11.hpp | 597 ++++ .../detail/is_function_msvc10_fix.hpp | 30 + .../detail/is_function_ptr_tester.hpp | 672 ++-- boost/type_traits/detail/is_likely_lambda.hpp | 7 +- .../detail/is_mem_fun_pointer_tester.hpp | 2887 ++++++++--------- .../is_member_function_pointer_cxx_03.hpp | 117 + .../is_member_function_pointer_cxx_11.hpp | 672 ++++ .../detail/is_rvalue_reference_msvc10_fix.hpp | 43 + boost/type_traits/enable_if.hpp | 37 + boost/type_traits/has_dereference.hpp | 344 ++ boost/type_traits/has_minus.hpp | 17 +- boost/type_traits/has_minus_assign.hpp | 17 +- boost/type_traits/has_plus_assign.hpp | 17 +- boost/type_traits/has_post_decrement.hpp | 21 + boost/type_traits/has_post_increment.hpp | 21 + boost/type_traits/has_pre_decrement.hpp | 21 + boost/type_traits/has_pre_increment.hpp | 22 + boost/type_traits/has_trivial_move_assign.hpp | 2 +- .../has_trivial_move_constructor.hpp | 3 +- boost/type_traits/integral_constant.hpp | 20 +- boost/type_traits/intrinsics.hpp | 22 +- boost/type_traits/is_complete.hpp | 6 +- boost/type_traits/is_constructible.hpp | 2 +- boost/type_traits/is_copy_assignable.hpp | 7 +- boost/type_traits/is_copy_constructible.hpp | 10 +- .../type_traits/is_default_constructible.hpp | 2 +- boost/type_traits/is_destructible.hpp | 2 +- boost/type_traits/is_final.hpp | 2 +- boost/type_traits/is_function.hpp | 83 +- .../is_member_function_pointer.hpp | 100 +- boost/type_traits/is_noncopyable.hpp | 39 + .../is_nothrow_move_assignable.hpp | 4 +- .../is_nothrow_move_constructible.hpp | 4 +- boost/type_traits/is_rvalue_reference.hpp | 4 + boost/type_traits/is_virtual_base_of.hpp | 173 +- boost/type_traits/make_void.hpp | 2 +- boost/variant/bad_visit.hpp | 2 +- boost/variant/detail/apply_visitor_binary.hpp | 59 +- .../variant/detail/apply_visitor_delayed.hpp | 11 +- boost/variant/detail/apply_visitor_unary.hpp | 85 +- boost/variant/detail/config.hpp | 2 +- boost/variant/detail/element_index.hpp | 2 +- boost/variant/detail/forced_return.hpp | 22 +- boost/variant/detail/generic_result_type.hpp | 88 - boost/variant/detail/has_result_type.hpp | 2 +- boost/variant/detail/hash_variant.hpp | 3 +- boost/variant/detail/make_variant_list.hpp | 2 +- boost/variant/detail/move.hpp | 2 +- .../detail/multivisitors_cpp11_based.hpp | 10 +- .../multivisitors_preprocessor_based.hpp | 4 +- boost/variant/detail/std_hash.hpp | 46 + boost/variant/detail/visitation_impl.hpp | 19 +- boost/variant/get.hpp | 2 +- boost/variant/multivisitors.hpp | 2 +- boost/variant/polymorphic_get.hpp | 2 +- boost/variant/recursive_variant.hpp | 2 +- boost/variant/recursive_wrapper_fwd.hpp | 2 +- boost/variant/static_visitor.hpp | 2 - boost/variant/variant.hpp | 190 +- boost/variant/variant_fwd.hpp | 2 +- boost/variant/visitor_ptr.hpp | 29 - boost/version.hpp | 4 +- boost/winapi/basic_types.hpp | 117 +- boost/winapi/character_code_conversion.hpp | 70 +- boost/winapi/config.hpp | 32 +- boost/winapi/error_codes.hpp | 454 ++- boost/winapi/error_handling.hpp | 62 +- boost/winapi/get_current_process.hpp | 2 +- boost/winapi/get_current_thread.hpp | 2 +- boost/winapi/get_last_error.hpp | 2 +- boost/winapi/get_process_times.hpp | 2 +- boost/winapi/get_thread_times.hpp | 2 +- boost/winapi/local_memory.hpp | 6 +- boost/winapi/time.hpp | 16 +- boost/winapi/timers.hpp | 4 +- 843 files changed, 32812 insertions(+), 23388 deletions(-) create mode 100644 boost/asio/awaitable.hpp create mode 100644 boost/asio/co_spawn.hpp create mode 100644 boost/asio/compose.hpp delete mode 100644 boost/asio/datagram_socket_service.hpp delete mode 100644 boost/asio/deadline_timer_service.hpp create mode 100644 boost/asio/detached.hpp create mode 100644 boost/asio/detail/executor_function.hpp create mode 100644 boost/asio/detail/future.hpp delete mode 100644 boost/asio/detail/impl/winrt_ssocket_service_base.ipp create mode 100644 boost/asio/detail/io_object_executor.hpp create mode 100644 boost/asio/detail/io_object_impl.hpp create mode 100644 boost/asio/detail/non_const_lvalue.hpp delete mode 100644 boost/asio/detail/winrt_socket_connect_op.hpp delete mode 100644 boost/asio/detail/winrt_socket_recv_op.hpp delete mode 100644 boost/asio/detail/winrt_socket_send_op.hpp delete mode 100644 boost/asio/detail/winrt_ssocket_service.hpp delete mode 100644 boost/asio/detail/winrt_ssocket_service_base.hpp delete mode 100644 boost/asio/handler_type.hpp create mode 100644 boost/asio/impl/awaitable.hpp create mode 100644 boost/asio/impl/co_spawn.hpp create mode 100644 boost/asio/impl/compose.hpp create mode 100644 boost/asio/impl/detached.hpp create mode 100644 boost/asio/impl/redirect_error.hpp create mode 100644 boost/asio/impl/use_awaitable.hpp create mode 100644 boost/asio/ip/impl/network_v4.hpp create mode 100644 boost/asio/ip/impl/network_v4.ipp create mode 100644 boost/asio/ip/impl/network_v6.hpp create mode 100644 boost/asio/ip/impl/network_v6.ipp create mode 100644 boost/asio/ip/network_v4.hpp create mode 100644 boost/asio/ip/network_v6.hpp delete mode 100644 boost/asio/ip/resolver_service.hpp delete mode 100644 boost/asio/posix/stream_descriptor_service.hpp delete mode 100644 boost/asio/raw_socket_service.hpp create mode 100644 boost/asio/redirect_error.hpp delete mode 100644 boost/asio/seq_packet_socket_service.hpp delete mode 100644 boost/asio/serial_port_service.hpp delete mode 100644 boost/asio/signal_set_service.hpp delete mode 100644 boost/asio/socket_acceptor_service.hpp delete mode 100644 boost/asio/stream_socket_service.hpp create mode 100644 boost/asio/this_coro.hpp create mode 100644 boost/asio/use_awaitable.hpp delete mode 100644 boost/asio/waitable_timer_service.hpp delete mode 100644 boost/asio/windows/basic_handle.hpp create mode 100644 boost/asio/windows/basic_overlapped_handle.hpp delete mode 100644 boost/asio/windows/object_handle_service.hpp delete mode 100644 boost/asio/windows/random_access_handle_service.hpp delete mode 100644 boost/asio/windows/stream_handle_service.hpp create mode 100644 boost/core/use_default.hpp delete mode 100644 boost/detail/endian.hpp create mode 100644 boost/detail/select_type.hpp delete mode 100644 boost/detail/sp_typeinfo.hpp delete mode 100644 boost/detail/winapi/time.hpp delete mode 100644 boost/detail/winapi/timers.hpp create mode 100644 boost/iterator/distance.hpp create mode 100644 boost/predef/architecture/ptx.h create mode 100644 boost/predef/compiler/nvcc.h delete mode 100644 boost/predef/detail/endian_compat.h create mode 100644 boost/predef/language/cuda.h create mode 100644 boost/predef/platform/android.h create mode 100644 boost/range/detail/less.hpp create mode 100644 boost/smart_ptr/detail/sp_typeinfo_.hpp create mode 100644 boost/system/detail/config.hpp delete mode 100644 boost/system/detail/error_code.ipp create mode 100644 boost/system/detail/generic_category.hpp delete mode 100644 boost/system/detail/local_free_on_destruction.hpp create mode 100644 boost/system/detail/std_interoperability.hpp create mode 100644 boost/system/detail/system_category_posix.hpp create mode 100644 boost/system/detail/system_category_win32.hpp create mode 100644 boost/type_traits/copy_cv_ref.hpp create mode 100644 boost/type_traits/copy_reference.hpp create mode 100644 boost/type_traits/detail/is_function_cxx_03.hpp create mode 100644 boost/type_traits/detail/is_function_cxx_11.hpp create mode 100644 boost/type_traits/detail/is_function_msvc10_fix.hpp create mode 100644 boost/type_traits/detail/is_member_function_pointer_cxx_03.hpp create mode 100644 boost/type_traits/detail/is_member_function_pointer_cxx_11.hpp create mode 100644 boost/type_traits/detail/is_rvalue_reference_msvc10_fix.hpp create mode 100644 boost/type_traits/enable_if.hpp create mode 100644 boost/type_traits/is_noncopyable.hpp delete mode 100644 boost/variant/detail/generic_result_type.hpp create mode 100644 boost/variant/detail/std_hash.hpp diff --git a/Readme.md b/Readme.md index 29bd113b..3c7ad16d 100644 --- a/Readme.md +++ b/Readme.md @@ -1,7 +1,7 @@ Boost libraries - trimmed down for Citra ======================================== -This is a subset of Boost v1.67.0 generated using the bcp tool. To get a list of boost modules guaranteed to exist, check the build script. +This is a subset of Boost v1.71.0 generated using the bcp tool. To get a list of boost modules guaranteed to exist, check the build script. Updating this repo (on Windows) =============================== diff --git a/boost/algorithm/string/finder.hpp b/boost/algorithm/string/finder.hpp index 93f7ec30..61f6e415 100644 --- a/boost/algorithm/string/finder.hpp +++ b/boost/algorithm/string/finder.hpp @@ -43,7 +43,6 @@ namespace boost { The result is given as an \c iterator_range delimiting the match. \param Search A substring to be searched for. - \param Comp An element comparison predicate \return An instance of the \c first_finder object */ template @@ -84,7 +83,6 @@ namespace boost { The result is given as an \c iterator_range delimiting the match. \param Search A substring to be searched for. - \param Comp An element comparison predicate \return An instance of the \c last_finder object */ template @@ -124,7 +122,6 @@ namespace boost { \param Search A substring to be searched for. \param Nth An index of the match to be find - \param Comp An element comparison predicate \return An instance of the \c nth_finder object */ template @@ -230,7 +227,6 @@ namespace boost { \param Begin Beginning of the range \param End End of the range - \param Range The range. \return An instance of the \c range_finger object */ template< typename ForwardIteratorT > diff --git a/boost/array.hpp b/boost/array.hpp index 210c0721..99dc2c6d 100644 --- a/boost/array.hpp +++ b/boost/array.hpp @@ -183,7 +183,7 @@ namespace boost { // check range (may be private because it is static) static BOOST_CONSTEXPR bool rangecheck (size_type i) { - return i > size() ? boost::throw_exception(std::out_of_range ("array<>: index out of range")), true : true; + return i >= size() ? boost::throw_exception(std::out_of_range ("array<>: index out of range")), true : true; } }; diff --git a/boost/asio.hpp b/boost/asio.hpp index 53841de1..1ee7e12f 100644 --- a/boost/asio.hpp +++ b/boost/asio.hpp @@ -2,7 +2,7 @@ // asio.hpp // ~~~~~~~~ // -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2019 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) @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include @@ -27,6 +28,7 @@ #include #include #include +#include #include #include #include @@ -42,13 +44,14 @@ #include #include #include +#include #include +#include #include #include -#include -#include #include #include +#include #include #include #include @@ -62,7 +65,6 @@ #include #include #include -#include #include #include #include @@ -75,6 +77,8 @@ #include #include #include +#include +#include #include #include #include @@ -86,7 +90,6 @@ #include #include #include -#include #include #include #include @@ -105,46 +108,38 @@ #include #include #include -#include #include -#include #include #include #include -#include +#include #include #include -#include #include -#include -#include #include #include #include -#include #include #include #include #include +#include #include #include +#include #include #include #include #include -#include -#include #include +#include #include #include #include -#include #include #include #include -#include #include -#include #include #include diff --git a/boost/asio/associated_allocator.hpp b/boost/asio/associated_allocator.hpp index bcf1eca3..c70852b5 100644 --- a/boost/asio/associated_allocator.hpp +++ b/boost/asio/associated_allocator.hpp @@ -2,7 +2,7 @@ // associated_allocator.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2019 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/boost/asio/associated_executor.hpp b/boost/asio/associated_executor.hpp index c31800f3..a44190b5 100644 --- a/boost/asio/associated_executor.hpp +++ b/boost/asio/associated_executor.hpp @@ -2,7 +2,7 @@ // associated_executor.hpp // ~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2019 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/boost/asio/async_result.hpp b/boost/asio/async_result.hpp index a2aafce1..4f3bb1ec 100644 --- a/boost/asio/async_result.hpp +++ b/boost/asio/async_result.hpp @@ -2,7 +2,7 @@ // async_result.hpp // ~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2019 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,7 +17,7 @@ #include #include -#include +#include #include @@ -42,30 +42,15 @@ namespace asio { * The primary template assumes that the CompletionToken is the completion * handler. */ -#if defined(BOOST_ASIO_NO_DEPRECATED) || defined(GENERATING_DOCUMENTATION) template -#else // defined(BOOST_ASIO_NO_DEPRECATED) || defined(GENERATING_DOCUMENTATION) -template -#endif // defined(BOOST_ASIO_NO_DEPRECATED) || defined(GENERATING_DOCUMENTATION) class async_result { public: -#if defined(BOOST_ASIO_NO_DEPRECATED) || defined(GENERATING_DOCUMENTATION) /// The concrete completion handler type for the specific signature. typedef CompletionToken completion_handler_type; /// The return type of the initiating function. typedef void return_type; -#else // defined(BOOST_ASIO_NO_DEPRECATED) || defined(GENERATING_DOCUMENTATION) - // For backward compatibility, determine the concrete completion handler type - // by using the legacy handler_type trait. - typedef typename handler_type::type - completion_handler_type; - - // For backward compatibility, determine the initiating function return type - // using the legacy single-parameter version of async_result. - typedef typename async_result::type return_type; -#endif // defined(BOOST_ASIO_NO_DEPRECATED) || defined(GENERATING_DOCUMENTATION) /// Construct an async result from a given handler. /** @@ -74,11 +59,6 @@ public: * then returned from the initiating function. */ explicit async_result(completion_handler_type& h) -#if defined(BOOST_ASIO_NO_DEPRECATED) || defined(GENERATING_DOCUMENTATION) - // No data members to initialise. -#else // defined(BOOST_ASIO_NO_DEPRECATED) || defined(GENERATING_DOCUMENTATION) - : legacy_result_(h) -#endif // defined(BOOST_ASIO_NO_DEPRECATED) || defined(GENERATING_DOCUMENTATION) { (void)h; } @@ -86,56 +66,60 @@ public: /// Obtain the value to be returned from the initiating function. return_type get() { -#if defined(BOOST_ASIO_NO_DEPRECATED) || defined(GENERATING_DOCUMENTATION) - // Nothing to do. -#else // defined(BOOST_ASIO_NO_DEPRECATED) || defined(GENERATING_DOCUMENTATION) - return legacy_result_.get(); -#endif // defined(BOOST_ASIO_NO_DEPRECATED) || defined(GENERATING_DOCUMENTATION) } +#if defined(BOOST_ASIO_HAS_VARIADIC_TEMPLATES) \ + || defined(GENERATING_DOCUMENTATION) + + /// Initiate the asynchronous operation that will produce the result, and + /// obtain the value to be returned from the initiating function. + template + static return_type initiate( + BOOST_ASIO_MOVE_ARG(Initiation) initiation, + BOOST_ASIO_MOVE_ARG(RawCompletionToken) token, + BOOST_ASIO_MOVE_ARG(Args)... args) + { + BOOST_ASIO_MOVE_CAST(Initiation)(initiation)( + BOOST_ASIO_MOVE_CAST(RawCompletionToken)(token), + BOOST_ASIO_MOVE_CAST(Args)(args)...); + } + +#else // defined(BOOST_ASIO_HAS_VARIADIC_TEMPLATES) + // || defined(GENERATING_DOCUMENTATION) + + template + static return_type initiate( + BOOST_ASIO_MOVE_ARG(Initiation) initiation, + BOOST_ASIO_MOVE_ARG(RawCompletionToken) token) + { + BOOST_ASIO_MOVE_CAST(Initiation)(initiation)( + BOOST_ASIO_MOVE_CAST(RawCompletionToken)(token)); + } + +#define BOOST_ASIO_PRIVATE_INITIATE_DEF(n) \ + template \ + static return_type initiate( \ + BOOST_ASIO_MOVE_ARG(Initiation) initiation, \ + BOOST_ASIO_MOVE_ARG(RawCompletionToken) token, \ + BOOST_ASIO_VARIADIC_MOVE_PARAMS(n)) \ + { \ + BOOST_ASIO_MOVE_CAST(Initiation)(initiation)( \ + BOOST_ASIO_MOVE_CAST(RawCompletionToken)(token), \ + BOOST_ASIO_VARIADIC_MOVE_ARGS(n)); \ + } \ + /**/ + BOOST_ASIO_VARIADIC_GENERATE(BOOST_ASIO_PRIVATE_INITIATE_DEF) +#undef BOOST_ASIO_PRIVATE_INITIATE_DEF + +#endif // defined(BOOST_ASIO_HAS_VARIADIC_TEMPLATES) + // || defined(GENERATING_DOCUMENTATION) + private: async_result(const async_result&) BOOST_ASIO_DELETED; async_result& operator=(const async_result&) BOOST_ASIO_DELETED; - -#if defined(BOOST_ASIO_NO_DEPRECATED) || defined(GENERATING_DOCUMENTATION) - // No data members. -#else // defined(BOOST_ASIO_NO_DEPRECATED) || defined(GENERATING_DOCUMENTATION) - async_result legacy_result_; -#endif // defined(BOOST_ASIO_NO_DEPRECATED) || defined(GENERATING_DOCUMENTATION) }; -#if !defined(BOOST_ASIO_NO_DEPRECATED) - -/// (Deprecated: Use two-parameter version of async_result.) An interface for -/// customising the behaviour of an initiating function. -/** - * This template may be specialised for user-defined handler types. - */ -template -class async_result -{ -public: - /// The return type of the initiating function. - typedef void type; - - /// Construct an async result from a given handler. - /** - * When using a specalised async_result, the constructor has an opportunity - * to initialise some state associated with the handler, which is then - * returned from the initiating function. - */ - explicit async_result(Handler&) - { - } - - /// Obtain the value to be returned from the initiating function. - type get() - { - } -}; - -#endif // !defined(BOOST_ASIO_NO_DEPRECATED) - /// 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. @@ -195,11 +179,40 @@ struct async_result_helper { }; -} // namespace detail -} // namespace asio -} // namespace boost +struct async_result_memfns_base +{ + void initiate(); +}; -#include +template +struct async_result_memfns_derived + : T, async_result_memfns_base +{ +}; + +template +struct async_result_memfns_check +{ +}; + +template +char (&async_result_initiate_memfn_helper(...))[2]; + +template +char async_result_initiate_memfn_helper( + async_result_memfns_check< + void (async_result_memfns_base::*)(), + &async_result_memfns_derived::initiate>*); + +template +struct async_result_has_initiate_memfn + : integral_constant::type, Signature> + >(0)) != 1> +{ +}; + +} // namespace detail #if defined(GENERATING_DOCUMENTATION) # define BOOST_ASIO_INITFN_RESULT_TYPE(ct, sig) \ @@ -220,4 +233,126 @@ struct async_result_helper typename ::boost::asio::decay::type, sig>::completion_handler_type #endif +#if defined(GENERATING_DOCUMENTATION) + +template +BOOST_ASIO_INITFN_RESULT_TYPE(CompletionToken, Signature) +async_initiate(BOOST_ASIO_MOVE_ARG(Initiation) initiation, + BOOST_ASIO_NONDEDUCED_MOVE_ARG(CompletionToken), + BOOST_ASIO_MOVE_ARG(Args)... args); + +#elif defined(BOOST_ASIO_HAS_VARIADIC_TEMPLATES) + +template +inline typename enable_if< + detail::async_result_has_initiate_memfn::value, + BOOST_ASIO_INITFN_RESULT_TYPE(CompletionToken, Signature)>::type +async_initiate(BOOST_ASIO_MOVE_ARG(Initiation) initiation, + BOOST_ASIO_NONDEDUCED_MOVE_ARG(CompletionToken) token, + BOOST_ASIO_MOVE_ARG(Args)... args) +{ + return async_result::type, + Signature>::initiate(BOOST_ASIO_MOVE_CAST(Initiation)(initiation), + BOOST_ASIO_MOVE_CAST(CompletionToken)(token), + BOOST_ASIO_MOVE_CAST(Args)(args)...); +} + +template +inline typename enable_if< + !detail::async_result_has_initiate_memfn::value, + BOOST_ASIO_INITFN_RESULT_TYPE(CompletionToken, Signature)>::type +async_initiate(BOOST_ASIO_MOVE_ARG(Initiation) initiation, + BOOST_ASIO_NONDEDUCED_MOVE_ARG(CompletionToken) token, + BOOST_ASIO_MOVE_ARG(Args)... args) +{ + async_completion completion(token); + + BOOST_ASIO_MOVE_CAST(Initiation)(initiation)( + BOOST_ASIO_MOVE_CAST(BOOST_ASIO_HANDLER_TYPE(CompletionToken, + Signature))(completion.completion_handler), + BOOST_ASIO_MOVE_CAST(Args)(args)...); + + return completion.result.get(); +} + +#else // defined(BOOST_ASIO_HAS_VARIADIC_TEMPLATES) + +template +inline typename enable_if< + detail::async_result_has_initiate_memfn::value, + BOOST_ASIO_INITFN_RESULT_TYPE(CompletionToken, Signature)>::type +async_initiate(BOOST_ASIO_MOVE_ARG(Initiation) initiation, + BOOST_ASIO_NONDEDUCED_MOVE_ARG(CompletionToken) token) +{ + return async_result::type, + Signature>::initiate(BOOST_ASIO_MOVE_CAST(Initiation)(initiation), + BOOST_ASIO_MOVE_CAST(CompletionToken)(token)); +} + +template +inline typename enable_if< + !detail::async_result_has_initiate_memfn::value, + BOOST_ASIO_INITFN_RESULT_TYPE(CompletionToken, Signature)>::type +async_initiate(BOOST_ASIO_MOVE_ARG(Initiation) initiation, + BOOST_ASIO_NONDEDUCED_MOVE_ARG(CompletionToken) token) +{ + async_completion completion(token); + + BOOST_ASIO_MOVE_CAST(Initiation)(initiation)( + BOOST_ASIO_MOVE_CAST(BOOST_ASIO_HANDLER_TYPE(CompletionToken, + Signature))(completion.completion_handler)); + + return completion.result.get(); +} + +#define BOOST_ASIO_PRIVATE_INITIATE_DEF(n) \ + template \ + inline typename enable_if< \ + detail::async_result_has_initiate_memfn< \ + CompletionToken, Signature>::value, \ + BOOST_ASIO_INITFN_RESULT_TYPE(CompletionToken, Signature)>::type \ + async_initiate(BOOST_ASIO_MOVE_ARG(Initiation) initiation, \ + BOOST_ASIO_NONDEDUCED_MOVE_ARG(CompletionToken) token, \ + BOOST_ASIO_VARIADIC_MOVE_PARAMS(n)) \ + { \ + return async_result::type, \ + Signature>::initiate(BOOST_ASIO_MOVE_CAST(Initiation)(initiation), \ + BOOST_ASIO_MOVE_CAST(CompletionToken)(token), \ + BOOST_ASIO_VARIADIC_MOVE_ARGS(n)); \ + } \ + \ + template \ + inline typename enable_if< \ + !detail::async_result_has_initiate_memfn< \ + CompletionToken, Signature>::value, \ + BOOST_ASIO_INITFN_RESULT_TYPE(CompletionToken, Signature)>::type \ + async_initiate(BOOST_ASIO_MOVE_ARG(Initiation) initiation, \ + BOOST_ASIO_NONDEDUCED_MOVE_ARG(CompletionToken) token, \ + BOOST_ASIO_VARIADIC_MOVE_PARAMS(n)) \ + { \ + async_completion completion(token); \ + \ + BOOST_ASIO_MOVE_CAST(Initiation)(initiation)( \ + BOOST_ASIO_MOVE_CAST(BOOST_ASIO_HANDLER_TYPE(CompletionToken, \ + Signature))(completion.completion_handler), \ + BOOST_ASIO_VARIADIC_MOVE_ARGS(n)); \ + \ + return completion.result.get(); \ + } \ + /**/ + BOOST_ASIO_VARIADIC_GENERATE(BOOST_ASIO_PRIVATE_INITIATE_DEF) +#undef BOOST_ASIO_PRIVATE_INITIATE_DEF + +#endif // defined(BOOST_ASIO_HAS_VARIADIC_TEMPLATES) + +} // namespace asio +} // namespace boost + +#include + #endif // BOOST_ASIO_ASYNC_RESULT_HPP diff --git a/boost/asio/awaitable.hpp b/boost/asio/awaitable.hpp new file mode 100644 index 00000000..83f8647c --- /dev/null +++ b/boost/asio/awaitable.hpp @@ -0,0 +1,125 @@ +// +// awaitable.hpp +// ~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2019 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef BOOST_ASIO_AWAITABLE_HPP +#define BOOST_ASIO_AWAITABLE_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include + +#if defined(BOOST_ASIO_HAS_CO_AWAIT) || defined(GENERATING_DOCUMENTATION) + +#include +#include + +#include + +namespace boost { +namespace asio { +namespace detail { + +using std::experimental::coroutine_handle; +using std::experimental::suspend_always; + +template class awaitable_thread; +template class awaitable_frame; + +} // namespace detail + +/// The return type of a coroutine or asynchronous operation. +template +class awaitable +{ +public: + /// The type of the awaited value. + typedef T value_type; + + /// The executor type that will be used for the coroutine. + typedef Executor executor_type; + + /// Default constructor. + constexpr awaitable() noexcept + : frame_(nullptr) + { + } + + /// Move constructor. + awaitable(awaitable&& other) noexcept + : frame_(std::exchange(other.frame_, nullptr)) + { + } + + /// Destructor + ~awaitable() + { + if (frame_) + frame_->destroy(); + } + + /// Checks if the awaitable refers to a future result. + bool valid() const noexcept + { + return !!frame_; + } + +#if !defined(GENERATING_DOCUMENTATION) + + // Support for co_await keyword. + bool await_ready() const noexcept + { + return false; + } + + // Support for co_await keyword. + template + void await_suspend( + detail::coroutine_handle> h) + { + frame_->push_frame(&h.promise()); + } + + // Support for co_await keyword. + T await_resume() + { + return frame_->get(); + } + +#endif // !defined(GENERATING_DOCUMENTATION) + +private: + template friend class detail::awaitable_thread; + template friend class detail::awaitable_frame; + + // Not copy constructible or copy assignable. + awaitable(const awaitable&) = delete; + awaitable& operator=(const awaitable&) = delete; + + // Construct the awaitable from a coroutine's frame object. + explicit awaitable(detail::awaitable_frame* a) + : frame_(a) + { + } + + detail::awaitable_frame* frame_; +}; + +} // namespace asio +} // namespace boost + +#include + +#include + +#endif // defined(BOOST_ASIO_HAS_CO_AWAIT) || defined(GENERATING_DOCUMENTATION) + +#endif // BOOST_ASIO_AWAITABLE_HPP diff --git a/boost/asio/basic_datagram_socket.hpp b/boost/asio/basic_datagram_socket.hpp index b512b75d..b058f78c 100644 --- a/boost/asio/basic_datagram_socket.hpp +++ b/boost/asio/basic_datagram_socket.hpp @@ -2,7 +2,7 @@ // basic_datagram_socket.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2019 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) @@ -19,19 +19,25 @@ #include #include #include +#include #include #include #include -#if defined(BOOST_ASIO_ENABLE_OLD_SERVICES) -# include -#endif // defined(BOOST_ASIO_ENABLE_OLD_SERVICES) - #include namespace boost { namespace asio { +#if !defined(BOOST_ASIO_BASIC_DATAGRAM_SOCKET_FWD_DECL) +#define BOOST_ASIO_BASIC_DATAGRAM_SOCKET_FWD_DECL + +// Forward declaration with defaulted arguments. +template +class basic_datagram_socket; + +#endif // !defined(BOOST_ASIO_BASIC_DATAGRAM_SOCKET_FWD_DECL) + /// Provides datagram-oriented socket functionality. /** * The basic_datagram_socket class template provides asynchronous and blocking @@ -41,18 +47,28 @@ namespace asio { * @e Distinct @e objects: Safe.@n * @e Shared @e objects: Unsafe. */ -template )> +template class basic_datagram_socket - : public basic_socket + : public basic_socket { public: + /// The type of the executor associated with the object. + typedef Executor executor_type; + + /// Rebinds the socket type to another executor. + template + struct rebind_executor + { + /// The socket type when rebound to the specified executor. + typedef basic_datagram_socket other; + }; + /// The native representation of a socket. #if defined(GENERATING_DOCUMENTATION) typedef implementation_defined native_handle_type; #else - typedef typename basic_socket< - Protocol BOOST_ASIO_SVC_TARG>::native_handle_type native_handle_type; + typedef typename basic_socket::native_handle_type native_handle_type; #endif /// The protocol type. @@ -66,12 +82,29 @@ public: * This constructor creates a datagram socket without opening it. The open() * function must be called before data can be sent or received on the socket. * - * @param io_context The io_context object that the datagram socket will use - * to dispatch handlers for any asynchronous operations performed on the - * socket. + * @param ex The I/O executor that the socket will use, by default, to + * dispatch handlers for any asynchronous operations performed on the socket. */ - explicit basic_datagram_socket(boost::asio::io_context& io_context) - : basic_socket(io_context) + explicit basic_datagram_socket(const executor_type& ex) + : basic_socket(ex) + { + } + + /// Construct a basic_datagram_socket without opening it. + /** + * This constructor creates a datagram socket without opening it. The open() + * function must be called before data can be sent or received on the socket. + * + * @param context An execution context which provides the I/O executor that + * the socket will use, by default, to dispatch handlers for any asynchronous + * operations performed on the socket. + */ + template + explicit basic_datagram_socket(ExecutionContext& context, + typename enable_if< + is_convertible::value + >::type* = 0) + : basic_socket(context) { } @@ -79,17 +112,37 @@ public: /** * This constructor creates and opens a datagram socket. * - * @param io_context The io_context object that the datagram socket will use - * to dispatch handlers for any asynchronous operations performed on the - * socket. + * @param ex The I/O executor that the socket will use, by default, to + * dispatch handlers for any asynchronous operations performed on the socket. * * @param protocol An object specifying protocol parameters to be used. * * @throws boost::system::system_error Thrown on failure. */ - basic_datagram_socket(boost::asio::io_context& io_context, - const protocol_type& protocol) - : basic_socket(io_context, protocol) + basic_datagram_socket(const executor_type& ex, const protocol_type& protocol) + : basic_socket(ex, protocol) + { + } + + /// Construct and open a basic_datagram_socket. + /** + * This constructor creates and opens a datagram socket. + * + * @param context An execution context which provides the I/O executor that + * the socket will use, by default, to dispatch handlers for any asynchronous + * operations performed on the socket. + * + * @param protocol An object specifying protocol parameters to be used. + * + * @throws boost::system::system_error Thrown on failure. + */ + template + basic_datagram_socket(ExecutionContext& context, + const protocol_type& protocol, + typename enable_if< + is_convertible::value + >::type* = 0) + : basic_socket(context, protocol) { } @@ -100,18 +153,42 @@ public: * to the specified endpoint on the local machine. The protocol used is the * protocol associated with the given endpoint. * - * @param io_context The io_context object that the datagram socket will use - * to dispatch handlers for any asynchronous operations performed on the - * socket. + * @param ex The I/O executor that the socket will use, by default, to + * dispatch handlers for any asynchronous operations performed on the socket. * * @param endpoint An endpoint on the local machine to which the datagram * socket will be bound. * * @throws boost::system::system_error Thrown on failure. */ - basic_datagram_socket(boost::asio::io_context& io_context, - const endpoint_type& endpoint) - : basic_socket(io_context, endpoint) + basic_datagram_socket(const executor_type& ex, const endpoint_type& endpoint) + : basic_socket(ex, endpoint) + { + } + + /// Construct a basic_datagram_socket, opening it and binding it to the given + /// local endpoint. + /** + * This constructor creates a datagram socket and automatically opens it bound + * to the specified endpoint on the local machine. The protocol used is the + * protocol associated with the given endpoint. + * + * @param context An execution context which provides the I/O executor that + * the socket will use, by default, to dispatch handlers for any asynchronous + * operations performed on the socket. + * + * @param endpoint An endpoint on the local machine to which the datagram + * socket will be bound. + * + * @throws boost::system::system_error Thrown on failure. + */ + template + basic_datagram_socket(ExecutionContext& context, + const endpoint_type& endpoint, + typename enable_if< + is_convertible::value + >::type* = 0) + : basic_socket(context, endpoint) { } @@ -120,9 +197,8 @@ public: * This constructor creates a datagram socket object to hold an existing * native socket. * - * @param io_context The io_context object that the datagram socket will use - * to dispatch handlers for any asynchronous operations performed on the - * socket. + * @param ex The I/O executor that the socket will use, by default, to + * dispatch handlers for any asynchronous operations performed on the socket. * * @param protocol An object specifying protocol parameters to be used. * @@ -130,10 +206,34 @@ public: * * @throws boost::system::system_error Thrown on failure. */ - basic_datagram_socket(boost::asio::io_context& io_context, + basic_datagram_socket(const executor_type& ex, const protocol_type& protocol, const native_handle_type& native_socket) - : basic_socket( - io_context, protocol, native_socket) + : basic_socket(ex, protocol, native_socket) + { + } + + /// Construct a basic_datagram_socket on an existing native socket. + /** + * This constructor creates a datagram socket object to hold an existing + * native socket. + * + * @param context An execution context which provides the I/O executor that + * the socket will use, by default, to dispatch handlers for any asynchronous + * operations performed on the socket. + * + * @param protocol An object specifying protocol parameters to be used. + * + * @param native_socket The new underlying socket implementation. + * + * @throws boost::system::system_error Thrown on failure. + */ + template + basic_datagram_socket(ExecutionContext& context, + const protocol_type& protocol, const native_handle_type& native_socket, + typename enable_if< + is_convertible::value + >::type* = 0) + : basic_socket(context, protocol, native_socket) { } @@ -146,10 +246,11 @@ public: * will occur. * * @note Following the move, the moved-from object is in the same state as if - * constructed using the @c basic_datagram_socket(io_context&) constructor. + * constructed using the @c basic_datagram_socket(const executor_type&) + * constructor. */ basic_datagram_socket(basic_datagram_socket&& other) - : basic_socket(std::move(other)) + : basic_socket(std::move(other)) { } @@ -162,11 +263,12 @@ public: * will occur. * * @note Following the move, the moved-from object is in the same state as if - * constructed using the @c basic_datagram_socket(io_context&) constructor. + * constructed using the @c basic_datagram_socket(const executor_type&) + * constructor. */ basic_datagram_socket& operator=(basic_datagram_socket&& other) { - basic_socket::operator=(std::move(other)); + basic_socket::operator=(std::move(other)); return *this; } @@ -179,13 +281,16 @@ public: * will occur. * * @note Following the move, the moved-from object is in the same state as if - * constructed using the @c basic_datagram_socket(io_context&) constructor. + * constructed using the @c basic_datagram_socket(const executor_type&) + * constructor. */ - template - basic_datagram_socket( - basic_datagram_socket&& other, - typename enable_if::value>::type* = 0) - : basic_socket(std::move(other)) + template + basic_datagram_socket(basic_datagram_socket&& other, + typename enable_if< + is_convertible::value + && is_convertible::value + >::type* = 0) + : basic_socket(std::move(other)) { } @@ -199,14 +304,17 @@ public: * will occur. * * @note Following the move, the moved-from object is in the same state as if - * constructed using the @c basic_datagram_socket(io_context&) constructor. + * constructed using the @c basic_datagram_socket(const executor_type&) + * constructor. */ - template - typename enable_if::value, - basic_datagram_socket>::type& operator=( - basic_datagram_socket&& other) + template + typename enable_if< + is_convertible::value + && is_convertible::value, + basic_datagram_socket& + >::type operator=(basic_datagram_socket&& other) { - basic_socket::operator=(std::move(other)); + basic_socket::operator=(std::move(other)); return *this; } #endif // defined(BOOST_ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) @@ -246,8 +354,8 @@ public: std::size_t send(const ConstBufferSequence& buffers) { boost::system::error_code ec; - std::size_t s = this->get_service().send( - this->get_implementation(), buffers, 0, ec); + std::size_t s = this->impl_.get_service().send( + this->impl_.get_implementation(), buffers, 0, ec); boost::asio::detail::throw_error(ec, "send"); return s; } @@ -274,8 +382,8 @@ public: socket_base::message_flags flags) { boost::system::error_code ec; - std::size_t s = this->get_service().send( - this->get_implementation(), buffers, flags, ec); + std::size_t s = this->impl_.get_service().send( + this->impl_.get_implementation(), buffers, flags, ec); boost::asio::detail::throw_error(ec, "send"); return s; } @@ -301,8 +409,8 @@ public: std::size_t send(const ConstBufferSequence& buffers, socket_base::message_flags flags, boost::system::error_code& ec) { - return this->get_service().send( - this->get_implementation(), buffers, flags, ec); + return this->impl_.get_service().send( + this->impl_.get_implementation(), buffers, flags, ec); } /// Start an asynchronous send on a connected socket. @@ -323,9 +431,9 @@ public: * std::size_t bytes_transferred // Number of bytes sent. * ); @endcode * Regardless of whether the asynchronous operation completes immediately or - * not, the handler will not be invoked from within this function. Invocation - * of the handler will be performed in a manner equivalent to using - * boost::asio::io_context::post(). + * not, the handler will not be invoked from within this function. On + * immediate completion, invocation of the handler will be performed in a + * manner equivalent to using boost::asio::post(). * * @note The async_send operation can only be used with a connected socket. * Use the async_send_to function to send data on an unconnected datagram @@ -346,22 +454,10 @@ public: async_send(const ConstBufferSequence& buffers, BOOST_ASIO_MOVE_ARG(WriteHandler) handler) { - // If you get an error on the following line it means that your handler does - // not meet the documented type requirements for a WriteHandler. - BOOST_ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check; - -#if defined(BOOST_ASIO_ENABLE_OLD_SERVICES) - return this->get_service().async_send(this->get_implementation(), - buffers, 0, BOOST_ASIO_MOVE_CAST(WriteHandler)(handler)); -#else // defined(BOOST_ASIO_ENABLE_OLD_SERVICES) - async_completion init(handler); - - this->get_service().async_send(this->get_implementation(), - buffers, 0, init.completion_handler); - - return init.result.get(); -#endif // defined(BOOST_ASIO_ENABLE_OLD_SERVICES) + return async_initiate( + initiate_async_send(), handler, this, + buffers, socket_base::message_flags(0)); } /// Start an asynchronous send on a connected socket. @@ -384,9 +480,9 @@ public: * std::size_t bytes_transferred // Number of bytes sent. * ); @endcode * Regardless of whether the asynchronous operation completes immediately or - * not, the handler will not be invoked from within this function. Invocation - * of the handler will be performed in a manner equivalent to using - * boost::asio::io_context::post(). + * not, the handler will not be invoked from within this function. On + * immediate completion, invocation of the handler will be performed in a + * manner equivalent to using boost::asio::post(). * * @note The async_send operation can only be used with a connected socket. * Use the async_send_to function to send data on an unconnected datagram @@ -399,22 +495,9 @@ public: socket_base::message_flags flags, BOOST_ASIO_MOVE_ARG(WriteHandler) handler) { - // If you get an error on the following line it means that your handler does - // not meet the documented type requirements for a WriteHandler. - BOOST_ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check; - -#if defined(BOOST_ASIO_ENABLE_OLD_SERVICES) - return this->get_service().async_send(this->get_implementation(), - buffers, flags, BOOST_ASIO_MOVE_CAST(WriteHandler)(handler)); -#else // defined(BOOST_ASIO_ENABLE_OLD_SERVICES) - async_completion init(handler); - - this->get_service().async_send(this->get_implementation(), - buffers, flags, init.completion_handler); - - return init.result.get(); -#endif // defined(BOOST_ASIO_ENABLE_OLD_SERVICES) + return async_initiate( + initiate_async_send(), handler, this, buffers, flags); } /// Send a datagram to the specified endpoint. @@ -447,8 +530,8 @@ public: const endpoint_type& destination) { boost::system::error_code ec; - std::size_t s = this->get_service().send_to( - this->get_implementation(), buffers, destination, 0, ec); + std::size_t s = this->impl_.get_service().send_to( + this->impl_.get_implementation(), buffers, destination, 0, ec); boost::asio::detail::throw_error(ec, "send_to"); return s; } @@ -474,8 +557,8 @@ public: const endpoint_type& destination, socket_base::message_flags flags) { boost::system::error_code ec; - std::size_t s = this->get_service().send_to( - this->get_implementation(), buffers, destination, flags, ec); + std::size_t s = this->impl_.get_service().send_to( + this->impl_.get_implementation(), buffers, destination, flags, ec); boost::asio::detail::throw_error(ec, "send_to"); return s; } @@ -501,7 +584,7 @@ public: const endpoint_type& destination, socket_base::message_flags flags, boost::system::error_code& ec) { - return this->get_service().send_to(this->get_implementation(), + return this->impl_.get_service().send_to(this->impl_.get_implementation(), buffers, destination, flags, ec); } @@ -526,9 +609,9 @@ public: * std::size_t bytes_transferred // Number of bytes sent. * ); @endcode * Regardless of whether the asynchronous operation completes immediately or - * not, the handler will not be invoked from within this function. Invocation - * of the handler will be performed in a manner equivalent to using - * boost::asio::io_context::post(). + * not, the handler will not be invoked from within this function. On + * immediate completion, invocation of the handler will be performed in a + * manner equivalent to using boost::asio::post(). * * @par Example * To send a single data buffer use the @ref buffer function as follows: @@ -549,24 +632,10 @@ public: const endpoint_type& destination, BOOST_ASIO_MOVE_ARG(WriteHandler) handler) { - // If you get an error on the following line it means that your handler does - // not meet the documented type requirements for a WriteHandler. - BOOST_ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check; - -#if defined(BOOST_ASIO_ENABLE_OLD_SERVICES) - return this->get_service().async_send_to( - this->get_implementation(), buffers, destination, 0, - BOOST_ASIO_MOVE_CAST(WriteHandler)(handler)); -#else // defined(BOOST_ASIO_ENABLE_OLD_SERVICES) - async_completion init(handler); - - this->get_service().async_send_to( - this->get_implementation(), buffers, destination, 0, - init.completion_handler); - - return init.result.get(); -#endif // defined(BOOST_ASIO_ENABLE_OLD_SERVICES) + return async_initiate( + initiate_async_send_to(), handler, this, buffers, + destination, socket_base::message_flags(0)); } /// Start an asynchronous send. @@ -592,9 +661,9 @@ public: * std::size_t bytes_transferred // Number of bytes sent. * ); @endcode * Regardless of whether the asynchronous operation completes immediately or - * not, the handler will not be invoked from within this function. Invocation - * of the handler will be performed in a manner equivalent to using - * boost::asio::io_context::post(). + * not, the handler will not be invoked from within this function. On + * immediate completion, invocation of the handler will be performed in a + * manner equivalent to using boost::asio::post(). */ template BOOST_ASIO_INITFN_RESULT_TYPE(WriteHandler, @@ -603,24 +672,9 @@ public: const endpoint_type& destination, socket_base::message_flags flags, BOOST_ASIO_MOVE_ARG(WriteHandler) handler) { - // If you get an error on the following line it means that your handler does - // not meet the documented type requirements for a WriteHandler. - BOOST_ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check; - -#if defined(BOOST_ASIO_ENABLE_OLD_SERVICES) - return this->get_service().async_send_to( - this->get_implementation(), buffers, destination, flags, - BOOST_ASIO_MOVE_CAST(WriteHandler)(handler)); -#else // defined(BOOST_ASIO_ENABLE_OLD_SERVICES) - async_completion init(handler); - - this->get_service().async_send_to( - this->get_implementation(), buffers, destination, flags, - init.completion_handler); - - return init.result.get(); -#endif // defined(BOOST_ASIO_ENABLE_OLD_SERVICES) + return async_initiate( + initiate_async_send_to(), handler, this, buffers, destination, flags); } /// Receive some data on a connected socket. @@ -651,8 +705,8 @@ public: std::size_t receive(const MutableBufferSequence& buffers) { boost::system::error_code ec; - std::size_t s = this->get_service().receive( - this->get_implementation(), buffers, 0, ec); + std::size_t s = this->impl_.get_service().receive( + this->impl_.get_implementation(), buffers, 0, ec); boost::asio::detail::throw_error(ec, "receive"); return s; } @@ -680,8 +734,8 @@ public: socket_base::message_flags flags) { boost::system::error_code ec; - std::size_t s = this->get_service().receive( - this->get_implementation(), buffers, flags, ec); + std::size_t s = this->impl_.get_service().receive( + this->impl_.get_implementation(), buffers, flags, ec); boost::asio::detail::throw_error(ec, "receive"); return s; } @@ -708,8 +762,8 @@ public: std::size_t receive(const MutableBufferSequence& buffers, socket_base::message_flags flags, boost::system::error_code& ec) { - return this->get_service().receive( - this->get_implementation(), buffers, flags, ec); + return this->impl_.get_service().receive( + this->impl_.get_implementation(), buffers, flags, ec); } /// Start an asynchronous receive on a connected socket. @@ -730,9 +784,9 @@ public: * std::size_t bytes_transferred // Number of bytes received. * ); @endcode * Regardless of whether the asynchronous operation completes immediately or - * not, the handler will not be invoked from within this function. Invocation - * of the handler will be performed in a manner equivalent to using - * boost::asio::io_context::post(). + * not, the handler will not be invoked from within this function. On + * immediate completion, invocation of the handler will be performed in a + * manner equivalent to using boost::asio::post(). * * @note The async_receive operation can only be used with a connected socket. * Use the async_receive_from function to receive data on an unconnected @@ -754,22 +808,10 @@ public: async_receive(const MutableBufferSequence& buffers, BOOST_ASIO_MOVE_ARG(ReadHandler) handler) { - // If you get an error on the following line it means that your handler does - // not meet the documented type requirements for a ReadHandler. - BOOST_ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check; - -#if defined(BOOST_ASIO_ENABLE_OLD_SERVICES) - return this->get_service().async_receive(this->get_implementation(), - buffers, 0, BOOST_ASIO_MOVE_CAST(ReadHandler)(handler)); -#else // defined(BOOST_ASIO_ENABLE_OLD_SERVICES) - async_completion init(handler); - - this->get_service().async_receive(this->get_implementation(), - buffers, 0, init.completion_handler); - - return init.result.get(); -#endif // defined(BOOST_ASIO_ENABLE_OLD_SERVICES) + return async_initiate( + initiate_async_receive(), handler, this, + buffers, socket_base::message_flags(0)); } /// Start an asynchronous receive on a connected socket. @@ -792,9 +834,9 @@ public: * std::size_t bytes_transferred // Number of bytes received. * ); @endcode * Regardless of whether the asynchronous operation completes immediately or - * not, the handler will not be invoked from within this function. Invocation - * of the handler will be performed in a manner equivalent to using - * boost::asio::io_context::post(). + * not, the handler will not be invoked from within this function. On + * immediate completion, invocation of the handler will be performed in a + * manner equivalent to using boost::asio::post(). * * @note The async_receive operation can only be used with a connected socket. * Use the async_receive_from function to receive data on an unconnected @@ -807,22 +849,9 @@ public: socket_base::message_flags flags, BOOST_ASIO_MOVE_ARG(ReadHandler) handler) { - // If you get an error on the following line it means that your handler does - // not meet the documented type requirements for a ReadHandler. - BOOST_ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check; - -#if defined(BOOST_ASIO_ENABLE_OLD_SERVICES) - return this->get_service().async_receive(this->get_implementation(), - buffers, flags, BOOST_ASIO_MOVE_CAST(ReadHandler)(handler)); -#else // defined(BOOST_ASIO_ENABLE_OLD_SERVICES) - async_completion init(handler); - - this->get_service().async_receive(this->get_implementation(), - buffers, flags, init.completion_handler); - - return init.result.get(); -#endif // defined(BOOST_ASIO_ENABLE_OLD_SERVICES) + return async_initiate( + initiate_async_receive(), handler, this, buffers, flags); } /// Receive a datagram with the endpoint of the sender. @@ -856,8 +885,8 @@ public: endpoint_type& sender_endpoint) { boost::system::error_code ec; - std::size_t s = this->get_service().receive_from( - this->get_implementation(), buffers, sender_endpoint, 0, ec); + std::size_t s = this->impl_.get_service().receive_from( + this->impl_.get_implementation(), buffers, sender_endpoint, 0, ec); boost::asio::detail::throw_error(ec, "receive_from"); return s; } @@ -883,8 +912,8 @@ public: endpoint_type& sender_endpoint, socket_base::message_flags flags) { boost::system::error_code ec; - std::size_t s = this->get_service().receive_from( - this->get_implementation(), buffers, sender_endpoint, flags, ec); + std::size_t s = this->impl_.get_service().receive_from( + this->impl_.get_implementation(), buffers, sender_endpoint, flags, ec); boost::asio::detail::throw_error(ec, "receive_from"); return s; } @@ -910,8 +939,8 @@ public: endpoint_type& sender_endpoint, socket_base::message_flags flags, boost::system::error_code& ec) { - return this->get_service().receive_from(this->get_implementation(), - buffers, sender_endpoint, flags, ec); + return this->impl_.get_service().receive_from( + this->impl_.get_implementation(), buffers, sender_endpoint, flags, ec); } /// Start an asynchronous receive. @@ -937,9 +966,9 @@ public: * std::size_t bytes_transferred // Number of bytes received. * ); @endcode * Regardless of whether the asynchronous operation completes immediately or - * not, the handler will not be invoked from within this function. Invocation - * of the handler will be performed in a manner equivalent to using - * boost::asio::io_context::post(). + * not, the handler will not be invoked from within this function. On + * immediate completion, invocation of the handler will be performed in a + * manner equivalent to using boost::asio::post(). * * @par Example * To receive into a single data buffer use the @ref buffer function as @@ -957,24 +986,10 @@ public: endpoint_type& sender_endpoint, BOOST_ASIO_MOVE_ARG(ReadHandler) handler) { - // If you get an error on the following line it means that your handler does - // not meet the documented type requirements for a ReadHandler. - BOOST_ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check; - -#if defined(BOOST_ASIO_ENABLE_OLD_SERVICES) - return this->get_service().async_receive_from( - this->get_implementation(), buffers, sender_endpoint, 0, - BOOST_ASIO_MOVE_CAST(ReadHandler)(handler)); -#else // defined(BOOST_ASIO_ENABLE_OLD_SERVICES) - async_completion init(handler); - - this->get_service().async_receive_from( - this->get_implementation(), buffers, sender_endpoint, 0, - init.completion_handler); - - return init.result.get(); -#endif // defined(BOOST_ASIO_ENABLE_OLD_SERVICES) + return async_initiate( + initiate_async_receive_from(), handler, this, buffers, + &sender_endpoint, socket_base::message_flags(0)); } /// Start an asynchronous receive. @@ -1002,9 +1017,9 @@ public: * std::size_t bytes_transferred // Number of bytes received. * ); @endcode * Regardless of whether the asynchronous operation completes immediately or - * not, the handler will not be invoked from within this function. Invocation - * of the handler will be performed in a manner equivalent to using - * boost::asio::io_context::post(). + * not, the handler will not be invoked from within this function. On + * immediate completion, invocation of the handler will be performed in a + * manner equivalent to using boost::asio::post(). */ template BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler, @@ -1013,25 +1028,85 @@ public: endpoint_type& sender_endpoint, socket_base::message_flags flags, BOOST_ASIO_MOVE_ARG(ReadHandler) handler) { - // If you get an error on the following line it means that your handler does - // not meet the documented type requirements for a ReadHandler. - BOOST_ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check; - -#if defined(BOOST_ASIO_ENABLE_OLD_SERVICES) - return this->get_service().async_receive_from( - this->get_implementation(), buffers, sender_endpoint, flags, - BOOST_ASIO_MOVE_CAST(ReadHandler)(handler)); -#else // defined(BOOST_ASIO_ENABLE_OLD_SERVICES) - async_completion init(handler); - - this->get_service().async_receive_from( - this->get_implementation(), buffers, sender_endpoint, flags, - init.completion_handler); - - return init.result.get(); -#endif // defined(BOOST_ASIO_ENABLE_OLD_SERVICES) + return async_initiate( + initiate_async_receive_from(), handler, + this, buffers, &sender_endpoint, flags); } + +private: + struct initiate_async_send + { + template + void operator()(BOOST_ASIO_MOVE_ARG(WriteHandler) handler, + basic_datagram_socket* self, const ConstBufferSequence& buffers, + socket_base::message_flags flags) const + { + // If you get an error on the following line it means that your handler + // does not meet the documented type requirements for a WriteHandler. + BOOST_ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check; + + detail::non_const_lvalue handler2(handler); + self->impl_.get_service().async_send( + self->impl_.get_implementation(), buffers, flags, + handler2.value, self->impl_.get_implementation_executor()); + } + }; + + struct initiate_async_send_to + { + template + void operator()(BOOST_ASIO_MOVE_ARG(WriteHandler) handler, + basic_datagram_socket* self, const ConstBufferSequence& buffers, + const endpoint_type& destination, + socket_base::message_flags flags) const + { + // If you get an error on the following line it means that your handler + // does not meet the documented type requirements for a WriteHandler. + BOOST_ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check; + + detail::non_const_lvalue handler2(handler); + self->impl_.get_service().async_send_to( + self->impl_.get_implementation(), buffers, destination, flags, + handler2.value, self->impl_.get_implementation_executor()); + } + }; + + struct initiate_async_receive + { + template + void operator()(BOOST_ASIO_MOVE_ARG(ReadHandler) handler, + basic_datagram_socket* self, const MutableBufferSequence& buffers, + socket_base::message_flags flags) const + { + // If you get an error on the following line it means that your handler + // does not meet the documented type requirements for a ReadHandler. + BOOST_ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check; + + detail::non_const_lvalue handler2(handler); + self->impl_.get_service().async_receive( + self->impl_.get_implementation(), buffers, flags, + handler2.value, self->impl_.get_implementation_executor()); + } + }; + + struct initiate_async_receive_from + { + template + void operator()(BOOST_ASIO_MOVE_ARG(ReadHandler) handler, + basic_datagram_socket* self, const MutableBufferSequence& buffers, + endpoint_type* sender_endpoint, socket_base::message_flags flags) const + { + // If you get an error on the following line it means that your handler + // does not meet the documented type requirements for a ReadHandler. + BOOST_ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check; + + detail::non_const_lvalue handler2(handler); + self->impl_.get_service().async_receive_from( + self->impl_.get_implementation(), buffers, *sender_endpoint, flags, + handler2.value, self->impl_.get_implementation_executor()); + } + }; }; } // namespace asio diff --git a/boost/asio/basic_deadline_timer.hpp b/boost/asio/basic_deadline_timer.hpp index 56a265bf..75f0fcd8 100644 --- a/boost/asio/basic_deadline_timer.hpp +++ b/boost/asio/basic_deadline_timer.hpp @@ -2,7 +2,7 @@ // basic_deadline_timer.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2019 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,19 +21,16 @@ || defined(GENERATING_DOCUMENTATION) #include -#include +#include #include +#include +#include #include #include +#include +#include #include -#if defined(BOOST_ASIO_ENABLE_OLD_SERVICES) -# include -#else // defined(BOOST_ASIO_ENABLE_OLD_SERVICES) -# include -# define BOOST_ASIO_SVC_T detail::deadline_timer_service -#endif // defined(BOOST_ASIO_ENABLE_OLD_SERVICES) - #include namespace boost { @@ -58,7 +55,7 @@ namespace asio { * Performing a blocking wait: * @code * // Construct a timer without setting an expiry time. - * boost::asio::deadline_timer timer(io_context); + * boost::asio::deadline_timer timer(my_context); * * // Set an expiry time relative to now. * timer.expires_from_now(boost::posix_time::seconds(5)); @@ -81,7 +78,7 @@ namespace asio { * ... * * // Construct a timer with an absolute expiry time. - * boost::asio::deadline_timer timer(io_context, + * boost::asio::deadline_timer timer(my_context, * boost::posix_time::time_from_string("2005-12-07 23:59:59.000")); * * // Start an asynchronous wait. @@ -128,14 +125,13 @@ namespace asio { * it contains the value boost::asio::error::operation_aborted. */ template - BOOST_ASIO_SVC_TPARAM_DEF2(= deadline_timer_service)> + typename TimeTraits = boost::asio::time_traits