passenger 5.1.4 → 5.1.5

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.

Files changed (542) hide show
  1. checksums.yaml +4 -4
  2. data/.editorconfig +9 -0
  3. data/CHANGELOG +9 -0
  4. data/build/cxx_tests.rb +11 -1
  5. data/build/documentation.rb +0 -32
  6. data/build/support/cxx_dependency_map.rb +602 -2
  7. data/build/test_basics.rb +3 -3
  8. data/dev/boost-patches/0001-Patch-boost-thread-so-that-oxt-thread-can-use-it.patch +48 -0
  9. data/dev/boost-patches/0002-Make-boost-thread_interrupted-derive-from-oxt-tracab.patch +33 -0
  10. data/dev/boost-patches/0003-Disable-a-Clang-pragma-to-prevent-warnings-on-OS-X.patch +25 -0
  11. data/dev/ci/README.md +121 -0
  12. data/dev/ci/lib/functions.sh +129 -0
  13. data/dev/ci/lib/set-container-envvars.sh +46 -0
  14. data/dev/ci/lib/setup-container.sh +43 -0
  15. data/dev/ci/run-tests-natively +24 -0
  16. data/dev/ci/run-tests-with-docker +42 -0
  17. data/dev/ci/scripts/debug-console-wrapper.sh +27 -0
  18. data/dev/ci/scripts/docker-entrypoint-stage2.sh +17 -0
  19. data/dev/ci/scripts/docker-entrypoint.sh +17 -0
  20. data/dev/ci/scripts/inituidgid +17 -0
  21. data/dev/ci/scripts/run-tests-natively-stage2.sh +17 -0
  22. data/dev/ci/scripts/setup-host-natively.sh +11 -0
  23. data/dev/ci/setup-host +50 -0
  24. data/dev/ci/tests/apache2/run +6 -0
  25. data/dev/ci/tests/apache2/setup +4 -0
  26. data/dev/ci/tests/cxx/run +9 -0
  27. data/dev/ci/tests/cxx/setup +4 -0
  28. data/dev/ci/tests/nginx-dynamic/run +20 -0
  29. data/dev/ci/tests/nginx-dynamic/setup +4 -0
  30. data/dev/ci/tests/nginx/run +5 -0
  31. data/dev/ci/tests/nginx/setup +4 -0
  32. data/dev/ci/tests/nodejs/run +4 -0
  33. data/dev/ci/tests/nodejs/setup +4 -0
  34. data/dev/ci/tests/ruby/run +4 -0
  35. data/dev/ci/tests/ruby/setup +4 -0
  36. data/dev/ci/tests/source-packaging/run +4 -0
  37. data/dev/ci/tests/source-packaging/setup +4 -0
  38. data/dev/ci/tests/standalone/run +4 -0
  39. data/dev/ci/tests/standalone/setup +4 -0
  40. data/dev/copy_boost_headers +8 -2
  41. data/src/agent/Core/ApiServer.h +11 -5
  42. data/src/agent/Core/Controller.h +12 -46
  43. data/src/agent/Core/Controller/CheckoutSession.cpp +1 -1
  44. data/src/agent/Core/Controller/Config.h +369 -0
  45. data/src/agent/Core/Controller/ForwardResponse.cpp +4 -4
  46. data/src/agent/Core/Controller/Hooks.cpp +15 -3
  47. data/src/agent/Core/Controller/Implementation.cpp +1 -1
  48. data/src/agent/Core/Controller/InitRequest.cpp +28 -39
  49. data/src/agent/Core/Controller/InitializationAndShutdown.cpp +25 -60
  50. data/src/agent/Core/Controller/InternalUtils.cpp +0 -16
  51. data/src/agent/Core/Controller/Miscellaneous.cpp +0 -17
  52. data/src/agent/Core/Controller/Request.h +2 -0
  53. data/src/agent/Core/Controller/SendRequest.cpp +4 -4
  54. data/src/agent/Core/Controller/{StateInspectionAndConfiguration.cpp → StateInspection.cpp} +0 -22
  55. data/src/agent/Core/Controller/TurboCaching.h +11 -10
  56. data/src/agent/Core/CoreMain.cpp +16 -6
  57. data/src/agent/Core/ResponseCache.h +3 -3
  58. data/src/agent/Core/SpawningKit/SmartSpawner.h +9 -3
  59. data/src/agent/Core/SpawningKit/Spawner.h +7 -3
  60. data/src/agent/UstRouter/ApiServer.h +3 -2
  61. data/src/agent/UstRouter/Controller.h +66 -32
  62. data/src/agent/UstRouter/UstRouterMain.cpp +10 -2
  63. data/src/agent/Watchdog/ApiServer.h +3 -2
  64. data/src/agent/Watchdog/WatchdogMain.cpp +3 -1
  65. data/src/apache2_module/ConfigurationCommands.cpp +1 -1
  66. data/src/cxx_supportlib/ConfigKit/Common.h +125 -0
  67. data/src/cxx_supportlib/ConfigKit/ConfigKit.h +34 -0
  68. data/src/cxx_supportlib/ConfigKit/README.md +895 -0
  69. data/src/cxx_supportlib/ConfigKit/Schema.h +331 -0
  70. data/src/cxx_supportlib/ConfigKit/Store.h +385 -0
  71. data/src/cxx_supportlib/ConfigKit/TableTranslator.h +185 -0
  72. data/src/cxx_supportlib/ConfigKit/Utils.h +141 -0
  73. data/src/cxx_supportlib/ConfigKit/VariantMapUtils.h +81 -0
  74. data/src/cxx_supportlib/Constants.h +1 -1
  75. data/src/cxx_supportlib/Crypto.cpp +2 -2
  76. data/src/cxx_supportlib/Logging.h +0 -35
  77. data/src/cxx_supportlib/ServerKit/HttpServer.h +35 -16
  78. data/src/cxx_supportlib/ServerKit/Server.h +65 -25
  79. data/src/cxx_supportlib/oxt/macros.hpp +3 -0
  80. data/src/cxx_supportlib/vendor-modified/boost/algorithm/string/replace.hpp +0 -2
  81. data/src/cxx_supportlib/vendor-modified/boost/array.hpp +53 -42
  82. data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/atomic_template.hpp +11 -5
  83. data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/bitwise_cast.hpp +13 -2
  84. data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/caps_gcc_x86.hpp +23 -0
  85. data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/caps_msvc_x86.hpp +5 -0
  86. data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/config.hpp +3 -2
  87. data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/interlocked.hpp +8 -1
  88. data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/ops_emulated.hpp +3 -1
  89. data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/ops_gcc_alpha.hpp +2 -0
  90. data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/ops_gcc_arm.hpp +2 -0
  91. data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/ops_gcc_atomic.hpp +5 -0
  92. data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/ops_gcc_ppc.hpp +2 -0
  93. data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/ops_gcc_sparc.hpp +6 -4
  94. data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/ops_gcc_sync.hpp +2 -0
  95. data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/ops_gcc_x86.hpp +3 -1
  96. data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/ops_gcc_x86_dcas.hpp +28 -17
  97. data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/ops_linux_arm.hpp +2 -0
  98. data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/ops_msvc_arm.hpp +2 -0
  99. data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/ops_msvc_x86.hpp +9 -4
  100. data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/platform.hpp +3 -3
  101. data/src/cxx_supportlib/vendor-modified/boost/bind/arg.hpp +10 -3
  102. data/src/cxx_supportlib/vendor-modified/boost/bind/bind.hpp +90 -18
  103. data/src/cxx_supportlib/vendor-modified/boost/cerrno.hpp +2 -2
  104. data/src/cxx_supportlib/vendor-modified/boost/chrono/duration.hpp +1 -1
  105. data/src/cxx_supportlib/vendor-modified/boost/config/auto_link.hpp +8 -3
  106. data/src/cxx_supportlib/vendor-modified/boost/config/compiler/borland.hpp +2 -0
  107. data/src/cxx_supportlib/vendor-modified/boost/config/compiler/clang.hpp +35 -6
  108. data/src/cxx_supportlib/vendor-modified/boost/config/compiler/codegear.hpp +2 -0
  109. data/src/cxx_supportlib/vendor-modified/boost/config/compiler/comeau.hpp +1 -1
  110. data/src/cxx_supportlib/vendor-modified/boost/config/compiler/common_edg.hpp +2 -0
  111. data/src/cxx_supportlib/vendor-modified/boost/config/compiler/compaq_cxx.hpp +1 -1
  112. data/src/cxx_supportlib/vendor-modified/boost/config/compiler/cray.hpp +3 -1
  113. data/src/cxx_supportlib/vendor-modified/boost/config/compiler/digitalmars.hpp +2 -0
  114. data/src/cxx_supportlib/vendor-modified/boost/config/compiler/gcc.hpp +19 -4
  115. data/src/cxx_supportlib/vendor-modified/boost/config/compiler/gcc_xml.hpp +3 -1
  116. data/src/cxx_supportlib/vendor-modified/boost/config/compiler/greenhills.hpp +1 -1
  117. data/src/cxx_supportlib/vendor-modified/boost/config/compiler/hp_acc.hpp +3 -1
  118. data/src/cxx_supportlib/vendor-modified/boost/config/compiler/intel.hpp +29 -7
  119. data/src/cxx_supportlib/vendor-modified/boost/config/compiler/kai.hpp +1 -1
  120. data/src/cxx_supportlib/vendor-modified/boost/config/compiler/metrowerks.hpp +2 -0
  121. data/src/cxx_supportlib/vendor-modified/boost/config/compiler/mpw.hpp +2 -0
  122. data/src/cxx_supportlib/vendor-modified/boost/config/compiler/nvcc.hpp +16 -0
  123. data/src/cxx_supportlib/vendor-modified/boost/config/compiler/pathscale.hpp +2 -0
  124. data/src/cxx_supportlib/vendor-modified/boost/config/compiler/pgi.hpp +2 -0
  125. data/src/cxx_supportlib/vendor-modified/boost/config/compiler/sgi_mipspro.hpp +1 -1
  126. data/src/cxx_supportlib/vendor-modified/boost/config/compiler/sunpro_cc.hpp +10 -1
  127. data/src/cxx_supportlib/vendor-modified/boost/config/compiler/vacpp.hpp +2 -0
  128. data/src/cxx_supportlib/vendor-modified/boost/config/compiler/visualc.hpp +44 -16
  129. data/src/cxx_supportlib/vendor-modified/boost/config/compiler/xlcpp.hpp +4 -0
  130. data/src/cxx_supportlib/vendor-modified/boost/config/platform/cygwin.hpp +1 -2
  131. data/src/cxx_supportlib/vendor-modified/boost/config/platform/linux.hpp +1 -1
  132. data/src/cxx_supportlib/vendor-modified/boost/config/select_compiler_config.hpp +21 -21
  133. data/src/cxx_supportlib/vendor-modified/boost/config/stdlib/dinkumware.hpp +42 -1
  134. data/src/cxx_supportlib/vendor-modified/boost/config/stdlib/libcomo.hpp +7 -0
  135. data/src/cxx_supportlib/vendor-modified/boost/config/stdlib/libcpp.hpp +40 -7
  136. data/src/cxx_supportlib/vendor-modified/boost/config/stdlib/libstdcpp3.hpp +39 -6
  137. data/src/cxx_supportlib/vendor-modified/boost/config/stdlib/modena.hpp +7 -0
  138. data/src/cxx_supportlib/vendor-modified/boost/config/stdlib/msl.hpp +7 -0
  139. data/src/cxx_supportlib/vendor-modified/boost/config/stdlib/roguewave.hpp +7 -0
  140. data/src/cxx_supportlib/vendor-modified/boost/config/stdlib/sgi.hpp +8 -1
  141. data/src/cxx_supportlib/vendor-modified/boost/config/stdlib/stlport.hpp +7 -0
  142. data/src/cxx_supportlib/vendor-modified/boost/config/stdlib/vacpp.hpp +7 -0
  143. data/src/cxx_supportlib/vendor-modified/boost/config/suffix.hpp +33 -4
  144. data/src/cxx_supportlib/vendor-modified/boost/container/adaptive_pool.hpp +0 -2
  145. data/src/cxx_supportlib/vendor-modified/boost/container/allocator.hpp +0 -3
  146. data/src/cxx_supportlib/vendor-modified/boost/container/allocator_traits.hpp +34 -27
  147. data/src/cxx_supportlib/vendor-modified/boost/container/deque.hpp +62 -26
  148. data/src/cxx_supportlib/vendor-modified/boost/container/detail/addressof.hpp +2 -2
  149. data/src/cxx_supportlib/vendor-modified/boost/container/detail/advanced_insert_int.hpp +4 -4
  150. data/src/cxx_supportlib/vendor-modified/boost/container/detail/compare_functors.hpp +4 -4
  151. data/src/cxx_supportlib/vendor-modified/boost/container/detail/config_begin.hpp +2 -0
  152. data/src/cxx_supportlib/vendor-modified/boost/container/detail/construct_in_place.hpp +39 -5
  153. data/src/cxx_supportlib/vendor-modified/boost/container/detail/copy_move_algo.hpp +49 -32
  154. data/src/cxx_supportlib/vendor-modified/boost/container/detail/dispatch_uses_allocator.hpp +175 -7
  155. data/src/cxx_supportlib/vendor-modified/boost/container/detail/flat_tree.hpp +223 -98
  156. data/src/cxx_supportlib/vendor-modified/boost/container/detail/is_sorted.hpp +57 -0
  157. data/src/cxx_supportlib/vendor-modified/boost/container/detail/iterators.hpp +88 -41
  158. data/src/cxx_supportlib/vendor-modified/boost/container/detail/mpl.hpp +7 -8
  159. data/src/cxx_supportlib/vendor-modified/boost/container/detail/mutex.hpp +4 -9
  160. data/src/cxx_supportlib/vendor-modified/boost/container/detail/node_alloc_holder.hpp +45 -18
  161. data/src/cxx_supportlib/vendor-modified/boost/container/detail/pair.hpp +205 -26
  162. data/src/cxx_supportlib/vendor-modified/boost/container/detail/tree.hpp +290 -181
  163. data/src/cxx_supportlib/vendor-modified/boost/container/detail/value_init.hpp +2 -0
  164. data/src/cxx_supportlib/vendor-modified/boost/container/detail/variadic_templates_tools.hpp +24 -19
  165. data/src/cxx_supportlib/vendor-modified/boost/container/detail/workaround.hpp +38 -0
  166. data/src/cxx_supportlib/vendor-modified/boost/container/flat_map.hpp +320 -46
  167. data/src/cxx_supportlib/vendor-modified/boost/container/flat_set.hpp +91 -18
  168. data/src/cxx_supportlib/vendor-modified/boost/container/list.hpp +23 -19
  169. data/src/cxx_supportlib/vendor-modified/boost/container/map.hpp +491 -120
  170. data/src/cxx_supportlib/vendor-modified/boost/container/new_allocator.hpp +4 -4
  171. data/src/cxx_supportlib/vendor-modified/boost/container/node_allocator.hpp +0 -3
  172. data/src/cxx_supportlib/vendor-modified/boost/container/node_handle.hpp +399 -0
  173. data/src/cxx_supportlib/vendor-modified/boost/container/pmr/deque.hpp +2 -0
  174. data/src/cxx_supportlib/vendor-modified/boost/container/pmr/flat_map.hpp +4 -0
  175. data/src/cxx_supportlib/vendor-modified/boost/container/pmr/flat_set.hpp +4 -0
  176. data/src/cxx_supportlib/vendor-modified/boost/container/pmr/list.hpp +2 -0
  177. data/src/cxx_supportlib/vendor-modified/boost/container/pmr/map.hpp +4 -0
  178. data/src/cxx_supportlib/vendor-modified/boost/container/pmr/set.hpp +4 -0
  179. data/src/cxx_supportlib/vendor-modified/boost/container/pmr/slist.hpp +2 -0
  180. data/src/cxx_supportlib/vendor-modified/boost/container/pmr/small_vector.hpp +2 -0
  181. data/src/cxx_supportlib/vendor-modified/boost/container/pmr/stable_vector.hpp +2 -0
  182. data/src/cxx_supportlib/vendor-modified/boost/container/pmr/string.hpp +2 -0
  183. data/src/cxx_supportlib/vendor-modified/boost/container/pmr/vector.hpp +2 -0
  184. data/src/cxx_supportlib/vendor-modified/boost/container/set.hpp +101 -20
  185. data/src/cxx_supportlib/vendor-modified/boost/container/slist.hpp +19 -14
  186. data/src/cxx_supportlib/vendor-modified/boost/container/small_vector.hpp +117 -59
  187. data/src/cxx_supportlib/vendor-modified/boost/container/stable_vector.hpp +8 -6
  188. data/src/cxx_supportlib/vendor-modified/boost/container/static_vector.hpp +33 -28
  189. data/src/cxx_supportlib/vendor-modified/boost/container/string.hpp +414 -70
  190. data/src/cxx_supportlib/vendor-modified/boost/container/throw_exception.hpp +1 -0
  191. data/src/cxx_supportlib/vendor-modified/boost/container/uses_allocator_fwd.hpp +2 -2
  192. data/src/cxx_supportlib/vendor-modified/boost/container/vector.hpp +134 -117
  193. data/src/cxx_supportlib/vendor-modified/boost/core/addressof.hpp +202 -99
  194. data/src/cxx_supportlib/vendor-modified/boost/core/demangle.hpp +8 -10
  195. data/src/cxx_supportlib/vendor-modified/boost/core/lightweight_test.hpp +217 -1
  196. data/src/cxx_supportlib/vendor-modified/boost/core/scoped_enum.hpp +29 -27
  197. data/src/cxx_supportlib/vendor-modified/boost/current_function.hpp +5 -1
  198. data/src/cxx_supportlib/vendor-modified/boost/date_time/c_time.hpp +13 -13
  199. data/src/cxx_supportlib/vendor-modified/boost/date_time/constrained_value.hpp +3 -3
  200. data/src/cxx_supportlib/vendor-modified/boost/date_time/date.hpp +2 -1
  201. data/src/cxx_supportlib/vendor-modified/boost/date_time/date_duration.hpp +4 -3
  202. data/src/cxx_supportlib/vendor-modified/boost/date_time/date_duration_types.hpp +6 -5
  203. data/src/cxx_supportlib/vendor-modified/boost/date_time/date_facet.hpp +2 -2
  204. data/src/cxx_supportlib/vendor-modified/boost/date_time/date_names_put.hpp +8 -7
  205. data/src/cxx_supportlib/vendor-modified/boost/date_time/gregorian/greg_calendar.hpp +2 -1
  206. data/src/cxx_supportlib/vendor-modified/boost/date_time/gregorian/greg_date.hpp +2 -1
  207. data/src/cxx_supportlib/vendor-modified/boost/date_time/gregorian/greg_day.hpp +4 -3
  208. data/src/cxx_supportlib/vendor-modified/boost/date_time/gregorian/greg_day_of_year.hpp +3 -2
  209. data/src/cxx_supportlib/vendor-modified/boost/date_time/gregorian/greg_duration.hpp +2 -1
  210. data/src/cxx_supportlib/vendor-modified/boost/date_time/gregorian/greg_duration_types.hpp +4 -3
  211. data/src/cxx_supportlib/vendor-modified/boost/date_time/gregorian/greg_facet.hpp +27 -7
  212. data/src/cxx_supportlib/vendor-modified/boost/date_time/gregorian/greg_month.hpp +5 -5
  213. data/src/cxx_supportlib/vendor-modified/boost/date_time/gregorian/greg_serialize.hpp +5 -0
  214. data/src/cxx_supportlib/vendor-modified/boost/date_time/gregorian/greg_weekday.hpp +4 -4
  215. data/src/cxx_supportlib/vendor-modified/boost/date_time/gregorian/greg_year.hpp +4 -5
  216. data/src/cxx_supportlib/vendor-modified/boost/date_time/gregorian_calendar.hpp +2 -1
  217. data/src/cxx_supportlib/vendor-modified/boost/date_time/local_time/local_date_time.hpp +5 -4
  218. data/src/cxx_supportlib/vendor-modified/boost/date_time/local_time/posix_time_zone.hpp +4 -3
  219. data/src/cxx_supportlib/vendor-modified/boost/date_time/period.hpp +3 -2
  220. data/src/cxx_supportlib/vendor-modified/boost/date_time/posix_time/date_duration_operators.hpp +1 -1
  221. data/src/cxx_supportlib/vendor-modified/boost/date_time/posix_time/posix_time_config.hpp +2 -2
  222. data/src/cxx_supportlib/vendor-modified/boost/date_time/posix_time/posix_time_duration.hpp +5 -4
  223. data/src/cxx_supportlib/vendor-modified/boost/date_time/posix_time/ptime.hpp +6 -5
  224. data/src/cxx_supportlib/vendor-modified/boost/date_time/posix_time/time_parsers.hpp +4 -0
  225. data/src/cxx_supportlib/vendor-modified/boost/date_time/time_duration.hpp +2 -2
  226. data/src/cxx_supportlib/vendor-modified/boost/date_time/time_facet.hpp +5 -4
  227. data/src/cxx_supportlib/vendor-modified/boost/date_time/time_zone_base.hpp +2 -1
  228. data/src/cxx_supportlib/vendor-modified/boost/date_time/year_month_day.hpp +3 -1
  229. data/src/cxx_supportlib/vendor-modified/boost/detail/iterator.hpp +13 -0
  230. data/src/cxx_supportlib/vendor-modified/boost/detail/lcast_precision.hpp +1 -0
  231. data/src/cxx_supportlib/vendor-modified/boost/detail/workaround.hpp +5 -0
  232. data/src/cxx_supportlib/vendor-modified/boost/exception/detail/error_info_impl.hpp +11 -0
  233. data/src/cxx_supportlib/vendor-modified/boost/exception/detail/shared_ptr.hpp +17 -0
  234. data/src/cxx_supportlib/vendor-modified/boost/exception/exception.hpp +25 -3
  235. data/src/cxx_supportlib/vendor-modified/boost/exception/get_error_info.hpp +2 -1
  236. data/src/cxx_supportlib/vendor-modified/boost/exception/info.hpp +114 -1
  237. data/src/cxx_supportlib/vendor-modified/boost/function/function_base.hpp +116 -142
  238. data/src/cxx_supportlib/vendor-modified/boost/function/function_template.hpp +57 -69
  239. data/src/cxx_supportlib/vendor-modified/boost/functional/hash/detail/hash_float.hpp +1 -1
  240. data/src/cxx_supportlib/vendor-modified/boost/functional/hash/extensions.hpp +3 -3
  241. data/src/cxx_supportlib/vendor-modified/boost/functional/hash/hash.hpp +27 -13
  242. data/src/cxx_supportlib/vendor-modified/boost/intrusive/any_hook.hpp +4 -2
  243. data/src/cxx_supportlib/vendor-modified/boost/intrusive/avl_set.hpp +99 -12
  244. data/src/cxx_supportlib/vendor-modified/boost/intrusive/avl_set_hook.hpp +4 -2
  245. data/src/cxx_supportlib/vendor-modified/boost/intrusive/avltree.hpp +35 -4
  246. data/src/cxx_supportlib/vendor-modified/boost/intrusive/avltree_algorithms.hpp +37 -6
  247. data/src/cxx_supportlib/vendor-modified/boost/intrusive/bs_set.hpp +95 -8
  248. data/src/cxx_supportlib/vendor-modified/boost/intrusive/bs_set_hook.hpp +4 -2
  249. data/src/cxx_supportlib/vendor-modified/boost/intrusive/bstree.hpp +209 -72
  250. data/src/cxx_supportlib/vendor-modified/boost/intrusive/bstree_algorithms.hpp +86 -20
  251. data/src/cxx_supportlib/vendor-modified/boost/intrusive/circular_list_algorithms.hpp +11 -11
  252. data/src/cxx_supportlib/vendor-modified/boost/intrusive/circular_slist_algorithms.hpp +6 -6
  253. data/src/cxx_supportlib/vendor-modified/boost/intrusive/detail/algo_type.hpp +4 -1
  254. data/src/cxx_supportlib/vendor-modified/boost/intrusive/detail/any_node_and_algorithms.hpp +58 -45
  255. data/src/cxx_supportlib/vendor-modified/boost/intrusive/detail/avltree_node.hpp +27 -26
  256. data/src/cxx_supportlib/vendor-modified/boost/intrusive/detail/bstree_algorithms_base.hpp +2 -2
  257. data/src/cxx_supportlib/vendor-modified/boost/intrusive/detail/common_slist_algorithms.hpp +7 -7
  258. data/src/cxx_supportlib/vendor-modified/boost/intrusive/detail/config_begin.hpp +8 -3
  259. data/src/cxx_supportlib/vendor-modified/boost/intrusive/detail/default_header_holder.hpp +4 -3
  260. data/src/cxx_supportlib/vendor-modified/boost/intrusive/detail/ebo_functor_holder.hpp +27 -26
  261. data/src/cxx_supportlib/vendor-modified/boost/intrusive/detail/equal_to_value.hpp +3 -1
  262. data/src/cxx_supportlib/vendor-modified/boost/intrusive/detail/exception_disposer.hpp +4 -2
  263. data/src/cxx_supportlib/vendor-modified/boost/intrusive/detail/generic_hook.hpp +9 -7
  264. data/src/cxx_supportlib/vendor-modified/boost/intrusive/detail/has_member_function_callable_with.hpp +83 -57
  265. data/src/cxx_supportlib/vendor-modified/boost/intrusive/detail/hashtable_node.hpp +30 -30
  266. data/src/cxx_supportlib/vendor-modified/boost/intrusive/detail/hook_traits.hpp +9 -8
  267. data/src/cxx_supportlib/vendor-modified/boost/intrusive/detail/iiterator.hpp +8 -7
  268. data/src/cxx_supportlib/vendor-modified/boost/intrusive/detail/iterator.hpp +16 -15
  269. data/src/cxx_supportlib/vendor-modified/boost/intrusive/detail/key_nodeptr_comp.hpp +70 -44
  270. data/src/cxx_supportlib/vendor-modified/boost/intrusive/detail/list_iterator.hpp +22 -21
  271. data/src/cxx_supportlib/vendor-modified/boost/intrusive/detail/list_node.hpp +7 -6
  272. data/src/cxx_supportlib/vendor-modified/boost/intrusive/detail/parent_from_member.hpp +5 -4
  273. data/src/cxx_supportlib/vendor-modified/boost/intrusive/detail/rbtree_node.hpp +29 -28
  274. data/src/cxx_supportlib/vendor-modified/boost/intrusive/detail/reverse_iterator.hpp +33 -12
  275. data/src/cxx_supportlib/vendor-modified/boost/intrusive/detail/size_holder.hpp +19 -12
  276. data/src/cxx_supportlib/vendor-modified/boost/intrusive/detail/slist_iterator.hpp +21 -20
  277. data/src/cxx_supportlib/vendor-modified/boost/intrusive/detail/slist_node.hpp +4 -3
  278. data/src/cxx_supportlib/vendor-modified/boost/intrusive/detail/to_raw_pointer.hpp +3 -2
  279. data/src/cxx_supportlib/vendor-modified/boost/intrusive/detail/transform_iterator.hpp +23 -22
  280. data/src/cxx_supportlib/vendor-modified/boost/intrusive/detail/tree_iterator.hpp +23 -22
  281. data/src/cxx_supportlib/vendor-modified/boost/intrusive/detail/tree_node.hpp +10 -9
  282. data/src/cxx_supportlib/vendor-modified/boost/intrusive/detail/tree_value_compare.hpp +103 -29
  283. data/src/cxx_supportlib/vendor-modified/boost/intrusive/detail/workaround.hpp +15 -0
  284. data/src/cxx_supportlib/vendor-modified/boost/intrusive/hashtable.hpp +295 -211
  285. data/src/cxx_supportlib/vendor-modified/boost/intrusive/linear_slist_algorithms.hpp +2 -2
  286. data/src/cxx_supportlib/vendor-modified/boost/intrusive/list.hpp +20 -7
  287. data/src/cxx_supportlib/vendor-modified/boost/intrusive/list_hook.hpp +4 -2
  288. data/src/cxx_supportlib/vendor-modified/boost/intrusive/member_value_traits.hpp +5 -4
  289. data/src/cxx_supportlib/vendor-modified/boost/intrusive/options.hpp +4 -4
  290. data/src/cxx_supportlib/vendor-modified/boost/intrusive/parent_from_member.hpp +3 -2
  291. data/src/cxx_supportlib/vendor-modified/boost/intrusive/pointer_plus_bits.hpp +4 -4
  292. data/src/cxx_supportlib/vendor-modified/boost/intrusive/pointer_traits.hpp +4 -4
  293. data/src/cxx_supportlib/vendor-modified/boost/intrusive/priority_compare.hpp +22 -4
  294. data/src/cxx_supportlib/vendor-modified/boost/intrusive/rbtree.hpp +36 -4
  295. data/src/cxx_supportlib/vendor-modified/boost/intrusive/rbtree_algorithms.hpp +43 -13
  296. data/src/cxx_supportlib/vendor-modified/boost/intrusive/set.hpp +95 -8
  297. data/src/cxx_supportlib/vendor-modified/boost/intrusive/set_hook.hpp +4 -2
  298. data/src/cxx_supportlib/vendor-modified/boost/intrusive/sg_set.hpp +96 -12
  299. data/src/cxx_supportlib/vendor-modified/boost/intrusive/sgtree.hpp +102 -5
  300. data/src/cxx_supportlib/vendor-modified/boost/intrusive/sgtree_algorithms.hpp +48 -4
  301. data/src/cxx_supportlib/vendor-modified/boost/intrusive/slist.hpp +20 -11
  302. data/src/cxx_supportlib/vendor-modified/boost/intrusive/slist_hook.hpp +9 -2
  303. data/src/cxx_supportlib/vendor-modified/boost/intrusive/splay_set.hpp +95 -8
  304. data/src/cxx_supportlib/vendor-modified/boost/intrusive/splaytree.hpp +36 -4
  305. data/src/cxx_supportlib/vendor-modified/boost/intrusive/splaytree_algorithms.hpp +27 -0
  306. data/src/cxx_supportlib/vendor-modified/boost/intrusive/treap.hpp +167 -23
  307. data/src/cxx_supportlib/vendor-modified/boost/intrusive/treap_algorithms.hpp +28 -0
  308. data/src/cxx_supportlib/vendor-modified/boost/intrusive/treap_set.hpp +100 -46
  309. data/src/cxx_supportlib/vendor-modified/boost/intrusive/trivial_value_traits.hpp +5 -4
  310. data/src/cxx_supportlib/vendor-modified/boost/intrusive/unordered_set.hpp +37 -27
  311. data/src/cxx_supportlib/vendor-modified/boost/intrusive/unordered_set_hook.hpp +30 -14
  312. data/src/cxx_supportlib/vendor-modified/boost/lexical_cast.hpp +1 -1
  313. data/src/cxx_supportlib/vendor-modified/boost/lexical_cast/detail/converter_lexical_streams.hpp +35 -36
  314. data/src/cxx_supportlib/vendor-modified/boost/lexical_cast/detail/converter_numeric.hpp +6 -28
  315. data/src/cxx_supportlib/vendor-modified/boost/lexical_cast/try_lexical_convert.hpp +20 -5
  316. data/src/cxx_supportlib/vendor-modified/boost/libs/regex/src/posix_api.cpp +4 -2
  317. data/src/cxx_supportlib/vendor-modified/boost/libs/regex/src/regex.cpp +3 -1
  318. data/src/cxx_supportlib/vendor-modified/boost/libs/thread/src/pthread/once.cpp +5 -0
  319. data/src/cxx_supportlib/vendor-modified/boost/libs/thread/src/pthread/thread.cpp +11 -7
  320. data/src/cxx_supportlib/vendor-modified/boost/math/policies/policy.hpp +1 -3
  321. data/src/cxx_supportlib/vendor-modified/boost/math/special_functions/fpclassify.hpp +5 -1
  322. data/src/cxx_supportlib/vendor-modified/boost/math/special_functions/math_fwd.hpp +11 -0
  323. data/src/cxx_supportlib/vendor-modified/boost/math/tools/config.hpp +10 -2
  324. data/src/cxx_supportlib/vendor-modified/boost/move/adl_move_swap.hpp +40 -7
  325. data/src/cxx_supportlib/vendor-modified/boost/move/algo/adaptive_merge.hpp +67 -0
  326. data/src/cxx_supportlib/vendor-modified/boost/move/algo/adaptive_sort.hpp +63 -0
  327. data/src/cxx_supportlib/vendor-modified/boost/move/algo/detail/adaptive_sort_merge.hpp +2437 -0
  328. data/src/cxx_supportlib/vendor-modified/boost/move/algo/detail/basic_op.hpp +121 -0
  329. data/src/cxx_supportlib/vendor-modified/boost/move/algo/detail/insertion_sort.hpp +127 -0
  330. data/src/cxx_supportlib/vendor-modified/boost/move/algo/detail/merge.hpp +637 -0
  331. data/src/cxx_supportlib/vendor-modified/boost/move/algo/detail/merge_sort.hpp +139 -0
  332. data/src/cxx_supportlib/vendor-modified/boost/move/algo/move.hpp +155 -0
  333. data/src/cxx_supportlib/vendor-modified/boost/move/algorithm.hpp +1 -116
  334. data/src/cxx_supportlib/vendor-modified/boost/move/core.hpp +14 -13
  335. data/src/cxx_supportlib/vendor-modified/boost/move/default_delete.hpp +17 -1
  336. data/src/cxx_supportlib/vendor-modified/boost/move/detail/config_begin.hpp +2 -0
  337. data/src/cxx_supportlib/vendor-modified/boost/move/detail/destruct_n.hpp +67 -0
  338. data/src/cxx_supportlib/vendor-modified/boost/move/detail/fwd_macros.hpp +227 -32
  339. data/src/cxx_supportlib/vendor-modified/boost/move/detail/iterator_traits.hpp +4 -0
  340. data/src/cxx_supportlib/vendor-modified/boost/move/detail/meta_utils.hpp +30 -9
  341. data/src/cxx_supportlib/vendor-modified/boost/move/detail/meta_utils_core.hpp +12 -0
  342. data/src/cxx_supportlib/vendor-modified/boost/move/detail/move_helpers.hpp +84 -80
  343. data/src/cxx_supportlib/vendor-modified/boost/move/detail/placement_new.hpp +30 -0
  344. data/src/cxx_supportlib/vendor-modified/boost/move/detail/reverse_iterator.hpp +171 -0
  345. data/src/cxx_supportlib/vendor-modified/boost/move/detail/type_traits.hpp +14 -20
  346. data/src/cxx_supportlib/vendor-modified/boost/move/detail/unique_ptr_meta_utils.hpp +1 -1
  347. data/src/cxx_supportlib/vendor-modified/boost/move/detail/workaround.hpp +14 -0
  348. data/src/cxx_supportlib/vendor-modified/boost/move/iterator.hpp +32 -33
  349. data/src/cxx_supportlib/vendor-modified/boost/move/make_unique.hpp +2 -1
  350. data/src/cxx_supportlib/vendor-modified/boost/move/unique_ptr.hpp +49 -49
  351. data/src/cxx_supportlib/vendor-modified/boost/move/utility.hpp +8 -7
  352. data/src/cxx_supportlib/vendor-modified/boost/move/utility_core.hpp +17 -16
  353. data/src/cxx_supportlib/vendor-modified/boost/mpl/print.hpp +3 -0
  354. data/src/cxx_supportlib/vendor-modified/boost/none.hpp +1 -1
  355. data/src/cxx_supportlib/vendor-modified/boost/none_t.hpp +2 -3
  356. data/src/cxx_supportlib/vendor-modified/boost/operators.hpp +197 -255
  357. data/src/cxx_supportlib/vendor-modified/boost/optional/detail/old_optional_implementation.hpp +1059 -0
  358. data/src/cxx_supportlib/vendor-modified/boost/optional/detail/optional_aligned_storage.hpp +75 -0
  359. data/src/cxx_supportlib/vendor-modified/boost/optional/detail/optional_config.hpp +116 -0
  360. data/src/cxx_supportlib/vendor-modified/boost/optional/detail/optional_factory_support.hpp +36 -0
  361. data/src/cxx_supportlib/vendor-modified/boost/optional/detail/optional_reference_spec.hpp +253 -0
  362. data/src/cxx_supportlib/vendor-modified/boost/optional/detail/optional_relops.hpp +196 -0
  363. data/src/cxx_supportlib/vendor-modified/boost/optional/detail/optional_swap.hpp +117 -0
  364. data/src/cxx_supportlib/vendor-modified/boost/optional/optional.hpp +372 -554
  365. data/src/cxx_supportlib/vendor-modified/boost/optional/optional_fwd.hpp +12 -1
  366. data/src/cxx_supportlib/vendor-modified/boost/pool/detail/mutex.hpp +15 -7
  367. data/src/cxx_supportlib/vendor-modified/boost/pool/pool_alloc.hpp +24 -0
  368. data/src/cxx_supportlib/vendor-modified/boost/predef/compiler/intel.h +9 -2
  369. data/src/cxx_supportlib/vendor-modified/boost/predef/compiler/visualc.h +15 -1
  370. data/src/cxx_supportlib/vendor-modified/boost/predef/hardware/simd.h +16 -4
  371. data/src/cxx_supportlib/vendor-modified/boost/predef/hardware/simd/x86.h +3 -3
  372. data/src/cxx_supportlib/vendor-modified/boost/predef/hardware/simd/x86_amd.h +4 -4
  373. data/src/cxx_supportlib/vendor-modified/boost/predef/hardware/simd/x86_amd/versions.h +4 -4
  374. data/src/cxx_supportlib/vendor-modified/boost/predef/os/cygwin.h +1 -1
  375. data/src/cxx_supportlib/vendor-modified/boost/predef/version.h +2 -2
  376. data/src/cxx_supportlib/vendor-modified/boost/predef/version_number.h +20 -1
  377. data/src/cxx_supportlib/vendor-modified/boost/preprocessor/cat.hpp +1 -1
  378. data/src/cxx_supportlib/vendor-modified/boost/preprocessor/config/config.hpp +6 -6
  379. data/src/cxx_supportlib/vendor-modified/boost/preprocessor/seq/detail/binary_transform.hpp +5 -6
  380. data/src/cxx_supportlib/vendor-modified/boost/preprocessor/seq/detail/to_list_msvc.hpp +55 -0
  381. data/src/cxx_supportlib/vendor-modified/boost/preprocessor/seq/to_list.hpp +12 -0
  382. data/src/cxx_supportlib/vendor-modified/boost/range/const_iterator.hpp +4 -4
  383. data/src/cxx_supportlib/vendor-modified/boost/range/size_type.hpp +0 -5
  384. data/src/cxx_supportlib/vendor-modified/boost/regex/concepts.hpp +16 -16
  385. data/src/cxx_supportlib/vendor-modified/boost/regex/config.hpp +4 -4
  386. data/src/cxx_supportlib/vendor-modified/boost/regex/pending/unicode_iterator.hpp +3 -0
  387. data/src/cxx_supportlib/vendor-modified/boost/regex/v4/basic_regex_creator.hpp +102 -87
  388. data/src/cxx_supportlib/vendor-modified/boost/regex/v4/basic_regex_parser.hpp +45 -21
  389. data/src/cxx_supportlib/vendor-modified/boost/regex/v4/cpp_regex_traits.hpp +4 -4
  390. data/src/cxx_supportlib/vendor-modified/boost/regex/v4/fileiter.hpp +2 -2
  391. data/src/cxx_supportlib/vendor-modified/boost/regex/v4/instances.hpp +1 -1
  392. data/src/cxx_supportlib/vendor-modified/boost/regex/v4/match_flags.hpp +14 -2
  393. data/src/cxx_supportlib/vendor-modified/boost/regex/v4/mem_block_cache.hpp +46 -0
  394. data/src/cxx_supportlib/vendor-modified/boost/regex/v4/perl_matcher.hpp +5 -2
  395. data/src/cxx_supportlib/vendor-modified/boost/regex/v4/perl_matcher_common.hpp +5 -14
  396. data/src/cxx_supportlib/vendor-modified/boost/regex/v4/perl_matcher_non_recursive.hpp +116 -13
  397. data/src/cxx_supportlib/vendor-modified/boost/regex/v4/perl_matcher_recursive.hpp +34 -0
  398. data/src/cxx_supportlib/vendor-modified/boost/regex/v4/regex_format.hpp +2 -2
  399. data/src/cxx_supportlib/vendor-modified/boost/regex/v4/regex_traits.hpp +1 -1
  400. data/src/cxx_supportlib/vendor-modified/boost/regex/v4/regex_traits_defaults.hpp +3 -3
  401. data/src/cxx_supportlib/vendor-modified/boost/regex/v4/regex_workaround.hpp +1 -0
  402. data/src/cxx_supportlib/vendor-modified/boost/regex/v4/w32_regex_traits.hpp +2 -2
  403. data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/allocate_shared_array.hpp +1004 -159
  404. data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/bad_weak_ptr.hpp +9 -0
  405. data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/detail/atomic_count.hpp +3 -0
  406. data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/detail/shared_count.hpp +4 -58
  407. data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/detail/sp_counted_base.hpp +5 -2
  408. data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/detail/sp_counted_base_clang.hpp +9 -0
  409. data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/detail/sp_counted_impl.hpp +0 -8
  410. data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/detail/sp_has_sync.hpp +3 -3
  411. data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/detail/sp_noexcept.hpp +30 -0
  412. data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/detail/spinlock.hpp +3 -0
  413. data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/enable_shared_from_this.hpp +5 -4
  414. data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/intrusive_ptr.hpp +28 -3
  415. data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/intrusive_ref_counter.hpp +187 -0
  416. data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/make_shared_array.hpp +52 -144
  417. data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/make_shared_object.hpp +120 -450
  418. data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/scoped_array.hpp +2 -1
  419. data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/scoped_ptr.hpp +2 -1
  420. data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/shared_array.hpp +7 -6
  421. data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/shared_ptr.hpp +70 -8
  422. data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/weak_ptr.hpp +6 -5
  423. data/src/cxx_supportlib/vendor-modified/boost/system/error_code.hpp +9 -8
  424. data/src/cxx_supportlib/vendor-modified/boost/system/system_error.hpp +3 -3
  425. data/src/cxx_supportlib/vendor-modified/boost/thread/barrier.hpp +5 -4
  426. data/src/cxx_supportlib/vendor-modified/boost/thread/completion_latch.hpp +0 -1
  427. data/src/cxx_supportlib/vendor-modified/boost/thread/concurrent_queues/queue_views.hpp +0 -11
  428. data/src/cxx_supportlib/vendor-modified/boost/thread/concurrent_queues/sync_timed_queue.hpp +6 -4
  429. data/src/cxx_supportlib/vendor-modified/boost/thread/detail/config.hpp +11 -2
  430. data/src/cxx_supportlib/vendor-modified/boost/thread/detail/thread.hpp +11 -4
  431. data/src/cxx_supportlib/vendor-modified/boost/thread/exceptions.hpp +8 -8
  432. data/src/cxx_supportlib/vendor-modified/boost/thread/executors/executor.hpp +1 -1
  433. data/src/cxx_supportlib/vendor-modified/boost/thread/executors/generic_executor_ref.hpp +5 -5
  434. data/src/cxx_supportlib/vendor-modified/boost/thread/executors/loop_executor.hpp +22 -18
  435. data/src/cxx_supportlib/vendor-modified/boost/thread/future.hpp +163 -55
  436. data/src/cxx_supportlib/vendor-modified/boost/thread/futures/launch.hpp +1 -0
  437. data/src/cxx_supportlib/vendor-modified/boost/thread/futures/wait_for_all.hpp +1 -1
  438. data/src/cxx_supportlib/vendor-modified/boost/thread/lock_types.hpp +9 -9
  439. data/src/cxx_supportlib/vendor-modified/boost/thread/locks.hpp +1 -0
  440. data/src/cxx_supportlib/vendor-modified/boost/thread/pthread/condition_variable.hpp +6 -7
  441. data/src/cxx_supportlib/vendor-modified/boost/thread/pthread/condition_variable_fwd.hpp +17 -2
  442. data/src/cxx_supportlib/vendor-modified/boost/thread/pthread/shared_mutex.hpp +2 -2
  443. data/src/cxx_supportlib/vendor-modified/boost/thread/pthread/thread_data.hpp +5 -5
  444. data/src/cxx_supportlib/vendor-modified/boost/thread/pthread/timespec.hpp +29 -0
  445. data/src/cxx_supportlib/vendor-modified/boost/thread/scoped_thread.hpp +23 -18
  446. data/src/cxx_supportlib/vendor-modified/boost/thread/synchronized_value.hpp +6 -6
  447. data/src/cxx_supportlib/vendor-modified/boost/thread/thread_functors.hpp +19 -4
  448. data/src/cxx_supportlib/vendor-modified/boost/thread/thread_guard.hpp +3 -3
  449. data/src/cxx_supportlib/vendor-modified/boost/thread/user_scheduler.hpp +1 -1
  450. data/src/cxx_supportlib/vendor-modified/boost/type_index.hpp +265 -0
  451. data/src/cxx_supportlib/vendor-modified/boost/type_index/stl_type_index.hpp +272 -0
  452. data/src/cxx_supportlib/vendor-modified/boost/type_index/type_index_facade.hpp +300 -0
  453. data/src/cxx_supportlib/vendor-modified/boost/type_traits/add_reference.hpp +3 -3
  454. data/src/cxx_supportlib/vendor-modified/boost/type_traits/aligned_storage.hpp +6 -6
  455. data/src/cxx_supportlib/vendor-modified/boost/type_traits/common_type.hpp +1 -0
  456. data/src/cxx_supportlib/vendor-modified/boost/type_traits/detail/common_arithmetic_type.hpp +9 -3
  457. data/src/cxx_supportlib/vendor-modified/boost/type_traits/detail/mp_defer.hpp +3 -3
  458. data/src/cxx_supportlib/vendor-modified/boost/type_traits/extent.hpp +1 -0
  459. data/src/cxx_supportlib/vendor-modified/boost/type_traits/has_nothrow_assign.hpp +2 -1
  460. data/src/cxx_supportlib/vendor-modified/boost/type_traits/has_nothrow_constructor.hpp +2 -1
  461. data/src/cxx_supportlib/vendor-modified/boost/type_traits/has_nothrow_destructor.hpp +1 -1
  462. data/src/cxx_supportlib/vendor-modified/boost/type_traits/has_trivial_assign.hpp +2 -1
  463. data/src/cxx_supportlib/vendor-modified/boost/type_traits/has_trivial_copy.hpp +1 -0
  464. data/src/cxx_supportlib/vendor-modified/boost/type_traits/has_trivial_destructor.hpp +1 -1
  465. data/src/cxx_supportlib/vendor-modified/boost/type_traits/has_trivial_move_assign.hpp +1 -0
  466. data/src/cxx_supportlib/vendor-modified/boost/type_traits/has_trivial_move_constructor.hpp +1 -0
  467. data/src/cxx_supportlib/vendor-modified/boost/type_traits/is_abstract.hpp +1 -0
  468. data/src/cxx_supportlib/vendor-modified/boost/type_traits/is_array.hpp +1 -1
  469. data/src/cxx_supportlib/vendor-modified/boost/type_traits/is_assignable.hpp +1 -0
  470. data/src/cxx_supportlib/vendor-modified/boost/type_traits/is_const.hpp +2 -1
  471. data/src/cxx_supportlib/vendor-modified/boost/type_traits/is_default_constructible.hpp +21 -1
  472. data/src/cxx_supportlib/vendor-modified/boost/type_traits/is_destructible.hpp +1 -0
  473. data/src/cxx_supportlib/vendor-modified/boost/type_traits/is_nothrow_move_assignable.hpp +1 -1
  474. data/src/cxx_supportlib/vendor-modified/boost/type_traits/is_nothrow_move_constructible.hpp +2 -1
  475. data/src/cxx_supportlib/vendor-modified/boost/type_traits/is_pod.hpp +1 -0
  476. data/src/cxx_supportlib/vendor-modified/boost/type_traits/is_rvalue_reference.hpp +1 -1
  477. data/src/cxx_supportlib/vendor-modified/boost/type_traits/is_virtual_base_of.hpp +1 -1
  478. data/src/cxx_supportlib/vendor-modified/boost/type_traits/is_volatile.hpp +2 -1
  479. data/src/cxx_supportlib/vendor-modified/boost/type_traits/make_void.hpp +52 -0
  480. data/src/cxx_supportlib/vendor-modified/boost/type_traits/rank.hpp +1 -0
  481. data/src/cxx_supportlib/vendor-modified/boost/type_traits/remove_all_extents.hpp +1 -1
  482. data/src/cxx_supportlib/vendor-modified/boost/type_traits/remove_const.hpp +1 -1
  483. data/src/cxx_supportlib/vendor-modified/boost/type_traits/remove_cv.hpp +1 -1
  484. data/src/cxx_supportlib/vendor-modified/boost/type_traits/remove_extent.hpp +1 -1
  485. data/src/cxx_supportlib/vendor-modified/boost/type_traits/remove_pointer.hpp +1 -1
  486. data/src/cxx_supportlib/vendor-modified/boost/type_traits/remove_volatile.hpp +1 -1
  487. data/src/cxx_supportlib/vendor-modified/boost/type_traits/type_with_alignment.hpp +1 -1
  488. data/src/cxx_supportlib/vendor-modified/boost/unordered/detail/fwd.hpp +40 -6
  489. data/src/cxx_supportlib/vendor-modified/boost/unordered/detail/implementation.hpp +4986 -0
  490. data/src/cxx_supportlib/vendor-modified/boost/unordered/detail/map.hpp +107 -0
  491. data/src/cxx_supportlib/vendor-modified/boost/unordered/detail/set.hpp +105 -0
  492. data/src/cxx_supportlib/vendor-modified/boost/unordered/unordered_map.hpp +1814 -1255
  493. data/src/cxx_supportlib/vendor-modified/boost/unordered/unordered_map_fwd.hpp +41 -45
  494. data/src/cxx_supportlib/vendor-modified/boost/unordered/unordered_set.hpp +1498 -1161
  495. data/src/cxx_supportlib/vendor-modified/boost/unordered/unordered_set_fwd.hpp +40 -44
  496. data/src/cxx_supportlib/vendor-modified/boost/utility.hpp +2 -2
  497. data/src/cxx_supportlib/vendor-modified/boost/utility/base_from_member.hpp +7 -6
  498. data/src/cxx_supportlib/vendor-modified/boost/utility/compare_pointees.hpp +10 -2
  499. data/src/cxx_supportlib/vendor-modified/boost/utility/string_ref.hpp +39 -22
  500. data/src/cxx_supportlib/vendor-modified/boost/utility/string_view.hpp +690 -0
  501. data/src/cxx_supportlib/vendor-modified/boost/utility/string_view_fwd.hpp +39 -0
  502. data/src/cxx_supportlib/vendor-modified/boost/version.hpp +2 -2
  503. data/src/helper-scripts/crash-watch.rb +3 -0
  504. data/src/ruby_supportlib/phusion_passenger.rb +1 -1
  505. data/src/ruby_supportlib/phusion_passenger/apache2/config_options.rb +1 -0
  506. data/src/ruby_supportlib/phusion_passenger/packaging.rb +2 -12
  507. metadata +77 -38
  508. data/dev/ci/inituidgid +0 -24
  509. data/dev/ci/run_jenkins.sh +0 -70
  510. data/dev/ci/run_travis.sh +0 -314
  511. data/doc/Design and Architecture.html +0 -2421
  512. data/doc/Design and Architecture.txt +0 -511
  513. data/doc/Security of user switching support.html +0 -1833
  514. data/doc/Users guide Apache.html +0 -3101
  515. data/doc/Users guide Apache.idmap.txt +0 -451
  516. data/doc/Users guide Apache.txt +0 -534
  517. data/doc/Users guide Nginx.html +0 -3026
  518. data/doc/Users guide Nginx.idmap.txt +0 -431
  519. data/doc/Users guide Nginx.txt +0 -451
  520. data/doc/Users guide Standalone.html +0 -2092
  521. data/doc/Users guide Standalone.idmap.txt +0 -137
  522. data/doc/Users guide Standalone.txt +0 -81
  523. data/doc/Users guide.html +0 -1606
  524. data/doc/Users guide.txt +0 -8
  525. data/src/cxx_supportlib/vendor-modified/boost/align/align.hpp +0 -20
  526. data/src/cxx_supportlib/vendor-modified/boost/align/detail/address.hpp +0 -29
  527. data/src/cxx_supportlib/vendor-modified/boost/align/detail/align.hpp +0 -40
  528. data/src/cxx_supportlib/vendor-modified/boost/align/detail/align_cxx11.hpp +0 -22
  529. data/src/cxx_supportlib/vendor-modified/boost/align/detail/is_alignment.hpp +0 -29
  530. data/src/cxx_supportlib/vendor-modified/boost/container/detail/hash_table.hpp +0 -383
  531. data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/detail/array_allocator.hpp +0 -318
  532. data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/detail/array_count_impl.hpp +0 -67
  533. data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/detail/array_traits.hpp +0 -60
  534. data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/detail/array_utility.hpp +0 -214
  535. data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/detail/sp_if_array.hpp +0 -34
  536. data/src/cxx_supportlib/vendor-modified/boost/unordered/detail/allocate.hpp +0 -1128
  537. data/src/cxx_supportlib/vendor-modified/boost/unordered/detail/buckets.hpp +0 -928
  538. data/src/cxx_supportlib/vendor-modified/boost/unordered/detail/equivalent.hpp +0 -686
  539. data/src/cxx_supportlib/vendor-modified/boost/unordered/detail/extract_key.hpp +0 -188
  540. data/src/cxx_supportlib/vendor-modified/boost/unordered/detail/table.hpp +0 -873
  541. data/src/cxx_supportlib/vendor-modified/boost/unordered/detail/unique.hpp +0 -628
  542. data/src/cxx_supportlib/vendor-modified/boost/unordered/detail/util.hpp +0 -266
@@ -0,0 +1,107 @@
1
+
2
+ // Copyright (C) 2005-2016 Daniel James
3
+ // Distributed under the Boost Software License, Version 1.0. (See accompanying
4
+ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
5
+
6
+ #include <boost/unordered/detail/implementation.hpp>
7
+ #include <boost/unordered/unordered_map_fwd.hpp>
8
+
9
+ namespace boost {
10
+ namespace unordered {
11
+ namespace detail {
12
+ template <typename A, typename K, typename M, typename H, typename P> struct map
13
+ {
14
+ typedef boost::unordered::detail::map<A, K, M, H, P> types;
15
+
16
+ typedef std::pair<K const, M> value_type;
17
+ typedef H hasher;
18
+ typedef P key_equal;
19
+ typedef K const const_key_type;
20
+
21
+ typedef typename ::boost::unordered::detail::rebind_wrap<A,
22
+ value_type>::type value_allocator;
23
+ typedef boost::unordered::detail::allocator_traits<value_allocator>
24
+ value_allocator_traits;
25
+
26
+ typedef boost::unordered::detail::pick_node<A, value_type> pick;
27
+ typedef typename pick::node node;
28
+ typedef typename pick::bucket bucket;
29
+ typedef typename pick::link_pointer link_pointer;
30
+ typedef typename pick::node_algo node_algo;
31
+
32
+ typedef boost::unordered::detail::table_impl<types> table;
33
+ typedef boost::unordered::detail::map_extractor<value_type> extractor;
34
+
35
+ typedef typename boost::unordered::detail::pick_policy<K>::type policy;
36
+
37
+ typedef boost::unordered::iterator_detail::iterator<node> iterator;
38
+ typedef boost::unordered::iterator_detail::c_iterator<node> c_iterator;
39
+ typedef boost::unordered::iterator_detail::l_iterator<node, policy>
40
+ l_iterator;
41
+ typedef boost::unordered::iterator_detail::cl_iterator<node, policy>
42
+ cl_iterator;
43
+
44
+ typedef boost::unordered::node_handle_map<node, K, M, A> node_type;
45
+ typedef boost::unordered::insert_return_type_map<node, K, M, A>
46
+ insert_return_type;
47
+ };
48
+
49
+ template <typename A, typename K, typename M, typename H, typename P>
50
+ struct multimap
51
+ {
52
+ typedef boost::unordered::detail::multimap<A, K, M, H, P> types;
53
+
54
+ typedef std::pair<K const, M> value_type;
55
+ typedef H hasher;
56
+ typedef P key_equal;
57
+ typedef K const const_key_type;
58
+
59
+ typedef typename ::boost::unordered::detail::rebind_wrap<A,
60
+ value_type>::type value_allocator;
61
+ typedef boost::unordered::detail::allocator_traits<value_allocator>
62
+ value_allocator_traits;
63
+
64
+ #if BOOST_UNORDERED_INTEROPERABLE_NODES
65
+ typedef boost::unordered::detail::pick_node<A, value_type> pick;
66
+ #else
67
+ typedef boost::unordered::detail::pick_grouped_node<A, value_type> pick;
68
+ #endif
69
+ typedef typename pick::node node;
70
+ typedef typename pick::bucket bucket;
71
+ typedef typename pick::link_pointer link_pointer;
72
+ typedef typename pick::node_algo node_algo;
73
+
74
+ typedef boost::unordered::detail::grouped_table_impl<types> table;
75
+ typedef boost::unordered::detail::map_extractor<value_type> extractor;
76
+
77
+ typedef typename boost::unordered::detail::pick_policy<K>::type policy;
78
+
79
+ typedef boost::unordered::iterator_detail::iterator<node> iterator;
80
+ typedef boost::unordered::iterator_detail::c_iterator<node> c_iterator;
81
+ typedef boost::unordered::iterator_detail::l_iterator<node, policy>
82
+ l_iterator;
83
+ typedef boost::unordered::iterator_detail::cl_iterator<node, policy>
84
+ cl_iterator;
85
+
86
+ typedef boost::unordered::node_handle_map<node, K, M, A> node_type;
87
+ };
88
+
89
+ template <typename K, typename M, typename H, typename P, typename A>
90
+ class instantiate_map
91
+ {
92
+ typedef boost::unordered_map<K, M, H, P, A> container;
93
+ container x;
94
+ typename container::node_type node_type;
95
+ typename container::insert_return_type insert_return_type;
96
+ };
97
+
98
+ template <typename K, typename M, typename H, typename P, typename A>
99
+ class instantiate_multimap
100
+ {
101
+ typedef boost::unordered_multimap<K, M, H, P, A> container;
102
+ container x;
103
+ typename container::node_type node_type;
104
+ };
105
+ }
106
+ }
107
+ }
@@ -0,0 +1,105 @@
1
+
2
+ // Copyright (C) 2005-2016 Daniel James
3
+ // Distributed under the Boost Software License, Version 1.0. (See accompanying
4
+ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
5
+
6
+ #include <boost/unordered/detail/implementation.hpp>
7
+ #include <boost/unordered/unordered_set_fwd.hpp>
8
+
9
+ namespace boost {
10
+ namespace unordered {
11
+ namespace detail {
12
+ template <typename A, typename T, typename H, typename P> struct set
13
+ {
14
+ typedef boost::unordered::detail::set<A, T, H, P> types;
15
+
16
+ typedef T value_type;
17
+ typedef H hasher;
18
+ typedef P key_equal;
19
+ typedef T const const_key_type;
20
+
21
+ typedef typename ::boost::unordered::detail::rebind_wrap<A,
22
+ value_type>::type value_allocator;
23
+ typedef boost::unordered::detail::allocator_traits<value_allocator>
24
+ value_allocator_traits;
25
+
26
+ typedef boost::unordered::detail::pick_node<A, value_type> pick;
27
+ typedef typename pick::node node;
28
+ typedef typename pick::bucket bucket;
29
+ typedef typename pick::link_pointer link_pointer;
30
+ typedef typename pick::node_algo node_algo;
31
+
32
+ typedef boost::unordered::detail::table_impl<types> table;
33
+ typedef boost::unordered::detail::set_extractor<value_type> extractor;
34
+
35
+ typedef typename boost::unordered::detail::pick_policy<T>::type policy;
36
+
37
+ typedef boost::unordered::iterator_detail::c_iterator<node> iterator;
38
+ typedef boost::unordered::iterator_detail::c_iterator<node> c_iterator;
39
+ typedef boost::unordered::iterator_detail::cl_iterator<node, policy>
40
+ l_iterator;
41
+ typedef boost::unordered::iterator_detail::cl_iterator<node, policy>
42
+ cl_iterator;
43
+
44
+ typedef boost::unordered::node_handle_set<node, T, A> node_type;
45
+ typedef boost::unordered::insert_return_type_set<node, T, A>
46
+ insert_return_type;
47
+ };
48
+
49
+ template <typename A, typename T, typename H, typename P> struct multiset
50
+ {
51
+ typedef boost::unordered::detail::multiset<A, T, H, P> types;
52
+
53
+ typedef T value_type;
54
+ typedef H hasher;
55
+ typedef P key_equal;
56
+ typedef T const const_key_type;
57
+
58
+ typedef typename ::boost::unordered::detail::rebind_wrap<A,
59
+ value_type>::type value_allocator;
60
+ typedef boost::unordered::detail::allocator_traits<value_allocator>
61
+ value_allocator_traits;
62
+
63
+ #if BOOST_UNORDERED_INTEROPERABLE_NODES
64
+ typedef boost::unordered::detail::pick_node<A, value_type> pick;
65
+ #else
66
+ typedef boost::unordered::detail::pick_grouped_node<A, value_type> pick;
67
+ #endif
68
+ typedef typename pick::node node;
69
+ typedef typename pick::bucket bucket;
70
+ typedef typename pick::link_pointer link_pointer;
71
+ typedef typename pick::node_algo node_algo;
72
+
73
+ typedef boost::unordered::detail::grouped_table_impl<types> table;
74
+ typedef boost::unordered::detail::set_extractor<value_type> extractor;
75
+
76
+ typedef typename boost::unordered::detail::pick_policy<T>::type policy;
77
+
78
+ typedef boost::unordered::iterator_detail::c_iterator<node> iterator;
79
+ typedef boost::unordered::iterator_detail::c_iterator<node> c_iterator;
80
+ typedef boost::unordered::iterator_detail::cl_iterator<node, policy>
81
+ l_iterator;
82
+ typedef boost::unordered::iterator_detail::cl_iterator<node, policy>
83
+ cl_iterator;
84
+
85
+ typedef boost::unordered::node_handle_set<node, T, A> node_type;
86
+ };
87
+
88
+ template <typename T, typename H, typename P, typename A> class instantiate_set
89
+ {
90
+ typedef boost::unordered_set<T, H, P, A> container;
91
+ container x;
92
+ typename container::node_type node_type;
93
+ typename container::insert_return_type insert_return_type;
94
+ };
95
+
96
+ template <typename T, typename H, typename P, typename A>
97
+ class instantiate_multiset
98
+ {
99
+ typedef boost::unordered_multiset<T, H, P, A> container;
100
+ container x;
101
+ typename container::node_type node_type;
102
+ };
103
+ }
104
+ }
105
+ }
@@ -14,12 +14,10 @@
14
14
  #pragma once
15
15
  #endif
16
16
 
17
- #include <boost/unordered/unordered_map_fwd.hpp>
18
- #include <boost/unordered/detail/equivalent.hpp>
19
- #include <boost/unordered/detail/unique.hpp>
20
- #include <boost/unordered/detail/util.hpp>
17
+ #include <boost/core/explicit_operator_bool.hpp>
21
18
  #include <boost/functional/hash.hpp>
22
19
  #include <boost/move/move.hpp>
20
+ #include <boost/unordered/detail/map.hpp>
23
21
 
24
22
  #if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
25
23
  #include <initializer_list>
@@ -28,1625 +26,2186 @@
28
26
  #if defined(BOOST_MSVC)
29
27
  #pragma warning(push)
30
28
  #if BOOST_MSVC >= 1400
31
- #pragma warning(disable:4396) //the inline specifier cannot be used when a
32
- // friend declaration refers to a specialization
33
- // of a function template
29
+ #pragma warning(disable : 4396) // the inline specifier cannot be used when a
30
+ // friend declaration refers to a specialization
31
+ // of a function template
34
32
  #endif
35
33
  #endif
36
34
 
37
- namespace boost
35
+ namespace boost {
36
+ namespace unordered {
37
+ template <class K, class T, class H, class P, class A> class unordered_map
38
38
  {
39
- namespace unordered
40
- {
41
- template <class K, class T, class H, class P, class A>
42
- class unordered_map
43
- {
44
39
  #if defined(BOOST_UNORDERED_USE_MOVE)
45
- BOOST_COPYABLE_AND_MOVABLE(unordered_map)
46
- #endif
40
+ BOOST_COPYABLE_AND_MOVABLE(unordered_map)
41
+ #endif
42
+ template <typename, typename, typename, typename, typename>
43
+ friend class unordered_multimap;
47
44
 
48
- public:
45
+ public:
46
+ typedef K key_type;
47
+ typedef std::pair<const K, T> value_type;
48
+ typedef T mapped_type;
49
+ typedef H hasher;
50
+ typedef P key_equal;
51
+ typedef A allocator_type;
49
52
 
50
- typedef K key_type;
51
- typedef std::pair<const K, T> value_type;
52
- typedef T mapped_type;
53
- typedef H hasher;
54
- typedef P key_equal;
55
- typedef A allocator_type;
53
+ private:
54
+ typedef boost::unordered::detail::map<A, K, T, H, P> types;
55
+ typedef typename types::value_allocator_traits value_allocator_traits;
56
+ typedef typename types::table table;
56
57
 
57
- private:
58
+ public:
59
+ typedef typename value_allocator_traits::pointer pointer;
60
+ typedef typename value_allocator_traits::const_pointer const_pointer;
58
61
 
59
- typedef boost::unordered::detail::map<A, K, T, H, P> types;
60
- typedef typename types::traits allocator_traits;
61
- typedef typename types::table table;
62
+ typedef value_type& reference;
63
+ typedef value_type const& const_reference;
62
64
 
63
- public:
65
+ typedef std::size_t size_type;
66
+ typedef std::ptrdiff_t difference_type;
64
67
 
65
- typedef typename allocator_traits::pointer pointer;
66
- typedef typename allocator_traits::const_pointer const_pointer;
68
+ typedef typename table::cl_iterator const_local_iterator;
69
+ typedef typename table::l_iterator local_iterator;
70
+ typedef typename table::c_iterator const_iterator;
71
+ typedef typename table::iterator iterator;
72
+ typedef typename types::node_type node_type;
73
+ typedef typename types::insert_return_type insert_return_type;
67
74
 
68
- typedef value_type& reference;
69
- typedef value_type const& const_reference;
75
+ private:
76
+ table table_;
70
77
 
71
- typedef std::size_t size_type;
72
- typedef std::ptrdiff_t difference_type;
78
+ public:
79
+ // constructors
73
80
 
74
- typedef typename table::cl_iterator const_local_iterator;
75
- typedef typename table::l_iterator local_iterator;
76
- typedef typename table::c_iterator const_iterator;
77
- typedef typename table::iterator iterator;
81
+ unordered_map();
78
82
 
79
- private:
83
+ explicit unordered_map(size_type, const hasher& = hasher(),
84
+ const key_equal& = key_equal(),
85
+ const allocator_type& = allocator_type());
80
86
 
81
- table table_;
87
+ explicit unordered_map(size_type, const allocator_type&);
82
88
 
83
- public:
89
+ explicit unordered_map(size_type, const hasher&, const allocator_type&);
84
90
 
85
- // constructors
91
+ explicit unordered_map(allocator_type const&);
86
92
 
87
- explicit unordered_map(
88
- size_type = boost::unordered::detail::default_bucket_count,
89
- const hasher& = hasher(),
90
- const key_equal& = key_equal(),
91
- const allocator_type& = allocator_type());
93
+ template <class InputIt> unordered_map(InputIt, InputIt);
92
94
 
93
- explicit unordered_map(allocator_type const&);
95
+ template <class InputIt>
96
+ unordered_map(InputIt, InputIt, size_type, const hasher& = hasher(),
97
+ const key_equal& = key_equal());
94
98
 
95
- template <class InputIt>
96
- unordered_map(InputIt, InputIt);
99
+ template <class InputIt>
100
+ unordered_map(InputIt, InputIt, size_type, const hasher&, const key_equal&,
101
+ const allocator_type&);
97
102
 
98
- template <class InputIt>
99
- unordered_map(
100
- InputIt, InputIt,
101
- size_type,
102
- const hasher& = hasher(),
103
- const key_equal& = key_equal());
103
+ template <class InputIt>
104
+ unordered_map(
105
+ InputIt, InputIt, size_type, const hasher&, const allocator_type&);
104
106
 
105
- template <class InputIt>
106
- unordered_map(
107
- InputIt, InputIt,
108
- size_type,
109
- const hasher&,
110
- const key_equal&,
111
- const allocator_type&);
107
+ template <class InputIt>
108
+ unordered_map(InputIt, InputIt, size_type, const allocator_type&);
112
109
 
113
- // copy/move constructors
110
+ // copy/move constructors
114
111
 
115
- unordered_map(unordered_map const&);
112
+ unordered_map(unordered_map const&);
116
113
 
117
- unordered_map(unordered_map const&, allocator_type const&);
114
+ unordered_map(unordered_map const&, allocator_type const&);
115
+ unordered_map(BOOST_RV_REF(unordered_map), allocator_type const&);
118
116
 
119
117
  #if defined(BOOST_UNORDERED_USE_MOVE)
120
- unordered_map(BOOST_RV_REF(unordered_map) other)
121
- BOOST_NOEXCEPT_IF(table::nothrow_move_constructible)
122
- : table_(other.table_, boost::unordered::detail::move_tag())
123
- {
124
- }
118
+ unordered_map(BOOST_RV_REF(unordered_map) other)
119
+ BOOST_NOEXCEPT_IF(table::nothrow_move_constructible)
120
+ : table_(other.table_, boost::unordered::detail::move_tag())
121
+ {
122
+ }
125
123
  #elif !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
126
- unordered_map(unordered_map&& other)
127
- BOOST_NOEXCEPT_IF(table::nothrow_move_constructible)
128
- : table_(other.table_, boost::unordered::detail::move_tag())
129
- {
130
- }
131
- #endif
132
-
133
- #if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
134
- unordered_map(unordered_map&&, allocator_type const&);
124
+ unordered_map(unordered_map&& other)
125
+ BOOST_NOEXCEPT_IF(table::nothrow_move_constructible)
126
+ : table_(other.table_, boost::unordered::detail::move_tag())
127
+ {
128
+ }
135
129
  #endif
136
130
 
137
131
  #if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
138
- unordered_map(
139
- std::initializer_list<value_type>,
140
- size_type = boost::unordered::detail::default_bucket_count,
141
- const hasher& = hasher(),
142
- const key_equal&l = key_equal(),
143
- const allocator_type& = allocator_type());
132
+ unordered_map(std::initializer_list<value_type>,
133
+ size_type = boost::unordered::detail::default_bucket_count,
134
+ const hasher& = hasher(), const key_equal& l = key_equal(),
135
+ const allocator_type& = allocator_type());
136
+ unordered_map(std::initializer_list<value_type>, size_type, const hasher&,
137
+ const allocator_type&);
138
+ unordered_map(
139
+ std::initializer_list<value_type>, size_type, const allocator_type&);
144
140
  #endif
145
141
 
146
- // Destructor
142
+ // Destructor
147
143
 
148
- ~unordered_map() BOOST_NOEXCEPT;
144
+ ~unordered_map() BOOST_NOEXCEPT;
149
145
 
150
- // Assign
146
+ // Assign
151
147
 
152
148
  #if defined(BOOST_UNORDERED_USE_MOVE)
153
- unordered_map& operator=(BOOST_COPY_ASSIGN_REF(unordered_map) x)
154
- {
155
- table_.assign(x.table_);
156
- return *this;
157
- }
149
+ unordered_map& operator=(BOOST_COPY_ASSIGN_REF(unordered_map) x)
150
+ {
151
+ table_.assign(x.table_);
152
+ return *this;
153
+ }
158
154
 
159
- unordered_map& operator=(BOOST_RV_REF(unordered_map) x)
160
- {
161
- table_.move_assign(x.table_);
162
- return *this;
163
- }
155
+ unordered_map& operator=(BOOST_RV_REF(unordered_map) x)
156
+ {
157
+ table_.move_assign(x.table_);
158
+ return *this;
159
+ }
164
160
  #else
165
- unordered_map& operator=(unordered_map const& x)
166
- {
167
- table_.assign(x.table_);
168
- return *this;
169
- }
161
+ unordered_map& operator=(unordered_map const& x)
162
+ {
163
+ table_.assign(x.table_);
164
+ return *this;
165
+ }
170
166
 
171
167
  #if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
172
- unordered_map& operator=(unordered_map&& x)
173
- {
174
- table_.move_assign(x.table_);
175
- return *this;
176
- }
168
+ unordered_map& operator=(unordered_map&& x)
169
+ {
170
+ table_.move_assign(x.table_);
171
+ return *this;
172
+ }
177
173
  #endif
178
174
  #endif
179
175
 
180
176
  #if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
181
- unordered_map& operator=(std::initializer_list<value_type>);
177
+ unordered_map& operator=(std::initializer_list<value_type>);
182
178
  #endif
183
179
 
184
- allocator_type get_allocator() const BOOST_NOEXCEPT
185
- {
186
- return table_.node_alloc();
187
- }
180
+ allocator_type get_allocator() const BOOST_NOEXCEPT
181
+ {
182
+ return table_.node_alloc();
183
+ }
188
184
 
189
- // size and capacity
185
+ // size and capacity
190
186
 
191
- bool empty() const BOOST_NOEXCEPT
192
- {
193
- return table_.size_ == 0;
194
- }
187
+ bool empty() const BOOST_NOEXCEPT { return table_.size_ == 0; }
195
188
 
196
- size_type size() const BOOST_NOEXCEPT
197
- {
198
- return table_.size_;
199
- }
189
+ size_type size() const BOOST_NOEXCEPT { return table_.size_; }
200
190
 
201
- size_type max_size() const BOOST_NOEXCEPT;
191
+ size_type max_size() const BOOST_NOEXCEPT;
202
192
 
203
- // iterators
193
+ // iterators
204
194
 
205
- iterator begin() BOOST_NOEXCEPT
206
- {
207
- return table_.begin();
208
- }
195
+ iterator begin() BOOST_NOEXCEPT { return iterator(table_.begin()); }
209
196
 
210
- const_iterator begin() const BOOST_NOEXCEPT
211
- {
212
- return table_.begin();
213
- }
197
+ const_iterator begin() const BOOST_NOEXCEPT
198
+ {
199
+ return const_iterator(table_.begin());
200
+ }
214
201
 
215
- iterator end() BOOST_NOEXCEPT
216
- {
217
- return iterator();
218
- }
202
+ iterator end() BOOST_NOEXCEPT { return iterator(); }
219
203
 
220
- const_iterator end() const BOOST_NOEXCEPT
221
- {
222
- return const_iterator();
223
- }
204
+ const_iterator end() const BOOST_NOEXCEPT { return const_iterator(); }
224
205
 
225
- const_iterator cbegin() const BOOST_NOEXCEPT
226
- {
227
- return table_.begin();
228
- }
206
+ const_iterator cbegin() const BOOST_NOEXCEPT
207
+ {
208
+ return const_iterator(table_.begin());
209
+ }
229
210
 
230
- const_iterator cend() const BOOST_NOEXCEPT
231
- {
232
- return const_iterator();
233
- }
211
+ const_iterator cend() const BOOST_NOEXCEPT { return const_iterator(); }
234
212
 
235
- // emplace
213
+ // extract
214
+
215
+ node_type extract(const_iterator position)
216
+ {
217
+ return node_type(
218
+ table_.extract_by_iterator(position), table_.node_alloc());
219
+ }
220
+
221
+ node_type extract(const key_type& k)
222
+ {
223
+ return node_type(table_.extract_by_key(k), table_.node_alloc());
224
+ }
225
+
226
+ // emplace
236
227
 
237
228
  #if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
238
- template <class... Args>
239
- std::pair<iterator, bool> emplace(BOOST_FWD_REF(Args)... args)
240
- {
241
- return table_.emplace(boost::forward<Args>(args)...);
242
- }
229
+ template <class... Args>
230
+ std::pair<iterator, bool> emplace(BOOST_FWD_REF(Args)... args)
231
+ {
232
+ return table_.emplace(boost::forward<Args>(args)...);
233
+ }
243
234
 
244
- template <class... Args>
245
- iterator emplace_hint(const_iterator, BOOST_FWD_REF(Args)... args)
246
- {
247
- return table_.emplace(boost::forward<Args>(args)...).first;
248
- }
235
+ template <class... Args>
236
+ iterator emplace_hint(const_iterator hint, BOOST_FWD_REF(Args)... args)
237
+ {
238
+ return table_.emplace_hint(hint, boost::forward<Args>(args)...);
239
+ }
240
+
241
+ template <class... Args>
242
+ std::pair<iterator, bool> try_emplace(
243
+ key_type const& k, BOOST_FWD_REF(Args)... args)
244
+ {
245
+ return table_.try_emplace_impl(k, boost::forward<Args>(args)...);
246
+ }
247
+
248
+ template <class... Args>
249
+ iterator try_emplace(
250
+ const_iterator hint, key_type const& k, BOOST_FWD_REF(Args)... args)
251
+ {
252
+ return table_.try_emplace_hint_impl(
253
+ hint, k, boost::forward<Args>(args)...);
254
+ }
255
+
256
+ template <class... Args>
257
+ std::pair<iterator, bool> try_emplace(
258
+ BOOST_RV_REF(key_type) k, BOOST_FWD_REF(Args)... args)
259
+ {
260
+ return table_.try_emplace_impl(
261
+ boost::move(k), boost::forward<Args>(args)...);
262
+ }
263
+
264
+ template <class... Args>
265
+ iterator try_emplace(const_iterator hint, BOOST_RV_REF(key_type) k,
266
+ BOOST_FWD_REF(Args)... args)
267
+ {
268
+ return table_.try_emplace_hint_impl(
269
+ hint, boost::move(k), boost::forward<Args>(args)...);
270
+ }
249
271
  #else
250
272
 
251
273
  #if !BOOST_WORKAROUND(__SUNPRO_CC, BOOST_TESTED_AT(0x5100))
252
274
 
253
- // 0 argument emplace requires special treatment in case
254
- // the container is instantiated with a value type that
255
- // doesn't have a default constructor.
275
+ // 0 argument emplace requires special treatment in case
276
+ // the container is instantiated with a value type that
277
+ // doesn't have a default constructor.
256
278
 
257
- std::pair<iterator, bool> emplace(
258
- boost::unordered::detail::empty_emplace
259
- = boost::unordered::detail::empty_emplace(),
260
- value_type v = value_type())
261
- {
262
- return this->emplace(boost::move(v));
263
- }
279
+ std::pair<iterator, bool> emplace(
280
+ boost::unordered::detail::empty_emplace =
281
+ boost::unordered::detail::empty_emplace(),
282
+ value_type v = value_type())
283
+ {
284
+ return this->emplace(boost::move(v));
285
+ }
264
286
 
265
- iterator emplace_hint(const_iterator hint,
266
- boost::unordered::detail::empty_emplace
267
- = boost::unordered::detail::empty_emplace(),
268
- value_type v = value_type()
269
- )
270
- {
271
- return this->emplace_hint(hint, boost::move(v));
272
- }
287
+ iterator emplace_hint(const_iterator hint,
288
+ boost::unordered::detail::empty_emplace =
289
+ boost::unordered::detail::empty_emplace(),
290
+ value_type v = value_type())
291
+ {
292
+ return this->emplace_hint(hint, boost::move(v));
293
+ }
273
294
 
274
295
  #endif
275
296
 
276
- template <typename A0>
277
- std::pair<iterator, bool> emplace(BOOST_FWD_REF(A0) a0)
278
- {
279
- return table_.emplace(
280
- boost::unordered::detail::create_emplace_args(
281
- boost::forward<A0>(a0))
282
- );
283
- }
297
+ template <typename Key>
298
+ std::pair<iterator, bool> try_emplace(BOOST_FWD_REF(Key) k)
299
+ {
300
+ return table_.try_emplace_impl(boost::forward<Key>(k));
301
+ }
284
302
 
285
- template <typename A0>
286
- iterator emplace_hint(const_iterator, BOOST_FWD_REF(A0) a0)
287
- {
288
- return table_.emplace(
289
- boost::unordered::detail::create_emplace_args(
290
- boost::forward<A0>(a0))
291
- ).first;
292
- }
303
+ template <typename Key>
304
+ iterator try_emplace(const_iterator hint, BOOST_FWD_REF(Key) k)
305
+ {
306
+ return table_.try_emplace_hint_impl(hint, boost::forward<Key>(k));
307
+ }
293
308
 
294
- template <typename A0, typename A1>
295
- std::pair<iterator, bool> emplace(
296
- BOOST_FWD_REF(A0) a0,
297
- BOOST_FWD_REF(A1) a1)
298
- {
299
- return table_.emplace(
300
- boost::unordered::detail::create_emplace_args(
301
- boost::forward<A0>(a0),
302
- boost::forward<A1>(a1))
303
- );
304
- }
309
+ template <typename A0>
310
+ std::pair<iterator, bool> emplace(BOOST_FWD_REF(A0) a0)
311
+ {
312
+ return table_.emplace(boost::unordered::detail::create_emplace_args(
313
+ boost::forward<A0>(a0)));
314
+ }
305
315
 
306
- template <typename A0, typename A1>
307
- iterator emplace_hint(const_iterator,
308
- BOOST_FWD_REF(A0) a0,
309
- BOOST_FWD_REF(A1) a1)
310
- {
311
- return table_.emplace(
312
- boost::unordered::detail::create_emplace_args(
313
- boost::forward<A0>(a0),
314
- boost::forward<A1>(a1))
315
- ).first;
316
- }
316
+ template <typename A0>
317
+ iterator emplace_hint(const_iterator hint, BOOST_FWD_REF(A0) a0)
318
+ {
319
+ return table_.emplace_hint(
320
+ hint, boost::unordered::detail::create_emplace_args(
321
+ boost::forward<A0>(a0)));
322
+ }
317
323
 
318
- template <typename A0, typename A1, typename A2>
319
- std::pair<iterator, bool> emplace(
320
- BOOST_FWD_REF(A0) a0,
321
- BOOST_FWD_REF(A1) a1,
322
- BOOST_FWD_REF(A2) a2)
323
- {
324
- return table_.emplace(
325
- boost::unordered::detail::create_emplace_args(
326
- boost::forward<A0>(a0),
327
- boost::forward<A1>(a1),
328
- boost::forward<A2>(a2))
329
- );
330
- }
324
+ template <typename A0>
325
+ std::pair<iterator, bool> try_emplace(
326
+ key_type const& k, BOOST_FWD_REF(A0) a0)
327
+ {
328
+ return table_.try_emplace_impl(
329
+ k, boost::unordered::detail::create_emplace_args(
330
+ boost::forward<A0>(a0)));
331
+ }
331
332
 
332
- template <typename A0, typename A1, typename A2>
333
- iterator emplace_hint(const_iterator,
334
- BOOST_FWD_REF(A0) a0,
335
- BOOST_FWD_REF(A1) a1,
336
- BOOST_FWD_REF(A2) a2)
337
- {
338
- return table_.emplace(
339
- boost::unordered::detail::create_emplace_args(
340
- boost::forward<A0>(a0),
341
- boost::forward<A1>(a1),
342
- boost::forward<A2>(a2))
343
- ).first;
344
- }
333
+ template <typename A0>
334
+ iterator try_emplace(
335
+ const_iterator hint, key_type const& k, BOOST_FWD_REF(A0) a0)
336
+ {
337
+ return table_.try_emplace_hint_impl(
338
+ hint, k, boost::unordered::detail::create_emplace_args(
339
+ boost::forward<A0>(a0)));
340
+ }
345
341
 
346
- #define BOOST_UNORDERED_EMPLACE(z, n, _) \
347
- template < \
348
- BOOST_PP_ENUM_PARAMS_Z(z, n, typename A) \
349
- > \
350
- std::pair<iterator, bool> emplace( \
351
- BOOST_PP_ENUM_##z(n, BOOST_UNORDERED_FWD_PARAM, a) \
352
- ) \
353
- { \
354
- return table_.emplace( \
355
- boost::unordered::detail::create_emplace_args( \
356
- BOOST_PP_ENUM_##z(n, BOOST_UNORDERED_CALL_FORWARD, \
357
- a) \
358
- )); \
359
- } \
360
- \
361
- template < \
362
- BOOST_PP_ENUM_PARAMS_Z(z, n, typename A) \
363
- > \
364
- iterator emplace_hint( \
365
- const_iterator, \
366
- BOOST_PP_ENUM_##z(n, BOOST_UNORDERED_FWD_PARAM, a) \
367
- ) \
368
- { \
369
- return table_.emplace( \
370
- boost::unordered::detail::create_emplace_args( \
371
- BOOST_PP_ENUM_##z(n, BOOST_UNORDERED_CALL_FORWARD, \
372
- a) \
373
- )).first; \
374
- }
342
+ template <typename A0>
343
+ std::pair<iterator, bool> try_emplace(
344
+ BOOST_RV_REF(key_type) k, BOOST_FWD_REF(A0) a0)
345
+ {
346
+ return table_.try_emplace_impl(
347
+ boost::move(k), boost::unordered::detail::create_emplace_args(
348
+ boost::forward<A0>(a0)));
349
+ }
350
+
351
+ template <typename A0>
352
+ iterator try_emplace(
353
+ const_iterator hint, BOOST_RV_REF(key_type) k, BOOST_FWD_REF(A0) a0)
354
+ {
355
+ return table_.try_emplace_hint_impl(
356
+ hint, boost::move(k), boost::unordered::detail::create_emplace_args(
357
+ boost::forward<A0>(a0)));
358
+ }
359
+
360
+ template <typename A0, typename A1>
361
+ std::pair<iterator, bool> emplace(
362
+ BOOST_FWD_REF(A0) a0, BOOST_FWD_REF(A1) a1)
363
+ {
364
+ return table_.emplace(boost::unordered::detail::create_emplace_args(
365
+ boost::forward<A0>(a0), boost::forward<A1>(a1)));
366
+ }
367
+
368
+ template <typename A0, typename A1>
369
+ iterator emplace_hint(
370
+ const_iterator hint, BOOST_FWD_REF(A0) a0, BOOST_FWD_REF(A1) a1)
371
+ {
372
+ return table_.emplace_hint(
373
+ hint, boost::unordered::detail::create_emplace_args(
374
+ boost::forward<A0>(a0), boost::forward<A1>(a1)));
375
+ }
376
+
377
+ template <typename A0, typename A1>
378
+ std::pair<iterator, bool> try_emplace(
379
+ key_type const& k, BOOST_FWD_REF(A0) a0, BOOST_FWD_REF(A1) a1)
380
+ {
381
+ return table_.try_emplace_impl(
382
+ k, boost::unordered::detail::create_emplace_args(
383
+ boost::forward<A0>(a0), boost::forward<A1>(a1)));
384
+ }
375
385
 
376
- BOOST_PP_REPEAT_FROM_TO(4, BOOST_UNORDERED_EMPLACE_LIMIT,
377
- BOOST_UNORDERED_EMPLACE, _)
386
+ template <typename A0, typename A1>
387
+ iterator try_emplace(const_iterator hint, key_type const& k,
388
+ BOOST_FWD_REF(A0) a0, BOOST_FWD_REF(A1) a1)
389
+ {
390
+ return table_.try_emplace_hint_impl(
391
+ hint, k, boost::unordered::detail::create_emplace_args(
392
+ boost::forward<A0>(a0), boost::forward<A1>(a1)));
393
+ }
394
+
395
+ template <typename A0, typename A1>
396
+ std::pair<iterator, bool> try_emplace(
397
+ BOOST_RV_REF(key_type) k, BOOST_FWD_REF(A0) a0, BOOST_FWD_REF(A1) a1)
398
+ {
399
+ return table_.try_emplace_impl(
400
+ boost::move(k),
401
+ boost::unordered::detail::create_emplace_args(
402
+ boost::forward<A0>(a0), boost::forward<A1>(a1)));
403
+ }
404
+
405
+ template <typename A0, typename A1>
406
+ iterator try_emplace(const_iterator hint, BOOST_RV_REF(key_type) k,
407
+ BOOST_FWD_REF(A0) a0, BOOST_FWD_REF(A1) a1)
408
+ {
409
+ return table_.try_emplace_hint_impl(
410
+ hint, boost::move(k),
411
+ boost::unordered::detail::create_emplace_args(
412
+ boost::forward<A0>(a0), boost::forward<A1>(a1)));
413
+ }
414
+
415
+ template <typename A0, typename A1, typename A2>
416
+ std::pair<iterator, bool> emplace(
417
+ BOOST_FWD_REF(A0) a0, BOOST_FWD_REF(A1) a1, BOOST_FWD_REF(A2) a2)
418
+ {
419
+ return table_.emplace(boost::unordered::detail::create_emplace_args(
420
+ boost::forward<A0>(a0), boost::forward<A1>(a1),
421
+ boost::forward<A2>(a2)));
422
+ }
423
+
424
+ template <typename A0, typename A1, typename A2>
425
+ iterator emplace_hint(const_iterator hint, BOOST_FWD_REF(A0) a0,
426
+ BOOST_FWD_REF(A1) a1, BOOST_FWD_REF(A2) a2)
427
+ {
428
+ return table_.emplace_hint(
429
+ hint, boost::unordered::detail::create_emplace_args(
430
+ boost::forward<A0>(a0), boost::forward<A1>(a1),
431
+ boost::forward<A2>(a2)));
432
+ }
433
+
434
+ template <typename A0, typename A1, typename A2>
435
+ std::pair<iterator, bool> try_emplace(key_type const& k,
436
+ BOOST_FWD_REF(A0) a0, BOOST_FWD_REF(A1) a1, BOOST_FWD_REF(A2) a2)
437
+ {
438
+ return table_.try_emplace_impl(
439
+ k, boost::unordered::detail::create_emplace_args(
440
+ boost::forward<A0>(a0), boost::forward<A1>(a1),
441
+ boost::forward<A2>(a2)));
442
+ }
443
+
444
+ template <typename A0, typename A1, typename A2>
445
+ iterator try_emplace(const_iterator hint, key_type const& k,
446
+ BOOST_FWD_REF(A0) a0, BOOST_FWD_REF(A1) a1, BOOST_FWD_REF(A2) a2)
447
+ {
448
+ return table_
449
+ .try_emplace_impl_(
450
+ hint, k, boost::unordered::detail::create_emplace_args(
451
+ boost::forward<A0>(a0), boost::forward<A1>(a1),
452
+ boost::forward<A2>(a2)))
453
+ .first;
454
+ }
455
+
456
+ template <typename A0, typename A1, typename A2>
457
+ std::pair<iterator, bool> try_emplace(BOOST_RV_REF(key_type) k,
458
+ BOOST_FWD_REF(A0) a0, BOOST_FWD_REF(A1) a1, BOOST_FWD_REF(A2) a2)
459
+ {
460
+ return table_.try_emplace_impl(
461
+ boost::move(k), boost::unordered::detail::create_emplace_args(
462
+ boost::forward<A0>(a0), boost::forward<A1>(a1),
463
+ boost::forward<A2>(a2)));
464
+ }
465
+
466
+ template <typename A0, typename A1, typename A2>
467
+ iterator try_emplace(const_iterator hint, BOOST_RV_REF(key_type) k,
468
+ BOOST_FWD_REF(A0) a0, BOOST_FWD_REF(A1) a1, BOOST_FWD_REF(A2) a2)
469
+ {
470
+ return table_.try_emplace_hint_impl(
471
+ hint, boost::move(k),
472
+ boost::unordered::detail::create_emplace_args(
473
+ boost::forward<A0>(a0), boost::forward<A1>(a1),
474
+ boost::forward<A2>(a2)));
475
+ }
476
+
477
+ #define BOOST_UNORDERED_EMPLACE(z, n, _) \
478
+ template <BOOST_PP_ENUM_PARAMS_Z(z, n, typename A)> \
479
+ std::pair<iterator, bool> emplace( \
480
+ BOOST_PP_ENUM_##z(n, BOOST_UNORDERED_FWD_PARAM, a)) \
481
+ { \
482
+ return table_.emplace(boost::unordered::detail::create_emplace_args( \
483
+ BOOST_PP_ENUM_##z(n, BOOST_UNORDERED_CALL_FORWARD, a))); \
484
+ } \
485
+ \
486
+ template <BOOST_PP_ENUM_PARAMS_Z(z, n, typename A)> \
487
+ iterator emplace_hint(const_iterator hint, \
488
+ BOOST_PP_ENUM_##z(n, BOOST_UNORDERED_FWD_PARAM, a)) \
489
+ { \
490
+ return table_.emplace_hint( \
491
+ hint, boost::unordered::detail::create_emplace_args( \
492
+ BOOST_PP_ENUM_##z(n, BOOST_UNORDERED_CALL_FORWARD, a))); \
493
+ } \
494
+ \
495
+ template <BOOST_PP_ENUM_PARAMS_Z(z, n, typename A)> \
496
+ std::pair<iterator, bool> try_emplace( \
497
+ key_type const& k, BOOST_PP_ENUM_##z(n, BOOST_UNORDERED_FWD_PARAM, a)) \
498
+ { \
499
+ return table_.try_emplace_impl( \
500
+ k, boost::unordered::detail::create_emplace_args( \
501
+ BOOST_PP_ENUM_##z(n, BOOST_UNORDERED_CALL_FORWARD, a))); \
502
+ } \
503
+ \
504
+ template <BOOST_PP_ENUM_PARAMS_Z(z, n, typename A)> \
505
+ iterator try_emplace(const_iterator hint, key_type const& k, \
506
+ BOOST_PP_ENUM_##z(n, BOOST_UNORDERED_FWD_PARAM, a)) \
507
+ { \
508
+ return table_.try_emplace_hint_impl(hint, k, \
509
+ boost::unordered::detail::create_emplace_args(BOOST_PP_ENUM_##z( \
510
+ n, BOOST_UNORDERED_CALL_FORWARD, a))); \
511
+ } \
512
+ \
513
+ template <BOOST_PP_ENUM_PARAMS_Z(z, n, typename A)> \
514
+ std::pair<iterator, bool> try_emplace(BOOST_RV_REF(key_type) k, \
515
+ BOOST_PP_ENUM_##z(n, BOOST_UNORDERED_FWD_PARAM, a)) \
516
+ { \
517
+ return table_.try_emplace_impl(boost::move(k), \
518
+ boost::unordered::detail::create_emplace_args(BOOST_PP_ENUM_##z( \
519
+ n, BOOST_UNORDERED_CALL_FORWARD, a))); \
520
+ } \
521
+ \
522
+ template <BOOST_PP_ENUM_PARAMS_Z(z, n, typename A)> \
523
+ iterator try_emplace(const_iterator hint, BOOST_RV_REF(key_type) k, \
524
+ BOOST_PP_ENUM_##z(n, BOOST_UNORDERED_FWD_PARAM, a)) \
525
+ { \
526
+ return table_.try_emplace_hint_impl(hint, boost::move(k), \
527
+ boost::unordered::detail::create_emplace_args(BOOST_PP_ENUM_##z( \
528
+ n, BOOST_UNORDERED_CALL_FORWARD, a))); \
529
+ }
530
+
531
+ BOOST_PP_REPEAT_FROM_TO(
532
+ 4, BOOST_UNORDERED_EMPLACE_LIMIT, BOOST_UNORDERED_EMPLACE, _)
378
533
 
379
534
  #undef BOOST_UNORDERED_EMPLACE
380
535
 
381
536
  #endif
382
537
 
383
- std::pair<iterator, bool> insert(value_type const& x)
384
- {
385
- return this->emplace(x);
386
- }
538
+ std::pair<iterator, bool> insert(value_type const& x)
539
+ {
540
+ return this->emplace(x);
541
+ }
387
542
 
388
- std::pair<iterator, bool> insert(BOOST_RV_REF(value_type) x)
389
- {
390
- return this->emplace(boost::move(x));
391
- }
543
+ std::pair<iterator, bool> insert(BOOST_RV_REF(value_type) x)
544
+ {
545
+ return this->emplace(boost::move(x));
546
+ }
392
547
 
393
- iterator insert(const_iterator hint, value_type const& x)
394
- {
395
- return this->emplace_hint(hint, x);
396
- }
548
+ iterator insert(const_iterator hint, value_type const& x)
549
+ {
550
+ return this->emplace_hint(hint, x);
551
+ }
397
552
 
398
- iterator insert(const_iterator hint, BOOST_RV_REF(value_type) x)
399
- {
400
- return this->emplace_hint(hint, boost::move(x));
401
- }
553
+ iterator insert(const_iterator hint, BOOST_RV_REF(value_type) x)
554
+ {
555
+ return this->emplace_hint(hint, boost::move(x));
556
+ }
557
+
558
+ template <class M>
559
+ std::pair<iterator, bool> insert_or_assign(
560
+ key_type const& k, BOOST_FWD_REF(M) obj)
561
+ {
562
+ return table_.insert_or_assign_impl(k, boost::forward<M>(obj));
563
+ }
564
+
565
+ template <class M>
566
+ iterator insert_or_assign(
567
+ const_iterator, key_type const& k, BOOST_FWD_REF(M) obj)
568
+ {
569
+ return table_.insert_or_assign_impl(k, boost::forward<M>(obj)).first;
570
+ }
571
+
572
+ template <class M>
573
+ std::pair<iterator, bool> insert_or_assign(
574
+ BOOST_RV_REF(key_type) k, BOOST_FWD_REF(M) obj)
575
+ {
576
+ return table_.insert_or_assign_impl(
577
+ boost::move(k), boost::forward<M>(obj));
578
+ }
402
579
 
403
- template <class InputIt> void insert(InputIt, InputIt);
580
+ template <class M>
581
+ iterator insert_or_assign(
582
+ const_iterator, BOOST_RV_REF(key_type) k, BOOST_FWD_REF(M) obj)
583
+ {
584
+ return table_
585
+ .insert_or_assign_impl(boost::move(k), boost::forward<M>(obj))
586
+ .first;
587
+ }
588
+
589
+ template <class InputIt> void insert(InputIt, InputIt);
404
590
 
405
591
  #if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
406
- void insert(std::initializer_list<value_type>);
592
+ void insert(std::initializer_list<value_type>);
407
593
  #endif
408
594
 
409
- iterator erase(const_iterator);
410
- size_type erase(const key_type&);
411
- iterator erase(const_iterator, const_iterator);
412
- void quick_erase(const_iterator it) { erase(it); }
413
- void erase_return_void(const_iterator it) { erase(it); }
595
+ insert_return_type insert(BOOST_RV_REF(node_type) np)
596
+ {
597
+ insert_return_type result;
598
+ table_.move_insert_node_type(np, result);
599
+ return boost::move(result);
600
+ }
414
601
 
415
- void clear();
416
- void swap(unordered_map&);
602
+ iterator insert(const_iterator hint, BOOST_RV_REF(node_type) np)
603
+ {
604
+ return table_.move_insert_node_type_with_hint(hint, np);
605
+ }
417
606
 
418
- // observers
607
+ #if defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
608
+ private:
609
+ // Note: Use r-value node_type to insert.
610
+ insert_return_type insert(node_type&);
611
+ iterator insert(const_iterator, node_type& np);
419
612
 
420
- hasher hash_function() const;
421
- key_equal key_eq() const;
613
+ public:
614
+ #endif
422
615
 
423
- mapped_type& operator[](const key_type&);
424
- mapped_type& at(const key_type&);
425
- mapped_type const& at(const key_type&) const;
616
+ iterator erase(const_iterator);
617
+ size_type erase(const key_type&);
618
+ iterator erase(const_iterator, const_iterator);
619
+ void quick_erase(const_iterator it) { erase(it); }
620
+ void erase_return_void(const_iterator it) { erase(it); }
426
621
 
427
- // lookup
622
+ void clear();
623
+ void swap(unordered_map&);
428
624
 
429
- iterator find(const key_type&);
430
- const_iterator find(const key_type&) const;
625
+ template <typename H2, typename P2>
626
+ void merge(boost::unordered_map<K, T, H2, P2, A>& source);
431
627
 
432
- template <class CompatibleKey, class CompatibleHash,
433
- class CompatiblePredicate>
434
- iterator find(
435
- CompatibleKey const&,
436
- CompatibleHash const&,
437
- CompatiblePredicate const&);
628
+ #if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
629
+ template <typename H2, typename P2>
630
+ void merge(boost::unordered_map<K, T, H2, P2, A>&& source);
631
+ #endif
438
632
 
439
- template <class CompatibleKey, class CompatibleHash,
440
- class CompatiblePredicate>
441
- const_iterator find(
442
- CompatibleKey const&,
443
- CompatibleHash const&,
444
- CompatiblePredicate const&) const;
633
+ #if BOOST_UNORDERED_INTEROPERABLE_NODES
634
+ template <typename H2, typename P2>
635
+ void merge(boost::unordered_multimap<K, T, H2, P2, A>& source);
445
636
 
446
- size_type count(const key_type&) const;
637
+ #if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
638
+ template <typename H2, typename P2>
639
+ void merge(boost::unordered_multimap<K, T, H2, P2, A>&& source);
640
+ #endif
641
+ #endif
447
642
 
448
- std::pair<iterator, iterator>
449
- equal_range(const key_type&);
450
- std::pair<const_iterator, const_iterator>
451
- equal_range(const key_type&) const;
643
+ // observers
452
644
 
453
- // bucket interface
645
+ hasher hash_function() const;
646
+ key_equal key_eq() const;
454
647
 
455
- size_type bucket_count() const BOOST_NOEXCEPT
456
- {
457
- return table_.bucket_count_;
458
- }
648
+ mapped_type& operator[](const key_type&);
649
+ mapped_type& at(const key_type&);
650
+ mapped_type const& at(const key_type&) const;
459
651
 
460
- size_type max_bucket_count() const BOOST_NOEXCEPT
461
- {
462
- return table_.max_bucket_count();
463
- }
652
+ // lookup
464
653
 
465
- size_type bucket_size(size_type) const;
654
+ iterator find(const key_type&);
655
+ const_iterator find(const key_type&) const;
466
656
 
467
- size_type bucket(const key_type& k) const
468
- {
469
- return table_.hash_to_bucket(table_.hash(k));
470
- }
657
+ template <class CompatibleKey, class CompatibleHash,
658
+ class CompatiblePredicate>
659
+ iterator find(CompatibleKey const&, CompatibleHash const&,
660
+ CompatiblePredicate const&);
471
661
 
472
- local_iterator begin(size_type n)
473
- {
474
- return local_iterator(
475
- table_.begin(n), n, table_.bucket_count_);
476
- }
662
+ template <class CompatibleKey, class CompatibleHash,
663
+ class CompatiblePredicate>
664
+ const_iterator find(CompatibleKey const&, CompatibleHash const&,
665
+ CompatiblePredicate const&) const;
477
666
 
478
- const_local_iterator begin(size_type n) const
479
- {
480
- return const_local_iterator(
481
- table_.begin(n), n, table_.bucket_count_);
482
- }
667
+ size_type count(const key_type&) const;
483
668
 
484
- local_iterator end(size_type)
485
- {
486
- return local_iterator();
487
- }
669
+ std::pair<iterator, iterator> equal_range(const key_type&);
670
+ std::pair<const_iterator, const_iterator> equal_range(
671
+ const key_type&) const;
488
672
 
489
- const_local_iterator end(size_type) const
490
- {
491
- return const_local_iterator();
492
- }
673
+ // bucket interface
493
674
 
494
- const_local_iterator cbegin(size_type n) const
495
- {
496
- return const_local_iterator(
497
- table_.begin(n), n, table_.bucket_count_);
498
- }
675
+ size_type bucket_count() const BOOST_NOEXCEPT
676
+ {
677
+ return table_.bucket_count_;
678
+ }
499
679
 
500
- const_local_iterator cend(size_type) const
501
- {
502
- return const_local_iterator();
503
- }
680
+ size_type max_bucket_count() const BOOST_NOEXCEPT
681
+ {
682
+ return table_.max_bucket_count();
683
+ }
504
684
 
505
- // hash policy
685
+ size_type bucket_size(size_type) const;
506
686
 
507
- float max_load_factor() const BOOST_NOEXCEPT
508
- {
509
- return table_.mlf_;
510
- }
687
+ size_type bucket(const key_type& k) const
688
+ {
689
+ return table_.hash_to_bucket(table_.hash(k));
690
+ }
691
+
692
+ local_iterator begin(size_type n)
693
+ {
694
+ return local_iterator(table_.begin(n), n, table_.bucket_count_);
695
+ }
696
+
697
+ const_local_iterator begin(size_type n) const
698
+ {
699
+ return const_local_iterator(table_.begin(n), n, table_.bucket_count_);
700
+ }
701
+
702
+ local_iterator end(size_type) { return local_iterator(); }
703
+
704
+ const_local_iterator end(size_type) const { return const_local_iterator(); }
705
+
706
+ const_local_iterator cbegin(size_type n) const
707
+ {
708
+ return const_local_iterator(table_.begin(n), n, table_.bucket_count_);
709
+ }
710
+
711
+ const_local_iterator cend(size_type) const
712
+ {
713
+ return const_local_iterator();
714
+ }
715
+
716
+ // hash policy
717
+
718
+ float max_load_factor() const BOOST_NOEXCEPT { return table_.mlf_; }
511
719
 
512
- float load_factor() const BOOST_NOEXCEPT;
513
- void max_load_factor(float) BOOST_NOEXCEPT;
514
- void rehash(size_type);
515
- void reserve(size_type);
720
+ float load_factor() const BOOST_NOEXCEPT;
721
+ void max_load_factor(float) BOOST_NOEXCEPT;
722
+ void rehash(size_type);
723
+ void reserve(size_type);
516
724
 
517
725
  #if !BOOST_WORKAROUND(__BORLANDC__, < 0x0582)
518
- friend bool operator==<K,T,H,P,A>(
519
- unordered_map const&, unordered_map const&);
520
- friend bool operator!=<K,T,H,P,A>(
521
- unordered_map const&, unordered_map const&);
726
+ friend bool operator==
727
+ <K, T, H, P, A>(unordered_map const&, unordered_map const&);
728
+ friend bool operator!=
729
+ <K, T, H, P, A>(unordered_map const&, unordered_map const&);
522
730
  #endif
523
- }; // class template unordered_map
731
+ }; // class template unordered_map
524
732
 
525
- template <class K, class T, class H, class P, class A>
526
- class unordered_multimap
527
- {
733
+ template <class K, class T, class H, class P, class A> class unordered_multimap
734
+ {
528
735
  #if defined(BOOST_UNORDERED_USE_MOVE)
529
- BOOST_COPYABLE_AND_MOVABLE(unordered_multimap)
736
+ BOOST_COPYABLE_AND_MOVABLE(unordered_multimap)
530
737
  #endif
531
- public:
738
+ template <typename, typename, typename, typename, typename>
739
+ friend class unordered_map;
740
+
741
+ public:
742
+ typedef K key_type;
743
+ typedef std::pair<const K, T> value_type;
744
+ typedef T mapped_type;
745
+ typedef H hasher;
746
+ typedef P key_equal;
747
+ typedef A allocator_type;
748
+
749
+ private:
750
+ typedef boost::unordered::detail::multimap<A, K, T, H, P> types;
751
+ typedef typename types::value_allocator_traits value_allocator_traits;
752
+ typedef typename types::table table;
532
753
 
533
- typedef K key_type;
534
- typedef std::pair<const K, T> value_type;
535
- typedef T mapped_type;
536
- typedef H hasher;
537
- typedef P key_equal;
538
- typedef A allocator_type;
754
+ public:
755
+ typedef typename value_allocator_traits::pointer pointer;
756
+ typedef typename value_allocator_traits::const_pointer const_pointer;
539
757
 
540
- private:
758
+ typedef value_type& reference;
759
+ typedef value_type const& const_reference;
541
760
 
542
- typedef boost::unordered::detail::multimap<A, K, T, H, P> types;
543
- typedef typename types::traits allocator_traits;
544
- typedef typename types::table table;
761
+ typedef std::size_t size_type;
762
+ typedef std::ptrdiff_t difference_type;
545
763
 
546
- public:
764
+ typedef typename table::cl_iterator const_local_iterator;
765
+ typedef typename table::l_iterator local_iterator;
766
+ typedef typename table::c_iterator const_iterator;
767
+ typedef typename table::iterator iterator;
768
+ typedef typename types::node_type node_type;
547
769
 
548
- typedef typename allocator_traits::pointer pointer;
549
- typedef typename allocator_traits::const_pointer const_pointer;
770
+ private:
771
+ table table_;
550
772
 
551
- typedef value_type& reference;
552
- typedef value_type const& const_reference;
773
+ public:
774
+ // constructors
553
775
 
554
- typedef std::size_t size_type;
555
- typedef std::ptrdiff_t difference_type;
776
+ unordered_multimap();
556
777
 
557
- typedef typename table::cl_iterator const_local_iterator;
558
- typedef typename table::l_iterator local_iterator;
559
- typedef typename table::c_iterator const_iterator;
560
- typedef typename table::iterator iterator;
778
+ explicit unordered_multimap(size_type, const hasher& = hasher(),
779
+ const key_equal& = key_equal(),
780
+ const allocator_type& = allocator_type());
561
781
 
562
- private:
782
+ explicit unordered_multimap(size_type, const allocator_type&);
563
783
 
564
- table table_;
565
-
566
- public:
784
+ explicit unordered_multimap(
785
+ size_type, const hasher&, const allocator_type&);
567
786
 
568
- // constructors
787
+ explicit unordered_multimap(allocator_type const&);
569
788
 
570
- explicit unordered_multimap(
571
- size_type = boost::unordered::detail::default_bucket_count,
572
- const hasher& = hasher(),
573
- const key_equal& = key_equal(),
574
- const allocator_type& = allocator_type());
789
+ template <class InputIt> unordered_multimap(InputIt, InputIt);
575
790
 
576
- explicit unordered_multimap(allocator_type const&);
791
+ template <class InputIt>
792
+ unordered_multimap(InputIt, InputIt, size_type, const hasher& = hasher(),
793
+ const key_equal& = key_equal());
577
794
 
578
- template <class InputIt>
579
- unordered_multimap(InputIt, InputIt);
795
+ template <class InputIt>
796
+ unordered_multimap(InputIt, InputIt, size_type, const hasher&,
797
+ const key_equal&, const allocator_type&);
580
798
 
581
- template <class InputIt>
582
- unordered_multimap(
583
- InputIt, InputIt,
584
- size_type,
585
- const hasher& = hasher(),
586
- const key_equal& = key_equal());
799
+ template <class InputIt>
800
+ unordered_multimap(
801
+ InputIt, InputIt, size_type, const hasher&, const allocator_type&);
587
802
 
588
- template <class InputIt>
589
- unordered_multimap(
590
- InputIt, InputIt,
591
- size_type,
592
- const hasher&,
593
- const key_equal&,
594
- const allocator_type&);
803
+ template <class InputIt>
804
+ unordered_multimap(InputIt, InputIt, size_type, const allocator_type&);
595
805
 
596
- // copy/move constructors
806
+ // copy/move constructors
597
807
 
598
- unordered_multimap(unordered_multimap const&);
808
+ unordered_multimap(unordered_multimap const&);
599
809
 
600
- unordered_multimap(unordered_multimap const&, allocator_type const&);
810
+ unordered_multimap(unordered_multimap const&, allocator_type const&);
811
+ unordered_multimap(BOOST_RV_REF(unordered_multimap), allocator_type const&);
601
812
 
602
813
  #if defined(BOOST_UNORDERED_USE_MOVE)
603
- unordered_multimap(BOOST_RV_REF(unordered_multimap) other)
604
- BOOST_NOEXCEPT_IF(table::nothrow_move_constructible)
605
- : table_(other.table_, boost::unordered::detail::move_tag())
606
- {
607
- }
814
+ unordered_multimap(BOOST_RV_REF(unordered_multimap) other)
815
+ BOOST_NOEXCEPT_IF(table::nothrow_move_constructible)
816
+ : table_(other.table_, boost::unordered::detail::move_tag())
817
+ {
818
+ }
608
819
  #elif !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
609
- unordered_multimap(unordered_multimap&& other)
610
- BOOST_NOEXCEPT_IF(table::nothrow_move_constructible)
611
- : table_(other.table_, boost::unordered::detail::move_tag())
612
- {
613
- }
614
- #endif
615
-
616
- #if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
617
- unordered_multimap(unordered_multimap&&, allocator_type const&);
820
+ unordered_multimap(unordered_multimap&& other)
821
+ BOOST_NOEXCEPT_IF(table::nothrow_move_constructible)
822
+ : table_(other.table_, boost::unordered::detail::move_tag())
823
+ {
824
+ }
618
825
  #endif
619
826
 
620
827
  #if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
621
- unordered_multimap(
622
- std::initializer_list<value_type>,
623
- size_type = boost::unordered::detail::default_bucket_count,
624
- const hasher& = hasher(),
625
- const key_equal&l = key_equal(),
626
- const allocator_type& = allocator_type());
828
+ unordered_multimap(std::initializer_list<value_type>,
829
+ size_type = boost::unordered::detail::default_bucket_count,
830
+ const hasher& = hasher(), const key_equal& l = key_equal(),
831
+ const allocator_type& = allocator_type());
832
+ unordered_multimap(std::initializer_list<value_type>, size_type,
833
+ const hasher&, const allocator_type&);
834
+ unordered_multimap(
835
+ std::initializer_list<value_type>, size_type, const allocator_type&);
627
836
  #endif
628
837
 
629
- // Destructor
838
+ // Destructor
630
839
 
631
- ~unordered_multimap() BOOST_NOEXCEPT;
840
+ ~unordered_multimap() BOOST_NOEXCEPT;
632
841
 
633
- // Assign
842
+ // Assign
634
843
 
635
844
  #if defined(BOOST_UNORDERED_USE_MOVE)
636
- unordered_multimap& operator=(
637
- BOOST_COPY_ASSIGN_REF(unordered_multimap) x)
638
- {
639
- table_.assign(x.table_);
640
- return *this;
641
- }
845
+ unordered_multimap& operator=(BOOST_COPY_ASSIGN_REF(unordered_multimap) x)
846
+ {
847
+ table_.assign(x.table_);
848
+ return *this;
849
+ }
642
850
 
643
- unordered_multimap& operator=(BOOST_RV_REF(unordered_multimap) x)
644
- {
645
- table_.move_assign(x.table_);
646
- return *this;
647
- }
851
+ unordered_multimap& operator=(BOOST_RV_REF(unordered_multimap) x)
852
+ {
853
+ table_.move_assign(x.table_);
854
+ return *this;
855
+ }
648
856
  #else
649
- unordered_multimap& operator=(unordered_multimap const& x)
650
- {
651
- table_.assign(x.table_);
652
- return *this;
653
- }
857
+ unordered_multimap& operator=(unordered_multimap const& x)
858
+ {
859
+ table_.assign(x.table_);
860
+ return *this;
861
+ }
654
862
 
655
863
  #if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
656
- unordered_multimap& operator=(unordered_multimap&& x)
657
- {
658
- table_.move_assign(x.table_);
659
- return *this;
660
- }
864
+ unordered_multimap& operator=(unordered_multimap&& x)
865
+ {
866
+ table_.move_assign(x.table_);
867
+ return *this;
868
+ }
661
869
  #endif
662
870
  #endif
663
871
 
664
872
  #if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
665
- unordered_multimap& operator=(std::initializer_list<value_type>);
873
+ unordered_multimap& operator=(std::initializer_list<value_type>);
666
874
  #endif
667
875
 
668
- allocator_type get_allocator() const BOOST_NOEXCEPT
669
- {
670
- return table_.node_alloc();
671
- }
672
-
673
- // size and capacity
876
+ allocator_type get_allocator() const BOOST_NOEXCEPT
877
+ {
878
+ return table_.node_alloc();
879
+ }
674
880
 
675
- bool empty() const BOOST_NOEXCEPT
676
- {
677
- return table_.size_ == 0;
678
- }
881
+ // size and capacity
679
882
 
680
- size_type size() const BOOST_NOEXCEPT
681
- {
682
- return table_.size_;
683
- }
883
+ bool empty() const BOOST_NOEXCEPT { return table_.size_ == 0; }
684
884
 
685
- size_type max_size() const BOOST_NOEXCEPT;
885
+ size_type size() const BOOST_NOEXCEPT { return table_.size_; }
686
886
 
687
- // iterators
887
+ size_type max_size() const BOOST_NOEXCEPT;
688
888
 
689
- iterator begin() BOOST_NOEXCEPT
690
- {
691
- return table_.begin();
692
- }
889
+ // iterators
693
890
 
694
- const_iterator begin() const BOOST_NOEXCEPT
695
- {
696
- return table_.begin();
697
- }
891
+ iterator begin() BOOST_NOEXCEPT { return iterator(table_.begin()); }
698
892
 
699
- iterator end() BOOST_NOEXCEPT
700
- {
701
- return iterator();
702
- }
893
+ const_iterator begin() const BOOST_NOEXCEPT
894
+ {
895
+ return const_iterator(table_.begin());
896
+ }
703
897
 
704
- const_iterator end() const BOOST_NOEXCEPT
705
- {
706
- return const_iterator();
707
- }
898
+ iterator end() BOOST_NOEXCEPT { return iterator(); }
708
899
 
709
- const_iterator cbegin() const BOOST_NOEXCEPT
710
- {
711
- return table_.begin();
712
- }
900
+ const_iterator end() const BOOST_NOEXCEPT { return const_iterator(); }
713
901
 
714
- const_iterator cend() const BOOST_NOEXCEPT
715
- {
716
- return const_iterator();
717
- }
902
+ const_iterator cbegin() const BOOST_NOEXCEPT
903
+ {
904
+ return const_iterator(table_.begin());
905
+ }
718
906
 
719
- // emplace
907
+ const_iterator cend() const BOOST_NOEXCEPT { return const_iterator(); }
720
908
 
721
- #if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
722
- template <class... Args>
723
- iterator emplace(BOOST_FWD_REF(Args)... args)
724
- {
725
- return table_.emplace(boost::forward<Args>(args)...);
726
- }
909
+ // extract
727
910
 
728
- template <class... Args>
729
- iterator emplace_hint(const_iterator, BOOST_FWD_REF(Args)... args)
730
- {
731
- return table_.emplace(boost::forward<Args>(args)...);
732
- }
733
- #else
911
+ node_type extract(const_iterator position)
912
+ {
913
+ return node_type(
914
+ table_.extract_by_iterator(position), table_.node_alloc());
915
+ }
734
916
 
735
- #if !BOOST_WORKAROUND(__SUNPRO_CC, BOOST_TESTED_AT(0x5100))
917
+ node_type extract(const key_type& k)
918
+ {
919
+ return node_type(table_.extract_by_key(k), table_.node_alloc());
920
+ }
736
921
 
737
- // 0 argument emplace requires special treatment in case
738
- // the container is instantiated with a value type that
739
- // doesn't have a default constructor.
922
+ // emplace
740
923
 
741
- iterator emplace(
742
- boost::unordered::detail::empty_emplace
743
- = boost::unordered::detail::empty_emplace(),
744
- value_type v = value_type())
745
- {
746
- return this->emplace(boost::move(v));
747
- }
748
-
749
- iterator emplace_hint(const_iterator hint,
750
- boost::unordered::detail::empty_emplace
751
- = boost::unordered::detail::empty_emplace(),
752
- value_type v = value_type()
753
- )
754
- {
755
- return this->emplace_hint(hint, boost::move(v));
756
- }
757
-
758
- #endif
924
+ #if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
925
+ template <class... Args> iterator emplace(BOOST_FWD_REF(Args)... args)
926
+ {
927
+ return table_.emplace(boost::forward<Args>(args)...);
928
+ }
759
929
 
760
- template <typename A0>
761
- iterator emplace(BOOST_FWD_REF(A0) a0)
762
- {
763
- return table_.emplace(
764
- boost::unordered::detail::create_emplace_args(
765
- boost::forward<A0>(a0))
766
- );
767
- }
930
+ template <class... Args>
931
+ iterator emplace_hint(const_iterator hint, BOOST_FWD_REF(Args)... args)
932
+ {
933
+ return table_.emplace_hint(hint, boost::forward<Args>(args)...);
934
+ }
935
+ #else
768
936
 
769
- template <typename A0>
770
- iterator emplace_hint(const_iterator, BOOST_FWD_REF(A0) a0)
771
- {
772
- return table_.emplace(
773
- boost::unordered::detail::create_emplace_args(
774
- boost::forward<A0>(a0))
775
- );
776
- }
937
+ #if !BOOST_WORKAROUND(__SUNPRO_CC, BOOST_TESTED_AT(0x5100))
777
938
 
778
- template <typename A0, typename A1>
779
- iterator emplace(
780
- BOOST_FWD_REF(A0) a0,
781
- BOOST_FWD_REF(A1) a1)
782
- {
783
- return table_.emplace(
784
- boost::unordered::detail::create_emplace_args(
785
- boost::forward<A0>(a0),
786
- boost::forward<A1>(a1))
787
- );
788
- }
939
+ // 0 argument emplace requires special treatment in case
940
+ // the container is instantiated with a value type that
941
+ // doesn't have a default constructor.
789
942
 
790
- template <typename A0, typename A1>
791
- iterator emplace_hint(const_iterator,
792
- BOOST_FWD_REF(A0) a0,
793
- BOOST_FWD_REF(A1) a1)
794
- {
795
- return table_.emplace(
796
- boost::unordered::detail::create_emplace_args(
797
- boost::forward<A0>(a0),
798
- boost::forward<A1>(a1))
799
- );
800
- }
943
+ iterator emplace(boost::unordered::detail::empty_emplace =
944
+ boost::unordered::detail::empty_emplace(),
945
+ value_type v = value_type())
946
+ {
947
+ return this->emplace(boost::move(v));
948
+ }
801
949
 
802
- template <typename A0, typename A1, typename A2>
803
- iterator emplace(
804
- BOOST_FWD_REF(A0) a0,
805
- BOOST_FWD_REF(A1) a1,
806
- BOOST_FWD_REF(A2) a2)
807
- {
808
- return table_.emplace(
809
- boost::unordered::detail::create_emplace_args(
810
- boost::forward<A0>(a0),
811
- boost::forward<A1>(a1),
812
- boost::forward<A2>(a2))
813
- );
814
- }
950
+ iterator emplace_hint(const_iterator hint,
951
+ boost::unordered::detail::empty_emplace =
952
+ boost::unordered::detail::empty_emplace(),
953
+ value_type v = value_type())
954
+ {
955
+ return this->emplace_hint(hint, boost::move(v));
956
+ }
815
957
 
816
- template <typename A0, typename A1, typename A2>
817
- iterator emplace_hint(const_iterator,
818
- BOOST_FWD_REF(A0) a0,
819
- BOOST_FWD_REF(A1) a1,
820
- BOOST_FWD_REF(A2) a2)
821
- {
822
- return table_.emplace(
823
- boost::unordered::detail::create_emplace_args(
824
- boost::forward<A0>(a0),
825
- boost::forward<A1>(a1),
826
- boost::forward<A2>(a2))
827
- );
828
- }
958
+ #endif
829
959
 
830
- #define BOOST_UNORDERED_EMPLACE(z, n, _) \
831
- template < \
832
- BOOST_PP_ENUM_PARAMS_Z(z, n, typename A) \
833
- > \
834
- iterator emplace( \
835
- BOOST_PP_ENUM_##z(n, BOOST_UNORDERED_FWD_PARAM, a) \
836
- ) \
837
- { \
838
- return table_.emplace( \
839
- boost::unordered::detail::create_emplace_args( \
840
- BOOST_PP_ENUM_##z(n, BOOST_UNORDERED_CALL_FORWARD, \
841
- a) \
842
- )); \
843
- } \
844
- \
845
- template < \
846
- BOOST_PP_ENUM_PARAMS_Z(z, n, typename A) \
847
- > \
848
- iterator emplace_hint( \
849
- const_iterator, \
850
- BOOST_PP_ENUM_##z(n, BOOST_UNORDERED_FWD_PARAM, a) \
851
- ) \
852
- { \
853
- return table_.emplace( \
854
- boost::unordered::detail::create_emplace_args( \
855
- BOOST_PP_ENUM_##z(n, BOOST_UNORDERED_CALL_FORWARD, \
856
- a) \
857
- )); \
858
- }
960
+ template <typename A0> iterator emplace(BOOST_FWD_REF(A0) a0)
961
+ {
962
+ return table_.emplace(boost::unordered::detail::create_emplace_args(
963
+ boost::forward<A0>(a0)));
964
+ }
859
965
 
860
- BOOST_PP_REPEAT_FROM_TO(4, BOOST_UNORDERED_EMPLACE_LIMIT,
861
- BOOST_UNORDERED_EMPLACE, _)
966
+ template <typename A0>
967
+ iterator emplace_hint(const_iterator hint, BOOST_FWD_REF(A0) a0)
968
+ {
969
+ return table_.emplace_hint(
970
+ hint, boost::unordered::detail::create_emplace_args(
971
+ boost::forward<A0>(a0)));
972
+ }
862
973
 
863
- #undef BOOST_UNORDERED_EMPLACE
974
+ template <typename A0, typename A1>
975
+ iterator emplace(BOOST_FWD_REF(A0) a0, BOOST_FWD_REF(A1) a1)
976
+ {
977
+ return table_.emplace(boost::unordered::detail::create_emplace_args(
978
+ boost::forward<A0>(a0), boost::forward<A1>(a1)));
979
+ }
864
980
 
865
- #endif
981
+ template <typename A0, typename A1>
982
+ iterator emplace_hint(
983
+ const_iterator hint, BOOST_FWD_REF(A0) a0, BOOST_FWD_REF(A1) a1)
984
+ {
985
+ return table_.emplace_hint(
986
+ hint, boost::unordered::detail::create_emplace_args(
987
+ boost::forward<A0>(a0), boost::forward<A1>(a1)));
988
+ }
866
989
 
867
- iterator insert(value_type const& x)
868
- {
869
- return this->emplace(x);
870
- }
990
+ template <typename A0, typename A1, typename A2>
991
+ iterator emplace(
992
+ BOOST_FWD_REF(A0) a0, BOOST_FWD_REF(A1) a1, BOOST_FWD_REF(A2) a2)
993
+ {
994
+ return table_.emplace(boost::unordered::detail::create_emplace_args(
995
+ boost::forward<A0>(a0), boost::forward<A1>(a1),
996
+ boost::forward<A2>(a2)));
997
+ }
871
998
 
872
- iterator insert(BOOST_RV_REF(value_type) x)
873
- {
874
- return this->emplace(boost::move(x));
875
- }
999
+ template <typename A0, typename A1, typename A2>
1000
+ iterator emplace_hint(const_iterator hint, BOOST_FWD_REF(A0) a0,
1001
+ BOOST_FWD_REF(A1) a1, BOOST_FWD_REF(A2) a2)
1002
+ {
1003
+ return table_.emplace_hint(
1004
+ hint, boost::unordered::detail::create_emplace_args(
1005
+ boost::forward<A0>(a0), boost::forward<A1>(a1),
1006
+ boost::forward<A2>(a2)));
1007
+ }
876
1008
 
877
- iterator insert(const_iterator hint, value_type const& x)
878
- {
879
- return this->emplace_hint(hint, x);
880
- }
1009
+ #define BOOST_UNORDERED_EMPLACE(z, n, _) \
1010
+ template <BOOST_PP_ENUM_PARAMS_Z(z, n, typename A)> \
1011
+ iterator emplace(BOOST_PP_ENUM_##z(n, BOOST_UNORDERED_FWD_PARAM, a)) \
1012
+ { \
1013
+ return table_.emplace(boost::unordered::detail::create_emplace_args( \
1014
+ BOOST_PP_ENUM_##z(n, BOOST_UNORDERED_CALL_FORWARD, a))); \
1015
+ } \
1016
+ \
1017
+ template <BOOST_PP_ENUM_PARAMS_Z(z, n, typename A)> \
1018
+ iterator emplace_hint(const_iterator hint, \
1019
+ BOOST_PP_ENUM_##z(n, BOOST_UNORDERED_FWD_PARAM, a)) \
1020
+ { \
1021
+ return table_.emplace_hint( \
1022
+ hint, boost::unordered::detail::create_emplace_args( \
1023
+ BOOST_PP_ENUM_##z(n, BOOST_UNORDERED_CALL_FORWARD, a))); \
1024
+ }
881
1025
 
882
- iterator insert(const_iterator hint, BOOST_RV_REF(value_type) x)
883
- {
884
- return this->emplace_hint(hint, boost::move(x));
885
- }
1026
+ BOOST_PP_REPEAT_FROM_TO(
1027
+ 4, BOOST_UNORDERED_EMPLACE_LIMIT, BOOST_UNORDERED_EMPLACE, _)
886
1028
 
887
- template <class InputIt> void insert(InputIt, InputIt);
1029
+ #undef BOOST_UNORDERED_EMPLACE
888
1030
 
889
- #if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
890
- void insert(std::initializer_list<value_type>);
891
1031
  #endif
892
1032
 
893
- iterator erase(const_iterator);
894
- size_type erase(const key_type&);
895
- iterator erase(const_iterator, const_iterator);
896
- void quick_erase(const_iterator it) { erase(it); }
897
- void erase_return_void(const_iterator it) { erase(it); }
898
-
899
- void clear();
900
- void swap(unordered_multimap&);
1033
+ iterator insert(value_type const& x) { return this->emplace(x); }
901
1034
 
902
- // observers
1035
+ iterator insert(BOOST_RV_REF(value_type) x)
1036
+ {
1037
+ return this->emplace(boost::move(x));
1038
+ }
903
1039
 
904
- hasher hash_function() const;
905
- key_equal key_eq() const;
1040
+ iterator insert(const_iterator hint, value_type const& x)
1041
+ {
1042
+ return this->emplace_hint(hint, x);
1043
+ }
906
1044
 
907
- // lookup
1045
+ iterator insert(const_iterator hint, BOOST_RV_REF(value_type) x)
1046
+ {
1047
+ return this->emplace_hint(hint, boost::move(x));
1048
+ }
908
1049
 
909
- iterator find(const key_type&);
910
- const_iterator find(const key_type&) const;
1050
+ template <class InputIt> void insert(InputIt, InputIt);
911
1051
 
912
- template <class CompatibleKey, class CompatibleHash,
913
- class CompatiblePredicate>
914
- iterator find(
915
- CompatibleKey const&,
916
- CompatibleHash const&,
917
- CompatiblePredicate const&);
1052
+ #if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
1053
+ void insert(std::initializer_list<value_type>);
1054
+ #endif
918
1055
 
919
- template <class CompatibleKey, class CompatibleHash,
920
- class CompatiblePredicate>
921
- const_iterator find(
922
- CompatibleKey const&,
923
- CompatibleHash const&,
924
- CompatiblePredicate const&) const;
1056
+ iterator insert(BOOST_RV_REF(node_type) np)
1057
+ {
1058
+ return table_.move_insert_node_type(np);
1059
+ }
925
1060
 
926
- size_type count(const key_type&) const;
1061
+ iterator insert(const_iterator hint, BOOST_RV_REF(node_type) np)
1062
+ {
1063
+ return table_.move_insert_node_type_with_hint(hint, np);
1064
+ }
927
1065
 
928
- std::pair<iterator, iterator>
929
- equal_range(const key_type&);
930
- std::pair<const_iterator, const_iterator>
931
- equal_range(const key_type&) const;
1066
+ #if defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
1067
+ private:
1068
+ // Note: Use r-value node_type to insert.
1069
+ iterator insert(node_type&);
1070
+ iterator insert(const_iterator, node_type& np);
932
1071
 
933
- // bucket interface
1072
+ public:
1073
+ #endif
934
1074
 
935
- size_type bucket_count() const BOOST_NOEXCEPT
936
- {
937
- return table_.bucket_count_;
938
- }
1075
+ iterator erase(const_iterator);
1076
+ size_type erase(const key_type&);
1077
+ iterator erase(const_iterator, const_iterator);
1078
+ void quick_erase(const_iterator it) { erase(it); }
1079
+ void erase_return_void(const_iterator it) { erase(it); }
939
1080
 
940
- size_type max_bucket_count() const BOOST_NOEXCEPT
941
- {
942
- return table_.max_bucket_count();
943
- }
1081
+ void clear();
1082
+ void swap(unordered_multimap&);
944
1083
 
945
- size_type bucket_size(size_type) const;
1084
+ template <typename H2, typename P2>
1085
+ void merge(boost::unordered_multimap<K, T, H2, P2, A>& source);
946
1086
 
947
- size_type bucket(const key_type& k) const
948
- {
949
- return table_.hash_to_bucket(table_.hash(k));
950
- }
1087
+ #if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
1088
+ template <typename H2, typename P2>
1089
+ void merge(boost::unordered_multimap<K, T, H2, P2, A>&& source);
1090
+ #endif
951
1091
 
952
- local_iterator begin(size_type n)
953
- {
954
- return local_iterator(
955
- table_.begin(n), n, table_.bucket_count_);
956
- }
1092
+ #if BOOST_UNORDERED_INTEROPERABLE_NODES
1093
+ template <typename H2, typename P2>
1094
+ void merge(boost::unordered_map<K, T, H2, P2, A>& source);
957
1095
 
958
- const_local_iterator begin(size_type n) const
959
- {
960
- return const_local_iterator(
961
- table_.begin(n), n, table_.bucket_count_);
962
- }
1096
+ #if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
1097
+ template <typename H2, typename P2>
1098
+ void merge(boost::unordered_map<K, T, H2, P2, A>&& source);
1099
+ #endif
1100
+ #endif
963
1101
 
964
- local_iterator end(size_type)
965
- {
966
- return local_iterator();
967
- }
1102
+ // observers
968
1103
 
969
- const_local_iterator end(size_type) const
970
- {
971
- return const_local_iterator();
972
- }
1104
+ hasher hash_function() const;
1105
+ key_equal key_eq() const;
973
1106
 
974
- const_local_iterator cbegin(size_type n) const
975
- {
976
- return const_local_iterator(
977
- table_.begin(n), n, table_.bucket_count_);
978
- }
1107
+ // lookup
979
1108
 
980
- const_local_iterator cend(size_type) const
981
- {
982
- return const_local_iterator();
983
- }
1109
+ iterator find(const key_type&);
1110
+ const_iterator find(const key_type&) const;
984
1111
 
985
- // hash policy
1112
+ template <class CompatibleKey, class CompatibleHash,
1113
+ class CompatiblePredicate>
1114
+ iterator find(CompatibleKey const&, CompatibleHash const&,
1115
+ CompatiblePredicate const&);
986
1116
 
987
- float max_load_factor() const BOOST_NOEXCEPT
988
- {
989
- return table_.mlf_;
990
- }
1117
+ template <class CompatibleKey, class CompatibleHash,
1118
+ class CompatiblePredicate>
1119
+ const_iterator find(CompatibleKey const&, CompatibleHash const&,
1120
+ CompatiblePredicate const&) const;
991
1121
 
992
- float load_factor() const BOOST_NOEXCEPT;
993
- void max_load_factor(float) BOOST_NOEXCEPT;
994
- void rehash(size_type);
995
- void reserve(size_type);
1122
+ size_type count(const key_type&) const;
996
1123
 
997
- #if !BOOST_WORKAROUND(__BORLANDC__, < 0x0582)
998
- friend bool operator==<K,T,H,P,A>(
999
- unordered_multimap const&, unordered_multimap const&);
1000
- friend bool operator!=<K,T,H,P,A>(
1001
- unordered_multimap const&, unordered_multimap const&);
1002
- #endif
1003
- }; // class template unordered_multimap
1124
+ std::pair<iterator, iterator> equal_range(const key_type&);
1125
+ std::pair<const_iterator, const_iterator> equal_range(
1126
+ const key_type&) const;
1004
1127
 
1005
- ////////////////////////////////////////////////////////////////////////////////
1128
+ // bucket interface
1006
1129
 
1007
- template <class K, class T, class H, class P, class A>
1008
- unordered_map<K,T,H,P,A>::unordered_map(
1009
- size_type n, const hasher &hf, const key_equal &eql,
1010
- const allocator_type &a)
1011
- : table_(n, hf, eql, a)
1130
+ size_type bucket_count() const BOOST_NOEXCEPT
1012
1131
  {
1132
+ return table_.bucket_count_;
1013
1133
  }
1014
1134
 
1015
- template <class K, class T, class H, class P, class A>
1016
- unordered_map<K,T,H,P,A>::unordered_map(allocator_type const& a)
1017
- : table_(boost::unordered::detail::default_bucket_count,
1018
- hasher(), key_equal(), a)
1135
+ size_type max_bucket_count() const BOOST_NOEXCEPT
1019
1136
  {
1137
+ return table_.max_bucket_count();
1020
1138
  }
1021
1139
 
1022
- template <class K, class T, class H, class P, class A>
1023
- unordered_map<K,T,H,P,A>::unordered_map(
1024
- unordered_map const& other, allocator_type const& a)
1025
- : table_(other.table_, a)
1140
+ size_type bucket_size(size_type) const;
1141
+
1142
+ size_type bucket(const key_type& k) const
1026
1143
  {
1144
+ return table_.hash_to_bucket(table_.hash(k));
1027
1145
  }
1028
1146
 
1029
- template <class K, class T, class H, class P, class A>
1030
- template <class InputIt>
1031
- unordered_map<K,T,H,P,A>::unordered_map(InputIt f, InputIt l)
1032
- : table_(boost::unordered::detail::initial_size(f, l),
1033
- hasher(), key_equal(), allocator_type())
1147
+ local_iterator begin(size_type n)
1034
1148
  {
1035
- table_.insert_range(f, l);
1149
+ return local_iterator(table_.begin(n), n, table_.bucket_count_);
1036
1150
  }
1037
1151
 
1038
- template <class K, class T, class H, class P, class A>
1039
- template <class InputIt>
1040
- unordered_map<K,T,H,P,A>::unordered_map(
1041
- InputIt f, InputIt l,
1042
- size_type n,
1043
- const hasher &hf,
1044
- const key_equal &eql)
1045
- : table_(boost::unordered::detail::initial_size(f, l, n),
1046
- hf, eql, allocator_type())
1047
- {
1048
- table_.insert_range(f, l);
1049
- }
1050
-
1051
- template <class K, class T, class H, class P, class A>
1052
- template <class InputIt>
1053
- unordered_map<K,T,H,P,A>::unordered_map(
1054
- InputIt f, InputIt l,
1055
- size_type n,
1056
- const hasher &hf,
1057
- const key_equal &eql,
1058
- const allocator_type &a)
1059
- : table_(boost::unordered::detail::initial_size(f, l, n), hf, eql, a)
1152
+ const_local_iterator begin(size_type n) const
1060
1153
  {
1061
- table_.insert_range(f, l);
1154
+ return const_local_iterator(table_.begin(n), n, table_.bucket_count_);
1062
1155
  }
1063
-
1064
- template <class K, class T, class H, class P, class A>
1065
- unordered_map<K,T,H,P,A>::~unordered_map() BOOST_NOEXCEPT {}
1066
1156
 
1067
- template <class K, class T, class H, class P, class A>
1068
- unordered_map<K,T,H,P,A>::unordered_map(
1069
- unordered_map const& other)
1070
- : table_(other.table_)
1157
+ local_iterator end(size_type) { return local_iterator(); }
1158
+
1159
+ const_local_iterator end(size_type) const { return const_local_iterator(); }
1160
+
1161
+ const_local_iterator cbegin(size_type n) const
1071
1162
  {
1163
+ return const_local_iterator(table_.begin(n), n, table_.bucket_count_);
1072
1164
  }
1073
1165
 
1074
- #if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
1075
-
1076
- template <class K, class T, class H, class P, class A>
1077
- unordered_map<K,T,H,P,A>::unordered_map(
1078
- unordered_map&& other, allocator_type const& a)
1079
- : table_(other.table_, a, boost::unordered::detail::move_tag())
1166
+ const_local_iterator cend(size_type) const
1080
1167
  {
1168
+ return const_local_iterator();
1081
1169
  }
1082
1170
 
1171
+ // hash policy
1172
+
1173
+ float max_load_factor() const BOOST_NOEXCEPT { return table_.mlf_; }
1174
+
1175
+ float load_factor() const BOOST_NOEXCEPT;
1176
+ void max_load_factor(float) BOOST_NOEXCEPT;
1177
+ void rehash(size_type);
1178
+ void reserve(size_type);
1179
+
1180
+ #if !BOOST_WORKAROUND(__BORLANDC__, < 0x0582)
1181
+ friend bool operator==
1182
+ <K, T, H, P, A>(unordered_multimap const&, unordered_multimap const&);
1183
+ friend bool operator!=
1184
+ <K, T, H, P, A>(unordered_multimap const&, unordered_multimap const&);
1083
1185
  #endif
1186
+ }; // class template unordered_multimap
1187
+
1188
+ ////////////////////////////////////////////////////////////////////////////////
1189
+
1190
+ template <class K, class T, class H, class P, class A>
1191
+ unordered_map<K, T, H, P, A>::unordered_map()
1192
+ : table_(boost::unordered::detail::default_bucket_count, hasher(),
1193
+ key_equal(), allocator_type())
1194
+ {
1195
+ }
1196
+
1197
+ template <class K, class T, class H, class P, class A>
1198
+ unordered_map<K, T, H, P, A>::unordered_map(size_type n, const hasher& hf,
1199
+ const key_equal& eql, const allocator_type& a)
1200
+ : table_(n, hf, eql, a)
1201
+ {
1202
+ }
1203
+
1204
+ template <class K, class T, class H, class P, class A>
1205
+ unordered_map<K, T, H, P, A>::unordered_map(
1206
+ size_type n, const allocator_type& a)
1207
+ : table_(n, hasher(), key_equal(), a)
1208
+ {
1209
+ }
1210
+
1211
+ template <class K, class T, class H, class P, class A>
1212
+ unordered_map<K, T, H, P, A>::unordered_map(
1213
+ size_type n, const hasher& hf, const allocator_type& a)
1214
+ : table_(n, hf, key_equal(), a)
1215
+ {
1216
+ }
1217
+
1218
+ template <class K, class T, class H, class P, class A>
1219
+ unordered_map<K, T, H, P, A>::unordered_map(allocator_type const& a)
1220
+ : table_(boost::unordered::detail::default_bucket_count, hasher(),
1221
+ key_equal(), a)
1222
+ {
1223
+ }
1224
+
1225
+ template <class K, class T, class H, class P, class A>
1226
+ unordered_map<K, T, H, P, A>::unordered_map(
1227
+ unordered_map const& other, allocator_type const& a)
1228
+ : table_(other.table_, a)
1229
+ {
1230
+ }
1231
+
1232
+ template <class K, class T, class H, class P, class A>
1233
+ template <class InputIt>
1234
+ unordered_map<K, T, H, P, A>::unordered_map(InputIt f, InputIt l)
1235
+ : table_(boost::unordered::detail::initial_size(f, l), hasher(),
1236
+ key_equal(), allocator_type())
1237
+ {
1238
+ table_.insert_range(f, l);
1239
+ }
1240
+
1241
+ template <class K, class T, class H, class P, class A>
1242
+ template <class InputIt>
1243
+ unordered_map<K, T, H, P, A>::unordered_map(
1244
+ InputIt f, InputIt l, size_type n, const hasher& hf, const key_equal& eql)
1245
+ : table_(boost::unordered::detail::initial_size(f, l, n), hf, eql,
1246
+ allocator_type())
1247
+ {
1248
+ table_.insert_range(f, l);
1249
+ }
1250
+
1251
+ template <class K, class T, class H, class P, class A>
1252
+ template <class InputIt>
1253
+ unordered_map<K, T, H, P, A>::unordered_map(InputIt f, InputIt l, size_type n,
1254
+ const hasher& hf, const key_equal& eql, const allocator_type& a)
1255
+ : table_(boost::unordered::detail::initial_size(f, l, n), hf, eql, a)
1256
+ {
1257
+ table_.insert_range(f, l);
1258
+ }
1259
+
1260
+ template <class K, class T, class H, class P, class A>
1261
+ template <class InputIt>
1262
+ unordered_map<K, T, H, P, A>::unordered_map(InputIt f, InputIt l, size_type n,
1263
+ const hasher& hf, const allocator_type& a)
1264
+ : table_(
1265
+ boost::unordered::detail::initial_size(f, l, n), hf, key_equal(), a)
1266
+ {
1267
+ table_.insert_range(f, l);
1268
+ }
1269
+
1270
+ template <class K, class T, class H, class P, class A>
1271
+ template <class InputIt>
1272
+ unordered_map<K, T, H, P, A>::unordered_map(
1273
+ InputIt f, InputIt l, size_type n, const allocator_type& a)
1274
+ : table_(boost::unordered::detail::initial_size(f, l, n), hasher(),
1275
+ key_equal(), a)
1276
+ {
1277
+ table_.insert_range(f, l);
1278
+ }
1279
+
1280
+ template <class K, class T, class H, class P, class A>
1281
+ unordered_map<K, T, H, P, A>::~unordered_map() BOOST_NOEXCEPT
1282
+ {
1283
+ }
1284
+
1285
+ template <class K, class T, class H, class P, class A>
1286
+ unordered_map<K, T, H, P, A>::unordered_map(unordered_map const& other)
1287
+ : table_(other.table_)
1288
+ {
1289
+ }
1290
+
1291
+ template <class K, class T, class H, class P, class A>
1292
+ unordered_map<K, T, H, P, A>::unordered_map(
1293
+ BOOST_RV_REF(unordered_map) other, allocator_type const& a)
1294
+ : table_(other.table_, a, boost::unordered::detail::move_tag())
1295
+ {
1296
+ }
1084
1297
 
1085
1298
  #if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
1086
1299
 
1087
- template <class K, class T, class H, class P, class A>
1088
- unordered_map<K,T,H,P,A>::unordered_map(
1089
- std::initializer_list<value_type> list, size_type n,
1090
- const hasher &hf, const key_equal &eql, const allocator_type &a)
1091
- : table_(
1092
- boost::unordered::detail::initial_size(
1093
- list.begin(), list.end(), n),
1094
- hf, eql, a)
1095
- {
1096
- table_.insert_range(list.begin(), list.end());
1097
- }
1300
+ template <class K, class T, class H, class P, class A>
1301
+ unordered_map<K, T, H, P, A>::unordered_map(
1302
+ std::initializer_list<value_type> list, size_type n, const hasher& hf,
1303
+ const key_equal& eql, const allocator_type& a)
1304
+ : table_(
1305
+ boost::unordered::detail::initial_size(list.begin(), list.end(), n),
1306
+ hf, eql, a)
1307
+ {
1308
+ table_.insert_range(list.begin(), list.end());
1309
+ }
1310
+
1311
+ template <class K, class T, class H, class P, class A>
1312
+ unordered_map<K, T, H, P, A>::unordered_map(
1313
+ std::initializer_list<value_type> list, size_type n, const hasher& hf,
1314
+ const allocator_type& a)
1315
+ : table_(
1316
+ boost::unordered::detail::initial_size(list.begin(), list.end(), n),
1317
+ hf, key_equal(), a)
1318
+ {
1319
+ table_.insert_range(list.begin(), list.end());
1320
+ }
1321
+
1322
+ template <class K, class T, class H, class P, class A>
1323
+ unordered_map<K, T, H, P, A>::unordered_map(
1324
+ std::initializer_list<value_type> list, size_type n,
1325
+ const allocator_type& a)
1326
+ : table_(
1327
+ boost::unordered::detail::initial_size(list.begin(), list.end(), n),
1328
+ hasher(), key_equal(), a)
1329
+ {
1330
+ table_.insert_range(list.begin(), list.end());
1331
+ }
1098
1332
 
1099
- template <class K, class T, class H, class P, class A>
1100
- unordered_map<K,T,H,P,A>& unordered_map<K,T,H,P,A>::operator=(
1101
- std::initializer_list<value_type> list)
1102
- {
1103
- table_.clear();
1104
- table_.insert_range(list.begin(), list.end());
1105
- return *this;
1106
- }
1333
+ template <class K, class T, class H, class P, class A>
1334
+ unordered_map<K, T, H, P, A>& unordered_map<K, T, H, P, A>::operator=(
1335
+ std::initializer_list<value_type> list)
1336
+ {
1337
+ table_.clear();
1338
+ table_.insert_range(list.begin(), list.end());
1339
+ return *this;
1340
+ }
1107
1341
 
1108
1342
  #endif
1109
1343
 
1110
- // size and capacity
1344
+ // size and capacity
1111
1345
 
1112
- template <class K, class T, class H, class P, class A>
1113
- std::size_t unordered_map<K,T,H,P,A>::max_size() const BOOST_NOEXCEPT
1114
- {
1115
- return table_.max_size();
1116
- }
1346
+ template <class K, class T, class H, class P, class A>
1347
+ std::size_t unordered_map<K, T, H, P, A>::max_size() const BOOST_NOEXCEPT
1348
+ {
1349
+ return table_.max_size();
1350
+ }
1117
1351
 
1118
- // modifiers
1352
+ // modifiers
1119
1353
 
1120
- template <class K, class T, class H, class P, class A>
1121
- template <class InputIt>
1122
- void unordered_map<K,T,H,P,A>::insert(InputIt first, InputIt last)
1123
- {
1124
- table_.insert_range(first, last);
1125
- }
1354
+ template <class K, class T, class H, class P, class A>
1355
+ template <class InputIt>
1356
+ void unordered_map<K, T, H, P, A>::insert(InputIt first, InputIt last)
1357
+ {
1358
+ table_.insert_range(first, last);
1359
+ }
1126
1360
 
1127
1361
  #if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
1128
- template <class K, class T, class H, class P, class A>
1129
- void unordered_map<K,T,H,P,A>::insert(
1130
- std::initializer_list<value_type> list)
1131
- {
1132
- table_.insert_range(list.begin(), list.end());
1133
- }
1362
+ template <class K, class T, class H, class P, class A>
1363
+ void unordered_map<K, T, H, P, A>::insert(
1364
+ std::initializer_list<value_type> list)
1365
+ {
1366
+ table_.insert_range(list.begin(), list.end());
1367
+ }
1134
1368
  #endif
1135
1369
 
1136
- template <class K, class T, class H, class P, class A>
1137
- typename unordered_map<K,T,H,P,A>::iterator
1138
- unordered_map<K,T,H,P,A>::erase(const_iterator position)
1139
- {
1140
- return table_.erase(position);
1141
- }
1370
+ template <class K, class T, class H, class P, class A>
1371
+ typename unordered_map<K, T, H, P, A>::iterator
1372
+ unordered_map<K, T, H, P, A>::erase(const_iterator position)
1373
+ {
1374
+ return table_.erase(position);
1375
+ }
1142
1376
 
1143
- template <class K, class T, class H, class P, class A>
1144
- typename unordered_map<K,T,H,P,A>::size_type
1145
- unordered_map<K,T,H,P,A>::erase(const key_type& k)
1146
- {
1147
- return table_.erase_key(k);
1148
- }
1377
+ template <class K, class T, class H, class P, class A>
1378
+ typename unordered_map<K, T, H, P, A>::size_type
1379
+ unordered_map<K, T, H, P, A>::erase(const key_type& k)
1380
+ {
1381
+ return table_.erase_key(k);
1382
+ }
1149
1383
 
1150
- template <class K, class T, class H, class P, class A>
1151
- typename unordered_map<K,T,H,P,A>::iterator
1152
- unordered_map<K,T,H,P,A>::erase(
1153
- const_iterator first, const_iterator last)
1154
- {
1155
- return table_.erase_range(first, last);
1156
- }
1384
+ template <class K, class T, class H, class P, class A>
1385
+ typename unordered_map<K, T, H, P, A>::iterator
1386
+ unordered_map<K, T, H, P, A>::erase(const_iterator first, const_iterator last)
1387
+ {
1388
+ return table_.erase_range(first, last);
1389
+ }
1157
1390
 
1158
- template <class K, class T, class H, class P, class A>
1159
- void unordered_map<K,T,H,P,A>::clear()
1160
- {
1161
- table_.clear();
1162
- }
1391
+ template <class K, class T, class H, class P, class A>
1392
+ void unordered_map<K, T, H, P, A>::clear()
1393
+ {
1394
+ table_.clear();
1395
+ }
1163
1396
 
1164
- template <class K, class T, class H, class P, class A>
1165
- void unordered_map<K,T,H,P,A>::swap(unordered_map& other)
1166
- {
1167
- table_.swap(other.table_);
1168
- }
1397
+ template <class K, class T, class H, class P, class A>
1398
+ void unordered_map<K, T, H, P, A>::swap(unordered_map& other)
1399
+ {
1400
+ table_.swap(other.table_);
1401
+ }
1169
1402
 
1170
- // observers
1403
+ template <class K, class T, class H, class P, class A>
1404
+ template <typename H2, typename P2>
1405
+ void unordered_map<K, T, H, P, A>::merge(
1406
+ boost::unordered_map<K, T, H2, P2, A>& source)
1407
+ {
1408
+ table_.merge_impl(source.table_);
1409
+ }
1171
1410
 
1172
- template <class K, class T, class H, class P, class A>
1173
- typename unordered_map<K,T,H,P,A>::hasher
1174
- unordered_map<K,T,H,P,A>::hash_function() const
1175
- {
1176
- return table_.hash_function();
1177
- }
1411
+ #if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
1412
+ template <class K, class T, class H, class P, class A>
1413
+ template <typename H2, typename P2>
1414
+ void unordered_map<K, T, H, P, A>::merge(
1415
+ boost::unordered_map<K, T, H2, P2, A>&& source)
1416
+ {
1417
+ table_.merge_impl(source.table_);
1418
+ }
1419
+ #endif
1178
1420
 
1179
- template <class K, class T, class H, class P, class A>
1180
- typename unordered_map<K,T,H,P,A>::key_equal
1181
- unordered_map<K,T,H,P,A>::key_eq() const
1182
- {
1183
- return table_.key_eq();
1184
- }
1421
+ #if BOOST_UNORDERED_INTEROPERABLE_NODES
1422
+ template <class K, class T, class H, class P, class A>
1423
+ template <typename H2, typename P2>
1424
+ void unordered_map<K, T, H, P, A>::merge(
1425
+ boost::unordered_multimap<K, T, H2, P2, A>& source)
1426
+ {
1427
+ table_.merge_impl(source.table_);
1428
+ }
1185
1429
 
1186
- template <class K, class T, class H, class P, class A>
1187
- typename unordered_map<K,T,H,P,A>::mapped_type&
1188
- unordered_map<K,T,H,P,A>::operator[](const key_type &k)
1189
- {
1190
- return table_[k].second;
1191
- }
1430
+ #if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
1431
+ template <class K, class T, class H, class P, class A>
1432
+ template <typename H2, typename P2>
1433
+ void unordered_map<K, T, H, P, A>::merge(
1434
+ boost::unordered_multimap<K, T, H2, P2, A>&& source)
1435
+ {
1436
+ table_.merge_impl(source.table_);
1437
+ }
1438
+ #endif
1439
+ #endif
1192
1440
 
1193
- template <class K, class T, class H, class P, class A>
1194
- typename unordered_map<K,T,H,P,A>::mapped_type&
1195
- unordered_map<K,T,H,P,A>::at(const key_type& k)
1196
- {
1197
- return table_.at(k).second;
1198
- }
1441
+ // observers
1199
1442
 
1200
- template <class K, class T, class H, class P, class A>
1201
- typename unordered_map<K,T,H,P,A>::mapped_type const&
1202
- unordered_map<K,T,H,P,A>::at(const key_type& k) const
1203
- {
1204
- return table_.at(k).second;
1205
- }
1443
+ template <class K, class T, class H, class P, class A>
1444
+ typename unordered_map<K, T, H, P, A>::hasher
1445
+ unordered_map<K, T, H, P, A>::hash_function() const
1446
+ {
1447
+ return table_.hash_function();
1448
+ }
1206
1449
 
1207
- // lookup
1450
+ template <class K, class T, class H, class P, class A>
1451
+ typename unordered_map<K, T, H, P, A>::key_equal
1452
+ unordered_map<K, T, H, P, A>::key_eq() const
1453
+ {
1454
+ return table_.key_eq();
1455
+ }
1208
1456
 
1209
- template <class K, class T, class H, class P, class A>
1210
- typename unordered_map<K,T,H,P,A>::iterator
1211
- unordered_map<K,T,H,P,A>::find(const key_type& k)
1212
- {
1213
- return table_.find_node(k);
1214
- }
1457
+ template <class K, class T, class H, class P, class A>
1458
+ typename unordered_map<K, T, H, P, A>::mapped_type&
1459
+ unordered_map<K, T, H, P, A>::operator[](const key_type& k)
1460
+ {
1461
+ return table_.try_emplace_impl(k).first->second;
1462
+ }
1215
1463
 
1216
- template <class K, class T, class H, class P, class A>
1217
- typename unordered_map<K,T,H,P,A>::const_iterator
1218
- unordered_map<K,T,H,P,A>::find(const key_type& k) const
1219
- {
1220
- return table_.find_node(k);
1221
- }
1464
+ template <class K, class T, class H, class P, class A>
1465
+ typename unordered_map<K, T, H, P, A>::mapped_type&
1466
+ unordered_map<K, T, H, P, A>::at(const key_type& k)
1467
+ {
1468
+ return table_.at(k).second;
1469
+ }
1222
1470
 
1223
- template <class K, class T, class H, class P, class A>
1224
- template <class CompatibleKey, class CompatibleHash,
1225
- class CompatiblePredicate>
1226
- typename unordered_map<K,T,H,P,A>::iterator
1227
- unordered_map<K,T,H,P,A>::find(
1228
- CompatibleKey const& k,
1229
- CompatibleHash const& hash,
1230
- CompatiblePredicate const& eq)
1231
- {
1232
- return table_.generic_find_node(k, hash, eq);
1233
- }
1471
+ template <class K, class T, class H, class P, class A>
1472
+ typename unordered_map<K, T, H, P, A>::mapped_type const&
1473
+ unordered_map<K, T, H, P, A>::at(const key_type& k) const
1474
+ {
1475
+ return table_.at(k).second;
1476
+ }
1234
1477
 
1235
- template <class K, class T, class H, class P, class A>
1236
- template <class CompatibleKey, class CompatibleHash,
1237
- class CompatiblePredicate>
1238
- typename unordered_map<K,T,H,P,A>::const_iterator
1239
- unordered_map<K,T,H,P,A>::find(
1240
- CompatibleKey const& k,
1241
- CompatibleHash const& hash,
1242
- CompatiblePredicate const& eq) const
1243
- {
1244
- return table_.generic_find_node(k, hash, eq);
1245
- }
1478
+ // lookup
1246
1479
 
1247
- template <class K, class T, class H, class P, class A>
1248
- typename unordered_map<K,T,H,P,A>::size_type
1249
- unordered_map<K,T,H,P,A>::count(const key_type& k) const
1250
- {
1251
- return table_.count(k);
1252
- }
1480
+ template <class K, class T, class H, class P, class A>
1481
+ typename unordered_map<K, T, H, P, A>::iterator
1482
+ unordered_map<K, T, H, P, A>::find(const key_type& k)
1483
+ {
1484
+ return iterator(table_.find_node(k));
1485
+ }
1253
1486
 
1254
- template <class K, class T, class H, class P, class A>
1255
- std::pair<
1256
- typename unordered_map<K,T,H,P,A>::iterator,
1257
- typename unordered_map<K,T,H,P,A>::iterator>
1258
- unordered_map<K,T,H,P,A>::equal_range(const key_type& k)
1259
- {
1260
- return table_.equal_range(k);
1261
- }
1487
+ template <class K, class T, class H, class P, class A>
1488
+ typename unordered_map<K, T, H, P, A>::const_iterator
1489
+ unordered_map<K, T, H, P, A>::find(const key_type& k) const
1490
+ {
1491
+ return const_iterator(table_.find_node(k));
1492
+ }
1493
+
1494
+ template <class K, class T, class H, class P, class A>
1495
+ template <class CompatibleKey, class CompatibleHash, class CompatiblePredicate>
1496
+ typename unordered_map<K, T, H, P, A>::iterator
1497
+ unordered_map<K, T, H, P, A>::find(CompatibleKey const& k,
1498
+ CompatibleHash const& hash, CompatiblePredicate const& eq)
1499
+ {
1500
+ return iterator(table_.generic_find_node(k, hash, eq));
1501
+ }
1502
+
1503
+ template <class K, class T, class H, class P, class A>
1504
+ template <class CompatibleKey, class CompatibleHash, class CompatiblePredicate>
1505
+ typename unordered_map<K, T, H, P, A>::const_iterator
1506
+ unordered_map<K, T, H, P, A>::find(CompatibleKey const& k,
1507
+ CompatibleHash const& hash, CompatiblePredicate const& eq) const
1508
+ {
1509
+ return const_iterator(table_.generic_find_node(k, hash, eq));
1510
+ }
1262
1511
 
1263
- template <class K, class T, class H, class P, class A>
1264
- std::pair<
1265
- typename unordered_map<K,T,H,P,A>::const_iterator,
1266
- typename unordered_map<K,T,H,P,A>::const_iterator>
1267
- unordered_map<K,T,H,P,A>::equal_range(const key_type& k) const
1268
- {
1269
- return table_.equal_range(k);
1270
- }
1512
+ template <class K, class T, class H, class P, class A>
1513
+ typename unordered_map<K, T, H, P, A>::size_type
1514
+ unordered_map<K, T, H, P, A>::count(const key_type& k) const
1515
+ {
1516
+ return table_.count(k);
1517
+ }
1271
1518
 
1272
- template <class K, class T, class H, class P, class A>
1273
- typename unordered_map<K,T,H,P,A>::size_type
1274
- unordered_map<K,T,H,P,A>::bucket_size(size_type n) const
1275
- {
1276
- return table_.bucket_size(n);
1277
- }
1519
+ template <class K, class T, class H, class P, class A>
1520
+ std::pair<typename unordered_map<K, T, H, P, A>::iterator,
1521
+ typename unordered_map<K, T, H, P, A>::iterator>
1522
+ unordered_map<K, T, H, P, A>::equal_range(const key_type& k)
1523
+ {
1524
+ return table_.equal_range(k);
1525
+ }
1278
1526
 
1279
- // hash policy
1527
+ template <class K, class T, class H, class P, class A>
1528
+ std::pair<typename unordered_map<K, T, H, P, A>::const_iterator,
1529
+ typename unordered_map<K, T, H, P, A>::const_iterator>
1530
+ unordered_map<K, T, H, P, A>::equal_range(const key_type& k) const
1531
+ {
1532
+ return table_.equal_range(k);
1533
+ }
1280
1534
 
1281
- template <class K, class T, class H, class P, class A>
1282
- float unordered_map<K,T,H,P,A>::load_factor() const BOOST_NOEXCEPT
1283
- {
1284
- return table_.load_factor();
1285
- }
1535
+ template <class K, class T, class H, class P, class A>
1536
+ typename unordered_map<K, T, H, P, A>::size_type
1537
+ unordered_map<K, T, H, P, A>::bucket_size(size_type n) const
1538
+ {
1539
+ return table_.bucket_size(n);
1540
+ }
1286
1541
 
1287
- template <class K, class T, class H, class P, class A>
1288
- void unordered_map<K,T,H,P,A>::max_load_factor(float m) BOOST_NOEXCEPT
1289
- {
1290
- table_.max_load_factor(m);
1291
- }
1542
+ // hash policy
1292
1543
 
1293
- template <class K, class T, class H, class P, class A>
1294
- void unordered_map<K,T,H,P,A>::rehash(size_type n)
1295
- {
1296
- table_.rehash(n);
1297
- }
1544
+ template <class K, class T, class H, class P, class A>
1545
+ float unordered_map<K, T, H, P, A>::load_factor() const BOOST_NOEXCEPT
1546
+ {
1547
+ return table_.load_factor();
1548
+ }
1298
1549
 
1299
- template <class K, class T, class H, class P, class A>
1300
- void unordered_map<K,T,H,P,A>::reserve(size_type n)
1301
- {
1302
- table_.reserve(n);
1303
- }
1550
+ template <class K, class T, class H, class P, class A>
1551
+ void unordered_map<K, T, H, P, A>::max_load_factor(float m) BOOST_NOEXCEPT
1552
+ {
1553
+ table_.max_load_factor(m);
1554
+ }
1304
1555
 
1305
- template <class K, class T, class H, class P, class A>
1306
- inline bool operator==(
1307
- unordered_map<K,T,H,P,A> const& m1,
1308
- unordered_map<K,T,H,P,A> const& m2)
1309
- {
1556
+ template <class K, class T, class H, class P, class A>
1557
+ void unordered_map<K, T, H, P, A>::rehash(size_type n)
1558
+ {
1559
+ table_.rehash(n);
1560
+ }
1561
+
1562
+ template <class K, class T, class H, class P, class A>
1563
+ void unordered_map<K, T, H, P, A>::reserve(size_type n)
1564
+ {
1565
+ table_.reserve(n);
1566
+ }
1567
+
1568
+ template <class K, class T, class H, class P, class A>
1569
+ inline bool operator==(unordered_map<K, T, H, P, A> const& m1,
1570
+ unordered_map<K, T, H, P, A> const& m2)
1571
+ {
1310
1572
  #if BOOST_WORKAROUND(__CODEGEARC__, BOOST_TESTED_AT(0x0613))
1311
- struct dummy { unordered_map<K,T,H,P,A> x; };
1573
+ struct dummy
1574
+ {
1575
+ unordered_map<K, T, H, P, A> x;
1576
+ };
1312
1577
  #endif
1313
- return m1.table_.equals(m2.table_);
1314
- }
1578
+ return m1.table_.equals(m2.table_);
1579
+ }
1315
1580
 
1316
- template <class K, class T, class H, class P, class A>
1317
- inline bool operator!=(
1318
- unordered_map<K,T,H,P,A> const& m1,
1319
- unordered_map<K,T,H,P,A> const& m2)
1320
- {
1581
+ template <class K, class T, class H, class P, class A>
1582
+ inline bool operator!=(unordered_map<K, T, H, P, A> const& m1,
1583
+ unordered_map<K, T, H, P, A> const& m2)
1584
+ {
1321
1585
  #if BOOST_WORKAROUND(__CODEGEARC__, BOOST_TESTED_AT(0x0613))
1322
- struct dummy { unordered_map<K,T,H,P,A> x; };
1586
+ struct dummy
1587
+ {
1588
+ unordered_map<K, T, H, P, A> x;
1589
+ };
1323
1590
  #endif
1324
- return !m1.table_.equals(m2.table_);
1325
- }
1591
+ return !m1.table_.equals(m2.table_);
1592
+ }
1326
1593
 
1327
- template <class K, class T, class H, class P, class A>
1328
- inline void swap(
1329
- unordered_map<K,T,H,P,A> &m1,
1330
- unordered_map<K,T,H,P,A> &m2)
1331
- {
1594
+ template <class K, class T, class H, class P, class A>
1595
+ inline void swap(
1596
+ unordered_map<K, T, H, P, A>& m1, unordered_map<K, T, H, P, A>& m2)
1597
+ {
1332
1598
  #if BOOST_WORKAROUND(__CODEGEARC__, BOOST_TESTED_AT(0x0613))
1333
- struct dummy { unordered_map<K,T,H,P,A> x; };
1599
+ struct dummy
1600
+ {
1601
+ unordered_map<K, T, H, P, A> x;
1602
+ };
1334
1603
  #endif
1335
- m1.swap(m2);
1336
- }
1604
+ m1.swap(m2);
1605
+ }
1337
1606
 
1338
1607
  ////////////////////////////////////////////////////////////////////////////////
1339
1608
 
1340
- template <class K, class T, class H, class P, class A>
1341
- unordered_multimap<K,T,H,P,A>::unordered_multimap(
1342
- size_type n, const hasher &hf, const key_equal &eql,
1343
- const allocator_type &a)
1344
- : table_(n, hf, eql, a)
1345
- {
1346
- }
1609
+ template <class K, class T, class H, class P, class A>
1610
+ unordered_multimap<K, T, H, P, A>::unordered_multimap()
1611
+ : table_(boost::unordered::detail::default_bucket_count, hasher(),
1612
+ key_equal(), allocator_type())
1613
+ {
1614
+ }
1347
1615
 
1348
- template <class K, class T, class H, class P, class A>
1349
- unordered_multimap<K,T,H,P,A>::unordered_multimap(allocator_type const& a)
1350
- : table_(boost::unordered::detail::default_bucket_count,
1351
- hasher(), key_equal(), a)
1352
- {
1353
- }
1616
+ template <class K, class T, class H, class P, class A>
1617
+ unordered_multimap<K, T, H, P, A>::unordered_multimap(size_type n,
1618
+ const hasher& hf, const key_equal& eql, const allocator_type& a)
1619
+ : table_(n, hf, eql, a)
1620
+ {
1621
+ }
1354
1622
 
1355
- template <class K, class T, class H, class P, class A>
1356
- unordered_multimap<K,T,H,P,A>::unordered_multimap(
1357
- unordered_multimap const& other, allocator_type const& a)
1358
- : table_(other.table_, a)
1359
- {
1360
- }
1623
+ template <class K, class T, class H, class P, class A>
1624
+ unordered_multimap<K, T, H, P, A>::unordered_multimap(
1625
+ size_type n, const allocator_type& a)
1626
+ : table_(n, hasher(), key_equal(), a)
1627
+ {
1628
+ }
1361
1629
 
1362
- template <class K, class T, class H, class P, class A>
1363
- template <class InputIt>
1364
- unordered_multimap<K,T,H,P,A>::unordered_multimap(InputIt f, InputIt l)
1365
- : table_(boost::unordered::detail::initial_size(f, l),
1366
- hasher(), key_equal(), allocator_type())
1367
- {
1368
- table_.insert_range(f, l);
1369
- }
1630
+ template <class K, class T, class H, class P, class A>
1631
+ unordered_multimap<K, T, H, P, A>::unordered_multimap(
1632
+ size_type n, const hasher& hf, const allocator_type& a)
1633
+ : table_(n, hf, key_equal(), a)
1634
+ {
1635
+ }
1370
1636
 
1371
- template <class K, class T, class H, class P, class A>
1372
- template <class InputIt>
1373
- unordered_multimap<K,T,H,P,A>::unordered_multimap(
1374
- InputIt f, InputIt l,
1375
- size_type n,
1376
- const hasher &hf,
1377
- const key_equal &eql)
1378
- : table_(boost::unordered::detail::initial_size(f, l, n),
1379
- hf, eql, allocator_type())
1380
- {
1381
- table_.insert_range(f, l);
1382
- }
1383
-
1384
- template <class K, class T, class H, class P, class A>
1385
- template <class InputIt>
1386
- unordered_multimap<K,T,H,P,A>::unordered_multimap(
1387
- InputIt f, InputIt l,
1388
- size_type n,
1389
- const hasher &hf,
1390
- const key_equal &eql,
1391
- const allocator_type &a)
1392
- : table_(boost::unordered::detail::initial_size(f, l, n), hf, eql, a)
1393
- {
1394
- table_.insert_range(f, l);
1395
- }
1396
-
1397
- template <class K, class T, class H, class P, class A>
1398
- unordered_multimap<K,T,H,P,A>::~unordered_multimap() BOOST_NOEXCEPT {}
1637
+ template <class K, class T, class H, class P, class A>
1638
+ unordered_multimap<K, T, H, P, A>::unordered_multimap(allocator_type const& a)
1639
+ : table_(boost::unordered::detail::default_bucket_count, hasher(),
1640
+ key_equal(), a)
1641
+ {
1642
+ }
1399
1643
 
1400
- template <class K, class T, class H, class P, class A>
1401
- unordered_multimap<K,T,H,P,A>::unordered_multimap(
1402
- unordered_multimap const& other)
1403
- : table_(other.table_)
1404
- {
1405
- }
1644
+ template <class K, class T, class H, class P, class A>
1645
+ unordered_multimap<K, T, H, P, A>::unordered_multimap(
1646
+ unordered_multimap const& other, allocator_type const& a)
1647
+ : table_(other.table_, a)
1648
+ {
1649
+ }
1406
1650
 
1407
- #if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
1651
+ template <class K, class T, class H, class P, class A>
1652
+ template <class InputIt>
1653
+ unordered_multimap<K, T, H, P, A>::unordered_multimap(InputIt f, InputIt l)
1654
+ : table_(boost::unordered::detail::initial_size(f, l), hasher(),
1655
+ key_equal(), allocator_type())
1656
+ {
1657
+ table_.insert_range(f, l);
1658
+ }
1659
+
1660
+ template <class K, class T, class H, class P, class A>
1661
+ template <class InputIt>
1662
+ unordered_multimap<K, T, H, P, A>::unordered_multimap(
1663
+ InputIt f, InputIt l, size_type n, const hasher& hf, const key_equal& eql)
1664
+ : table_(boost::unordered::detail::initial_size(f, l, n), hf, eql,
1665
+ allocator_type())
1666
+ {
1667
+ table_.insert_range(f, l);
1668
+ }
1669
+
1670
+ template <class K, class T, class H, class P, class A>
1671
+ template <class InputIt>
1672
+ unordered_multimap<K, T, H, P, A>::unordered_multimap(InputIt f, InputIt l,
1673
+ size_type n, const hasher& hf, const key_equal& eql,
1674
+ const allocator_type& a)
1675
+ : table_(boost::unordered::detail::initial_size(f, l, n), hf, eql, a)
1676
+ {
1677
+ table_.insert_range(f, l);
1678
+ }
1679
+
1680
+ template <class K, class T, class H, class P, class A>
1681
+ template <class InputIt>
1682
+ unordered_multimap<K, T, H, P, A>::unordered_multimap(InputIt f, InputIt l,
1683
+ size_type n, const hasher& hf, const allocator_type& a)
1684
+ : table_(
1685
+ boost::unordered::detail::initial_size(f, l, n), hf, key_equal(), a)
1686
+ {
1687
+ table_.insert_range(f, l);
1688
+ }
1689
+
1690
+ template <class K, class T, class H, class P, class A>
1691
+ template <class InputIt>
1692
+ unordered_multimap<K, T, H, P, A>::unordered_multimap(
1693
+ InputIt f, InputIt l, size_type n, const allocator_type& a)
1694
+ : table_(boost::unordered::detail::initial_size(f, l, n), hasher(),
1695
+ key_equal(), a)
1696
+ {
1697
+ table_.insert_range(f, l);
1698
+ }
1408
1699
 
1409
- template <class K, class T, class H, class P, class A>
1410
- unordered_multimap<K,T,H,P,A>::unordered_multimap(
1411
- unordered_multimap&& other, allocator_type const& a)
1412
- : table_(other.table_, a, boost::unordered::detail::move_tag())
1413
- {
1414
- }
1700
+ template <class K, class T, class H, class P, class A>
1701
+ unordered_multimap<K, T, H, P, A>::~unordered_multimap() BOOST_NOEXCEPT
1702
+ {
1703
+ }
1415
1704
 
1416
- #endif
1705
+ template <class K, class T, class H, class P, class A>
1706
+ unordered_multimap<K, T, H, P, A>::unordered_multimap(
1707
+ unordered_multimap const& other)
1708
+ : table_(other.table_)
1709
+ {
1710
+ }
1711
+
1712
+ template <class K, class T, class H, class P, class A>
1713
+ unordered_multimap<K, T, H, P, A>::unordered_multimap(
1714
+ BOOST_RV_REF(unordered_multimap) other, allocator_type const& a)
1715
+ : table_(other.table_, a, boost::unordered::detail::move_tag())
1716
+ {
1717
+ }
1417
1718
 
1418
1719
  #if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
1419
1720
 
1420
- template <class K, class T, class H, class P, class A>
1421
- unordered_multimap<K,T,H,P,A>::unordered_multimap(
1422
- std::initializer_list<value_type> list, size_type n,
1423
- const hasher &hf, const key_equal &eql, const allocator_type &a)
1424
- : table_(
1425
- boost::unordered::detail::initial_size(
1426
- list.begin(), list.end(), n),
1427
- hf, eql, a)
1428
- {
1429
- table_.insert_range(list.begin(), list.end());
1430
- }
1721
+ template <class K, class T, class H, class P, class A>
1722
+ unordered_multimap<K, T, H, P, A>::unordered_multimap(
1723
+ std::initializer_list<value_type> list, size_type n, const hasher& hf,
1724
+ const key_equal& eql, const allocator_type& a)
1725
+ : table_(
1726
+ boost::unordered::detail::initial_size(list.begin(), list.end(), n),
1727
+ hf, eql, a)
1728
+ {
1729
+ table_.insert_range(list.begin(), list.end());
1730
+ }
1731
+
1732
+ template <class K, class T, class H, class P, class A>
1733
+ unordered_multimap<K, T, H, P, A>::unordered_multimap(
1734
+ std::initializer_list<value_type> list, size_type n, const hasher& hf,
1735
+ const allocator_type& a)
1736
+ : table_(
1737
+ boost::unordered::detail::initial_size(list.begin(), list.end(), n),
1738
+ hf, key_equal(), a)
1739
+ {
1740
+ table_.insert_range(list.begin(), list.end());
1741
+ }
1742
+
1743
+ template <class K, class T, class H, class P, class A>
1744
+ unordered_multimap<K, T, H, P, A>::unordered_multimap(
1745
+ std::initializer_list<value_type> list, size_type n,
1746
+ const allocator_type& a)
1747
+ : table_(
1748
+ boost::unordered::detail::initial_size(list.begin(), list.end(), n),
1749
+ hasher(), key_equal(), a)
1750
+ {
1751
+ table_.insert_range(list.begin(), list.end());
1752
+ }
1431
1753
 
1432
- template <class K, class T, class H, class P, class A>
1433
- unordered_multimap<K,T,H,P,A>& unordered_multimap<K,T,H,P,A>::operator=(
1434
- std::initializer_list<value_type> list)
1435
- {
1436
- table_.clear();
1437
- table_.insert_range(list.begin(), list.end());
1438
- return *this;
1439
- }
1754
+ template <class K, class T, class H, class P, class A>
1755
+ unordered_multimap<K, T, H, P, A>& unordered_multimap<K, T, H, P, A>::operator=(
1756
+ std::initializer_list<value_type> list)
1757
+ {
1758
+ table_.clear();
1759
+ table_.insert_range(list.begin(), list.end());
1760
+ return *this;
1761
+ }
1440
1762
 
1441
1763
  #endif
1442
1764
 
1443
- // size and capacity
1765
+ // size and capacity
1444
1766
 
1445
- template <class K, class T, class H, class P, class A>
1446
- std::size_t unordered_multimap<K,T,H,P,A>::max_size() const BOOST_NOEXCEPT
1447
- {
1448
- return table_.max_size();
1449
- }
1767
+ template <class K, class T, class H, class P, class A>
1768
+ std::size_t unordered_multimap<K, T, H, P, A>::max_size() const BOOST_NOEXCEPT
1769
+ {
1770
+ return table_.max_size();
1771
+ }
1450
1772
 
1451
- // modifiers
1773
+ // modifiers
1452
1774
 
1453
- template <class K, class T, class H, class P, class A>
1454
- template <class InputIt>
1455
- void unordered_multimap<K,T,H,P,A>::insert(InputIt first, InputIt last)
1456
- {
1457
- table_.insert_range(first, last);
1458
- }
1775
+ template <class K, class T, class H, class P, class A>
1776
+ template <class InputIt>
1777
+ void unordered_multimap<K, T, H, P, A>::insert(InputIt first, InputIt last)
1778
+ {
1779
+ table_.insert_range(first, last);
1780
+ }
1459
1781
 
1460
1782
  #if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
1461
- template <class K, class T, class H, class P, class A>
1462
- void unordered_multimap<K,T,H,P,A>::insert(
1463
- std::initializer_list<value_type> list)
1464
- {
1465
- table_.insert_range(list.begin(), list.end());
1466
- }
1783
+ template <class K, class T, class H, class P, class A>
1784
+ void unordered_multimap<K, T, H, P, A>::insert(
1785
+ std::initializer_list<value_type> list)
1786
+ {
1787
+ table_.insert_range(list.begin(), list.end());
1788
+ }
1467
1789
  #endif
1468
1790
 
1469
- template <class K, class T, class H, class P, class A>
1470
- typename unordered_multimap<K,T,H,P,A>::iterator
1471
- unordered_multimap<K,T,H,P,A>::erase(const_iterator position)
1472
- {
1473
- return table_.erase(position);
1474
- }
1791
+ template <class K, class T, class H, class P, class A>
1792
+ typename unordered_multimap<K, T, H, P, A>::iterator
1793
+ unordered_multimap<K, T, H, P, A>::erase(const_iterator position)
1794
+ {
1795
+ return table_.erase(position);
1796
+ }
1475
1797
 
1476
- template <class K, class T, class H, class P, class A>
1477
- typename unordered_multimap<K,T,H,P,A>::size_type
1478
- unordered_multimap<K,T,H,P,A>::erase(const key_type& k)
1479
- {
1480
- return table_.erase_key(k);
1798
+ template <class K, class T, class H, class P, class A>
1799
+ typename unordered_multimap<K, T, H, P, A>::size_type
1800
+ unordered_multimap<K, T, H, P, A>::erase(const key_type& k)
1801
+ {
1802
+ return table_.erase_key(k);
1803
+ }
1804
+
1805
+ template <class K, class T, class H, class P, class A>
1806
+ typename unordered_multimap<K, T, H, P, A>::iterator
1807
+ unordered_multimap<K, T, H, P, A>::erase(
1808
+ const_iterator first, const_iterator last)
1809
+ {
1810
+ return table_.erase_range(first, last);
1811
+ }
1812
+
1813
+ template <class K, class T, class H, class P, class A>
1814
+ void unordered_multimap<K, T, H, P, A>::clear()
1815
+ {
1816
+ table_.clear();
1817
+ }
1818
+
1819
+ template <class K, class T, class H, class P, class A>
1820
+ void unordered_multimap<K, T, H, P, A>::swap(unordered_multimap& other)
1821
+ {
1822
+ table_.swap(other.table_);
1823
+ }
1824
+
1825
+ // observers
1826
+
1827
+ template <class K, class T, class H, class P, class A>
1828
+ typename unordered_multimap<K, T, H, P, A>::hasher
1829
+ unordered_multimap<K, T, H, P, A>::hash_function() const
1830
+ {
1831
+ return table_.hash_function();
1832
+ }
1833
+
1834
+ template <class K, class T, class H, class P, class A>
1835
+ typename unordered_multimap<K, T, H, P, A>::key_equal
1836
+ unordered_multimap<K, T, H, P, A>::key_eq() const
1837
+ {
1838
+ return table_.key_eq();
1839
+ }
1840
+
1841
+ template <class K, class T, class H, class P, class A>
1842
+ template <typename H2, typename P2>
1843
+ void unordered_multimap<K, T, H, P, A>::merge(
1844
+ boost::unordered_multimap<K, T, H2, P2, A>& source)
1845
+ {
1846
+ while (!source.empty()) {
1847
+ insert(source.extract(source.begin()));
1481
1848
  }
1849
+ }
1482
1850
 
1483
- template <class K, class T, class H, class P, class A>
1484
- typename unordered_multimap<K,T,H,P,A>::iterator
1485
- unordered_multimap<K,T,H,P,A>::erase(
1486
- const_iterator first, const_iterator last)
1487
- {
1488
- return table_.erase_range(first, last);
1851
+ #if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
1852
+ template <class K, class T, class H, class P, class A>
1853
+ template <typename H2, typename P2>
1854
+ void unordered_multimap<K, T, H, P, A>::merge(
1855
+ boost::unordered_multimap<K, T, H2, P2, A>&& source)
1856
+ {
1857
+ while (!source.empty()) {
1858
+ insert(source.extract(source.begin()));
1489
1859
  }
1860
+ }
1861
+ #endif
1490
1862
 
1491
- template <class K, class T, class H, class P, class A>
1492
- void unordered_multimap<K,T,H,P,A>::clear()
1493
- {
1494
- table_.clear();
1863
+ #if BOOST_UNORDERED_INTEROPERABLE_NODES
1864
+ template <class K, class T, class H, class P, class A>
1865
+ template <typename H2, typename P2>
1866
+ void unordered_multimap<K, T, H, P, A>::merge(
1867
+ boost::unordered_map<K, T, H2, P2, A>& source)
1868
+ {
1869
+ while (!source.empty()) {
1870
+ insert(source.extract(source.begin()));
1495
1871
  }
1872
+ }
1496
1873
 
1497
- template <class K, class T, class H, class P, class A>
1498
- void unordered_multimap<K,T,H,P,A>::swap(unordered_multimap& other)
1499
- {
1500
- table_.swap(other.table_);
1874
+ #if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
1875
+ template <class K, class T, class H, class P, class A>
1876
+ template <typename H2, typename P2>
1877
+ void unordered_multimap<K, T, H, P, A>::merge(
1878
+ boost::unordered_map<K, T, H2, P2, A>&& source)
1879
+ {
1880
+ while (!source.empty()) {
1881
+ insert(source.extract(source.begin()));
1501
1882
  }
1883
+ }
1884
+ #endif
1885
+ #endif
1502
1886
 
1503
- // observers
1887
+ // lookup
1504
1888
 
1505
- template <class K, class T, class H, class P, class A>
1506
- typename unordered_multimap<K,T,H,P,A>::hasher
1507
- unordered_multimap<K,T,H,P,A>::hash_function() const
1508
- {
1509
- return table_.hash_function();
1510
- }
1889
+ template <class K, class T, class H, class P, class A>
1890
+ typename unordered_multimap<K, T, H, P, A>::iterator
1891
+ unordered_multimap<K, T, H, P, A>::find(const key_type& k)
1892
+ {
1893
+ return iterator(table_.find_node(k));
1894
+ }
1511
1895
 
1512
- template <class K, class T, class H, class P, class A>
1513
- typename unordered_multimap<K,T,H,P,A>::key_equal
1514
- unordered_multimap<K,T,H,P,A>::key_eq() const
1515
- {
1516
- return table_.key_eq();
1517
- }
1896
+ template <class K, class T, class H, class P, class A>
1897
+ typename unordered_multimap<K, T, H, P, A>::const_iterator
1898
+ unordered_multimap<K, T, H, P, A>::find(const key_type& k) const
1899
+ {
1900
+ return const_iterator(table_.find_node(k));
1901
+ }
1902
+
1903
+ template <class K, class T, class H, class P, class A>
1904
+ template <class CompatibleKey, class CompatibleHash, class CompatiblePredicate>
1905
+ typename unordered_multimap<K, T, H, P, A>::iterator
1906
+ unordered_multimap<K, T, H, P, A>::find(CompatibleKey const& k,
1907
+ CompatibleHash const& hash, CompatiblePredicate const& eq)
1908
+ {
1909
+ return iterator(table_.generic_find_node(k, hash, eq));
1910
+ }
1911
+
1912
+ template <class K, class T, class H, class P, class A>
1913
+ template <class CompatibleKey, class CompatibleHash, class CompatiblePredicate>
1914
+ typename unordered_multimap<K, T, H, P, A>::const_iterator
1915
+ unordered_multimap<K, T, H, P, A>::find(CompatibleKey const& k,
1916
+ CompatibleHash const& hash, CompatiblePredicate const& eq) const
1917
+ {
1918
+ return const_iterator(table_.generic_find_node(k, hash, eq));
1919
+ }
1518
1920
 
1519
- // lookup
1921
+ template <class K, class T, class H, class P, class A>
1922
+ typename unordered_multimap<K, T, H, P, A>::size_type
1923
+ unordered_multimap<K, T, H, P, A>::count(const key_type& k) const
1924
+ {
1925
+ return table_.count(k);
1926
+ }
1520
1927
 
1521
- template <class K, class T, class H, class P, class A>
1522
- typename unordered_multimap<K,T,H,P,A>::iterator
1523
- unordered_multimap<K,T,H,P,A>::find(const key_type& k)
1928
+ template <class K, class T, class H, class P, class A>
1929
+ std::pair<typename unordered_multimap<K, T, H, P, A>::iterator,
1930
+ typename unordered_multimap<K, T, H, P, A>::iterator>
1931
+ unordered_multimap<K, T, H, P, A>::equal_range(const key_type& k)
1932
+ {
1933
+ return table_.equal_range(k);
1934
+ }
1935
+
1936
+ template <class K, class T, class H, class P, class A>
1937
+ std::pair<typename unordered_multimap<K, T, H, P, A>::const_iterator,
1938
+ typename unordered_multimap<K, T, H, P, A>::const_iterator>
1939
+ unordered_multimap<K, T, H, P, A>::equal_range(const key_type& k) const
1940
+ {
1941
+ return table_.equal_range(k);
1942
+ }
1943
+
1944
+ template <class K, class T, class H, class P, class A>
1945
+ typename unordered_multimap<K, T, H, P, A>::size_type
1946
+ unordered_multimap<K, T, H, P, A>::bucket_size(size_type n) const
1947
+ {
1948
+ return table_.bucket_size(n);
1949
+ }
1950
+
1951
+ // hash policy
1952
+
1953
+ template <class K, class T, class H, class P, class A>
1954
+ float unordered_multimap<K, T, H, P, A>::load_factor() const BOOST_NOEXCEPT
1955
+ {
1956
+ return table_.load_factor();
1957
+ }
1958
+
1959
+ template <class K, class T, class H, class P, class A>
1960
+ void unordered_multimap<K, T, H, P, A>::max_load_factor(float m) BOOST_NOEXCEPT
1961
+ {
1962
+ table_.max_load_factor(m);
1963
+ }
1964
+
1965
+ template <class K, class T, class H, class P, class A>
1966
+ void unordered_multimap<K, T, H, P, A>::rehash(size_type n)
1967
+ {
1968
+ table_.rehash(n);
1969
+ }
1970
+
1971
+ template <class K, class T, class H, class P, class A>
1972
+ void unordered_multimap<K, T, H, P, A>::reserve(size_type n)
1973
+ {
1974
+ table_.reserve(n);
1975
+ }
1976
+
1977
+ template <class K, class T, class H, class P, class A>
1978
+ inline bool operator==(unordered_multimap<K, T, H, P, A> const& m1,
1979
+ unordered_multimap<K, T, H, P, A> const& m2)
1980
+ {
1981
+ #if BOOST_WORKAROUND(__CODEGEARC__, BOOST_TESTED_AT(0x0613))
1982
+ struct dummy
1524
1983
  {
1525
- return table_.find_node(k);
1526
- }
1984
+ unordered_multimap<K, T, H, P, A> x;
1985
+ };
1986
+ #endif
1987
+ return m1.table_.equals(m2.table_);
1988
+ }
1527
1989
 
1528
- template <class K, class T, class H, class P, class A>
1529
- typename unordered_multimap<K,T,H,P,A>::const_iterator
1530
- unordered_multimap<K,T,H,P,A>::find(const key_type& k) const
1990
+ template <class K, class T, class H, class P, class A>
1991
+ inline bool operator!=(unordered_multimap<K, T, H, P, A> const& m1,
1992
+ unordered_multimap<K, T, H, P, A> const& m2)
1993
+ {
1994
+ #if BOOST_WORKAROUND(__CODEGEARC__, BOOST_TESTED_AT(0x0613))
1995
+ struct dummy
1531
1996
  {
1532
- return table_.find_node(k);
1533
- }
1997
+ unordered_multimap<K, T, H, P, A> x;
1998
+ };
1999
+ #endif
2000
+ return !m1.table_.equals(m2.table_);
2001
+ }
1534
2002
 
1535
- template <class K, class T, class H, class P, class A>
1536
- template <class CompatibleKey, class CompatibleHash,
1537
- class CompatiblePredicate>
1538
- typename unordered_multimap<K,T,H,P,A>::iterator
1539
- unordered_multimap<K,T,H,P,A>::find(
1540
- CompatibleKey const& k,
1541
- CompatibleHash const& hash,
1542
- CompatiblePredicate const& eq)
2003
+ template <class K, class T, class H, class P, class A>
2004
+ inline void swap(unordered_multimap<K, T, H, P, A>& m1,
2005
+ unordered_multimap<K, T, H, P, A>& m2)
2006
+ {
2007
+ #if BOOST_WORKAROUND(__CODEGEARC__, BOOST_TESTED_AT(0x0613))
2008
+ struct dummy
1543
2009
  {
1544
- return table_.generic_find_node(k, hash, eq);
1545
- }
2010
+ unordered_multimap<K, T, H, P, A> x;
2011
+ };
2012
+ #endif
2013
+ m1.swap(m2);
2014
+ }
1546
2015
 
1547
- template <class K, class T, class H, class P, class A>
1548
- template <class CompatibleKey, class CompatibleHash,
1549
- class CompatiblePredicate>
1550
- typename unordered_multimap<K,T,H,P,A>::const_iterator
1551
- unordered_multimap<K,T,H,P,A>::find(
1552
- CompatibleKey const& k,
1553
- CompatibleHash const& hash,
1554
- CompatiblePredicate const& eq) const
2016
+ template <typename N, class K, class T, class A> class node_handle_map
2017
+ {
2018
+ BOOST_MOVABLE_BUT_NOT_COPYABLE(node_handle_map)
2019
+
2020
+ template <typename Types>
2021
+ friend struct ::boost::unordered::detail::table_impl;
2022
+ template <typename Types>
2023
+ friend struct ::boost::unordered::detail::grouped_table_impl;
2024
+
2025
+ typedef typename boost::unordered::detail::rebind_wrap<A,
2026
+ std::pair<K const, T> >::type value_allocator;
2027
+ typedef boost::unordered::detail::allocator_traits<value_allocator>
2028
+ value_allocator_traits;
2029
+ typedef N node;
2030
+ typedef typename boost::unordered::detail::rebind_wrap<A, node>::type
2031
+ node_allocator;
2032
+ typedef boost::unordered::detail::allocator_traits<node_allocator>
2033
+ node_allocator_traits;
2034
+ typedef typename node_allocator_traits::pointer node_pointer;
2035
+
2036
+ public:
2037
+ typedef K key_type;
2038
+ typedef T mapped_type;
2039
+ typedef A allocator_type;
2040
+
2041
+ private:
2042
+ node_pointer ptr_;
2043
+ bool has_alloc_;
2044
+ boost::unordered::detail::value_base<value_allocator> alloc_;
2045
+
2046
+ public:
2047
+ BOOST_CONSTEXPR node_handle_map() BOOST_NOEXCEPT : ptr_(), has_alloc_(false)
1555
2048
  {
1556
- return table_.generic_find_node(k, hash, eq);
1557
2049
  }
1558
2050
 
1559
- template <class K, class T, class H, class P, class A>
1560
- typename unordered_multimap<K,T,H,P,A>::size_type
1561
- unordered_multimap<K,T,H,P,A>::count(const key_type& k) const
2051
+ /*BOOST_CONSTEXPR */ node_handle_map(
2052
+ node_pointer ptr, allocator_type const& a)
2053
+ : ptr_(ptr), has_alloc_(false)
1562
2054
  {
1563
- return table_.count(k);
2055
+ if (ptr_) {
2056
+ new ((void*)&alloc_) value_allocator(a);
2057
+ has_alloc_ = true;
2058
+ }
1564
2059
  }
1565
2060
 
1566
- template <class K, class T, class H, class P, class A>
1567
- std::pair<
1568
- typename unordered_multimap<K,T,H,P,A>::iterator,
1569
- typename unordered_multimap<K,T,H,P,A>::iterator>
1570
- unordered_multimap<K,T,H,P,A>::equal_range(const key_type& k)
2061
+ ~node_handle_map()
1571
2062
  {
1572
- return table_.equal_range(k);
2063
+ if (has_alloc_ && ptr_) {
2064
+ node_allocator node_alloc(alloc_.value());
2065
+ boost::unordered::detail::node_tmp<node_allocator> tmp(
2066
+ ptr_, node_alloc);
2067
+ }
2068
+ if (has_alloc_) {
2069
+ alloc_.value_ptr()->~value_allocator();
2070
+ }
1573
2071
  }
1574
2072
 
1575
- template <class K, class T, class H, class P, class A>
1576
- std::pair<
1577
- typename unordered_multimap<K,T,H,P,A>::const_iterator,
1578
- typename unordered_multimap<K,T,H,P,A>::const_iterator>
1579
- unordered_multimap<K,T,H,P,A>::equal_range(const key_type& k) const
2073
+ node_handle_map(BOOST_RV_REF(node_handle_map) n) BOOST_NOEXCEPT
2074
+ : ptr_(n.ptr_),
2075
+ has_alloc_(false)
1580
2076
  {
1581
- return table_.equal_range(k);
2077
+ if (n.has_alloc_) {
2078
+ new ((void*)&alloc_) value_allocator(boost::move(n.alloc_.value()));
2079
+ has_alloc_ = true;
2080
+ n.ptr_ = node_pointer();
2081
+ n.alloc_.value_ptr()->~value_allocator();
2082
+ n.has_alloc_ = false;
2083
+ }
1582
2084
  }
1583
2085
 
1584
- template <class K, class T, class H, class P, class A>
1585
- typename unordered_multimap<K,T,H,P,A>::size_type
1586
- unordered_multimap<K,T,H,P,A>::bucket_size(size_type n) const
2086
+ node_handle_map& operator=(BOOST_RV_REF(node_handle_map) n)
1587
2087
  {
1588
- return table_.bucket_size(n);
1589
- }
2088
+ BOOST_ASSERT(!has_alloc_ ||
2089
+ value_allocator_traits::
2090
+ propagate_on_container_move_assignment::value ||
2091
+ (n.has_alloc_ && alloc_.value() == n.alloc_.value()));
1590
2092
 
1591
- // hash policy
2093
+ if (ptr_) {
2094
+ node_allocator node_alloc(alloc_.value());
2095
+ boost::unordered::detail::node_tmp<node_allocator> tmp(
2096
+ ptr_, node_alloc);
2097
+ ptr_ = node_pointer();
2098
+ }
1592
2099
 
1593
- template <class K, class T, class H, class P, class A>
1594
- float unordered_multimap<K,T,H,P,A>::load_factor() const BOOST_NOEXCEPT
1595
- {
1596
- return table_.load_factor();
1597
- }
2100
+ if (has_alloc_) {
2101
+ alloc_.value_ptr()->~value_allocator();
2102
+ has_alloc_ = false;
2103
+ }
1598
2104
 
1599
- template <class K, class T, class H, class P, class A>
1600
- void unordered_multimap<K,T,H,P,A>::max_load_factor(float m) BOOST_NOEXCEPT
1601
- {
1602
- table_.max_load_factor(m);
2105
+ if (!has_alloc_ && n.has_alloc_) {
2106
+ move_allocator(n);
2107
+ }
2108
+
2109
+ ptr_ = n.ptr_;
2110
+ n.ptr_ = node_pointer();
2111
+
2112
+ return *this;
1603
2113
  }
1604
2114
 
1605
- template <class K, class T, class H, class P, class A>
1606
- void unordered_multimap<K,T,H,P,A>::rehash(size_type n)
2115
+ key_type& key() const { return const_cast<key_type&>(ptr_->value().first); }
2116
+
2117
+ mapped_type& mapped() const { return ptr_->value().second; }
2118
+
2119
+ allocator_type get_allocator() const { return alloc_.value(); }
2120
+
2121
+ BOOST_EXPLICIT_OPERATOR_BOOL_NOEXCEPT()
2122
+
2123
+ bool operator!() const BOOST_NOEXCEPT { return ptr_ ? 0 : 1; }
2124
+
2125
+ bool empty() const BOOST_NOEXCEPT { return ptr_ ? 0 : 1; }
2126
+
2127
+ void swap(node_handle_map& n) BOOST_NOEXCEPT_IF(
2128
+ value_allocator_traits::propagate_on_container_swap::value
2129
+ /* || value_allocator_traits::is_always_equal::value */)
1607
2130
  {
1608
- table_.rehash(n);
2131
+ if (!has_alloc_) {
2132
+ if (n.has_alloc_) {
2133
+ move_allocator(n);
2134
+ }
2135
+ } else if (!n.has_alloc_) {
2136
+ n.move_allocator(*this);
2137
+ } else {
2138
+ swap_impl(n, boost::unordered::detail::integral_constant<bool,
2139
+ value_allocator_traits::
2140
+ propagate_on_container_swap::value>());
2141
+ }
2142
+ boost::swap(ptr_, n.ptr_);
1609
2143
  }
1610
2144
 
1611
- template <class K, class T, class H, class P, class A>
1612
- void unordered_multimap<K,T,H,P,A>::reserve(size_type n)
2145
+ private:
2146
+ void move_allocator(node_handle_map& n)
1613
2147
  {
1614
- table_.reserve(n);
2148
+ new ((void*)&alloc_) value_allocator(boost::move(n.alloc_.value()));
2149
+ n.alloc_.value_ptr()->~value_allocator();
2150
+ has_alloc_ = true;
2151
+ n.has_alloc_ = false;
1615
2152
  }
1616
2153
 
1617
- template <class K, class T, class H, class P, class A>
1618
- inline bool operator==(
1619
- unordered_multimap<K,T,H,P,A> const& m1,
1620
- unordered_multimap<K,T,H,P,A> const& m2)
2154
+ void swap_impl(node_handle_map&, boost::unordered::detail::false_type) {}
2155
+
2156
+ void swap_impl(node_handle_map& n, boost::unordered::detail::true_type)
1621
2157
  {
1622
- #if BOOST_WORKAROUND(__CODEGEARC__, BOOST_TESTED_AT(0x0613))
1623
- struct dummy { unordered_multimap<K,T,H,P,A> x; };
1624
- #endif
1625
- return m1.table_.equals(m2.table_);
2158
+ boost::swap(alloc_, n.alloc_);
1626
2159
  }
2160
+ };
1627
2161
 
1628
- template <class K, class T, class H, class P, class A>
1629
- inline bool operator!=(
1630
- unordered_multimap<K,T,H,P,A> const& m1,
1631
- unordered_multimap<K,T,H,P,A> const& m2)
2162
+ template <class N, class K, class T, class A>
2163
+ void swap(node_handle_map<N, K, T, A>& x, node_handle_map<N, K, T, A>& y)
2164
+ BOOST_NOEXCEPT_IF(BOOST_NOEXCEPT_EXPR(x.swap(y)))
2165
+ {
2166
+ x.swap(y);
2167
+ }
2168
+
2169
+ template <class N, class K, class T, class A> struct insert_return_type_map
2170
+ {
2171
+ private:
2172
+ BOOST_MOVABLE_BUT_NOT_COPYABLE(insert_return_type_map)
2173
+
2174
+ typedef typename boost::unordered::detail::rebind_wrap<A,
2175
+ std::pair<K const, T> >::type value_allocator;
2176
+ typedef N node_;
2177
+
2178
+ public:
2179
+ bool inserted;
2180
+ boost::unordered::iterator_detail::iterator<node_> position;
2181
+ boost::unordered::node_handle_map<N, K, T, A> node;
2182
+
2183
+ insert_return_type_map() : inserted(false), position(), node() {}
2184
+
2185
+ insert_return_type_map(BOOST_RV_REF(insert_return_type_map)
2186
+ x) BOOST_NOEXCEPT : inserted(x.inserted),
2187
+ position(x.position),
2188
+ node(boost::move(x.node))
1632
2189
  {
1633
- #if BOOST_WORKAROUND(__CODEGEARC__, BOOST_TESTED_AT(0x0613))
1634
- struct dummy { unordered_multimap<K,T,H,P,A> x; };
1635
- #endif
1636
- return !m1.table_.equals(m2.table_);
1637
2190
  }
1638
2191
 
1639
- template <class K, class T, class H, class P, class A>
1640
- inline void swap(
1641
- unordered_multimap<K,T,H,P,A> &m1,
1642
- unordered_multimap<K,T,H,P,A> &m2)
2192
+ insert_return_type_map& operator=(BOOST_RV_REF(insert_return_type_map) x)
1643
2193
  {
1644
- #if BOOST_WORKAROUND(__CODEGEARC__, BOOST_TESTED_AT(0x0613))
1645
- struct dummy { unordered_multimap<K,T,H,P,A> x; };
1646
- #endif
1647
- m1.swap(m2);
2194
+ inserted = x.inserted;
2195
+ position = x.position;
2196
+ node = boost::move(x.node);
2197
+ return *this;
1648
2198
  }
2199
+ };
1649
2200
 
2201
+ template <class N, class K, class T, class A>
2202
+ void swap(insert_return_type_map<N, K, T, A>& x,
2203
+ insert_return_type_map<N, K, T, A>& y)
2204
+ {
2205
+ boost::swap(x.node, y.node);
2206
+ boost::swap(x.inserted, y.inserted);
2207
+ boost::swap(x.position, y.position);
2208
+ }
1650
2209
  } // namespace unordered
1651
2210
  } // namespace boost
1652
2211