passenger 6.0.16 → 6.0.17

Sign up to get free protection for your applications and to get access to all the features.
Files changed (286) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG +22 -1
  3. data/build/integration_tests.rb +6 -6
  4. data/build/ruby_tests.rb +1 -1
  5. data/build/test_basics.rb +0 -1
  6. data/src/agent/Core/Config.h +1 -1
  7. data/src/agent/Core/Controller/Config.h +1 -1
  8. data/src/agent/Core/SpawningKit/PipeWatcher.h +18 -3
  9. data/src/agent/Watchdog/Config.h +1 -1
  10. data/src/cxx_supportlib/Constants.h +1 -1
  11. data/src/cxx_supportlib/vendor-modified/boost/align/aligned_alloc.hpp +1 -1
  12. data/src/cxx_supportlib/vendor-modified/boost/array.hpp +1 -1
  13. data/src/cxx_supportlib/vendor-modified/boost/asio/any_completion_executor.hpp +344 -0
  14. data/src/cxx_supportlib/vendor-modified/boost/asio/any_completion_handler.hpp +686 -0
  15. data/src/cxx_supportlib/vendor-modified/boost/asio/any_io_executor.hpp +56 -0
  16. data/src/cxx_supportlib/vendor-modified/boost/asio/associated_allocator.hpp +81 -25
  17. data/src/cxx_supportlib/vendor-modified/boost/asio/associated_cancellation_slot.hpp +68 -8
  18. data/src/cxx_supportlib/vendor-modified/boost/asio/associated_executor.hpp +46 -11
  19. data/src/cxx_supportlib/vendor-modified/boost/asio/basic_datagram_socket.hpp +4 -4
  20. data/src/cxx_supportlib/vendor-modified/boost/asio/basic_deadline_timer.hpp +2 -2
  21. data/src/cxx_supportlib/vendor-modified/boost/asio/basic_file.hpp +1 -1
  22. data/src/cxx_supportlib/vendor-modified/boost/asio/basic_random_access_file.hpp +2 -2
  23. data/src/cxx_supportlib/vendor-modified/boost/asio/basic_raw_socket.hpp +4 -4
  24. data/src/cxx_supportlib/vendor-modified/boost/asio/basic_readable_pipe.hpp +2 -2
  25. data/src/cxx_supportlib/vendor-modified/boost/asio/basic_seq_packet_socket.hpp +2 -2
  26. data/src/cxx_supportlib/vendor-modified/boost/asio/basic_serial_port.hpp +3 -3
  27. data/src/cxx_supportlib/vendor-modified/boost/asio/basic_signal_set.hpp +2 -2
  28. data/src/cxx_supportlib/vendor-modified/boost/asio/basic_socket.hpp +3 -3
  29. data/src/cxx_supportlib/vendor-modified/boost/asio/basic_socket_acceptor.hpp +4 -4
  30. data/src/cxx_supportlib/vendor-modified/boost/asio/basic_stream_file.hpp +2 -2
  31. data/src/cxx_supportlib/vendor-modified/boost/asio/basic_stream_socket.hpp +2 -2
  32. data/src/cxx_supportlib/vendor-modified/boost/asio/basic_waitable_timer.hpp +2 -2
  33. data/src/cxx_supportlib/vendor-modified/boost/asio/basic_writable_pipe.hpp +2 -2
  34. data/src/cxx_supportlib/vendor-modified/boost/asio/bind_allocator.hpp +13 -3
  35. data/src/cxx_supportlib/vendor-modified/boost/asio/bind_cancellation_slot.hpp +14 -3
  36. data/src/cxx_supportlib/vendor-modified/boost/asio/bind_executor.hpp +13 -3
  37. data/src/cxx_supportlib/vendor-modified/boost/asio/compose.hpp +30 -305
  38. data/src/cxx_supportlib/vendor-modified/boost/asio/consign.hpp +90 -0
  39. data/src/cxx_supportlib/vendor-modified/boost/asio/defer.hpp +17 -18
  40. data/src/cxx_supportlib/vendor-modified/boost/asio/detail/bind_handler.hpp +98 -24
  41. data/src/cxx_supportlib/vendor-modified/boost/asio/detail/composed_work.hpp +330 -0
  42. data/src/cxx_supportlib/vendor-modified/boost/asio/detail/config.hpp +81 -15
  43. data/src/cxx_supportlib/vendor-modified/boost/asio/detail/handler_alloc_helpers.hpp +4 -4
  44. data/src/cxx_supportlib/vendor-modified/boost/asio/detail/handler_work.hpp +19 -11
  45. data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/descriptor_ops.ipp +37 -0
  46. data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/handler_tracking.ipp +3 -1
  47. data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/select_reactor.ipp +1 -1
  48. data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/socket_ops.ipp +10 -2
  49. data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/strand_executor_service.hpp +14 -1
  50. data/src/cxx_supportlib/vendor-modified/boost/asio/detail/memory.hpp +18 -0
  51. data/src/cxx_supportlib/vendor-modified/boost/asio/detail/utility.hpp +1 -2
  52. data/src/cxx_supportlib/vendor-modified/boost/asio/detail/work_dispatcher.hpp +7 -3
  53. data/src/cxx_supportlib/vendor-modified/boost/asio/dispatch.hpp +4 -14
  54. data/src/cxx_supportlib/vendor-modified/boost/asio/execution/allocator.hpp +22 -3
  55. data/src/cxx_supportlib/vendor-modified/boost/asio/execution/any_executor.hpp +447 -142
  56. data/src/cxx_supportlib/vendor-modified/boost/asio/execution/blocking.hpp +57 -8
  57. data/src/cxx_supportlib/vendor-modified/boost/asio/execution/blocking_adaptation.hpp +51 -6
  58. data/src/cxx_supportlib/vendor-modified/boost/asio/execution/bulk_execute.hpp +5 -0
  59. data/src/cxx_supportlib/vendor-modified/boost/asio/execution/bulk_guarantee.hpp +41 -4
  60. data/src/cxx_supportlib/vendor-modified/boost/asio/execution/connect.hpp +5 -0
  61. data/src/cxx_supportlib/vendor-modified/boost/asio/execution/context.hpp +13 -2
  62. data/src/cxx_supportlib/vendor-modified/boost/asio/execution/context_as.hpp +13 -2
  63. data/src/cxx_supportlib/vendor-modified/boost/asio/execution/detail/as_operation.hpp +4 -0
  64. data/src/cxx_supportlib/vendor-modified/boost/asio/execution/execute.hpp +9 -2
  65. data/src/cxx_supportlib/vendor-modified/boost/asio/execution/executor.hpp +11 -1
  66. data/src/cxx_supportlib/vendor-modified/boost/asio/execution/mapping.hpp +52 -8
  67. data/src/cxx_supportlib/vendor-modified/boost/asio/execution/occupancy.hpp +13 -2
  68. data/src/cxx_supportlib/vendor-modified/boost/asio/execution/operation_state.hpp +5 -0
  69. data/src/cxx_supportlib/vendor-modified/boost/asio/execution/outstanding_work.hpp +39 -6
  70. data/src/cxx_supportlib/vendor-modified/boost/asio/execution/receiver.hpp +5 -0
  71. data/src/cxx_supportlib/vendor-modified/boost/asio/execution/relationship.hpp +39 -6
  72. data/src/cxx_supportlib/vendor-modified/boost/asio/execution/schedule.hpp +5 -0
  73. data/src/cxx_supportlib/vendor-modified/boost/asio/execution/scheduler.hpp +5 -0
  74. data/src/cxx_supportlib/vendor-modified/boost/asio/execution/sender.hpp +5 -0
  75. data/src/cxx_supportlib/vendor-modified/boost/asio/execution/set_done.hpp +5 -0
  76. data/src/cxx_supportlib/vendor-modified/boost/asio/execution/set_error.hpp +5 -0
  77. data/src/cxx_supportlib/vendor-modified/boost/asio/execution/set_value.hpp +5 -0
  78. data/src/cxx_supportlib/vendor-modified/boost/asio/execution/start.hpp +5 -0
  79. data/src/cxx_supportlib/vendor-modified/boost/asio/execution/submit.hpp +5 -0
  80. data/src/cxx_supportlib/vendor-modified/boost/asio/executor_work_guard.hpp +6 -9
  81. data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/basic_channel.hpp +3 -3
  82. data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/basic_concurrent_channel.hpp +3 -3
  83. data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/channel_traits.hpp +70 -0
  84. data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/co_composed.hpp +146 -0
  85. data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/coro.hpp +35 -5
  86. data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/detail/channel_handler.hpp +13 -3
  87. data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/detail/channel_operation.hpp +7 -0
  88. data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/detail/channel_service.hpp +180 -0
  89. data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/detail/coro_completion_handler.hpp +171 -0
  90. data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/detail/coro_promise_allocator.hpp +89 -66
  91. data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/detail/partial_promise.hpp +66 -45
  92. data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/impl/as_single.hpp +13 -3
  93. data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/impl/co_composed.hpp +1134 -0
  94. data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/impl/coro.hpp +130 -106
  95. data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/impl/parallel_group.hpp +377 -3
  96. data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/impl/promise.hpp +168 -29
  97. data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/impl/use_coro.hpp +149 -203
  98. data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/impl/use_promise.hpp +68 -0
  99. data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/parallel_group.hpp +256 -0
  100. data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/promise.hpp +76 -80
  101. data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/use_coro.hpp +40 -14
  102. data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/use_promise.hpp +113 -0
  103. data/src/cxx_supportlib/vendor-modified/boost/asio/impl/any_completion_executor.ipp +132 -0
  104. data/src/cxx_supportlib/vendor-modified/boost/asio/impl/any_io_executor.ipp +12 -0
  105. data/src/cxx_supportlib/vendor-modified/boost/asio/impl/append.hpp +12 -3
  106. data/src/cxx_supportlib/vendor-modified/boost/asio/impl/as_tuple.hpp +12 -3
  107. data/src/cxx_supportlib/vendor-modified/boost/asio/impl/buffered_read_stream.hpp +25 -6
  108. data/src/cxx_supportlib/vendor-modified/boost/asio/impl/buffered_write_stream.hpp +25 -6
  109. data/src/cxx_supportlib/vendor-modified/boost/asio/impl/co_spawn.hpp +34 -45
  110. data/src/cxx_supportlib/vendor-modified/boost/asio/impl/connect.hpp +28 -6
  111. data/src/cxx_supportlib/vendor-modified/boost/asio/impl/consign.hpp +204 -0
  112. data/src/cxx_supportlib/vendor-modified/boost/asio/impl/defer.hpp +33 -1
  113. data/src/cxx_supportlib/vendor-modified/boost/asio/impl/deferred.hpp +13 -3
  114. data/src/cxx_supportlib/vendor-modified/boost/asio/impl/dispatch.hpp +21 -9
  115. data/src/cxx_supportlib/vendor-modified/boost/asio/impl/handler_alloc_hook.ipp +1 -1
  116. data/src/cxx_supportlib/vendor-modified/boost/asio/impl/post.hpp +33 -1
  117. data/src/cxx_supportlib/vendor-modified/boost/asio/impl/prepend.hpp +12 -3
  118. data/src/cxx_supportlib/vendor-modified/boost/asio/impl/read.hpp +40 -9
  119. data/src/cxx_supportlib/vendor-modified/boost/asio/impl/read_at.hpp +27 -6
  120. data/src/cxx_supportlib/vendor-modified/boost/asio/impl/read_until.hpp +104 -24
  121. data/src/cxx_supportlib/vendor-modified/boost/asio/impl/redirect_error.hpp +12 -3
  122. data/src/cxx_supportlib/vendor-modified/boost/asio/impl/spawn.hpp +70 -15
  123. data/src/cxx_supportlib/vendor-modified/boost/asio/impl/src.hpp +1 -0
  124. data/src/cxx_supportlib/vendor-modified/boost/asio/impl/use_future.hpp +25 -0
  125. data/src/cxx_supportlib/vendor-modified/boost/asio/impl/write.hpp +38 -30
  126. data/src/cxx_supportlib/vendor-modified/boost/asio/impl/write_at.hpp +27 -6
  127. data/src/cxx_supportlib/vendor-modified/boost/asio/io_context.hpp +0 -13
  128. data/src/cxx_supportlib/vendor-modified/boost/asio/ip/impl/network_v4.ipp +3 -1
  129. data/src/cxx_supportlib/vendor-modified/boost/asio/ip/impl/network_v6.ipp +3 -1
  130. data/src/cxx_supportlib/vendor-modified/boost/asio/posix/basic_descriptor.hpp +2 -2
  131. data/src/cxx_supportlib/vendor-modified/boost/asio/posix/basic_stream_descriptor.hpp +2 -2
  132. data/src/cxx_supportlib/vendor-modified/boost/asio/post.hpp +17 -18
  133. data/src/cxx_supportlib/vendor-modified/boost/asio/spawn.hpp +3 -1
  134. data/src/cxx_supportlib/vendor-modified/boost/asio/ssl/detail/io.hpp +13 -3
  135. data/src/cxx_supportlib/vendor-modified/boost/asio/strand.hpp +11 -7
  136. data/src/cxx_supportlib/vendor-modified/boost/asio/system_executor.hpp +0 -13
  137. data/src/cxx_supportlib/vendor-modified/boost/asio/thread_pool.hpp +23 -18
  138. data/src/cxx_supportlib/vendor-modified/boost/asio/version.hpp +1 -1
  139. data/src/cxx_supportlib/vendor-modified/boost/asio/windows/basic_object_handle.hpp +2 -2
  140. data/src/cxx_supportlib/vendor-modified/boost/asio/windows/basic_overlapped_handle.hpp +1 -1
  141. data/src/cxx_supportlib/vendor-modified/boost/asio/windows/basic_random_access_handle.hpp +2 -2
  142. data/src/cxx_supportlib/vendor-modified/boost/asio/windows/basic_stream_handle.hpp +2 -2
  143. data/src/cxx_supportlib/vendor-modified/boost/asio.hpp +4 -0
  144. data/src/cxx_supportlib/vendor-modified/boost/bind/bind.hpp +1 -1
  145. data/src/cxx_supportlib/vendor-modified/boost/chrono/config.hpp +1 -0
  146. data/src/cxx_supportlib/vendor-modified/boost/chrono/detail/inlined/mac/chrono.hpp +4 -4
  147. data/src/cxx_supportlib/vendor-modified/boost/chrono/detail/scan_keyword.hpp +4 -2
  148. data/src/cxx_supportlib/vendor-modified/boost/chrono/duration.hpp +2 -2
  149. data/src/cxx_supportlib/vendor-modified/boost/chrono/io/duration_io.hpp +3 -3
  150. data/src/cxx_supportlib/vendor-modified/boost/chrono/io/duration_put.hpp +5 -5
  151. data/src/cxx_supportlib/vendor-modified/boost/chrono/io/duration_units.hpp +2 -2
  152. data/src/cxx_supportlib/vendor-modified/boost/chrono/io/time_point_io.hpp +2 -2
  153. data/src/cxx_supportlib/vendor-modified/boost/chrono/io/utility/ios_base_state_ptr.hpp +7 -7
  154. data/src/cxx_supportlib/vendor-modified/boost/chrono/time_point.hpp +1 -1
  155. data/src/cxx_supportlib/vendor-modified/boost/circular_buffer/details.hpp +5 -1
  156. data/src/cxx_supportlib/vendor-modified/boost/config/compiler/clang.hpp +10 -3
  157. data/src/cxx_supportlib/vendor-modified/boost/config/compiler/clang_version.hpp +9 -3
  158. data/src/cxx_supportlib/vendor-modified/boost/config/compiler/gcc.hpp +9 -3
  159. data/src/cxx_supportlib/vendor-modified/boost/config/compiler/sunpro_cc.hpp +6 -0
  160. data/src/cxx_supportlib/vendor-modified/boost/config/compiler/visualc.hpp +8 -0
  161. data/src/cxx_supportlib/vendor-modified/boost/config/compiler/xlcpp.hpp +4 -0
  162. data/src/cxx_supportlib/vendor-modified/boost/config/detail/suffix.hpp +33 -0
  163. data/src/cxx_supportlib/vendor-modified/boost/config/header_deprecated.hpp +1 -1
  164. data/src/cxx_supportlib/vendor-modified/boost/config/stdlib/libcpp.hpp +9 -0
  165. data/src/cxx_supportlib/vendor-modified/boost/config/stdlib/libstdcpp3.hpp +4 -2
  166. data/src/cxx_supportlib/vendor-modified/boost/container/allocator.hpp +1 -1
  167. data/src/cxx_supportlib/vendor-modified/boost/container/container_fwd.hpp +29 -0
  168. data/src/cxx_supportlib/vendor-modified/boost/container/deque.hpp +13 -13
  169. data/src/cxx_supportlib/vendor-modified/boost/container/detail/advanced_insert_int.hpp +80 -95
  170. data/src/cxx_supportlib/vendor-modified/boost/container/detail/config_begin.hpp +10 -0
  171. data/src/cxx_supportlib/vendor-modified/boost/container/detail/config_end.hpp +3 -0
  172. data/src/cxx_supportlib/vendor-modified/boost/container/detail/copy_move_algo.hpp +738 -34
  173. data/src/cxx_supportlib/vendor-modified/boost/container/detail/destroyers.hpp +38 -10
  174. data/src/cxx_supportlib/vendor-modified/boost/container/detail/flat_tree.hpp +1 -0
  175. data/src/cxx_supportlib/vendor-modified/boost/container/detail/iterator.hpp +2 -0
  176. data/src/cxx_supportlib/vendor-modified/boost/container/detail/workaround.hpp +3 -4
  177. data/src/cxx_supportlib/vendor-modified/boost/container/devector.hpp +1150 -1213
  178. data/src/cxx_supportlib/vendor-modified/boost/container/node_allocator.hpp +1 -1
  179. data/src/cxx_supportlib/vendor-modified/boost/container/options.hpp +104 -12
  180. data/src/cxx_supportlib/vendor-modified/boost/container/stable_vector.hpp +1 -0
  181. data/src/cxx_supportlib/vendor-modified/boost/container/string.hpp +11 -1
  182. data/src/cxx_supportlib/vendor-modified/boost/container/vector.hpp +31 -331
  183. data/src/cxx_supportlib/vendor-modified/boost/container_hash/detail/hash_mix.hpp +113 -0
  184. data/src/cxx_supportlib/vendor-modified/boost/container_hash/detail/hash_range.hpp +173 -0
  185. data/src/cxx_supportlib/vendor-modified/boost/container_hash/detail/hash_tuple.hpp +133 -0
  186. data/src/cxx_supportlib/vendor-modified/boost/container_hash/hash.hpp +461 -566
  187. data/src/cxx_supportlib/vendor-modified/boost/container_hash/hash_fwd.hpp +24 -24
  188. data/src/cxx_supportlib/vendor-modified/boost/container_hash/is_contiguous_range.hpp +91 -0
  189. data/src/cxx_supportlib/vendor-modified/boost/container_hash/is_described_class.hpp +38 -0
  190. data/src/cxx_supportlib/vendor-modified/boost/container_hash/is_range.hpp +73 -0
  191. data/src/cxx_supportlib/vendor-modified/boost/container_hash/is_unordered_range.hpp +39 -0
  192. data/src/cxx_supportlib/vendor-modified/boost/core/bit.hpp +32 -4
  193. data/src/cxx_supportlib/vendor-modified/boost/core/detail/string_view.hpp +16 -0
  194. data/src/cxx_supportlib/vendor-modified/boost/core/empty_value.hpp +16 -16
  195. data/src/cxx_supportlib/vendor-modified/boost/core/fclose_deleter.hpp +46 -0
  196. data/src/cxx_supportlib/vendor-modified/boost/date_time/date.hpp +1 -1
  197. data/src/cxx_supportlib/vendor-modified/boost/date_time/gregorian/formatters.hpp +3 -3
  198. data/src/cxx_supportlib/vendor-modified/boost/date_time/gregorian/formatters_limited.hpp +3 -3
  199. data/src/cxx_supportlib/vendor-modified/boost/date_time/gregorian/greg_date.hpp +12 -13
  200. data/src/cxx_supportlib/vendor-modified/boost/date_time/gregorian/parsers.hpp +2 -2
  201. data/src/cxx_supportlib/vendor-modified/boost/date_time/gregorian_calendar.ipp +2 -2
  202. data/src/cxx_supportlib/vendor-modified/boost/date_time/iso_format.hpp +13 -13
  203. data/src/cxx_supportlib/vendor-modified/boost/date_time/local_time/local_date_time.hpp +2 -2
  204. data/src/cxx_supportlib/vendor-modified/boost/date_time/posix_time/time_formatters.hpp +4 -4
  205. data/src/cxx_supportlib/vendor-modified/boost/date_time/posix_time/time_formatters_limited.hpp +2 -2
  206. data/src/cxx_supportlib/vendor-modified/boost/date_time/special_values_parser.hpp +1 -1
  207. data/src/cxx_supportlib/vendor-modified/boost/date_time/time_facet.hpp +1 -1
  208. data/src/cxx_supportlib/vendor-modified/boost/date_time/time_parsing.hpp +2 -2
  209. data/src/cxx_supportlib/vendor-modified/boost/describe/bases.hpp +50 -0
  210. data/src/cxx_supportlib/vendor-modified/boost/describe/detail/config.hpp +40 -0
  211. data/src/cxx_supportlib/vendor-modified/boost/describe/detail/cx_streq.hpp +30 -0
  212. data/src/cxx_supportlib/vendor-modified/boost/describe/detail/void_t.hpp +32 -0
  213. data/src/cxx_supportlib/vendor-modified/boost/describe/members.hpp +159 -0
  214. data/src/cxx_supportlib/vendor-modified/boost/describe/modifiers.hpp +33 -0
  215. data/src/cxx_supportlib/vendor-modified/boost/intrusive/avltree_algorithms.hpp +9 -9
  216. data/src/cxx_supportlib/vendor-modified/boost/intrusive/bstree_algorithms.hpp +45 -45
  217. data/src/cxx_supportlib/vendor-modified/boost/intrusive/detail/any_node_and_algorithms.hpp +8 -8
  218. data/src/cxx_supportlib/vendor-modified/boost/intrusive/detail/bstree_algorithms_base.hpp +37 -38
  219. data/src/cxx_supportlib/vendor-modified/boost/intrusive/detail/iterator.hpp +16 -0
  220. data/src/cxx_supportlib/vendor-modified/boost/intrusive/detail/workaround.hpp +1 -1
  221. data/src/cxx_supportlib/vendor-modified/boost/intrusive/hashtable.hpp +145 -90
  222. data/src/cxx_supportlib/vendor-modified/boost/intrusive/pack_options.hpp +2 -0
  223. data/src/cxx_supportlib/vendor-modified/boost/intrusive/rbtree_algorithms.hpp +7 -7
  224. data/src/cxx_supportlib/vendor-modified/boost/intrusive/sgtree_algorithms.hpp +5 -5
  225. data/src/cxx_supportlib/vendor-modified/boost/intrusive/splaytree_algorithms.hpp +11 -9
  226. data/src/cxx_supportlib/vendor-modified/boost/intrusive/treap_algorithms.hpp +7 -7
  227. data/src/cxx_supportlib/vendor-modified/boost/iterator/iterator_facade.hpp +106 -25
  228. data/src/cxx_supportlib/vendor-modified/boost/lexical_cast/detail/converter_lexical_streams.hpp +1 -1
  229. data/src/cxx_supportlib/vendor-modified/boost/lexical_cast/detail/converter_numeric.hpp +8 -5
  230. data/src/cxx_supportlib/vendor-modified/boost/lexical_cast/detail/lcast_unsigned_converters.hpp +1 -1
  231. data/src/cxx_supportlib/vendor-modified/boost/move/algo/detail/adaptive_sort_merge.hpp +4 -2
  232. data/src/cxx_supportlib/vendor-modified/boost/move/algo/detail/pdqsort.hpp +2 -1
  233. data/src/cxx_supportlib/vendor-modified/boost/move/detail/type_traits.hpp +8 -4
  234. data/src/cxx_supportlib/vendor-modified/boost/mp11/bind.hpp +111 -0
  235. data/src/cxx_supportlib/vendor-modified/boost/mp11/version.hpp +1 -1
  236. data/src/cxx_supportlib/vendor-modified/boost/numeric/conversion/detail/int_float_mixture.hpp +5 -5
  237. data/src/cxx_supportlib/vendor-modified/boost/numeric/conversion/detail/sign_mixture.hpp +5 -5
  238. data/src/cxx_supportlib/vendor-modified/boost/numeric/conversion/detail/udt_builtin_mixture.hpp +5 -5
  239. data/src/cxx_supportlib/vendor-modified/boost/preprocessor/variadic/has_opt.hpp +6 -2
  240. data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/detail/spinlock_gcc_atomic.hpp +11 -2
  241. data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/intrusive_ptr.hpp +1 -1
  242. data/src/cxx_supportlib/vendor-modified/boost/system/detail/config.hpp +7 -1
  243. data/src/cxx_supportlib/vendor-modified/boost/system/detail/error_category.hpp +2 -2
  244. data/src/cxx_supportlib/vendor-modified/boost/system/detail/error_category_impl.hpp +10 -1
  245. data/src/cxx_supportlib/vendor-modified/boost/system/detail/error_code.hpp +38 -43
  246. data/src/cxx_supportlib/vendor-modified/boost/system/detail/error_condition.hpp +52 -0
  247. data/src/cxx_supportlib/vendor-modified/boost/throw_exception.hpp +1 -1
  248. data/src/cxx_supportlib/vendor-modified/boost/type_traits/detail/is_function_ptr_helper.hpp +27 -27
  249. data/src/cxx_supportlib/vendor-modified/boost/type_traits/detail/is_mem_fun_pointer_impl.hpp +27 -27
  250. data/src/cxx_supportlib/vendor-modified/boost/type_traits/intrinsics.hpp +22 -8
  251. data/src/cxx_supportlib/vendor-modified/boost/unordered/detail/fca.hpp +37 -7
  252. data/src/cxx_supportlib/vendor-modified/boost/unordered/detail/foa.hpp +1921 -0
  253. data/src/cxx_supportlib/vendor-modified/boost/unordered/detail/implementation.hpp +66 -82
  254. data/src/cxx_supportlib/vendor-modified/boost/unordered/detail/prime_fmod.hpp +6 -0
  255. data/src/cxx_supportlib/vendor-modified/boost/unordered/detail/type_traits.hpp +109 -0
  256. data/src/cxx_supportlib/vendor-modified/boost/unordered/detail/xmx.hpp +75 -0
  257. data/src/cxx_supportlib/vendor-modified/boost/unordered/hash_traits.hpp +45 -0
  258. data/src/cxx_supportlib/vendor-modified/boost/unordered/unordered_flat_map.hpp +732 -0
  259. data/src/cxx_supportlib/vendor-modified/boost/unordered/unordered_flat_map_fwd.hpp +49 -0
  260. data/src/cxx_supportlib/vendor-modified/boost/unordered/unordered_flat_set.hpp +586 -0
  261. data/src/cxx_supportlib/vendor-modified/boost/unordered/unordered_flat_set_fwd.hpp +49 -0
  262. data/src/cxx_supportlib/vendor-modified/boost/unordered/unordered_map.hpp +166 -66
  263. data/src/cxx_supportlib/vendor-modified/boost/unordered/unordered_set.hpp +145 -28
  264. data/src/cxx_supportlib/vendor-modified/boost/version.hpp +2 -2
  265. data/src/cxx_supportlib/vendor-modified/websocketpp/websocketpp/common/md5.hpp +1 -1
  266. data/src/ruby_native_extension/extconf.rb +1 -1
  267. data/src/ruby_supportlib/phusion_passenger/platform_info/operating_system.rb +1 -1
  268. data/src/ruby_supportlib/phusion_passenger.rb +5 -5
  269. metadata +36 -19
  270. data/src/cxx_supportlib/vendor-modified/boost/align/align.hpp +0 -19
  271. data/src/cxx_supportlib/vendor-modified/boost/align/alignment_of.hpp +0 -54
  272. data/src/cxx_supportlib/vendor-modified/boost/align/alignment_of_forward.hpp +0 -20
  273. data/src/cxx_supportlib/vendor-modified/boost/align/detail/align_cxx11.hpp +0 -21
  274. data/src/cxx_supportlib/vendor-modified/boost/align/detail/aligned_alloc.hpp +0 -52
  275. data/src/cxx_supportlib/vendor-modified/boost/align/detail/alignment_of.hpp +0 -31
  276. data/src/cxx_supportlib/vendor-modified/boost/align/detail/alignment_of_cxx11.hpp +0 -23
  277. data/src/cxx_supportlib/vendor-modified/boost/align/detail/element_type.hpp +0 -91
  278. data/src/cxx_supportlib/vendor-modified/boost/align/detail/integral_constant.hpp +0 -53
  279. data/src/cxx_supportlib/vendor-modified/boost/align/detail/min_size.hpp +0 -26
  280. data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/detail/completion_handler_erasure.hpp +0 -196
  281. data/src/cxx_supportlib/vendor-modified/boost/asio/impl/compose.hpp +0 -709
  282. data/src/cxx_supportlib/vendor-modified/boost/container_hash/detail/float_functions.hpp +0 -336
  283. data/src/cxx_supportlib/vendor-modified/boost/container_hash/detail/hash_float.hpp +0 -271
  284. data/src/cxx_supportlib/vendor-modified/boost/container_hash/detail/limits.hpp +0 -62
  285. data/src/cxx_supportlib/vendor-modified/boost/container_hash/extensions.hpp +0 -361
  286. data/src/cxx_supportlib/vendor-modified/boost/detail/container_fwd.hpp +0 -157
@@ -0,0 +1,686 @@
1
+ //
2
+ // any_completion_handler.hpp
3
+ // ~~~~~~~~~~~~~~~~~~~~~~~~~~
4
+ //
5
+ // Copyright (c) 2003-2022 Christopher M. Kohlhoff (chris at kohlhoff dot com)
6
+ //
7
+ // Distributed under the Boost Software License, Version 1.0. (See accompanying
8
+ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
9
+ //
10
+
11
+ #ifndef BOOST_ASIO_ANY_COMPLETION_HANDLER_HPP
12
+ #define BOOST_ASIO_ANY_COMPLETION_HANDLER_HPP
13
+
14
+ #include <boost/asio/detail/config.hpp>
15
+
16
+ #if (defined(BOOST_ASIO_HAS_STD_TUPLE) \
17
+ && defined(BOOST_ASIO_HAS_MOVE) \
18
+ && defined(BOOST_ASIO_HAS_VARIADIC_TEMPLATES)) \
19
+ || defined(GENERATING_DOCUMENTATION)
20
+
21
+ #include <cstring>
22
+ #include <functional>
23
+ #include <memory>
24
+ #include <utility>
25
+ #include <boost/asio/any_completion_executor.hpp>
26
+ #include <boost/asio/associated_allocator.hpp>
27
+ #include <boost/asio/associated_cancellation_slot.hpp>
28
+ #include <boost/asio/associated_executor.hpp>
29
+ #include <boost/asio/cancellation_state.hpp>
30
+ #include <boost/asio/recycling_allocator.hpp>
31
+
32
+ #include <boost/asio/detail/push_options.hpp>
33
+
34
+ namespace boost {
35
+ namespace asio {
36
+ namespace detail {
37
+
38
+ class any_completion_handler_impl_base
39
+ {
40
+ public:
41
+ template <typename S>
42
+ explicit any_completion_handler_impl_base(S&& slot)
43
+ : cancel_state_(BOOST_ASIO_MOVE_CAST(S)(slot), enable_total_cancellation())
44
+ {
45
+ }
46
+
47
+ cancellation_slot get_cancellation_slot() const BOOST_ASIO_NOEXCEPT
48
+ {
49
+ return cancel_state_.slot();
50
+ }
51
+
52
+ private:
53
+ cancellation_state cancel_state_;
54
+ };
55
+
56
+ template <typename Handler>
57
+ class any_completion_handler_impl :
58
+ public any_completion_handler_impl_base
59
+ {
60
+ public:
61
+ template <typename S, typename H>
62
+ any_completion_handler_impl(S&& slot, H&& h)
63
+ : any_completion_handler_impl_base(BOOST_ASIO_MOVE_CAST(S)(slot)),
64
+ handler_(BOOST_ASIO_MOVE_CAST(H)(h))
65
+ {
66
+ }
67
+
68
+ struct uninit_deleter
69
+ {
70
+ typename std::allocator_traits<
71
+ associated_allocator_t<Handler,
72
+ boost::asio::recycling_allocator<void>>>::template
73
+ rebind_alloc<any_completion_handler_impl> alloc;
74
+
75
+ void operator()(any_completion_handler_impl* ptr)
76
+ {
77
+ std::allocator_traits<decltype(alloc)>::deallocate(alloc, ptr, 1);
78
+ }
79
+ };
80
+
81
+ struct deleter
82
+ {
83
+ typename std::allocator_traits<
84
+ associated_allocator_t<Handler,
85
+ boost::asio::recycling_allocator<void>>>::template
86
+ rebind_alloc<any_completion_handler_impl> alloc;
87
+
88
+ void operator()(any_completion_handler_impl* ptr)
89
+ {
90
+ std::allocator_traits<decltype(alloc)>::destroy(alloc, ptr);
91
+ std::allocator_traits<decltype(alloc)>::deallocate(alloc, ptr, 1);
92
+ }
93
+ };
94
+
95
+ template <typename S, typename H>
96
+ static any_completion_handler_impl* create(S&& slot, H&& h)
97
+ {
98
+ uninit_deleter d{
99
+ (get_associated_allocator)(h,
100
+ boost::asio::recycling_allocator<void>())};
101
+
102
+ std::unique_ptr<any_completion_handler_impl, uninit_deleter> uninit_ptr(
103
+ std::allocator_traits<decltype(d.alloc)>::allocate(d.alloc, 1), d);
104
+
105
+ any_completion_handler_impl* ptr =
106
+ new (uninit_ptr.get()) any_completion_handler_impl(
107
+ BOOST_ASIO_MOVE_CAST(S)(slot), BOOST_ASIO_MOVE_CAST(H)(h));
108
+
109
+ uninit_ptr.release();
110
+ return ptr;
111
+ }
112
+
113
+ void destroy()
114
+ {
115
+ deleter d{
116
+ (get_associated_allocator)(handler_,
117
+ boost::asio::recycling_allocator<void>())};
118
+
119
+ d(this);
120
+ }
121
+
122
+ any_completion_executor executor(
123
+ const any_completion_executor& candidate) const BOOST_ASIO_NOEXCEPT
124
+ {
125
+ return any_completion_executor(std::nothrow,
126
+ (get_associated_executor)(handler_, candidate));
127
+ }
128
+
129
+ void* allocate(std::size_t size, std::size_t align) const
130
+ {
131
+ typename std::allocator_traits<
132
+ associated_allocator_t<Handler,
133
+ boost::asio::recycling_allocator<void>>>::template
134
+ rebind_alloc<unsigned char> alloc(
135
+ (get_associated_allocator)(handler_,
136
+ boost::asio::recycling_allocator<void>()));
137
+
138
+ std::size_t space = size + align - 1;
139
+ unsigned char* base =
140
+ std::allocator_traits<decltype(alloc)>::allocate(
141
+ alloc, space + sizeof(std::ptrdiff_t));
142
+
143
+ void* p = base;
144
+ if (detail::align(align, size, p, space))
145
+ {
146
+ std::ptrdiff_t off = static_cast<unsigned char*>(p) - base;
147
+ std::memcpy(static_cast<unsigned char*>(p) + size, &off, sizeof(off));
148
+ return p;
149
+ }
150
+
151
+ std::bad_alloc ex;
152
+ boost::asio::detail::throw_exception(ex);
153
+ return nullptr;
154
+ }
155
+
156
+ void deallocate(void* p, std::size_t size, std::size_t align) const
157
+ {
158
+ if (p)
159
+ {
160
+ typename std::allocator_traits<
161
+ associated_allocator_t<Handler,
162
+ boost::asio::recycling_allocator<void>>>::template
163
+ rebind_alloc<unsigned char> alloc(
164
+ (get_associated_allocator)(handler_,
165
+ boost::asio::recycling_allocator<void>()));
166
+
167
+ std::ptrdiff_t off;
168
+ std::memcpy(&off, static_cast<unsigned char*>(p) + size, sizeof(off));
169
+ unsigned char* base = static_cast<unsigned char*>(p) - off;
170
+
171
+ std::allocator_traits<decltype(alloc)>::deallocate(
172
+ alloc, base, size + align -1 + sizeof(std::ptrdiff_t));
173
+ }
174
+ }
175
+
176
+ template <typename... Args>
177
+ void call(Args&&... args)
178
+ {
179
+ deleter d{
180
+ (get_associated_allocator)(handler_,
181
+ boost::asio::recycling_allocator<void>())};
182
+
183
+ std::unique_ptr<any_completion_handler_impl, deleter> ptr(this, d);
184
+ Handler handler(BOOST_ASIO_MOVE_CAST(Handler)(handler_));
185
+ ptr.reset();
186
+
187
+ BOOST_ASIO_MOVE_CAST(Handler)(handler)(
188
+ BOOST_ASIO_MOVE_CAST(Args)(args)...);
189
+ }
190
+
191
+ private:
192
+ Handler handler_;
193
+ };
194
+
195
+ template <typename Signature>
196
+ class any_completion_handler_call_fn;
197
+
198
+ template <typename R, typename... Args>
199
+ class any_completion_handler_call_fn<R(Args...)>
200
+ {
201
+ public:
202
+ using type = void(*)(any_completion_handler_impl_base*, Args...);
203
+
204
+ constexpr any_completion_handler_call_fn(type fn)
205
+ : call_fn_(fn)
206
+ {
207
+ }
208
+
209
+ void call(any_completion_handler_impl_base* impl, Args... args) const
210
+ {
211
+ call_fn_(impl, BOOST_ASIO_MOVE_CAST(Args)(args)...);
212
+ }
213
+
214
+ template <typename Handler>
215
+ static void impl(any_completion_handler_impl_base* impl, Args... args)
216
+ {
217
+ static_cast<any_completion_handler_impl<Handler>*>(impl)->call(
218
+ BOOST_ASIO_MOVE_CAST(Args)(args)...);
219
+ }
220
+
221
+ private:
222
+ type call_fn_;
223
+ };
224
+
225
+ template <typename... Signatures>
226
+ class any_completion_handler_call_fns;
227
+
228
+ template <typename Signature>
229
+ class any_completion_handler_call_fns<Signature> :
230
+ public any_completion_handler_call_fn<Signature>
231
+ {
232
+ public:
233
+ using any_completion_handler_call_fn<
234
+ Signature>::any_completion_handler_call_fn;
235
+ using any_completion_handler_call_fn<Signature>::call;
236
+ };
237
+
238
+ template <typename Signature, typename... Signatures>
239
+ class any_completion_handler_call_fns<Signature, Signatures...> :
240
+ public any_completion_handler_call_fn<Signature>,
241
+ public any_completion_handler_call_fns<Signatures...>
242
+ {
243
+ public:
244
+ template <typename CallFn, typename... CallFns>
245
+ constexpr any_completion_handler_call_fns(CallFn fn, CallFns... fns)
246
+ : any_completion_handler_call_fn<Signature>(fn),
247
+ any_completion_handler_call_fns<Signatures...>(fns...)
248
+ {
249
+ }
250
+
251
+ using any_completion_handler_call_fn<Signature>::call;
252
+ using any_completion_handler_call_fns<Signatures...>::call;
253
+ };
254
+
255
+ class any_completion_handler_destroy_fn
256
+ {
257
+ public:
258
+ using type = void(*)(any_completion_handler_impl_base*);
259
+
260
+ constexpr any_completion_handler_destroy_fn(type fn)
261
+ : destroy_fn_(fn)
262
+ {
263
+ }
264
+
265
+ void destroy(any_completion_handler_impl_base* impl) const
266
+ {
267
+ destroy_fn_(impl);
268
+ }
269
+
270
+ template <typename Handler>
271
+ static void impl(any_completion_handler_impl_base* impl)
272
+ {
273
+ static_cast<any_completion_handler_impl<Handler>*>(impl)->destroy();
274
+ }
275
+
276
+ private:
277
+ type destroy_fn_;
278
+ };
279
+
280
+ class any_completion_handler_executor_fn
281
+ {
282
+ public:
283
+ using type = any_completion_executor(*)(
284
+ any_completion_handler_impl_base*, const any_completion_executor&);
285
+
286
+ constexpr any_completion_handler_executor_fn(type fn)
287
+ : executor_fn_(fn)
288
+ {
289
+ }
290
+
291
+ any_completion_executor executor(any_completion_handler_impl_base* impl,
292
+ const any_completion_executor& candidate) const
293
+ {
294
+ return executor_fn_(impl, candidate);
295
+ }
296
+
297
+ template <typename Handler>
298
+ static any_completion_executor impl(any_completion_handler_impl_base* impl,
299
+ const any_completion_executor& candidate)
300
+ {
301
+ return static_cast<any_completion_handler_impl<Handler>*>(impl)->executor(
302
+ candidate);
303
+ }
304
+
305
+ private:
306
+ type executor_fn_;
307
+ };
308
+
309
+ class any_completion_handler_allocate_fn
310
+ {
311
+ public:
312
+ using type = void*(*)(any_completion_handler_impl_base*,
313
+ std::size_t, std::size_t);
314
+
315
+ constexpr any_completion_handler_allocate_fn(type fn)
316
+ : allocate_fn_(fn)
317
+ {
318
+ }
319
+
320
+ void* allocate(any_completion_handler_impl_base* impl,
321
+ std::size_t size, std::size_t align) const
322
+ {
323
+ return allocate_fn_(impl, size, align);
324
+ }
325
+
326
+ template <typename Handler>
327
+ static void* impl(any_completion_handler_impl_base* impl,
328
+ std::size_t size, std::size_t align)
329
+ {
330
+ return static_cast<any_completion_handler_impl<Handler>*>(impl)->allocate(
331
+ size, align);
332
+ }
333
+
334
+ private:
335
+ type allocate_fn_;
336
+ };
337
+
338
+ class any_completion_handler_deallocate_fn
339
+ {
340
+ public:
341
+ using type = void(*)(any_completion_handler_impl_base*,
342
+ void*, std::size_t, std::size_t);
343
+
344
+ constexpr any_completion_handler_deallocate_fn(type fn)
345
+ : deallocate_fn_(fn)
346
+ {
347
+ }
348
+
349
+ void deallocate(any_completion_handler_impl_base* impl,
350
+ void* p, std::size_t size, std::size_t align) const
351
+ {
352
+ deallocate_fn_(impl, p, size, align);
353
+ }
354
+
355
+ template <typename Handler>
356
+ static void impl(any_completion_handler_impl_base* impl,
357
+ void* p, std::size_t size, std::size_t align)
358
+ {
359
+ static_cast<any_completion_handler_impl<Handler>*>(impl)->deallocate(
360
+ p, size, align);
361
+ }
362
+
363
+ private:
364
+ type deallocate_fn_;
365
+ };
366
+
367
+ template <typename... Signatures>
368
+ class any_completion_handler_fn_table
369
+ : private any_completion_handler_destroy_fn,
370
+ private any_completion_handler_executor_fn,
371
+ private any_completion_handler_allocate_fn,
372
+ private any_completion_handler_deallocate_fn,
373
+ private any_completion_handler_call_fns<Signatures...>
374
+ {
375
+ public:
376
+ template <typename... CallFns>
377
+ constexpr any_completion_handler_fn_table(
378
+ any_completion_handler_destroy_fn::type destroy_fn,
379
+ any_completion_handler_executor_fn::type executor_fn,
380
+ any_completion_handler_allocate_fn::type allocate_fn,
381
+ any_completion_handler_deallocate_fn::type deallocate_fn,
382
+ CallFns... call_fns)
383
+ : any_completion_handler_destroy_fn(destroy_fn),
384
+ any_completion_handler_executor_fn(executor_fn),
385
+ any_completion_handler_allocate_fn(allocate_fn),
386
+ any_completion_handler_deallocate_fn(deallocate_fn),
387
+ any_completion_handler_call_fns<Signatures...>(call_fns...)
388
+ {
389
+ }
390
+
391
+ using any_completion_handler_destroy_fn::destroy;
392
+ using any_completion_handler_executor_fn::executor;
393
+ using any_completion_handler_allocate_fn::allocate;
394
+ using any_completion_handler_deallocate_fn::deallocate;
395
+ using any_completion_handler_call_fns<Signatures...>::call;
396
+ };
397
+
398
+ template <typename Handler, typename... Signatures>
399
+ struct any_completion_handler_fn_table_instance
400
+ {
401
+ static constexpr any_completion_handler_fn_table<Signatures...>
402
+ value = any_completion_handler_fn_table<Signatures...>(
403
+ &any_completion_handler_destroy_fn::impl<Handler>,
404
+ &any_completion_handler_executor_fn::impl<Handler>,
405
+ &any_completion_handler_allocate_fn::impl<Handler>,
406
+ &any_completion_handler_deallocate_fn::impl<Handler>,
407
+ &any_completion_handler_call_fn<Signatures>::template impl<Handler>...);
408
+ };
409
+
410
+ template <typename Handler, typename... Signatures>
411
+ constexpr any_completion_handler_fn_table<Signatures...>
412
+ any_completion_handler_fn_table_instance<Handler, Signatures...>::value;
413
+
414
+ } // namespace detail
415
+
416
+ template <typename... Signatures>
417
+ class any_completion_handler;
418
+
419
+ template <typename T, typename... Signatures>
420
+ class any_completion_handler_allocator
421
+ {
422
+ private:
423
+ template <typename...>
424
+ friend class any_completion_handler;
425
+
426
+ template <typename, typename...>
427
+ friend class any_completion_handler_allocator;
428
+
429
+ const detail::any_completion_handler_fn_table<Signatures...>* fn_table_;
430
+ detail::any_completion_handler_impl_base* impl_;
431
+
432
+ constexpr any_completion_handler_allocator(int,
433
+ const any_completion_handler<Signatures...>& h) BOOST_ASIO_NOEXCEPT
434
+ : fn_table_(h.fn_table_),
435
+ impl_(h.impl_)
436
+ {
437
+ }
438
+
439
+ public:
440
+ typedef T value_type;
441
+
442
+ template <typename U>
443
+ struct rebind
444
+ {
445
+ typedef any_completion_handler_allocator<U, Signatures...> other;
446
+ };
447
+
448
+ template <typename U>
449
+ constexpr any_completion_handler_allocator(
450
+ const any_completion_handler_allocator<U, Signatures...>& a)
451
+ BOOST_ASIO_NOEXCEPT
452
+ : fn_table_(a.fn_table_),
453
+ impl_(a.impl_)
454
+ {
455
+ }
456
+
457
+ constexpr bool operator==(
458
+ const any_completion_handler_allocator& other) const BOOST_ASIO_NOEXCEPT
459
+ {
460
+ return fn_table_ == other.fn_table_ && impl_ == other.impl_;
461
+ }
462
+
463
+ constexpr bool operator!=(
464
+ const any_completion_handler_allocator& other) const BOOST_ASIO_NOEXCEPT
465
+ {
466
+ return fn_table_ != other.fn_table_ || impl_ != other.impl_;
467
+ }
468
+
469
+ T* allocate(std::size_t n) const
470
+ {
471
+ return static_cast<T*>(
472
+ fn_table_->allocate(
473
+ impl_, sizeof(T) * n, alignof(T)));
474
+ }
475
+
476
+ void deallocate(T* p, std::size_t n) const
477
+ {
478
+ fn_table_->deallocate(impl_, p, sizeof(T) * n, alignof(T));
479
+ }
480
+ };
481
+
482
+ template <typename... Signatures>
483
+ class any_completion_handler_allocator<void, Signatures...>
484
+ {
485
+ private:
486
+ template <typename...>
487
+ friend class any_completion_handler;
488
+
489
+ template <typename, typename...>
490
+ friend class any_completion_handler_allocator;
491
+
492
+ const detail::any_completion_handler_fn_table<Signatures...>* fn_table_;
493
+ detail::any_completion_handler_impl_base* impl_;
494
+
495
+ constexpr any_completion_handler_allocator(int,
496
+ const any_completion_handler<Signatures...>& h) BOOST_ASIO_NOEXCEPT
497
+ : fn_table_(h.fn_table_),
498
+ impl_(h.impl_)
499
+ {
500
+ }
501
+
502
+ public:
503
+ typedef void value_type;
504
+
505
+ template <typename U>
506
+ struct rebind
507
+ {
508
+ typedef any_completion_handler_allocator<U, Signatures...> other;
509
+ };
510
+
511
+ template <typename U>
512
+ constexpr any_completion_handler_allocator(
513
+ const any_completion_handler_allocator<U, Signatures...>& a)
514
+ BOOST_ASIO_NOEXCEPT
515
+ : fn_table_(a.fn_table_),
516
+ impl_(a.impl_)
517
+ {
518
+ }
519
+
520
+ constexpr bool operator==(
521
+ const any_completion_handler_allocator& other) const BOOST_ASIO_NOEXCEPT
522
+ {
523
+ return fn_table_ == other.fn_table_ && impl_ == other.impl_;
524
+ }
525
+
526
+ constexpr bool operator!=(
527
+ const any_completion_handler_allocator& other) const BOOST_ASIO_NOEXCEPT
528
+ {
529
+ return fn_table_ != other.fn_table_ || impl_ != other.impl_;
530
+ }
531
+ };
532
+
533
+ template <typename... Signatures>
534
+ class any_completion_handler
535
+ {
536
+ private:
537
+ template <typename, typename...>
538
+ friend class any_completion_handler_allocator;
539
+
540
+ template <typename, typename>
541
+ friend struct associated_executor;
542
+
543
+ const detail::any_completion_handler_fn_table<Signatures...>* fn_table_;
544
+ detail::any_completion_handler_impl_base* impl_;
545
+
546
+ public:
547
+ using allocator_type = any_completion_handler_allocator<void, Signatures...>;
548
+ using cancellation_slot_type = cancellation_slot;
549
+
550
+ constexpr any_completion_handler()
551
+ : fn_table_(nullptr),
552
+ impl_(nullptr)
553
+ {
554
+ }
555
+
556
+ constexpr any_completion_handler(nullptr_t)
557
+ : fn_table_(nullptr),
558
+ impl_(nullptr)
559
+ {
560
+ }
561
+
562
+ template <typename H, typename Handler = typename decay<H>::type>
563
+ any_completion_handler(H&& h)
564
+ : fn_table_(
565
+ &detail::any_completion_handler_fn_table_instance<
566
+ Handler, Signatures...>::value),
567
+ impl_(detail::any_completion_handler_impl<Handler>::create(
568
+ (get_associated_cancellation_slot)(h), BOOST_ASIO_MOVE_CAST(H)(h)))
569
+ {
570
+ }
571
+
572
+ any_completion_handler(any_completion_handler&& other) BOOST_ASIO_NOEXCEPT
573
+ : fn_table_(other.fn_table_),
574
+ impl_(other.impl_)
575
+ {
576
+ other.fn_table_ = nullptr;
577
+ other.impl_ = nullptr;
578
+ }
579
+
580
+ any_completion_handler& operator=(
581
+ any_completion_handler&& other) BOOST_ASIO_NOEXCEPT
582
+ {
583
+ any_completion_handler(other).swap(*this);
584
+ return *this;
585
+ }
586
+
587
+ any_completion_handler& operator=(nullptr_t) BOOST_ASIO_NOEXCEPT
588
+ {
589
+ any_completion_handler().swap(*this);
590
+ return *this;
591
+ }
592
+
593
+ ~any_completion_handler()
594
+ {
595
+ if (impl_)
596
+ fn_table_->destroy(impl_);
597
+ }
598
+
599
+ constexpr explicit operator bool() const BOOST_ASIO_NOEXCEPT
600
+ {
601
+ return impl_ != nullptr;
602
+ }
603
+
604
+ constexpr bool operator!() const BOOST_ASIO_NOEXCEPT
605
+ {
606
+ return impl_ == nullptr;
607
+ }
608
+
609
+ void swap(any_completion_handler& other) BOOST_ASIO_NOEXCEPT
610
+ {
611
+ std::swap(fn_table_, other.fn_table_);
612
+ std::swap(impl_, other.impl_);
613
+ }
614
+
615
+ allocator_type get_allocator() const BOOST_ASIO_NOEXCEPT
616
+ {
617
+ return allocator_type(0, *this);
618
+ }
619
+
620
+ cancellation_slot_type get_cancellation_slot() const BOOST_ASIO_NOEXCEPT
621
+ {
622
+ return impl_->get_cancellation_slot();
623
+ }
624
+
625
+ template <typename... Args>
626
+ auto operator()(Args&&... args)
627
+ -> decltype(fn_table_->call(impl_, BOOST_ASIO_MOVE_CAST(Args)(args)...))
628
+ {
629
+ if (detail::any_completion_handler_impl_base* impl = impl_)
630
+ {
631
+ impl_ = nullptr;
632
+ return fn_table_->call(impl, BOOST_ASIO_MOVE_CAST(Args)(args)...);
633
+ }
634
+ std::bad_function_call ex;
635
+ boost::asio::detail::throw_exception(ex);
636
+ }
637
+
638
+ friend constexpr bool operator==(
639
+ const any_completion_handler& a, nullptr_t) BOOST_ASIO_NOEXCEPT
640
+ {
641
+ return a.impl_ == nullptr;
642
+ }
643
+
644
+ friend constexpr bool operator==(
645
+ nullptr_t, const any_completion_handler& b) BOOST_ASIO_NOEXCEPT
646
+ {
647
+ return nullptr == b.impl_;
648
+ }
649
+
650
+ friend constexpr bool operator!=(
651
+ const any_completion_handler& a, nullptr_t) BOOST_ASIO_NOEXCEPT
652
+ {
653
+ return a.impl_ != nullptr;
654
+ }
655
+
656
+ friend constexpr bool operator!=(
657
+ nullptr_t, const any_completion_handler& b) BOOST_ASIO_NOEXCEPT
658
+ {
659
+ return nullptr != b.impl_;
660
+ }
661
+ };
662
+
663
+ template <typename... Signatures, typename Candidate>
664
+ struct associated_executor<any_completion_handler<Signatures...>, Candidate>
665
+ {
666
+ using type = any_completion_executor;
667
+
668
+ static type get(const any_completion_handler<Signatures...>& handler,
669
+ const Candidate& candidate = Candidate()) BOOST_ASIO_NOEXCEPT
670
+ {
671
+ return handler.fn_table_->executor(handler.impl_,
672
+ any_completion_executor(std::nothrow, candidate));
673
+ }
674
+ };
675
+
676
+ } // namespace asio
677
+ } // namespace boost
678
+
679
+ #include <boost/asio/detail/pop_options.hpp>
680
+
681
+ #endif // (defined(BOOST_ASIO_HAS_STD_TUPLE)
682
+ // && defined(BOOST_ASIO_HAS_MOVE)
683
+ // && defined(BOOST_ASIO_HAS_VARIADIC_TEMPLATES))
684
+ // || defined(GENERATING_DOCUMENTATION)
685
+
686
+ #endif // BOOST_ASIO_ANY_COMPLETION_HANDLER_HPP