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,196 @@
1
+ // Copyright (C) 2003, 2008 Fernando Luis Cacciola Carballal.
2
+ // Copyright (C) 2015 Andrzej Krzemienski.
3
+ //
4
+ // Use, modification, and distribution is subject to the Boost Software
5
+ // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
6
+ // http://www.boost.org/LICENSE_1_0.txt)
7
+ //
8
+ // See http://www.boost.org/libs/optional for documentation.
9
+ //
10
+ // You are welcome to contact the author at:
11
+ // akrzemi1@gmail.com
12
+
13
+ #ifndef BOOST_OPTIONAL_DETAIL_OPTIONAL_RELOPS_AJK_03OCT2015_HPP
14
+ #define BOOST_OPTIONAL_DETAIL_OPTIONAL_RELOPS_AJK_03OCT2015_HPP
15
+
16
+ namespace boost {
17
+
18
+ // optional's relational operators ( ==, !=, <, >, <=, >= ) have deep-semantics (compare values).
19
+ // WARNING: This is UNLIKE pointers. Use equal_pointees()/less_pointess() in generic code instead.
20
+
21
+
22
+ //
23
+ // optional<T> vs optional<T> cases
24
+ //
25
+
26
+ template<class T>
27
+ inline
28
+ bool operator == ( optional<T> const& x, optional<T> const& y )
29
+ { return equal_pointees(x,y); }
30
+
31
+ template<class T>
32
+ inline
33
+ bool operator < ( optional<T> const& x, optional<T> const& y )
34
+ { return less_pointees(x,y); }
35
+
36
+ template<class T>
37
+ inline
38
+ bool operator != ( optional<T> const& x, optional<T> const& y )
39
+ { return !( x == y ) ; }
40
+
41
+ template<class T>
42
+ inline
43
+ bool operator > ( optional<T> const& x, optional<T> const& y )
44
+ { return y < x ; }
45
+
46
+ template<class T>
47
+ inline
48
+ bool operator <= ( optional<T> const& x, optional<T> const& y )
49
+ { return !( y < x ) ; }
50
+
51
+ template<class T>
52
+ inline
53
+ bool operator >= ( optional<T> const& x, optional<T> const& y )
54
+ { return !( x < y ) ; }
55
+
56
+
57
+ //
58
+ // optional<T> vs T cases
59
+ //
60
+ template<class T>
61
+ inline
62
+ bool operator == ( optional<T> const& x, T const& y )
63
+ { return equal_pointees(x, optional<T>(y)); }
64
+
65
+ template<class T>
66
+ inline
67
+ bool operator < ( optional<T> const& x, T const& y )
68
+ { return less_pointees(x, optional<T>(y)); }
69
+
70
+ template<class T>
71
+ inline
72
+ bool operator != ( optional<T> const& x, T const& y )
73
+ { return !( x == y ) ; }
74
+
75
+ template<class T>
76
+ inline
77
+ bool operator > ( optional<T> const& x, T const& y )
78
+ { return y < x ; }
79
+
80
+ template<class T>
81
+ inline
82
+ bool operator <= ( optional<T> const& x, T const& y )
83
+ { return !( y < x ) ; }
84
+
85
+ template<class T>
86
+ inline
87
+ bool operator >= ( optional<T> const& x, T const& y )
88
+ { return !( x < y ) ; }
89
+
90
+ //
91
+ // T vs optional<T> cases
92
+ //
93
+
94
+ template<class T>
95
+ inline
96
+ bool operator == ( T const& x, optional<T> const& y )
97
+ { return equal_pointees( optional<T>(x), y ); }
98
+
99
+ template<class T>
100
+ inline
101
+ bool operator < ( T const& x, optional<T> const& y )
102
+ { return less_pointees( optional<T>(x), y ); }
103
+
104
+ template<class T>
105
+ inline
106
+ bool operator != ( T const& x, optional<T> const& y )
107
+ { return !( x == y ) ; }
108
+
109
+ template<class T>
110
+ inline
111
+ bool operator > ( T const& x, optional<T> const& y )
112
+ { return y < x ; }
113
+
114
+ template<class T>
115
+ inline
116
+ bool operator <= ( T const& x, optional<T> const& y )
117
+ { return !( y < x ) ; }
118
+
119
+ template<class T>
120
+ inline
121
+ bool operator >= ( T const& x, optional<T> const& y )
122
+ { return !( x < y ) ; }
123
+
124
+
125
+ //
126
+ // optional<T> vs none cases
127
+ //
128
+
129
+ template<class T>
130
+ inline
131
+ bool operator == ( optional<T> const& x, none_t ) BOOST_NOEXCEPT
132
+ { return !x; }
133
+
134
+ template<class T>
135
+ inline
136
+ bool operator < ( optional<T> const& x, none_t )
137
+ { return less_pointees(x,optional<T>() ); }
138
+
139
+ template<class T>
140
+ inline
141
+ bool operator != ( optional<T> const& x, none_t ) BOOST_NOEXCEPT
142
+ { return bool(x); }
143
+
144
+ template<class T>
145
+ inline
146
+ bool operator > ( optional<T> const& x, none_t y )
147
+ { return y < x ; }
148
+
149
+ template<class T>
150
+ inline
151
+ bool operator <= ( optional<T> const& x, none_t y )
152
+ { return !( y < x ) ; }
153
+
154
+ template<class T>
155
+ inline
156
+ bool operator >= ( optional<T> const& x, none_t y )
157
+ { return !( x < y ) ; }
158
+
159
+ //
160
+ // none vs optional<T> cases
161
+ //
162
+
163
+ template<class T>
164
+ inline
165
+ bool operator == ( none_t , optional<T> const& y ) BOOST_NOEXCEPT
166
+ { return !y; }
167
+
168
+ template<class T>
169
+ inline
170
+ bool operator < ( none_t , optional<T> const& y )
171
+ { return less_pointees(optional<T>() ,y); }
172
+
173
+ template<class T>
174
+ inline
175
+ bool operator != ( none_t, optional<T> const& y ) BOOST_NOEXCEPT
176
+ { return bool(y); }
177
+
178
+ template<class T>
179
+ inline
180
+ bool operator > ( none_t x, optional<T> const& y )
181
+ { return y < x ; }
182
+
183
+ template<class T>
184
+ inline
185
+ bool operator <= ( none_t x, optional<T> const& y )
186
+ { return !( y < x ) ; }
187
+
188
+ template<class T>
189
+ inline
190
+ bool operator >= ( none_t x, optional<T> const& y )
191
+ { return !( x < y ) ; }
192
+
193
+ } // namespace boost
194
+
195
+ #endif // header guard
196
+
@@ -0,0 +1,117 @@
1
+ // Copyright (C) 2003, 2008 Fernando Luis Cacciola Carballal.
2
+ // Copyright (C) 2015 Andrzej Krzemienski.
3
+ //
4
+ // Use, modification, and distribution is subject to the Boost Software
5
+ // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
6
+ // http://www.boost.org/LICENSE_1_0.txt)
7
+ //
8
+ // See http://www.boost.org/libs/optional for documentation.
9
+ //
10
+ // You are welcome to contact the author at:
11
+ // akrzemi1@gmail.com
12
+
13
+ #ifndef BOOST_OPTIONAL_DETAIL_OPTIONAL_SWAP_AJK_28JAN2015_HPP
14
+ #define BOOST_OPTIONAL_DETAIL_OPTIONAL_SWAP_AJK_28JAN2015_HPP
15
+
16
+ #include <boost/core/swap.hpp>
17
+ #include <boost/optional/optional_fwd.hpp>
18
+
19
+ namespace boost {
20
+
21
+ namespace optional_detail {
22
+
23
+ template <bool use_default_constructor> struct swap_selector;
24
+
25
+ template <>
26
+ struct swap_selector<true>
27
+ {
28
+ template <class T>
29
+ static void optional_swap ( optional<T>& x, optional<T>& y )
30
+ {
31
+ const bool hasX = !!x;
32
+ const bool hasY = !!y;
33
+
34
+ if ( !hasX && !hasY )
35
+ return;
36
+
37
+ if( !hasX )
38
+ x.emplace();
39
+ else if ( !hasY )
40
+ y.emplace();
41
+
42
+ // Boost.Utility.Swap will take care of ADL and workarounds for broken compilers
43
+ boost::swap(x.get(), y.get());
44
+
45
+ if( !hasX )
46
+ y = boost::none ;
47
+ else if( !hasY )
48
+ x = boost::none ;
49
+ }
50
+ };
51
+
52
+ #ifdef BOOST_OPTIONAL_DETAIL_MOVE
53
+ # undef BOOST_OPTIONAL_DETAIL_MOVE
54
+ #endif
55
+
56
+ #ifndef BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES
57
+ # define BOOST_OPTIONAL_DETAIL_MOVE(EXPR_) boost::move(EXPR_)
58
+ #else
59
+ # define BOOST_OPTIONAL_DETAIL_MOVE(EXPR_) EXPR_
60
+ #endif
61
+
62
+ template <>
63
+ struct swap_selector<false>
64
+ {
65
+ template <class T>
66
+ static void optional_swap ( optional<T>& x, optional<T>& y )
67
+ //BOOST_NOEXCEPT_IF(::boost::is_nothrow_move_constructible<T>::value && BOOST_NOEXCEPT_EXPR(boost::swap(*x, *y)))
68
+ {
69
+ if (x)
70
+ {
71
+ if (y)
72
+ {
73
+ boost::swap(*x, *y);
74
+ }
75
+ else
76
+ {
77
+ y = BOOST_OPTIONAL_DETAIL_MOVE(*x);
78
+ x = boost::none;
79
+ }
80
+ }
81
+ else
82
+ {
83
+ if (y)
84
+ {
85
+ x = BOOST_OPTIONAL_DETAIL_MOVE(*y);
86
+ y = boost::none;
87
+ }
88
+ }
89
+ }
90
+ };
91
+
92
+ } // namespace optional_detail
93
+
94
+ #if (!defined BOOST_NO_CXX11_RVALUE_REFERENCES) && (!defined BOOST_CONFIG_RESTORE_OBSOLETE_SWAP_IMPLEMENTATION)
95
+
96
+ template<class T>
97
+ struct optional_swap_should_use_default_constructor : boost::false_type {} ;
98
+
99
+ #else
100
+
101
+ template<class T>
102
+ struct optional_swap_should_use_default_constructor : has_nothrow_default_constructor<T> {} ;
103
+
104
+ #endif
105
+
106
+ template <class T>
107
+ inline void swap ( optional<T>& x, optional<T>& y )
108
+ //BOOST_NOEXCEPT_IF(::boost::is_nothrow_move_constructible<T>::value && BOOST_NOEXCEPT_EXPR(boost::swap(*x, *y)))
109
+ {
110
+ optional_detail::swap_selector<optional_swap_should_use_default_constructor<T>::value>::optional_swap(x, y);
111
+ }
112
+
113
+ } // namespace boost
114
+
115
+ #undef BOOST_OPTIONAL_DETAIL_MOVE
116
+
117
+ #endif // header guard
@@ -1,5 +1,5 @@
1
1
  // Copyright (C) 2003, 2008 Fernando Luis Cacciola Carballal.
2
- // Copyright (C) 2014, 2015 Andrzej Krzemienski.
2
+ // Copyright (C) 2014 - 2016 Andrzej Krzemienski.
3
3
  //
4
4
  // Use, modification, and distribution is subject to the Boost Software
5
5
  // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
@@ -20,7 +20,6 @@
20
20
  #include <new>
21
21
  #include <iosfwd>
22
22
 
23
- #include <boost/config.hpp>
24
23
  #include <boost/assert.hpp>
25
24
  #include <boost/core/addressof.hpp>
26
25
  #include <boost/core/enable_if.hpp>
@@ -31,208 +30,85 @@
31
30
  #include <boost/throw_exception.hpp>
32
31
  #include <boost/type.hpp>
33
32
  #include <boost/type_traits/alignment_of.hpp>
33
+ #include <boost/type_traits/conditional.hpp>
34
34
  #include <boost/type_traits/has_nothrow_constructor.hpp>
35
35
  #include <boost/type_traits/type_with_alignment.hpp>
36
36
  #include <boost/type_traits/remove_const.hpp>
37
37
  #include <boost/type_traits/remove_reference.hpp>
38
38
  #include <boost/type_traits/decay.hpp>
39
39
  #include <boost/type_traits/is_base_of.hpp>
40
+ #include <boost/type_traits/is_constructible.hpp>
40
41
  #include <boost/type_traits/is_lvalue_reference.hpp>
41
42
  #include <boost/type_traits/is_nothrow_move_assignable.hpp>
42
43
  #include <boost/type_traits/is_nothrow_move_constructible.hpp>
43
- #include <boost/type_traits/is_reference.hpp>
44
44
  #include <boost/type_traits/is_rvalue_reference.hpp>
45
45
  #include <boost/type_traits/is_same.hpp>
46
- #include <boost/mpl/if.hpp>
47
- #include <boost/mpl/bool.hpp>
48
- #include <boost/mpl/not.hpp>
49
- #include <boost/detail/reference_content.hpp>
50
46
  #include <boost/move/utility.hpp>
51
47
  #include <boost/none.hpp>
52
48
  #include <boost/utility/compare_pointees.hpp>
53
49
 
54
50
  #include <boost/optional/optional_fwd.hpp>
51
+ #include <boost/optional/detail/optional_config.hpp>
52
+ #include <boost/optional/detail/optional_factory_support.hpp>
53
+ #include <boost/optional/detail/optional_aligned_storage.hpp>
55
54
 
56
- #if (defined BOOST_NO_CXX11_RVALUE_REFERENCES) || (defined BOOST_OPTIONAL_CONFIG_NO_RVALUE_REFERENCES)
57
- #define BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES
58
- #endif
59
-
60
- #if BOOST_WORKAROUND(BOOST_INTEL_CXX_VERSION,<=700)
61
- // AFAICT only Intel 7 correctly resolves the overload set
62
- // that includes the in-place factory taking functions,
63
- // so for the other icc versions, in-place factory support
64
- // is disabled
65
- #define BOOST_OPTIONAL_NO_INPLACE_FACTORY_SUPPORT
66
- #endif
67
-
68
- #if BOOST_WORKAROUND(__BORLANDC__, <= 0x551)
69
- // BCB (5.5.1) cannot parse the nested template struct in an inplace factory.
70
- #define BOOST_OPTIONAL_NO_INPLACE_FACTORY_SUPPORT
71
- #endif
72
-
73
- #if !defined(BOOST_OPTIONAL_NO_INPLACE_FACTORY_SUPPORT) \
74
- && BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x581) )
75
- // BCB (up to 5.64) has the following bug:
76
- // If there is a member function/operator template of the form
77
- // template<class Expr> mfunc( Expr expr ) ;
78
- // some calls are resolved to this even if there are other better matches.
79
- // The effect of this bug is that calls to converting ctors and assignments
80
- // are incrorrectly sink to this general catch-all member function template as shown above.
81
- #define BOOST_OPTIONAL_WEAK_OVERLOAD_RESOLUTION
82
- #endif
83
-
84
- #if defined(__GNUC__) && !defined(__INTEL_COMPILER)
85
- // GCC since 3.3 has may_alias attribute that helps to alleviate optimizer issues with
86
- // regard to violation of the strict aliasing rules. The optional< T > storage type is marked
87
- // with this attribute in order to let the compiler know that it will alias objects of type T
88
- // and silence compilation warnings.
89
- #define BOOST_OPTIONAL_DETAIL_USE_ATTRIBUTE_MAY_ALIAS
90
- #endif
91
-
92
- // Daniel Wallin discovered that bind/apply.hpp badly interacts with the apply<>
93
- // member template of a factory as used in the optional<> implementation.
94
- // He proposed this simple fix which is to move the call to apply<> outside
95
- // namespace boost.
96
- namespace boost_optional_detail
97
- {
98
- template <class T, class Factory>
99
- inline void construct(Factory const& factory, void* address)
100
- {
101
- factory.BOOST_NESTED_TEMPLATE apply<T>(address);
102
- }
103
- }
104
-
105
-
106
- namespace boost {
107
-
108
- class in_place_factory_base ;
109
- class typed_in_place_factory_base ;
110
-
111
- // This forward is needed to refer to namespace scope swap from the member swap
112
- template<class T> void swap ( optional<T>& x, optional<T>& y );
113
-
114
- namespace optional_detail {
115
- // This local class is used instead of that in "aligned_storage.hpp"
116
- // because I've found the 'official' class to ICE BCB5.5
117
- // when some types are used with optional<>
118
- // (due to sizeof() passed down as a non-type template parameter)
119
- template <class T>
120
- class aligned_storage
121
- {
122
- // Borland ICEs if unnamed unions are used for this!
123
- union
124
- // This works around GCC warnings about breaking strict aliasing rules when casting storage address to T*
125
- #if defined(BOOST_OPTIONAL_DETAIL_USE_ATTRIBUTE_MAY_ALIAS)
126
- __attribute__((__may_alias__))
127
- #endif
128
- dummy_u
129
- {
130
- char data[ sizeof(T) ];
131
- BOOST_DEDUCED_TYPENAME type_with_alignment<
132
- ::boost::alignment_of<T>::value >::type aligner_;
133
- } dummy_ ;
134
-
135
- public:
136
-
137
- #if defined(BOOST_OPTIONAL_DETAIL_USE_ATTRIBUTE_MAY_ALIAS)
138
- void const* address() const { return &dummy_; }
139
- void * address() { return &dummy_; }
55
+ #ifdef BOOST_OPTIONAL_CONFIG_USE_OLD_IMPLEMENTATION_OF_OPTIONAL
56
+ #include <boost/optional/detail/old_optional_implementation.hpp>
140
57
  #else
141
- void const* address() const { return dummy_.data; }
142
- void * address() { return dummy_.data; }
143
- #endif
144
- } ;
145
-
146
- template<class T>
147
- struct types_when_isnt_ref
58
+ namespace boost {
59
+
60
+ namespace optional_ns {
61
+
62
+ // a tag for in-place initialization of contained value
63
+ struct in_place_init_t
148
64
  {
149
- typedef T const& reference_const_type ;
150
- typedef T & reference_type ;
151
- #ifndef BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES
152
- typedef T && rval_reference_type ;
153
- typedef T && reference_type_of_temporary_wrapper;
154
- #ifdef BOOST_MOVE_OLD_RVALUE_REF_BINDING_RULES
155
- // GCC 4.4 has support for an early draft of rvalue references. The conforming version below
156
- // causes warnings about returning references to a temporary.
157
- static T&& move(T&& r) { return r; }
158
- #else
159
- static rval_reference_type move(reference_type r) { return boost::move(r); }
160
- #endif
161
- #endif
162
- typedef T const* pointer_const_type ;
163
- typedef T * pointer_type ;
164
- typedef T const& argument_type ;
165
- } ;
65
+ struct init_tag{};
66
+ explicit in_place_init_t(init_tag){}
67
+ };
68
+ const in_place_init_t in_place_init ((in_place_init_t::init_tag()));
166
69
 
167
- template<class T>
168
- struct types_when_is_ref
70
+ // a tag for conditional in-place initialization of contained value
71
+ struct in_place_init_if_t
169
72
  {
170
- typedef BOOST_DEDUCED_TYPENAME remove_reference<T>::type raw_type ;
73
+ struct init_tag{};
74
+ explicit in_place_init_if_t(init_tag){}
75
+ };
76
+ const in_place_init_if_t in_place_init_if ((in_place_init_if_t::init_tag()));
77
+
78
+ } // namespace optional_ns
171
79
 
172
- typedef raw_type& reference_const_type ;
173
- typedef raw_type& reference_type ;
174
- #ifndef BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES
175
- typedef BOOST_DEDUCED_TYPENAME remove_const<raw_type>::type&& rval_reference_type ;
176
- typedef raw_type& reference_type_of_temporary_wrapper;
177
- static reference_type move(reference_type r) { return r; }
178
- #endif
179
- typedef raw_type* pointer_const_type ;
180
- typedef raw_type* pointer_type ;
181
- typedef raw_type& argument_type ;
182
- } ;
80
+ using optional_ns::in_place_init_t;
81
+ using optional_ns::in_place_init;
82
+ using optional_ns::in_place_init_if_t;
83
+ using optional_ns::in_place_init_if;
183
84
 
184
- template <class To, class From>
185
- void prevent_binding_rvalue_ref_to_optional_lvalue_ref()
186
- {
187
- #ifndef BOOST_OPTIONAL_CONFIG_ALLOW_BINDING_TO_RVALUES
188
- BOOST_STATIC_ASSERT_MSG(
189
- !boost::is_lvalue_reference<To>::value || !boost::is_rvalue_reference<From>::value,
190
- "binding rvalue references to optional lvalue references is disallowed");
191
- #endif
192
- }
85
+ namespace optional_detail {
193
86
 
194
87
  struct optional_tag {} ;
195
88
 
89
+
196
90
  template<class T>
197
91
  class optional_base : public optional_tag
198
92
  {
199
93
  private :
200
94
 
201
- typedef
202
- #if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
203
- BOOST_DEDUCED_TYPENAME
204
- #endif
205
- ::boost::detail::make_reference_content<T>::type internal_type ;
206
-
207
- typedef aligned_storage<internal_type> storage_type ;
208
-
209
- typedef types_when_isnt_ref<T> types_when_not_ref ;
210
- typedef types_when_is_ref<T> types_when_ref ;
211
-
95
+ typedef aligned_storage<T> storage_type ;
212
96
  typedef optional_base<T> this_type ;
213
97
 
214
98
  protected :
215
99
 
216
100
  typedef T value_type ;
217
101
 
218
- typedef mpl::true_ is_reference_tag ;
219
- typedef mpl::false_ is_not_reference_tag ;
220
-
221
- typedef BOOST_DEDUCED_TYPENAME is_reference<T>::type is_reference_predicate ;
222
-
223
- public:
224
- typedef BOOST_DEDUCED_TYPENAME mpl::if_<is_reference_predicate,types_when_ref,types_when_not_ref>::type types ;
225
-
226
102
  protected:
227
- typedef BOOST_DEDUCED_TYPENAME types::reference_type reference_type ;
228
- typedef BOOST_DEDUCED_TYPENAME types::reference_const_type reference_const_type ;
103
+ typedef T & reference_type ;
104
+ typedef T const& reference_const_type ;
229
105
  #ifndef BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES
230
- typedef BOOST_DEDUCED_TYPENAME types::rval_reference_type rval_reference_type ;
231
- typedef BOOST_DEDUCED_TYPENAME types::reference_type_of_temporary_wrapper reference_type_of_temporary_wrapper ;
106
+ typedef T && rval_reference_type ;
107
+ typedef T && reference_type_of_temporary_wrapper ;
232
108
  #endif
233
- typedef BOOST_DEDUCED_TYPENAME types::pointer_type pointer_type ;
234
- typedef BOOST_DEDUCED_TYPENAME types::pointer_const_type pointer_const_type ;
235
- typedef BOOST_DEDUCED_TYPENAME types::argument_type argument_type ;
109
+ typedef T * pointer_type ;
110
+ typedef T const* pointer_const_type ;
111
+ typedef T const& argument_type ;
236
112
 
237
113
  // Creates an optional<T> uninitialized.
238
114
  // No-throw
@@ -252,7 +128,7 @@ class optional_base : public optional_tag
252
128
  :
253
129
  m_initialized(false)
254
130
  {
255
- construct(val);
131
+ construct(val);
256
132
  }
257
133
 
258
134
  #ifndef BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES
@@ -332,7 +208,7 @@ class optional_base : public optional_tag
332
208
  if (is_initialized())
333
209
  {
334
210
  if ( rhs.is_initialized() )
335
- assign_value(rhs.get_impl(), is_reference_predicate() );
211
+ assign_value(rhs.get_impl());
336
212
  else destroy();
337
213
  }
338
214
  else
@@ -349,7 +225,7 @@ class optional_base : public optional_tag
349
225
  if (is_initialized())
350
226
  {
351
227
  if ( rhs.is_initialized() )
352
- assign_value(boost::move(rhs.get_impl()), is_reference_predicate() );
228
+ assign_value( boost::move(rhs.get_impl()) );
353
229
  else destroy();
354
230
  }
355
231
  else
@@ -368,9 +244,9 @@ class optional_base : public optional_tag
368
244
  {
369
245
  if ( rhs.is_initialized() )
370
246
  #ifndef BOOST_OPTIONAL_CONFIG_RESTORE_ASSIGNMENT_OF_NONCONVERTIBLE_TYPES
371
- assign_value(rhs.get(), is_reference_predicate() );
247
+ assign_value( rhs.get() );
372
248
  #else
373
- assign_value(static_cast<value_type>(rhs.get()), is_reference_predicate() );
249
+ assign_value( static_cast<value_type>(rhs.get()) );
374
250
  #endif
375
251
 
376
252
  else destroy();
@@ -395,7 +271,7 @@ class optional_base : public optional_tag
395
271
  if (is_initialized())
396
272
  {
397
273
  if ( rhs.is_initialized() )
398
- assign_value(static_cast<ref_type>(rhs.get()), is_reference_predicate() );
274
+ assign_value( static_cast<ref_type>(rhs.get()) );
399
275
  else destroy();
400
276
  }
401
277
  else
@@ -410,7 +286,7 @@ class optional_base : public optional_tag
410
286
  void assign ( argument_type val )
411
287
  {
412
288
  if (is_initialized())
413
- assign_value(val, is_reference_predicate() );
289
+ assign_value(val);
414
290
  else construct(val);
415
291
  }
416
292
 
@@ -419,7 +295,7 @@ class optional_base : public optional_tag
419
295
  void assign ( rval_reference_type val )
420
296
  {
421
297
  if (is_initialized())
422
- assign_value( boost::move(val), is_reference_predicate() );
298
+ assign_value( boost::move(val) );
423
299
  else construct( boost::move(val) );
424
300
  }
425
301
  #endif
@@ -471,14 +347,14 @@ class optional_base : public optional_tag
471
347
 
472
348
  void construct ( argument_type val )
473
349
  {
474
- ::new (m_storage.address()) internal_type(val) ;
350
+ ::new (m_storage.address()) value_type(val) ;
475
351
  m_initialized = true ;
476
352
  }
477
353
 
478
354
  #ifndef BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES
479
355
  void construct ( rval_reference_type val )
480
356
  {
481
- ::new (m_storage.address()) internal_type( types::move(val) ) ;
357
+ ::new (m_storage.address()) value_type( boost::move(val) ) ;
482
358
  m_initialized = true ;
483
359
  }
484
360
  #endif
@@ -487,51 +363,179 @@ class optional_base : public optional_tag
487
363
  #if (!defined BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES) && (!defined BOOST_NO_CXX11_VARIADIC_TEMPLATES)
488
364
  // Constructs in-place
489
365
  // upon exception *this is always uninitialized
366
+ template<class... Args>
367
+ void construct ( in_place_init_t, Args&&... args )
368
+ {
369
+ ::new (m_storage.address()) value_type( boost::forward<Args>(args)... ) ;
370
+ m_initialized = true ;
371
+ }
372
+
490
373
  template<class... Args>
491
374
  void emplace_assign ( Args&&... args )
375
+ {
376
+ destroy();
377
+ construct(in_place_init, boost::forward<Args>(args)...);
378
+ }
379
+
380
+ template<class... Args>
381
+ explicit optional_base ( in_place_init_t, Args&&... args )
382
+ :
383
+ m_initialized(false)
384
+ {
385
+ construct(in_place_init, boost::forward<Args>(args)...);
386
+ }
387
+
388
+ template<class... Args>
389
+ explicit optional_base ( in_place_init_if_t, bool cond, Args&&... args )
390
+ :
391
+ m_initialized(false)
392
+ {
393
+ if ( cond )
394
+ construct(in_place_init, boost::forward<Args>(args)...);
395
+ }
396
+ #elif (!defined BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES)
397
+ template<class Arg>
398
+ void construct ( in_place_init_t, Arg&& arg )
492
399
  {
493
- destroy();
494
- ::new (m_storage.address()) internal_type( boost::forward<Args>(args)... );
400
+ ::new (m_storage.address()) value_type( boost::forward<Arg>(arg) );
495
401
  m_initialized = true ;
496
402
  }
497
- #elif (!defined BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES)
403
+
404
+ void construct ( in_place_init_t )
405
+ {
406
+ ::new (m_storage.address()) value_type();
407
+ m_initialized = true ;
408
+ }
409
+
498
410
  template<class Arg>
499
411
  void emplace_assign ( Arg&& arg )
500
412
  {
501
413
  destroy();
502
- ::new (m_storage.address()) internal_type( boost::forward<Arg>(arg) );
503
- m_initialized = true ;
414
+ construct(in_place_init, boost::forward<Arg>(arg)) ;
504
415
  }
505
416
 
506
417
  void emplace_assign ()
507
418
  {
508
419
  destroy();
509
- ::new (m_storage.address()) internal_type();
510
- m_initialized = true ;
420
+ construct(in_place_init) ;
511
421
  }
422
+
423
+ template<class Arg>
424
+ explicit optional_base ( in_place_init_t, Arg&& arg )
425
+ :
426
+ m_initialized(false)
427
+ {
428
+ construct(in_place_init, boost::forward<Arg>(arg));
429
+ }
430
+
431
+ explicit optional_base ( in_place_init_t )
432
+ :
433
+ m_initialized(false)
434
+ {
435
+ construct(in_place_init);
436
+ }
437
+
438
+ template<class Arg>
439
+ explicit optional_base ( in_place_init_if_t, bool cond, Arg&& arg )
440
+ :
441
+ m_initialized(false)
442
+ {
443
+ if ( cond )
444
+ construct(in_place_init, boost::forward<Arg>(arg));
445
+ }
446
+
447
+ explicit optional_base ( in_place_init_if_t, bool cond )
448
+ :
449
+ m_initialized(false)
450
+ {
451
+ if ( cond )
452
+ construct(in_place_init);
453
+ }
454
+
512
455
  #else
456
+
513
457
  template<class Arg>
514
- void emplace_assign ( const Arg& arg )
458
+ void construct ( in_place_init_t, const Arg& arg )
515
459
  {
516
- destroy();
517
- ::new (m_storage.address()) internal_type( arg );
460
+ ::new (m_storage.address()) value_type( arg );
518
461
  m_initialized = true ;
519
462
  }
520
463
 
521
464
  template<class Arg>
522
- void emplace_assign ( Arg& arg )
465
+ void construct ( in_place_init_t, Arg& arg )
523
466
  {
524
- destroy();
525
- ::new (m_storage.address()) internal_type( arg );
467
+ ::new (m_storage.address()) value_type( arg );
526
468
  m_initialized = true ;
527
469
  }
528
470
 
529
- void emplace_assign ()
471
+ void construct ( in_place_init_t )
530
472
  {
531
- destroy();
532
- ::new (m_storage.address()) internal_type();
473
+ ::new (m_storage.address()) value_type();
533
474
  m_initialized = true ;
534
475
  }
476
+
477
+ template<class Arg>
478
+ void emplace_assign ( const Arg& arg )
479
+ {
480
+ destroy();
481
+ construct(in_place_init, arg);
482
+ }
483
+
484
+ template<class Arg>
485
+ void emplace_assign ( Arg& arg )
486
+ {
487
+ destroy();
488
+ construct(in_place_init, arg);
489
+ }
490
+
491
+ void emplace_assign ()
492
+ {
493
+ destroy();
494
+ construct(in_place_init);
495
+ }
496
+
497
+ template<class Arg>
498
+ explicit optional_base ( in_place_init_t, const Arg& arg )
499
+ : m_initialized(false)
500
+ {
501
+ construct(in_place_init, arg);
502
+ }
503
+
504
+ template<class Arg>
505
+ explicit optional_base ( in_place_init_t, Arg& arg )
506
+ : m_initialized(false)
507
+ {
508
+ construct(in_place_init, arg);
509
+ }
510
+
511
+ explicit optional_base ( in_place_init_t )
512
+ : m_initialized(false)
513
+ {
514
+ construct(in_place_init);
515
+ }
516
+
517
+ template<class Arg>
518
+ explicit optional_base ( in_place_init_if_t, bool cond, const Arg& arg )
519
+ : m_initialized(false)
520
+ {
521
+ if ( cond )
522
+ construct(in_place_init, arg);
523
+ }
524
+
525
+ template<class Arg>
526
+ explicit optional_base ( in_place_init_if_t, bool cond, Arg& arg )
527
+ : m_initialized(false)
528
+ {
529
+ if ( cond )
530
+ construct(in_place_init, arg);
531
+ }
532
+
533
+ explicit optional_base ( in_place_init_if_t, bool cond )
534
+ : m_initialized(false)
535
+ {
536
+ if ( cond )
537
+ construct(in_place_init);
538
+ }
535
539
  #endif
536
540
 
537
541
  #ifndef BOOST_OPTIONAL_NO_INPLACE_FACTORY_SUPPORT
@@ -541,7 +545,6 @@ class optional_base : public optional_tag
541
545
  template<class Expr>
542
546
  void construct ( Expr&& factory, in_place_factory_base const* )
543
547
  {
544
- BOOST_STATIC_ASSERT ( ::boost::mpl::not_<is_reference_predicate>::value ) ;
545
548
  boost_optional_detail::construct<value_type>(factory, m_storage.address());
546
549
  m_initialized = true ;
547
550
  }
@@ -550,7 +553,6 @@ class optional_base : public optional_tag
550
553
  template<class Expr>
551
554
  void construct ( Expr&& factory, typed_in_place_factory_base const* )
552
555
  {
553
- BOOST_STATIC_ASSERT ( ::boost::mpl::not_<is_reference_predicate>::value ) ;
554
556
  factory.apply(m_storage.address()) ;
555
557
  m_initialized = true ;
556
558
  }
@@ -575,7 +577,6 @@ class optional_base : public optional_tag
575
577
  template<class Expr>
576
578
  void construct ( Expr const& factory, in_place_factory_base const* )
577
579
  {
578
- BOOST_STATIC_ASSERT ( ::boost::mpl::not_<is_reference_predicate>::value ) ;
579
580
  boost_optional_detail::construct<value_type>(factory, m_storage.address());
580
581
  m_initialized = true ;
581
582
  }
@@ -584,7 +585,6 @@ class optional_base : public optional_tag
584
585
  template<class Expr>
585
586
  void construct ( Expr const& factory, typed_in_place_factory_base const* )
586
587
  {
587
- BOOST_STATIC_ASSERT ( ::boost::mpl::not_<is_reference_predicate>::value ) ;
588
588
  factory.apply(m_storage.address()) ;
589
589
  m_initialized = true ;
590
590
  }
@@ -615,7 +615,7 @@ class optional_base : public optional_tag
615
615
  template<class Expr>
616
616
  void construct ( Expr&& expr, void const* )
617
617
  {
618
- new (m_storage.address()) internal_type(boost::forward<Expr>(expr)) ;
618
+ new (m_storage.address()) value_type(boost::forward<Expr>(expr)) ;
619
619
  m_initialized = true ;
620
620
  }
621
621
 
@@ -626,7 +626,7 @@ class optional_base : public optional_tag
626
626
  template<class Expr>
627
627
  void assign_expr_to_initialized ( Expr&& expr, void const* )
628
628
  {
629
- assign_value(boost::forward<Expr>(expr), is_reference_predicate());
629
+ assign_value( boost::forward<Expr>(expr) );
630
630
  }
631
631
  #else
632
632
  // Constructs using any expression implicitly convertible to the single argument
@@ -636,7 +636,7 @@ class optional_base : public optional_tag
636
636
  template<class Expr>
637
637
  void construct ( Expr const& expr, void const* )
638
638
  {
639
- new (m_storage.address()) internal_type(expr) ;
639
+ new (m_storage.address()) value_type(expr) ;
640
640
  m_initialized = true ;
641
641
  }
642
642
 
@@ -647,7 +647,7 @@ class optional_base : public optional_tag
647
647
  template<class Expr>
648
648
  void assign_expr_to_initialized ( Expr const& expr, void const* )
649
649
  {
650
- assign_value(expr, is_reference_predicate());
650
+ assign_value(expr);
651
651
  }
652
652
 
653
653
  #endif
@@ -674,7 +674,7 @@ class optional_base : public optional_tag
674
674
  {
675
675
  // An exception can be thrown here.
676
676
  // It it happens, THIS will be left uninitialized.
677
- new (m_storage.address()) internal_type(types::move(expr.get())) ;
677
+ new (m_storage.address()) value_type(boost::move(expr.get())) ;
678
678
  m_initialized = true ;
679
679
  }
680
680
  }
@@ -687,78 +687,84 @@ class optional_base : public optional_tag
687
687
  {
688
688
  // An exception can be thrown here.
689
689
  // It it happens, THIS will be left uninitialized.
690
- new (m_storage.address()) internal_type(expr.get()) ;
690
+ new (m_storage.address()) value_type(expr.get()) ;
691
691
  m_initialized = true ;
692
692
  }
693
693
  }
694
694
  #endif
695
695
  #endif // defined BOOST_OPTIONAL_WEAK_OVERLOAD_RESOLUTION
696
696
 
697
- void assign_value ( argument_type val, is_not_reference_tag ) { get_impl() = val; }
698
- void assign_value ( argument_type val, is_reference_tag ) { construct(val); }
697
+ void assign_value ( argument_type val ) { get_impl() = val; }
699
698
  #ifndef BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES
700
- void assign_value ( rval_reference_type val, is_not_reference_tag ) { get_impl() = static_cast<rval_reference_type>(val); }
701
- void assign_value ( rval_reference_type val, is_reference_tag ) { construct( static_cast<rval_reference_type>(val) ); }
699
+ void assign_value ( rval_reference_type val ) { get_impl() = static_cast<rval_reference_type>(val); }
702
700
  #endif
703
701
 
704
702
  void destroy()
705
703
  {
706
704
  if ( m_initialized )
707
- destroy_impl(is_reference_predicate()) ;
705
+ destroy_impl() ;
708
706
  }
709
707
 
710
- reference_const_type get_impl() const { return dereference(get_object(), is_reference_predicate() ) ; }
711
- reference_type get_impl() { return dereference(get_object(), is_reference_predicate() ) ; }
708
+ reference_const_type get_impl() const { return m_storage.ref() ; }
709
+ reference_type get_impl() { return m_storage.ref() ; }
712
710
 
713
- pointer_const_type get_ptr_impl() const { return cast_ptr(get_object(), is_reference_predicate() ) ; }
714
- pointer_type get_ptr_impl() { return cast_ptr(get_object(), is_reference_predicate() ) ; }
711
+ pointer_const_type get_ptr_impl() const { return m_storage.ptr_ref(); }
712
+ pointer_type get_ptr_impl() { return m_storage.ptr_ref(); }
715
713
 
716
714
  private :
717
715
 
718
- // internal_type can be either T or reference_content<T>
719
- #if defined(BOOST_OPTIONAL_DETAIL_USE_ATTRIBUTE_MAY_ALIAS)
720
- // This workaround is supposed to silence GCC warnings about broken strict aliasing rules
721
- internal_type const* get_object() const
722
- {
723
- union { void const* ap_pvoid; internal_type const* as_ptype; } caster = { m_storage.address() };
724
- return caster.as_ptype;
725
- }
726
- internal_type * get_object()
727
- {
728
- union { void* ap_pvoid; internal_type* as_ptype; } caster = { m_storage.address() };
729
- return caster.as_ptype;
730
- }
716
+ #if BOOST_WORKAROUND(BOOST_MSVC, <= 1600)
717
+ void destroy_impl ( ) { m_storage.ptr_ref()->~T() ; m_initialized = false ; }
731
718
  #else
732
- internal_type const* get_object() const { return static_cast<internal_type const*>(m_storage.address()); }
733
- internal_type * get_object() { return static_cast<internal_type *> (m_storage.address()); }
719
+ void destroy_impl ( ) { m_storage.ref().T::~T() ; m_initialized = false ; }
734
720
  #endif
735
721
 
736
- // reference_content<T> lacks an implicit conversion to T&, so the following is needed to obtain a proper reference.
737
- reference_const_type dereference( internal_type const* p, is_not_reference_tag ) const { return *p ; }
738
- reference_type dereference( internal_type* p, is_not_reference_tag ) { return *p ; }
739
- reference_const_type dereference( internal_type const* p, is_reference_tag ) const { return p->get() ; }
740
- reference_type dereference( internal_type* p, is_reference_tag ) { return p->get() ; }
722
+ bool m_initialized ;
723
+ storage_type m_storage ;
724
+ } ;
725
+
726
+ // definition of metafunciton is_optional_val_init_candidate
727
+ template <typename U>
728
+ struct is_optional_related
729
+ : boost::conditional< boost::is_base_of<optional_detail::optional_tag, BOOST_DEDUCED_TYPENAME boost::decay<U>::type>::value
730
+ || boost::is_same<BOOST_DEDUCED_TYPENAME boost::decay<U>::type, none_t>::value
731
+ || boost::is_same<BOOST_DEDUCED_TYPENAME boost::decay<U>::type, in_place_init_t>::value
732
+ || boost::is_same<BOOST_DEDUCED_TYPENAME boost::decay<U>::type, in_place_init_if_t>::value,
733
+ boost::true_type, boost::false_type>::type
734
+ {};
735
+
736
+ #if !defined(BOOST_OPTIONAL_DETAIL_NO_IS_CONSTRUCTIBLE_TRAIT)
737
+
738
+ template <typename T, typename U>
739
+ struct is_convertible_to_T_or_factory
740
+ : boost::conditional< boost::is_base_of<boost::in_place_factory_base, BOOST_DEDUCED_TYPENAME boost::decay<U>::type>::value
741
+ || boost::is_base_of<boost::typed_in_place_factory_base, BOOST_DEDUCED_TYPENAME boost::decay<U>::type>::value
742
+ || (boost::is_constructible<T, U&&>::value && !boost::is_same<T, BOOST_DEDUCED_TYPENAME boost::decay<U>::type>::value)
743
+ , boost::true_type, boost::false_type>::type
744
+ {};
745
+
746
+ template <typename T, typename U>
747
+ struct is_optional_constructible : boost::is_constructible<T, U>
748
+ {};
741
749
 
742
- #if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x581))
743
- void destroy_impl ( is_not_reference_tag ) { get_ptr_impl()->internal_type::~internal_type() ; m_initialized = false ; }
744
750
  #else
745
- void destroy_impl ( is_not_reference_tag ) { get_ptr_impl()->~T() ; m_initialized = false ; }
746
- #endif
747
751
 
748
- void destroy_impl ( is_reference_tag ) { m_initialized = false ; }
752
+ template <typename, typename>
753
+ struct is_convertible_to_T_or_factory : boost::true_type
754
+ {};
749
755
 
750
- // If T is of reference type, trying to get a pointer to the held value must result in a compile-time error.
751
- // Decent compilers should disallow conversions from reference_content<T>* to T*, but just in case,
752
- // the following olverloads are used to filter out the case and guarantee an error in case of T being a reference.
753
- pointer_const_type cast_ptr( internal_type const* p, is_not_reference_tag ) const { return p ; }
754
- pointer_type cast_ptr( internal_type * p, is_not_reference_tag ) { return p ; }
755
- pointer_const_type cast_ptr( internal_type const* p, is_reference_tag ) const { return &p->get() ; }
756
- pointer_type cast_ptr( internal_type * p, is_reference_tag ) { return &p->get() ; }
756
+ template <typename T, typename U>
757
+ struct is_optional_constructible : boost::true_type
758
+ {};
757
759
 
758
- bool m_initialized ;
759
- storage_type m_storage ;
760
- } ;
760
+ #endif // is_convertible condition
761
761
 
762
+ template <typename T, typename U>
763
+ struct is_optional_val_init_candidate
764
+ : boost::conditional< !is_optional_related<U>::value && is_convertible_to_T_or_factory<T, U>::value
765
+ , boost::true_type, boost::false_type>::type
766
+ {};
767
+
762
768
  } // namespace optional_detail
763
769
 
764
770
  template<class T>
@@ -797,7 +803,7 @@ class optional : public optional_detail::optional_base<T>
797
803
  // Creates an optional<T> initialized with 'move(val)'.
798
804
  // Can throw if T::T(T &&) does
799
805
  optional ( rval_reference_type val ) : base( boost::forward<T>(val) )
800
- {optional_detail::prevent_binding_rvalue_ref_to_optional_lvalue_ref<T, rval_reference_type>();}
806
+ {}
801
807
  #endif
802
808
 
803
809
  // Creates an optional<T> initialized with 'val' IFF cond is true, otherwise creates an uninitialized optional.
@@ -810,7 +816,11 @@ class optional : public optional_detail::optional_base<T>
810
816
  // Requires a valid conversion from U to T.
811
817
  // Can throw if T::T(U const&) does
812
818
  template<class U>
813
- explicit optional ( optional<U> const& rhs )
819
+ explicit optional ( optional<U> const& rhs
820
+ #ifndef BOOST_OPTIONAL_DETAIL_NO_SFINAE_FRIENDLY_CONSTRUCTORS
821
+ ,typename boost::enable_if< optional_detail::is_optional_constructible<T, U const&> >::type* = 0
822
+ #endif
823
+ )
814
824
  :
815
825
  base()
816
826
  {
@@ -823,7 +833,11 @@ class optional : public optional_detail::optional_base<T>
823
833
  // Requires a valid conversion from U to T.
824
834
  // Can throw if T::T(U&&) does
825
835
  template<class U>
826
- explicit optional ( optional<U> && rhs )
836
+ explicit optional ( optional<U> && rhs
837
+ #ifndef BOOST_OPTIONAL_DETAIL_NO_SFINAE_FRIENDLY_CONSTRUCTORS
838
+ ,typename boost::enable_if< optional_detail::is_optional_constructible<T, U> >::type* = 0
839
+ #endif
840
+ )
827
841
  :
828
842
  base()
829
843
  {
@@ -847,12 +861,10 @@ class optional : public optional_detail::optional_base<T>
847
861
 
848
862
  template<class Expr>
849
863
  explicit optional ( Expr&& expr,
850
- BOOST_DEDUCED_TYPENAME boost::disable_if_c<
851
- (boost::is_base_of<optional_detail::optional_tag, BOOST_DEDUCED_TYPENAME boost::decay<Expr>::type>::value) ||
852
- boost::is_same<BOOST_DEDUCED_TYPENAME boost::decay<Expr>::type, none_t>::value >::type* = 0
864
+ BOOST_DEDUCED_TYPENAME boost::enable_if< optional_detail::is_optional_val_init_candidate<T, Expr> >::type* = 0
853
865
  )
854
866
  : base(boost::forward<Expr>(expr),boost::addressof(expr))
855
- {optional_detail::prevent_binding_rvalue_ref_to_optional_lvalue_ref<T, Expr&&>();}
867
+ {}
856
868
 
857
869
  #else
858
870
  template<class Expr>
@@ -873,23 +885,22 @@ class optional : public optional_detail::optional_base<T>
873
885
  {}
874
886
 
875
887
  #endif
876
- // No-throw (assuming T::~T() doesn't)
888
+
889
+ #if BOOST_WORKAROUND(_MSC_VER, <= 1600)
890
+ // On old MSVC compilers the implicitly declared dtor is not called
877
891
  ~optional() {}
892
+ #endif
878
893
 
894
+
879
895
  #if !defined(BOOST_OPTIONAL_NO_INPLACE_FACTORY_SUPPORT) && !defined(BOOST_OPTIONAL_WEAK_OVERLOAD_RESOLUTION)
880
896
  // Assigns from an expression. See corresponding constructor.
881
897
  // Basic Guarantee: If the resolved T ctor throws, this is left UNINITIALIZED
882
898
  #ifndef BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES
883
899
 
884
900
  template<class Expr>
885
- BOOST_DEDUCED_TYPENAME boost::disable_if_c<
886
- boost::is_base_of<optional_detail::optional_tag, BOOST_DEDUCED_TYPENAME boost::decay<Expr>::type>::value ||
887
- boost::is_same<BOOST_DEDUCED_TYPENAME boost::decay<Expr>::type, none_t>::value,
888
- optional&
889
- >::type
901
+ BOOST_DEDUCED_TYPENAME boost::enable_if<optional_detail::is_optional_val_init_candidate<T, Expr>, optional&>::type
890
902
  operator= ( Expr&& expr )
891
903
  {
892
- optional_detail::prevent_binding_rvalue_ref_to_optional_lvalue_ref<T, Expr&&>();
893
904
  this->assign_expr(boost::forward<Expr>(expr),boost::addressof(expr));
894
905
  return *this ;
895
906
  }
@@ -945,6 +956,19 @@ class optional : public optional_detail::optional_base<T>
945
956
  }
946
957
  #endif
947
958
 
959
+ #ifndef BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX
960
+
961
+ // Assigns from a T (deep-moves/copies the rhs value)
962
+ template <typename T_>
963
+ BOOST_DEDUCED_TYPENAME boost::enable_if<boost::is_same<T, BOOST_DEDUCED_TYPENAME boost::decay<T_>::type>, optional&>::type
964
+ operator= ( T_&& val )
965
+ {
966
+ this->assign( boost::forward<T_>(val) ) ;
967
+ return *this ;
968
+ }
969
+
970
+ #else
971
+
948
972
  // Assigns from a T (deep-copies the rhs value)
949
973
  // Basic Guarantee: If T::( T const& ) throws, this is left UNINITIALIZED
950
974
  optional& operator= ( argument_type val )
@@ -952,17 +976,18 @@ class optional : public optional_detail::optional_base<T>
952
976
  this->assign( val ) ;
953
977
  return *this ;
954
978
  }
955
-
979
+
956
980
  #ifndef BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES
957
981
  // Assigns from a T (deep-moves the rhs value)
958
982
  optional& operator= ( rval_reference_type val )
959
983
  {
960
- optional_detail::prevent_binding_rvalue_ref_to_optional_lvalue_ref<T, rval_reference_type>();
961
984
  this->assign( boost::move(val) ) ;
962
985
  return *this ;
963
986
  }
964
987
  #endif
965
-
988
+
989
+ #endif // BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX
990
+
966
991
  // Assigns from a "none"
967
992
  // Which destroys the current value, if any, leaving this UNINITIALIZED
968
993
  // No-throw (assuming T::~T() doesn't)
@@ -977,9 +1002,20 @@ class optional : public optional_detail::optional_base<T>
977
1002
  // upon exception *this is always uninitialized
978
1003
  template<class... Args>
979
1004
  void emplace ( Args&&... args )
980
- {
981
- this->emplace_assign( boost::forward<Args>(args)... );
982
- }
1005
+ {
1006
+ this->emplace_assign( boost::forward<Args>(args)... );
1007
+ }
1008
+
1009
+ template<class... Args>
1010
+ explicit optional ( in_place_init_t, Args&&... args )
1011
+ : base( in_place_init, boost::forward<Args>(args)... )
1012
+ {}
1013
+
1014
+ template<class... Args>
1015
+ explicit optional ( in_place_init_if_t, bool cond, Args&&... args )
1016
+ : base( in_place_init_if, cond, boost::forward<Args>(args)... )
1017
+ {}
1018
+
983
1019
  #elif (!defined BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES)
984
1020
  template<class Arg>
985
1021
  void emplace ( Arg&& arg )
@@ -991,6 +1027,24 @@ class optional : public optional_detail::optional_base<T>
991
1027
  {
992
1028
  this->emplace_assign();
993
1029
  }
1030
+
1031
+ template<class Args>
1032
+ explicit optional ( in_place_init_t, Args&& args )
1033
+ : base( in_place_init, boost::forward<Args>(args) )
1034
+ {}
1035
+
1036
+ explicit optional ( in_place_init_t )
1037
+ : base( in_place_init )
1038
+ {}
1039
+
1040
+ template<class Args>
1041
+ explicit optional ( in_place_init_if_t, bool cond, Args&& args )
1042
+ : base( in_place_init_if, cond, boost::forward<Args>(args) )
1043
+ {}
1044
+
1045
+ explicit optional ( in_place_init_if_t, bool cond )
1046
+ : base( in_place_init_if, cond )
1047
+ {}
994
1048
  #else
995
1049
  template<class Arg>
996
1050
  void emplace ( const Arg& arg )
@@ -1008,6 +1062,34 @@ class optional : public optional_detail::optional_base<T>
1008
1062
  {
1009
1063
  this->emplace_assign();
1010
1064
  }
1065
+
1066
+ template<class Arg>
1067
+ explicit optional ( in_place_init_t, const Arg& arg )
1068
+ : base( in_place_init, arg )
1069
+ {}
1070
+
1071
+ template<class Arg>
1072
+ explicit optional ( in_place_init_t, Arg& arg )
1073
+ : base( in_place_init, arg )
1074
+ {}
1075
+
1076
+ explicit optional ( in_place_init_t )
1077
+ : base( in_place_init )
1078
+ {}
1079
+
1080
+ template<class Arg>
1081
+ explicit optional ( in_place_init_if_t, bool cond, const Arg& arg )
1082
+ : base( in_place_init_if, cond, arg )
1083
+ {}
1084
+
1085
+ template<class Arg>
1086
+ explicit optional ( in_place_init_if_t, bool cond, Arg& arg )
1087
+ : base( in_place_init_if, cond, arg )
1088
+ {}
1089
+
1090
+ explicit optional ( in_place_init_if_t, bool cond )
1091
+ : base( in_place_init_if, cond )
1092
+ {}
1011
1093
  #endif
1012
1094
 
1013
1095
  void swap( optional & arg )
@@ -1040,7 +1122,7 @@ class optional : public optional_detail::optional_base<T>
1040
1122
  #if (!defined BOOST_NO_CXX11_REF_QUALIFIERS) && (!defined BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES)
1041
1123
  reference_const_type operator *() const& { return this->get() ; }
1042
1124
  reference_type operator *() & { return this->get() ; }
1043
- reference_type_of_temporary_wrapper operator *() && { return base::types::move(this->get()) ; }
1125
+ reference_type_of_temporary_wrapper operator *() && { return boost::move(this->get()) ; }
1044
1126
  #else
1045
1127
  reference_const_type operator *() const { return this->get() ; }
1046
1128
  reference_type operator *() { return this->get() ; }
@@ -1066,7 +1148,7 @@ class optional : public optional_detail::optional_base<T>
1066
1148
  reference_type_of_temporary_wrapper value() &&
1067
1149
  {
1068
1150
  if (this->is_initialized())
1069
- return base::types::move(this->get()) ;
1151
+ return boost::move(this->get()) ;
1070
1152
  else
1071
1153
  throw_exception(bad_optional_access());
1072
1154
  }
@@ -1104,7 +1186,7 @@ class optional : public optional_detail::optional_base<T>
1104
1186
  value_type value_or ( U&& v ) &&
1105
1187
  {
1106
1188
  if (this->is_initialized())
1107
- return base::types::move(get());
1189
+ return boost::move(get());
1108
1190
  else
1109
1191
  return boost::forward<U>(v);
1110
1192
  }
@@ -1152,7 +1234,7 @@ class optional : public optional_detail::optional_base<T>
1152
1234
  value_type value_or_eval ( F f ) &&
1153
1235
  {
1154
1236
  if (this->is_initialized())
1155
- return base::types::move(get());
1237
+ return boost::move(get());
1156
1238
  else
1157
1239
  return f();
1158
1240
  }
@@ -1172,6 +1254,12 @@ class optional : public optional_detail::optional_base<T>
1172
1254
  BOOST_EXPLICIT_OPERATOR_BOOL_NOEXCEPT()
1173
1255
  } ;
1174
1256
 
1257
+ } // namespace boost
1258
+
1259
+ #endif // BOOST_OPTIONAL_CONFIG_USE_OLD_IMPLEMENTATION_OF_OPTIONAL
1260
+
1261
+ namespace boost {
1262
+
1175
1263
  #ifndef BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES
1176
1264
  template<class T>
1177
1265
  class optional<T&&>
@@ -1180,6 +1268,14 @@ class optional<T&&>
1180
1268
  } ;
1181
1269
  #endif
1182
1270
 
1271
+ } // namespace boost
1272
+
1273
+ #ifndef BOOST_OPTIONAL_CONFIG_DONT_SPECIALIZE_OPTIONAL_REFS
1274
+ # include <boost/optional/detail/optional_reference_spec.hpp>
1275
+ #endif
1276
+
1277
+ namespace boost {
1278
+
1183
1279
  // Returns optional<T>(v)
1184
1280
  template<class T>
1185
1281
  inline
@@ -1268,6 +1364,10 @@ get_pointer ( optional<T>& opt )
1268
1364
  return opt.get_ptr() ;
1269
1365
  }
1270
1366
 
1367
+ } // namespace boost
1368
+
1369
+ namespace boost {
1370
+
1271
1371
  // The following declaration prevents a bug where operator safe-bool is used upon streaming optional object if you forget the IO header.
1272
1372
  template<class CharType, class CharTrait>
1273
1373
  std::basic_ostream<CharType, CharTrait>&
@@ -1277,291 +1377,9 @@ operator<<(std::basic_ostream<CharType, CharTrait>& os, optional_detail::optiona
1277
1377
  return os;
1278
1378
  }
1279
1379
 
1280
- // optional's relational operators ( ==, !=, <, >, <=, >= ) have deep-semantics (compare values).
1281
- // WARNING: This is UNLIKE pointers. Use equal_pointees()/less_pointess() in generic code instead.
1282
-
1283
-
1284
- //
1285
- // optional<T> vs optional<T> cases
1286
- //
1287
-
1288
- template<class T>
1289
- inline
1290
- bool operator == ( optional<T> const& x, optional<T> const& y )
1291
- { return equal_pointees(x,y); }
1292
-
1293
- template<class T>
1294
- inline
1295
- bool operator < ( optional<T> const& x, optional<T> const& y )
1296
- { return less_pointees(x,y); }
1297
-
1298
- template<class T>
1299
- inline
1300
- bool operator != ( optional<T> const& x, optional<T> const& y )
1301
- { return !( x == y ) ; }
1302
-
1303
- template<class T>
1304
- inline
1305
- bool operator > ( optional<T> const& x, optional<T> const& y )
1306
- { return y < x ; }
1307
-
1308
- template<class T>
1309
- inline
1310
- bool operator <= ( optional<T> const& x, optional<T> const& y )
1311
- { return !( y < x ) ; }
1312
-
1313
- template<class T>
1314
- inline
1315
- bool operator >= ( optional<T> const& x, optional<T> const& y )
1316
- { return !( x < y ) ; }
1317
-
1318
-
1319
- //
1320
- // optional<T> vs T cases
1321
- //
1322
- template<class T>
1323
- inline
1324
- bool operator == ( optional<T> const& x, T const& y )
1325
- { return equal_pointees(x, optional<T>(y)); }
1326
-
1327
- template<class T>
1328
- inline
1329
- bool operator < ( optional<T> const& x, T const& y )
1330
- { return less_pointees(x, optional<T>(y)); }
1331
-
1332
- template<class T>
1333
- inline
1334
- bool operator != ( optional<T> const& x, T const& y )
1335
- { return !( x == y ) ; }
1336
-
1337
- template<class T>
1338
- inline
1339
- bool operator > ( optional<T> const& x, T const& y )
1340
- { return y < x ; }
1341
-
1342
- template<class T>
1343
- inline
1344
- bool operator <= ( optional<T> const& x, T const& y )
1345
- { return !( y < x ) ; }
1346
-
1347
- template<class T>
1348
- inline
1349
- bool operator >= ( optional<T> const& x, T const& y )
1350
- { return !( x < y ) ; }
1351
-
1352
- //
1353
- // T vs optional<T> cases
1354
- //
1355
-
1356
- template<class T>
1357
- inline
1358
- bool operator == ( T const& x, optional<T> const& y )
1359
- { return equal_pointees( optional<T>(x), y ); }
1360
-
1361
- template<class T>
1362
- inline
1363
- bool operator < ( T const& x, optional<T> const& y )
1364
- { return less_pointees( optional<T>(x), y ); }
1365
-
1366
- template<class T>
1367
- inline
1368
- bool operator != ( T const& x, optional<T> const& y )
1369
- { return !( x == y ) ; }
1370
-
1371
- template<class T>
1372
- inline
1373
- bool operator > ( T const& x, optional<T> const& y )
1374
- { return y < x ; }
1375
-
1376
- template<class T>
1377
- inline
1378
- bool operator <= ( T const& x, optional<T> const& y )
1379
- { return !( y < x ) ; }
1380
-
1381
- template<class T>
1382
- inline
1383
- bool operator >= ( T const& x, optional<T> const& y )
1384
- { return !( x < y ) ; }
1385
-
1386
-
1387
- //
1388
- // optional<T> vs none cases
1389
- //
1390
-
1391
- template<class T>
1392
- inline
1393
- bool operator == ( optional<T> const& x, none_t ) BOOST_NOEXCEPT
1394
- { return !x; }
1395
-
1396
- template<class T>
1397
- inline
1398
- bool operator < ( optional<T> const& x, none_t )
1399
- { return less_pointees(x,optional<T>() ); }
1400
-
1401
- template<class T>
1402
- inline
1403
- bool operator != ( optional<T> const& x, none_t ) BOOST_NOEXCEPT
1404
- { return bool(x); }
1405
-
1406
- template<class T>
1407
- inline
1408
- bool operator > ( optional<T> const& x, none_t y )
1409
- { return y < x ; }
1410
-
1411
- template<class T>
1412
- inline
1413
- bool operator <= ( optional<T> const& x, none_t y )
1414
- { return !( y < x ) ; }
1415
-
1416
- template<class T>
1417
- inline
1418
- bool operator >= ( optional<T> const& x, none_t y )
1419
- { return !( x < y ) ; }
1420
-
1421
- //
1422
- // none vs optional<T> cases
1423
- //
1424
-
1425
- template<class T>
1426
- inline
1427
- bool operator == ( none_t , optional<T> const& y ) BOOST_NOEXCEPT
1428
- { return !y; }
1429
-
1430
- template<class T>
1431
- inline
1432
- bool operator < ( none_t , optional<T> const& y )
1433
- { return less_pointees(optional<T>() ,y); }
1434
-
1435
- template<class T>
1436
- inline
1437
- bool operator != ( none_t, optional<T> const& y ) BOOST_NOEXCEPT
1438
- { return bool(y); }
1439
-
1440
- template<class T>
1441
- inline
1442
- bool operator > ( none_t x, optional<T> const& y )
1443
- { return y < x ; }
1444
-
1445
- template<class T>
1446
- inline
1447
- bool operator <= ( none_t x, optional<T> const& y )
1448
- { return !( y < x ) ; }
1449
-
1450
- template<class T>
1451
- inline
1452
- bool operator >= ( none_t x, optional<T> const& y )
1453
- { return !( x < y ) ; }
1454
-
1455
- namespace optional_detail {
1456
-
1457
- template<bool use_default_constructor> struct swap_selector;
1458
-
1459
- template<>
1460
- struct swap_selector<true>
1461
- {
1462
- template<class T>
1463
- static void optional_swap ( optional<T>& x, optional<T>& y )
1464
- {
1465
- const bool hasX = !!x;
1466
- const bool hasY = !!y;
1467
-
1468
- if ( !hasX && !hasY )
1469
- return;
1470
-
1471
- if( !hasX )
1472
- x.emplace();
1473
- else if ( !hasY )
1474
- y.emplace();
1475
-
1476
- // Boost.Utility.Swap will take care of ADL and workarounds for broken compilers
1477
- boost::swap(x.get(),y.get());
1478
-
1479
- if( !hasX )
1480
- y = boost::none ;
1481
- else if( !hasY )
1482
- x = boost::none ;
1483
- }
1484
- };
1485
-
1486
- #ifndef BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES
1487
- template<>
1488
- struct swap_selector<false>
1489
- {
1490
- template<class T>
1491
- static void optional_swap ( optional<T>& x, optional<T>& y )
1492
- //BOOST_NOEXCEPT_IF(::boost::is_nothrow_move_constructible<T>::value && BOOST_NOEXCEPT_EXPR(boost::swap(*x, *y)))
1493
- {
1494
- if(x)
1495
- {
1496
- if (y)
1497
- {
1498
- boost::swap(*x, *y);
1499
- }
1500
- else
1501
- {
1502
- y = boost::move(*x);
1503
- x = boost::none;
1504
- }
1505
- }
1506
- else
1507
- {
1508
- if (y)
1509
- {
1510
- x = boost::move(*y);
1511
- y = boost::none;
1512
- }
1513
- }
1514
- }
1515
- };
1516
- #else
1517
- template<>
1518
- struct swap_selector<false>
1519
- {
1520
- template<class T>
1521
- static void optional_swap ( optional<T>& x, optional<T>& y )
1522
- {
1523
- const bool hasX = !!x;
1524
- const bool hasY = !!y;
1525
-
1526
- if ( !hasX && hasY )
1527
- {
1528
- x = y.get();
1529
- y = boost::none ;
1530
- }
1531
- else if ( hasX && !hasY )
1532
- {
1533
- y = x.get();
1534
- x = boost::none ;
1535
- }
1536
- else if ( hasX && hasY )
1537
- {
1538
- // Boost.Utility.Swap will take care of ADL and workarounds for broken compilers
1539
- boost::swap(x.get(),y.get());
1540
- }
1541
- }
1542
- };
1543
- #endif // !defined BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES
1544
-
1545
- } // namespace optional_detail
1546
-
1547
- #if (!defined BOOST_NO_CXX11_RVALUE_REFERENCES) && (!defined BOOST_CONFIG_RESTORE_OBSOLETE_SWAP_IMPLEMENTATION)
1548
-
1549
- template<class T>
1550
- struct optional_swap_should_use_default_constructor : boost::false_type {} ;
1551
-
1552
- #else
1553
-
1554
- template<class T>
1555
- struct optional_swap_should_use_default_constructor : has_nothrow_default_constructor<T> {} ;
1556
-
1557
- #endif //BOOST_NO_CXX11_RVALUE_REFERENCES
1558
-
1559
- template<class T> inline void swap ( optional<T>& x, optional<T>& y )
1560
- //BOOST_NOEXCEPT_IF(::boost::is_nothrow_move_constructible<T>::value && BOOST_NOEXCEPT_EXPR(boost::swap(*x, *y)))
1561
- {
1562
- optional_detail::swap_selector<optional_swap_should_use_default_constructor<T>::value>::optional_swap(x, y);
1563
- }
1564
-
1565
1380
  } // namespace boost
1566
1381
 
1567
- #endif
1382
+ #include <boost/optional/detail/optional_relops.hpp>
1383
+ #include <boost/optional/detail/optional_swap.hpp>
1384
+
1385
+ #endif // header guard