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
@@ -11,53 +11,49 @@
11
11
  #pragma once
12
12
  #endif
13
13
 
14
- #include <memory>
15
- #include <functional>
16
14
  #include <boost/functional/hash_fwd.hpp>
17
15
  #include <boost/unordered/detail/fwd.hpp>
16
+ #include <functional>
17
+ #include <memory>
18
+
19
+ namespace boost {
20
+ namespace unordered {
21
+ template <class T, class H = boost::hash<T>, class P = std::equal_to<T>,
22
+ class A = std::allocator<T> >
23
+ class unordered_set;
24
+
25
+ template <class T, class H, class P, class A>
26
+ inline bool operator==(
27
+ unordered_set<T, H, P, A> const&, unordered_set<T, H, P, A> const&);
28
+ template <class T, class H, class P, class A>
29
+ inline bool operator!=(
30
+ unordered_set<T, H, P, A> const&, unordered_set<T, H, P, A> const&);
31
+ template <class T, class H, class P, class A>
32
+ inline void swap(unordered_set<T, H, P, A>& m1, unordered_set<T, H, P, A>& m2);
33
+
34
+ template <class T, class H = boost::hash<T>, class P = std::equal_to<T>,
35
+ class A = std::allocator<T> >
36
+ class unordered_multiset;
37
+
38
+ template <class T, class H, class P, class A>
39
+ inline bool operator==(unordered_multiset<T, H, P, A> const&,
40
+ unordered_multiset<T, H, P, A> const&);
41
+ template <class T, class H, class P, class A>
42
+ inline bool operator!=(unordered_multiset<T, H, P, A> const&,
43
+ unordered_multiset<T, H, P, A> const&);
44
+ template <class T, class H, class P, class A>
45
+ inline void swap(
46
+ unordered_multiset<T, H, P, A>& m1, unordered_multiset<T, H, P, A>& m2);
47
+
48
+ template <class N, class T, class A> class node_handle_set;
49
+ template <class N, class T, class A> struct insert_return_type_set;
50
+ }
18
51
 
19
- namespace boost
20
- {
21
- namespace unordered
22
- {
23
- template <class T,
24
- class H = boost::hash<T>,
25
- class P = std::equal_to<T>,
26
- class A = std::allocator<T> >
27
- class unordered_set;
28
-
29
- template <class T, class H, class P, class A>
30
- inline bool operator==(unordered_set<T, H, P, A> const&,
31
- unordered_set<T, H, P, A> const&);
32
- template <class T, class H, class P, class A>
33
- inline bool operator!=(unordered_set<T, H, P, A> const&,
34
- unordered_set<T, H, P, A> const&);
35
- template <class T, class H, class P, class A>
36
- inline void swap(unordered_set<T, H, P, A> &m1,
37
- unordered_set<T, H, P, A> &m2);
38
-
39
- template <class T,
40
- class H = boost::hash<T>,
41
- class P = std::equal_to<T>,
42
- class A = std::allocator<T> >
43
- class unordered_multiset;
44
-
45
- template <class T, class H, class P, class A>
46
- inline bool operator==(unordered_multiset<T, H, P, A> const&,
47
- unordered_multiset<T, H, P, A> const&);
48
- template <class T, class H, class P, class A>
49
- inline bool operator!=(unordered_multiset<T, H, P, A> const&,
50
- unordered_multiset<T, H, P, A> const&);
51
- template <class T, class H, class P, class A>
52
- inline void swap(unordered_multiset<T, H, P, A> &m1,
53
- unordered_multiset<T, H, P, A> &m2);
54
- }
55
-
56
- using boost::unordered::unordered_set;
57
- using boost::unordered::unordered_multiset;
58
- using boost::unordered::swap;
59
- using boost::unordered::operator==;
60
- using boost::unordered::operator!=;
52
+ using boost::unordered::unordered_set;
53
+ using boost::unordered::unordered_multiset;
54
+ using boost::unordered::swap;
55
+ using boost::unordered::operator==;
56
+ using boost::unordered::operator!=;
61
57
  }
62
58
 
63
59
  #endif
@@ -14,8 +14,8 @@
14
14
  #include <boost/utility/binary.hpp>
15
15
  #include <boost/utility/enable_if.hpp>
16
16
  #include <boost/utility/identity_type.hpp>
17
- #include <boost/checked_delete.hpp>
17
+ #include <boost/core/checked_delete.hpp>
18
+ #include <boost/core/noncopyable.hpp>
18
19
  #include <boost/next_prior.hpp>
19
- #include <boost/noncopyable.hpp>
20
20
 
21
21
  #endif // BOOST_UTILITY_HPP
@@ -47,11 +47,11 @@
47
47
  // {}
48
48
  // This macro should only persist within this file.
49
49
 
50
- #define BOOST_PRIVATE_CTR_DEF( z, n, data ) \
51
- template < BOOST_PP_ENUM_PARAMS(n, typename T) > \
52
- explicit base_from_member( BOOST_PP_ENUM_BINARY_PARAMS(n, T, x) ) \
53
- : member( BOOST_PP_ENUM_PARAMS(n, x) ) \
54
- {} \
50
+ #define BOOST_PRIVATE_CTR_DEF( z, n, data ) \
51
+ template < BOOST_PP_ENUM_PARAMS(n, typename T) > \
52
+ base_from_member( BOOST_PP_ENUM_BINARY_PARAMS(n, T, x) ) \
53
+ : member( BOOST_PP_ENUM_PARAMS(n, x) ) \
54
+ {} \
55
55
  /**/
56
56
 
57
57
 
@@ -142,7 +142,8 @@ protected:
142
142
  : member()
143
143
  {}
144
144
 
145
- BOOST_PP_REPEAT_FROM_TO( 1, BOOST_PP_INC(BOOST_BASE_FROM_MEMBER_MAX_ARITY),
145
+ template < typename T0 > explicit base_from_member( T0 x0 ) : member( x0 ) {}
146
+ BOOST_PP_REPEAT_FROM_TO( 2, BOOST_PP_INC(BOOST_BASE_FROM_MEMBER_MAX_ARITY),
146
147
  BOOST_PRIVATE_CTR_DEF, _ )
147
148
  #endif
148
149
 
@@ -33,8 +33,12 @@ bool equal_pointees ( OptionalPointee const& x, OptionalPointee const& y )
33
33
  }
34
34
 
35
35
  template<class OptionalPointee>
36
- struct equal_pointees_t : std::binary_function<OptionalPointee,OptionalPointee,bool>
36
+ struct equal_pointees_t
37
37
  {
38
+ typedef bool result_type;
39
+ typedef OptionalPointee first_argument_type;
40
+ typedef OptionalPointee second_argument_type;
41
+
38
42
  bool operator() ( OptionalPointee const& x, OptionalPointee const& y ) const
39
43
  { return equal_pointees(x,y) ; }
40
44
  } ;
@@ -56,8 +60,12 @@ bool less_pointees ( OptionalPointee const& x, OptionalPointee const& y )
56
60
  }
57
61
 
58
62
  template<class OptionalPointee>
59
- struct less_pointees_t : std::binary_function<OptionalPointee,OptionalPointee,bool>
63
+ struct less_pointees_t
60
64
  {
65
+ typedef bool result_type;
66
+ typedef OptionalPointee first_argument_type;
67
+ typedef OptionalPointee second_argument_type;
68
+
61
69
  bool operator() ( OptionalPointee const& x, OptionalPointee const& y ) const
62
70
  { return less_pointees(x,y) ; }
63
71
  } ;
@@ -27,6 +27,11 @@
27
27
  #include <string>
28
28
  #include <iosfwd>
29
29
 
30
+ #if defined(BOOST_NO_CXX11_DEFAULTED_FUNCTIONS) || (defined(BOOST_GCC) && ((BOOST_GCC+0) / 100) <= 406)
31
+ // GCC 4.6 cannot handle a defaulted function with noexcept specifier
32
+ #define BOOST_STRING_REF_NO_CXX11_DEFAULTED_NOEXCEPT_FUNCTIONS
33
+ #endif
34
+
30
35
  namespace boost {
31
36
 
32
37
  namespace detail {
@@ -57,26 +62,44 @@ namespace boost {
57
62
  static BOOST_CONSTEXPR_OR_CONST size_type npos = size_type(-1);
58
63
 
59
64
  // construct/copy
60
- BOOST_CONSTEXPR basic_string_ref ()
65
+ BOOST_CONSTEXPR basic_string_ref () BOOST_NOEXCEPT
61
66
  : ptr_(NULL), len_(0) {}
62
67
 
63
- BOOST_CONSTEXPR basic_string_ref (const basic_string_ref &rhs)
68
+ // by defaulting these functions, basic_string_ref becomes
69
+ // trivially copy/move constructible.
70
+ BOOST_CONSTEXPR basic_string_ref (const basic_string_ref &rhs) BOOST_NOEXCEPT
71
+ #ifndef BOOST_STRING_REF_NO_CXX11_DEFAULTED_NOEXCEPT_FUNCTIONS
72
+ = default;
73
+ #else
64
74
  : ptr_(rhs.ptr_), len_(rhs.len_) {}
75
+ #endif
65
76
 
66
- basic_string_ref& operator=(const basic_string_ref &rhs) {
77
+ basic_string_ref& operator=(const basic_string_ref &rhs) BOOST_NOEXCEPT
78
+ #ifndef BOOST_STRING_REF_NO_CXX11_DEFAULTED_NOEXCEPT_FUNCTIONS
79
+ = default;
80
+ #else
81
+ {
67
82
  ptr_ = rhs.ptr_;
68
83
  len_ = rhs.len_;
69
84
  return *this;
70
85
  }
86
+ #endif
71
87
 
72
- basic_string_ref(const charT* str)
88
+ basic_string_ref(const charT* str) BOOST_NOEXCEPT
73
89
  : ptr_(str), len_(traits::length(str)) {}
74
90
 
75
91
  template<typename Allocator>
76
92
  basic_string_ref(const std::basic_string<charT, traits, Allocator>& str)
77
93
  : ptr_(str.data()), len_(str.length()) {}
78
94
 
79
- BOOST_CONSTEXPR basic_string_ref(const charT* str, size_type len)
95
+ // #if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) && !defined(BOOST_NO_CXX11_DELETED_FUNCTIONS)
96
+ // // Constructing a string_ref from a temporary string is a bad idea
97
+ // template<typename Allocator>
98
+ // basic_string_ref( std::basic_string<charT, traits, Allocator>&&)
99
+ // = delete;
100
+ // #endif
101
+
102
+ BOOST_CONSTEXPR basic_string_ref(const charT* str, size_type len) BOOST_NOEXCEPT
80
103
  : ptr_(str), len_(len) {}
81
104
 
82
105
  #ifndef BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS
@@ -139,9 +162,7 @@ namespace boost {
139
162
  basic_string_ref substr(size_type pos, size_type n=npos) const {
140
163
  if ( pos > size())
141
164
  BOOST_THROW_EXCEPTION( std::out_of_range ( "string_ref::substr" ) );
142
- if ( n == npos || pos + n > size())
143
- n = size () - pos;
144
- return basic_string_ref ( data() + pos, n );
165
+ return basic_string_ref(data() + pos, (std::min)(size() - pos, n));
145
166
  }
146
167
 
147
168
  int compare(basic_string_ref x) const {
@@ -174,13 +195,13 @@ namespace boost {
174
195
  size_type rfind(basic_string_ref s) const {
175
196
  const_reverse_iterator iter = std::search ( this->crbegin (), this->crend (),
176
197
  s.crbegin (), s.crend (), traits::eq );
177
- return iter == this->crend () ? npos : reverse_distance ( this->crbegin (), iter );
198
+ return iter == this->crend () ? npos : (std::distance(iter, this->crend()) - s.size());
178
199
  }
179
200
 
180
201
  size_type rfind(charT c) const {
181
202
  const_reverse_iterator iter = std::find_if ( this->crbegin (), this->crend (),
182
203
  detail::string_ref_traits_eq<charT, traits> ( c ));
183
- return iter == this->crend () ? npos : reverse_distance ( this->crbegin (), iter );
204
+ return iter == this->crend () ? npos : (this->size() - 1 - std::distance(this->crbegin(), iter));
184
205
  }
185
206
 
186
207
  size_type find_first_of(charT c) const { return find (c); }
@@ -195,7 +216,7 @@ namespace boost {
195
216
  size_type find_last_of(basic_string_ref s) const {
196
217
  const_reverse_iterator iter = std::find_first_of
197
218
  ( this->crbegin (), this->crend (), s.cbegin (), s.cend (), traits::eq );
198
- return iter == this->crend () ? npos : reverse_distance ( this->crbegin (), iter);
219
+ return iter == this->crend () ? npos : (this->size() - 1 - std::distance(this->crbegin(), iter));
199
220
  }
200
221
 
201
222
  size_type find_first_not_of(basic_string_ref s) const {
@@ -212,21 +233,17 @@ namespace boost {
212
233
 
213
234
  size_type find_last_not_of(basic_string_ref s) const {
214
235
  const_reverse_iterator iter = find_not_of ( this->crbegin (), this->crend (), s );
215
- return iter == this->crend () ? npos : reverse_distance ( this->crbegin (), iter );
236
+ return iter == this->crend () ? npos : (this->size() - 1 - std::distance(this->crbegin(), iter));
216
237
  }
217
238
 
218
239
  size_type find_last_not_of(charT c) const {
219
240
  for ( const_reverse_iterator iter = this->crbegin (); iter != this->crend (); ++iter )
220
241
  if ( !traits::eq ( c, *iter ))
221
- return reverse_distance ( this->crbegin (), iter );
242
+ return this->size() - 1 - std::distance(this->crbegin(), iter);
222
243
  return npos;
223
244
  }
224
245
 
225
246
  private:
226
- template <typename r_iter>
227
- size_type reverse_distance ( r_iter first, r_iter last ) const {
228
- return len_ - 1 - std::distance ( first, last );
229
- }
230
247
 
231
248
  template <typename Iterator>
232
249
  Iterator find_not_of ( Iterator first, Iterator last, basic_string_ref s ) const {
@@ -405,7 +422,7 @@ namespace boost {
405
422
  namespace detail {
406
423
 
407
424
  template<class charT, class traits>
408
- inline void insert_fill_chars(std::basic_ostream<charT, traits>& os, std::size_t n) {
425
+ inline void sr_insert_fill_chars(std::basic_ostream<charT, traits>& os, std::size_t n) {
409
426
  enum { chunk_size = 8 };
410
427
  charT fill_chars[chunk_size];
411
428
  std::fill_n(fill_chars, static_cast< std::size_t >(chunk_size), os.fill());
@@ -416,19 +433,19 @@ namespace boost {
416
433
  }
417
434
 
418
435
  template<class charT, class traits>
419
- void insert_aligned(std::basic_ostream<charT, traits>& os, const basic_string_ref<charT,traits>& str) {
436
+ void sr_insert_aligned(std::basic_ostream<charT, traits>& os, const basic_string_ref<charT,traits>& str) {
420
437
  const std::size_t size = str.size();
421
438
  const std::size_t alignment_size = static_cast< std::size_t >(os.width()) - size;
422
439
  const bool align_left = (os.flags() & std::basic_ostream<charT, traits>::adjustfield) == std::basic_ostream<charT, traits>::left;
423
440
  if (!align_left) {
424
- detail::insert_fill_chars(os, alignment_size);
441
+ detail::sr_insert_fill_chars(os, alignment_size);
425
442
  if (os.good())
426
443
  os.write(str.data(), size);
427
444
  }
428
445
  else {
429
446
  os.write(str.data(), size);
430
447
  if (os.good())
431
- detail::insert_fill_chars(os, alignment_size);
448
+ detail::sr_insert_fill_chars(os, alignment_size);
432
449
  }
433
450
  }
434
451
 
@@ -444,7 +461,7 @@ namespace boost {
444
461
  if (w <= size)
445
462
  os.write(str.data(), size);
446
463
  else
447
- detail::insert_aligned(os, str);
464
+ detail::sr_insert_aligned(os, str);
448
465
  os.width(0);
449
466
  }
450
467
  return os;
@@ -0,0 +1,690 @@
1
+ /*
2
+ Copyright (c) Marshall Clow 2012-2015.
3
+ Copyright (c) Beman Dawes 2015
4
+
5
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
6
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
7
+
8
+ For more information, see http://www.boost.org
9
+
10
+ Based on the StringRef implementation in LLVM (http://llvm.org) and
11
+ N3422 by Jeffrey Yasskin
12
+ http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3442.html
13
+ Updated July 2015 to reflect the Library Fundamentals TS
14
+ http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4480.html
15
+ */
16
+
17
+ #ifndef BOOST_STRING_VIEW_HPP
18
+ #define BOOST_STRING_VIEW_HPP
19
+
20
+ #include <boost/config.hpp>
21
+ #include <boost/detail/workaround.hpp>
22
+ #include <boost/utility/string_view_fwd.hpp>
23
+ #include <boost/throw_exception.hpp>
24
+
25
+ #include <cstddef>
26
+ #include <stdexcept>
27
+ #include <algorithm>
28
+ #include <iterator>
29
+ #include <string>
30
+ #include <cstring>
31
+ #include <iosfwd>
32
+
33
+ #if defined(BOOST_NO_CXX11_DEFAULTED_FUNCTIONS) || (defined(BOOST_GCC) && ((BOOST_GCC+0) / 100) <= 406)
34
+ // GCC 4.6 cannot handle a defaulted function with noexcept specifier
35
+ #define BOOST_STRING_VIEW_NO_CXX11_DEFAULTED_NOEXCEPT_FUNCTIONS
36
+ #endif
37
+
38
+ namespace boost {
39
+
40
+ namespace detail {
41
+ // A helper functor because sometimes we don't have lambdas
42
+ template <typename charT, typename traits>
43
+ class string_view_traits_eq {
44
+ public:
45
+ string_view_traits_eq ( charT ch ) : ch_(ch) {}
46
+ bool operator()( charT val ) const { return traits::eq (ch_, val); }
47
+ charT ch_;
48
+ };
49
+ }
50
+
51
+ template<typename charT, typename traits> // traits defaulted in string_view_fwd.hpp
52
+ class basic_string_view {
53
+ public:
54
+ // types
55
+ typedef traits traits_type;
56
+ typedef charT value_type;
57
+ typedef charT* pointer;
58
+ typedef const charT* const_pointer;
59
+ typedef charT& reference;
60
+ typedef const charT& const_reference;
61
+ typedef const_pointer const_iterator; // impl-defined
62
+ typedef const_iterator iterator;
63
+ typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
64
+ typedef const_reverse_iterator reverse_iterator;
65
+ typedef std::size_t size_type;
66
+ typedef std::ptrdiff_t difference_type;
67
+ static BOOST_CONSTEXPR_OR_CONST size_type npos = size_type(-1);
68
+
69
+ // construct/copy
70
+ BOOST_CONSTEXPR basic_string_view() BOOST_NOEXCEPT
71
+ : ptr_(NULL), len_(0) {}
72
+
73
+ // by defaulting these functions, basic_string_ref becomes
74
+ // trivially copy/move constructible.
75
+ BOOST_CONSTEXPR basic_string_view(const basic_string_view &rhs) BOOST_NOEXCEPT
76
+ #ifndef BOOST_STRING_VIEW_NO_CXX11_DEFAULTED_NOEXCEPT_FUNCTIONS
77
+ = default;
78
+ #else
79
+ : ptr_(rhs.ptr_), len_(rhs.len_) {}
80
+ #endif
81
+
82
+ basic_string_view& operator=(const basic_string_view &rhs) BOOST_NOEXCEPT
83
+ #ifndef BOOST_STRING_VIEW_NO_CXX11_DEFAULTED_NOEXCEPT_FUNCTIONS
84
+ = default;
85
+ #else
86
+ {
87
+ ptr_ = rhs.ptr_;
88
+ len_ = rhs.len_;
89
+ return *this;
90
+ }
91
+ #endif
92
+
93
+ template<typename Allocator>
94
+ basic_string_view(const std::basic_string<charT, traits, Allocator>& str) BOOST_NOEXCEPT
95
+ : ptr_(str.data()), len_(str.length()) {}
96
+
97
+ // #if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) && !defined(BOOST_NO_CXX11_DELETED_FUNCTIONS)
98
+ // // Constructing a string_view from a temporary string is a bad idea
99
+ // template<typename Allocator>
100
+ // basic_string_view( std::basic_string<charT, traits, Allocator>&&)
101
+ // = delete;
102
+ // #endif
103
+
104
+ BOOST_CONSTEXPR basic_string_view(const charT* str)
105
+ : ptr_(str), len_(traits::length(str)) {}
106
+
107
+ BOOST_CONSTEXPR basic_string_view(const charT* str, size_type len)
108
+ : ptr_(str), len_(len) {}
109
+
110
+ // iterators
111
+ BOOST_CONSTEXPR const_iterator begin() const BOOST_NOEXCEPT { return ptr_; }
112
+ BOOST_CONSTEXPR const_iterator cbegin() const BOOST_NOEXCEPT { return ptr_; }
113
+ BOOST_CONSTEXPR const_iterator end() const BOOST_NOEXCEPT { return ptr_ + len_; }
114
+ BOOST_CONSTEXPR const_iterator cend() const BOOST_NOEXCEPT { return ptr_ + len_; }
115
+ const_reverse_iterator rbegin() const BOOST_NOEXCEPT { return const_reverse_iterator(end()); }
116
+ const_reverse_iterator crbegin() const BOOST_NOEXCEPT { return const_reverse_iterator(end()); }
117
+ const_reverse_iterator rend() const BOOST_NOEXCEPT { return const_reverse_iterator(begin()); }
118
+ const_reverse_iterator crend() const BOOST_NOEXCEPT { return const_reverse_iterator(begin()); }
119
+
120
+ // capacity
121
+ BOOST_CONSTEXPR size_type size() const BOOST_NOEXCEPT { return len_; }
122
+ BOOST_CONSTEXPR size_type length() const BOOST_NOEXCEPT { return len_; }
123
+ BOOST_CONSTEXPR size_type max_size() const BOOST_NOEXCEPT { return len_; }
124
+ BOOST_CONSTEXPR bool empty() const BOOST_NOEXCEPT { return len_ == 0; }
125
+
126
+ // element access
127
+ BOOST_CONSTEXPR const_reference operator[](size_type pos) const BOOST_NOEXCEPT { return ptr_[pos]; }
128
+
129
+ BOOST_CONSTEXPR const_reference at(size_t pos) const {
130
+ return pos >= len_ ? BOOST_THROW_EXCEPTION(std::out_of_range("boost::string_view::at")), ptr_[0] : ptr_[pos];
131
+ }
132
+
133
+ BOOST_CONSTEXPR const_reference front() const { return ptr_[0]; }
134
+ BOOST_CONSTEXPR const_reference back() const { return ptr_[len_-1]; }
135
+ BOOST_CONSTEXPR const_pointer data() const BOOST_NOEXCEPT { return ptr_; }
136
+
137
+ // modifiers
138
+ void clear() BOOST_NOEXCEPT { len_ = 0; } // Boost extension
139
+
140
+ BOOST_CXX14_CONSTEXPR void remove_prefix(size_type n) {
141
+ if ( n > len_ )
142
+ n = len_;
143
+ ptr_ += n;
144
+ len_ -= n;
145
+ }
146
+
147
+ BOOST_CXX14_CONSTEXPR void remove_suffix(size_type n) {
148
+ if ( n > len_ )
149
+ n = len_;
150
+ len_ -= n;
151
+ }
152
+
153
+ BOOST_CXX14_CONSTEXPR void swap(basic_string_view& s) BOOST_NOEXCEPT {
154
+ std::swap(ptr_, s.ptr_);
155
+ std::swap(len_, s.len_);
156
+ }
157
+
158
+ // basic_string_view string operations
159
+ #ifndef BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS
160
+ template<typename Allocator>
161
+ explicit operator std::basic_string<charT, traits, Allocator>() const {
162
+ return std::basic_string<charT, traits, Allocator>(begin(), end());
163
+ }
164
+ #endif
165
+
166
+ #ifndef BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS
167
+ template<typename Allocator = std::allocator<charT> >
168
+ std::basic_string<charT, traits, Allocator> to_string(const Allocator& a = Allocator()) const {
169
+ return std::basic_string<charT, traits, Allocator>(begin(), end(), a);
170
+ }
171
+ #else
172
+ std::basic_string<charT, traits> to_string() const {
173
+ return std::basic_string<charT, traits>(begin(), end());
174
+ }
175
+
176
+ template<typename Allocator>
177
+ std::basic_string<charT, traits, Allocator> to_string(const Allocator& a) const {
178
+ return std::basic_string<charT, traits, Allocator>(begin(), end(), a);
179
+ }
180
+ #endif
181
+
182
+ size_type copy(charT* s, size_type n, size_type pos=0) const {
183
+ if (pos > size())
184
+ BOOST_THROW_EXCEPTION(std::out_of_range("string_view::copy" ));
185
+ size_type rlen = (std::min)(n, len_ - pos);
186
+ traits_type::copy(s, data() + pos, rlen);
187
+ return rlen;
188
+ }
189
+
190
+ BOOST_CXX14_CONSTEXPR basic_string_view substr(size_type pos, size_type n=npos) const {
191
+ if ( pos > size())
192
+ BOOST_THROW_EXCEPTION( std::out_of_range ( "string_view::substr" ) );
193
+ return basic_string_view(data() + pos, (std::min)(size() - pos, n));
194
+ }
195
+
196
+ BOOST_CXX14_CONSTEXPR int compare(basic_string_view x) const BOOST_NOEXCEPT {
197
+ const int cmp = traits::compare(ptr_, x.ptr_, (std::min)(len_, x.len_));
198
+ return cmp != 0 ? cmp : (len_ == x.len_ ? 0 : len_ < x.len_ ? -1 : 1);
199
+ }
200
+
201
+ BOOST_CXX14_CONSTEXPR int compare(size_type pos1, size_type n1, basic_string_view x)
202
+ const BOOST_NOEXCEPT {
203
+ return substr(pos1, n1).compare(x);
204
+ }
205
+
206
+ BOOST_CXX14_CONSTEXPR int compare(size_type pos1, size_type n1,
207
+ basic_string_view x, size_type pos2, size_type n2) const {
208
+ return substr(pos1, n1).compare(x.substr(pos2, n2));
209
+ }
210
+
211
+ BOOST_CXX14_CONSTEXPR int compare(const charT* x) const {
212
+ return compare(basic_string_view(x));
213
+ }
214
+
215
+ BOOST_CXX14_CONSTEXPR int compare(size_type pos1, size_type n1, const charT* x) const {
216
+ return substr(pos1, n1).compare(basic_string_view(x));
217
+ }
218
+
219
+ BOOST_CXX14_CONSTEXPR int compare(size_type pos1, size_type n1,
220
+ const charT* x, size_type n2) const {
221
+ return substr(pos1, n1).compare(basic_string_view(x, n2));
222
+ }
223
+
224
+ // Searches
225
+ BOOST_CONSTEXPR bool starts_with(charT c) const BOOST_NOEXCEPT { // Boost extension
226
+ return !empty() && traits::eq(c, front());
227
+ }
228
+
229
+ BOOST_CONSTEXPR bool starts_with(basic_string_view x) const BOOST_NOEXCEPT { // Boost extension
230
+ return len_ >= x.len_ && traits::compare(ptr_, x.ptr_, x.len_) == 0;
231
+ }
232
+
233
+ BOOST_CONSTEXPR bool ends_with(charT c) const BOOST_NOEXCEPT { // Boost extension
234
+ return !empty() && traits::eq(c, back());
235
+ }
236
+
237
+ BOOST_CONSTEXPR bool ends_with(basic_string_view x) const BOOST_NOEXCEPT { // Boost extension
238
+ return len_ >= x.len_ &&
239
+ traits::compare(ptr_ + len_ - x.len_, x.ptr_, x.len_) == 0;
240
+ }
241
+
242
+ // find
243
+ BOOST_CXX14_CONSTEXPR size_type find(basic_string_view s, size_type pos = 0) const BOOST_NOEXCEPT {
244
+ if (pos > size())
245
+ return npos;
246
+ if (s.empty())
247
+ return pos;
248
+ const_iterator iter = std::search(this->cbegin() + pos, this->cend(),
249
+ s.cbegin (), s.cend (), traits::eq);
250
+ return iter == this->cend () ? npos : std::distance(this->cbegin (), iter);
251
+ }
252
+ BOOST_CXX14_CONSTEXPR size_type find(charT c, size_type pos = 0) const BOOST_NOEXCEPT
253
+ { return find(basic_string_view(&c, 1), pos); }
254
+ BOOST_CXX14_CONSTEXPR size_type find(const charT* s, size_type pos, size_type n) const BOOST_NOEXCEPT
255
+ { return find(basic_string_view(s, n), pos); }
256
+ BOOST_CXX14_CONSTEXPR size_type find(const charT* s, size_type pos = 0) const BOOST_NOEXCEPT
257
+ { return find(basic_string_view(s), pos); }
258
+
259
+ // rfind
260
+ BOOST_CXX14_CONSTEXPR size_type rfind(basic_string_view s, size_type pos = npos) const BOOST_NOEXCEPT {
261
+ if (len_ < s.len_)
262
+ return npos;
263
+ if (pos > len_ - s.len_)
264
+ pos = len_ - s.len_;
265
+ if (s.len_ == 0u) // an empty string is always found
266
+ return pos;
267
+ for (const charT* cur = ptr_ + pos; ; --cur) {
268
+ if (traits::compare(cur, s.ptr_, s.len_) == 0)
269
+ return cur - ptr_;
270
+ if (cur == ptr_)
271
+ return npos;
272
+ };
273
+ }
274
+ BOOST_CXX14_CONSTEXPR size_type rfind(charT c, size_type pos = npos) const BOOST_NOEXCEPT
275
+ { return rfind(basic_string_view(&c, 1), pos); }
276
+ BOOST_CXX14_CONSTEXPR size_type rfind(const charT* s, size_type pos, size_type n) const BOOST_NOEXCEPT
277
+ { return rfind(basic_string_view(s, n), pos); }
278
+ BOOST_CXX14_CONSTEXPR size_type rfind(const charT* s, size_type pos = npos) const BOOST_NOEXCEPT
279
+ { return rfind(basic_string_view(s), pos); }
280
+
281
+ // find_first_of
282
+ BOOST_CXX14_CONSTEXPR size_type find_first_of(basic_string_view s, size_type pos = 0) const BOOST_NOEXCEPT {
283
+ if (pos >= len_ || s.len_ == 0)
284
+ return npos;
285
+ const_iterator iter = std::find_first_of
286
+ (this->cbegin () + pos, this->cend (), s.cbegin (), s.cend (), traits::eq);
287
+ return iter == this->cend () ? npos : std::distance ( this->cbegin (), iter );
288
+ }
289
+ BOOST_CXX14_CONSTEXPR size_type find_first_of(charT c, size_type pos = 0) const BOOST_NOEXCEPT
290
+ { return find_first_of(basic_string_view(&c, 1), pos); }
291
+ BOOST_CXX14_CONSTEXPR size_type find_first_of(const charT* s, size_type pos, size_type n) const BOOST_NOEXCEPT
292
+ { return find_first_of(basic_string_view(s, n), pos); }
293
+ BOOST_CXX14_CONSTEXPR size_type find_first_of(const charT* s, size_type pos = 0) const BOOST_NOEXCEPT
294
+ { return find_first_of(basic_string_view(s), pos); }
295
+
296
+ // find_last_of
297
+ BOOST_CXX14_CONSTEXPR size_type find_last_of(basic_string_view s, size_type pos = npos) const BOOST_NOEXCEPT {
298
+ if (s.len_ == 0u)
299
+ return npos;
300
+ if (pos >= len_)
301
+ pos = 0;
302
+ else
303
+ pos = len_ - (pos+1);
304
+ const_reverse_iterator iter = std::find_first_of
305
+ ( this->crbegin () + pos, this->crend (), s.cbegin (), s.cend (), traits::eq );
306
+ return iter == this->crend () ? npos : reverse_distance ( this->crbegin (), iter);
307
+ }
308
+ BOOST_CXX14_CONSTEXPR size_type find_last_of(charT c, size_type pos = npos) const BOOST_NOEXCEPT
309
+ { return find_last_of(basic_string_view(&c, 1), pos); }
310
+ BOOST_CXX14_CONSTEXPR size_type find_last_of(const charT* s, size_type pos, size_type n) const BOOST_NOEXCEPT
311
+ { return find_last_of(basic_string_view(s, n), pos); }
312
+ BOOST_CXX14_CONSTEXPR size_type find_last_of(const charT* s, size_type pos = npos) const BOOST_NOEXCEPT
313
+ { return find_last_of(basic_string_view(s), pos); }
314
+
315
+ // find_first_not_of
316
+ BOOST_CXX14_CONSTEXPR size_type find_first_not_of(basic_string_view s, size_type pos = 0) const BOOST_NOEXCEPT {
317
+ if (pos >= len_)
318
+ return npos;
319
+ if (s.len_ == 0)
320
+ return pos;
321
+ const_iterator iter = find_not_of ( this->cbegin () + pos, this->cend (), s );
322
+ return iter == this->cend () ? npos : std::distance ( this->cbegin (), iter );
323
+ }
324
+ BOOST_CXX14_CONSTEXPR size_type find_first_not_of(charT c, size_type pos = 0) const BOOST_NOEXCEPT
325
+ { return find_first_not_of(basic_string_view(&c, 1), pos); }
326
+ BOOST_CXX14_CONSTEXPR size_type find_first_not_of(const charT* s, size_type pos, size_type n) const BOOST_NOEXCEPT
327
+ { return find_first_not_of(basic_string_view(s, n), pos); }
328
+ BOOST_CXX14_CONSTEXPR size_type find_first_not_of(const charT* s, size_type pos = 0) const BOOST_NOEXCEPT
329
+ { return find_first_not_of(basic_string_view(s), pos); }
330
+
331
+ // find_last_not_of
332
+ BOOST_CXX14_CONSTEXPR size_type find_last_not_of(basic_string_view s, size_type pos = npos) const BOOST_NOEXCEPT {
333
+ if (pos >= len_)
334
+ pos = len_ - 1;
335
+ if (s.len_ == 0u)
336
+ return pos;
337
+ pos = len_ - (pos+1);
338
+ const_reverse_iterator iter = find_not_of ( this->crbegin () + pos, this->crend (), s );
339
+ return iter == this->crend () ? npos : reverse_distance ( this->crbegin (), iter );
340
+ }
341
+ BOOST_CXX14_CONSTEXPR size_type find_last_not_of(charT c, size_type pos = npos) const BOOST_NOEXCEPT
342
+ { return find_last_not_of(basic_string_view(&c, 1), pos); }
343
+ BOOST_CXX14_CONSTEXPR size_type find_last_not_of(const charT* s, size_type pos, size_type n) const BOOST_NOEXCEPT
344
+ { return find_last_not_of(basic_string_view(s, n), pos); }
345
+ BOOST_CXX14_CONSTEXPR size_type find_last_not_of(const charT* s, size_type pos = npos) const BOOST_NOEXCEPT
346
+ { return find_last_not_of(basic_string_view(s), pos); }
347
+
348
+ private:
349
+ template <typename r_iter>
350
+ size_type reverse_distance(r_iter first, r_iter last) const BOOST_NOEXCEPT {
351
+ // Portability note here: std::distance is not NOEXCEPT, but calling it with a string_view::reverse_iterator will not throw.
352
+ return len_ - 1 - std::distance ( first, last );
353
+ }
354
+
355
+ template <typename Iterator>
356
+ Iterator find_not_of(Iterator first, Iterator last, basic_string_view s) const BOOST_NOEXCEPT {
357
+ for (; first != last ; ++first)
358
+ if ( 0 == traits::find(s.ptr_, s.len_, *first))
359
+ return first;
360
+ return last;
361
+ }
362
+
363
+ const charT *ptr_;
364
+ std::size_t len_;
365
+ };
366
+
367
+
368
+ // Comparison operators
369
+ // Equality
370
+ template<typename charT, typename traits>
371
+ inline bool operator==(basic_string_view<charT, traits> x,
372
+ basic_string_view<charT, traits> y) BOOST_NOEXCEPT {
373
+ if (x.size () != y.size ()) return false;
374
+ return x.compare(y) == 0;
375
+ }
376
+
377
+ // Inequality
378
+ template<typename charT, typename traits>
379
+ inline bool operator!=(basic_string_view<charT, traits> x,
380
+ basic_string_view<charT, traits> y) BOOST_NOEXCEPT {
381
+ if ( x.size () != y.size ()) return true;
382
+ return x.compare(y) != 0;
383
+ }
384
+
385
+ // Less than
386
+ template<typename charT, typename traits>
387
+ inline bool operator<(basic_string_view<charT, traits> x,
388
+ basic_string_view<charT, traits> y) BOOST_NOEXCEPT {
389
+ return x.compare(y) < 0;
390
+ }
391
+
392
+ // Greater than
393
+ template<typename charT, typename traits>
394
+ inline bool operator>(basic_string_view<charT, traits> x,
395
+ basic_string_view<charT, traits> y) BOOST_NOEXCEPT {
396
+ return x.compare(y) > 0;
397
+ }
398
+
399
+ // Less than or equal to
400
+ template<typename charT, typename traits>
401
+ inline bool operator<=(basic_string_view<charT, traits> x,
402
+ basic_string_view<charT, traits> y) BOOST_NOEXCEPT {
403
+ return x.compare(y) <= 0;
404
+ }
405
+
406
+ // Greater than or equal to
407
+ template<typename charT, typename traits>
408
+ inline bool operator>=(basic_string_view<charT, traits> x,
409
+ basic_string_view<charT, traits> y) BOOST_NOEXCEPT {
410
+ return x.compare(y) >= 0;
411
+ }
412
+
413
+ // "sufficient additional overloads of comparison functions"
414
+ template<typename charT, typename traits, typename Allocator>
415
+ inline bool operator==(basic_string_view<charT, traits> x,
416
+ const std::basic_string<charT, traits, Allocator> & y) BOOST_NOEXCEPT {
417
+ return x == basic_string_view<charT, traits>(y);
418
+ }
419
+
420
+ template<typename charT, typename traits, typename Allocator>
421
+ inline bool operator==(const std::basic_string<charT, traits, Allocator> & x,
422
+ basic_string_view<charT, traits> y) BOOST_NOEXCEPT {
423
+ return basic_string_view<charT, traits>(x) == y;
424
+ }
425
+
426
+ template<typename charT, typename traits>
427
+ inline bool operator==(basic_string_view<charT, traits> x,
428
+ const charT * y) BOOST_NOEXCEPT {
429
+ return x == basic_string_view<charT, traits>(y);
430
+ }
431
+
432
+ template<typename charT, typename traits>
433
+ inline bool operator==(const charT * x,
434
+ basic_string_view<charT, traits> y) BOOST_NOEXCEPT {
435
+ return basic_string_view<charT, traits>(x) == y;
436
+ }
437
+
438
+ template<typename charT, typename traits, typename Allocator>
439
+ inline bool operator!=(basic_string_view<charT, traits> x,
440
+ const std::basic_string<charT, traits, Allocator> & y) BOOST_NOEXCEPT {
441
+ return x != basic_string_view<charT, traits>(y);
442
+ }
443
+
444
+ template<typename charT, typename traits, typename Allocator>
445
+ inline bool operator!=(const std::basic_string<charT, traits, Allocator> & x,
446
+ basic_string_view<charT, traits> y) BOOST_NOEXCEPT {
447
+ return basic_string_view<charT, traits>(x) != y;
448
+ }
449
+
450
+ template<typename charT, typename traits>
451
+ inline bool operator!=(basic_string_view<charT, traits> x,
452
+ const charT * y) BOOST_NOEXCEPT {
453
+ return x != basic_string_view<charT, traits>(y);
454
+ }
455
+
456
+ template<typename charT, typename traits>
457
+ inline bool operator!=(const charT * x,
458
+ basic_string_view<charT, traits> y) BOOST_NOEXCEPT {
459
+ return basic_string_view<charT, traits>(x) != y;
460
+ }
461
+
462
+ template<typename charT, typename traits, typename Allocator>
463
+ inline bool operator<(basic_string_view<charT, traits> x,
464
+ const std::basic_string<charT, traits, Allocator> & y) BOOST_NOEXCEPT {
465
+ return x < basic_string_view<charT, traits>(y);
466
+ }
467
+
468
+ template<typename charT, typename traits, typename Allocator>
469
+ inline bool operator<(const std::basic_string<charT, traits, Allocator> & x,
470
+ basic_string_view<charT, traits> y) BOOST_NOEXCEPT {
471
+ return basic_string_view<charT, traits>(x) < y;
472
+ }
473
+
474
+ template<typename charT, typename traits>
475
+ inline bool operator<(basic_string_view<charT, traits> x,
476
+ const charT * y) BOOST_NOEXCEPT {
477
+ return x < basic_string_view<charT, traits>(y);
478
+ }
479
+
480
+ template<typename charT, typename traits>
481
+ inline bool operator<(const charT * x,
482
+ basic_string_view<charT, traits> y) BOOST_NOEXCEPT {
483
+ return basic_string_view<charT, traits>(x) < y;
484
+ }
485
+
486
+ template<typename charT, typename traits, typename Allocator>
487
+ inline bool operator>(basic_string_view<charT, traits> x,
488
+ const std::basic_string<charT, traits, Allocator> & y) BOOST_NOEXCEPT {
489
+ return x > basic_string_view<charT, traits>(y);
490
+ }
491
+
492
+ template<typename charT, typename traits, typename Allocator>
493
+ inline bool operator>(const std::basic_string<charT, traits, Allocator> & x,
494
+ basic_string_view<charT, traits> y) BOOST_NOEXCEPT {
495
+ return basic_string_view<charT, traits>(x) > y;
496
+ }
497
+
498
+ template<typename charT, typename traits>
499
+ inline bool operator>(basic_string_view<charT, traits> x,
500
+ const charT * y) BOOST_NOEXCEPT {
501
+ return x > basic_string_view<charT, traits>(y);
502
+ }
503
+
504
+ template<typename charT, typename traits>
505
+ inline bool operator>(const charT * x,
506
+ basic_string_view<charT, traits> y) BOOST_NOEXCEPT {
507
+ return basic_string_view<charT, traits>(x) > y;
508
+ }
509
+
510
+ template<typename charT, typename traits, typename Allocator>
511
+ inline bool operator<=(basic_string_view<charT, traits> x,
512
+ const std::basic_string<charT, traits, Allocator> & y) BOOST_NOEXCEPT {
513
+ return x <= basic_string_view<charT, traits>(y);
514
+ }
515
+
516
+ template<typename charT, typename traits, typename Allocator>
517
+ inline bool operator<=(const std::basic_string<charT, traits, Allocator> & x,
518
+ basic_string_view<charT, traits> y) BOOST_NOEXCEPT {
519
+ return basic_string_view<charT, traits>(x) <= y;
520
+ }
521
+
522
+ template<typename charT, typename traits>
523
+ inline bool operator<=(basic_string_view<charT, traits> x,
524
+ const charT * y) BOOST_NOEXCEPT {
525
+ return x <= basic_string_view<charT, traits>(y);
526
+ }
527
+
528
+ template<typename charT, typename traits>
529
+ inline bool operator<=(const charT * x,
530
+ basic_string_view<charT, traits> y) BOOST_NOEXCEPT {
531
+ return basic_string_view<charT, traits>(x) <= y;
532
+ }
533
+
534
+ template<typename charT, typename traits, typename Allocator>
535
+ inline bool operator>=(basic_string_view<charT, traits> x,
536
+ const std::basic_string<charT, traits, Allocator> & y) BOOST_NOEXCEPT {
537
+ return x >= basic_string_view<charT, traits>(y);
538
+ }
539
+
540
+ template<typename charT, typename traits, typename Allocator>
541
+ inline bool operator>=(const std::basic_string<charT, traits, Allocator> & x,
542
+ basic_string_view<charT, traits> y) BOOST_NOEXCEPT {
543
+ return basic_string_view<charT, traits>(x) >= y;
544
+ }
545
+
546
+ template<typename charT, typename traits>
547
+ inline bool operator>=(basic_string_view<charT, traits> x,
548
+ const charT * y) BOOST_NOEXCEPT {
549
+ return x >= basic_string_view<charT, traits>(y);
550
+ }
551
+
552
+ template<typename charT, typename traits>
553
+ inline bool operator>=(const charT * x,
554
+ basic_string_view<charT, traits> y) BOOST_NOEXCEPT {
555
+ return basic_string_view<charT, traits>(x) >= y;
556
+ }
557
+
558
+ namespace detail {
559
+
560
+ template<class charT, class traits>
561
+ inline void sv_insert_fill_chars(std::basic_ostream<charT, traits>& os, std::size_t n) {
562
+ enum { chunk_size = 8 };
563
+ charT fill_chars[chunk_size];
564
+ std::fill_n(fill_chars, static_cast< std::size_t >(chunk_size), os.fill());
565
+ for (; n >= chunk_size && os.good(); n -= chunk_size)
566
+ os.write(fill_chars, static_cast< std::size_t >(chunk_size));
567
+ if (n > 0 && os.good())
568
+ os.write(fill_chars, n);
569
+ }
570
+
571
+ template<class charT, class traits>
572
+ void sv_insert_aligned(std::basic_ostream<charT, traits>& os, const basic_string_view<charT,traits>& str) {
573
+ const std::size_t size = str.size();
574
+ const std::size_t alignment_size = static_cast< std::size_t >(os.width()) - size;
575
+ const bool align_left = (os.flags() & std::basic_ostream<charT, traits>::adjustfield) == std::basic_ostream<charT, traits>::left;
576
+ if (!align_left) {
577
+ detail::sv_insert_fill_chars(os, alignment_size);
578
+ if (os.good())
579
+ os.write(str.data(), size);
580
+ }
581
+ else {
582
+ os.write(str.data(), size);
583
+ if (os.good())
584
+ detail::sv_insert_fill_chars(os, alignment_size);
585
+ }
586
+ }
587
+
588
+ } // namespace detail
589
+
590
+ // Inserter
591
+ template<class charT, class traits>
592
+ inline std::basic_ostream<charT, traits>&
593
+ operator<<(std::basic_ostream<charT, traits>& os,
594
+ const basic_string_view<charT,traits>& str) {
595
+ if (os.good()) {
596
+ const std::size_t size = str.size();
597
+ const std::size_t w = static_cast< std::size_t >(os.width());
598
+ if (w <= size)
599
+ os.write(str.data(), size);
600
+ else
601
+ detail::sv_insert_aligned(os, str);
602
+ os.width(0);
603
+ }
604
+ return os;
605
+ }
606
+
607
+ #if 0
608
+ // numeric conversions
609
+ //
610
+ // These are short-term implementations.
611
+ // In a production environment, I would rather avoid the copying.
612
+ //
613
+ inline int stoi (string_view str, size_t* idx=0, int base=10) {
614
+ return std::stoi ( std::string(str), idx, base );
615
+ }
616
+
617
+ inline long stol (string_view str, size_t* idx=0, int base=10) {
618
+ return std::stol ( std::string(str), idx, base );
619
+ }
620
+
621
+ inline unsigned long stoul (string_view str, size_t* idx=0, int base=10) {
622
+ return std::stoul ( std::string(str), idx, base );
623
+ }
624
+
625
+ inline long long stoll (string_view str, size_t* idx=0, int base=10) {
626
+ return std::stoll ( std::string(str), idx, base );
627
+ }
628
+
629
+ inline unsigned long long stoull (string_view str, size_t* idx=0, int base=10) {
630
+ return std::stoull ( std::string(str), idx, base );
631
+ }
632
+
633
+ inline float stof (string_view str, size_t* idx=0) {
634
+ return std::stof ( std::string(str), idx );
635
+ }
636
+
637
+ inline double stod (string_view str, size_t* idx=0) {
638
+ return std::stod ( std::string(str), idx );
639
+ }
640
+
641
+ inline long double stold (string_view str, size_t* idx=0) {
642
+ return std::stold ( std::string(str), idx );
643
+ }
644
+
645
+ inline int stoi (wstring_view str, size_t* idx=0, int base=10) {
646
+ return std::stoi ( std::wstring(str), idx, base );
647
+ }
648
+
649
+ inline long stol (wstring_view str, size_t* idx=0, int base=10) {
650
+ return std::stol ( std::wstring(str), idx, base );
651
+ }
652
+
653
+ inline unsigned long stoul (wstring_view str, size_t* idx=0, int base=10) {
654
+ return std::stoul ( std::wstring(str), idx, base );
655
+ }
656
+
657
+ inline long long stoll (wstring_view str, size_t* idx=0, int base=10) {
658
+ return std::stoll ( std::wstring(str), idx, base );
659
+ }
660
+
661
+ inline unsigned long long stoull (wstring_view str, size_t* idx=0, int base=10) {
662
+ return std::stoull ( std::wstring(str), idx, base );
663
+ }
664
+
665
+ inline float stof (wstring_view str, size_t* idx=0) {
666
+ return std::stof ( std::wstring(str), idx );
667
+ }
668
+
669
+ inline double stod (wstring_view str, size_t* idx=0) {
670
+ return std::stod ( std::wstring(str), idx );
671
+ }
672
+
673
+ inline long double stold (wstring_view str, size_t* idx=0) {
674
+ return std::stold ( std::wstring(str), idx );
675
+ }
676
+ #endif
677
+
678
+ }
679
+
680
+ #if 0
681
+ namespace std {
682
+ // Hashing
683
+ template<> struct hash<boost::string_view>;
684
+ template<> struct hash<boost::u16string_view>;
685
+ template<> struct hash<boost::u32string_view>;
686
+ template<> struct hash<boost::wstring_view>;
687
+ }
688
+ #endif
689
+
690
+ #endif