passenger 6.0.16 → 6.0.18
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG +46 -2
- data/CONTRIBUTORS +2 -0
- data/build/integration_tests.rb +6 -6
- data/build/ruby_tests.rb +1 -1
- data/build/test_basics.rb +0 -1
- data/src/agent/Core/Config.h +1 -1
- data/src/agent/Core/Controller/Config.h +1 -1
- data/src/agent/Core/SpawningKit/PipeWatcher.h +18 -3
- data/src/agent/Watchdog/Config.h +1 -1
- data/src/cxx_supportlib/Constants.h +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/align/aligned_alloc.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/array.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/any_completion_executor.hpp +344 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/any_completion_handler.hpp +686 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/any_io_executor.hpp +56 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/associated_allocator.hpp +81 -25
- data/src/cxx_supportlib/vendor-modified/boost/asio/associated_cancellation_slot.hpp +68 -8
- data/src/cxx_supportlib/vendor-modified/boost/asio/associated_executor.hpp +46 -11
- data/src/cxx_supportlib/vendor-modified/boost/asio/basic_datagram_socket.hpp +4 -4
- data/src/cxx_supportlib/vendor-modified/boost/asio/basic_deadline_timer.hpp +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/asio/basic_file.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/basic_random_access_file.hpp +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/asio/basic_raw_socket.hpp +4 -4
- data/src/cxx_supportlib/vendor-modified/boost/asio/basic_readable_pipe.hpp +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/asio/basic_seq_packet_socket.hpp +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/asio/basic_serial_port.hpp +3 -3
- data/src/cxx_supportlib/vendor-modified/boost/asio/basic_signal_set.hpp +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/asio/basic_socket.hpp +3 -3
- data/src/cxx_supportlib/vendor-modified/boost/asio/basic_socket_acceptor.hpp +4 -4
- data/src/cxx_supportlib/vendor-modified/boost/asio/basic_stream_file.hpp +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/asio/basic_stream_socket.hpp +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/asio/basic_waitable_timer.hpp +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/asio/basic_writable_pipe.hpp +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/asio/bind_allocator.hpp +13 -3
- data/src/cxx_supportlib/vendor-modified/boost/asio/bind_cancellation_slot.hpp +14 -3
- data/src/cxx_supportlib/vendor-modified/boost/asio/bind_executor.hpp +13 -3
- data/src/cxx_supportlib/vendor-modified/boost/asio/compose.hpp +30 -305
- data/src/cxx_supportlib/vendor-modified/boost/asio/consign.hpp +90 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/defer.hpp +17 -18
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/bind_handler.hpp +98 -24
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/composed_work.hpp +330 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/config.hpp +81 -15
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/handler_alloc_helpers.hpp +4 -4
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/handler_work.hpp +19 -11
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/descriptor_ops.ipp +37 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/handler_tracking.ipp +3 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/select_reactor.ipp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/socket_ops.ipp +10 -2
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/strand_executor_service.hpp +14 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/memory.hpp +18 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/utility.hpp +1 -2
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/work_dispatcher.hpp +7 -3
- data/src/cxx_supportlib/vendor-modified/boost/asio/dispatch.hpp +4 -14
- data/src/cxx_supportlib/vendor-modified/boost/asio/execution/allocator.hpp +22 -3
- data/src/cxx_supportlib/vendor-modified/boost/asio/execution/any_executor.hpp +447 -142
- data/src/cxx_supportlib/vendor-modified/boost/asio/execution/blocking.hpp +57 -8
- data/src/cxx_supportlib/vendor-modified/boost/asio/execution/blocking_adaptation.hpp +51 -6
- data/src/cxx_supportlib/vendor-modified/boost/asio/execution/bulk_execute.hpp +5 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/execution/bulk_guarantee.hpp +41 -4
- data/src/cxx_supportlib/vendor-modified/boost/asio/execution/connect.hpp +5 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/execution/context.hpp +13 -2
- data/src/cxx_supportlib/vendor-modified/boost/asio/execution/context_as.hpp +13 -2
- data/src/cxx_supportlib/vendor-modified/boost/asio/execution/detail/as_operation.hpp +4 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/execution/execute.hpp +9 -2
- data/src/cxx_supportlib/vendor-modified/boost/asio/execution/executor.hpp +11 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/execution/mapping.hpp +52 -8
- data/src/cxx_supportlib/vendor-modified/boost/asio/execution/occupancy.hpp +13 -2
- data/src/cxx_supportlib/vendor-modified/boost/asio/execution/operation_state.hpp +5 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/execution/outstanding_work.hpp +39 -6
- data/src/cxx_supportlib/vendor-modified/boost/asio/execution/receiver.hpp +5 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/execution/relationship.hpp +39 -6
- data/src/cxx_supportlib/vendor-modified/boost/asio/execution/schedule.hpp +5 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/execution/scheduler.hpp +5 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/execution/sender.hpp +5 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/execution/set_done.hpp +5 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/execution/set_error.hpp +5 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/execution/set_value.hpp +5 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/execution/start.hpp +5 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/execution/submit.hpp +5 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/executor_work_guard.hpp +6 -9
- data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/basic_channel.hpp +3 -3
- data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/basic_concurrent_channel.hpp +3 -3
- data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/channel_traits.hpp +70 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/co_composed.hpp +146 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/coro.hpp +35 -5
- data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/detail/channel_handler.hpp +13 -3
- data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/detail/channel_operation.hpp +7 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/detail/channel_service.hpp +180 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/detail/coro_completion_handler.hpp +171 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/detail/coro_promise_allocator.hpp +89 -66
- data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/detail/partial_promise.hpp +66 -45
- data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/impl/as_single.hpp +13 -3
- data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/impl/co_composed.hpp +1134 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/impl/coro.hpp +130 -106
- data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/impl/parallel_group.hpp +377 -3
- data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/impl/promise.hpp +168 -29
- data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/impl/use_coro.hpp +149 -203
- data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/impl/use_promise.hpp +68 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/parallel_group.hpp +256 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/promise.hpp +76 -80
- data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/use_coro.hpp +40 -14
- data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/use_promise.hpp +113 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/impl/any_completion_executor.ipp +132 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/impl/any_io_executor.ipp +12 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/impl/append.hpp +12 -3
- data/src/cxx_supportlib/vendor-modified/boost/asio/impl/as_tuple.hpp +12 -3
- data/src/cxx_supportlib/vendor-modified/boost/asio/impl/buffered_read_stream.hpp +25 -6
- data/src/cxx_supportlib/vendor-modified/boost/asio/impl/buffered_write_stream.hpp +25 -6
- data/src/cxx_supportlib/vendor-modified/boost/asio/impl/co_spawn.hpp +34 -45
- data/src/cxx_supportlib/vendor-modified/boost/asio/impl/connect.hpp +28 -6
- data/src/cxx_supportlib/vendor-modified/boost/asio/impl/consign.hpp +204 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/impl/defer.hpp +33 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/impl/deferred.hpp +13 -3
- data/src/cxx_supportlib/vendor-modified/boost/asio/impl/dispatch.hpp +21 -9
- data/src/cxx_supportlib/vendor-modified/boost/asio/impl/handler_alloc_hook.ipp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/impl/post.hpp +33 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/impl/prepend.hpp +12 -3
- data/src/cxx_supportlib/vendor-modified/boost/asio/impl/read.hpp +40 -9
- data/src/cxx_supportlib/vendor-modified/boost/asio/impl/read_at.hpp +27 -6
- data/src/cxx_supportlib/vendor-modified/boost/asio/impl/read_until.hpp +104 -24
- data/src/cxx_supportlib/vendor-modified/boost/asio/impl/redirect_error.hpp +12 -3
- data/src/cxx_supportlib/vendor-modified/boost/asio/impl/spawn.hpp +70 -15
- data/src/cxx_supportlib/vendor-modified/boost/asio/impl/src.hpp +1 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/impl/use_future.hpp +25 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/impl/write.hpp +38 -30
- data/src/cxx_supportlib/vendor-modified/boost/asio/impl/write_at.hpp +27 -6
- data/src/cxx_supportlib/vendor-modified/boost/asio/io_context.hpp +0 -13
- data/src/cxx_supportlib/vendor-modified/boost/asio/ip/impl/network_v4.ipp +3 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/ip/impl/network_v6.ipp +3 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/posix/basic_descriptor.hpp +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/asio/posix/basic_stream_descriptor.hpp +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/asio/post.hpp +17 -18
- data/src/cxx_supportlib/vendor-modified/boost/asio/spawn.hpp +3 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/ssl/detail/io.hpp +13 -3
- data/src/cxx_supportlib/vendor-modified/boost/asio/strand.hpp +11 -7
- data/src/cxx_supportlib/vendor-modified/boost/asio/system_executor.hpp +0 -13
- data/src/cxx_supportlib/vendor-modified/boost/asio/thread_pool.hpp +23 -18
- data/src/cxx_supportlib/vendor-modified/boost/asio/version.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/windows/basic_object_handle.hpp +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/asio/windows/basic_overlapped_handle.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/windows/basic_random_access_handle.hpp +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/asio/windows/basic_stream_handle.hpp +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/asio.hpp +4 -0
- data/src/cxx_supportlib/vendor-modified/boost/bind/bind.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/chrono/config.hpp +1 -0
- data/src/cxx_supportlib/vendor-modified/boost/chrono/detail/inlined/mac/chrono.hpp +4 -4
- data/src/cxx_supportlib/vendor-modified/boost/chrono/detail/scan_keyword.hpp +4 -2
- data/src/cxx_supportlib/vendor-modified/boost/chrono/duration.hpp +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/chrono/io/duration_io.hpp +3 -3
- data/src/cxx_supportlib/vendor-modified/boost/chrono/io/duration_put.hpp +5 -5
- data/src/cxx_supportlib/vendor-modified/boost/chrono/io/duration_units.hpp +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/chrono/io/time_point_io.hpp +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/chrono/io/utility/ios_base_state_ptr.hpp +7 -7
- data/src/cxx_supportlib/vendor-modified/boost/chrono/time_point.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/circular_buffer/details.hpp +5 -1
- data/src/cxx_supportlib/vendor-modified/boost/config/compiler/clang.hpp +10 -3
- data/src/cxx_supportlib/vendor-modified/boost/config/compiler/clang_version.hpp +9 -3
- data/src/cxx_supportlib/vendor-modified/boost/config/compiler/gcc.hpp +9 -3
- data/src/cxx_supportlib/vendor-modified/boost/config/compiler/sunpro_cc.hpp +6 -0
- data/src/cxx_supportlib/vendor-modified/boost/config/compiler/visualc.hpp +8 -0
- data/src/cxx_supportlib/vendor-modified/boost/config/compiler/xlcpp.hpp +4 -0
- data/src/cxx_supportlib/vendor-modified/boost/config/detail/suffix.hpp +33 -0
- data/src/cxx_supportlib/vendor-modified/boost/config/header_deprecated.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/config/stdlib/libcpp.hpp +9 -0
- data/src/cxx_supportlib/vendor-modified/boost/config/stdlib/libstdcpp3.hpp +4 -2
- data/src/cxx_supportlib/vendor-modified/boost/container/allocator.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/container/container_fwd.hpp +29 -0
- data/src/cxx_supportlib/vendor-modified/boost/container/deque.hpp +13 -13
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/advanced_insert_int.hpp +80 -95
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/config_begin.hpp +10 -0
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/config_end.hpp +3 -0
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/copy_move_algo.hpp +738 -34
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/destroyers.hpp +38 -10
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/flat_tree.hpp +1 -0
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/iterator.hpp +2 -0
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/workaround.hpp +3 -4
- data/src/cxx_supportlib/vendor-modified/boost/container/devector.hpp +1150 -1213
- data/src/cxx_supportlib/vendor-modified/boost/container/node_allocator.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/container/options.hpp +104 -12
- data/src/cxx_supportlib/vendor-modified/boost/container/stable_vector.hpp +1 -0
- data/src/cxx_supportlib/vendor-modified/boost/container/string.hpp +11 -1
- data/src/cxx_supportlib/vendor-modified/boost/container/vector.hpp +31 -331
- data/src/cxx_supportlib/vendor-modified/boost/container_hash/detail/hash_mix.hpp +113 -0
- data/src/cxx_supportlib/vendor-modified/boost/container_hash/detail/hash_range.hpp +173 -0
- data/src/cxx_supportlib/vendor-modified/boost/container_hash/detail/hash_tuple.hpp +133 -0
- data/src/cxx_supportlib/vendor-modified/boost/container_hash/hash.hpp +461 -566
- data/src/cxx_supportlib/vendor-modified/boost/container_hash/hash_fwd.hpp +24 -24
- data/src/cxx_supportlib/vendor-modified/boost/container_hash/is_contiguous_range.hpp +91 -0
- data/src/cxx_supportlib/vendor-modified/boost/container_hash/is_described_class.hpp +38 -0
- data/src/cxx_supportlib/vendor-modified/boost/container_hash/is_range.hpp +73 -0
- data/src/cxx_supportlib/vendor-modified/boost/container_hash/is_unordered_range.hpp +39 -0
- data/src/cxx_supportlib/vendor-modified/boost/core/bit.hpp +32 -4
- data/src/cxx_supportlib/vendor-modified/boost/core/detail/string_view.hpp +16 -0
- data/src/cxx_supportlib/vendor-modified/boost/core/empty_value.hpp +16 -16
- data/src/cxx_supportlib/vendor-modified/boost/core/fclose_deleter.hpp +46 -0
- data/src/cxx_supportlib/vendor-modified/boost/date_time/date.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/date_time/gregorian/formatters.hpp +3 -3
- data/src/cxx_supportlib/vendor-modified/boost/date_time/gregorian/formatters_limited.hpp +3 -3
- data/src/cxx_supportlib/vendor-modified/boost/date_time/gregorian/greg_date.hpp +12 -13
- data/src/cxx_supportlib/vendor-modified/boost/date_time/gregorian/parsers.hpp +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/date_time/gregorian_calendar.ipp +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/date_time/iso_format.hpp +13 -13
- data/src/cxx_supportlib/vendor-modified/boost/date_time/local_time/local_date_time.hpp +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/date_time/posix_time/time_formatters.hpp +4 -4
- data/src/cxx_supportlib/vendor-modified/boost/date_time/posix_time/time_formatters_limited.hpp +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/date_time/special_values_parser.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/date_time/time_facet.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/date_time/time_parsing.hpp +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/describe/bases.hpp +50 -0
- data/src/cxx_supportlib/vendor-modified/boost/describe/detail/config.hpp +40 -0
- data/src/cxx_supportlib/vendor-modified/boost/describe/detail/cx_streq.hpp +30 -0
- data/src/cxx_supportlib/vendor-modified/boost/describe/detail/void_t.hpp +32 -0
- data/src/cxx_supportlib/vendor-modified/boost/describe/members.hpp +159 -0
- data/src/cxx_supportlib/vendor-modified/boost/describe/modifiers.hpp +33 -0
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/avltree_algorithms.hpp +9 -9
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/bstree_algorithms.hpp +45 -45
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/detail/any_node_and_algorithms.hpp +8 -8
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/detail/bstree_algorithms_base.hpp +37 -38
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/detail/iterator.hpp +16 -0
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/detail/workaround.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/hashtable.hpp +145 -90
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/pack_options.hpp +2 -0
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/rbtree_algorithms.hpp +7 -7
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/sgtree_algorithms.hpp +5 -5
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/splaytree_algorithms.hpp +11 -9
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/treap_algorithms.hpp +7 -7
- data/src/cxx_supportlib/vendor-modified/boost/iterator/iterator_facade.hpp +106 -25
- data/src/cxx_supportlib/vendor-modified/boost/lexical_cast/detail/converter_lexical_streams.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/lexical_cast/detail/converter_numeric.hpp +8 -5
- data/src/cxx_supportlib/vendor-modified/boost/lexical_cast/detail/lcast_unsigned_converters.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/move/algo/detail/adaptive_sort_merge.hpp +4 -2
- data/src/cxx_supportlib/vendor-modified/boost/move/algo/detail/pdqsort.hpp +2 -1
- data/src/cxx_supportlib/vendor-modified/boost/move/detail/type_traits.hpp +8 -4
- data/src/cxx_supportlib/vendor-modified/boost/mp11/bind.hpp +111 -0
- data/src/cxx_supportlib/vendor-modified/boost/mp11/version.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/numeric/conversion/detail/int_float_mixture.hpp +5 -5
- data/src/cxx_supportlib/vendor-modified/boost/numeric/conversion/detail/sign_mixture.hpp +5 -5
- data/src/cxx_supportlib/vendor-modified/boost/numeric/conversion/detail/udt_builtin_mixture.hpp +5 -5
- data/src/cxx_supportlib/vendor-modified/boost/preprocessor/variadic/has_opt.hpp +6 -2
- data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/detail/spinlock_gcc_atomic.hpp +11 -2
- data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/intrusive_ptr.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/system/detail/config.hpp +7 -1
- data/src/cxx_supportlib/vendor-modified/boost/system/detail/error_category.hpp +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/system/detail/error_category_impl.hpp +10 -1
- data/src/cxx_supportlib/vendor-modified/boost/system/detail/error_code.hpp +38 -43
- data/src/cxx_supportlib/vendor-modified/boost/system/detail/error_condition.hpp +52 -0
- data/src/cxx_supportlib/vendor-modified/boost/throw_exception.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/detail/is_function_ptr_helper.hpp +27 -27
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/detail/is_mem_fun_pointer_impl.hpp +27 -27
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/intrinsics.hpp +22 -8
- data/src/cxx_supportlib/vendor-modified/boost/unordered/detail/fca.hpp +37 -7
- data/src/cxx_supportlib/vendor-modified/boost/unordered/detail/foa.hpp +1921 -0
- data/src/cxx_supportlib/vendor-modified/boost/unordered/detail/implementation.hpp +66 -82
- data/src/cxx_supportlib/vendor-modified/boost/unordered/detail/prime_fmod.hpp +6 -0
- data/src/cxx_supportlib/vendor-modified/boost/unordered/detail/type_traits.hpp +109 -0
- data/src/cxx_supportlib/vendor-modified/boost/unordered/detail/xmx.hpp +75 -0
- data/src/cxx_supportlib/vendor-modified/boost/unordered/hash_traits.hpp +45 -0
- data/src/cxx_supportlib/vendor-modified/boost/unordered/unordered_flat_map.hpp +732 -0
- data/src/cxx_supportlib/vendor-modified/boost/unordered/unordered_flat_map_fwd.hpp +49 -0
- data/src/cxx_supportlib/vendor-modified/boost/unordered/unordered_flat_set.hpp +586 -0
- data/src/cxx_supportlib/vendor-modified/boost/unordered/unordered_flat_set_fwd.hpp +49 -0
- data/src/cxx_supportlib/vendor-modified/boost/unordered/unordered_map.hpp +166 -66
- data/src/cxx_supportlib/vendor-modified/boost/unordered/unordered_set.hpp +145 -28
- data/src/cxx_supportlib/vendor-modified/boost/version.hpp +2 -2
- data/src/cxx_supportlib/vendor-modified/websocketpp/websocketpp/common/md5.hpp +1 -1
- data/src/ruby_native_extension/extconf.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/native_support.rb +4 -2
- data/src/ruby_supportlib/phusion_passenger/platform_info/operating_system.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/public_api.rb +3 -0
- data/src/ruby_supportlib/phusion_passenger/utils.rb +1 -0
- data/src/ruby_supportlib/phusion_passenger.rb +5 -5
- metadata +36 -19
- data/src/cxx_supportlib/vendor-modified/boost/align/align.hpp +0 -19
- data/src/cxx_supportlib/vendor-modified/boost/align/alignment_of.hpp +0 -54
- data/src/cxx_supportlib/vendor-modified/boost/align/alignment_of_forward.hpp +0 -20
- data/src/cxx_supportlib/vendor-modified/boost/align/detail/align_cxx11.hpp +0 -21
- data/src/cxx_supportlib/vendor-modified/boost/align/detail/aligned_alloc.hpp +0 -52
- data/src/cxx_supportlib/vendor-modified/boost/align/detail/alignment_of.hpp +0 -31
- data/src/cxx_supportlib/vendor-modified/boost/align/detail/alignment_of_cxx11.hpp +0 -23
- data/src/cxx_supportlib/vendor-modified/boost/align/detail/element_type.hpp +0 -91
- data/src/cxx_supportlib/vendor-modified/boost/align/detail/integral_constant.hpp +0 -53
- data/src/cxx_supportlib/vendor-modified/boost/align/detail/min_size.hpp +0 -26
- data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/detail/completion_handler_erasure.hpp +0 -196
- data/src/cxx_supportlib/vendor-modified/boost/asio/impl/compose.hpp +0 -709
- data/src/cxx_supportlib/vendor-modified/boost/container_hash/detail/float_functions.hpp +0 -336
- data/src/cxx_supportlib/vendor-modified/boost/container_hash/detail/hash_float.hpp +0 -271
- data/src/cxx_supportlib/vendor-modified/boost/container_hash/detail/limits.hpp +0 -62
- data/src/cxx_supportlib/vendor-modified/boost/container_hash/extensions.hpp +0 -361
- 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
|
-
//
|
4
|
-
//
|
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
|
-
//
|
14
|
-
//
|
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
|
-
#
|
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 <
|
21
|
-
#include <
|
22
|
-
#include <boost/container_hash/
|
23
|
-
#include <
|
24
|
-
#include <boost/
|
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/
|
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(
|
32
|
-
#include <
|
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(
|
44
|
-
#
|
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(
|
100
|
-
#
|
62
|
+
#if !defined(BOOST_NO_CXX17_HDR_VARIANT)
|
63
|
+
#include <variant>
|
101
64
|
#endif
|
102
65
|
|
103
|
-
#if !defined(
|
104
|
-
#
|
66
|
+
#if !defined(BOOST_NO_CXX17_HDR_STRING_VIEW)
|
67
|
+
# include <string_view>
|
105
68
|
#endif
|
106
69
|
|
107
|
-
|
108
|
-
|
109
|
-
#endif
|
70
|
+
namespace boost
|
71
|
+
{
|
110
72
|
|
111
|
-
|
112
|
-
|
113
|
-
|
73
|
+
//
|
74
|
+
// boost::hash_value
|
75
|
+
//
|
114
76
|
|
115
|
-
|
116
|
-
# include <variant>
|
117
|
-
#endif
|
77
|
+
// integral types
|
118
78
|
|
119
|
-
namespace boost
|
120
|
-
{
|
121
79
|
namespace hash_detail
|
122
80
|
{
|
123
|
-
|
124
|
-
|
125
|
-
|
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
|
-
|
128
|
-
|
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
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
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
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
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
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
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
|
-
|
194
|
-
|
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
|
-
|
201
|
-
|
202
|
-
|
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
|
-
|
216
|
-
|
217
|
-
|
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
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
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
|
-
|
226
|
-
|
227
|
-
|
137
|
+
return seed;
|
138
|
+
}
|
139
|
+
};
|
228
140
|
|
229
|
-
|
230
|
-
|
231
|
-
|
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
|
-
|
234
|
-
|
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
|
-
|
238
|
-
|
239
|
-
|
240
|
-
std::basic_string_view<Ch, std::BOOST_HASH_CHAR_TRAITS<Ch> > const&);
|
241
|
-
#endif
|
150
|
+
return seed;
|
151
|
+
}
|
152
|
+
};
|
242
153
|
|
243
|
-
|
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
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
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
|
-
|
258
|
-
std::size_t hash_value(std::type_index);
|
259
|
-
#endif
|
163
|
+
// enumeration types
|
260
164
|
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
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
|
-
//
|
186
|
+
// floating point types
|
267
187
|
|
268
188
|
namespace hash_detail
|
269
189
|
{
|
270
|
-
template
|
271
|
-
|
272
|
-
|
273
|
-
|
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
|
-
|
292
|
-
|
195
|
+
// float
|
196
|
+
template<class T, int Digits> struct hash_float_impl<T, 32, Digits>
|
293
197
|
{
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
198
|
+
static std::size_t fn( T v )
|
199
|
+
{
|
200
|
+
boost::uint32_t w;
|
201
|
+
std::memcpy( &w, &v, sizeof( v ) );
|
298
202
|
|
299
|
-
|
203
|
+
return w;
|
204
|
+
}
|
205
|
+
};
|
300
206
|
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
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
|
-
|
309
|
-
|
215
|
+
return hash_value( w );
|
216
|
+
}
|
217
|
+
};
|
310
218
|
|
311
|
-
|
219
|
+
// 80 bit long double in 12 bytes
|
220
|
+
template<class T> struct hash_float_impl<T, 96, 64>
|
312
221
|
{
|
313
|
-
|
314
|
-
inline static SizeT fn(SizeT seed, SizeT value)
|
222
|
+
static std::size_t fn( T v )
|
315
223
|
{
|
316
|
-
|
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
|
-
|
236
|
+
// 80 bit long double in 16 bytes
|
237
|
+
template<class T> struct hash_float_impl<T, 128, 64>
|
322
238
|
{
|
323
|
-
|
239
|
+
static std::size_t fn( T v )
|
324
240
|
{
|
325
|
-
|
326
|
-
|
241
|
+
boost::uint64_t w[ 2 ] = {};
|
242
|
+
std::memcpy( &w, &v, 80 / CHAR_BIT );
|
327
243
|
|
328
|
-
|
329
|
-
k1 = BOOST_FUNCTIONAL_HASH_ROTL32(k1,15);
|
330
|
-
k1 *= c2;
|
244
|
+
std::size_t seed = 0;
|
331
245
|
|
332
|
-
|
333
|
-
|
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
|
249
|
+
return seed;
|
337
250
|
}
|
338
251
|
};
|
339
252
|
|
340
|
-
|
253
|
+
// 128 bit long double
|
254
|
+
template<class T, int Digits> struct hash_float_impl<T, 128, Digits>
|
341
255
|
{
|
342
|
-
|
256
|
+
static std::size_t fn( T v )
|
343
257
|
{
|
344
|
-
|
345
|
-
|
258
|
+
boost::uint64_t w[ 2 ];
|
259
|
+
std::memcpy( &w, &v, sizeof( v ) );
|
346
260
|
|
347
|
-
|
348
|
-
k ^= k >> r;
|
349
|
-
k *= m;
|
261
|
+
std::size_t seed = 0;
|
350
262
|
|
351
|
-
|
352
|
-
h *= m;
|
263
|
+
#if defined(__FLOAT_WORD_ORDER__) && defined(__ORDER_BIG_ENDIAN__) && __FLOAT_WORD_ORDER__ == __ORDER_BIG_ENDIAN__
|
353
264
|
|
354
|
-
|
355
|
-
|
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
|
-
|
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
|
-
|
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::
|
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::
|
284
|
+
return boost::hash_detail::hash_float_impl<T>::fn( v + 0 );
|
373
285
|
}
|
374
286
|
|
375
|
-
|
376
|
-
|
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
|
-
|
292
|
+
boost::uintptr_t x = reinterpret_cast<boost::uintptr_t>( v );
|
293
|
+
return boost::hash_value( x + (x >> 3) );
|
379
294
|
}
|
380
295
|
|
381
|
-
|
382
|
-
|
383
|
-
|
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
|
301
|
+
return boost::hash_range( x, x + N );
|
386
302
|
}
|
387
303
|
|
388
|
-
|
389
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
313
|
+
std::size_t hash_value( std::complex<T> const& v )
|
419
314
|
{
|
420
|
-
boost::hash<T>
|
421
|
-
|
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
|
-
|
425
|
-
#pragma warning(pop)
|
426
|
-
#endif
|
321
|
+
// pair
|
427
322
|
|
428
|
-
template <class
|
429
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
451
|
-
|
452
|
-
|
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
|
-
|
340
|
+
return boost::hash_range( v.begin(), v.end() );
|
341
|
+
}
|
455
342
|
|
456
|
-
|
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
|
-
|
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
|
-
|
466
|
-
|
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
|
-
|
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(
|
477
|
-
|
478
|
-
|
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(
|
371
|
+
return boost::hash_range( v.begin(), v.end() );
|
481
372
|
}
|
482
373
|
|
483
|
-
|
484
|
-
|
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(
|
380
|
+
return boost::hash_range( v.data(), v.data() + v.size() );
|
487
381
|
}
|
488
|
-
#endif
|
489
382
|
|
490
|
-
template
|
491
|
-
|
492
|
-
|
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.
|
387
|
+
return boost::hash_range( v.data(), v.data() + v.size() );
|
495
388
|
}
|
496
389
|
|
497
|
-
|
498
|
-
|
499
|
-
|
500
|
-
|
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
|
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::
|
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
|
-
|
510
|
-
}
|
414
|
+
static_assert( !boost::is_union<T>::value, "described unions are not supported" );
|
511
415
|
|
512
|
-
|
513
|
-
|
514
|
-
|
515
|
-
|
516
|
-
|
517
|
-
|
518
|
-
|
519
|
-
boost::
|
520
|
-
|
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
|
-
#
|
526
|
-
|
527
|
-
|
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
|
531
|
-
|
532
|
-
|
533
|
-
|
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
|
-
|
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
|
-
|
476
|
+
|
477
|
+
inline std::size_t hash_value( std::error_code const& v )
|
478
|
+
{
|
549
479
|
std::size_t seed = 0;
|
550
|
-
|
551
|
-
hash_combine(seed,
|
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
|
-
|
558
|
-
hash_combine(seed,
|
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::
|
542
|
+
// boost::hash_combine
|
565
543
|
//
|
566
544
|
|
567
|
-
|
568
|
-
|
569
|
-
|
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
|
-
//
|
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
|
-
|
590
|
-
|
591
|
-
|
592
|
-
|
593
|
-
|
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
|
-
|
600
|
-
|
601
|
-
|
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
|
-
|
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
|
-
|
645
|
-
|
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
|
-
|
658
|
-
|
659
|
-
|
660
|
-
#endif
|
571
|
+
//
|
572
|
+
// boost::hash_unordered_range
|
573
|
+
//
|
661
574
|
|
662
|
-
|
663
|
-
|
664
|
-
|
665
|
-
|
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
|
-
|
668
|
-
|
669
|
-
|
670
|
-
#endif
|
581
|
+
for( ; first != last; ++first )
|
582
|
+
{
|
583
|
+
std::size_t s3( s2 );
|
671
584
|
|
672
|
-
|
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
|
-
|
679
|
-
|
680
|
-
#endif
|
587
|
+
r += s3;
|
588
|
+
}
|
681
589
|
|
682
|
-
|
683
|
-
|
684
|
-
#undef BOOST_HASH_SPECIALIZE_TEMPLATE_REF
|
590
|
+
seed += r;
|
591
|
+
}
|
685
592
|
|
686
|
-
|
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
|
-
|
598
|
+
hash_unordered_range( seed, first, last );
|
689
599
|
|
690
|
-
|
691
|
-
|
692
|
-
|
600
|
+
return seed;
|
601
|
+
}
|
602
|
+
|
603
|
+
//
|
604
|
+
// boost::hash
|
605
|
+
//
|
606
|
+
|
607
|
+
template <class T> struct hash
|
693
608
|
{
|
694
|
-
|
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
|
-
|
703
|
-
|
612
|
+
std::size_t operator()( T const& val ) const
|
613
|
+
{
|
614
|
+
return hash_value( val );
|
704
615
|
}
|
705
616
|
};
|
706
617
|
|
707
|
-
#
|
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
|
-
//
|
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
|
-
|
624
|
+
template<class E, class T, class A> struct hash< std::basic_string<E, T, A> >
|
716
625
|
{
|
717
|
-
|
718
|
-
|
626
|
+
typedef std::basic_string<E, T, A> argument_type;
|
627
|
+
typedef std::size_t result_type;
|
719
628
|
|
720
|
-
|
721
|
-
struct hash_impl<true>
|
629
|
+
std::size_t operator()( std::basic_string<E, T, A> const& val ) const
|
722
630
|
{
|
723
|
-
|
724
|
-
|
725
|
-
|
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
|
-
|
743
|
-
|
744
|
-
|
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
|
-
#
|
752
|
-
|
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(
|
755
|
-
|
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
|
657
|
+
#endif
|
658
|
+
} // namespace unordered
|
759
659
|
|
760
|
-
//
|
761
|
-
// twice - once with BOOST_HASH_NO_EXTENSIONS defined, and then with it
|
762
|
-
// undefined.
|
660
|
+
} // namespace boost
|
763
661
|
|
764
|
-
#
|
765
|
-
&& !defined(BOOST_FUNCTIONAL_HASH_EXTENSIONS_HPP)
|
766
|
-
#include <boost/container_hash/extensions.hpp>
|
767
|
-
#endif
|
662
|
+
#endif // #ifndef BOOST_FUNCTIONAL_HASH_HASH_HPP
|