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
@@ -1,35 +1,50 @@
1
-
2
1
  // Copyright 2005-2014 Daniel James.
3
- // Distributed under the Boost Software License, Version 1.0. (See accompanying
4
- // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
5
-
6
- // Based on Peter Dimov's proposal
7
- // http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2005/n1756.pdf
8
- // issue 6.18.
9
- //
10
- // This also contains public domain code from MurmurHash. From the
11
- // MurmurHash header:
2
+ // Copyright 2021, 2022 Peter Dimov.
3
+ // Distributed under the Boost Software License, Version 1.0.
4
+ // https://www.boost.org/LICENSE_1_0.txt
12
5
 
13
- // MurmurHash3 was written by Austin Appleby, and is placed in the public
14
- // domain. The author hereby disclaims copyright to this source code.
6
+ // Based on Peter Dimov's proposal
7
+ // http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2005/n1756.pdf
8
+ // issue 6.18.
15
9
 
16
- #if !defined(BOOST_FUNCTIONAL_HASH_HASH_HPP)
10
+ #ifndef BOOST_FUNCTIONAL_HASH_HASH_HPP
17
11
  #define BOOST_FUNCTIONAL_HASH_HASH_HPP
18
12
 
19
13
  #include <boost/container_hash/hash_fwd.hpp>
20
- #include <functional>
21
- #include <iterator>
22
- #include <boost/container_hash/detail/hash_float.hpp>
23
- #include <string>
24
- #include <boost/limits.hpp>
14
+ #include <boost/container_hash/is_range.hpp>
15
+ #include <boost/container_hash/is_contiguous_range.hpp>
16
+ #include <boost/container_hash/is_unordered_range.hpp>
17
+ #include <boost/container_hash/is_described_class.hpp>
18
+ #include <boost/container_hash/detail/hash_tuple.hpp>
19
+ #include <boost/container_hash/detail/hash_mix.hpp>
20
+ #include <boost/container_hash/detail/hash_range.hpp>
25
21
  #include <boost/type_traits/is_enum.hpp>
26
22
  #include <boost/type_traits/is_integral.hpp>
27
- #include <boost/core/enable_if.hpp>
23
+ #include <boost/type_traits/is_floating_point.hpp>
24
+ #include <boost/type_traits/is_signed.hpp>
25
+ #include <boost/type_traits/is_unsigned.hpp>
26
+ #include <boost/type_traits/make_unsigned.hpp>
27
+ #include <boost/type_traits/enable_if.hpp>
28
+ #include <boost/type_traits/conjunction.hpp>
29
+ #include <boost/type_traits/is_union.hpp>
30
+ #include <boost/describe/bases.hpp>
31
+ #include <boost/describe/members.hpp>
28
32
  #include <boost/cstdint.hpp>
33
+
34
+ #if defined(BOOST_DESCRIBE_CXX14)
35
+ # include <boost/mp11/algorithm.hpp>
36
+ #endif
37
+
38
+ #include <string>
39
+ #include <iterator>
40
+ #include <complex>
41
+ #include <utility>
42
+ #include <limits>
29
43
  #include <climits>
44
+ #include <cstring>
30
45
 
31
- #if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
32
- #include <boost/type_traits/is_pointer.hpp>
46
+ #if !defined(BOOST_NO_CXX11_SMART_PTR)
47
+ # include <memory>
33
48
  #endif
34
49
 
35
50
  #if !defined(BOOST_NO_CXX11_HDR_TYPEINDEX)
@@ -40,728 +55,608 @@
40
55
  #include <system_error>
41
56
  #endif
42
57
 
43
- #if defined(BOOST_MSVC)
44
- #pragma warning(push)
45
-
46
- #if BOOST_MSVC >= 1400
47
- #pragma warning(disable:6295) // Ill-defined for-loop : 'unsigned int' values
48
- // are always of range '0' to '4294967295'.
49
- // Loop executes infinitely.
50
- #endif
51
-
52
- #endif
53
-
54
- #if BOOST_WORKAROUND(__GNUC__, < 3) \
55
- && !defined(__SGI_STL_PORT) && !defined(_STLPORT_VERSION)
56
- #define BOOST_HASH_CHAR_TRAITS string_char_traits
57
- #else
58
- #define BOOST_HASH_CHAR_TRAITS char_traits
59
- #endif
60
-
61
- #if defined(_MSC_VER)
62
- # define BOOST_FUNCTIONAL_HASH_ROTL32(x, r) _rotl(x,r)
63
- #else
64
- # define BOOST_FUNCTIONAL_HASH_ROTL32(x, r) (x << r) | (x >> (32 - r))
65
- #endif
66
-
67
- // Detect whether standard library has C++17 headers
68
-
69
- #if !defined(BOOST_HASH_CXX17)
70
- # if defined(BOOST_MSVC)
71
- # if defined(_HAS_CXX17) && _HAS_CXX17
72
- # define BOOST_HASH_CXX17 1
73
- # endif
74
- # elif defined(__cplusplus) && __cplusplus >= 201703
75
- # define BOOST_HASH_CXX17 1
76
- # endif
77
- #endif
78
-
79
- #if !defined(BOOST_HASH_CXX17)
80
- # define BOOST_HASH_CXX17 0
81
- #endif
82
-
83
- #if BOOST_HASH_CXX17 && defined(__has_include)
84
- # if !defined(BOOST_HASH_HAS_STRING_VIEW) && __has_include(<string_view>)
85
- # define BOOST_HASH_HAS_STRING_VIEW 1
86
- # endif
87
- # if !defined(BOOST_HASH_HAS_OPTIONAL) && __has_include(<optional>)
88
- # define BOOST_HASH_HAS_OPTIONAL 1
89
- # endif
90
- # if !defined(BOOST_HASH_HAS_VARIANT) && __has_include(<variant>)
91
- # define BOOST_HASH_HAS_VARIANT 1
92
- # endif
93
- #endif
94
-
95
- #if !defined(BOOST_HASH_HAS_STRING_VIEW)
96
- # define BOOST_HASH_HAS_STRING_VIEW 0
58
+ #if !defined(BOOST_NO_CXX17_HDR_OPTIONAL)
59
+ #include <optional>
97
60
  #endif
98
61
 
99
- #if !defined(BOOST_HASH_HAS_OPTIONAL)
100
- # define BOOST_HASH_HAS_OPTIONAL 0
62
+ #if !defined(BOOST_NO_CXX17_HDR_VARIANT)
63
+ #include <variant>
101
64
  #endif
102
65
 
103
- #if !defined(BOOST_HASH_HAS_VARIANT)
104
- # define BOOST_HASH_HAS_VARIANT 0
66
+ #if !defined(BOOST_NO_CXX17_HDR_STRING_VIEW)
67
+ # include <string_view>
105
68
  #endif
106
69
 
107
- #if BOOST_HASH_HAS_STRING_VIEW
108
- # include <string_view>
109
- #endif
70
+ namespace boost
71
+ {
110
72
 
111
- #if BOOST_HASH_HAS_OPTIONAL
112
- # include <optional>
113
- #endif
73
+ //
74
+ // boost::hash_value
75
+ //
114
76
 
115
- #if BOOST_HASH_HAS_VARIANT
116
- # include <variant>
117
- #endif
77
+ // integral types
118
78
 
119
- namespace boost
120
- {
121
79
  namespace hash_detail
122
80
  {
123
- #if defined(BOOST_NO_CXX98_FUNCTION_BASE)
124
- template <typename T>
125
- struct hash_base
81
+ template<class T,
82
+ bool bigger_than_size_t = (sizeof(T) > sizeof(std::size_t)),
83
+ bool is_unsigned = boost::is_unsigned<T>::value,
84
+ std::size_t size_t_bits = sizeof(std::size_t) * CHAR_BIT,
85
+ std::size_t type_bits = sizeof(T) * CHAR_BIT>
86
+ struct hash_integral_impl;
87
+
88
+ template<class T, bool is_unsigned, std::size_t size_t_bits, std::size_t type_bits> struct hash_integral_impl<T, false, is_unsigned, size_t_bits, type_bits>
126
89
  {
127
- typedef T argument_type;
128
- typedef std::size_t result_type;
90
+ static std::size_t fn( T v )
91
+ {
92
+ return static_cast<std::size_t>( v );
93
+ }
129
94
  };
130
- #else
131
- template <typename T>
132
- struct hash_base : std::unary_function<T, std::size_t> {};
133
- #endif
134
95
 
135
- struct enable_hash_value { typedef std::size_t type; };
136
-
137
- template <typename T> struct basic_numbers {};
138
- template <typename T> struct long_numbers;
139
- template <typename T> struct ulong_numbers;
140
- template <typename T> struct float_numbers {};
141
-
142
- template <> struct basic_numbers<bool> :
143
- boost::hash_detail::enable_hash_value {};
144
- template <> struct basic_numbers<char> :
145
- boost::hash_detail::enable_hash_value {};
146
- template <> struct basic_numbers<unsigned char> :
147
- boost::hash_detail::enable_hash_value {};
148
- template <> struct basic_numbers<signed char> :
149
- boost::hash_detail::enable_hash_value {};
150
- template <> struct basic_numbers<short> :
151
- boost::hash_detail::enable_hash_value {};
152
- template <> struct basic_numbers<unsigned short> :
153
- boost::hash_detail::enable_hash_value {};
154
- template <> struct basic_numbers<int> :
155
- boost::hash_detail::enable_hash_value {};
156
- template <> struct basic_numbers<unsigned int> :
157
- boost::hash_detail::enable_hash_value {};
158
- template <> struct basic_numbers<long> :
159
- boost::hash_detail::enable_hash_value {};
160
- template <> struct basic_numbers<unsigned long> :
161
- boost::hash_detail::enable_hash_value {};
162
-
163
- #if !defined(BOOST_NO_INTRINSIC_WCHAR_T)
164
- template <> struct basic_numbers<wchar_t> :
165
- boost::hash_detail::enable_hash_value {};
166
- #endif
167
-
168
- #if !defined(BOOST_NO_CXX11_CHAR16_T)
169
- template <> struct basic_numbers<char16_t> :
170
- boost::hash_detail::enable_hash_value {};
171
- #endif
96
+ template<class T, std::size_t size_t_bits, std::size_t type_bits> struct hash_integral_impl<T, true, false, size_t_bits, type_bits>
97
+ {
98
+ static std::size_t fn( T v )
99
+ {
100
+ typedef typename boost::make_unsigned<T>::type U;
172
101
 
173
- #if !defined(BOOST_NO_CXX11_CHAR32_T)
174
- template <> struct basic_numbers<char32_t> :
175
- boost::hash_detail::enable_hash_value {};
176
- #endif
102
+ if( v >= 0 )
103
+ {
104
+ return hash_integral_impl<U>::fn( static_cast<U>( v ) );
105
+ }
106
+ else
107
+ {
108
+ return ~hash_integral_impl<U>::fn( static_cast<U>( ~static_cast<U>( v ) ) );
109
+ }
110
+ }
111
+ };
177
112
 
178
- // long_numbers is defined like this to allow for separate
179
- // specialization for long_long and int128_type, in case
180
- // they conflict.
181
- template <typename T> struct long_numbers2 {};
182
- template <typename T> struct ulong_numbers2 {};
183
- template <typename T> struct long_numbers : long_numbers2<T> {};
184
- template <typename T> struct ulong_numbers : ulong_numbers2<T> {};
185
-
186
- #if !defined(BOOST_NO_LONG_LONG)
187
- template <> struct long_numbers<boost::long_long_type> :
188
- boost::hash_detail::enable_hash_value {};
189
- template <> struct ulong_numbers<boost::ulong_long_type> :
190
- boost::hash_detail::enable_hash_value {};
191
- #endif
113
+ template<class T> struct hash_integral_impl<T, true, true, 32, 64>
114
+ {
115
+ static std::size_t fn( T v )
116
+ {
117
+ std::size_t seed = 0;
192
118
 
193
- #if defined(BOOST_HAS_INT128)
194
- template <> struct long_numbers2<boost::int128_type> :
195
- boost::hash_detail::enable_hash_value {};
196
- template <> struct ulong_numbers2<boost::uint128_type> :
197
- boost::hash_detail::enable_hash_value {};
198
- #endif
119
+ seed = static_cast<std::size_t>( v >> 32 ) + hash_detail::hash_mix( seed );
120
+ seed = static_cast<std::size_t>( v ) + hash_detail::hash_mix( seed );
199
121
 
200
- template <> struct float_numbers<float> :
201
- boost::hash_detail::enable_hash_value {};
202
- template <> struct float_numbers<double> :
203
- boost::hash_detail::enable_hash_value {};
204
- template <> struct float_numbers<long double> :
205
- boost::hash_detail::enable_hash_value {};
206
- }
207
-
208
- template <typename T>
209
- typename boost::hash_detail::basic_numbers<T>::type hash_value(T);
210
- template <typename T>
211
- typename boost::hash_detail::long_numbers<T>::type hash_value(T);
212
- template <typename T>
213
- typename boost::hash_detail::ulong_numbers<T>::type hash_value(T);
122
+ return seed;
123
+ }
124
+ };
214
125
 
215
- template <typename T>
216
- typename boost::enable_if<boost::is_enum<T>, std::size_t>::type
217
- hash_value(T);
126
+ template<class T> struct hash_integral_impl<T, true, true, 32, 128>
127
+ {
128
+ static std::size_t fn( T v )
129
+ {
130
+ std::size_t seed = 0;
218
131
 
219
- #if !BOOST_WORKAROUND(__DMC__, <= 0x848)
220
- template <class T> std::size_t hash_value(T* const&);
221
- #else
222
- template <class T> std::size_t hash_value(T*);
223
- #endif
132
+ seed = static_cast<std::size_t>( v >> 96 ) + hash_detail::hash_mix( seed );
133
+ seed = static_cast<std::size_t>( v >> 64 ) + hash_detail::hash_mix( seed );
134
+ seed = static_cast<std::size_t>( v >> 32 ) + hash_detail::hash_mix( seed );
135
+ seed = static_cast<std::size_t>( v ) + hash_detail::hash_mix( seed );
224
136
 
225
- #if !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING)
226
- template< class T, unsigned N >
227
- std::size_t hash_value(const T (&x)[N]);
137
+ return seed;
138
+ }
139
+ };
228
140
 
229
- template< class T, unsigned N >
230
- std::size_t hash_value(T (&x)[N]);
231
- #endif
141
+ template<class T> struct hash_integral_impl<T, true, true, 64, 128>
142
+ {
143
+ static std::size_t fn( T v )
144
+ {
145
+ std::size_t seed = 0;
232
146
 
233
- template <class Ch, class A>
234
- std::size_t hash_value(
235
- std::basic_string<Ch, std::BOOST_HASH_CHAR_TRAITS<Ch>, A> const&);
147
+ seed = static_cast<std::size_t>( v >> 64 ) + hash_detail::hash_mix( seed );
148
+ seed = static_cast<std::size_t>( v ) + hash_detail::hash_mix( seed );
236
149
 
237
- #if BOOST_HASH_HAS_STRING_VIEW
238
- template <class Ch>
239
- std::size_t hash_value(
240
- std::basic_string_view<Ch, std::BOOST_HASH_CHAR_TRAITS<Ch> > const&);
241
- #endif
150
+ return seed;
151
+ }
152
+ };
242
153
 
243
- template <typename T>
244
- typename boost::hash_detail::float_numbers<T>::type hash_value(T);
154
+ } // namespace hash_detail
245
155
 
246
- #if BOOST_HASH_HAS_OPTIONAL
247
156
  template <typename T>
248
- std::size_t hash_value(std::optional<T> const&);
249
- #endif
250
-
251
- #if BOOST_HASH_HAS_VARIANT
252
- std::size_t hash_value(std::monostate);
253
- template <typename... Types>
254
- std::size_t hash_value(std::variant<Types...> const&);
255
- #endif
157
+ typename boost::enable_if_<boost::is_integral<T>::value, std::size_t>::type
158
+ hash_value( T v )
159
+ {
160
+ return hash_detail::hash_integral_impl<T>::fn( v );
161
+ }
256
162
 
257
- #if !defined(BOOST_NO_CXX11_HDR_TYPEINDEX)
258
- std::size_t hash_value(std::type_index);
259
- #endif
163
+ // enumeration types
260
164
 
261
- #if !defined(BOOST_NO_CXX11_HDR_SYSTEM_ERROR)
262
- std::size_t hash_value(std::error_code const&);
263
- std::size_t hash_value(std::error_condition const&);
264
- #endif
165
+ template <typename T>
166
+ typename boost::enable_if_<boost::is_enum<T>::value, std::size_t>::type
167
+ hash_value( T v )
168
+ {
169
+ // This should in principle return the equivalent of
170
+ //
171
+ // boost::hash_value( to_underlying(v) );
172
+ //
173
+ // However, the C++03 implementation of underlying_type,
174
+ //
175
+ // conditional<is_signed<T>, make_signed<T>, make_unsigned<T>>::type::type
176
+ //
177
+ // generates a legitimate -Wconversion warning in is_signed,
178
+ // because -1 is not a valid enum value when all the enumerators
179
+ // are nonnegative.
180
+ //
181
+ // So the legacy implementation will have to do for now.
182
+
183
+ return static_cast<std::size_t>( v );
184
+ }
265
185
 
266
- // Implementation
186
+ // floating point types
267
187
 
268
188
  namespace hash_detail
269
189
  {
270
- template <class T>
271
- inline std::size_t hash_value_signed(T val)
272
- {
273
- const unsigned int size_t_bits = std::numeric_limits<std::size_t>::digits;
274
- // ceiling(std::numeric_limits<T>::digits / size_t_bits) - 1
275
- const int length = (std::numeric_limits<T>::digits - 1)
276
- / static_cast<int>(size_t_bits);
277
-
278
- std::size_t seed = 0;
279
- T positive = val < 0 ? -1 - val : val;
280
-
281
- // Hopefully, this loop can be unrolled.
282
- for(unsigned int i = length * size_t_bits; i > 0; i -= size_t_bits)
283
- {
284
- seed ^= (std::size_t) (positive >> i) + (seed<<6) + (seed>>2);
285
- }
286
- seed ^= (std::size_t) val + (seed<<6) + (seed>>2);
287
-
288
- return seed;
289
- }
190
+ template<class T,
191
+ std::size_t Bits = sizeof(T) * CHAR_BIT,
192
+ int Digits = std::numeric_limits<T>::digits>
193
+ struct hash_float_impl;
290
194
 
291
- template <class T>
292
- inline std::size_t hash_value_unsigned(T val)
195
+ // float
196
+ template<class T, int Digits> struct hash_float_impl<T, 32, Digits>
293
197
  {
294
- const unsigned int size_t_bits = std::numeric_limits<std::size_t>::digits;
295
- // ceiling(std::numeric_limits<T>::digits / size_t_bits) - 1
296
- const int length = (std::numeric_limits<T>::digits - 1)
297
- / static_cast<int>(size_t_bits);
198
+ static std::size_t fn( T v )
199
+ {
200
+ boost::uint32_t w;
201
+ std::memcpy( &w, &v, sizeof( v ) );
298
202
 
299
- std::size_t seed = 0;
203
+ return w;
204
+ }
205
+ };
300
206
 
301
- // Hopefully, this loop can be unrolled.
302
- for(unsigned int i = length * size_t_bits; i > 0; i -= size_t_bits)
303
- {
304
- seed ^= (std::size_t) (val >> i) + (seed<<6) + (seed>>2);
305
- }
306
- seed ^= (std::size_t) val + (seed<<6) + (seed>>2);
207
+ // double
208
+ template<class T, int Digits> struct hash_float_impl<T, 64, Digits>
209
+ {
210
+ static std::size_t fn( T v )
211
+ {
212
+ boost::uint64_t w;
213
+ std::memcpy( &w, &v, sizeof( v ) );
307
214
 
308
- return seed;
309
- }
215
+ return hash_value( w );
216
+ }
217
+ };
310
218
 
311
- template<std::size_t Bits> struct hash_combine_impl
219
+ // 80 bit long double in 12 bytes
220
+ template<class T> struct hash_float_impl<T, 96, 64>
312
221
  {
313
- template <typename SizeT>
314
- inline static SizeT fn(SizeT seed, SizeT value)
222
+ static std::size_t fn( T v )
315
223
  {
316
- seed ^= value + 0x9e3779b9 + (seed<<6) + (seed>>2);
224
+ boost::uint64_t w[ 2 ] = {};
225
+ std::memcpy( &w, &v, 80 / CHAR_BIT );
226
+
227
+ std::size_t seed = 0;
228
+
229
+ seed = hash_value( w[0] ) + hash_detail::hash_mix( seed );
230
+ seed = hash_value( w[1] ) + hash_detail::hash_mix( seed );
231
+
317
232
  return seed;
318
233
  }
319
234
  };
320
235
 
321
- template<> struct hash_combine_impl<32>
236
+ // 80 bit long double in 16 bytes
237
+ template<class T> struct hash_float_impl<T, 128, 64>
322
238
  {
323
- inline static boost::uint32_t fn(boost::uint32_t h1, boost::uint32_t k1)
239
+ static std::size_t fn( T v )
324
240
  {
325
- const boost::uint32_t c1 = 0xcc9e2d51;
326
- const boost::uint32_t c2 = 0x1b873593;
241
+ boost::uint64_t w[ 2 ] = {};
242
+ std::memcpy( &w, &v, 80 / CHAR_BIT );
327
243
 
328
- k1 *= c1;
329
- k1 = BOOST_FUNCTIONAL_HASH_ROTL32(k1,15);
330
- k1 *= c2;
244
+ std::size_t seed = 0;
331
245
 
332
- h1 ^= k1;
333
- h1 = BOOST_FUNCTIONAL_HASH_ROTL32(h1,13);
334
- h1 = h1*5+0xe6546b64;
246
+ seed = hash_value( w[0] ) + hash_detail::hash_mix( seed );
247
+ seed = hash_value( w[1] ) + hash_detail::hash_mix( seed );
335
248
 
336
- return h1;
249
+ return seed;
337
250
  }
338
251
  };
339
252
 
340
- template<> struct hash_combine_impl<64>
253
+ // 128 bit long double
254
+ template<class T, int Digits> struct hash_float_impl<T, 128, Digits>
341
255
  {
342
- inline static boost::uint64_t fn(boost::uint64_t h, boost::uint64_t k)
256
+ static std::size_t fn( T v )
343
257
  {
344
- const boost::uint64_t m = (boost::uint64_t(0xc6a4a793) << 32) + 0x5bd1e995;
345
- const int r = 47;
258
+ boost::uint64_t w[ 2 ];
259
+ std::memcpy( &w, &v, sizeof( v ) );
346
260
 
347
- k *= m;
348
- k ^= k >> r;
349
- k *= m;
261
+ std::size_t seed = 0;
350
262
 
351
- h ^= k;
352
- h *= m;
263
+ #if defined(__FLOAT_WORD_ORDER__) && defined(__ORDER_BIG_ENDIAN__) && __FLOAT_WORD_ORDER__ == __ORDER_BIG_ENDIAN__
353
264
 
354
- // Completely arbitrary number, to prevent 0's
355
- // from hashing to 0.
356
- h += 0xe6546b64;
265
+ seed = hash_value( w[1] ) + hash_detail::hash_mix( seed );
266
+ seed = hash_value( w[0] ) + hash_detail::hash_mix( seed );
357
267
 
358
- return h;
268
+ #else
269
+
270
+ seed = hash_value( w[0] ) + hash_detail::hash_mix( seed );
271
+ seed = hash_value( w[1] ) + hash_detail::hash_mix( seed );
272
+
273
+ #endif
274
+ return seed;
359
275
  }
360
276
  };
361
- }
362
277
 
363
- template <typename T>
364
- typename boost::hash_detail::basic_numbers<T>::type hash_value(T v)
365
- {
366
- return static_cast<std::size_t>(v);
367
- }
278
+ } // namespace hash_detail
368
279
 
369
280
  template <typename T>
370
- typename boost::hash_detail::long_numbers<T>::type hash_value(T v)
281
+ typename boost::enable_if_<boost::is_floating_point<T>::value, std::size_t>::type
282
+ hash_value( T v )
371
283
  {
372
- return hash_detail::hash_value_signed(v);
284
+ return boost::hash_detail::hash_float_impl<T>::fn( v + 0 );
373
285
  }
374
286
 
375
- template <typename T>
376
- typename boost::hash_detail::ulong_numbers<T>::type hash_value(T v)
287
+ // pointer types
288
+
289
+ // `x + (x >> 3)` adjustment by Alberto Barbati and Dave Harris.
290
+ template <class T> std::size_t hash_value( T* const& v )
377
291
  {
378
- return hash_detail::hash_value_unsigned(v);
292
+ boost::uintptr_t x = reinterpret_cast<boost::uintptr_t>( v );
293
+ return boost::hash_value( x + (x >> 3) );
379
294
  }
380
295
 
381
- template <typename T>
382
- typename boost::enable_if<boost::is_enum<T>, std::size_t>::type
383
- hash_value(T v)
296
+ // array types
297
+
298
+ template<class T, std::size_t N>
299
+ inline std::size_t hash_value( T const (&x)[ N ] )
384
300
  {
385
- return static_cast<std::size_t>(v);
301
+ return boost::hash_range( x, x + N );
386
302
  }
387
303
 
388
- // Implementation by Alberto Barbati and Dave Harris.
389
- #if !BOOST_WORKAROUND(__DMC__, <= 0x848)
390
- template <class T> std::size_t hash_value(T* const& v)
391
- #else
392
- template <class T> std::size_t hash_value(T* v)
393
- #endif
304
+ template<class T, std::size_t N>
305
+ inline std::size_t hash_value( T (&x)[ N ] )
394
306
  {
395
- #if defined(__VMS) && __INITIAL_POINTER_SIZE == 64
396
- // for some reason ptrdiff_t on OpenVMS compiler with
397
- // 64 bit is not 64 bit !!!
398
- std::size_t x = static_cast<std::size_t>(
399
- reinterpret_cast<long long int>(v));
400
- #else
401
- std::size_t x = static_cast<std::size_t>(
402
- reinterpret_cast<std::ptrdiff_t>(v));
403
- #endif
404
- return x + (x >> 3);
307
+ return boost::hash_range( x, x + N );
405
308
  }
406
309
 
407
- #if defined(BOOST_MSVC)
408
- #pragma warning(push)
409
- #if BOOST_MSVC <= 1400
410
- #pragma warning(disable:4267) // 'argument' : conversion from 'size_t' to
411
- // 'unsigned int', possible loss of data
412
- // A misguided attempt to detect 64-bit
413
- // incompatability.
414
- #endif
415
- #endif
310
+ // complex
416
311
 
417
312
  template <class T>
418
- inline void hash_combine(std::size_t& seed, T const& v)
313
+ std::size_t hash_value( std::complex<T> const& v )
419
314
  {
420
- boost::hash<T> hasher;
421
- seed = boost::hash_detail::hash_combine_impl<sizeof(std::size_t) * CHAR_BIT>::fn(seed, hasher(v));
315
+ std::size_t re = boost::hash<T>()( v.real() );
316
+ std::size_t im = boost::hash<T>()( v.imag() );
317
+
318
+ return re + hash_detail::hash_mix( im );
422
319
  }
423
320
 
424
- #if defined(BOOST_MSVC)
425
- #pragma warning(pop)
426
- #endif
321
+ // pair
427
322
 
428
- template <class It>
429
- inline std::size_t hash_range(It first, It last)
323
+ template <class A, class B>
324
+ std::size_t hash_value( std::pair<A, B> const& v )
430
325
  {
431
326
  std::size_t seed = 0;
432
327
 
433
- for(; first != last; ++first)
434
- {
435
- hash_combine<typename std::iterator_traits<It>::value_type>(seed, *first);
436
- }
328
+ boost::hash_combine( seed, v.first );
329
+ boost::hash_combine( seed, v.second );
437
330
 
438
331
  return seed;
439
332
  }
440
333
 
441
- template <class It>
442
- inline void hash_range(std::size_t& seed, It first, It last)
443
- {
444
- for(; first != last; ++first)
445
- {
446
- hash_combine<typename std::iterator_traits<It>::value_type>(seed, *first);
447
- }
448
- }
334
+ // ranges (list, set, deque...)
449
335
 
450
- #if BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x551))
451
- template <class T>
452
- inline std::size_t hash_range(T* first, T* last)
336
+ template <typename T>
337
+ typename boost::enable_if_<container_hash::is_range<T>::value && !container_hash::is_contiguous_range<T>::value && !container_hash::is_unordered_range<T>::value, std::size_t>::type
338
+ hash_value( T const& v )
453
339
  {
454
- std::size_t seed = 0;
340
+ return boost::hash_range( v.begin(), v.end() );
341
+ }
455
342
 
456
- for(; first != last; ++first)
457
- {
458
- boost::hash<T> hasher;
459
- seed ^= hasher(*first) + 0x9e3779b9 + (seed<<6) + (seed>>2);
460
- }
343
+ // contiguous ranges (string, vector, array)
461
344
 
462
- return seed;
345
+ template <typename T>
346
+ typename boost::enable_if_<container_hash::is_contiguous_range<T>::value, std::size_t>::type
347
+ hash_value( T const& v )
348
+ {
349
+ return boost::hash_range( v.data(), v.data() + v.size() );
463
350
  }
464
351
 
465
- template <class T>
466
- inline void hash_range(std::size_t& seed, T* first, T* last)
352
+ // unordered ranges (unordered_set, unordered_map)
353
+
354
+ template <typename T>
355
+ typename boost::enable_if_<container_hash::is_unordered_range<T>::value, std::size_t>::type
356
+ hash_value( T const& v )
467
357
  {
468
- for(; first != last; ++first)
469
- {
470
- boost::hash<T> hasher;
471
- seed ^= hasher(*first) + 0x9e3779b9 + (seed<<6) + (seed>>2);
472
- }
358
+ return boost::hash_unordered_range( v.begin(), v.end() );
473
359
  }
474
- #endif
475
360
 
476
- #if !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING)
477
- template< class T, unsigned N >
478
- inline std::size_t hash_value(const T (&x)[N])
361
+ #if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) && ( \
362
+ ( defined(_MSVC_STL_VERSION) && _MSVC_STL_VERSION < 142 ) || \
363
+ ( !defined(_MSVC_STL_VERSION) && defined(_CPPLIB_VER) && _CPPLIB_VER >= 520 ) )
364
+
365
+ // resolve ambiguity with unconstrained stdext::hash_value in <xhash> :-/
366
+
367
+ template<template<class...> class L, class... T>
368
+ typename boost::enable_if_<container_hash::is_range<L<T...>>::value && !container_hash::is_contiguous_range<L<T...>>::value && !container_hash::is_unordered_range<L<T...>>::value, std::size_t>::type
369
+ hash_value( L<T...> const& v )
479
370
  {
480
- return hash_range(x, x + N);
371
+ return boost::hash_range( v.begin(), v.end() );
481
372
  }
482
373
 
483
- template< class T, unsigned N >
484
- inline std::size_t hash_value(T (&x)[N])
374
+ // contiguous ranges (string, vector, array)
375
+
376
+ template<template<class...> class L, class... T>
377
+ typename boost::enable_if_<container_hash::is_contiguous_range<L<T...>>::value, std::size_t>::type
378
+ hash_value( L<T...> const& v )
485
379
  {
486
- return hash_range(x, x + N);
380
+ return boost::hash_range( v.data(), v.data() + v.size() );
487
381
  }
488
- #endif
489
382
 
490
- template <class Ch, class A>
491
- inline std::size_t hash_value(
492
- std::basic_string<Ch, std::BOOST_HASH_CHAR_TRAITS<Ch>, A> const& v)
383
+ template<template<class, std::size_t> class L, class T, std::size_t N>
384
+ typename boost::enable_if_<container_hash::is_contiguous_range<L<T, N>>::value, std::size_t>::type
385
+ hash_value( L<T, N> const& v )
493
386
  {
494
- return hash_range(v.begin(), v.end());
387
+ return boost::hash_range( v.data(), v.data() + v.size() );
495
388
  }
496
389
 
497
- #if BOOST_HASH_HAS_STRING_VIEW
498
- template <class Ch>
499
- inline std::size_t hash_value(
500
- std::basic_string_view<Ch, std::BOOST_HASH_CHAR_TRAITS<Ch> > const& v)
390
+ // unordered ranges (unordered_set, unordered_map)
391
+
392
+ template<template<class...> class L, class... T>
393
+ typename boost::enable_if_<container_hash::is_unordered_range<L<T...>>::value, std::size_t>::type
394
+ hash_value( L<T...> const& v )
501
395
  {
502
- return hash_range(v.begin(), v.end());
396
+ return boost::hash_unordered_range( v.begin(), v.end() );
503
397
  }
398
+
399
+ #endif
400
+
401
+ // described classes
402
+
403
+ #if defined(BOOST_DESCRIBE_CXX14)
404
+
405
+ #if defined(_MSC_VER) && _MSC_VER == 1900
406
+ # pragma warning(push)
407
+ # pragma warning(disable: 4100) // unreferenced formal parameter
504
408
  #endif
505
409
 
506
410
  template <typename T>
507
- typename boost::hash_detail::float_numbers<T>::type hash_value(T v)
411
+ typename boost::enable_if_<container_hash::is_described_class<T>::value, std::size_t>::type
412
+ hash_value( T const& v )
508
413
  {
509
- return boost::hash_detail::float_hash_value(v);
510
- }
414
+ static_assert( !boost::is_union<T>::value, "described unions are not supported" );
511
415
 
512
- #if BOOST_HASH_HAS_OPTIONAL
513
- template <typename T>
514
- inline std::size_t hash_value(std::optional<T> const& v) {
515
- if (!v) {
516
- // Arbitray value for empty optional.
517
- return 0x12345678;
518
- } else {
519
- boost::hash<T> hf;
520
- return hf(*v);
521
- }
416
+ std::size_t r = 0;
417
+
418
+ using Bd = describe::describe_bases<T, describe::mod_any_access>;
419
+
420
+ mp11::mp_for_each<Bd>([&](auto D){
421
+
422
+ using B = typename decltype(D)::type;
423
+ boost::hash_combine( r, (B const&)v );
424
+
425
+ });
426
+
427
+ using Md = describe::describe_members<T, describe::mod_any_access>;
428
+
429
+ mp11::mp_for_each<Md>([&](auto D){
430
+
431
+ boost::hash_combine( r, v.*D.pointer );
432
+
433
+ });
434
+
435
+ return r;
522
436
  }
437
+
438
+ #if defined(_MSC_VER) && _MSC_VER == 1900
439
+ # pragma warning(pop)
523
440
  #endif
524
441
 
525
- #if BOOST_HASH_HAS_VARIANT
526
- inline std::size_t hash_value(std::monostate) {
527
- return 0x87654321;
442
+ #endif
443
+
444
+ // std::unique_ptr, std::shared_ptr
445
+
446
+ #if !defined(BOOST_NO_CXX11_SMART_PTR)
447
+
448
+ template <typename T>
449
+ std::size_t hash_value( std::shared_ptr<T> const& x )
450
+ {
451
+ return boost::hash_value( x.get() );
528
452
  }
529
453
 
530
- template <typename... Types>
531
- inline std::size_t hash_value(std::variant<Types...> const& v) {
532
- std::size_t seed = 0;
533
- hash_combine(seed, v.index());
534
- std::visit([&seed](auto&& x) { hash_combine(seed, x); }, v);
535
- return seed;
454
+ template <typename T, typename Deleter>
455
+ std::size_t hash_value( std::unique_ptr<T, Deleter> const& x )
456
+ {
457
+ return boost::hash_value( x.get() );
536
458
  }
459
+
537
460
  #endif
538
461
 
462
+ // std::type_index
539
463
 
540
464
  #if !defined(BOOST_NO_CXX11_HDR_TYPEINDEX)
541
- inline std::size_t hash_value(std::type_index v)
465
+
466
+ inline std::size_t hash_value( std::type_index const& v )
542
467
  {
543
468
  return v.hash_code();
544
469
  }
470
+
545
471
  #endif
546
472
 
473
+ // std::error_code, std::error_condition
474
+
547
475
  #if !defined(BOOST_NO_CXX11_HDR_SYSTEM_ERROR)
548
- inline std::size_t hash_value(std::error_code const& v) {
476
+
477
+ inline std::size_t hash_value( std::error_code const& v )
478
+ {
549
479
  std::size_t seed = 0;
550
- hash_combine(seed, v.value());
551
- hash_combine(seed, &v.category());
480
+
481
+ boost::hash_combine( seed, v.value() );
482
+ boost::hash_combine( seed, &v.category() );
483
+
552
484
  return seed;
553
485
  }
554
486
 
555
- inline std::size_t hash_value(std::error_condition const& v) {
487
+ inline std::size_t hash_value( std::error_condition const& v )
488
+ {
489
+ std::size_t seed = 0;
490
+
491
+ boost::hash_combine( seed, v.value() );
492
+ boost::hash_combine( seed, &v.category() );
493
+
494
+ return seed;
495
+ }
496
+
497
+ #endif
498
+
499
+ // std::optional
500
+
501
+ #if !defined(BOOST_NO_CXX17_HDR_OPTIONAL)
502
+
503
+ template <typename T>
504
+ std::size_t hash_value( std::optional<T> const& v )
505
+ {
506
+ if( !v )
507
+ {
508
+ // Arbitray value for empty optional.
509
+ return 0x12345678;
510
+ }
511
+ else
512
+ {
513
+ return boost::hash<T>()(*v);
514
+ }
515
+ }
516
+
517
+ #endif
518
+
519
+ // std::variant
520
+
521
+ #if !defined(BOOST_NO_CXX17_HDR_VARIANT)
522
+
523
+ inline std::size_t hash_value( std::monostate )
524
+ {
525
+ return 0x87654321;
526
+ }
527
+
528
+ template <typename... Types>
529
+ std::size_t hash_value( std::variant<Types...> const& v )
530
+ {
556
531
  std::size_t seed = 0;
557
- hash_combine(seed, v.value());
558
- hash_combine(seed, &v.category());
532
+
533
+ hash_combine( seed, v.index() );
534
+ std::visit( [&seed](auto&& x) { hash_combine(seed, x); }, v );
535
+
559
536
  return seed;
560
537
  }
538
+
561
539
  #endif
562
540
 
563
541
  //
564
- // boost::hash
542
+ // boost::hash_combine
565
543
  //
566
544
 
567
- // Define the specializations required by the standard. The general purpose
568
- // boost::hash is defined later in extensions.hpp if
569
- // BOOST_HASH_NO_EXTENSIONS is not defined.
545
+ template <class T>
546
+ inline void hash_combine( std::size_t& seed, T const& v )
547
+ {
548
+ seed = boost::hash_detail::hash_mix( seed + 0x9e3779b9 + boost::hash<T>()( v ) );
549
+ }
570
550
 
571
- // BOOST_HASH_SPECIALIZE - define a specialization for a type which is
572
- // passed by copy.
573
551
  //
574
- // BOOST_HASH_SPECIALIZE_REF - define a specialization for a type which is
575
- // passed by const reference.
552
+ // boost::hash_range
576
553
  //
577
- // These are undefined later.
578
-
579
- #define BOOST_HASH_SPECIALIZE(type) \
580
- template <> struct hash<type> \
581
- : public boost::hash_detail::hash_base<type> \
582
- { \
583
- std::size_t operator()(type v) const \
584
- { \
585
- return boost::hash_value(v); \
586
- } \
587
- };
588
554
 
589
- #define BOOST_HASH_SPECIALIZE_REF(type) \
590
- template <> struct hash<type> \
591
- : public boost::hash_detail::hash_base<type> \
592
- { \
593
- std::size_t operator()(type const& v) const \
594
- { \
595
- return boost::hash_value(v); \
596
- } \
597
- };
555
+ template <class It>
556
+ inline void hash_range( std::size_t& seed, It first, It last )
557
+ {
558
+ seed = hash_detail::hash_range( seed, first, last );
559
+ }
598
560
 
599
- #define BOOST_HASH_SPECIALIZE_TEMPLATE_REF(type) \
600
- struct hash<type> \
601
- : public boost::hash_detail::hash_base<type> \
602
- { \
603
- std::size_t operator()(type const& v) const \
604
- { \
605
- return boost::hash_value(v); \
606
- } \
607
- };
561
+ template <class It>
562
+ inline std::size_t hash_range( It first, It last )
563
+ {
564
+ std::size_t seed = 0;
608
565
 
609
- BOOST_HASH_SPECIALIZE(bool)
610
- BOOST_HASH_SPECIALIZE(char)
611
- BOOST_HASH_SPECIALIZE(signed char)
612
- BOOST_HASH_SPECIALIZE(unsigned char)
613
- #if !defined(BOOST_NO_INTRINSIC_WCHAR_T)
614
- BOOST_HASH_SPECIALIZE(wchar_t)
615
- #endif
616
- #if !defined(BOOST_NO_CXX11_CHAR16_T)
617
- BOOST_HASH_SPECIALIZE(char16_t)
618
- #endif
619
- #if !defined(BOOST_NO_CXX11_CHAR32_T)
620
- BOOST_HASH_SPECIALIZE(char32_t)
621
- #endif
622
- BOOST_HASH_SPECIALIZE(short)
623
- BOOST_HASH_SPECIALIZE(unsigned short)
624
- BOOST_HASH_SPECIALIZE(int)
625
- BOOST_HASH_SPECIALIZE(unsigned int)
626
- BOOST_HASH_SPECIALIZE(long)
627
- BOOST_HASH_SPECIALIZE(unsigned long)
628
-
629
- BOOST_HASH_SPECIALIZE(float)
630
- BOOST_HASH_SPECIALIZE(double)
631
- BOOST_HASH_SPECIALIZE(long double)
632
-
633
- BOOST_HASH_SPECIALIZE_REF(std::string)
634
- #if !defined(BOOST_NO_STD_WSTRING) && !defined(BOOST_NO_INTRINSIC_WCHAR_T)
635
- BOOST_HASH_SPECIALIZE_REF(std::wstring)
636
- #endif
637
- #if !defined(BOOST_NO_CXX11_CHAR16_T)
638
- BOOST_HASH_SPECIALIZE_REF(std::basic_string<char16_t>)
639
- #endif
640
- #if !defined(BOOST_NO_CXX11_CHAR32_T)
641
- BOOST_HASH_SPECIALIZE_REF(std::basic_string<char32_t>)
642
- #endif
566
+ hash_range( seed, first, last );
643
567
 
644
- #if BOOST_HASH_HAS_STRING_VIEW
645
- BOOST_HASH_SPECIALIZE_REF(std::string_view)
646
- # if !defined(BOOST_NO_STD_WSTRING) && !defined(BOOST_NO_INTRINSIC_WCHAR_T)
647
- BOOST_HASH_SPECIALIZE_REF(std::wstring_view)
648
- # endif
649
- # if !defined(BOOST_NO_CXX11_CHAR16_T)
650
- BOOST_HASH_SPECIALIZE_REF(std::basic_string_view<char16_t>)
651
- # endif
652
- # if !defined(BOOST_NO_CXX11_CHAR32_T)
653
- BOOST_HASH_SPECIALIZE_REF(std::basic_string_view<char32_t>)
654
- # endif
655
- #endif
568
+ return seed;
569
+ }
656
570
 
657
- #if !defined(BOOST_NO_LONG_LONG)
658
- BOOST_HASH_SPECIALIZE(boost::long_long_type)
659
- BOOST_HASH_SPECIALIZE(boost::ulong_long_type)
660
- #endif
571
+ //
572
+ // boost::hash_unordered_range
573
+ //
661
574
 
662
- #if defined(BOOST_HAS_INT128)
663
- BOOST_HASH_SPECIALIZE(boost::int128_type)
664
- BOOST_HASH_SPECIALIZE(boost::uint128_type)
665
- #endif
575
+ template <class It>
576
+ inline void hash_unordered_range( std::size_t& seed, It first, It last )
577
+ {
578
+ std::size_t r = 0;
579
+ std::size_t const s2( seed );
666
580
 
667
- #if BOOST_HASH_HAS_OPTIONAL
668
- template <typename T>
669
- BOOST_HASH_SPECIALIZE_TEMPLATE_REF(std::optional<T>)
670
- #endif
581
+ for( ; first != last; ++first )
582
+ {
583
+ std::size_t s3( s2 );
671
584
 
672
- #if !defined(BOOST_HASH_HAS_VARIANT)
673
- template <typename... T>
674
- BOOST_HASH_SPECIALIZE_TEMPLATE_REF(std::variant<T...>)
675
- BOOST_HASH_SPECIALIZE(std::monostate)
676
- #endif
585
+ hash_combine<typename std::iterator_traits<It>::value_type>( s3, *first );
677
586
 
678
- #if !defined(BOOST_NO_CXX11_HDR_TYPEINDEX)
679
- BOOST_HASH_SPECIALIZE(std::type_index)
680
- #endif
587
+ r += s3;
588
+ }
681
589
 
682
- #undef BOOST_HASH_SPECIALIZE
683
- #undef BOOST_HASH_SPECIALIZE_REF
684
- #undef BOOST_HASH_SPECIALIZE_TEMPLATE_REF
590
+ seed += r;
591
+ }
685
592
 
686
- // Specializing boost::hash for pointers.
593
+ template <class It>
594
+ inline std::size_t hash_unordered_range( It first, It last )
595
+ {
596
+ std::size_t seed = 0;
687
597
 
688
- #if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
598
+ hash_unordered_range( seed, first, last );
689
599
 
690
- template <class T>
691
- struct hash<T*>
692
- : public boost::hash_detail::hash_base<T*>
600
+ return seed;
601
+ }
602
+
603
+ //
604
+ // boost::hash
605
+ //
606
+
607
+ template <class T> struct hash
693
608
  {
694
- std::size_t operator()(T* v) const
695
- {
696
- #if !BOOST_WORKAROUND(__SUNPRO_CC, <= 0x590)
697
- return boost::hash_value(v);
698
- #else
699
- std::size_t x = static_cast<std::size_t>(
700
- reinterpret_cast<std::ptrdiff_t>(v));
609
+ typedef T argument_type;
610
+ typedef std::size_t result_type;
701
611
 
702
- return x + (x >> 3);
703
- #endif
612
+ std::size_t operator()( T const& val ) const
613
+ {
614
+ return hash_value( val );
704
615
  }
705
616
  };
706
617
 
707
- #else
618
+ #if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) && ( \
619
+ ( defined(_MSVC_STL_VERSION) && _MSVC_STL_VERSION < 142 ) || \
620
+ ( !defined(_MSVC_STL_VERSION) && defined(_CPPLIB_VER) && _CPPLIB_VER >= 520 ) )
708
621
 
709
- // For compilers without partial specialization, we define a
710
- // boost::hash for all remaining types. But hash_impl is only defined
711
- // for pointers in 'extensions.hpp' - so when BOOST_HASH_NO_EXTENSIONS
712
- // is defined there will still be a compile error for types not supported
713
- // in the standard.
622
+ // Dinkumware has stdext::hash_value for basic_string in <xhash> :-/
714
623
 
715
- namespace hash_detail
624
+ template<class E, class T, class A> struct hash< std::basic_string<E, T, A> >
716
625
  {
717
- template <bool IsPointer>
718
- struct hash_impl;
626
+ typedef std::basic_string<E, T, A> argument_type;
627
+ typedef std::size_t result_type;
719
628
 
720
- template <>
721
- struct hash_impl<true>
629
+ std::size_t operator()( std::basic_string<E, T, A> const& val ) const
722
630
  {
723
- template <class T>
724
- struct inner
725
- : public boost::hash_detail::hash_base<T>
726
- {
727
- std::size_t operator()(T val) const
728
- {
729
- #if !BOOST_WORKAROUND(__SUNPRO_CC, <= 590)
730
- return boost::hash_value(val);
731
- #else
732
- std::size_t x = static_cast<std::size_t>(
733
- reinterpret_cast<std::ptrdiff_t>(val));
631
+ return boost::hash_value( val );
632
+ }
633
+ };
734
634
 
735
- return x + (x >> 3);
736
635
  #endif
737
- }
738
- };
739
- };
740
- }
741
636
 
742
- template <class T> struct hash
743
- : public boost::hash_detail::hash_impl<boost::is_pointer<T>::value>
744
- ::BOOST_NESTED_TEMPLATE inner<T>
637
+ // boost::unordered::hash_is_avalanching
638
+
639
+ namespace unordered
745
640
  {
746
- };
641
+ template<class T> struct hash_is_avalanching;
642
+ template<class Ch> struct hash_is_avalanching< boost::hash< std::basic_string<Ch> > >: boost::is_integral<Ch> {};
747
643
 
644
+ // boost::is_integral<char8_t> is false, but should be true (https://github.com/boostorg/type_traits/issues/175)
645
+ #if defined(__cpp_char8_t) && __cpp_char8_t >= 201811L
646
+ template<> struct hash_is_avalanching< boost::hash< std::basic_string<char8_t> > >: boost::true_type {};
748
647
  #endif
749
- }
750
648
 
751
- #undef BOOST_HASH_CHAR_TRAITS
752
- #undef BOOST_FUNCTIONAL_HASH_ROTL32
649
+ #if !defined(BOOST_NO_CXX17_HDR_STRING_VIEW)
650
+
651
+ template<class Ch> struct hash_is_avalanching< boost::hash< std::basic_string_view<Ch> > >: boost::is_integral<Ch> {};
753
652
 
754
- #if defined(BOOST_MSVC)
755
- #pragma warning(pop)
653
+ #if defined(__cpp_char8_t) && __cpp_char8_t >= 201811L
654
+ template<> struct hash_is_avalanching< boost::hash< std::basic_string_view<char8_t> > >: boost::true_type {};
756
655
  #endif
757
656
 
758
- #endif // BOOST_FUNCTIONAL_HASH_HASH_HPP
657
+ #endif
658
+ } // namespace unordered
759
659
 
760
- // Include this outside of the include guards in case the file is included
761
- // twice - once with BOOST_HASH_NO_EXTENSIONS defined, and then with it
762
- // undefined.
660
+ } // namespace boost
763
661
 
764
- #if !defined(BOOST_HASH_NO_EXTENSIONS) \
765
- && !defined(BOOST_FUNCTIONAL_HASH_EXTENSIONS_HPP)
766
- #include <boost/container_hash/extensions.hpp>
767
- #endif
662
+ #endif // #ifndef BOOST_FUNCTIONAL_HASH_HASH_HPP