passenger 6.0.16 → 6.0.18

Sign up to get free protection for your applications and to get access to all the features.
Files changed (290) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG +46 -2
  3. data/CONTRIBUTORS +2 -0
  4. data/build/integration_tests.rb +6 -6
  5. data/build/ruby_tests.rb +1 -1
  6. data/build/test_basics.rb +0 -1
  7. data/src/agent/Core/Config.h +1 -1
  8. data/src/agent/Core/Controller/Config.h +1 -1
  9. data/src/agent/Core/SpawningKit/PipeWatcher.h +18 -3
  10. data/src/agent/Watchdog/Config.h +1 -1
  11. data/src/cxx_supportlib/Constants.h +1 -1
  12. data/src/cxx_supportlib/vendor-modified/boost/align/aligned_alloc.hpp +1 -1
  13. data/src/cxx_supportlib/vendor-modified/boost/array.hpp +1 -1
  14. data/src/cxx_supportlib/vendor-modified/boost/asio/any_completion_executor.hpp +344 -0
  15. data/src/cxx_supportlib/vendor-modified/boost/asio/any_completion_handler.hpp +686 -0
  16. data/src/cxx_supportlib/vendor-modified/boost/asio/any_io_executor.hpp +56 -0
  17. data/src/cxx_supportlib/vendor-modified/boost/asio/associated_allocator.hpp +81 -25
  18. data/src/cxx_supportlib/vendor-modified/boost/asio/associated_cancellation_slot.hpp +68 -8
  19. data/src/cxx_supportlib/vendor-modified/boost/asio/associated_executor.hpp +46 -11
  20. data/src/cxx_supportlib/vendor-modified/boost/asio/basic_datagram_socket.hpp +4 -4
  21. data/src/cxx_supportlib/vendor-modified/boost/asio/basic_deadline_timer.hpp +2 -2
  22. data/src/cxx_supportlib/vendor-modified/boost/asio/basic_file.hpp +1 -1
  23. data/src/cxx_supportlib/vendor-modified/boost/asio/basic_random_access_file.hpp +2 -2
  24. data/src/cxx_supportlib/vendor-modified/boost/asio/basic_raw_socket.hpp +4 -4
  25. data/src/cxx_supportlib/vendor-modified/boost/asio/basic_readable_pipe.hpp +2 -2
  26. data/src/cxx_supportlib/vendor-modified/boost/asio/basic_seq_packet_socket.hpp +2 -2
  27. data/src/cxx_supportlib/vendor-modified/boost/asio/basic_serial_port.hpp +3 -3
  28. data/src/cxx_supportlib/vendor-modified/boost/asio/basic_signal_set.hpp +2 -2
  29. data/src/cxx_supportlib/vendor-modified/boost/asio/basic_socket.hpp +3 -3
  30. data/src/cxx_supportlib/vendor-modified/boost/asio/basic_socket_acceptor.hpp +4 -4
  31. data/src/cxx_supportlib/vendor-modified/boost/asio/basic_stream_file.hpp +2 -2
  32. data/src/cxx_supportlib/vendor-modified/boost/asio/basic_stream_socket.hpp +2 -2
  33. data/src/cxx_supportlib/vendor-modified/boost/asio/basic_waitable_timer.hpp +2 -2
  34. data/src/cxx_supportlib/vendor-modified/boost/asio/basic_writable_pipe.hpp +2 -2
  35. data/src/cxx_supportlib/vendor-modified/boost/asio/bind_allocator.hpp +13 -3
  36. data/src/cxx_supportlib/vendor-modified/boost/asio/bind_cancellation_slot.hpp +14 -3
  37. data/src/cxx_supportlib/vendor-modified/boost/asio/bind_executor.hpp +13 -3
  38. data/src/cxx_supportlib/vendor-modified/boost/asio/compose.hpp +30 -305
  39. data/src/cxx_supportlib/vendor-modified/boost/asio/consign.hpp +90 -0
  40. data/src/cxx_supportlib/vendor-modified/boost/asio/defer.hpp +17 -18
  41. data/src/cxx_supportlib/vendor-modified/boost/asio/detail/bind_handler.hpp +98 -24
  42. data/src/cxx_supportlib/vendor-modified/boost/asio/detail/composed_work.hpp +330 -0
  43. data/src/cxx_supportlib/vendor-modified/boost/asio/detail/config.hpp +81 -15
  44. data/src/cxx_supportlib/vendor-modified/boost/asio/detail/handler_alloc_helpers.hpp +4 -4
  45. data/src/cxx_supportlib/vendor-modified/boost/asio/detail/handler_work.hpp +19 -11
  46. data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/descriptor_ops.ipp +37 -0
  47. data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/handler_tracking.ipp +3 -1
  48. data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/select_reactor.ipp +1 -1
  49. data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/socket_ops.ipp +10 -2
  50. data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/strand_executor_service.hpp +14 -1
  51. data/src/cxx_supportlib/vendor-modified/boost/asio/detail/memory.hpp +18 -0
  52. data/src/cxx_supportlib/vendor-modified/boost/asio/detail/utility.hpp +1 -2
  53. data/src/cxx_supportlib/vendor-modified/boost/asio/detail/work_dispatcher.hpp +7 -3
  54. data/src/cxx_supportlib/vendor-modified/boost/asio/dispatch.hpp +4 -14
  55. data/src/cxx_supportlib/vendor-modified/boost/asio/execution/allocator.hpp +22 -3
  56. data/src/cxx_supportlib/vendor-modified/boost/asio/execution/any_executor.hpp +447 -142
  57. data/src/cxx_supportlib/vendor-modified/boost/asio/execution/blocking.hpp +57 -8
  58. data/src/cxx_supportlib/vendor-modified/boost/asio/execution/blocking_adaptation.hpp +51 -6
  59. data/src/cxx_supportlib/vendor-modified/boost/asio/execution/bulk_execute.hpp +5 -0
  60. data/src/cxx_supportlib/vendor-modified/boost/asio/execution/bulk_guarantee.hpp +41 -4
  61. data/src/cxx_supportlib/vendor-modified/boost/asio/execution/connect.hpp +5 -0
  62. data/src/cxx_supportlib/vendor-modified/boost/asio/execution/context.hpp +13 -2
  63. data/src/cxx_supportlib/vendor-modified/boost/asio/execution/context_as.hpp +13 -2
  64. data/src/cxx_supportlib/vendor-modified/boost/asio/execution/detail/as_operation.hpp +4 -0
  65. data/src/cxx_supportlib/vendor-modified/boost/asio/execution/execute.hpp +9 -2
  66. data/src/cxx_supportlib/vendor-modified/boost/asio/execution/executor.hpp +11 -1
  67. data/src/cxx_supportlib/vendor-modified/boost/asio/execution/mapping.hpp +52 -8
  68. data/src/cxx_supportlib/vendor-modified/boost/asio/execution/occupancy.hpp +13 -2
  69. data/src/cxx_supportlib/vendor-modified/boost/asio/execution/operation_state.hpp +5 -0
  70. data/src/cxx_supportlib/vendor-modified/boost/asio/execution/outstanding_work.hpp +39 -6
  71. data/src/cxx_supportlib/vendor-modified/boost/asio/execution/receiver.hpp +5 -0
  72. data/src/cxx_supportlib/vendor-modified/boost/asio/execution/relationship.hpp +39 -6
  73. data/src/cxx_supportlib/vendor-modified/boost/asio/execution/schedule.hpp +5 -0
  74. data/src/cxx_supportlib/vendor-modified/boost/asio/execution/scheduler.hpp +5 -0
  75. data/src/cxx_supportlib/vendor-modified/boost/asio/execution/sender.hpp +5 -0
  76. data/src/cxx_supportlib/vendor-modified/boost/asio/execution/set_done.hpp +5 -0
  77. data/src/cxx_supportlib/vendor-modified/boost/asio/execution/set_error.hpp +5 -0
  78. data/src/cxx_supportlib/vendor-modified/boost/asio/execution/set_value.hpp +5 -0
  79. data/src/cxx_supportlib/vendor-modified/boost/asio/execution/start.hpp +5 -0
  80. data/src/cxx_supportlib/vendor-modified/boost/asio/execution/submit.hpp +5 -0
  81. data/src/cxx_supportlib/vendor-modified/boost/asio/executor_work_guard.hpp +6 -9
  82. data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/basic_channel.hpp +3 -3
  83. data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/basic_concurrent_channel.hpp +3 -3
  84. data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/channel_traits.hpp +70 -0
  85. data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/co_composed.hpp +146 -0
  86. data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/coro.hpp +35 -5
  87. data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/detail/channel_handler.hpp +13 -3
  88. data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/detail/channel_operation.hpp +7 -0
  89. data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/detail/channel_service.hpp +180 -0
  90. data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/detail/coro_completion_handler.hpp +171 -0
  91. data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/detail/coro_promise_allocator.hpp +89 -66
  92. data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/detail/partial_promise.hpp +66 -45
  93. data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/impl/as_single.hpp +13 -3
  94. data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/impl/co_composed.hpp +1134 -0
  95. data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/impl/coro.hpp +130 -106
  96. data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/impl/parallel_group.hpp +377 -3
  97. data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/impl/promise.hpp +168 -29
  98. data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/impl/use_coro.hpp +149 -203
  99. data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/impl/use_promise.hpp +68 -0
  100. data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/parallel_group.hpp +256 -0
  101. data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/promise.hpp +76 -80
  102. data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/use_coro.hpp +40 -14
  103. data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/use_promise.hpp +113 -0
  104. data/src/cxx_supportlib/vendor-modified/boost/asio/impl/any_completion_executor.ipp +132 -0
  105. data/src/cxx_supportlib/vendor-modified/boost/asio/impl/any_io_executor.ipp +12 -0
  106. data/src/cxx_supportlib/vendor-modified/boost/asio/impl/append.hpp +12 -3
  107. data/src/cxx_supportlib/vendor-modified/boost/asio/impl/as_tuple.hpp +12 -3
  108. data/src/cxx_supportlib/vendor-modified/boost/asio/impl/buffered_read_stream.hpp +25 -6
  109. data/src/cxx_supportlib/vendor-modified/boost/asio/impl/buffered_write_stream.hpp +25 -6
  110. data/src/cxx_supportlib/vendor-modified/boost/asio/impl/co_spawn.hpp +34 -45
  111. data/src/cxx_supportlib/vendor-modified/boost/asio/impl/connect.hpp +28 -6
  112. data/src/cxx_supportlib/vendor-modified/boost/asio/impl/consign.hpp +204 -0
  113. data/src/cxx_supportlib/vendor-modified/boost/asio/impl/defer.hpp +33 -1
  114. data/src/cxx_supportlib/vendor-modified/boost/asio/impl/deferred.hpp +13 -3
  115. data/src/cxx_supportlib/vendor-modified/boost/asio/impl/dispatch.hpp +21 -9
  116. data/src/cxx_supportlib/vendor-modified/boost/asio/impl/handler_alloc_hook.ipp +1 -1
  117. data/src/cxx_supportlib/vendor-modified/boost/asio/impl/post.hpp +33 -1
  118. data/src/cxx_supportlib/vendor-modified/boost/asio/impl/prepend.hpp +12 -3
  119. data/src/cxx_supportlib/vendor-modified/boost/asio/impl/read.hpp +40 -9
  120. data/src/cxx_supportlib/vendor-modified/boost/asio/impl/read_at.hpp +27 -6
  121. data/src/cxx_supportlib/vendor-modified/boost/asio/impl/read_until.hpp +104 -24
  122. data/src/cxx_supportlib/vendor-modified/boost/asio/impl/redirect_error.hpp +12 -3
  123. data/src/cxx_supportlib/vendor-modified/boost/asio/impl/spawn.hpp +70 -15
  124. data/src/cxx_supportlib/vendor-modified/boost/asio/impl/src.hpp +1 -0
  125. data/src/cxx_supportlib/vendor-modified/boost/asio/impl/use_future.hpp +25 -0
  126. data/src/cxx_supportlib/vendor-modified/boost/asio/impl/write.hpp +38 -30
  127. data/src/cxx_supportlib/vendor-modified/boost/asio/impl/write_at.hpp +27 -6
  128. data/src/cxx_supportlib/vendor-modified/boost/asio/io_context.hpp +0 -13
  129. data/src/cxx_supportlib/vendor-modified/boost/asio/ip/impl/network_v4.ipp +3 -1
  130. data/src/cxx_supportlib/vendor-modified/boost/asio/ip/impl/network_v6.ipp +3 -1
  131. data/src/cxx_supportlib/vendor-modified/boost/asio/posix/basic_descriptor.hpp +2 -2
  132. data/src/cxx_supportlib/vendor-modified/boost/asio/posix/basic_stream_descriptor.hpp +2 -2
  133. data/src/cxx_supportlib/vendor-modified/boost/asio/post.hpp +17 -18
  134. data/src/cxx_supportlib/vendor-modified/boost/asio/spawn.hpp +3 -1
  135. data/src/cxx_supportlib/vendor-modified/boost/asio/ssl/detail/io.hpp +13 -3
  136. data/src/cxx_supportlib/vendor-modified/boost/asio/strand.hpp +11 -7
  137. data/src/cxx_supportlib/vendor-modified/boost/asio/system_executor.hpp +0 -13
  138. data/src/cxx_supportlib/vendor-modified/boost/asio/thread_pool.hpp +23 -18
  139. data/src/cxx_supportlib/vendor-modified/boost/asio/version.hpp +1 -1
  140. data/src/cxx_supportlib/vendor-modified/boost/asio/windows/basic_object_handle.hpp +2 -2
  141. data/src/cxx_supportlib/vendor-modified/boost/asio/windows/basic_overlapped_handle.hpp +1 -1
  142. data/src/cxx_supportlib/vendor-modified/boost/asio/windows/basic_random_access_handle.hpp +2 -2
  143. data/src/cxx_supportlib/vendor-modified/boost/asio/windows/basic_stream_handle.hpp +2 -2
  144. data/src/cxx_supportlib/vendor-modified/boost/asio.hpp +4 -0
  145. data/src/cxx_supportlib/vendor-modified/boost/bind/bind.hpp +1 -1
  146. data/src/cxx_supportlib/vendor-modified/boost/chrono/config.hpp +1 -0
  147. data/src/cxx_supportlib/vendor-modified/boost/chrono/detail/inlined/mac/chrono.hpp +4 -4
  148. data/src/cxx_supportlib/vendor-modified/boost/chrono/detail/scan_keyword.hpp +4 -2
  149. data/src/cxx_supportlib/vendor-modified/boost/chrono/duration.hpp +2 -2
  150. data/src/cxx_supportlib/vendor-modified/boost/chrono/io/duration_io.hpp +3 -3
  151. data/src/cxx_supportlib/vendor-modified/boost/chrono/io/duration_put.hpp +5 -5
  152. data/src/cxx_supportlib/vendor-modified/boost/chrono/io/duration_units.hpp +2 -2
  153. data/src/cxx_supportlib/vendor-modified/boost/chrono/io/time_point_io.hpp +2 -2
  154. data/src/cxx_supportlib/vendor-modified/boost/chrono/io/utility/ios_base_state_ptr.hpp +7 -7
  155. data/src/cxx_supportlib/vendor-modified/boost/chrono/time_point.hpp +1 -1
  156. data/src/cxx_supportlib/vendor-modified/boost/circular_buffer/details.hpp +5 -1
  157. data/src/cxx_supportlib/vendor-modified/boost/config/compiler/clang.hpp +10 -3
  158. data/src/cxx_supportlib/vendor-modified/boost/config/compiler/clang_version.hpp +9 -3
  159. data/src/cxx_supportlib/vendor-modified/boost/config/compiler/gcc.hpp +9 -3
  160. data/src/cxx_supportlib/vendor-modified/boost/config/compiler/sunpro_cc.hpp +6 -0
  161. data/src/cxx_supportlib/vendor-modified/boost/config/compiler/visualc.hpp +8 -0
  162. data/src/cxx_supportlib/vendor-modified/boost/config/compiler/xlcpp.hpp +4 -0
  163. data/src/cxx_supportlib/vendor-modified/boost/config/detail/suffix.hpp +33 -0
  164. data/src/cxx_supportlib/vendor-modified/boost/config/header_deprecated.hpp +1 -1
  165. data/src/cxx_supportlib/vendor-modified/boost/config/stdlib/libcpp.hpp +9 -0
  166. data/src/cxx_supportlib/vendor-modified/boost/config/stdlib/libstdcpp3.hpp +4 -2
  167. data/src/cxx_supportlib/vendor-modified/boost/container/allocator.hpp +1 -1
  168. data/src/cxx_supportlib/vendor-modified/boost/container/container_fwd.hpp +29 -0
  169. data/src/cxx_supportlib/vendor-modified/boost/container/deque.hpp +13 -13
  170. data/src/cxx_supportlib/vendor-modified/boost/container/detail/advanced_insert_int.hpp +80 -95
  171. data/src/cxx_supportlib/vendor-modified/boost/container/detail/config_begin.hpp +10 -0
  172. data/src/cxx_supportlib/vendor-modified/boost/container/detail/config_end.hpp +3 -0
  173. data/src/cxx_supportlib/vendor-modified/boost/container/detail/copy_move_algo.hpp +738 -34
  174. data/src/cxx_supportlib/vendor-modified/boost/container/detail/destroyers.hpp +38 -10
  175. data/src/cxx_supportlib/vendor-modified/boost/container/detail/flat_tree.hpp +1 -0
  176. data/src/cxx_supportlib/vendor-modified/boost/container/detail/iterator.hpp +2 -0
  177. data/src/cxx_supportlib/vendor-modified/boost/container/detail/workaround.hpp +3 -4
  178. data/src/cxx_supportlib/vendor-modified/boost/container/devector.hpp +1150 -1213
  179. data/src/cxx_supportlib/vendor-modified/boost/container/node_allocator.hpp +1 -1
  180. data/src/cxx_supportlib/vendor-modified/boost/container/options.hpp +104 -12
  181. data/src/cxx_supportlib/vendor-modified/boost/container/stable_vector.hpp +1 -0
  182. data/src/cxx_supportlib/vendor-modified/boost/container/string.hpp +11 -1
  183. data/src/cxx_supportlib/vendor-modified/boost/container/vector.hpp +31 -331
  184. data/src/cxx_supportlib/vendor-modified/boost/container_hash/detail/hash_mix.hpp +113 -0
  185. data/src/cxx_supportlib/vendor-modified/boost/container_hash/detail/hash_range.hpp +173 -0
  186. data/src/cxx_supportlib/vendor-modified/boost/container_hash/detail/hash_tuple.hpp +133 -0
  187. data/src/cxx_supportlib/vendor-modified/boost/container_hash/hash.hpp +461 -566
  188. data/src/cxx_supportlib/vendor-modified/boost/container_hash/hash_fwd.hpp +24 -24
  189. data/src/cxx_supportlib/vendor-modified/boost/container_hash/is_contiguous_range.hpp +91 -0
  190. data/src/cxx_supportlib/vendor-modified/boost/container_hash/is_described_class.hpp +38 -0
  191. data/src/cxx_supportlib/vendor-modified/boost/container_hash/is_range.hpp +73 -0
  192. data/src/cxx_supportlib/vendor-modified/boost/container_hash/is_unordered_range.hpp +39 -0
  193. data/src/cxx_supportlib/vendor-modified/boost/core/bit.hpp +32 -4
  194. data/src/cxx_supportlib/vendor-modified/boost/core/detail/string_view.hpp +16 -0
  195. data/src/cxx_supportlib/vendor-modified/boost/core/empty_value.hpp +16 -16
  196. data/src/cxx_supportlib/vendor-modified/boost/core/fclose_deleter.hpp +46 -0
  197. data/src/cxx_supportlib/vendor-modified/boost/date_time/date.hpp +1 -1
  198. data/src/cxx_supportlib/vendor-modified/boost/date_time/gregorian/formatters.hpp +3 -3
  199. data/src/cxx_supportlib/vendor-modified/boost/date_time/gregorian/formatters_limited.hpp +3 -3
  200. data/src/cxx_supportlib/vendor-modified/boost/date_time/gregorian/greg_date.hpp +12 -13
  201. data/src/cxx_supportlib/vendor-modified/boost/date_time/gregorian/parsers.hpp +2 -2
  202. data/src/cxx_supportlib/vendor-modified/boost/date_time/gregorian_calendar.ipp +2 -2
  203. data/src/cxx_supportlib/vendor-modified/boost/date_time/iso_format.hpp +13 -13
  204. data/src/cxx_supportlib/vendor-modified/boost/date_time/local_time/local_date_time.hpp +2 -2
  205. data/src/cxx_supportlib/vendor-modified/boost/date_time/posix_time/time_formatters.hpp +4 -4
  206. data/src/cxx_supportlib/vendor-modified/boost/date_time/posix_time/time_formatters_limited.hpp +2 -2
  207. data/src/cxx_supportlib/vendor-modified/boost/date_time/special_values_parser.hpp +1 -1
  208. data/src/cxx_supportlib/vendor-modified/boost/date_time/time_facet.hpp +1 -1
  209. data/src/cxx_supportlib/vendor-modified/boost/date_time/time_parsing.hpp +2 -2
  210. data/src/cxx_supportlib/vendor-modified/boost/describe/bases.hpp +50 -0
  211. data/src/cxx_supportlib/vendor-modified/boost/describe/detail/config.hpp +40 -0
  212. data/src/cxx_supportlib/vendor-modified/boost/describe/detail/cx_streq.hpp +30 -0
  213. data/src/cxx_supportlib/vendor-modified/boost/describe/detail/void_t.hpp +32 -0
  214. data/src/cxx_supportlib/vendor-modified/boost/describe/members.hpp +159 -0
  215. data/src/cxx_supportlib/vendor-modified/boost/describe/modifiers.hpp +33 -0
  216. data/src/cxx_supportlib/vendor-modified/boost/intrusive/avltree_algorithms.hpp +9 -9
  217. data/src/cxx_supportlib/vendor-modified/boost/intrusive/bstree_algorithms.hpp +45 -45
  218. data/src/cxx_supportlib/vendor-modified/boost/intrusive/detail/any_node_and_algorithms.hpp +8 -8
  219. data/src/cxx_supportlib/vendor-modified/boost/intrusive/detail/bstree_algorithms_base.hpp +37 -38
  220. data/src/cxx_supportlib/vendor-modified/boost/intrusive/detail/iterator.hpp +16 -0
  221. data/src/cxx_supportlib/vendor-modified/boost/intrusive/detail/workaround.hpp +1 -1
  222. data/src/cxx_supportlib/vendor-modified/boost/intrusive/hashtable.hpp +145 -90
  223. data/src/cxx_supportlib/vendor-modified/boost/intrusive/pack_options.hpp +2 -0
  224. data/src/cxx_supportlib/vendor-modified/boost/intrusive/rbtree_algorithms.hpp +7 -7
  225. data/src/cxx_supportlib/vendor-modified/boost/intrusive/sgtree_algorithms.hpp +5 -5
  226. data/src/cxx_supportlib/vendor-modified/boost/intrusive/splaytree_algorithms.hpp +11 -9
  227. data/src/cxx_supportlib/vendor-modified/boost/intrusive/treap_algorithms.hpp +7 -7
  228. data/src/cxx_supportlib/vendor-modified/boost/iterator/iterator_facade.hpp +106 -25
  229. data/src/cxx_supportlib/vendor-modified/boost/lexical_cast/detail/converter_lexical_streams.hpp +1 -1
  230. data/src/cxx_supportlib/vendor-modified/boost/lexical_cast/detail/converter_numeric.hpp +8 -5
  231. data/src/cxx_supportlib/vendor-modified/boost/lexical_cast/detail/lcast_unsigned_converters.hpp +1 -1
  232. data/src/cxx_supportlib/vendor-modified/boost/move/algo/detail/adaptive_sort_merge.hpp +4 -2
  233. data/src/cxx_supportlib/vendor-modified/boost/move/algo/detail/pdqsort.hpp +2 -1
  234. data/src/cxx_supportlib/vendor-modified/boost/move/detail/type_traits.hpp +8 -4
  235. data/src/cxx_supportlib/vendor-modified/boost/mp11/bind.hpp +111 -0
  236. data/src/cxx_supportlib/vendor-modified/boost/mp11/version.hpp +1 -1
  237. data/src/cxx_supportlib/vendor-modified/boost/numeric/conversion/detail/int_float_mixture.hpp +5 -5
  238. data/src/cxx_supportlib/vendor-modified/boost/numeric/conversion/detail/sign_mixture.hpp +5 -5
  239. data/src/cxx_supportlib/vendor-modified/boost/numeric/conversion/detail/udt_builtin_mixture.hpp +5 -5
  240. data/src/cxx_supportlib/vendor-modified/boost/preprocessor/variadic/has_opt.hpp +6 -2
  241. data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/detail/spinlock_gcc_atomic.hpp +11 -2
  242. data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/intrusive_ptr.hpp +1 -1
  243. data/src/cxx_supportlib/vendor-modified/boost/system/detail/config.hpp +7 -1
  244. data/src/cxx_supportlib/vendor-modified/boost/system/detail/error_category.hpp +2 -2
  245. data/src/cxx_supportlib/vendor-modified/boost/system/detail/error_category_impl.hpp +10 -1
  246. data/src/cxx_supportlib/vendor-modified/boost/system/detail/error_code.hpp +38 -43
  247. data/src/cxx_supportlib/vendor-modified/boost/system/detail/error_condition.hpp +52 -0
  248. data/src/cxx_supportlib/vendor-modified/boost/throw_exception.hpp +1 -1
  249. data/src/cxx_supportlib/vendor-modified/boost/type_traits/detail/is_function_ptr_helper.hpp +27 -27
  250. data/src/cxx_supportlib/vendor-modified/boost/type_traits/detail/is_mem_fun_pointer_impl.hpp +27 -27
  251. data/src/cxx_supportlib/vendor-modified/boost/type_traits/intrinsics.hpp +22 -8
  252. data/src/cxx_supportlib/vendor-modified/boost/unordered/detail/fca.hpp +37 -7
  253. data/src/cxx_supportlib/vendor-modified/boost/unordered/detail/foa.hpp +1921 -0
  254. data/src/cxx_supportlib/vendor-modified/boost/unordered/detail/implementation.hpp +66 -82
  255. data/src/cxx_supportlib/vendor-modified/boost/unordered/detail/prime_fmod.hpp +6 -0
  256. data/src/cxx_supportlib/vendor-modified/boost/unordered/detail/type_traits.hpp +109 -0
  257. data/src/cxx_supportlib/vendor-modified/boost/unordered/detail/xmx.hpp +75 -0
  258. data/src/cxx_supportlib/vendor-modified/boost/unordered/hash_traits.hpp +45 -0
  259. data/src/cxx_supportlib/vendor-modified/boost/unordered/unordered_flat_map.hpp +732 -0
  260. data/src/cxx_supportlib/vendor-modified/boost/unordered/unordered_flat_map_fwd.hpp +49 -0
  261. data/src/cxx_supportlib/vendor-modified/boost/unordered/unordered_flat_set.hpp +586 -0
  262. data/src/cxx_supportlib/vendor-modified/boost/unordered/unordered_flat_set_fwd.hpp +49 -0
  263. data/src/cxx_supportlib/vendor-modified/boost/unordered/unordered_map.hpp +166 -66
  264. data/src/cxx_supportlib/vendor-modified/boost/unordered/unordered_set.hpp +145 -28
  265. data/src/cxx_supportlib/vendor-modified/boost/version.hpp +2 -2
  266. data/src/cxx_supportlib/vendor-modified/websocketpp/websocketpp/common/md5.hpp +1 -1
  267. data/src/ruby_native_extension/extconf.rb +1 -1
  268. data/src/ruby_supportlib/phusion_passenger/native_support.rb +4 -2
  269. data/src/ruby_supportlib/phusion_passenger/platform_info/operating_system.rb +1 -1
  270. data/src/ruby_supportlib/phusion_passenger/public_api.rb +3 -0
  271. data/src/ruby_supportlib/phusion_passenger/utils.rb +1 -0
  272. data/src/ruby_supportlib/phusion_passenger.rb +5 -5
  273. metadata +36 -19
  274. data/src/cxx_supportlib/vendor-modified/boost/align/align.hpp +0 -19
  275. data/src/cxx_supportlib/vendor-modified/boost/align/alignment_of.hpp +0 -54
  276. data/src/cxx_supportlib/vendor-modified/boost/align/alignment_of_forward.hpp +0 -20
  277. data/src/cxx_supportlib/vendor-modified/boost/align/detail/align_cxx11.hpp +0 -21
  278. data/src/cxx_supportlib/vendor-modified/boost/align/detail/aligned_alloc.hpp +0 -52
  279. data/src/cxx_supportlib/vendor-modified/boost/align/detail/alignment_of.hpp +0 -31
  280. data/src/cxx_supportlib/vendor-modified/boost/align/detail/alignment_of_cxx11.hpp +0 -23
  281. data/src/cxx_supportlib/vendor-modified/boost/align/detail/element_type.hpp +0 -91
  282. data/src/cxx_supportlib/vendor-modified/boost/align/detail/integral_constant.hpp +0 -53
  283. data/src/cxx_supportlib/vendor-modified/boost/align/detail/min_size.hpp +0 -26
  284. data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/detail/completion_handler_erasure.hpp +0 -196
  285. data/src/cxx_supportlib/vendor-modified/boost/asio/impl/compose.hpp +0 -709
  286. data/src/cxx_supportlib/vendor-modified/boost/container_hash/detail/float_functions.hpp +0 -336
  287. data/src/cxx_supportlib/vendor-modified/boost/container_hash/detail/hash_float.hpp +0 -271
  288. data/src/cxx_supportlib/vendor-modified/boost/container_hash/detail/limits.hpp +0 -62
  289. data/src/cxx_supportlib/vendor-modified/boost/container_hash/extensions.hpp +0 -361
  290. data/src/cxx_supportlib/vendor-modified/boost/detail/container_fwd.hpp +0 -157
@@ -0,0 +1,732 @@
1
+ // Copyright (C) 2022 Christian Mazakas
2
+ // Distributed under the Boost Software License, Version 1.0. (See accompanying
3
+ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
4
+
5
+ #ifndef BOOST_UNORDERED_UNORDERED_FLAT_MAP_HPP_INCLUDED
6
+ #define BOOST_UNORDERED_UNORDERED_FLAT_MAP_HPP_INCLUDED
7
+
8
+ #include <boost/config.hpp>
9
+ #if defined(BOOST_HAS_PRAGMA_ONCE)
10
+ #pragma once
11
+ #endif
12
+
13
+ #include <boost/unordered/detail/foa.hpp>
14
+ #include <boost/unordered/detail/type_traits.hpp>
15
+ #include <boost/unordered/unordered_flat_map_fwd.hpp>
16
+
17
+ #include <boost/core/allocator_access.hpp>
18
+ #include <boost/functional/hash.hpp>
19
+ #include <boost/throw_exception.hpp>
20
+
21
+ #include <initializer_list>
22
+ #include <iterator>
23
+ #include <stdexcept>
24
+ #include <type_traits>
25
+ #include <utility>
26
+
27
+ namespace boost {
28
+ namespace unordered {
29
+
30
+ #if defined(BOOST_MSVC)
31
+ #pragma warning(push)
32
+ #pragma warning(disable : 4714) /* marked as __forceinline not inlined */
33
+ #endif
34
+
35
+ template <class Key, class T, class Hash, class KeyEqual, class Allocator>
36
+ class unordered_flat_map
37
+ {
38
+ struct map_types
39
+ {
40
+ using key_type = Key;
41
+ using raw_key_type = typename std::remove_const<Key>::type;
42
+ using raw_mapped_type = typename std::remove_const<T>::type;
43
+
44
+ using init_type = std::pair<raw_key_type, raw_mapped_type>;
45
+ using moved_type = std::pair<raw_key_type&&, raw_mapped_type&&>;
46
+ using value_type = std::pair<Key const, T>;
47
+
48
+ template <class K, class V>
49
+ static raw_key_type const& extract(std::pair<K, V> const& kv)
50
+ {
51
+ return kv.first;
52
+ }
53
+
54
+ static moved_type move(value_type& x)
55
+ {
56
+ // TODO: we probably need to launder here
57
+ return {std::move(const_cast<raw_key_type&>(x.first)),
58
+ std::move(const_cast<raw_mapped_type&>(x.second))};
59
+ }
60
+ };
61
+
62
+ using table_type = detail::foa::table<map_types, Hash, KeyEqual,
63
+ typename boost::allocator_rebind<Allocator,
64
+ typename map_types::value_type>::type>;
65
+
66
+ table_type table_;
67
+
68
+ template <class K, class V, class H, class KE, class A, class Pred>
69
+ typename unordered_flat_map<K, V, H, KE, A>::size_type friend erase_if(
70
+ unordered_flat_map<K, V, H, KE, A>& set, Pred pred);
71
+
72
+ public:
73
+ using key_type = Key;
74
+ using mapped_type = T;
75
+ using value_type = typename map_types::value_type;
76
+ using init_type = typename map_types::init_type;
77
+ using size_type = std::size_t;
78
+ using difference_type = std::ptrdiff_t;
79
+ using hasher = typename boost::type_identity<Hash>::type;
80
+ using key_equal = typename boost::type_identity<KeyEqual>::type;
81
+ using allocator_type = typename boost::type_identity<Allocator>::type;
82
+ using reference = value_type&;
83
+ using const_reference = value_type const&;
84
+ using pointer = typename boost::allocator_pointer<allocator_type>::type;
85
+ using const_pointer =
86
+ typename boost::allocator_const_pointer<allocator_type>::type;
87
+ using iterator = typename table_type::iterator;
88
+ using const_iterator = typename table_type::const_iterator;
89
+
90
+ unordered_flat_map() : unordered_flat_map(0) {}
91
+
92
+ explicit unordered_flat_map(size_type n, hasher const& h = hasher(),
93
+ key_equal const& pred = key_equal(),
94
+ allocator_type const& a = allocator_type())
95
+ : table_(n, h, pred, a)
96
+ {
97
+ }
98
+
99
+ unordered_flat_map(size_type n, allocator_type const& a)
100
+ : unordered_flat_map(n, hasher(), key_equal(), a)
101
+ {
102
+ }
103
+
104
+ unordered_flat_map(size_type n, hasher const& h, allocator_type const& a)
105
+ : unordered_flat_map(n, h, key_equal(), a)
106
+ {
107
+ }
108
+
109
+ template <class InputIterator>
110
+ unordered_flat_map(
111
+ InputIterator f, InputIterator l, allocator_type const& a)
112
+ : unordered_flat_map(f, l, size_type(0), hasher(), key_equal(), a)
113
+ {
114
+ }
115
+
116
+ explicit unordered_flat_map(allocator_type const& a)
117
+ : unordered_flat_map(0, a)
118
+ {
119
+ }
120
+
121
+ template <class Iterator>
122
+ unordered_flat_map(Iterator first, Iterator last, size_type n = 0,
123
+ hasher const& h = hasher(), key_equal const& pred = key_equal(),
124
+ allocator_type const& a = allocator_type())
125
+ : unordered_flat_map(n, h, pred, a)
126
+ {
127
+ this->insert(first, last);
128
+ }
129
+
130
+ template <class Iterator>
131
+ unordered_flat_map(
132
+ Iterator first, Iterator last, size_type n, allocator_type const& a)
133
+ : unordered_flat_map(first, last, n, hasher(), key_equal(), a)
134
+ {
135
+ }
136
+
137
+ template <class Iterator>
138
+ unordered_flat_map(Iterator first, Iterator last, size_type n,
139
+ hasher const& h, allocator_type const& a)
140
+ : unordered_flat_map(first, last, n, h, key_equal(), a)
141
+ {
142
+ }
143
+
144
+ unordered_flat_map(unordered_flat_map const& other) : table_(other.table_)
145
+ {
146
+ }
147
+
148
+ unordered_flat_map(
149
+ unordered_flat_map const& other, allocator_type const& a)
150
+ : table_(other.table_, a)
151
+ {
152
+ }
153
+
154
+ unordered_flat_map(unordered_flat_map&& other)
155
+ noexcept(std::is_nothrow_move_constructible<hasher>::value&&
156
+ std::is_nothrow_move_constructible<key_equal>::value&&
157
+ std::is_nothrow_move_constructible<allocator_type>::value)
158
+ : table_(std::move(other.table_))
159
+ {
160
+ }
161
+
162
+ unordered_flat_map(unordered_flat_map&& other, allocator_type const& al)
163
+ : table_(std::move(other.table_), al)
164
+ {
165
+ }
166
+
167
+ unordered_flat_map(std::initializer_list<value_type> ilist,
168
+ size_type n = 0, hasher const& h = hasher(),
169
+ key_equal const& pred = key_equal(),
170
+ allocator_type const& a = allocator_type())
171
+ : unordered_flat_map(ilist.begin(), ilist.end(), n, h, pred, a)
172
+ {
173
+ }
174
+
175
+ unordered_flat_map(
176
+ std::initializer_list<value_type> il, allocator_type const& a)
177
+ : unordered_flat_map(il, size_type(0), hasher(), key_equal(), a)
178
+ {
179
+ }
180
+
181
+ unordered_flat_map(std::initializer_list<value_type> init, size_type n,
182
+ allocator_type const& a)
183
+ : unordered_flat_map(init, n, hasher(), key_equal(), a)
184
+ {
185
+ }
186
+
187
+ unordered_flat_map(std::initializer_list<value_type> init, size_type n,
188
+ hasher const& h, allocator_type const& a)
189
+ : unordered_flat_map(init, n, h, key_equal(), a)
190
+ {
191
+ }
192
+
193
+ ~unordered_flat_map() = default;
194
+
195
+ unordered_flat_map& operator=(unordered_flat_map const& other)
196
+ {
197
+ table_ = other.table_;
198
+ return *this;
199
+ }
200
+
201
+ unordered_flat_map& operator=(unordered_flat_map&& other) noexcept(
202
+ noexcept(std::declval<table_type&>() = std::declval<table_type&&>()))
203
+ {
204
+ table_ = std::move(other.table_);
205
+ return *this;
206
+ }
207
+
208
+ allocator_type get_allocator() const noexcept
209
+ {
210
+ return table_.get_allocator();
211
+ }
212
+
213
+ /// Iterators
214
+ ///
215
+
216
+ iterator begin() noexcept { return table_.begin(); }
217
+ const_iterator begin() const noexcept { return table_.begin(); }
218
+ const_iterator cbegin() const noexcept { return table_.cbegin(); }
219
+
220
+ iterator end() noexcept { return table_.end(); }
221
+ const_iterator end() const noexcept { return table_.end(); }
222
+ const_iterator cend() const noexcept { return table_.cend(); }
223
+
224
+ /// Capacity
225
+ ///
226
+
227
+ BOOST_ATTRIBUTE_NODISCARD bool empty() const noexcept
228
+ {
229
+ return table_.empty();
230
+ }
231
+
232
+ size_type size() const noexcept { return table_.size(); }
233
+
234
+ size_type max_size() const noexcept { return table_.max_size(); }
235
+
236
+ /// Modifiers
237
+ ///
238
+
239
+ void clear() noexcept { table_.clear(); }
240
+
241
+ template <class Ty>
242
+ BOOST_FORCEINLINE auto insert(Ty&& value)
243
+ -> decltype(table_.insert(std::forward<Ty>(value)))
244
+ {
245
+ return table_.insert(std::forward<Ty>(value));
246
+ }
247
+
248
+ BOOST_FORCEINLINE std::pair<iterator, bool> insert(init_type&& value)
249
+ {
250
+ return table_.insert(std::move(value));
251
+ }
252
+
253
+ template <class Ty>
254
+ BOOST_FORCEINLINE auto insert(const_iterator, Ty&& value)
255
+ -> decltype(table_.insert(std::forward<Ty>(value)).first)
256
+ {
257
+ return table_.insert(std::forward<Ty>(value)).first;
258
+ }
259
+
260
+ BOOST_FORCEINLINE iterator insert(const_iterator, init_type&& value)
261
+ {
262
+ return table_.insert(std::move(value)).first;
263
+ }
264
+
265
+ template <class InputIterator>
266
+ BOOST_FORCEINLINE void insert(InputIterator first, InputIterator last)
267
+ {
268
+ for (auto pos = first; pos != last; ++pos) {
269
+ table_.emplace(*pos);
270
+ }
271
+ }
272
+
273
+ void insert(std::initializer_list<value_type> ilist)
274
+ {
275
+ this->insert(ilist.begin(), ilist.end());
276
+ }
277
+
278
+ template <class M>
279
+ std::pair<iterator, bool> insert_or_assign(key_type const& key, M&& obj)
280
+ {
281
+ auto iter_bool_pair = table_.try_emplace(key, std::forward<M>(obj));
282
+ if (iter_bool_pair.second) {
283
+ return iter_bool_pair;
284
+ }
285
+ iter_bool_pair.first->second = std::forward<M>(obj);
286
+ return iter_bool_pair;
287
+ }
288
+
289
+ template <class M>
290
+ std::pair<iterator, bool> insert_or_assign(key_type&& key, M&& obj)
291
+ {
292
+ auto iter_bool_pair =
293
+ table_.try_emplace(std::move(key), std::forward<M>(obj));
294
+ if (iter_bool_pair.second) {
295
+ return iter_bool_pair;
296
+ }
297
+ iter_bool_pair.first->second = std::forward<M>(obj);
298
+ return iter_bool_pair;
299
+ }
300
+
301
+ template <class M>
302
+ iterator insert_or_assign(const_iterator, key_type const& key, M&& obj)
303
+ {
304
+ return this->insert_or_assign(key, std::forward<M>(obj)).first;
305
+ }
306
+
307
+ template <class M>
308
+ iterator insert_or_assign(const_iterator, key_type&& key, M&& obj)
309
+ {
310
+ return this->insert_or_assign(std::move(key), std::forward<M>(obj))
311
+ .first;
312
+ }
313
+
314
+ template <class... Args>
315
+ BOOST_FORCEINLINE std::pair<iterator, bool> emplace(Args&&... args)
316
+ {
317
+ return table_.emplace(std::forward<Args>(args)...);
318
+ }
319
+
320
+ template <class... Args>
321
+ BOOST_FORCEINLINE iterator emplace_hint(const_iterator, Args&&... args)
322
+ {
323
+ return table_.emplace(std::forward<Args>(args)...).first;
324
+ }
325
+
326
+ template <class... Args>
327
+ BOOST_FORCEINLINE std::pair<iterator, bool> try_emplace(
328
+ key_type const& key, Args&&... args)
329
+ {
330
+ return table_.try_emplace(key, std::forward<Args>(args)...);
331
+ }
332
+
333
+ template <class... Args>
334
+ BOOST_FORCEINLINE std::pair<iterator, bool> try_emplace(
335
+ key_type&& key, Args&&... args)
336
+ {
337
+ return table_.try_emplace(std::move(key), std::forward<Args>(args)...);
338
+ }
339
+
340
+ template <class... Args>
341
+ BOOST_FORCEINLINE iterator try_emplace(
342
+ const_iterator, key_type const& key, Args&&... args)
343
+ {
344
+ return table_.try_emplace(key, std::forward<Args>(args)...).first;
345
+ }
346
+
347
+ template <class... Args>
348
+ BOOST_FORCEINLINE iterator try_emplace(
349
+ const_iterator, key_type&& key, Args&&... args)
350
+ {
351
+ return table_.try_emplace(std::move(key), std::forward<Args>(args)...)
352
+ .first;
353
+ }
354
+
355
+ BOOST_FORCEINLINE void erase(iterator pos) { table_.erase(pos); }
356
+ BOOST_FORCEINLINE void erase(const_iterator pos)
357
+ {
358
+ return table_.erase(pos);
359
+ }
360
+ iterator erase(const_iterator first, const_iterator last)
361
+ {
362
+ while (first != last) {
363
+ this->erase(first++);
364
+ }
365
+ return iterator{detail::foa::const_iterator_cast_tag{}, last};
366
+ }
367
+
368
+ BOOST_FORCEINLINE size_type erase(key_type const& key)
369
+ {
370
+ return table_.erase(key);
371
+ }
372
+
373
+ template <class K>
374
+ BOOST_FORCEINLINE typename std::enable_if<
375
+ detail::transparent_non_iterable<K, unordered_flat_map>::value,
376
+ size_type>::type
377
+ erase(K const& key)
378
+ {
379
+ return table_.erase(key);
380
+ }
381
+
382
+ void swap(unordered_flat_map& rhs) noexcept(
383
+ noexcept(std::declval<table_type&>().swap(std::declval<table_type&>())))
384
+ {
385
+ table_.swap(rhs.table_);
386
+ }
387
+
388
+ template <class H2, class P2>
389
+ void merge(
390
+ unordered_flat_map<key_type, mapped_type, H2, P2, allocator_type>&
391
+ source)
392
+ {
393
+ table_.merge(source.table_);
394
+ }
395
+
396
+ template <class H2, class P2>
397
+ void merge(
398
+ unordered_flat_map<key_type, mapped_type, H2, P2, allocator_type>&&
399
+ source)
400
+ {
401
+ table_.merge(std::move(source.table_));
402
+ }
403
+
404
+ /// Lookup
405
+ ///
406
+
407
+ mapped_type& at(key_type const& key)
408
+ {
409
+ auto pos = table_.find(key);
410
+ if (pos != table_.end()) {
411
+ return pos->second;
412
+ }
413
+ // TODO: someday refactor this to conditionally serialize the key and
414
+ // include it in the error message
415
+ //
416
+ boost::throw_exception(
417
+ std::out_of_range("key was not found in unordered_flat_map"));
418
+ }
419
+
420
+ mapped_type const& at(key_type const& key) const
421
+ {
422
+ auto pos = table_.find(key);
423
+ if (pos != table_.end()) {
424
+ return pos->second;
425
+ }
426
+ boost::throw_exception(
427
+ std::out_of_range("key was not found in unordered_flat_map"));
428
+ }
429
+
430
+ BOOST_FORCEINLINE mapped_type& operator[](key_type const& key)
431
+ {
432
+ return table_.try_emplace(key).first->second;
433
+ }
434
+
435
+ BOOST_FORCEINLINE mapped_type& operator[](key_type&& key)
436
+ {
437
+ return table_.try_emplace(std::move(key)).first->second;
438
+ }
439
+
440
+ BOOST_FORCEINLINE size_type count(key_type const& key) const
441
+ {
442
+ auto pos = table_.find(key);
443
+ return pos != table_.end() ? 1 : 0;
444
+ }
445
+
446
+ template <class K>
447
+ BOOST_FORCEINLINE typename std::enable_if<
448
+ detail::are_transparent<K, hasher, key_equal>::value, size_type>::type
449
+ count(K const& key) const
450
+ {
451
+ auto pos = table_.find(key);
452
+ return pos != table_.end() ? 1 : 0;
453
+ }
454
+
455
+ BOOST_FORCEINLINE iterator find(key_type const& key)
456
+ {
457
+ return table_.find(key);
458
+ }
459
+
460
+ BOOST_FORCEINLINE const_iterator find(key_type const& key) const
461
+ {
462
+ return table_.find(key);
463
+ }
464
+
465
+ template <class K>
466
+ BOOST_FORCEINLINE typename std::enable_if<
467
+ boost::unordered::detail::are_transparent<K, hasher, key_equal>::value,
468
+ iterator>::type
469
+ find(K const& key)
470
+ {
471
+ return table_.find(key);
472
+ }
473
+
474
+ template <class K>
475
+ BOOST_FORCEINLINE typename std::enable_if<
476
+ boost::unordered::detail::are_transparent<K, hasher, key_equal>::value,
477
+ const_iterator>::type
478
+ find(K const& key) const
479
+ {
480
+ return table_.find(key);
481
+ }
482
+
483
+ BOOST_FORCEINLINE bool contains(key_type const& key) const
484
+ {
485
+ return this->find(key) != this->end();
486
+ }
487
+
488
+ template <class K>
489
+ BOOST_FORCEINLINE typename std::enable_if<
490
+ boost::unordered::detail::are_transparent<K, hasher, key_equal>::value,
491
+ bool>::type
492
+ contains(K const& key) const
493
+ {
494
+ return this->find(key) != this->end();
495
+ }
496
+
497
+ std::pair<iterator, iterator> equal_range(key_type const& key)
498
+ {
499
+ auto pos = table_.find(key);
500
+ if (pos == table_.end()) {
501
+ return {pos, pos};
502
+ }
503
+
504
+ auto next = pos;
505
+ ++next;
506
+ return {pos, next};
507
+ }
508
+
509
+ std::pair<const_iterator, const_iterator> equal_range(
510
+ key_type const& key) const
511
+ {
512
+ auto pos = table_.find(key);
513
+ if (pos == table_.end()) {
514
+ return {pos, pos};
515
+ }
516
+
517
+ auto next = pos;
518
+ ++next;
519
+ return {pos, next};
520
+ }
521
+
522
+ template <class K>
523
+ typename std::enable_if<
524
+ detail::are_transparent<K, hasher, key_equal>::value,
525
+ std::pair<iterator, iterator> >::type
526
+ equal_range(K const& key)
527
+ {
528
+ auto pos = table_.find(key);
529
+ if (pos == table_.end()) {
530
+ return {pos, pos};
531
+ }
532
+
533
+ auto next = pos;
534
+ ++next;
535
+ return {pos, next};
536
+ }
537
+
538
+ template <class K>
539
+ typename std::enable_if<
540
+ detail::are_transparent<K, hasher, key_equal>::value,
541
+ std::pair<const_iterator, const_iterator> >::type
542
+ equal_range(K const& key) const
543
+ {
544
+ auto pos = table_.find(key);
545
+ if (pos == table_.end()) {
546
+ return {pos, pos};
547
+ }
548
+
549
+ auto next = pos;
550
+ ++next;
551
+ return {pos, next};
552
+ }
553
+
554
+ /// Hash Policy
555
+ ///
556
+
557
+ size_type bucket_count() const noexcept { return table_.capacity(); }
558
+
559
+ float load_factor() const noexcept { return table_.load_factor(); }
560
+
561
+ float max_load_factor() const noexcept
562
+ {
563
+ return table_.max_load_factor();
564
+ }
565
+
566
+ void max_load_factor(float) {}
567
+
568
+ size_type max_load() const noexcept { return table_.max_load(); }
569
+
570
+ void rehash(size_type n) { table_.rehash(n); }
571
+
572
+ void reserve(size_type n) { table_.reserve(n); }
573
+
574
+ /// Observers
575
+ ///
576
+
577
+ hasher hash_function() const { return table_.hash_function(); }
578
+
579
+ key_equal key_eq() const { return table_.key_eq(); }
580
+ };
581
+
582
+ template <class Key, class T, class Hash, class KeyEqual, class Allocator>
583
+ bool operator==(
584
+ unordered_flat_map<Key, T, Hash, KeyEqual, Allocator> const& lhs,
585
+ unordered_flat_map<Key, T, Hash, KeyEqual, Allocator> const& rhs)
586
+ {
587
+ if (&lhs == &rhs) {
588
+ return true;
589
+ }
590
+
591
+ return (lhs.size() == rhs.size()) && ([&] {
592
+ for (auto const& kvp : lhs) {
593
+ auto pos = rhs.find(kvp.first);
594
+ if ((pos == rhs.end()) || (*pos != kvp)) {
595
+ return false;
596
+ }
597
+ }
598
+ return true;
599
+ })();
600
+ }
601
+
602
+ template <class Key, class T, class Hash, class KeyEqual, class Allocator>
603
+ bool operator!=(
604
+ unordered_flat_map<Key, T, Hash, KeyEqual, Allocator> const& lhs,
605
+ unordered_flat_map<Key, T, Hash, KeyEqual, Allocator> const& rhs)
606
+ {
607
+ return !(lhs == rhs);
608
+ }
609
+
610
+ template <class Key, class T, class Hash, class KeyEqual, class Allocator>
611
+ void swap(unordered_flat_map<Key, T, Hash, KeyEqual, Allocator>& lhs,
612
+ unordered_flat_map<Key, T, Hash, KeyEqual, Allocator>& rhs)
613
+ noexcept(noexcept(lhs.swap(rhs)))
614
+ {
615
+ lhs.swap(rhs);
616
+ }
617
+
618
+ template <class Key, class T, class Hash, class KeyEqual, class Allocator,
619
+ class Pred>
620
+ typename unordered_flat_map<Key, T, Hash, KeyEqual, Allocator>::size_type
621
+ erase_if(
622
+ unordered_flat_map<Key, T, Hash, KeyEqual, Allocator>& map, Pred pred)
623
+ {
624
+ return erase_if(map.table_, pred);
625
+ }
626
+
627
+ #if defined(BOOST_MSVC)
628
+ #pragma warning(pop) /* C4714 */
629
+ #endif
630
+
631
+ #if BOOST_UNORDERED_TEMPLATE_DEDUCTION_GUIDES
632
+
633
+ namespace detail {
634
+ template <typename T>
635
+ using iter_key_t =
636
+ typename std::iterator_traits<T>::value_type::first_type;
637
+ template <typename T>
638
+ using iter_val_t =
639
+ typename std::iterator_traits<T>::value_type::second_type;
640
+ template <typename T>
641
+ using iter_to_alloc_t =
642
+ typename std::pair<iter_key_t<T> const, iter_val_t<T> >;
643
+ } // namespace detail
644
+
645
+ template <class InputIterator,
646
+ class Hash =
647
+ boost::hash<boost::unordered::detail::iter_key_t<InputIterator> >,
648
+ class Pred =
649
+ std::equal_to<boost::unordered::detail::iter_key_t<InputIterator> >,
650
+ class Allocator = std::allocator<
651
+ boost::unordered::detail::iter_to_alloc_t<InputIterator> >,
652
+ class = boost::enable_if_t<detail::is_input_iterator_v<InputIterator> >,
653
+ class = boost::enable_if_t<detail::is_hash_v<Hash> >,
654
+ class = boost::enable_if_t<detail::is_pred_v<Pred> >,
655
+ class = boost::enable_if_t<detail::is_allocator_v<Allocator> > >
656
+ unordered_flat_map(InputIterator, InputIterator,
657
+ std::size_t = boost::unordered::detail::foa::default_bucket_count,
658
+ Hash = Hash(), Pred = Pred(), Allocator = Allocator())
659
+ -> unordered_flat_map<boost::unordered::detail::iter_key_t<InputIterator>,
660
+ boost::unordered::detail::iter_val_t<InputIterator>, Hash, Pred,
661
+ Allocator>;
662
+
663
+ template <class Key, class T,
664
+ class Hash = boost::hash<boost::remove_const_t<Key> >,
665
+ class Pred = std::equal_to<boost::remove_const_t<Key> >,
666
+ class Allocator = std::allocator<std::pair<const Key, T> >,
667
+ class = boost::enable_if_t<detail::is_hash_v<Hash> >,
668
+ class = boost::enable_if_t<detail::is_pred_v<Pred> >,
669
+ class = boost::enable_if_t<detail::is_allocator_v<Allocator> > >
670
+ unordered_flat_map(std::initializer_list<std::pair<Key, T> >,
671
+ std::size_t = boost::unordered::detail::foa::default_bucket_count,
672
+ Hash = Hash(), Pred = Pred(), Allocator = Allocator())
673
+ -> unordered_flat_map<boost::remove_const_t<Key>, T, Hash, Pred,
674
+ Allocator>;
675
+
676
+ template <class InputIterator, class Allocator,
677
+ class = boost::enable_if_t<detail::is_input_iterator_v<InputIterator> >,
678
+ class = boost::enable_if_t<detail::is_allocator_v<Allocator> > >
679
+ unordered_flat_map(InputIterator, InputIterator, std::size_t, Allocator)
680
+ -> unordered_flat_map<boost::unordered::detail::iter_key_t<InputIterator>,
681
+ boost::unordered::detail::iter_val_t<InputIterator>,
682
+ boost::hash<boost::unordered::detail::iter_key_t<InputIterator> >,
683
+ std::equal_to<boost::unordered::detail::iter_key_t<InputIterator> >,
684
+ Allocator>;
685
+
686
+ template <class InputIterator, class Allocator,
687
+ class = boost::enable_if_t<detail::is_input_iterator_v<InputIterator> >,
688
+ class = boost::enable_if_t<detail::is_allocator_v<Allocator> > >
689
+ unordered_flat_map(InputIterator, InputIterator, Allocator)
690
+ -> unordered_flat_map<boost::unordered::detail::iter_key_t<InputIterator>,
691
+ boost::unordered::detail::iter_val_t<InputIterator>,
692
+ boost::hash<boost::unordered::detail::iter_key_t<InputIterator> >,
693
+ std::equal_to<boost::unordered::detail::iter_key_t<InputIterator> >,
694
+ Allocator>;
695
+
696
+ template <class InputIterator, class Hash, class Allocator,
697
+ class = boost::enable_if_t<detail::is_hash_v<Hash> >,
698
+ class = boost::enable_if_t<detail::is_input_iterator_v<InputIterator> >,
699
+ class = boost::enable_if_t<detail::is_allocator_v<Allocator> > >
700
+ unordered_flat_map(
701
+ InputIterator, InputIterator, std::size_t, Hash, Allocator)
702
+ -> unordered_flat_map<boost::unordered::detail::iter_key_t<InputIterator>,
703
+ boost::unordered::detail::iter_val_t<InputIterator>, Hash,
704
+ std::equal_to<boost::unordered::detail::iter_key_t<InputIterator> >,
705
+ Allocator>;
706
+
707
+ template <class Key, class T, class Allocator,
708
+ class = boost::enable_if_t<detail::is_allocator_v<Allocator> > >
709
+ unordered_flat_map(std::initializer_list<std::pair<Key, T> >, std::size_t,
710
+ Allocator) -> unordered_flat_map<boost::remove_const_t<Key>, T,
711
+ boost::hash<boost::remove_const_t<Key> >,
712
+ std::equal_to<boost::remove_const_t<Key> >, Allocator>;
713
+
714
+ template <class Key, class T, class Allocator,
715
+ class = boost::enable_if_t<detail::is_allocator_v<Allocator> > >
716
+ unordered_flat_map(std::initializer_list<std::pair<Key, T> >, Allocator)
717
+ -> unordered_flat_map<boost::remove_const_t<Key>, T,
718
+ boost::hash<boost::remove_const_t<Key> >,
719
+ std::equal_to<boost::remove_const_t<Key> >, Allocator>;
720
+
721
+ template <class Key, class T, class Hash, class Allocator,
722
+ class = boost::enable_if_t<detail::is_hash_v<Hash> >,
723
+ class = boost::enable_if_t<detail::is_allocator_v<Allocator> > >
724
+ unordered_flat_map(std::initializer_list<std::pair<Key, T> >, std::size_t,
725
+ Hash, Allocator) -> unordered_flat_map<boost::remove_const_t<Key>, T,
726
+ Hash, std::equal_to<boost::remove_const_t<Key> >, Allocator>;
727
+ #endif
728
+
729
+ } // namespace unordered
730
+ } // namespace boost
731
+
732
+ #endif