passenger 4.0.20 → 4.0.21
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of passenger might be problematic. Click here for more details.
- checksums.yaml +8 -8
- checksums.yaml.gz.asc +7 -7
- data.tar.gz.asc +7 -7
- data/.gitignore +1 -0
- data/.travis.yml +1 -1
- data/NEWS +15 -0
- data/README.md +5 -3
- data/Rakefile +1 -0
- data/bin/passenger-config +1 -5
- data/bin/passenger-install-apache2-module +53 -5
- data/bin/passenger-install-nginx-module +19 -6
- data/bin/passenger-memory-stats +3 -3
- data/build/agents.rb +11 -8
- data/build/apache2.rb +9 -5
- data/build/basics.rb +15 -21
- data/build/common_library.rb +16 -6
- data/build/cplusplus_support.rb +5 -5
- data/build/cxx_tests.rb +3 -3
- data/build/documentation.rb +1 -1
- data/build/misc.rb +4 -37
- data/build/node_tests.rb +29 -0
- data/build/oxt_tests.rb +1 -1
- data/build/packaging.rb +29 -10
- data/build/preprocessor.rb +2 -1
- data/build/test_basics.rb +15 -6
- data/debian.template/locations.ini.template +1 -0
- data/debian.template/passenger.install.template +1 -0
- data/dev/copy_boost_headers.rb +7 -3
- data/dev/run_travis.sh +32 -16
- data/doc/Users guide Apache.idmap.txt +22 -34
- data/doc/Users guide Apache.txt +20 -234
- data/doc/Users guide Nginx.idmap.txt +84 -66
- data/doc/Users guide Nginx.txt +50 -1
- data/doc/Users guide Standalone.idmap.txt +74 -0
- data/doc/Users guide Standalone.txt +22 -9
- data/doc/Users guide.txt +51 -0
- data/doc/users_guide_snippets/environment_variables.txt +0 -3
- data/doc/users_guide_snippets/installation.txt +337 -380
- data/doc/users_guide_snippets/installation/run_installer.txt +58 -0
- data/doc/users_guide_snippets/installation/verify_running_epilogue.txt +6 -0
- data/doc/users_guide_snippets/support_information.txt +2 -9
- data/doc/users_guide_snippets/troubleshooting/default.txt +112 -0
- data/doc/users_guide_snippets/troubleshooting/rails.txt +56 -0
- data/doc/users_guide_snippets/where_to_get_support.txt +9 -0
- data/ext/apache2/Bucket.h +1 -1
- data/ext/apache2/Configuration.hpp +0 -44
- data/ext/apache2/CreateDirConfig.cpp +1 -1
- data/ext/apache2/CreateDirConfig.cpp.erb +1 -1
- data/ext/apache2/Hooks.cpp +28 -21
- data/ext/apache2/MergeDirConfig.cpp +1 -0
- data/ext/apache2/MergeDirConfig.cpp.erb +1 -1
- data/ext/apache2/SetHeaders.cpp +73 -0
- data/ext/apache2/SetHeaders.cpp.erb +88 -0
- data/ext/boost/algorithm/string/detail/find_format.hpp +5 -5
- data/ext/boost/algorithm/string/detail/find_format_all.hpp +5 -5
- data/ext/boost/algorithm/string/detail/finder.hpp +1 -1
- data/ext/boost/algorithm/string/formatter.hpp +2 -2
- data/ext/boost/assert.hpp +6 -1
- data/ext/boost/atomic.hpp +18 -0
- data/ext/boost/atomic/atomic.hpp +241 -0
- data/ext/boost/atomic/detail/base.hpp +585 -0
- data/ext/boost/atomic/detail/cas32strong.hpp +885 -0
- data/ext/boost/atomic/detail/cas32weak.hpp +947 -0
- data/ext/boost/atomic/detail/cas64strong.hpp +443 -0
- data/ext/boost/atomic/detail/config.hpp +54 -0
- data/ext/boost/atomic/detail/gcc-alpha.hpp +368 -0
- data/ext/boost/atomic/detail/gcc-armv6plus.hpp +252 -0
- data/ext/boost/atomic/detail/gcc-cas.hpp +157 -0
- data/ext/boost/atomic/detail/gcc-ppc.hpp +2850 -0
- data/ext/boost/atomic/detail/gcc-sparcv9.hpp +1259 -0
- data/ext/boost/atomic/detail/gcc-x86.hpp +1766 -0
- data/ext/boost/atomic/detail/generic-cas.hpp +206 -0
- data/ext/boost/atomic/detail/interlocked.hpp +200 -0
- data/ext/boost/atomic/detail/linux-arm.hpp +189 -0
- data/ext/boost/atomic/detail/lockpool.hpp +97 -0
- data/ext/boost/atomic/detail/platform.hpp +62 -0
- data/ext/boost/atomic/detail/type-classification.hpp +45 -0
- data/ext/boost/chrono/config.hpp +8 -3
- data/ext/boost/chrono/duration.hpp +9 -10
- data/ext/boost/chrono/system_clocks.hpp +1 -1
- data/ext/boost/chrono/time_point.hpp +4 -3
- data/ext/boost/config/auto_link.hpp +53 -52
- data/ext/boost/config/compiler/borland.hpp +1 -0
- data/ext/boost/config/compiler/clang.hpp +24 -1
- data/ext/boost/config/compiler/codegear.hpp +1 -0
- data/ext/boost/config/compiler/common_edg.hpp +1 -0
- data/ext/boost/config/compiler/cray.hpp +1 -0
- data/ext/boost/config/compiler/digitalmars.hpp +1 -0
- data/ext/boost/config/compiler/gcc.hpp +29 -3
- data/ext/boost/config/compiler/gcc_xml.hpp +2 -1
- data/ext/boost/config/compiler/hp_acc.hpp +1 -0
- data/ext/boost/config/compiler/intel.hpp +1 -1
- data/ext/boost/config/compiler/metrowerks.hpp +1 -0
- data/ext/boost/config/compiler/mpw.hpp +1 -0
- data/ext/boost/config/compiler/pathscale.hpp +1 -0
- data/ext/boost/config/compiler/pgi.hpp +1 -0
- data/ext/boost/config/compiler/sunpro_cc.hpp +1 -0
- data/ext/boost/config/compiler/vacpp.hpp +3 -2
- data/ext/boost/config/compiler/visualc.hpp +25 -11
- data/ext/boost/config/platform/vxworks.hpp +353 -15
- data/ext/boost/config/select_compiler_config.hpp +4 -4
- data/ext/boost/config/stdlib/dinkumware.hpp +10 -3
- data/ext/boost/config/stdlib/libstdcpp3.hpp +2 -1
- data/ext/boost/config/suffix.hpp +45 -19
- data/ext/boost/date_time/format_date_parser.hpp +1 -11
- data/ext/boost/date_time/strings_from_facet.hpp +5 -3
- data/ext/boost/detail/atomic_redef_macros.hpp +19 -0
- data/ext/boost/detail/atomic_undef_macros.hpp +39 -0
- data/ext/boost/detail/endian.hpp +52 -4
- data/ext/boost/detail/scoped_enum_emulation.hpp +10 -10
- data/ext/boost/detail/select_type.hpp +36 -0
- data/ext/boost/exception/current_exception_cast.hpp +1 -1
- data/ext/boost/exception/detail/error_info_impl.hpp +3 -5
- data/ext/boost/exception/detail/exception_ptr.hpp +3 -3
- data/ext/boost/exception/detail/is_output_streamable.hpp +1 -1
- data/ext/boost/exception/detail/object_hex_dump.hpp +1 -1
- data/ext/boost/exception/detail/type_info.hpp +1 -1
- data/ext/boost/exception/diagnostic_information.hpp +15 -14
- data/ext/boost/exception/exception.hpp +1 -1
- data/ext/boost/exception/get_error_info.hpp +1 -1
- data/ext/boost/exception/info.hpp +12 -13
- data/ext/boost/exception/to_string.hpp +6 -1
- data/ext/boost/exception/to_string_stub.hpp +9 -1
- data/ext/boost/foreach.hpp +5 -5
- data/ext/boost/function/function_template.hpp +6 -6
- data/ext/boost/functional/hash/detail/float_functions.hpp +90 -0
- data/ext/boost/functional/hash/detail/hash_float.hpp +11 -2
- data/ext/boost/functional/hash/extensions.hpp +14 -2
- data/ext/boost/functional/hash/hash.hpp +26 -5
- data/ext/boost/get_pointer.hpp +17 -2
- data/ext/boost/integer_traits.hpp +1 -1
- data/ext/boost/lexical_cast.hpp +615 -395
- data/ext/boost/libs/atomic/lockpool.cpp +24 -0
- data/ext/boost/libs/system/src/error_code.cpp +25 -18
- data/ext/boost/libs/thread/src/future.cpp +7 -5
- data/ext/boost/libs/thread/src/pthread/once.cpp +9 -3
- data/ext/boost/libs/thread/src/pthread/once_atomic.cpp +90 -0
- data/ext/boost/libs/thread/src/pthread/thread.cpp +129 -95
- data/ext/boost/libs/thread/src/pthread/timeconv.inl +20 -1
- data/ext/boost/limits.hpp +1 -1
- data/ext/boost/math/policies/policy.hpp +10 -0
- data/ext/boost/math/special_functions/detail/round_fwd.hpp +17 -4
- data/ext/boost/math/special_functions/fpclassify.hpp +114 -45
- data/ext/boost/math/special_functions/math_fwd.hpp +195 -83
- data/ext/boost/math/special_functions/sign.hpp +13 -8
- data/ext/boost/math/tools/config.hpp +38 -16
- data/ext/boost/move/algorithm.hpp +275 -0
- data/ext/boost/move/core.hpp +332 -0
- data/ext/boost/move/detail/config_begin.hpp +23 -0
- data/ext/boost/move/detail/config_end.hpp +20 -0
- data/ext/boost/move/detail/meta_utils.hpp +158 -0
- data/ext/boost/move/iterator.hpp +298 -0
- data/ext/boost/move/move.hpp +10 -1256
- data/ext/boost/move/traits.hpp +142 -0
- data/ext/boost/move/utility.hpp +194 -0
- data/ext/boost/mpl/assert.hpp +72 -4
- data/ext/boost/noncopyable.hpp +15 -3
- data/ext/boost/pointer_to_other.hpp +55 -0
- data/ext/boost/range/concepts.hpp +4 -4
- data/ext/boost/range/detail/extract_optional_type.hpp +1 -1
- data/ext/boost/range/empty.hpp +1 -1
- data/ext/boost/range/iterator_range_core.hpp +4 -1
- data/ext/boost/range/iterator_range_io.hpp +2 -2
- data/ext/boost/ratio/config.hpp +6 -0
- data/ext/boost/ratio/detail/overflow_helpers.hpp +2 -2
- data/ext/boost/smart_ptr/allocate_shared_array.hpp +250 -0
- data/ext/boost/smart_ptr/detail/allocate_array_helper.hpp +169 -0
- data/ext/boost/smart_ptr/detail/array_deleter.hpp +124 -0
- data/ext/boost/smart_ptr/detail/array_traits.hpp +53 -0
- data/ext/boost/smart_ptr/detail/array_utility.hpp +178 -0
- data/ext/boost/smart_ptr/detail/make_array_helper.hpp +157 -0
- data/ext/boost/smart_ptr/detail/operator_bool.hpp +16 -9
- data/ext/boost/smart_ptr/detail/shared_count.hpp +78 -7
- data/ext/boost/smart_ptr/detail/sp_convertible.hpp +15 -0
- data/ext/boost/smart_ptr/detail/sp_counted_base.hpp +12 -6
- data/ext/boost/smart_ptr/detail/sp_counted_base_acc_ia64.hpp +1 -0
- data/ext/boost/smart_ptr/detail/sp_counted_base_aix.hpp +1 -0
- data/ext/boost/smart_ptr/detail/sp_counted_base_cw_ppc.hpp +1 -0
- data/ext/boost/smart_ptr/detail/sp_counted_base_cw_x86.hpp +1 -0
- data/ext/boost/smart_ptr/detail/sp_counted_base_gcc_ia64.hpp +1 -0
- data/ext/boost/smart_ptr/detail/sp_counted_base_gcc_mips.hpp +1 -0
- data/ext/boost/smart_ptr/detail/sp_counted_base_gcc_ppc.hpp +1 -0
- data/ext/boost/smart_ptr/detail/sp_counted_base_gcc_sparc.hpp +1 -0
- data/ext/boost/smart_ptr/detail/sp_counted_base_gcc_x86.hpp +1 -0
- data/ext/boost/smart_ptr/detail/sp_counted_base_nt.hpp +1 -0
- data/ext/boost/smart_ptr/detail/sp_counted_base_pt.hpp +1 -0
- data/ext/boost/smart_ptr/detail/sp_counted_base_snc_ps3.hpp +162 -0
- data/ext/boost/smart_ptr/detail/sp_counted_base_solaris.hpp +1 -0
- data/ext/boost/smart_ptr/detail/sp_counted_base_spin.hpp +1 -0
- data/ext/boost/smart_ptr/detail/sp_counted_base_sync.hpp +1 -0
- data/ext/boost/smart_ptr/detail/sp_counted_base_vacpp_ppc.hpp +1 -0
- data/ext/boost/smart_ptr/detail/sp_counted_impl.hpp +15 -0
- data/ext/boost/smart_ptr/detail/sp_forward.hpp +39 -0
- data/ext/boost/smart_ptr/detail/sp_has_sync.hpp +19 -3
- data/ext/boost/smart_ptr/detail/sp_if_array.hpp +31 -0
- data/ext/boost/smart_ptr/detail/sp_nullptr_t.hpp +45 -0
- data/ext/boost/smart_ptr/detail/spinlock_gcc_arm.hpp +5 -12
- data/ext/boost/smart_ptr/enable_shared_from_this.hpp +4 -4
- data/ext/boost/smart_ptr/make_shared.hpp +5 -1060
- data/ext/boost/smart_ptr/make_shared_array.hpp +247 -0
- data/ext/boost/smart_ptr/make_shared_object.hpp +1128 -0
- data/ext/boost/smart_ptr/scoped_array.hpp +32 -7
- data/ext/boost/smart_ptr/scoped_ptr.hpp +31 -5
- data/ext/boost/smart_ptr/shared_array.hpp +135 -20
- data/ext/boost/smart_ptr/shared_ptr.hpp +444 -126
- data/ext/boost/smart_ptr/weak_ptr.hpp +39 -28
- data/ext/boost/static_assert.hpp +74 -17
- data/ext/boost/system/error_code.hpp +76 -68
- data/ext/boost/system/system_error.hpp +5 -1
- data/ext/boost/thread/barrier.hpp +6 -2
- data/ext/boost/thread/completion_latch.hpp +233 -0
- data/ext/boost/thread/condition.hpp +6 -1
- data/ext/boost/thread/detail/async_func.hpp +571 -0
- data/ext/boost/thread/detail/config.hpp +248 -40
- data/ext/boost/thread/detail/counter.hpp +93 -0
- data/ext/boost/thread/detail/delete.hpp +12 -0
- data/ext/boost/thread/detail/invoke.hpp +1351 -0
- data/ext/boost/thread/detail/is_convertible.hpp +48 -0
- data/ext/boost/thread/detail/lockable_wrapper.hpp +45 -0
- data/ext/boost/thread/detail/log.hpp +83 -0
- data/ext/boost/thread/detail/make_tuple_indices.hpp +224 -0
- data/ext/boost/thread/detail/move.hpp +32 -16
- data/ext/boost/thread/detail/thread.hpp +236 -41
- data/ext/boost/thread/detail/thread_group.hpp +55 -9
- data/ext/boost/thread/detail/thread_interruption.hpp +4 -1
- data/ext/boost/thread/exceptions.hpp +2 -0
- data/ext/boost/thread/externally_locked.hpp +351 -0
- data/ext/boost/thread/externally_locked_stream.hpp +170 -0
- data/ext/boost/thread/future.hpp +2517 -455
- data/ext/boost/thread/future_error_code.hpp +61 -0
- data/ext/boost/thread/is_locked_by_this_thread.hpp +39 -0
- data/ext/boost/thread/latch.hpp +142 -0
- data/ext/boost/thread/lock_algorithms.hpp +468 -0
- data/ext/boost/thread/lock_concepts.hpp +197 -0
- data/ext/boost/thread/lock_factories.hpp +78 -0
- data/ext/boost/thread/lock_guard.hpp +88 -0
- data/ext/boost/thread/lock_options.hpp +31 -0
- data/ext/boost/thread/lock_traits.hpp +45 -0
- data/ext/boost/thread/lock_types.hpp +1226 -0
- data/ext/boost/thread/lockable_adapter.hpp +226 -0
- data/ext/boost/thread/lockable_concepts.hpp +157 -0
- data/ext/boost/thread/lockable_traits.hpp +207 -0
- data/ext/boost/thread/locks.hpp +5 -1816
- data/ext/boost/thread/mutex.hpp +33 -1
- data/ext/boost/thread/null_mutex.hpp +243 -0
- data/ext/boost/thread/once.hpp +10 -1
- data/ext/boost/thread/poly_lockable.hpp +68 -0
- data/ext/boost/thread/poly_lockable_adapter.hpp +89 -0
- data/ext/boost/thread/poly_shared_lockable.hpp +135 -0
- data/ext/boost/thread/poly_shared_lockable_adapter.hpp +170 -0
- data/ext/boost/thread/pthread/condition_variable.hpp +74 -26
- data/ext/boost/thread/pthread/condition_variable_fwd.hpp +54 -27
- data/ext/boost/thread/pthread/mutex.hpp +101 -38
- data/ext/boost/thread/pthread/once.hpp +459 -44
- data/ext/boost/thread/pthread/once_atomic.hpp +313 -0
- data/ext/boost/thread/pthread/recursive_mutex.hpp +19 -10
- data/ext/boost/thread/pthread/shared_mutex.hpp +226 -61
- data/ext/boost/thread/pthread/shared_mutex_assert.hpp +724 -0
- data/ext/boost/thread/pthread/thread_data.hpp +53 -50
- data/ext/boost/thread/pthread/timespec.hpp +96 -12
- data/ext/boost/thread/recursive_mutex.hpp +44 -1
- data/ext/boost/thread/reverse_lock.hpp +3 -2
- data/ext/boost/thread/scoped_thread.hpp +285 -0
- data/ext/boost/thread/shared_lock_guard.hpp +2 -1
- data/ext/boost/thread/shared_mutex.hpp +23 -0
- data/ext/boost/thread/strict_lock.hpp +235 -0
- data/ext/boost/thread/sync_bounded_queue.hpp +594 -0
- data/ext/boost/thread/sync_queue.hpp +516 -0
- data/ext/boost/thread/synchronized_value.hpp +1001 -0
- data/ext/boost/thread/testable_mutex.hpp +148 -0
- data/ext/boost/thread/thread.hpp +1 -13
- data/ext/boost/thread/thread_functors.hpp +57 -0
- data/ext/boost/thread/thread_guard.hpp +46 -0
- data/ext/boost/thread/thread_only.hpp +29 -0
- data/ext/boost/thread/v2/shared_mutex.hpp +1062 -0
- data/ext/boost/thread/v2/thread.hpp +37 -10
- data/ext/boost/thread/xtime.hpp +2 -1
- data/ext/boost/token_functions.hpp +16 -16
- data/ext/boost/type_traits/add_lvalue_reference.hpp +26 -0
- data/ext/boost/type_traits/add_reference.hpp +1 -1
- data/ext/boost/type_traits/add_rvalue_reference.hpp +4 -4
- data/ext/boost/type_traits/aligned_storage.hpp +13 -0
- data/ext/boost/type_traits/common_type.hpp +11 -12
- data/ext/boost/type_traits/config.hpp +1 -1
- data/ext/boost/type_traits/detail/common_type_imp.hpp +1 -1
- data/ext/boost/type_traits/detail/has_binary_operator.hpp +1 -1
- data/ext/boost/type_traits/detail/is_function_ptr_tester.hpp +1 -1
- data/ext/boost/type_traits/has_left_shift.hpp +49 -0
- data/ext/boost/type_traits/has_right_shift.hpp +49 -0
- data/ext/boost/type_traits/has_trivial_move_assign.hpp +57 -0
- data/ext/boost/type_traits/has_trivial_move_constructor.hpp +57 -0
- data/ext/boost/type_traits/intrinsics.hpp +18 -2
- data/ext/boost/type_traits/is_abstract.hpp +1 -1
- data/ext/boost/type_traits/is_array.hpp +1 -1
- data/ext/boost/type_traits/is_const.hpp +1 -1
- data/ext/boost/type_traits/is_convertible.hpp +78 -17
- data/ext/boost/type_traits/is_function.hpp +6 -1
- data/ext/boost/type_traits/is_integral.hpp +6 -1
- data/ext/boost/type_traits/is_nothrow_move_assignable.hpp +84 -0
- data/ext/boost/type_traits/is_nothrow_move_constructible.hpp +84 -0
- data/ext/boost/type_traits/is_pod.hpp +3 -1
- data/ext/boost/type_traits/is_rvalue_reference.hpp +1 -1
- data/ext/boost/type_traits/is_volatile.hpp +1 -1
- data/ext/boost/type_traits/make_signed.hpp +153 -0
- data/ext/boost/type_traits/make_unsigned.hpp +16 -0
- data/ext/boost/type_traits/remove_const.hpp +1 -1
- data/ext/boost/type_traits/remove_cv.hpp +1 -1
- data/ext/boost/type_traits/remove_reference.hpp +1 -1
- data/ext/boost/type_traits/remove_volatile.hpp +1 -1
- data/ext/boost/unordered/detail/allocate.hpp +1120 -0
- data/ext/boost/unordered/detail/buckets.hpp +876 -0
- data/ext/boost/unordered/detail/equivalent.hpp +680 -0
- data/ext/boost/unordered/detail/extract_key.hpp +183 -0
- data/ext/boost/unordered/detail/fwd.hpp +23 -0
- data/ext/boost/unordered/detail/table.hpp +861 -0
- data/ext/boost/unordered/detail/unique.hpp +622 -0
- data/ext/boost/unordered/detail/util.hpp +260 -0
- data/ext/boost/unordered/unordered_map.hpp +1652 -0
- data/ext/boost/unordered/unordered_map_fwd.hpp +65 -0
- data/ext/boost/unordered/unordered_set.hpp +1549 -0
- data/ext/boost/unordered/unordered_set_fwd.hpp +63 -0
- data/ext/boost/unordered_map.hpp +18 -0
- data/ext/boost/unordered_set.hpp +18 -0
- data/ext/boost/utility/addressof.hpp +2 -2
- data/ext/boost/utility/result_of.hpp +8 -1
- data/ext/boost/version.hpp +2 -2
- data/ext/common/Account.h +1 -1
- data/ext/common/AccountsDatabase.h +1 -1
- data/ext/common/AgentsStarter.cpp +3 -1
- data/ext/common/AgentsStarter.h +2 -2
- data/ext/common/ApplicationPool2/AppTypes.cpp +24 -6
- data/ext/common/ApplicationPool2/AppTypes.h +17 -8
- data/ext/common/ApplicationPool2/Common.h +12 -12
- data/ext/common/ApplicationPool2/DirectSpawner.h +2 -2
- data/ext/common/ApplicationPool2/DummySpawner.h +3 -3
- data/ext/common/ApplicationPool2/Group.h +6 -6
- data/ext/common/ApplicationPool2/Implementation.cpp +19 -19
- data/ext/common/ApplicationPool2/PipeWatcher.h +5 -5
- data/ext/common/ApplicationPool2/Pool.h +21 -21
- data/ext/common/ApplicationPool2/Process.h +6 -6
- data/ext/common/ApplicationPool2/Session.h +1 -1
- data/ext/common/ApplicationPool2/SmartSpawner.h +24 -12
- data/ext/common/ApplicationPool2/Socket.h +2 -2
- data/ext/common/ApplicationPool2/Spawner.h +64 -14
- data/ext/common/ApplicationPool2/SpawnerFactory.h +7 -7
- data/ext/common/ApplicationPool2/SuperGroup.h +5 -5
- data/ext/common/BackgroundEventLoop.cpp +4 -4
- data/ext/common/BackgroundEventLoop.h +1 -1
- data/ext/common/Constants.h +13 -1
- data/ext/common/EventedBufferedInput.h +8 -8
- data/ext/common/Exceptions.cpp +71 -0
- data/ext/common/Exceptions.h +60 -7
- data/ext/common/FileDescriptor.h +4 -4
- data/ext/common/MessageClient.h +1 -1
- data/ext/common/MessageServer.h +5 -5
- data/ext/common/MultiLibeio.cpp +3 -3
- data/ext/common/MultiLibeio.h +2 -2
- data/ext/common/RandomGenerator.h +11 -11
- data/ext/common/ResourceLocator.h +8 -1
- data/ext/common/SafeLibev.h +12 -12
- data/ext/common/ServerInstanceDir.h +11 -3
- data/ext/common/UnionStation.h +10 -10
- data/ext/common/Utils.cpp +11 -13
- data/ext/common/Utils.h +9 -9
- data/ext/common/Utils/BlockingQueue.h +10 -10
- data/ext/common/Utils/BufferedIO.h +1 -1
- data/ext/common/Utils/CachedFileStat.hpp +2 -2
- data/ext/common/Utils/FileChangeChecker.h +1 -1
- data/ext/common/Utils/HashMap.h +13 -4
- data/ext/common/Utils/IOUtils.cpp +33 -10
- data/ext/common/Utils/IniFile.h +3 -3
- data/ext/common/Utils/Lock.h +2 -2
- data/ext/common/Utils/MessagePassing.h +10 -10
- data/ext/common/Utils/ProcessMetricsCollector.h +24 -6
- data/ext/common/Utils/ScopeGuard.h +5 -5
- data/ext/common/Utils/jsoncpp.cpp +2 -0
- data/ext/common/agents/HelperAgent/FileBackedPipe.h +26 -26
- data/ext/common/agents/HelperAgent/Main.cpp +18 -18
- data/ext/common/agents/HelperAgent/RequestHandler.cpp +4 -4
- data/ext/common/agents/HelperAgent/RequestHandler.h +30 -21
- data/ext/common/agents/LoggingAgent/AdminController.h +1 -1
- data/ext/common/agents/LoggingAgent/FilterSupport.h +13 -11
- data/ext/common/agents/LoggingAgent/LoggingServer.h +11 -11
- data/ext/common/agents/LoggingAgent/Main.cpp +9 -9
- data/ext/common/agents/LoggingAgent/RemoteSender.h +3 -3
- data/ext/common/agents/SpawnPreparer.cpp +1 -0
- data/ext/common/agents/Watchdog/AgentWatcher.cpp +8 -7
- data/ext/common/agents/Watchdog/Main.cpp +81 -73
- data/ext/common/agents/Watchdog/ServerInstanceDirToucher.cpp +1 -1
- data/ext/libev/Changes +57 -0
- data/ext/libev/LICENSE +2 -1
- data/ext/libev/Makefile.in +110 -50
- data/ext/libev/README +8 -8
- data/ext/libev/aclocal.m4 +1503 -861
- data/ext/libev/config.guess +290 -304
- data/ext/libev/config.sub +77 -198
- data/ext/libev/configure +1735 -890
- data/ext/libev/configure.ac +3 -2
- data/ext/libev/ev++.h +6 -6
- data/ext/libev/ev.c +541 -214
- data/ext/libev/ev.h +106 -100
- data/ext/libev/ev_epoll.c +1 -1
- data/ext/libev/ev_kqueue.c +20 -4
- data/ext/libev/ev_vars.h +15 -16
- data/ext/libev/ev_win32.c +12 -2
- data/ext/libev/ev_wrap.h +162 -160
- data/ext/libev/event.c +29 -6
- data/ext/libev/event.h +9 -2
- data/ext/libev/ltmain.sh +2632 -1384
- data/ext/nginx/ConfigurationCommands.c +1 -1
- data/ext/nginx/ConfigurationCommands.c.erb +3 -1
- data/ext/nginx/ContentHandler.c +25 -2
- data/ext/nginx/CreateLocationConfig.c +1 -0
- data/ext/nginx/CreateLocationConfig.c.erb +1 -1
- data/ext/nginx/MergeLocationConfig.c +1 -0
- data/ext/nginx/MergeLocationConfig.c.erb +1 -1
- data/ext/nginx/config +12 -0
- data/ext/oxt/dynamic_thread_group.hpp +7 -4
- data/ext/oxt/system_calls.cpp +5 -1
- data/ext/oxt/system_calls.hpp +3 -0
- data/helper-scripts/node-loader.js +117 -249
- data/lib/phusion_passenger.rb +27 -5
- data/lib/phusion_passenger/abstract_installer.rb +104 -9
- data/lib/phusion_passenger/admin_tools/memory_stats.rb +10 -9
- data/lib/phusion_passenger/apache2/config_options.rb +6 -3
- data/lib/phusion_passenger/common_library.rb +7 -1
- data/lib/phusion_passenger/constants.rb +6 -0
- data/lib/phusion_passenger/loader_shared_helpers.rb +7 -4
- data/lib/phusion_passenger/nginx/config_options.rb +2 -1
- data/lib/phusion_passenger/packaging.rb +3 -0
- data/lib/phusion_passenger/platform_info/apache.rb +43 -6
- data/lib/phusion_passenger/platform_info/apache_detector.rb +15 -5
- data/lib/phusion_passenger/platform_info/compiler.rb +167 -32
- data/lib/phusion_passenger/platform_info/cxx_portability.rb +133 -77
- data/lib/phusion_passenger/platform_info/depcheck.rb +17 -7
- data/lib/phusion_passenger/platform_info/depcheck_specs/apache2.rb +3 -3
- data/lib/phusion_passenger/platform_info/depcheck_specs/compiler_toolchain.rb +4 -4
- data/lib/phusion_passenger/platform_info/depcheck_specs/ruby.rb +5 -6
- data/lib/phusion_passenger/platform_info/linux.rb +2 -1
- data/lib/phusion_passenger/platform_info/operating_system.rb +1 -1
- data/lib/phusion_passenger/platform_info/ruby.rb +18 -3
- data/lib/phusion_passenger/standalone/runtime_installer.rb +6 -2
- data/lib/phusion_passenger/standalone/start_command.rb +8 -2
- data/lib/phusion_passenger/utils/ansi_colors.rb +9 -0
- data/lib/phusion_passenger/utils/hosts_file_parser.rb +4 -2
- data/node_lib/phusion_passenger/httplib_emulation.js +141 -0
- data/node_lib/phusion_passenger/line_reader.js +154 -0
- data/node_lib/phusion_passenger/request_handler.js +65 -0
- data/node_lib/phusion_passenger/session_protocol_parser.js +113 -0
- data/resources/templates/apache2/deployment_example.txt.erb +2 -1
- data/resources/templates/apache2/installing_against_a_different_apache.txt.erb +14 -0
- data/resources/templates/apache2/multiple_apache_installations_detected.txt.erb +15 -0
- data/resources/templates/apache2/possible_solutions_for_compilation_and_installation_problems.txt.erb +4 -5
- data/resources/templates/general_error_with_html.html.template +1 -1
- data/resources/templates/installer_common/gem_install_permission_problems.txt.erb +17 -0
- data/resources/templates/installer_common/low_amount_of_memory_warning.txt.erb +6 -4
- data/resources/templates/installer_common/world_inaccessible_directories.txt.erb +16 -0
- data/resources/templates/nginx/deployment_example.txt.erb +2 -1
- data/resources/templates/nginx/possible_solutions_for_compilation_and_installation_problems.txt.erb +4 -5
- data/resources/templates/standalone/config.erb +1 -0
- data/test/cxx/ApplicationPool2/DirectSpawnerTest.cpp +3 -3
- data/test/cxx/ApplicationPool2/PoolTest.cpp +4 -4
- data/test/cxx/ApplicationPool2/ProcessTest.cpp +5 -5
- data/test/cxx/ApplicationPool2/SmartSpawnerTest.cpp +5 -5
- data/test/cxx/ApplicationPool2/SpawnerTestCases.cpp +1 -1
- data/test/cxx/EventedBufferedInputTest.cpp +6 -6
- data/test/cxx/FileBackedPipeTest.cpp +1 -1
- data/test/cxx/MessagePassingTest.cpp +1 -1
- data/test/cxx/MessageServerTest.cpp +4 -4
- data/test/cxx/RequestHandlerTest.cpp +7 -7
- data/test/cxx/UnionStationTest.cpp +2 -2
- data/test/node/line_reader_spec.js +338 -0
- data/test/node/spec_helper.js +27 -0
- data/test/ruby/standalone/runtime_installer_spec.rb +2 -1
- metadata +131 -22
- metadata.gz.asc +7 -7
- data/ext/boost/functional/hash/detail/container_fwd_0x.hpp +0 -29
- data/ext/boost/lambda/core.hpp +0 -79
- data/ext/boost/lambda/detail/actions.hpp +0 -174
- data/ext/boost/lambda/detail/arity_code.hpp +0 -110
- data/ext/boost/lambda/detail/function_adaptors.hpp +0 -789
- data/ext/boost/lambda/detail/is_instance_of.hpp +0 -104
- data/ext/boost/lambda/detail/lambda_config.hpp +0 -48
- data/ext/boost/lambda/detail/lambda_functor_base.hpp +0 -615
- data/ext/boost/lambda/detail/lambda_functors.hpp +0 -324
- data/ext/boost/lambda/detail/lambda_fwd.hpp +0 -74
- data/ext/boost/lambda/detail/lambda_traits.hpp +0 -578
- data/ext/boost/lambda/detail/member_ptr.hpp +0 -737
- data/ext/boost/lambda/detail/operator_actions.hpp +0 -139
- data/ext/boost/lambda/detail/operator_lambda_func_base.hpp +0 -271
- data/ext/boost/lambda/detail/operator_return_type_traits.hpp +0 -917
- data/ext/boost/lambda/detail/operators.hpp +0 -370
- data/ext/boost/lambda/detail/ret.hpp +0 -325
- data/ext/boost/lambda/detail/return_type_traits.hpp +0 -282
- data/ext/boost/lambda/detail/select_functions.hpp +0 -74
- data/ext/boost/lambda/lambda.hpp +0 -34
@@ -0,0 +1,260 @@
|
|
1
|
+
|
2
|
+
// Copyright (C) 2003-2004 Jeremy B. Maitin-Shepard.
|
3
|
+
// Copyright (C) 2005-2011 Daniel James
|
4
|
+
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
5
|
+
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
6
|
+
|
7
|
+
#ifndef BOOST_UNORDERED_DETAIL_UTIL_HPP_INCLUDED
|
8
|
+
#define BOOST_UNORDERED_DETAIL_UTIL_HPP_INCLUDED
|
9
|
+
|
10
|
+
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
|
11
|
+
# pragma once
|
12
|
+
#endif
|
13
|
+
|
14
|
+
#include <boost/type_traits/is_convertible.hpp>
|
15
|
+
#include <boost/type_traits/is_empty.hpp>
|
16
|
+
#include <boost/iterator/iterator_categories.hpp>
|
17
|
+
#include <boost/utility/enable_if.hpp>
|
18
|
+
#include <boost/detail/select_type.hpp>
|
19
|
+
#include <boost/move/move.hpp>
|
20
|
+
#include <boost/preprocessor/seq/size.hpp>
|
21
|
+
#include <boost/preprocessor/seq/enum.hpp>
|
22
|
+
#include <boost/swap.hpp>
|
23
|
+
|
24
|
+
namespace boost { namespace unordered { namespace detail {
|
25
|
+
|
26
|
+
static const float minimum_max_load_factor = 1e-3f;
|
27
|
+
static const std::size_t default_bucket_count = 11;
|
28
|
+
struct move_tag {};
|
29
|
+
struct empty_emplace {};
|
30
|
+
|
31
|
+
////////////////////////////////////////////////////////////////////////////
|
32
|
+
// iterator SFINAE
|
33
|
+
|
34
|
+
template <typename I>
|
35
|
+
struct is_forward :
|
36
|
+
boost::is_convertible<
|
37
|
+
typename boost::iterator_traversal<I>::type,
|
38
|
+
boost::forward_traversal_tag>
|
39
|
+
{};
|
40
|
+
|
41
|
+
template <typename I, typename ReturnType>
|
42
|
+
struct enable_if_forward :
|
43
|
+
boost::enable_if_c<
|
44
|
+
boost::unordered::detail::is_forward<I>::value,
|
45
|
+
ReturnType>
|
46
|
+
{};
|
47
|
+
|
48
|
+
template <typename I, typename ReturnType>
|
49
|
+
struct disable_if_forward :
|
50
|
+
boost::disable_if_c<
|
51
|
+
boost::unordered::detail::is_forward<I>::value,
|
52
|
+
ReturnType>
|
53
|
+
{};
|
54
|
+
|
55
|
+
////////////////////////////////////////////////////////////////////////////
|
56
|
+
// primes
|
57
|
+
|
58
|
+
#define BOOST_UNORDERED_PRIMES \
|
59
|
+
(17ul)(29ul)(37ul)(53ul)(67ul)(79ul) \
|
60
|
+
(97ul)(131ul)(193ul)(257ul)(389ul)(521ul)(769ul) \
|
61
|
+
(1031ul)(1543ul)(2053ul)(3079ul)(6151ul)(12289ul)(24593ul) \
|
62
|
+
(49157ul)(98317ul)(196613ul)(393241ul)(786433ul) \
|
63
|
+
(1572869ul)(3145739ul)(6291469ul)(12582917ul)(25165843ul) \
|
64
|
+
(50331653ul)(100663319ul)(201326611ul)(402653189ul)(805306457ul) \
|
65
|
+
(1610612741ul)(3221225473ul)(4294967291ul)
|
66
|
+
|
67
|
+
template<class T> struct prime_list_template
|
68
|
+
{
|
69
|
+
static std::size_t const value[];
|
70
|
+
|
71
|
+
#if !defined(SUNPRO_CC)
|
72
|
+
static std::ptrdiff_t const length;
|
73
|
+
#else
|
74
|
+
static std::ptrdiff_t const length
|
75
|
+
= BOOST_PP_SEQ_SIZE(BOOST_UNORDERED_PRIMES);
|
76
|
+
#endif
|
77
|
+
};
|
78
|
+
|
79
|
+
template<class T>
|
80
|
+
std::size_t const prime_list_template<T>::value[] = {
|
81
|
+
BOOST_PP_SEQ_ENUM(BOOST_UNORDERED_PRIMES)
|
82
|
+
};
|
83
|
+
|
84
|
+
#if !defined(SUNPRO_CC)
|
85
|
+
template<class T>
|
86
|
+
std::ptrdiff_t const prime_list_template<T>::length
|
87
|
+
= BOOST_PP_SEQ_SIZE(BOOST_UNORDERED_PRIMES);
|
88
|
+
#endif
|
89
|
+
|
90
|
+
#undef BOOST_UNORDERED_PRIMES
|
91
|
+
|
92
|
+
typedef prime_list_template<std::size_t> prime_list;
|
93
|
+
|
94
|
+
// no throw
|
95
|
+
inline std::size_t next_prime(std::size_t num) {
|
96
|
+
std::size_t const* const prime_list_begin = prime_list::value;
|
97
|
+
std::size_t const* const prime_list_end = prime_list_begin +
|
98
|
+
prime_list::length;
|
99
|
+
std::size_t const* bound =
|
100
|
+
std::lower_bound(prime_list_begin, prime_list_end, num);
|
101
|
+
if(bound == prime_list_end)
|
102
|
+
bound--;
|
103
|
+
return *bound;
|
104
|
+
}
|
105
|
+
|
106
|
+
// no throw
|
107
|
+
inline std::size_t prev_prime(std::size_t num) {
|
108
|
+
std::size_t const* const prime_list_begin = prime_list::value;
|
109
|
+
std::size_t const* const prime_list_end = prime_list_begin +
|
110
|
+
prime_list::length;
|
111
|
+
std::size_t const* bound =
|
112
|
+
std::upper_bound(prime_list_begin,prime_list_end, num);
|
113
|
+
if(bound != prime_list_begin)
|
114
|
+
bound--;
|
115
|
+
return *bound;
|
116
|
+
}
|
117
|
+
|
118
|
+
////////////////////////////////////////////////////////////////////////////
|
119
|
+
// insert_size/initial_size
|
120
|
+
|
121
|
+
#if !defined(BOOST_NO_STD_DISTANCE)
|
122
|
+
|
123
|
+
using ::std::distance;
|
124
|
+
|
125
|
+
#else
|
126
|
+
|
127
|
+
template <class ForwardIterator>
|
128
|
+
inline std::size_t distance(ForwardIterator i, ForwardIterator j) {
|
129
|
+
std::size_t x;
|
130
|
+
std::distance(i, j, x);
|
131
|
+
return x;
|
132
|
+
}
|
133
|
+
|
134
|
+
#endif
|
135
|
+
|
136
|
+
template <class I>
|
137
|
+
inline typename
|
138
|
+
boost::unordered::detail::enable_if_forward<I, std::size_t>::type
|
139
|
+
insert_size(I i, I j)
|
140
|
+
{
|
141
|
+
return std::distance(i, j);
|
142
|
+
}
|
143
|
+
|
144
|
+
template <class I>
|
145
|
+
inline typename
|
146
|
+
boost::unordered::detail::disable_if_forward<I, std::size_t>::type
|
147
|
+
insert_size(I, I)
|
148
|
+
{
|
149
|
+
return 1;
|
150
|
+
}
|
151
|
+
|
152
|
+
template <class I>
|
153
|
+
inline std::size_t initial_size(I i, I j,
|
154
|
+
std::size_t num_buckets =
|
155
|
+
boost::unordered::detail::default_bucket_count)
|
156
|
+
{
|
157
|
+
// TODO: Why +1?
|
158
|
+
return (std::max)(
|
159
|
+
boost::unordered::detail::insert_size(i, j) + 1,
|
160
|
+
num_buckets);
|
161
|
+
}
|
162
|
+
|
163
|
+
////////////////////////////////////////////////////////////////////////////
|
164
|
+
// compressed
|
165
|
+
|
166
|
+
template <typename T, int Index>
|
167
|
+
struct compressed_base : private T
|
168
|
+
{
|
169
|
+
compressed_base(T const& x) : T(x) {}
|
170
|
+
compressed_base(T& x, move_tag) : T(boost::move(x)) {}
|
171
|
+
|
172
|
+
T& get() { return *this; }
|
173
|
+
T const& get() const { return *this; }
|
174
|
+
};
|
175
|
+
|
176
|
+
template <typename T, int Index>
|
177
|
+
struct uncompressed_base
|
178
|
+
{
|
179
|
+
uncompressed_base(T const& x) : value_(x) {}
|
180
|
+
uncompressed_base(T& x, move_tag) : value_(boost::move(x)) {}
|
181
|
+
|
182
|
+
T& get() { return value_; }
|
183
|
+
T const& get() const { return value_; }
|
184
|
+
private:
|
185
|
+
T value_;
|
186
|
+
};
|
187
|
+
|
188
|
+
template <typename T, int Index>
|
189
|
+
struct generate_base
|
190
|
+
: boost::detail::if_true<
|
191
|
+
boost::is_empty<T>::value
|
192
|
+
>:: BOOST_NESTED_TEMPLATE then<
|
193
|
+
boost::unordered::detail::compressed_base<T, Index>,
|
194
|
+
boost::unordered::detail::uncompressed_base<T, Index>
|
195
|
+
>
|
196
|
+
{};
|
197
|
+
|
198
|
+
template <typename T1, typename T2>
|
199
|
+
struct compressed
|
200
|
+
: private boost::unordered::detail::generate_base<T1, 1>::type,
|
201
|
+
private boost::unordered::detail::generate_base<T2, 2>::type
|
202
|
+
{
|
203
|
+
typedef typename generate_base<T1, 1>::type base1;
|
204
|
+
typedef typename generate_base<T2, 2>::type base2;
|
205
|
+
|
206
|
+
typedef T1 first_type;
|
207
|
+
typedef T2 second_type;
|
208
|
+
|
209
|
+
first_type& first() {
|
210
|
+
return static_cast<base1*>(this)->get();
|
211
|
+
}
|
212
|
+
|
213
|
+
first_type const& first() const {
|
214
|
+
return static_cast<base1 const*>(this)->get();
|
215
|
+
}
|
216
|
+
|
217
|
+
second_type& second() {
|
218
|
+
return static_cast<base2*>(this)->get();
|
219
|
+
}
|
220
|
+
|
221
|
+
second_type const& second() const {
|
222
|
+
return static_cast<base2 const*>(this)->get();
|
223
|
+
}
|
224
|
+
|
225
|
+
template <typename First, typename Second>
|
226
|
+
compressed(First const& x1, Second const& x2)
|
227
|
+
: base1(x1), base2(x2) {}
|
228
|
+
|
229
|
+
compressed(compressed const& x)
|
230
|
+
: base1(x.first()), base2(x.second()) {}
|
231
|
+
|
232
|
+
compressed(compressed& x, move_tag m)
|
233
|
+
: base1(x.first(), m), base2(x.second(), m) {}
|
234
|
+
|
235
|
+
void assign(compressed const& x)
|
236
|
+
{
|
237
|
+
first() = x.first();
|
238
|
+
second() = x.second();
|
239
|
+
}
|
240
|
+
|
241
|
+
void move_assign(compressed& x)
|
242
|
+
{
|
243
|
+
first() = boost::move(x.first());
|
244
|
+
second() = boost::move(x.second());
|
245
|
+
}
|
246
|
+
|
247
|
+
void swap(compressed& x)
|
248
|
+
{
|
249
|
+
boost::swap(first(), x.first());
|
250
|
+
boost::swap(second(), x.second());
|
251
|
+
}
|
252
|
+
|
253
|
+
private:
|
254
|
+
// Prevent assignment just to make use of assign or
|
255
|
+
// move_assign explicit.
|
256
|
+
compressed& operator=(compressed const&);
|
257
|
+
};
|
258
|
+
}}}
|
259
|
+
|
260
|
+
#endif
|
@@ -0,0 +1,1652 @@
|
|
1
|
+
|
2
|
+
// Copyright (C) 2003-2004 Jeremy B. Maitin-Shepard.
|
3
|
+
// Copyright (C) 2005-2011 Daniel James.
|
4
|
+
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
5
|
+
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
6
|
+
|
7
|
+
// See http://www.boost.org/libs/unordered for documentation
|
8
|
+
|
9
|
+
#ifndef BOOST_UNORDERED_UNORDERED_MAP_HPP_INCLUDED
|
10
|
+
#define BOOST_UNORDERED_UNORDERED_MAP_HPP_INCLUDED
|
11
|
+
|
12
|
+
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
|
13
|
+
# pragma once
|
14
|
+
#endif
|
15
|
+
|
16
|
+
#include <boost/unordered/unordered_map_fwd.hpp>
|
17
|
+
#include <boost/unordered/detail/equivalent.hpp>
|
18
|
+
#include <boost/unordered/detail/unique.hpp>
|
19
|
+
#include <boost/unordered/detail/util.hpp>
|
20
|
+
#include <boost/functional/hash.hpp>
|
21
|
+
#include <boost/move/move.hpp>
|
22
|
+
|
23
|
+
#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
|
24
|
+
#include <initializer_list>
|
25
|
+
#endif
|
26
|
+
|
27
|
+
#if defined(BOOST_MSVC)
|
28
|
+
#pragma warning(push)
|
29
|
+
#if BOOST_MSVC >= 1400
|
30
|
+
#pragma warning(disable:4396) //the inline specifier cannot be used when a
|
31
|
+
// friend declaration refers to a specialization
|
32
|
+
// of a function template
|
33
|
+
#endif
|
34
|
+
#endif
|
35
|
+
|
36
|
+
namespace boost
|
37
|
+
{
|
38
|
+
namespace unordered
|
39
|
+
{
|
40
|
+
template <class K, class T, class H, class P, class A>
|
41
|
+
class unordered_map
|
42
|
+
{
|
43
|
+
#if defined(BOOST_UNORDERED_USE_MOVE)
|
44
|
+
BOOST_COPYABLE_AND_MOVABLE(unordered_map)
|
45
|
+
#endif
|
46
|
+
|
47
|
+
public:
|
48
|
+
|
49
|
+
typedef K key_type;
|
50
|
+
typedef std::pair<const K, T> value_type;
|
51
|
+
typedef T mapped_type;
|
52
|
+
typedef H hasher;
|
53
|
+
typedef P key_equal;
|
54
|
+
typedef A allocator_type;
|
55
|
+
|
56
|
+
private:
|
57
|
+
|
58
|
+
typedef boost::unordered::detail::map<A, K, T, H, P> types;
|
59
|
+
typedef typename types::traits allocator_traits;
|
60
|
+
typedef typename types::table table;
|
61
|
+
|
62
|
+
public:
|
63
|
+
|
64
|
+
typedef typename allocator_traits::pointer pointer;
|
65
|
+
typedef typename allocator_traits::const_pointer const_pointer;
|
66
|
+
|
67
|
+
typedef value_type& reference;
|
68
|
+
typedef value_type const& const_reference;
|
69
|
+
|
70
|
+
typedef std::size_t size_type;
|
71
|
+
typedef std::ptrdiff_t difference_type;
|
72
|
+
|
73
|
+
typedef typename table::cl_iterator const_local_iterator;
|
74
|
+
typedef typename table::l_iterator local_iterator;
|
75
|
+
typedef typename table::c_iterator const_iterator;
|
76
|
+
typedef typename table::iterator iterator;
|
77
|
+
|
78
|
+
private:
|
79
|
+
|
80
|
+
table table_;
|
81
|
+
|
82
|
+
public:
|
83
|
+
|
84
|
+
// constructors
|
85
|
+
|
86
|
+
explicit unordered_map(
|
87
|
+
size_type = boost::unordered::detail::default_bucket_count,
|
88
|
+
const hasher& = hasher(),
|
89
|
+
const key_equal& = key_equal(),
|
90
|
+
const allocator_type& = allocator_type());
|
91
|
+
|
92
|
+
explicit unordered_map(allocator_type const&);
|
93
|
+
|
94
|
+
template <class InputIt>
|
95
|
+
unordered_map(InputIt, InputIt);
|
96
|
+
|
97
|
+
template <class InputIt>
|
98
|
+
unordered_map(
|
99
|
+
InputIt, InputIt,
|
100
|
+
size_type,
|
101
|
+
const hasher& = hasher(),
|
102
|
+
const key_equal& = key_equal());
|
103
|
+
|
104
|
+
template <class InputIt>
|
105
|
+
unordered_map(
|
106
|
+
InputIt, InputIt,
|
107
|
+
size_type,
|
108
|
+
const hasher&,
|
109
|
+
const key_equal&,
|
110
|
+
const allocator_type&);
|
111
|
+
|
112
|
+
// copy/move constructors
|
113
|
+
|
114
|
+
unordered_map(unordered_map const&);
|
115
|
+
|
116
|
+
unordered_map(unordered_map const&, allocator_type const&);
|
117
|
+
|
118
|
+
#if defined(BOOST_UNORDERED_USE_MOVE)
|
119
|
+
unordered_map(BOOST_RV_REF(unordered_map) other)
|
120
|
+
: table_(other.table_, boost::unordered::detail::move_tag())
|
121
|
+
{
|
122
|
+
}
|
123
|
+
#elif !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
|
124
|
+
unordered_map(unordered_map&& other)
|
125
|
+
: table_(other.table_, boost::unordered::detail::move_tag())
|
126
|
+
{
|
127
|
+
}
|
128
|
+
#endif
|
129
|
+
|
130
|
+
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
|
131
|
+
unordered_map(unordered_map&&, allocator_type const&);
|
132
|
+
#endif
|
133
|
+
|
134
|
+
#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
|
135
|
+
unordered_map(
|
136
|
+
std::initializer_list<value_type>,
|
137
|
+
size_type = boost::unordered::detail::default_bucket_count,
|
138
|
+
const hasher& = hasher(),
|
139
|
+
const key_equal&l = key_equal(),
|
140
|
+
const allocator_type& = allocator_type());
|
141
|
+
#endif
|
142
|
+
|
143
|
+
// Destructor
|
144
|
+
|
145
|
+
~unordered_map();
|
146
|
+
|
147
|
+
// Assign
|
148
|
+
|
149
|
+
#if defined(BOOST_UNORDERED_USE_MOVE)
|
150
|
+
unordered_map& operator=(BOOST_COPY_ASSIGN_REF(unordered_map) x)
|
151
|
+
{
|
152
|
+
table_.assign(x.table_);
|
153
|
+
return *this;
|
154
|
+
}
|
155
|
+
|
156
|
+
unordered_map& operator=(BOOST_RV_REF(unordered_map) x)
|
157
|
+
{
|
158
|
+
table_.move_assign(x.table_);
|
159
|
+
return *this;
|
160
|
+
}
|
161
|
+
#else
|
162
|
+
unordered_map& operator=(unordered_map const& x)
|
163
|
+
{
|
164
|
+
table_.assign(x.table_);
|
165
|
+
return *this;
|
166
|
+
}
|
167
|
+
|
168
|
+
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
|
169
|
+
unordered_map& operator=(unordered_map&& x)
|
170
|
+
{
|
171
|
+
table_.move_assign(x.table_);
|
172
|
+
return *this;
|
173
|
+
}
|
174
|
+
#endif
|
175
|
+
#endif
|
176
|
+
|
177
|
+
#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
|
178
|
+
unordered_map& operator=(std::initializer_list<value_type>);
|
179
|
+
#endif
|
180
|
+
|
181
|
+
allocator_type get_allocator() const BOOST_NOEXCEPT
|
182
|
+
{
|
183
|
+
return table_.node_alloc();
|
184
|
+
}
|
185
|
+
|
186
|
+
// size and capacity
|
187
|
+
|
188
|
+
bool empty() const BOOST_NOEXCEPT
|
189
|
+
{
|
190
|
+
return table_.size_ == 0;
|
191
|
+
}
|
192
|
+
|
193
|
+
size_type size() const BOOST_NOEXCEPT
|
194
|
+
{
|
195
|
+
return table_.size_;
|
196
|
+
}
|
197
|
+
|
198
|
+
size_type max_size() const BOOST_NOEXCEPT;
|
199
|
+
|
200
|
+
// iterators
|
201
|
+
|
202
|
+
iterator begin() BOOST_NOEXCEPT
|
203
|
+
{
|
204
|
+
return table_.begin();
|
205
|
+
}
|
206
|
+
|
207
|
+
const_iterator begin() const BOOST_NOEXCEPT
|
208
|
+
{
|
209
|
+
return table_.begin();
|
210
|
+
}
|
211
|
+
|
212
|
+
iterator end() BOOST_NOEXCEPT
|
213
|
+
{
|
214
|
+
return iterator();
|
215
|
+
}
|
216
|
+
|
217
|
+
const_iterator end() const BOOST_NOEXCEPT
|
218
|
+
{
|
219
|
+
return const_iterator();
|
220
|
+
}
|
221
|
+
|
222
|
+
const_iterator cbegin() const BOOST_NOEXCEPT
|
223
|
+
{
|
224
|
+
return table_.begin();
|
225
|
+
}
|
226
|
+
|
227
|
+
const_iterator cend() const BOOST_NOEXCEPT
|
228
|
+
{
|
229
|
+
return const_iterator();
|
230
|
+
}
|
231
|
+
|
232
|
+
// emplace
|
233
|
+
|
234
|
+
#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
|
235
|
+
template <class... Args>
|
236
|
+
std::pair<iterator, bool> emplace(BOOST_FWD_REF(Args)... args)
|
237
|
+
{
|
238
|
+
return table_.emplace(boost::forward<Args>(args)...);
|
239
|
+
}
|
240
|
+
|
241
|
+
template <class... Args>
|
242
|
+
iterator emplace_hint(const_iterator, BOOST_FWD_REF(Args)... args)
|
243
|
+
{
|
244
|
+
return table_.emplace(boost::forward<Args>(args)...).first;
|
245
|
+
}
|
246
|
+
#else
|
247
|
+
|
248
|
+
#if !BOOST_WORKAROUND(__SUNPRO_CC, BOOST_TESTED_AT(0x5100))
|
249
|
+
|
250
|
+
// 0 argument emplace requires special treatment in case
|
251
|
+
// the container is instantiated with a value type that
|
252
|
+
// doesn't have a default constructor.
|
253
|
+
|
254
|
+
std::pair<iterator, bool> emplace(
|
255
|
+
boost::unordered::detail::empty_emplace
|
256
|
+
= boost::unordered::detail::empty_emplace(),
|
257
|
+
value_type v = value_type())
|
258
|
+
{
|
259
|
+
return this->emplace(boost::move(v));
|
260
|
+
}
|
261
|
+
|
262
|
+
iterator emplace_hint(const_iterator hint,
|
263
|
+
boost::unordered::detail::empty_emplace
|
264
|
+
= boost::unordered::detail::empty_emplace(),
|
265
|
+
value_type v = value_type()
|
266
|
+
)
|
267
|
+
{
|
268
|
+
return this->emplace_hint(hint, boost::move(v));
|
269
|
+
}
|
270
|
+
|
271
|
+
#endif
|
272
|
+
|
273
|
+
template <typename A0>
|
274
|
+
std::pair<iterator, bool> emplace(BOOST_FWD_REF(A0) a0)
|
275
|
+
{
|
276
|
+
return table_.emplace(
|
277
|
+
boost::unordered::detail::create_emplace_args(
|
278
|
+
boost::forward<A0>(a0))
|
279
|
+
);
|
280
|
+
}
|
281
|
+
|
282
|
+
template <typename A0>
|
283
|
+
iterator emplace_hint(const_iterator, BOOST_FWD_REF(A0) a0)
|
284
|
+
{
|
285
|
+
return table_.emplace(
|
286
|
+
boost::unordered::detail::create_emplace_args(
|
287
|
+
boost::forward<A0>(a0))
|
288
|
+
).first;
|
289
|
+
}
|
290
|
+
|
291
|
+
template <typename A0, typename A1>
|
292
|
+
std::pair<iterator, bool> emplace(
|
293
|
+
BOOST_FWD_REF(A0) a0,
|
294
|
+
BOOST_FWD_REF(A1) a1)
|
295
|
+
{
|
296
|
+
return table_.emplace(
|
297
|
+
boost::unordered::detail::create_emplace_args(
|
298
|
+
boost::forward<A0>(a0),
|
299
|
+
boost::forward<A1>(a1))
|
300
|
+
);
|
301
|
+
}
|
302
|
+
|
303
|
+
template <typename A0, typename A1>
|
304
|
+
iterator emplace_hint(const_iterator,
|
305
|
+
BOOST_FWD_REF(A0) a0,
|
306
|
+
BOOST_FWD_REF(A1) a1)
|
307
|
+
{
|
308
|
+
return table_.emplace(
|
309
|
+
boost::unordered::detail::create_emplace_args(
|
310
|
+
boost::forward<A0>(a0),
|
311
|
+
boost::forward<A1>(a1))
|
312
|
+
).first;
|
313
|
+
}
|
314
|
+
|
315
|
+
template <typename A0, typename A1, typename A2>
|
316
|
+
std::pair<iterator, bool> emplace(
|
317
|
+
BOOST_FWD_REF(A0) a0,
|
318
|
+
BOOST_FWD_REF(A1) a1,
|
319
|
+
BOOST_FWD_REF(A2) a2)
|
320
|
+
{
|
321
|
+
return table_.emplace(
|
322
|
+
boost::unordered::detail::create_emplace_args(
|
323
|
+
boost::forward<A0>(a0),
|
324
|
+
boost::forward<A1>(a1),
|
325
|
+
boost::forward<A2>(a2))
|
326
|
+
);
|
327
|
+
}
|
328
|
+
|
329
|
+
template <typename A0, typename A1, typename A2>
|
330
|
+
iterator emplace_hint(const_iterator,
|
331
|
+
BOOST_FWD_REF(A0) a0,
|
332
|
+
BOOST_FWD_REF(A1) a1,
|
333
|
+
BOOST_FWD_REF(A2) a2)
|
334
|
+
{
|
335
|
+
return table_.emplace(
|
336
|
+
boost::unordered::detail::create_emplace_args(
|
337
|
+
boost::forward<A0>(a0),
|
338
|
+
boost::forward<A1>(a1),
|
339
|
+
boost::forward<A2>(a2))
|
340
|
+
).first;
|
341
|
+
}
|
342
|
+
|
343
|
+
#define BOOST_UNORDERED_EMPLACE(z, n, _) \
|
344
|
+
template < \
|
345
|
+
BOOST_PP_ENUM_PARAMS_Z(z, n, typename A) \
|
346
|
+
> \
|
347
|
+
std::pair<iterator, bool> emplace( \
|
348
|
+
BOOST_PP_ENUM_##z(n, BOOST_UNORDERED_FWD_PARAM, a) \
|
349
|
+
) \
|
350
|
+
{ \
|
351
|
+
return table_.emplace( \
|
352
|
+
boost::unordered::detail::create_emplace_args( \
|
353
|
+
BOOST_PP_ENUM_##z(n, BOOST_UNORDERED_CALL_FORWARD, \
|
354
|
+
a) \
|
355
|
+
)); \
|
356
|
+
} \
|
357
|
+
\
|
358
|
+
template < \
|
359
|
+
BOOST_PP_ENUM_PARAMS_Z(z, n, typename A) \
|
360
|
+
> \
|
361
|
+
iterator emplace_hint( \
|
362
|
+
const_iterator, \
|
363
|
+
BOOST_PP_ENUM_##z(n, BOOST_UNORDERED_FWD_PARAM, a) \
|
364
|
+
) \
|
365
|
+
{ \
|
366
|
+
return table_.emplace( \
|
367
|
+
boost::unordered::detail::create_emplace_args( \
|
368
|
+
BOOST_PP_ENUM_##z(n, BOOST_UNORDERED_CALL_FORWARD, \
|
369
|
+
a) \
|
370
|
+
)).first; \
|
371
|
+
}
|
372
|
+
|
373
|
+
BOOST_PP_REPEAT_FROM_TO(4, BOOST_UNORDERED_EMPLACE_LIMIT,
|
374
|
+
BOOST_UNORDERED_EMPLACE, _)
|
375
|
+
|
376
|
+
#undef BOOST_UNORDERED_EMPLACE
|
377
|
+
|
378
|
+
#endif
|
379
|
+
|
380
|
+
std::pair<iterator, bool> insert(value_type const& x)
|
381
|
+
{
|
382
|
+
return this->emplace(x);
|
383
|
+
}
|
384
|
+
|
385
|
+
std::pair<iterator, bool> insert(BOOST_RV_REF(value_type) x)
|
386
|
+
{
|
387
|
+
return this->emplace(boost::move(x));
|
388
|
+
}
|
389
|
+
|
390
|
+
iterator insert(const_iterator hint, value_type const& x)
|
391
|
+
{
|
392
|
+
return this->emplace_hint(hint, x);
|
393
|
+
}
|
394
|
+
|
395
|
+
iterator insert(const_iterator hint, BOOST_RV_REF(value_type) x)
|
396
|
+
{
|
397
|
+
return this->emplace_hint(hint, boost::move(x));
|
398
|
+
}
|
399
|
+
|
400
|
+
template <class InputIt> void insert(InputIt, InputIt);
|
401
|
+
|
402
|
+
#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
|
403
|
+
void insert(std::initializer_list<value_type>);
|
404
|
+
#endif
|
405
|
+
|
406
|
+
iterator erase(const_iterator);
|
407
|
+
size_type erase(const key_type&);
|
408
|
+
iterator erase(const_iterator, const_iterator);
|
409
|
+
void quick_erase(const_iterator it) { erase(it); }
|
410
|
+
void erase_return_void(const_iterator it) { erase(it); }
|
411
|
+
|
412
|
+
void clear();
|
413
|
+
void swap(unordered_map&);
|
414
|
+
|
415
|
+
// observers
|
416
|
+
|
417
|
+
hasher hash_function() const;
|
418
|
+
key_equal key_eq() const;
|
419
|
+
|
420
|
+
mapped_type& operator[](const key_type&);
|
421
|
+
mapped_type& at(const key_type&);
|
422
|
+
mapped_type const& at(const key_type&) const;
|
423
|
+
|
424
|
+
// lookup
|
425
|
+
|
426
|
+
iterator find(const key_type&);
|
427
|
+
const_iterator find(const key_type&) const;
|
428
|
+
|
429
|
+
template <class CompatibleKey, class CompatibleHash,
|
430
|
+
class CompatiblePredicate>
|
431
|
+
iterator find(
|
432
|
+
CompatibleKey const&,
|
433
|
+
CompatibleHash const&,
|
434
|
+
CompatiblePredicate const&);
|
435
|
+
|
436
|
+
template <class CompatibleKey, class CompatibleHash,
|
437
|
+
class CompatiblePredicate>
|
438
|
+
const_iterator find(
|
439
|
+
CompatibleKey const&,
|
440
|
+
CompatibleHash const&,
|
441
|
+
CompatiblePredicate const&) const;
|
442
|
+
|
443
|
+
size_type count(const key_type&) const;
|
444
|
+
|
445
|
+
std::pair<iterator, iterator>
|
446
|
+
equal_range(const key_type&);
|
447
|
+
std::pair<const_iterator, const_iterator>
|
448
|
+
equal_range(const key_type&) const;
|
449
|
+
|
450
|
+
// bucket interface
|
451
|
+
|
452
|
+
size_type bucket_count() const BOOST_NOEXCEPT
|
453
|
+
{
|
454
|
+
return table_.bucket_count_;
|
455
|
+
}
|
456
|
+
|
457
|
+
size_type max_bucket_count() const BOOST_NOEXCEPT
|
458
|
+
{
|
459
|
+
return table_.max_bucket_count();
|
460
|
+
}
|
461
|
+
|
462
|
+
size_type bucket_size(size_type) const;
|
463
|
+
|
464
|
+
size_type bucket(const key_type& k) const
|
465
|
+
{
|
466
|
+
return table_.hash_to_bucket(table_.hash(k));
|
467
|
+
}
|
468
|
+
|
469
|
+
local_iterator begin(size_type n)
|
470
|
+
{
|
471
|
+
return local_iterator(
|
472
|
+
table_.begin(n), n, table_.bucket_count_);
|
473
|
+
}
|
474
|
+
|
475
|
+
const_local_iterator begin(size_type n) const
|
476
|
+
{
|
477
|
+
return const_local_iterator(
|
478
|
+
table_.begin(n), n, table_.bucket_count_);
|
479
|
+
}
|
480
|
+
|
481
|
+
local_iterator end(size_type)
|
482
|
+
{
|
483
|
+
return local_iterator();
|
484
|
+
}
|
485
|
+
|
486
|
+
const_local_iterator end(size_type) const
|
487
|
+
{
|
488
|
+
return const_local_iterator();
|
489
|
+
}
|
490
|
+
|
491
|
+
const_local_iterator cbegin(size_type n) const
|
492
|
+
{
|
493
|
+
return const_local_iterator(
|
494
|
+
table_.begin(n), n, table_.bucket_count_);
|
495
|
+
}
|
496
|
+
|
497
|
+
const_local_iterator cend(size_type) const
|
498
|
+
{
|
499
|
+
return const_local_iterator();
|
500
|
+
}
|
501
|
+
|
502
|
+
// hash policy
|
503
|
+
|
504
|
+
float max_load_factor() const BOOST_NOEXCEPT
|
505
|
+
{
|
506
|
+
return table_.mlf_;
|
507
|
+
}
|
508
|
+
|
509
|
+
float load_factor() const BOOST_NOEXCEPT;
|
510
|
+
void max_load_factor(float) BOOST_NOEXCEPT;
|
511
|
+
void rehash(size_type);
|
512
|
+
void reserve(size_type);
|
513
|
+
|
514
|
+
#if !BOOST_WORKAROUND(__BORLANDC__, < 0x0582)
|
515
|
+
friend bool operator==<K,T,H,P,A>(
|
516
|
+
unordered_map const&, unordered_map const&);
|
517
|
+
friend bool operator!=<K,T,H,P,A>(
|
518
|
+
unordered_map const&, unordered_map const&);
|
519
|
+
#endif
|
520
|
+
}; // class template unordered_map
|
521
|
+
|
522
|
+
template <class K, class T, class H, class P, class A>
|
523
|
+
class unordered_multimap
|
524
|
+
{
|
525
|
+
#if defined(BOOST_UNORDERED_USE_MOVE)
|
526
|
+
BOOST_COPYABLE_AND_MOVABLE(unordered_multimap)
|
527
|
+
#endif
|
528
|
+
public:
|
529
|
+
|
530
|
+
typedef K key_type;
|
531
|
+
typedef std::pair<const K, T> value_type;
|
532
|
+
typedef T mapped_type;
|
533
|
+
typedef H hasher;
|
534
|
+
typedef P key_equal;
|
535
|
+
typedef A allocator_type;
|
536
|
+
|
537
|
+
private:
|
538
|
+
|
539
|
+
typedef boost::unordered::detail::multimap<A, K, T, H, P> types;
|
540
|
+
typedef typename types::traits allocator_traits;
|
541
|
+
typedef typename types::table table;
|
542
|
+
|
543
|
+
public:
|
544
|
+
|
545
|
+
typedef typename allocator_traits::pointer pointer;
|
546
|
+
typedef typename allocator_traits::const_pointer const_pointer;
|
547
|
+
|
548
|
+
typedef value_type& reference;
|
549
|
+
typedef value_type const& const_reference;
|
550
|
+
|
551
|
+
typedef std::size_t size_type;
|
552
|
+
typedef std::ptrdiff_t difference_type;
|
553
|
+
|
554
|
+
typedef typename table::cl_iterator const_local_iterator;
|
555
|
+
typedef typename table::l_iterator local_iterator;
|
556
|
+
typedef typename table::c_iterator const_iterator;
|
557
|
+
typedef typename table::iterator iterator;
|
558
|
+
|
559
|
+
private:
|
560
|
+
|
561
|
+
table table_;
|
562
|
+
|
563
|
+
public:
|
564
|
+
|
565
|
+
// constructors
|
566
|
+
|
567
|
+
explicit unordered_multimap(
|
568
|
+
size_type = boost::unordered::detail::default_bucket_count,
|
569
|
+
const hasher& = hasher(),
|
570
|
+
const key_equal& = key_equal(),
|
571
|
+
const allocator_type& = allocator_type());
|
572
|
+
|
573
|
+
explicit unordered_multimap(allocator_type const&);
|
574
|
+
|
575
|
+
template <class InputIt>
|
576
|
+
unordered_multimap(InputIt, InputIt);
|
577
|
+
|
578
|
+
template <class InputIt>
|
579
|
+
unordered_multimap(
|
580
|
+
InputIt, InputIt,
|
581
|
+
size_type,
|
582
|
+
const hasher& = hasher(),
|
583
|
+
const key_equal& = key_equal());
|
584
|
+
|
585
|
+
template <class InputIt>
|
586
|
+
unordered_multimap(
|
587
|
+
InputIt, InputIt,
|
588
|
+
size_type,
|
589
|
+
const hasher&,
|
590
|
+
const key_equal&,
|
591
|
+
const allocator_type&);
|
592
|
+
|
593
|
+
// copy/move constructors
|
594
|
+
|
595
|
+
unordered_multimap(unordered_multimap const&);
|
596
|
+
|
597
|
+
unordered_multimap(unordered_multimap const&, allocator_type const&);
|
598
|
+
|
599
|
+
#if defined(BOOST_UNORDERED_USE_MOVE)
|
600
|
+
unordered_multimap(BOOST_RV_REF(unordered_multimap) other)
|
601
|
+
: table_(other.table_, boost::unordered::detail::move_tag())
|
602
|
+
{
|
603
|
+
}
|
604
|
+
#elif !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
|
605
|
+
unordered_multimap(unordered_multimap&& other)
|
606
|
+
: table_(other.table_, boost::unordered::detail::move_tag())
|
607
|
+
{
|
608
|
+
}
|
609
|
+
#endif
|
610
|
+
|
611
|
+
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
|
612
|
+
unordered_multimap(unordered_multimap&&, allocator_type const&);
|
613
|
+
#endif
|
614
|
+
|
615
|
+
#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
|
616
|
+
unordered_multimap(
|
617
|
+
std::initializer_list<value_type>,
|
618
|
+
size_type = boost::unordered::detail::default_bucket_count,
|
619
|
+
const hasher& = hasher(),
|
620
|
+
const key_equal&l = key_equal(),
|
621
|
+
const allocator_type& = allocator_type());
|
622
|
+
#endif
|
623
|
+
|
624
|
+
// Destructor
|
625
|
+
|
626
|
+
~unordered_multimap();
|
627
|
+
|
628
|
+
// Assign
|
629
|
+
|
630
|
+
#if defined(BOOST_UNORDERED_USE_MOVE)
|
631
|
+
unordered_multimap& operator=(
|
632
|
+
BOOST_COPY_ASSIGN_REF(unordered_multimap) x)
|
633
|
+
{
|
634
|
+
table_.assign(x.table_);
|
635
|
+
return *this;
|
636
|
+
}
|
637
|
+
|
638
|
+
unordered_multimap& operator=(BOOST_RV_REF(unordered_multimap) x)
|
639
|
+
{
|
640
|
+
table_.move_assign(x.table_);
|
641
|
+
return *this;
|
642
|
+
}
|
643
|
+
#else
|
644
|
+
unordered_multimap& operator=(unordered_multimap const& x)
|
645
|
+
{
|
646
|
+
table_.assign(x.table_);
|
647
|
+
return *this;
|
648
|
+
}
|
649
|
+
|
650
|
+
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
|
651
|
+
unordered_multimap& operator=(unordered_multimap&& x)
|
652
|
+
{
|
653
|
+
table_.move_assign(x.table_);
|
654
|
+
return *this;
|
655
|
+
}
|
656
|
+
#endif
|
657
|
+
#endif
|
658
|
+
|
659
|
+
#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
|
660
|
+
unordered_multimap& operator=(std::initializer_list<value_type>);
|
661
|
+
#endif
|
662
|
+
|
663
|
+
allocator_type get_allocator() const BOOST_NOEXCEPT
|
664
|
+
{
|
665
|
+
return table_.node_alloc();
|
666
|
+
}
|
667
|
+
|
668
|
+
// size and capacity
|
669
|
+
|
670
|
+
bool empty() const BOOST_NOEXCEPT
|
671
|
+
{
|
672
|
+
return table_.size_ == 0;
|
673
|
+
}
|
674
|
+
|
675
|
+
size_type size() const BOOST_NOEXCEPT
|
676
|
+
{
|
677
|
+
return table_.size_;
|
678
|
+
}
|
679
|
+
|
680
|
+
size_type max_size() const BOOST_NOEXCEPT;
|
681
|
+
|
682
|
+
// iterators
|
683
|
+
|
684
|
+
iterator begin() BOOST_NOEXCEPT
|
685
|
+
{
|
686
|
+
return table_.begin();
|
687
|
+
}
|
688
|
+
|
689
|
+
const_iterator begin() const BOOST_NOEXCEPT
|
690
|
+
{
|
691
|
+
return table_.begin();
|
692
|
+
}
|
693
|
+
|
694
|
+
iterator end() BOOST_NOEXCEPT
|
695
|
+
{
|
696
|
+
return iterator();
|
697
|
+
}
|
698
|
+
|
699
|
+
const_iterator end() const BOOST_NOEXCEPT
|
700
|
+
{
|
701
|
+
return const_iterator();
|
702
|
+
}
|
703
|
+
|
704
|
+
const_iterator cbegin() const BOOST_NOEXCEPT
|
705
|
+
{
|
706
|
+
return table_.begin();
|
707
|
+
}
|
708
|
+
|
709
|
+
const_iterator cend() const BOOST_NOEXCEPT
|
710
|
+
{
|
711
|
+
return const_iterator();
|
712
|
+
}
|
713
|
+
|
714
|
+
// emplace
|
715
|
+
|
716
|
+
#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
|
717
|
+
template <class... Args>
|
718
|
+
iterator emplace(BOOST_FWD_REF(Args)... args)
|
719
|
+
{
|
720
|
+
return table_.emplace(boost::forward<Args>(args)...);
|
721
|
+
}
|
722
|
+
|
723
|
+
template <class... Args>
|
724
|
+
iterator emplace_hint(const_iterator, BOOST_FWD_REF(Args)... args)
|
725
|
+
{
|
726
|
+
return table_.emplace(boost::forward<Args>(args)...);
|
727
|
+
}
|
728
|
+
#else
|
729
|
+
|
730
|
+
#if !BOOST_WORKAROUND(__SUNPRO_CC, BOOST_TESTED_AT(0x5100))
|
731
|
+
|
732
|
+
// 0 argument emplace requires special treatment in case
|
733
|
+
// the container is instantiated with a value type that
|
734
|
+
// doesn't have a default constructor.
|
735
|
+
|
736
|
+
iterator emplace(
|
737
|
+
boost::unordered::detail::empty_emplace
|
738
|
+
= boost::unordered::detail::empty_emplace(),
|
739
|
+
value_type v = value_type())
|
740
|
+
{
|
741
|
+
return this->emplace(boost::move(v));
|
742
|
+
}
|
743
|
+
|
744
|
+
iterator emplace_hint(const_iterator hint,
|
745
|
+
boost::unordered::detail::empty_emplace
|
746
|
+
= boost::unordered::detail::empty_emplace(),
|
747
|
+
value_type v = value_type()
|
748
|
+
)
|
749
|
+
{
|
750
|
+
return this->emplace_hint(hint, boost::move(v));
|
751
|
+
}
|
752
|
+
|
753
|
+
#endif
|
754
|
+
|
755
|
+
template <typename A0>
|
756
|
+
iterator emplace(BOOST_FWD_REF(A0) a0)
|
757
|
+
{
|
758
|
+
return table_.emplace(
|
759
|
+
boost::unordered::detail::create_emplace_args(
|
760
|
+
boost::forward<A0>(a0))
|
761
|
+
);
|
762
|
+
}
|
763
|
+
|
764
|
+
template <typename A0>
|
765
|
+
iterator emplace_hint(const_iterator, BOOST_FWD_REF(A0) a0)
|
766
|
+
{
|
767
|
+
return table_.emplace(
|
768
|
+
boost::unordered::detail::create_emplace_args(
|
769
|
+
boost::forward<A0>(a0))
|
770
|
+
);
|
771
|
+
}
|
772
|
+
|
773
|
+
template <typename A0, typename A1>
|
774
|
+
iterator emplace(
|
775
|
+
BOOST_FWD_REF(A0) a0,
|
776
|
+
BOOST_FWD_REF(A1) a1)
|
777
|
+
{
|
778
|
+
return table_.emplace(
|
779
|
+
boost::unordered::detail::create_emplace_args(
|
780
|
+
boost::forward<A0>(a0),
|
781
|
+
boost::forward<A1>(a1))
|
782
|
+
);
|
783
|
+
}
|
784
|
+
|
785
|
+
template <typename A0, typename A1>
|
786
|
+
iterator emplace_hint(const_iterator,
|
787
|
+
BOOST_FWD_REF(A0) a0,
|
788
|
+
BOOST_FWD_REF(A1) a1)
|
789
|
+
{
|
790
|
+
return table_.emplace(
|
791
|
+
boost::unordered::detail::create_emplace_args(
|
792
|
+
boost::forward<A0>(a0),
|
793
|
+
boost::forward<A1>(a1))
|
794
|
+
);
|
795
|
+
}
|
796
|
+
|
797
|
+
template <typename A0, typename A1, typename A2>
|
798
|
+
iterator emplace(
|
799
|
+
BOOST_FWD_REF(A0) a0,
|
800
|
+
BOOST_FWD_REF(A1) a1,
|
801
|
+
BOOST_FWD_REF(A2) a2)
|
802
|
+
{
|
803
|
+
return table_.emplace(
|
804
|
+
boost::unordered::detail::create_emplace_args(
|
805
|
+
boost::forward<A0>(a0),
|
806
|
+
boost::forward<A1>(a1),
|
807
|
+
boost::forward<A2>(a2))
|
808
|
+
);
|
809
|
+
}
|
810
|
+
|
811
|
+
template <typename A0, typename A1, typename A2>
|
812
|
+
iterator emplace_hint(const_iterator,
|
813
|
+
BOOST_FWD_REF(A0) a0,
|
814
|
+
BOOST_FWD_REF(A1) a1,
|
815
|
+
BOOST_FWD_REF(A2) a2)
|
816
|
+
{
|
817
|
+
return table_.emplace(
|
818
|
+
boost::unordered::detail::create_emplace_args(
|
819
|
+
boost::forward<A0>(a0),
|
820
|
+
boost::forward<A1>(a1),
|
821
|
+
boost::forward<A2>(a2))
|
822
|
+
);
|
823
|
+
}
|
824
|
+
|
825
|
+
#define BOOST_UNORDERED_EMPLACE(z, n, _) \
|
826
|
+
template < \
|
827
|
+
BOOST_PP_ENUM_PARAMS_Z(z, n, typename A) \
|
828
|
+
> \
|
829
|
+
iterator emplace( \
|
830
|
+
BOOST_PP_ENUM_##z(n, BOOST_UNORDERED_FWD_PARAM, a) \
|
831
|
+
) \
|
832
|
+
{ \
|
833
|
+
return table_.emplace( \
|
834
|
+
boost::unordered::detail::create_emplace_args( \
|
835
|
+
BOOST_PP_ENUM_##z(n, BOOST_UNORDERED_CALL_FORWARD, \
|
836
|
+
a) \
|
837
|
+
)); \
|
838
|
+
} \
|
839
|
+
\
|
840
|
+
template < \
|
841
|
+
BOOST_PP_ENUM_PARAMS_Z(z, n, typename A) \
|
842
|
+
> \
|
843
|
+
iterator emplace_hint( \
|
844
|
+
const_iterator, \
|
845
|
+
BOOST_PP_ENUM_##z(n, BOOST_UNORDERED_FWD_PARAM, a) \
|
846
|
+
) \
|
847
|
+
{ \
|
848
|
+
return table_.emplace( \
|
849
|
+
boost::unordered::detail::create_emplace_args( \
|
850
|
+
BOOST_PP_ENUM_##z(n, BOOST_UNORDERED_CALL_FORWARD, \
|
851
|
+
a) \
|
852
|
+
)); \
|
853
|
+
}
|
854
|
+
|
855
|
+
BOOST_PP_REPEAT_FROM_TO(4, BOOST_UNORDERED_EMPLACE_LIMIT,
|
856
|
+
BOOST_UNORDERED_EMPLACE, _)
|
857
|
+
|
858
|
+
#undef BOOST_UNORDERED_EMPLACE
|
859
|
+
|
860
|
+
#endif
|
861
|
+
|
862
|
+
iterator insert(value_type const& x)
|
863
|
+
{
|
864
|
+
return this->emplace(x);
|
865
|
+
}
|
866
|
+
|
867
|
+
iterator insert(BOOST_RV_REF(value_type) x)
|
868
|
+
{
|
869
|
+
return this->emplace(boost::move(x));
|
870
|
+
}
|
871
|
+
|
872
|
+
iterator insert(const_iterator hint, value_type const& x)
|
873
|
+
{
|
874
|
+
return this->emplace_hint(hint, x);
|
875
|
+
}
|
876
|
+
|
877
|
+
iterator insert(const_iterator hint, BOOST_RV_REF(value_type) x)
|
878
|
+
{
|
879
|
+
return this->emplace_hint(hint, boost::move(x));
|
880
|
+
}
|
881
|
+
|
882
|
+
template <class InputIt> void insert(InputIt, InputIt);
|
883
|
+
|
884
|
+
#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
|
885
|
+
void insert(std::initializer_list<value_type>);
|
886
|
+
#endif
|
887
|
+
|
888
|
+
iterator erase(const_iterator);
|
889
|
+
size_type erase(const key_type&);
|
890
|
+
iterator erase(const_iterator, const_iterator);
|
891
|
+
void quick_erase(const_iterator it) { erase(it); }
|
892
|
+
void erase_return_void(const_iterator it) { erase(it); }
|
893
|
+
|
894
|
+
void clear();
|
895
|
+
void swap(unordered_multimap&);
|
896
|
+
|
897
|
+
// observers
|
898
|
+
|
899
|
+
hasher hash_function() const;
|
900
|
+
key_equal key_eq() const;
|
901
|
+
|
902
|
+
// lookup
|
903
|
+
|
904
|
+
iterator find(const key_type&);
|
905
|
+
const_iterator find(const key_type&) const;
|
906
|
+
|
907
|
+
template <class CompatibleKey, class CompatibleHash,
|
908
|
+
class CompatiblePredicate>
|
909
|
+
iterator find(
|
910
|
+
CompatibleKey const&,
|
911
|
+
CompatibleHash const&,
|
912
|
+
CompatiblePredicate const&);
|
913
|
+
|
914
|
+
template <class CompatibleKey, class CompatibleHash,
|
915
|
+
class CompatiblePredicate>
|
916
|
+
const_iterator find(
|
917
|
+
CompatibleKey const&,
|
918
|
+
CompatibleHash const&,
|
919
|
+
CompatiblePredicate const&) const;
|
920
|
+
|
921
|
+
size_type count(const key_type&) const;
|
922
|
+
|
923
|
+
std::pair<iterator, iterator>
|
924
|
+
equal_range(const key_type&);
|
925
|
+
std::pair<const_iterator, const_iterator>
|
926
|
+
equal_range(const key_type&) const;
|
927
|
+
|
928
|
+
// bucket interface
|
929
|
+
|
930
|
+
size_type bucket_count() const BOOST_NOEXCEPT
|
931
|
+
{
|
932
|
+
return table_.bucket_count_;
|
933
|
+
}
|
934
|
+
|
935
|
+
size_type max_bucket_count() const BOOST_NOEXCEPT
|
936
|
+
{
|
937
|
+
return table_.max_bucket_count();
|
938
|
+
}
|
939
|
+
|
940
|
+
size_type bucket_size(size_type) const;
|
941
|
+
|
942
|
+
size_type bucket(const key_type& k) const
|
943
|
+
{
|
944
|
+
return table_.hash_to_bucket(table_.hash(k));
|
945
|
+
}
|
946
|
+
|
947
|
+
local_iterator begin(size_type n)
|
948
|
+
{
|
949
|
+
return local_iterator(
|
950
|
+
table_.begin(n), n, table_.bucket_count_);
|
951
|
+
}
|
952
|
+
|
953
|
+
const_local_iterator begin(size_type n) const
|
954
|
+
{
|
955
|
+
return const_local_iterator(
|
956
|
+
table_.begin(n), n, table_.bucket_count_);
|
957
|
+
}
|
958
|
+
|
959
|
+
local_iterator end(size_type)
|
960
|
+
{
|
961
|
+
return local_iterator();
|
962
|
+
}
|
963
|
+
|
964
|
+
const_local_iterator end(size_type) const
|
965
|
+
{
|
966
|
+
return const_local_iterator();
|
967
|
+
}
|
968
|
+
|
969
|
+
const_local_iterator cbegin(size_type n) const
|
970
|
+
{
|
971
|
+
return const_local_iterator(
|
972
|
+
table_.begin(n), n, table_.bucket_count_);
|
973
|
+
}
|
974
|
+
|
975
|
+
const_local_iterator cend(size_type) const
|
976
|
+
{
|
977
|
+
return const_local_iterator();
|
978
|
+
}
|
979
|
+
|
980
|
+
// hash policy
|
981
|
+
|
982
|
+
float max_load_factor() const BOOST_NOEXCEPT
|
983
|
+
{
|
984
|
+
return table_.mlf_;
|
985
|
+
}
|
986
|
+
|
987
|
+
float load_factor() const BOOST_NOEXCEPT;
|
988
|
+
void max_load_factor(float) BOOST_NOEXCEPT;
|
989
|
+
void rehash(size_type);
|
990
|
+
void reserve(size_type);
|
991
|
+
|
992
|
+
#if !BOOST_WORKAROUND(__BORLANDC__, < 0x0582)
|
993
|
+
friend bool operator==<K,T,H,P,A>(
|
994
|
+
unordered_multimap const&, unordered_multimap const&);
|
995
|
+
friend bool operator!=<K,T,H,P,A>(
|
996
|
+
unordered_multimap const&, unordered_multimap const&);
|
997
|
+
#endif
|
998
|
+
}; // class template unordered_multimap
|
999
|
+
|
1000
|
+
////////////////////////////////////////////////////////////////////////////////
|
1001
|
+
|
1002
|
+
template <class K, class T, class H, class P, class A>
|
1003
|
+
unordered_map<K,T,H,P,A>::unordered_map(
|
1004
|
+
size_type n, const hasher &hf, const key_equal &eql,
|
1005
|
+
const allocator_type &a)
|
1006
|
+
: table_(n, hf, eql, a)
|
1007
|
+
{
|
1008
|
+
}
|
1009
|
+
|
1010
|
+
template <class K, class T, class H, class P, class A>
|
1011
|
+
unordered_map<K,T,H,P,A>::unordered_map(allocator_type const& a)
|
1012
|
+
: table_(boost::unordered::detail::default_bucket_count,
|
1013
|
+
hasher(), key_equal(), a)
|
1014
|
+
{
|
1015
|
+
}
|
1016
|
+
|
1017
|
+
template <class K, class T, class H, class P, class A>
|
1018
|
+
unordered_map<K,T,H,P,A>::unordered_map(
|
1019
|
+
unordered_map const& other, allocator_type const& a)
|
1020
|
+
: table_(other.table_, a)
|
1021
|
+
{
|
1022
|
+
}
|
1023
|
+
|
1024
|
+
template <class K, class T, class H, class P, class A>
|
1025
|
+
template <class InputIt>
|
1026
|
+
unordered_map<K,T,H,P,A>::unordered_map(InputIt f, InputIt l)
|
1027
|
+
: table_(boost::unordered::detail::initial_size(f, l),
|
1028
|
+
hasher(), key_equal(), allocator_type())
|
1029
|
+
{
|
1030
|
+
table_.insert_range(f, l);
|
1031
|
+
}
|
1032
|
+
|
1033
|
+
template <class K, class T, class H, class P, class A>
|
1034
|
+
template <class InputIt>
|
1035
|
+
unordered_map<K,T,H,P,A>::unordered_map(
|
1036
|
+
InputIt f, InputIt l,
|
1037
|
+
size_type n,
|
1038
|
+
const hasher &hf,
|
1039
|
+
const key_equal &eql)
|
1040
|
+
: table_(boost::unordered::detail::initial_size(f, l, n),
|
1041
|
+
hf, eql, allocator_type())
|
1042
|
+
{
|
1043
|
+
table_.insert_range(f, l);
|
1044
|
+
}
|
1045
|
+
|
1046
|
+
template <class K, class T, class H, class P, class A>
|
1047
|
+
template <class InputIt>
|
1048
|
+
unordered_map<K,T,H,P,A>::unordered_map(
|
1049
|
+
InputIt f, InputIt l,
|
1050
|
+
size_type n,
|
1051
|
+
const hasher &hf,
|
1052
|
+
const key_equal &eql,
|
1053
|
+
const allocator_type &a)
|
1054
|
+
: table_(boost::unordered::detail::initial_size(f, l, n), hf, eql, a)
|
1055
|
+
{
|
1056
|
+
table_.insert_range(f, l);
|
1057
|
+
}
|
1058
|
+
|
1059
|
+
template <class K, class T, class H, class P, class A>
|
1060
|
+
unordered_map<K,T,H,P,A>::~unordered_map() {}
|
1061
|
+
|
1062
|
+
template <class K, class T, class H, class P, class A>
|
1063
|
+
unordered_map<K,T,H,P,A>::unordered_map(
|
1064
|
+
unordered_map const& other)
|
1065
|
+
: table_(other.table_)
|
1066
|
+
{
|
1067
|
+
}
|
1068
|
+
|
1069
|
+
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
|
1070
|
+
|
1071
|
+
template <class K, class T, class H, class P, class A>
|
1072
|
+
unordered_map<K,T,H,P,A>::unordered_map(
|
1073
|
+
unordered_map&& other, allocator_type const& a)
|
1074
|
+
: table_(other.table_, a, boost::unordered::detail::move_tag())
|
1075
|
+
{
|
1076
|
+
}
|
1077
|
+
|
1078
|
+
#endif
|
1079
|
+
|
1080
|
+
#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
|
1081
|
+
|
1082
|
+
template <class K, class T, class H, class P, class A>
|
1083
|
+
unordered_map<K,T,H,P,A>::unordered_map(
|
1084
|
+
std::initializer_list<value_type> list, size_type n,
|
1085
|
+
const hasher &hf, const key_equal &eql, const allocator_type &a)
|
1086
|
+
: table_(
|
1087
|
+
boost::unordered::detail::initial_size(
|
1088
|
+
list.begin(), list.end(), n),
|
1089
|
+
hf, eql, a)
|
1090
|
+
{
|
1091
|
+
table_.insert_range(list.begin(), list.end());
|
1092
|
+
}
|
1093
|
+
|
1094
|
+
template <class K, class T, class H, class P, class A>
|
1095
|
+
unordered_map<K,T,H,P,A>& unordered_map<K,T,H,P,A>::operator=(
|
1096
|
+
std::initializer_list<value_type> list)
|
1097
|
+
{
|
1098
|
+
table_.clear();
|
1099
|
+
table_.insert_range(list.begin(), list.end());
|
1100
|
+
return *this;
|
1101
|
+
}
|
1102
|
+
|
1103
|
+
#endif
|
1104
|
+
|
1105
|
+
// size and capacity
|
1106
|
+
|
1107
|
+
template <class K, class T, class H, class P, class A>
|
1108
|
+
std::size_t unordered_map<K,T,H,P,A>::max_size() const BOOST_NOEXCEPT
|
1109
|
+
{
|
1110
|
+
return table_.max_size();
|
1111
|
+
}
|
1112
|
+
|
1113
|
+
// modifiers
|
1114
|
+
|
1115
|
+
template <class K, class T, class H, class P, class A>
|
1116
|
+
template <class InputIt>
|
1117
|
+
void unordered_map<K,T,H,P,A>::insert(InputIt first, InputIt last)
|
1118
|
+
{
|
1119
|
+
table_.insert_range(first, last);
|
1120
|
+
}
|
1121
|
+
|
1122
|
+
#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
|
1123
|
+
template <class K, class T, class H, class P, class A>
|
1124
|
+
void unordered_map<K,T,H,P,A>::insert(
|
1125
|
+
std::initializer_list<value_type> list)
|
1126
|
+
{
|
1127
|
+
table_.insert_range(list.begin(), list.end());
|
1128
|
+
}
|
1129
|
+
#endif
|
1130
|
+
|
1131
|
+
template <class K, class T, class H, class P, class A>
|
1132
|
+
typename unordered_map<K,T,H,P,A>::iterator
|
1133
|
+
unordered_map<K,T,H,P,A>::erase(const_iterator position)
|
1134
|
+
{
|
1135
|
+
return table_.erase(position);
|
1136
|
+
}
|
1137
|
+
|
1138
|
+
template <class K, class T, class H, class P, class A>
|
1139
|
+
typename unordered_map<K,T,H,P,A>::size_type
|
1140
|
+
unordered_map<K,T,H,P,A>::erase(const key_type& k)
|
1141
|
+
{
|
1142
|
+
return table_.erase_key(k);
|
1143
|
+
}
|
1144
|
+
|
1145
|
+
template <class K, class T, class H, class P, class A>
|
1146
|
+
typename unordered_map<K,T,H,P,A>::iterator
|
1147
|
+
unordered_map<K,T,H,P,A>::erase(
|
1148
|
+
const_iterator first, const_iterator last)
|
1149
|
+
{
|
1150
|
+
return table_.erase_range(first, last);
|
1151
|
+
}
|
1152
|
+
|
1153
|
+
template <class K, class T, class H, class P, class A>
|
1154
|
+
void unordered_map<K,T,H,P,A>::clear()
|
1155
|
+
{
|
1156
|
+
table_.clear();
|
1157
|
+
}
|
1158
|
+
|
1159
|
+
template <class K, class T, class H, class P, class A>
|
1160
|
+
void unordered_map<K,T,H,P,A>::swap(unordered_map& other)
|
1161
|
+
{
|
1162
|
+
table_.swap(other.table_);
|
1163
|
+
}
|
1164
|
+
|
1165
|
+
// observers
|
1166
|
+
|
1167
|
+
template <class K, class T, class H, class P, class A>
|
1168
|
+
typename unordered_map<K,T,H,P,A>::hasher
|
1169
|
+
unordered_map<K,T,H,P,A>::hash_function() const
|
1170
|
+
{
|
1171
|
+
return table_.hash_function();
|
1172
|
+
}
|
1173
|
+
|
1174
|
+
template <class K, class T, class H, class P, class A>
|
1175
|
+
typename unordered_map<K,T,H,P,A>::key_equal
|
1176
|
+
unordered_map<K,T,H,P,A>::key_eq() const
|
1177
|
+
{
|
1178
|
+
return table_.key_eq();
|
1179
|
+
}
|
1180
|
+
|
1181
|
+
template <class K, class T, class H, class P, class A>
|
1182
|
+
typename unordered_map<K,T,H,P,A>::mapped_type&
|
1183
|
+
unordered_map<K,T,H,P,A>::operator[](const key_type &k)
|
1184
|
+
{
|
1185
|
+
return table_[k].second;
|
1186
|
+
}
|
1187
|
+
|
1188
|
+
template <class K, class T, class H, class P, class A>
|
1189
|
+
typename unordered_map<K,T,H,P,A>::mapped_type&
|
1190
|
+
unordered_map<K,T,H,P,A>::at(const key_type& k)
|
1191
|
+
{
|
1192
|
+
return table_.at(k).second;
|
1193
|
+
}
|
1194
|
+
|
1195
|
+
template <class K, class T, class H, class P, class A>
|
1196
|
+
typename unordered_map<K,T,H,P,A>::mapped_type const&
|
1197
|
+
unordered_map<K,T,H,P,A>::at(const key_type& k) const
|
1198
|
+
{
|
1199
|
+
return table_.at(k).second;
|
1200
|
+
}
|
1201
|
+
|
1202
|
+
// lookup
|
1203
|
+
|
1204
|
+
template <class K, class T, class H, class P, class A>
|
1205
|
+
typename unordered_map<K,T,H,P,A>::iterator
|
1206
|
+
unordered_map<K,T,H,P,A>::find(const key_type& k)
|
1207
|
+
{
|
1208
|
+
return table_.find_node(k);
|
1209
|
+
}
|
1210
|
+
|
1211
|
+
template <class K, class T, class H, class P, class A>
|
1212
|
+
typename unordered_map<K,T,H,P,A>::const_iterator
|
1213
|
+
unordered_map<K,T,H,P,A>::find(const key_type& k) const
|
1214
|
+
{
|
1215
|
+
return table_.find_node(k);
|
1216
|
+
}
|
1217
|
+
|
1218
|
+
template <class K, class T, class H, class P, class A>
|
1219
|
+
template <class CompatibleKey, class CompatibleHash,
|
1220
|
+
class CompatiblePredicate>
|
1221
|
+
typename unordered_map<K,T,H,P,A>::iterator
|
1222
|
+
unordered_map<K,T,H,P,A>::find(
|
1223
|
+
CompatibleKey const& k,
|
1224
|
+
CompatibleHash const& hash,
|
1225
|
+
CompatiblePredicate const& eq)
|
1226
|
+
{
|
1227
|
+
return table_.generic_find_node(k, hash, eq);
|
1228
|
+
}
|
1229
|
+
|
1230
|
+
template <class K, class T, class H, class P, class A>
|
1231
|
+
template <class CompatibleKey, class CompatibleHash,
|
1232
|
+
class CompatiblePredicate>
|
1233
|
+
typename unordered_map<K,T,H,P,A>::const_iterator
|
1234
|
+
unordered_map<K,T,H,P,A>::find(
|
1235
|
+
CompatibleKey const& k,
|
1236
|
+
CompatibleHash const& hash,
|
1237
|
+
CompatiblePredicate const& eq) const
|
1238
|
+
{
|
1239
|
+
return table_.generic_find_node(k, hash, eq);
|
1240
|
+
}
|
1241
|
+
|
1242
|
+
template <class K, class T, class H, class P, class A>
|
1243
|
+
typename unordered_map<K,T,H,P,A>::size_type
|
1244
|
+
unordered_map<K,T,H,P,A>::count(const key_type& k) const
|
1245
|
+
{
|
1246
|
+
return table_.count(k);
|
1247
|
+
}
|
1248
|
+
|
1249
|
+
template <class K, class T, class H, class P, class A>
|
1250
|
+
std::pair<
|
1251
|
+
typename unordered_map<K,T,H,P,A>::iterator,
|
1252
|
+
typename unordered_map<K,T,H,P,A>::iterator>
|
1253
|
+
unordered_map<K,T,H,P,A>::equal_range(const key_type& k)
|
1254
|
+
{
|
1255
|
+
return table_.equal_range(k);
|
1256
|
+
}
|
1257
|
+
|
1258
|
+
template <class K, class T, class H, class P, class A>
|
1259
|
+
std::pair<
|
1260
|
+
typename unordered_map<K,T,H,P,A>::const_iterator,
|
1261
|
+
typename unordered_map<K,T,H,P,A>::const_iterator>
|
1262
|
+
unordered_map<K,T,H,P,A>::equal_range(const key_type& k) const
|
1263
|
+
{
|
1264
|
+
return table_.equal_range(k);
|
1265
|
+
}
|
1266
|
+
|
1267
|
+
template <class K, class T, class H, class P, class A>
|
1268
|
+
typename unordered_map<K,T,H,P,A>::size_type
|
1269
|
+
unordered_map<K,T,H,P,A>::bucket_size(size_type n) const
|
1270
|
+
{
|
1271
|
+
return table_.bucket_size(n);
|
1272
|
+
}
|
1273
|
+
|
1274
|
+
// hash policy
|
1275
|
+
|
1276
|
+
template <class K, class T, class H, class P, class A>
|
1277
|
+
float unordered_map<K,T,H,P,A>::load_factor() const BOOST_NOEXCEPT
|
1278
|
+
{
|
1279
|
+
return table_.load_factor();
|
1280
|
+
}
|
1281
|
+
|
1282
|
+
template <class K, class T, class H, class P, class A>
|
1283
|
+
void unordered_map<K,T,H,P,A>::max_load_factor(float m) BOOST_NOEXCEPT
|
1284
|
+
{
|
1285
|
+
table_.max_load_factor(m);
|
1286
|
+
}
|
1287
|
+
|
1288
|
+
template <class K, class T, class H, class P, class A>
|
1289
|
+
void unordered_map<K,T,H,P,A>::rehash(size_type n)
|
1290
|
+
{
|
1291
|
+
table_.rehash(n);
|
1292
|
+
}
|
1293
|
+
|
1294
|
+
template <class K, class T, class H, class P, class A>
|
1295
|
+
void unordered_map<K,T,H,P,A>::reserve(size_type n)
|
1296
|
+
{
|
1297
|
+
table_.reserve(n);
|
1298
|
+
}
|
1299
|
+
|
1300
|
+
template <class K, class T, class H, class P, class A>
|
1301
|
+
inline bool operator==(
|
1302
|
+
unordered_map<K,T,H,P,A> const& m1,
|
1303
|
+
unordered_map<K,T,H,P,A> const& m2)
|
1304
|
+
{
|
1305
|
+
#if BOOST_WORKAROUND(__CODEGEARC__, BOOST_TESTED_AT(0x0613))
|
1306
|
+
struct dummy { unordered_map<K,T,H,P,A> x; };
|
1307
|
+
#endif
|
1308
|
+
return m1.table_.equals(m2.table_);
|
1309
|
+
}
|
1310
|
+
|
1311
|
+
template <class K, class T, class H, class P, class A>
|
1312
|
+
inline bool operator!=(
|
1313
|
+
unordered_map<K,T,H,P,A> const& m1,
|
1314
|
+
unordered_map<K,T,H,P,A> const& m2)
|
1315
|
+
{
|
1316
|
+
#if BOOST_WORKAROUND(__CODEGEARC__, BOOST_TESTED_AT(0x0613))
|
1317
|
+
struct dummy { unordered_map<K,T,H,P,A> x; };
|
1318
|
+
#endif
|
1319
|
+
return !m1.table_.equals(m2.table_);
|
1320
|
+
}
|
1321
|
+
|
1322
|
+
template <class K, class T, class H, class P, class A>
|
1323
|
+
inline void swap(
|
1324
|
+
unordered_map<K,T,H,P,A> &m1,
|
1325
|
+
unordered_map<K,T,H,P,A> &m2)
|
1326
|
+
{
|
1327
|
+
#if BOOST_WORKAROUND(__CODEGEARC__, BOOST_TESTED_AT(0x0613))
|
1328
|
+
struct dummy { unordered_map<K,T,H,P,A> x; };
|
1329
|
+
#endif
|
1330
|
+
m1.swap(m2);
|
1331
|
+
}
|
1332
|
+
|
1333
|
+
////////////////////////////////////////////////////////////////////////////////
|
1334
|
+
|
1335
|
+
template <class K, class T, class H, class P, class A>
|
1336
|
+
unordered_multimap<K,T,H,P,A>::unordered_multimap(
|
1337
|
+
size_type n, const hasher &hf, const key_equal &eql,
|
1338
|
+
const allocator_type &a)
|
1339
|
+
: table_(n, hf, eql, a)
|
1340
|
+
{
|
1341
|
+
}
|
1342
|
+
|
1343
|
+
template <class K, class T, class H, class P, class A>
|
1344
|
+
unordered_multimap<K,T,H,P,A>::unordered_multimap(allocator_type const& a)
|
1345
|
+
: table_(boost::unordered::detail::default_bucket_count,
|
1346
|
+
hasher(), key_equal(), a)
|
1347
|
+
{
|
1348
|
+
}
|
1349
|
+
|
1350
|
+
template <class K, class T, class H, class P, class A>
|
1351
|
+
unordered_multimap<K,T,H,P,A>::unordered_multimap(
|
1352
|
+
unordered_multimap const& other, allocator_type const& a)
|
1353
|
+
: table_(other.table_, a)
|
1354
|
+
{
|
1355
|
+
}
|
1356
|
+
|
1357
|
+
template <class K, class T, class H, class P, class A>
|
1358
|
+
template <class InputIt>
|
1359
|
+
unordered_multimap<K,T,H,P,A>::unordered_multimap(InputIt f, InputIt l)
|
1360
|
+
: table_(boost::unordered::detail::initial_size(f, l),
|
1361
|
+
hasher(), key_equal(), allocator_type())
|
1362
|
+
{
|
1363
|
+
table_.insert_range(f, l);
|
1364
|
+
}
|
1365
|
+
|
1366
|
+
template <class K, class T, class H, class P, class A>
|
1367
|
+
template <class InputIt>
|
1368
|
+
unordered_multimap<K,T,H,P,A>::unordered_multimap(
|
1369
|
+
InputIt f, InputIt l,
|
1370
|
+
size_type n,
|
1371
|
+
const hasher &hf,
|
1372
|
+
const key_equal &eql)
|
1373
|
+
: table_(boost::unordered::detail::initial_size(f, l, n),
|
1374
|
+
hf, eql, allocator_type())
|
1375
|
+
{
|
1376
|
+
table_.insert_range(f, l);
|
1377
|
+
}
|
1378
|
+
|
1379
|
+
template <class K, class T, class H, class P, class A>
|
1380
|
+
template <class InputIt>
|
1381
|
+
unordered_multimap<K,T,H,P,A>::unordered_multimap(
|
1382
|
+
InputIt f, InputIt l,
|
1383
|
+
size_type n,
|
1384
|
+
const hasher &hf,
|
1385
|
+
const key_equal &eql,
|
1386
|
+
const allocator_type &a)
|
1387
|
+
: table_(boost::unordered::detail::initial_size(f, l, n), hf, eql, a)
|
1388
|
+
{
|
1389
|
+
table_.insert_range(f, l);
|
1390
|
+
}
|
1391
|
+
|
1392
|
+
template <class K, class T, class H, class P, class A>
|
1393
|
+
unordered_multimap<K,T,H,P,A>::~unordered_multimap() {}
|
1394
|
+
|
1395
|
+
template <class K, class T, class H, class P, class A>
|
1396
|
+
unordered_multimap<K,T,H,P,A>::unordered_multimap(
|
1397
|
+
unordered_multimap const& other)
|
1398
|
+
: table_(other.table_)
|
1399
|
+
{
|
1400
|
+
}
|
1401
|
+
|
1402
|
+
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
|
1403
|
+
|
1404
|
+
template <class K, class T, class H, class P, class A>
|
1405
|
+
unordered_multimap<K,T,H,P,A>::unordered_multimap(
|
1406
|
+
unordered_multimap&& other, allocator_type const& a)
|
1407
|
+
: table_(other.table_, a, boost::unordered::detail::move_tag())
|
1408
|
+
{
|
1409
|
+
}
|
1410
|
+
|
1411
|
+
#endif
|
1412
|
+
|
1413
|
+
#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
|
1414
|
+
|
1415
|
+
template <class K, class T, class H, class P, class A>
|
1416
|
+
unordered_multimap<K,T,H,P,A>::unordered_multimap(
|
1417
|
+
std::initializer_list<value_type> list, size_type n,
|
1418
|
+
const hasher &hf, const key_equal &eql, const allocator_type &a)
|
1419
|
+
: table_(
|
1420
|
+
boost::unordered::detail::initial_size(
|
1421
|
+
list.begin(), list.end(), n),
|
1422
|
+
hf, eql, a)
|
1423
|
+
{
|
1424
|
+
table_.insert_range(list.begin(), list.end());
|
1425
|
+
}
|
1426
|
+
|
1427
|
+
template <class K, class T, class H, class P, class A>
|
1428
|
+
unordered_multimap<K,T,H,P,A>& unordered_multimap<K,T,H,P,A>::operator=(
|
1429
|
+
std::initializer_list<value_type> list)
|
1430
|
+
{
|
1431
|
+
table_.clear();
|
1432
|
+
table_.insert_range(list.begin(), list.end());
|
1433
|
+
return *this;
|
1434
|
+
}
|
1435
|
+
|
1436
|
+
#endif
|
1437
|
+
|
1438
|
+
// size and capacity
|
1439
|
+
|
1440
|
+
template <class K, class T, class H, class P, class A>
|
1441
|
+
std::size_t unordered_multimap<K,T,H,P,A>::max_size() const BOOST_NOEXCEPT
|
1442
|
+
{
|
1443
|
+
return table_.max_size();
|
1444
|
+
}
|
1445
|
+
|
1446
|
+
// modifiers
|
1447
|
+
|
1448
|
+
template <class K, class T, class H, class P, class A>
|
1449
|
+
template <class InputIt>
|
1450
|
+
void unordered_multimap<K,T,H,P,A>::insert(InputIt first, InputIt last)
|
1451
|
+
{
|
1452
|
+
table_.insert_range(first, last);
|
1453
|
+
}
|
1454
|
+
|
1455
|
+
#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
|
1456
|
+
template <class K, class T, class H, class P, class A>
|
1457
|
+
void unordered_multimap<K,T,H,P,A>::insert(
|
1458
|
+
std::initializer_list<value_type> list)
|
1459
|
+
{
|
1460
|
+
table_.insert_range(list.begin(), list.end());
|
1461
|
+
}
|
1462
|
+
#endif
|
1463
|
+
|
1464
|
+
template <class K, class T, class H, class P, class A>
|
1465
|
+
typename unordered_multimap<K,T,H,P,A>::iterator
|
1466
|
+
unordered_multimap<K,T,H,P,A>::erase(const_iterator position)
|
1467
|
+
{
|
1468
|
+
return table_.erase(position);
|
1469
|
+
}
|
1470
|
+
|
1471
|
+
template <class K, class T, class H, class P, class A>
|
1472
|
+
typename unordered_multimap<K,T,H,P,A>::size_type
|
1473
|
+
unordered_multimap<K,T,H,P,A>::erase(const key_type& k)
|
1474
|
+
{
|
1475
|
+
return table_.erase_key(k);
|
1476
|
+
}
|
1477
|
+
|
1478
|
+
template <class K, class T, class H, class P, class A>
|
1479
|
+
typename unordered_multimap<K,T,H,P,A>::iterator
|
1480
|
+
unordered_multimap<K,T,H,P,A>::erase(
|
1481
|
+
const_iterator first, const_iterator last)
|
1482
|
+
{
|
1483
|
+
return table_.erase_range(first, last);
|
1484
|
+
}
|
1485
|
+
|
1486
|
+
template <class K, class T, class H, class P, class A>
|
1487
|
+
void unordered_multimap<K,T,H,P,A>::clear()
|
1488
|
+
{
|
1489
|
+
table_.clear();
|
1490
|
+
}
|
1491
|
+
|
1492
|
+
template <class K, class T, class H, class P, class A>
|
1493
|
+
void unordered_multimap<K,T,H,P,A>::swap(unordered_multimap& other)
|
1494
|
+
{
|
1495
|
+
table_.swap(other.table_);
|
1496
|
+
}
|
1497
|
+
|
1498
|
+
// observers
|
1499
|
+
|
1500
|
+
template <class K, class T, class H, class P, class A>
|
1501
|
+
typename unordered_multimap<K,T,H,P,A>::hasher
|
1502
|
+
unordered_multimap<K,T,H,P,A>::hash_function() const
|
1503
|
+
{
|
1504
|
+
return table_.hash_function();
|
1505
|
+
}
|
1506
|
+
|
1507
|
+
template <class K, class T, class H, class P, class A>
|
1508
|
+
typename unordered_multimap<K,T,H,P,A>::key_equal
|
1509
|
+
unordered_multimap<K,T,H,P,A>::key_eq() const
|
1510
|
+
{
|
1511
|
+
return table_.key_eq();
|
1512
|
+
}
|
1513
|
+
|
1514
|
+
// lookup
|
1515
|
+
|
1516
|
+
template <class K, class T, class H, class P, class A>
|
1517
|
+
typename unordered_multimap<K,T,H,P,A>::iterator
|
1518
|
+
unordered_multimap<K,T,H,P,A>::find(const key_type& k)
|
1519
|
+
{
|
1520
|
+
return table_.find_node(k);
|
1521
|
+
}
|
1522
|
+
|
1523
|
+
template <class K, class T, class H, class P, class A>
|
1524
|
+
typename unordered_multimap<K,T,H,P,A>::const_iterator
|
1525
|
+
unordered_multimap<K,T,H,P,A>::find(const key_type& k) const
|
1526
|
+
{
|
1527
|
+
return table_.find_node(k);
|
1528
|
+
}
|
1529
|
+
|
1530
|
+
template <class K, class T, class H, class P, class A>
|
1531
|
+
template <class CompatibleKey, class CompatibleHash,
|
1532
|
+
class CompatiblePredicate>
|
1533
|
+
typename unordered_multimap<K,T,H,P,A>::iterator
|
1534
|
+
unordered_multimap<K,T,H,P,A>::find(
|
1535
|
+
CompatibleKey const& k,
|
1536
|
+
CompatibleHash const& hash,
|
1537
|
+
CompatiblePredicate const& eq)
|
1538
|
+
{
|
1539
|
+
return table_.generic_find_node(k, hash, eq);
|
1540
|
+
}
|
1541
|
+
|
1542
|
+
template <class K, class T, class H, class P, class A>
|
1543
|
+
template <class CompatibleKey, class CompatibleHash,
|
1544
|
+
class CompatiblePredicate>
|
1545
|
+
typename unordered_multimap<K,T,H,P,A>::const_iterator
|
1546
|
+
unordered_multimap<K,T,H,P,A>::find(
|
1547
|
+
CompatibleKey const& k,
|
1548
|
+
CompatibleHash const& hash,
|
1549
|
+
CompatiblePredicate const& eq) const
|
1550
|
+
{
|
1551
|
+
return table_.generic_find_node(k, hash, eq);
|
1552
|
+
}
|
1553
|
+
|
1554
|
+
template <class K, class T, class H, class P, class A>
|
1555
|
+
typename unordered_multimap<K,T,H,P,A>::size_type
|
1556
|
+
unordered_multimap<K,T,H,P,A>::count(const key_type& k) const
|
1557
|
+
{
|
1558
|
+
return table_.count(k);
|
1559
|
+
}
|
1560
|
+
|
1561
|
+
template <class K, class T, class H, class P, class A>
|
1562
|
+
std::pair<
|
1563
|
+
typename unordered_multimap<K,T,H,P,A>::iterator,
|
1564
|
+
typename unordered_multimap<K,T,H,P,A>::iterator>
|
1565
|
+
unordered_multimap<K,T,H,P,A>::equal_range(const key_type& k)
|
1566
|
+
{
|
1567
|
+
return table_.equal_range(k);
|
1568
|
+
}
|
1569
|
+
|
1570
|
+
template <class K, class T, class H, class P, class A>
|
1571
|
+
std::pair<
|
1572
|
+
typename unordered_multimap<K,T,H,P,A>::const_iterator,
|
1573
|
+
typename unordered_multimap<K,T,H,P,A>::const_iterator>
|
1574
|
+
unordered_multimap<K,T,H,P,A>::equal_range(const key_type& k) const
|
1575
|
+
{
|
1576
|
+
return table_.equal_range(k);
|
1577
|
+
}
|
1578
|
+
|
1579
|
+
template <class K, class T, class H, class P, class A>
|
1580
|
+
typename unordered_multimap<K,T,H,P,A>::size_type
|
1581
|
+
unordered_multimap<K,T,H,P,A>::bucket_size(size_type n) const
|
1582
|
+
{
|
1583
|
+
return table_.bucket_size(n);
|
1584
|
+
}
|
1585
|
+
|
1586
|
+
// hash policy
|
1587
|
+
|
1588
|
+
template <class K, class T, class H, class P, class A>
|
1589
|
+
float unordered_multimap<K,T,H,P,A>::load_factor() const BOOST_NOEXCEPT
|
1590
|
+
{
|
1591
|
+
return table_.load_factor();
|
1592
|
+
}
|
1593
|
+
|
1594
|
+
template <class K, class T, class H, class P, class A>
|
1595
|
+
void unordered_multimap<K,T,H,P,A>::max_load_factor(float m) BOOST_NOEXCEPT
|
1596
|
+
{
|
1597
|
+
table_.max_load_factor(m);
|
1598
|
+
}
|
1599
|
+
|
1600
|
+
template <class K, class T, class H, class P, class A>
|
1601
|
+
void unordered_multimap<K,T,H,P,A>::rehash(size_type n)
|
1602
|
+
{
|
1603
|
+
table_.rehash(n);
|
1604
|
+
}
|
1605
|
+
|
1606
|
+
template <class K, class T, class H, class P, class A>
|
1607
|
+
void unordered_multimap<K,T,H,P,A>::reserve(size_type n)
|
1608
|
+
{
|
1609
|
+
table_.reserve(n);
|
1610
|
+
}
|
1611
|
+
|
1612
|
+
template <class K, class T, class H, class P, class A>
|
1613
|
+
inline bool operator==(
|
1614
|
+
unordered_multimap<K,T,H,P,A> const& m1,
|
1615
|
+
unordered_multimap<K,T,H,P,A> const& m2)
|
1616
|
+
{
|
1617
|
+
#if BOOST_WORKAROUND(__CODEGEARC__, BOOST_TESTED_AT(0x0613))
|
1618
|
+
struct dummy { unordered_multimap<K,T,H,P,A> x; };
|
1619
|
+
#endif
|
1620
|
+
return m1.table_.equals(m2.table_);
|
1621
|
+
}
|
1622
|
+
|
1623
|
+
template <class K, class T, class H, class P, class A>
|
1624
|
+
inline bool operator!=(
|
1625
|
+
unordered_multimap<K,T,H,P,A> const& m1,
|
1626
|
+
unordered_multimap<K,T,H,P,A> const& m2)
|
1627
|
+
{
|
1628
|
+
#if BOOST_WORKAROUND(__CODEGEARC__, BOOST_TESTED_AT(0x0613))
|
1629
|
+
struct dummy { unordered_multimap<K,T,H,P,A> x; };
|
1630
|
+
#endif
|
1631
|
+
return !m1.table_.equals(m2.table_);
|
1632
|
+
}
|
1633
|
+
|
1634
|
+
template <class K, class T, class H, class P, class A>
|
1635
|
+
inline void swap(
|
1636
|
+
unordered_multimap<K,T,H,P,A> &m1,
|
1637
|
+
unordered_multimap<K,T,H,P,A> &m2)
|
1638
|
+
{
|
1639
|
+
#if BOOST_WORKAROUND(__CODEGEARC__, BOOST_TESTED_AT(0x0613))
|
1640
|
+
struct dummy { unordered_multimap<K,T,H,P,A> x; };
|
1641
|
+
#endif
|
1642
|
+
m1.swap(m2);
|
1643
|
+
}
|
1644
|
+
|
1645
|
+
} // namespace unordered
|
1646
|
+
} // namespace boost
|
1647
|
+
|
1648
|
+
#if defined(BOOST_MSVC)
|
1649
|
+
#pragma warning(pop)
|
1650
|
+
#endif
|
1651
|
+
|
1652
|
+
#endif // BOOST_UNORDERED_UNORDERED_MAP_HPP_INCLUDED
|