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,1059 @@
1
+ // Copyright (C) 2003, 2008 Fernando Luis Cacciola Carballal.
2
+ // Copyright (C) 2014-2016 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 maintainer at:
11
+ // akrzemi1@gmail.com
12
+
13
+ #ifndef BOOST_OPTIONAL_DETAIL_OLD_OPTIONAL_IMPLEMENTATION_AJK_28JAN2015_HPP
14
+ #define BOOST_OPTIONAL_DETAIL_OLD_OPTIONAL_IMPLEMENTATION_AJK_28JAN2015_HPP
15
+
16
+ #include <boost/detail/reference_content.hpp>
17
+ #include <boost/mpl/bool.hpp>
18
+ #include <boost/mpl/if.hpp>
19
+ #include <boost/mpl/not.hpp>
20
+ #include <boost/type_traits/is_reference.hpp>
21
+
22
+ namespace boost {
23
+
24
+ namespace optional_detail {
25
+
26
+
27
+ template<class T>
28
+ struct types_when_isnt_ref
29
+ {
30
+ typedef T const& reference_const_type ;
31
+ typedef T & reference_type ;
32
+ #ifndef BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES
33
+ typedef T && rval_reference_type ;
34
+ typedef T && reference_type_of_temporary_wrapper;
35
+ #ifdef BOOST_MOVE_OLD_RVALUE_REF_BINDING_RULES
36
+ // GCC 4.4 has support for an early draft of rvalue references. The conforming version below
37
+ // causes warnings about returning references to a temporary.
38
+ static T&& move(T&& r) { return r; }
39
+ #else
40
+ static rval_reference_type move(reference_type r) { return boost::move(r); }
41
+ #endif
42
+ #endif
43
+ typedef T const* pointer_const_type ;
44
+ typedef T * pointer_type ;
45
+ typedef T const& argument_type ;
46
+ } ;
47
+
48
+ template<class T>
49
+ struct types_when_is_ref
50
+ {
51
+ typedef BOOST_DEDUCED_TYPENAME remove_reference<T>::type raw_type ;
52
+
53
+ typedef raw_type& reference_const_type ;
54
+ typedef raw_type& reference_type ;
55
+ #ifndef BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES
56
+ typedef BOOST_DEDUCED_TYPENAME remove_const<raw_type>::type&& rval_reference_type ;
57
+ typedef raw_type& reference_type_of_temporary_wrapper;
58
+ static reference_type move(reference_type r) { return r; }
59
+ #endif
60
+ typedef raw_type* pointer_const_type ;
61
+ typedef raw_type* pointer_type ;
62
+ typedef raw_type& argument_type ;
63
+ } ;
64
+
65
+ template <class To, class From>
66
+ void prevent_binding_rvalue_ref_to_optional_lvalue_ref()
67
+ {
68
+ #ifndef BOOST_OPTIONAL_CONFIG_ALLOW_BINDING_TO_RVALUES
69
+ BOOST_STATIC_ASSERT_MSG(
70
+ !boost::is_lvalue_reference<To>::value || !boost::is_rvalue_reference<From>::value,
71
+ "binding rvalue references to optional lvalue references is disallowed");
72
+ #endif
73
+ }
74
+
75
+ struct optional_tag {} ;
76
+
77
+ template<class T>
78
+ class optional_base : public optional_tag
79
+ {
80
+ private :
81
+
82
+ typedef
83
+ #if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
84
+ BOOST_DEDUCED_TYPENAME
85
+ #endif
86
+ ::boost::detail::make_reference_content<T>::type internal_type ;
87
+
88
+ typedef aligned_storage<internal_type> storage_type ;
89
+
90
+ typedef types_when_isnt_ref<T> types_when_not_ref ;
91
+ typedef types_when_is_ref<T> types_when_ref ;
92
+
93
+ typedef optional_base<T> this_type ;
94
+
95
+ protected :
96
+
97
+ typedef T value_type ;
98
+
99
+ typedef mpl::true_ is_reference_tag ;
100
+ typedef mpl::false_ is_not_reference_tag ;
101
+
102
+ typedef BOOST_DEDUCED_TYPENAME is_reference<T>::type is_reference_predicate ;
103
+
104
+ public:
105
+ typedef BOOST_DEDUCED_TYPENAME mpl::if_<is_reference_predicate,types_when_ref,types_when_not_ref>::type types ;
106
+
107
+ protected:
108
+ typedef BOOST_DEDUCED_TYPENAME types::reference_type reference_type ;
109
+ typedef BOOST_DEDUCED_TYPENAME types::reference_const_type reference_const_type ;
110
+ #ifndef BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES
111
+ typedef BOOST_DEDUCED_TYPENAME types::rval_reference_type rval_reference_type ;
112
+ typedef BOOST_DEDUCED_TYPENAME types::reference_type_of_temporary_wrapper reference_type_of_temporary_wrapper ;
113
+ #endif
114
+ typedef BOOST_DEDUCED_TYPENAME types::pointer_type pointer_type ;
115
+ typedef BOOST_DEDUCED_TYPENAME types::pointer_const_type pointer_const_type ;
116
+ typedef BOOST_DEDUCED_TYPENAME types::argument_type argument_type ;
117
+
118
+ // Creates an optional<T> uninitialized.
119
+ // No-throw
120
+ optional_base()
121
+ :
122
+ m_initialized(false) {}
123
+
124
+ // Creates an optional<T> uninitialized.
125
+ // No-throw
126
+ optional_base ( none_t )
127
+ :
128
+ m_initialized(false) {}
129
+
130
+ // Creates an optional<T> initialized with 'val'.
131
+ // Can throw if T::T(T const&) does
132
+ optional_base ( argument_type val )
133
+ :
134
+ m_initialized(false)
135
+ {
136
+ construct(val);
137
+ }
138
+
139
+ #ifndef BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES
140
+ // move-construct an optional<T> initialized from an rvalue-ref to 'val'.
141
+ // Can throw if T::T(T&&) does
142
+ optional_base ( rval_reference_type val )
143
+ :
144
+ m_initialized(false)
145
+ {
146
+ construct( boost::move(val) );
147
+ }
148
+ #endif
149
+
150
+ // Creates an optional<T> initialized with 'val' IFF cond is true, otherwise creates an uninitialzed optional<T>.
151
+ // Can throw if T::T(T const&) does
152
+ optional_base ( bool cond, argument_type val )
153
+ :
154
+ m_initialized(false)
155
+ {
156
+ if ( cond )
157
+ construct(val);
158
+ }
159
+
160
+ // Creates a deep copy of another optional<T>
161
+ // Can throw if T::T(T const&) does
162
+ optional_base ( optional_base const& rhs )
163
+ :
164
+ m_initialized(false)
165
+ {
166
+ if ( rhs.is_initialized() )
167
+ construct(rhs.get_impl());
168
+ }
169
+
170
+ #ifndef BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES
171
+ // Creates a deep move of another optional<T>
172
+ // Can throw if T::T(T&&) does
173
+ optional_base ( optional_base&& rhs )
174
+ :
175
+ m_initialized(false)
176
+ {
177
+ if ( rhs.is_initialized() )
178
+ construct( boost::move(rhs.get_impl()) );
179
+ }
180
+ #endif
181
+
182
+ #ifndef BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES
183
+
184
+ template<class Expr, class PtrExpr>
185
+ explicit optional_base ( Expr&& expr, PtrExpr const* tag )
186
+ :
187
+ m_initialized(false)
188
+ {
189
+ construct(boost::forward<Expr>(expr),tag);
190
+ }
191
+
192
+ #else
193
+ // This is used for both converting and in-place constructions.
194
+ // Derived classes use the 'tag' to select the appropriate
195
+ // implementation (the correct 'construct()' overload)
196
+ template<class Expr>
197
+ explicit optional_base ( Expr const& expr, Expr const* tag )
198
+ :
199
+ m_initialized(false)
200
+ {
201
+ construct(expr,tag);
202
+ }
203
+
204
+ #endif
205
+
206
+
207
+ // No-throw (assuming T::~T() doesn't)
208
+ ~optional_base() { destroy() ; }
209
+
210
+ // Assigns from another optional<T> (deep-copies the rhs value)
211
+ void assign ( optional_base const& rhs )
212
+ {
213
+ if (is_initialized())
214
+ {
215
+ if ( rhs.is_initialized() )
216
+ assign_value(rhs.get_impl(), is_reference_predicate() );
217
+ else destroy();
218
+ }
219
+ else
220
+ {
221
+ if ( rhs.is_initialized() )
222
+ construct(rhs.get_impl());
223
+ }
224
+ }
225
+
226
+ #ifndef BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES
227
+ // Assigns from another optional<T> (deep-moves the rhs value)
228
+ void assign ( optional_base&& rhs )
229
+ {
230
+ if (is_initialized())
231
+ {
232
+ if ( rhs.is_initialized() )
233
+ assign_value(boost::move(rhs.get_impl()), is_reference_predicate() );
234
+ else destroy();
235
+ }
236
+ else
237
+ {
238
+ if ( rhs.is_initialized() )
239
+ construct(boost::move(rhs.get_impl()));
240
+ }
241
+ }
242
+ #endif
243
+
244
+ // Assigns from another _convertible_ optional<U> (deep-copies the rhs value)
245
+ template<class U>
246
+ void assign ( optional<U> const& rhs )
247
+ {
248
+ if (is_initialized())
249
+ {
250
+ if ( rhs.is_initialized() )
251
+ #ifndef BOOST_OPTIONAL_CONFIG_RESTORE_ASSIGNMENT_OF_NONCONVERTIBLE_TYPES
252
+ assign_value(rhs.get(), is_reference_predicate() );
253
+ #else
254
+ assign_value(static_cast<value_type>(rhs.get()), is_reference_predicate() );
255
+ #endif
256
+
257
+ else destroy();
258
+ }
259
+ else
260
+ {
261
+ if ( rhs.is_initialized() )
262
+ #ifndef BOOST_OPTIONAL_CONFIG_RESTORE_ASSIGNMENT_OF_NONCONVERTIBLE_TYPES
263
+ construct(rhs.get());
264
+ #else
265
+ construct(static_cast<value_type>(rhs.get()));
266
+ #endif
267
+ }
268
+ }
269
+
270
+ #ifndef BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES
271
+ // move-assigns from another _convertible_ optional<U> (deep-moves from the rhs value)
272
+ template<class U>
273
+ void assign ( optional<U>&& rhs )
274
+ {
275
+ typedef BOOST_DEDUCED_TYPENAME optional<U>::rval_reference_type ref_type;
276
+ if (is_initialized())
277
+ {
278
+ if ( rhs.is_initialized() )
279
+ assign_value(static_cast<ref_type>(rhs.get()), is_reference_predicate() );
280
+ else destroy();
281
+ }
282
+ else
283
+ {
284
+ if ( rhs.is_initialized() )
285
+ construct(static_cast<ref_type>(rhs.get()));
286
+ }
287
+ }
288
+ #endif
289
+
290
+ // Assigns from a T (deep-copies the rhs value)
291
+ void assign ( argument_type val )
292
+ {
293
+ if (is_initialized())
294
+ assign_value(val, is_reference_predicate() );
295
+ else construct(val);
296
+ }
297
+
298
+ #ifndef BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES
299
+ // Assigns from a T (deep-moves the rhs value)
300
+ void assign ( rval_reference_type val )
301
+ {
302
+ if (is_initialized())
303
+ assign_value( boost::move(val), is_reference_predicate() );
304
+ else construct( boost::move(val) );
305
+ }
306
+ #endif
307
+
308
+ // Assigns from "none", destroying the current value, if any, leaving this UNINITIALIZED
309
+ // No-throw (assuming T::~T() doesn't)
310
+ void assign ( none_t ) BOOST_NOEXCEPT { destroy(); }
311
+
312
+ #ifndef BOOST_OPTIONAL_NO_INPLACE_FACTORY_SUPPORT
313
+
314
+ #ifndef BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES
315
+ template<class Expr, class ExprPtr>
316
+ void assign_expr ( Expr&& expr, ExprPtr const* tag )
317
+ {
318
+ if (is_initialized())
319
+ assign_expr_to_initialized(boost::forward<Expr>(expr),tag);
320
+ else construct(boost::forward<Expr>(expr),tag);
321
+ }
322
+ #else
323
+ template<class Expr>
324
+ void assign_expr ( Expr const& expr, Expr const* tag )
325
+ {
326
+ if (is_initialized())
327
+ assign_expr_to_initialized(expr,tag);
328
+ else construct(expr,tag);
329
+ }
330
+ #endif
331
+
332
+ #endif
333
+
334
+ public :
335
+
336
+ // **DEPPRECATED** Destroys the current value, if any, leaving this UNINITIALIZED
337
+ // No-throw (assuming T::~T() doesn't)
338
+ void reset() BOOST_NOEXCEPT { destroy(); }
339
+
340
+ // **DEPPRECATED** Replaces the current value -if any- with 'val'
341
+ void reset ( argument_type val ) { assign(val); }
342
+
343
+ // Returns a pointer to the value if this is initialized, otherwise,
344
+ // returns NULL.
345
+ // No-throw
346
+ pointer_const_type get_ptr() const { return m_initialized ? get_ptr_impl() : 0 ; }
347
+ pointer_type get_ptr() { return m_initialized ? get_ptr_impl() : 0 ; }
348
+
349
+ bool is_initialized() const { return m_initialized ; }
350
+
351
+ protected :
352
+
353
+ void construct ( argument_type val )
354
+ {
355
+ ::new (m_storage.address()) internal_type(val) ;
356
+ m_initialized = true ;
357
+ }
358
+
359
+ #ifndef BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES
360
+ void construct ( rval_reference_type val )
361
+ {
362
+ ::new (m_storage.address()) internal_type( types::move(val) ) ;
363
+ m_initialized = true ;
364
+ }
365
+ #endif
366
+
367
+
368
+ #if (!defined BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES) && (!defined BOOST_NO_CXX11_VARIADIC_TEMPLATES)
369
+ // Constructs in-place
370
+ // upon exception *this is always uninitialized
371
+ template<class... Args>
372
+ void emplace_assign ( Args&&... args )
373
+ {
374
+ destroy();
375
+ ::new (m_storage.address()) internal_type( boost::forward<Args>(args)... );
376
+ m_initialized = true ;
377
+ }
378
+ #elif (!defined BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES)
379
+ template<class Arg>
380
+ void emplace_assign ( Arg&& arg )
381
+ {
382
+ destroy();
383
+ ::new (m_storage.address()) internal_type( boost::forward<Arg>(arg) );
384
+ m_initialized = true ;
385
+ }
386
+
387
+ void emplace_assign ()
388
+ {
389
+ destroy();
390
+ ::new (m_storage.address()) internal_type();
391
+ m_initialized = true ;
392
+ }
393
+ #else
394
+ template<class Arg>
395
+ void emplace_assign ( const Arg& arg )
396
+ {
397
+ destroy();
398
+ ::new (m_storage.address()) internal_type( arg );
399
+ m_initialized = true ;
400
+ }
401
+
402
+ template<class Arg>
403
+ void emplace_assign ( Arg& arg )
404
+ {
405
+ destroy();
406
+ ::new (m_storage.address()) internal_type( arg );
407
+ m_initialized = true ;
408
+ }
409
+
410
+ void emplace_assign ()
411
+ {
412
+ destroy();
413
+ ::new (m_storage.address()) internal_type();
414
+ m_initialized = true ;
415
+ }
416
+ #endif
417
+
418
+ #ifndef BOOST_OPTIONAL_NO_INPLACE_FACTORY_SUPPORT
419
+
420
+ #ifndef BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES
421
+ // Constructs in-place using the given factory
422
+ template<class Expr>
423
+ void construct ( Expr&& factory, in_place_factory_base const* )
424
+ {
425
+ BOOST_STATIC_ASSERT ( ::boost::mpl::not_<is_reference_predicate>::value ) ;
426
+ boost_optional_detail::construct<value_type>(factory, m_storage.address());
427
+ m_initialized = true ;
428
+ }
429
+
430
+ // Constructs in-place using the given typed factory
431
+ template<class Expr>
432
+ void construct ( Expr&& factory, typed_in_place_factory_base const* )
433
+ {
434
+ BOOST_STATIC_ASSERT ( ::boost::mpl::not_<is_reference_predicate>::value ) ;
435
+ factory.apply(m_storage.address()) ;
436
+ m_initialized = true ;
437
+ }
438
+
439
+ template<class Expr>
440
+ void assign_expr_to_initialized ( Expr&& factory, in_place_factory_base const* tag )
441
+ {
442
+ destroy();
443
+ construct(factory,tag);
444
+ }
445
+
446
+ // Constructs in-place using the given typed factory
447
+ template<class Expr>
448
+ void assign_expr_to_initialized ( Expr&& factory, typed_in_place_factory_base const* tag )
449
+ {
450
+ destroy();
451
+ construct(factory,tag);
452
+ }
453
+
454
+ #else
455
+ // Constructs in-place using the given factory
456
+ template<class Expr>
457
+ void construct ( Expr const& factory, in_place_factory_base const* )
458
+ {
459
+ BOOST_STATIC_ASSERT ( ::boost::mpl::not_<is_reference_predicate>::value ) ;
460
+ boost_optional_detail::construct<value_type>(factory, m_storage.address());
461
+ m_initialized = true ;
462
+ }
463
+
464
+ // Constructs in-place using the given typed factory
465
+ template<class Expr>
466
+ void construct ( Expr const& factory, typed_in_place_factory_base const* )
467
+ {
468
+ BOOST_STATIC_ASSERT ( ::boost::mpl::not_<is_reference_predicate>::value ) ;
469
+ factory.apply(m_storage.address()) ;
470
+ m_initialized = true ;
471
+ }
472
+
473
+ template<class Expr>
474
+ void assign_expr_to_initialized ( Expr const& factory, in_place_factory_base const* tag )
475
+ {
476
+ destroy();
477
+ construct(factory,tag);
478
+ }
479
+
480
+ // Constructs in-place using the given typed factory
481
+ template<class Expr>
482
+ void assign_expr_to_initialized ( Expr const& factory, typed_in_place_factory_base const* tag )
483
+ {
484
+ destroy();
485
+ construct(factory,tag);
486
+ }
487
+ #endif
488
+
489
+ #endif
490
+
491
+ #ifndef BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES
492
+ // Constructs using any expression implicitly convertible to the single argument
493
+ // of a one-argument T constructor.
494
+ // Converting constructions of optional<T> from optional<U> uses this function with
495
+ // 'Expr' being of type 'U' and relying on a converting constructor of T from U.
496
+ template<class Expr>
497
+ void construct ( Expr&& expr, void const* )
498
+ {
499
+ new (m_storage.address()) internal_type(boost::forward<Expr>(expr)) ;
500
+ m_initialized = true ;
501
+ }
502
+
503
+ // Assigns using a form any expression implicitly convertible to the single argument
504
+ // of a T's assignment operator.
505
+ // Converting assignments of optional<T> from optional<U> uses this function with
506
+ // 'Expr' being of type 'U' and relying on a converting assignment of T from U.
507
+ template<class Expr>
508
+ void assign_expr_to_initialized ( Expr&& expr, void const* )
509
+ {
510
+ assign_value(boost::forward<Expr>(expr), is_reference_predicate());
511
+ }
512
+ #else
513
+ // Constructs using any expression implicitly convertible to the single argument
514
+ // of a one-argument T constructor.
515
+ // Converting constructions of optional<T> from optional<U> uses this function with
516
+ // 'Expr' being of type 'U' and relying on a converting constructor of T from U.
517
+ template<class Expr>
518
+ void construct ( Expr const& expr, void const* )
519
+ {
520
+ new (m_storage.address()) internal_type(expr) ;
521
+ m_initialized = true ;
522
+ }
523
+
524
+ // Assigns using a form any expression implicitly convertible to the single argument
525
+ // of a T's assignment operator.
526
+ // Converting assignments of optional<T> from optional<U> uses this function with
527
+ // 'Expr' being of type 'U' and relying on a converting assignment of T from U.
528
+ template<class Expr>
529
+ void assign_expr_to_initialized ( Expr const& expr, void const* )
530
+ {
531
+ assign_value(expr, is_reference_predicate());
532
+ }
533
+
534
+ #endif
535
+
536
+ #ifdef BOOST_OPTIONAL_WEAK_OVERLOAD_RESOLUTION
537
+ // BCB5.64 (and probably lower versions) workaround.
538
+ // The in-place factories are supported by means of catch-all constructors
539
+ // and assignment operators (the functions are parameterized in terms of
540
+ // an arbitrary 'Expr' type)
541
+ // This compiler incorrectly resolves the overload set and sinks optional<T> and optional<U>
542
+ // to the 'Expr'-taking functions even though explicit overloads are present for them.
543
+ // Thus, the following overload is needed to properly handle the case when the 'lhs'
544
+ // is another optional.
545
+ //
546
+ // For VC<=70 compilers this workaround dosen't work becasue the comnpiler issues and error
547
+ // instead of choosing the wrong overload
548
+ //
549
+ #ifndef BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES
550
+ // Notice that 'Expr' will be optional<T> or optional<U> (but not optional_base<..>)
551
+ template<class Expr>
552
+ void construct ( Expr&& expr, optional_tag const* )
553
+ {
554
+ if ( expr.is_initialized() )
555
+ {
556
+ // An exception can be thrown here.
557
+ // It it happens, THIS will be left uninitialized.
558
+ new (m_storage.address()) internal_type(types::move(expr.get())) ;
559
+ m_initialized = true ;
560
+ }
561
+ }
562
+ #else
563
+ // Notice that 'Expr' will be optional<T> or optional<U> (but not optional_base<..>)
564
+ template<class Expr>
565
+ void construct ( Expr const& expr, optional_tag const* )
566
+ {
567
+ if ( expr.is_initialized() )
568
+ {
569
+ // An exception can be thrown here.
570
+ // It it happens, THIS will be left uninitialized.
571
+ new (m_storage.address()) internal_type(expr.get()) ;
572
+ m_initialized = true ;
573
+ }
574
+ }
575
+ #endif
576
+ #endif // defined BOOST_OPTIONAL_WEAK_OVERLOAD_RESOLUTION
577
+
578
+ void assign_value ( argument_type val, is_not_reference_tag ) { get_impl() = val; }
579
+ void assign_value ( argument_type val, is_reference_tag ) { construct(val); }
580
+ #ifndef BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES
581
+ void assign_value ( rval_reference_type val, is_not_reference_tag ) { get_impl() = static_cast<rval_reference_type>(val); }
582
+ void assign_value ( rval_reference_type val, is_reference_tag ) { construct( static_cast<rval_reference_type>(val) ); }
583
+ #endif
584
+
585
+ void destroy()
586
+ {
587
+ if ( m_initialized )
588
+ destroy_impl(is_reference_predicate()) ;
589
+ }
590
+
591
+ reference_const_type get_impl() const { return dereference(get_object(), is_reference_predicate() ) ; }
592
+ reference_type get_impl() { return dereference(get_object(), is_reference_predicate() ) ; }
593
+
594
+ pointer_const_type get_ptr_impl() const { return cast_ptr(get_object(), is_reference_predicate() ) ; }
595
+ pointer_type get_ptr_impl() { return cast_ptr(get_object(), is_reference_predicate() ) ; }
596
+
597
+ private :
598
+
599
+ // internal_type can be either T or reference_content<T>
600
+ #if defined(BOOST_OPTIONAL_DETAIL_USE_ATTRIBUTE_MAY_ALIAS)
601
+ // This workaround is supposed to silence GCC warnings about broken strict aliasing rules
602
+ internal_type const* get_object() const
603
+ {
604
+ union { void const* ap_pvoid; internal_type const* as_ptype; } caster = { m_storage.address() };
605
+ return caster.as_ptype;
606
+ }
607
+ internal_type * get_object()
608
+ {
609
+ union { void* ap_pvoid; internal_type* as_ptype; } caster = { m_storage.address() };
610
+ return caster.as_ptype;
611
+ }
612
+ #else
613
+ internal_type const* get_object() const { return static_cast<internal_type const*>(m_storage.address()); }
614
+ internal_type * get_object() { return static_cast<internal_type *> (m_storage.address()); }
615
+ #endif
616
+
617
+ // reference_content<T> lacks an implicit conversion to T&, so the following is needed to obtain a proper reference.
618
+ reference_const_type dereference( internal_type const* p, is_not_reference_tag ) const { return *p ; }
619
+ reference_type dereference( internal_type* p, is_not_reference_tag ) { return *p ; }
620
+ reference_const_type dereference( internal_type const* p, is_reference_tag ) const { return p->get() ; }
621
+ reference_type dereference( internal_type* p, is_reference_tag ) { return p->get() ; }
622
+
623
+ #if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x581))
624
+ void destroy_impl ( is_not_reference_tag ) { get_ptr_impl()->internal_type::~internal_type() ; m_initialized = false ; }
625
+ #else
626
+ void destroy_impl ( is_not_reference_tag ) { get_ptr_impl()->~T() ; m_initialized = false ; }
627
+ #endif
628
+
629
+ void destroy_impl ( is_reference_tag ) { m_initialized = false ; }
630
+
631
+ // If T is of reference type, trying to get a pointer to the held value must result in a compile-time error.
632
+ // Decent compilers should disallow conversions from reference_content<T>* to T*, but just in case,
633
+ // the following olverloads are used to filter out the case and guarantee an error in case of T being a reference.
634
+ pointer_const_type cast_ptr( internal_type const* p, is_not_reference_tag ) const { return p ; }
635
+ pointer_type cast_ptr( internal_type * p, is_not_reference_tag ) { return p ; }
636
+ pointer_const_type cast_ptr( internal_type const* p, is_reference_tag ) const { return &p->get() ; }
637
+ pointer_type cast_ptr( internal_type * p, is_reference_tag ) { return &p->get() ; }
638
+
639
+ bool m_initialized ;
640
+ storage_type m_storage ;
641
+ } ;
642
+
643
+ } // namespace optional_detail
644
+
645
+ template<class T>
646
+ class optional : public optional_detail::optional_base<T>
647
+ {
648
+ typedef optional_detail::optional_base<T> base ;
649
+
650
+ public :
651
+
652
+ typedef optional<T> this_type ;
653
+
654
+ typedef BOOST_DEDUCED_TYPENAME base::value_type value_type ;
655
+ typedef BOOST_DEDUCED_TYPENAME base::reference_type reference_type ;
656
+ typedef BOOST_DEDUCED_TYPENAME base::reference_const_type reference_const_type ;
657
+ #ifndef BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES
658
+ typedef BOOST_DEDUCED_TYPENAME base::rval_reference_type rval_reference_type ;
659
+ typedef BOOST_DEDUCED_TYPENAME base::reference_type_of_temporary_wrapper reference_type_of_temporary_wrapper ;
660
+ #endif
661
+ typedef BOOST_DEDUCED_TYPENAME base::pointer_type pointer_type ;
662
+ typedef BOOST_DEDUCED_TYPENAME base::pointer_const_type pointer_const_type ;
663
+ typedef BOOST_DEDUCED_TYPENAME base::argument_type argument_type ;
664
+
665
+ // Creates an optional<T> uninitialized.
666
+ // No-throw
667
+ optional() BOOST_NOEXCEPT : base() {}
668
+
669
+ // Creates an optional<T> uninitialized.
670
+ // No-throw
671
+ optional( none_t none_ ) BOOST_NOEXCEPT : base(none_) {}
672
+
673
+ // Creates an optional<T> initialized with 'val'.
674
+ // Can throw if T::T(T const&) does
675
+ optional ( argument_type val ) : base(val) {}
676
+
677
+ #ifndef BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES
678
+ // Creates an optional<T> initialized with 'move(val)'.
679
+ // Can throw if T::T(T &&) does
680
+ optional ( rval_reference_type val ) : base( boost::forward<T>(val) )
681
+ {optional_detail::prevent_binding_rvalue_ref_to_optional_lvalue_ref<T, rval_reference_type>();}
682
+ #endif
683
+
684
+ // Creates an optional<T> initialized with 'val' IFF cond is true, otherwise creates an uninitialized optional.
685
+ // Can throw if T::T(T const&) does
686
+ optional ( bool cond, argument_type val ) : base(cond,val) {}
687
+
688
+ // NOTE: MSVC needs templated versions first
689
+
690
+ // Creates a deep copy of another convertible optional<U>
691
+ // Requires a valid conversion from U to T.
692
+ // Can throw if T::T(U const&) does
693
+ template<class U>
694
+ explicit optional ( optional<U> const& rhs )
695
+ :
696
+ base()
697
+ {
698
+ if ( rhs.is_initialized() )
699
+ this->construct(rhs.get());
700
+ }
701
+
702
+ #ifndef BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES
703
+ // Creates a deep move of another convertible optional<U>
704
+ // Requires a valid conversion from U to T.
705
+ // Can throw if T::T(U&&) does
706
+ template<class U>
707
+ explicit optional ( optional<U> && rhs )
708
+ :
709
+ base()
710
+ {
711
+ if ( rhs.is_initialized() )
712
+ this->construct( boost::move(rhs.get()) );
713
+ }
714
+ #endif
715
+
716
+ #ifndef BOOST_OPTIONAL_NO_INPLACE_FACTORY_SUPPORT
717
+ // Creates an optional<T> with an expression which can be either
718
+ // (a) An instance of InPlaceFactory (i.e. in_place(a,b,...,n);
719
+ // (b) An instance of TypedInPlaceFactory ( i.e. in_place<T>(a,b,...,n);
720
+ // (c) Any expression implicitly convertible to the single type
721
+ // of a one-argument T's constructor.
722
+ // (d*) Weak compilers (BCB) might also resolved Expr as optional<T> and optional<U>
723
+ // even though explicit overloads are present for these.
724
+ // Depending on the above some T ctor is called.
725
+ // Can throw if the resolved T ctor throws.
726
+ #ifndef BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES
727
+
728
+
729
+ template<class Expr>
730
+ explicit optional ( Expr&& expr,
731
+ BOOST_DEDUCED_TYPENAME boost::disable_if_c<
732
+ (boost::is_base_of<optional_detail::optional_tag, BOOST_DEDUCED_TYPENAME boost::decay<Expr>::type>::value) ||
733
+ boost::is_same<BOOST_DEDUCED_TYPENAME boost::decay<Expr>::type, none_t>::value >::type* = 0
734
+ )
735
+ : base(boost::forward<Expr>(expr),boost::addressof(expr))
736
+ {optional_detail::prevent_binding_rvalue_ref_to_optional_lvalue_ref<T, Expr&&>();}
737
+
738
+ #else
739
+ template<class Expr>
740
+ explicit optional ( Expr const& expr ) : base(expr,boost::addressof(expr)) {}
741
+ #endif // !defined BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES
742
+ #endif // !defined BOOST_OPTIONAL_NO_INPLACE_FACTORY_SUPPORT
743
+
744
+ // Creates a deep copy of another optional<T>
745
+ // Can throw if T::T(T const&) does
746
+ optional ( optional const& rhs ) : base( static_cast<base const&>(rhs) ) {}
747
+
748
+ #ifndef BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES
749
+ // Creates a deep move of another optional<T>
750
+ // Can throw if T::T(T&&) does
751
+ optional ( optional && rhs )
752
+ BOOST_NOEXCEPT_IF(::boost::is_nothrow_move_constructible<T>::value)
753
+ : base( boost::move(rhs) )
754
+ {}
755
+
756
+ #endif
757
+ // No-throw (assuming T::~T() doesn't)
758
+ ~optional() {}
759
+
760
+ #if !defined(BOOST_OPTIONAL_NO_INPLACE_FACTORY_SUPPORT) && !defined(BOOST_OPTIONAL_WEAK_OVERLOAD_RESOLUTION)
761
+ // Assigns from an expression. See corresponding constructor.
762
+ // Basic Guarantee: If the resolved T ctor throws, this is left UNINITIALIZED
763
+ #ifndef BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES
764
+
765
+ template<class Expr>
766
+ BOOST_DEDUCED_TYPENAME boost::disable_if_c<
767
+ boost::is_base_of<optional_detail::optional_tag, BOOST_DEDUCED_TYPENAME boost::decay<Expr>::type>::value ||
768
+ boost::is_same<BOOST_DEDUCED_TYPENAME boost::decay<Expr>::type, none_t>::value,
769
+ optional&
770
+ >::type
771
+ operator= ( Expr&& expr )
772
+ {
773
+ optional_detail::prevent_binding_rvalue_ref_to_optional_lvalue_ref<T, Expr&&>();
774
+ this->assign_expr(boost::forward<Expr>(expr),boost::addressof(expr));
775
+ return *this ;
776
+ }
777
+
778
+ #else
779
+ template<class Expr>
780
+ optional& operator= ( Expr const& expr )
781
+ {
782
+ this->assign_expr(expr,boost::addressof(expr));
783
+ return *this ;
784
+ }
785
+ #endif // !defined BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES
786
+ #endif // !defined(BOOST_OPTIONAL_NO_INPLACE_FACTORY_SUPPORT) && !defined(BOOST_OPTIONAL_WEAK_OVERLOAD_RESOLUTION)
787
+
788
+ // Copy-assigns from another convertible optional<U> (converts && deep-copies the rhs value)
789
+ // Requires a valid conversion from U to T.
790
+ // Basic Guarantee: If T::T( U const& ) throws, this is left UNINITIALIZED
791
+ template<class U>
792
+ optional& operator= ( optional<U> const& rhs )
793
+ {
794
+ this->assign(rhs);
795
+ return *this ;
796
+ }
797
+
798
+ #ifndef BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES
799
+ // Move-assigns from another convertible optional<U> (converts && deep-moves the rhs value)
800
+ // Requires a valid conversion from U to T.
801
+ // Basic Guarantee: If T::T( U && ) throws, this is left UNINITIALIZED
802
+ template<class U>
803
+ optional& operator= ( optional<U> && rhs )
804
+ {
805
+ this->assign(boost::move(rhs));
806
+ return *this ;
807
+ }
808
+ #endif
809
+
810
+ // Assigns from another optional<T> (deep-copies the rhs value)
811
+ // Basic Guarantee: If T::T( T const& ) throws, this is left UNINITIALIZED
812
+ // (NOTE: On BCB, this operator is not actually called and left is left UNMODIFIED in case of a throw)
813
+ optional& operator= ( optional const& rhs )
814
+ {
815
+ this->assign( static_cast<base const&>(rhs) ) ;
816
+ return *this ;
817
+ }
818
+
819
+ #ifndef BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES
820
+ // Assigns from another optional<T> (deep-moves the rhs value)
821
+ optional& operator= ( optional && rhs )
822
+ BOOST_NOEXCEPT_IF(::boost::is_nothrow_move_constructible<T>::value && ::boost::is_nothrow_move_assignable<T>::value)
823
+ {
824
+ this->assign( static_cast<base &&>(rhs) ) ;
825
+ return *this ;
826
+ }
827
+ #endif
828
+
829
+ // Assigns from a T (deep-copies the rhs value)
830
+ // Basic Guarantee: If T::( T const& ) throws, this is left UNINITIALIZED
831
+ optional& operator= ( argument_type val )
832
+ {
833
+ this->assign( val ) ;
834
+ return *this ;
835
+ }
836
+
837
+ #ifndef BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES
838
+ // Assigns from a T (deep-moves the rhs value)
839
+ optional& operator= ( rval_reference_type val )
840
+ {
841
+ optional_detail::prevent_binding_rvalue_ref_to_optional_lvalue_ref<T, rval_reference_type>();
842
+ this->assign( boost::move(val) ) ;
843
+ return *this ;
844
+ }
845
+ #endif
846
+
847
+ // Assigns from a "none"
848
+ // Which destroys the current value, if any, leaving this UNINITIALIZED
849
+ // No-throw (assuming T::~T() doesn't)
850
+ optional& operator= ( none_t none_ ) BOOST_NOEXCEPT
851
+ {
852
+ this->assign( none_ ) ;
853
+ return *this ;
854
+ }
855
+
856
+ #if (!defined BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES) && (!defined BOOST_NO_CXX11_VARIADIC_TEMPLATES)
857
+ // Constructs in-place
858
+ // upon exception *this is always uninitialized
859
+ template<class... Args>
860
+ void emplace ( Args&&... args )
861
+ {
862
+ this->emplace_assign( boost::forward<Args>(args)... );
863
+ }
864
+ #elif (!defined BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES)
865
+ template<class Arg>
866
+ void emplace ( Arg&& arg )
867
+ {
868
+ this->emplace_assign( boost::forward<Arg>(arg) );
869
+ }
870
+
871
+ void emplace ()
872
+ {
873
+ this->emplace_assign();
874
+ }
875
+ #else
876
+ template<class Arg>
877
+ void emplace ( const Arg& arg )
878
+ {
879
+ this->emplace_assign( arg );
880
+ }
881
+
882
+ template<class Arg>
883
+ void emplace ( Arg& arg )
884
+ {
885
+ this->emplace_assign( arg );
886
+ }
887
+
888
+ void emplace ()
889
+ {
890
+ this->emplace_assign();
891
+ }
892
+ #endif
893
+
894
+ void swap( optional & arg )
895
+ BOOST_NOEXCEPT_IF(::boost::is_nothrow_move_constructible<T>::value && ::boost::is_nothrow_move_assignable<T>::value)
896
+ {
897
+ // allow for Koenig lookup
898
+ boost::swap(*this, arg);
899
+ }
900
+
901
+
902
+ // Returns a reference to the value if this is initialized, otherwise,
903
+ // the behaviour is UNDEFINED
904
+ // No-throw
905
+ reference_const_type get() const { BOOST_ASSERT(this->is_initialized()) ; return this->get_impl(); }
906
+ reference_type get() { BOOST_ASSERT(this->is_initialized()) ; return this->get_impl(); }
907
+
908
+ // Returns a copy of the value if this is initialized, 'v' otherwise
909
+ reference_const_type get_value_or ( reference_const_type v ) const { return this->is_initialized() ? get() : v ; }
910
+ reference_type get_value_or ( reference_type v ) { return this->is_initialized() ? get() : v ; }
911
+
912
+ // Returns a pointer to the value if this is initialized, otherwise,
913
+ // the behaviour is UNDEFINED
914
+ // No-throw
915
+ pointer_const_type operator->() const { BOOST_ASSERT(this->is_initialized()) ; return this->get_ptr_impl() ; }
916
+ pointer_type operator->() { BOOST_ASSERT(this->is_initialized()) ; return this->get_ptr_impl() ; }
917
+
918
+ // Returns a reference to the value if this is initialized, otherwise,
919
+ // the behaviour is UNDEFINED
920
+ // No-throw
921
+ #if (!defined BOOST_NO_CXX11_REF_QUALIFIERS) && (!defined BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES)
922
+ reference_const_type operator *() const& { return this->get() ; }
923
+ reference_type operator *() & { return this->get() ; }
924
+ reference_type_of_temporary_wrapper operator *() && { return base::types::move(this->get()) ; }
925
+ #else
926
+ reference_const_type operator *() const { return this->get() ; }
927
+ reference_type operator *() { return this->get() ; }
928
+ #endif // !defined BOOST_NO_CXX11_REF_QUALIFIERS
929
+
930
+ #if (!defined BOOST_NO_CXX11_REF_QUALIFIERS) && (!defined BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES)
931
+ reference_const_type value() const&
932
+ {
933
+ if (this->is_initialized())
934
+ return this->get() ;
935
+ else
936
+ throw_exception(bad_optional_access());
937
+ }
938
+
939
+ reference_type value() &
940
+ {
941
+ if (this->is_initialized())
942
+ return this->get() ;
943
+ else
944
+ throw_exception(bad_optional_access());
945
+ }
946
+
947
+ reference_type_of_temporary_wrapper value() &&
948
+ {
949
+ if (this->is_initialized())
950
+ return base::types::move(this->get()) ;
951
+ else
952
+ throw_exception(bad_optional_access());
953
+ }
954
+
955
+ #else
956
+ reference_const_type value() const
957
+ {
958
+ if (this->is_initialized())
959
+ return this->get() ;
960
+ else
961
+ throw_exception(bad_optional_access());
962
+ }
963
+
964
+ reference_type value()
965
+ {
966
+ if (this->is_initialized())
967
+ return this->get() ;
968
+ else
969
+ throw_exception(bad_optional_access());
970
+ }
971
+ #endif
972
+
973
+
974
+ #ifndef BOOST_NO_CXX11_REF_QUALIFIERS
975
+ template <class U>
976
+ value_type value_or ( U&& v ) const&
977
+ {
978
+ if (this->is_initialized())
979
+ return get();
980
+ else
981
+ return boost::forward<U>(v);
982
+ }
983
+
984
+ template <class U>
985
+ value_type value_or ( U&& v ) &&
986
+ {
987
+ if (this->is_initialized())
988
+ return base::types::move(get());
989
+ else
990
+ return boost::forward<U>(v);
991
+ }
992
+ #elif !defined BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES
993
+ template <class U>
994
+ value_type value_or ( U&& v ) const
995
+ {
996
+ if (this->is_initialized())
997
+ return get();
998
+ else
999
+ return boost::forward<U>(v);
1000
+ }
1001
+ #else
1002
+ template <class U>
1003
+ value_type value_or ( U const& v ) const
1004
+ {
1005
+ if (this->is_initialized())
1006
+ return get();
1007
+ else
1008
+ return v;
1009
+ }
1010
+
1011
+ template <class U>
1012
+ value_type value_or ( U& v ) const
1013
+ {
1014
+ if (this->is_initialized())
1015
+ return get();
1016
+ else
1017
+ return v;
1018
+ }
1019
+ #endif
1020
+
1021
+
1022
+ #ifndef BOOST_NO_CXX11_REF_QUALIFIERS
1023
+ template <typename F>
1024
+ value_type value_or_eval ( F f ) const&
1025
+ {
1026
+ if (this->is_initialized())
1027
+ return get();
1028
+ else
1029
+ return f();
1030
+ }
1031
+
1032
+ template <typename F>
1033
+ value_type value_or_eval ( F f ) &&
1034
+ {
1035
+ if (this->is_initialized())
1036
+ return base::types::move(get());
1037
+ else
1038
+ return f();
1039
+ }
1040
+ #else
1041
+ template <typename F>
1042
+ value_type value_or_eval ( F f ) const
1043
+ {
1044
+ if (this->is_initialized())
1045
+ return get();
1046
+ else
1047
+ return f();
1048
+ }
1049
+ #endif
1050
+
1051
+ bool operator!() const BOOST_NOEXCEPT { return !this->is_initialized() ; }
1052
+
1053
+ BOOST_EXPLICIT_OPERATOR_BOOL_NOEXCEPT()
1054
+ } ;
1055
+
1056
+ } // namespace boost
1057
+
1058
+
1059
+ #endif // header guard