passenger 6.2.0 → 6.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (898) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG +69 -15
  3. data/CONTRIBUTING.md +7 -311
  4. data/CONTRIBUTORS +1 -0
  5. data/LICENSE +1 -1
  6. data/README.md +1 -1
  7. data/Rakefile +1 -1
  8. data/bin/passenger +1 -1
  9. data/bin/passenger-config +1 -1
  10. data/bin/passenger-install-apache2-module +1 -1
  11. data/bin/passenger-install-nginx-module +4 -9
  12. data/bin/passenger-memory-stats +1 -1
  13. data/bin/passenger-status +1 -1
  14. data/build/agent.rb +13 -15
  15. data/build/apache2.rb +13 -16
  16. data/build/basics.rb +10 -13
  17. data/build/common_library.rb +5 -9
  18. data/build/cxx_tests.rb +39 -12
  19. data/build/integration_tests.rb +5 -2
  20. data/build/misc.rb +1 -1
  21. data/build/nginx.rb +1 -1
  22. data/build/node_tests.rb +1 -1
  23. data/build/oxt_tests.rb +6 -8
  24. data/build/packaging.rb +1 -1
  25. data/build/ruby_extension.rb +1 -1
  26. data/build/ruby_tests.rb +1 -1
  27. data/build/schema_printer.rb +13 -15
  28. data/build/support/cplusplus.rb +61 -69
  29. data/build/support/cxx_dependency_map.rb +5 -64
  30. data/build/support/general.rb +1 -1
  31. data/build/support/vendor/cxx_hinted_parser/LICENSE.md +1 -1
  32. data/build/support/vendor/cxx_hinted_parser/lib/cxx_hinted_parser/parser.rb +1 -1
  33. data/build/support/vendor/cxx_hinted_parser/lib/cxx_hinted_parser.rb +1 -1
  34. data/build/support/vendor/cxxcodebuilder/LICENSE.md +1 -1
  35. data/build/support/vendor/cxxcodebuilder/lib/cxxcodebuilder/builder.rb +1 -1
  36. data/build/support/vendor/cxxcodebuilder/lib/cxxcodebuilder/initializer_builder.rb +1 -1
  37. data/build/support/vendor/cxxcodebuilder/lib/cxxcodebuilder.rb +1 -1
  38. data/build/test_basics.rb +1 -1
  39. data/dev/copy_boost_headers +1 -1
  40. data/dev/index_cxx_dependencies.rb +5 -1
  41. data/dev/libev-changes.patch +108 -0
  42. data/dev/nginx_version_sha256 +1 -1
  43. data/dev/ruby_server.rb +1 -6
  44. data/dev/upgrading_libuv.sh +16 -0
  45. data/doc/BasicArchitectureOverview.md +55 -0
  46. data/doc/BuildCaching.md +23 -0
  47. data/doc/BuildSystem.md +49 -0
  48. data/doc/DebuggingAndStressTesting.md +2 -0
  49. data/doc/DesignAspects/LimitedGemDependencies.md +1 -0
  50. data/doc/DevEnvironmentSetup.md +46 -0
  51. data/doc/DevHandbook.md +28 -0
  52. data/doc/Packaging.md +1 -1
  53. data/doc/RunningTests.md +88 -0
  54. data/doc/{TempFileHandling.md → SecureTempFileHandling.md} +1 -1
  55. data/doc/{CxxTestingGuide.md → WritingCxxTests.md} +1 -20
  56. data/src/agent/AgentMain.cpp +1 -1
  57. data/src/agent/Core/ApiServer.h +1 -1
  58. data/src/agent/Core/ApplicationPool/AbstractSession.h +1 -1
  59. data/src/agent/Core/ApplicationPool/BasicGroupInfo.h +1 -1
  60. data/src/agent/Core/ApplicationPool/BasicProcessInfo.h +1 -1
  61. data/src/agent/Core/ApplicationPool/Common.h +1 -1
  62. data/src/agent/Core/ApplicationPool/Context.h +1 -1
  63. data/src/agent/Core/ApplicationPool/Group/InitializationAndShutdown.cpp +1 -1
  64. data/src/agent/Core/ApplicationPool/Group/InternalUtils.cpp +1 -1
  65. data/src/agent/Core/ApplicationPool/Group/LifetimeAndBasics.cpp +1 -1
  66. data/src/agent/Core/ApplicationPool/Group/Miscellaneous.cpp +1 -1
  67. data/src/agent/Core/ApplicationPool/Group/OutOfBandWork.cpp +1 -1
  68. data/src/agent/Core/ApplicationPool/Group/ProcessListManagement.cpp +1 -1
  69. data/src/agent/Core/ApplicationPool/Group/SessionManagement.cpp +1 -1
  70. data/src/agent/Core/ApplicationPool/Group/SpawningAndRestarting.cpp +1 -1
  71. data/src/agent/Core/ApplicationPool/Group/StateInspection.cpp +1 -1
  72. data/src/agent/Core/ApplicationPool/Group/Verification.cpp +1 -1
  73. data/src/agent/Core/ApplicationPool/Group.h +1 -1
  74. data/src/agent/Core/ApplicationPool/Implementation.cpp +1 -1
  75. data/src/agent/Core/ApplicationPool/Options.h +1 -1
  76. data/src/agent/Core/ApplicationPool/Pool/AnalyticsCollection.cpp +1 -1
  77. data/src/agent/Core/ApplicationPool/Pool/GarbageCollection.cpp +1 -1
  78. data/src/agent/Core/ApplicationPool/Pool/GeneralUtils.cpp +1 -1
  79. data/src/agent/Core/ApplicationPool/Pool/GroupUtils.cpp +1 -1
  80. data/src/agent/Core/ApplicationPool/Pool/InitializationAndShutdown.cpp +1 -1
  81. data/src/agent/Core/ApplicationPool/Pool/Miscellaneous.cpp +1 -1
  82. data/src/agent/Core/ApplicationPool/Pool/ProcessUtils.cpp +1 -1
  83. data/src/agent/Core/ApplicationPool/Pool/StateInspection.cpp +1 -1
  84. data/src/agent/Core/ApplicationPool/Pool.h +1 -1
  85. data/src/agent/Core/ApplicationPool/Process.cpp +1 -1
  86. data/src/agent/Core/ApplicationPool/Process.h +1 -1
  87. data/src/agent/Core/ApplicationPool/Session.h +1 -1
  88. data/src/agent/Core/ApplicationPool/Socket.h +1 -1
  89. data/src/agent/Core/ApplicationPool/TestSession.h +1 -1
  90. data/src/agent/Core/Config.h +3 -2
  91. data/src/agent/Core/ConfigChange.cpp +1 -1
  92. data/src/agent/Core/ConfigChange.h +1 -1
  93. data/src/agent/Core/Controller/AppResponse.h +1 -1
  94. data/src/agent/Core/Controller/BufferBody.cpp +1 -1
  95. data/src/agent/Core/Controller/CheckoutSession.cpp +8 -5
  96. data/src/agent/Core/Controller/Client.h +1 -1
  97. data/src/agent/Core/Controller/Config.cpp +1 -1
  98. data/src/agent/Core/Controller/Config.h +2 -2
  99. data/src/agent/Core/Controller/ForwardResponse.cpp +2 -2
  100. data/src/agent/Core/Controller/Hooks.cpp +12 -9
  101. data/src/agent/Core/Controller/Implementation.cpp +1 -1
  102. data/src/agent/Core/Controller/InitRequest.cpp +1 -1
  103. data/src/agent/Core/Controller/InitializationAndShutdown.cpp +1 -1
  104. data/src/agent/Core/Controller/InternalUtils.cpp +1 -1
  105. data/src/agent/Core/Controller/Miscellaneous.cpp +1 -1
  106. data/src/agent/Core/Controller/Request.h +1 -1
  107. data/src/agent/Core/Controller/SendRequest.cpp +1 -1
  108. data/src/agent/Core/Controller/StateInspection.cpp +1 -1
  109. data/src/agent/Core/Controller/TurboCaching.h +1 -1
  110. data/src/agent/Core/Controller.h +1 -1
  111. data/src/agent/Core/CoreMain.cpp +1 -1
  112. data/src/agent/Core/OptionParser.h +1 -1
  113. data/src/agent/Core/ResponseCache.h +1 -1
  114. data/src/agent/Core/SecurityUpdateChecker.h +1 -1
  115. data/src/agent/Core/SpawningKit/Config/AutoGeneratedCode.h +1 -1
  116. data/src/agent/Core/SpawningKit/Config/AutoGeneratedCode.h.cxxcodebuilder +1 -1
  117. data/src/agent/Core/SpawningKit/Config.h +1 -1
  118. data/src/agent/Core/SpawningKit/Context.h +1 -1
  119. data/src/agent/Core/SpawningKit/DirectSpawner.h +1 -1
  120. data/src/agent/Core/SpawningKit/DummySpawner.h +1 -1
  121. data/src/agent/Core/SpawningKit/ErrorRenderer.h +1 -1
  122. data/src/agent/Core/SpawningKit/Exceptions.h +63 -2
  123. data/src/agent/Core/SpawningKit/Factory.h +1 -1
  124. data/src/agent/Core/SpawningKit/Handshake/BackgroundIOCapturer.h +1 -1
  125. data/src/agent/Core/SpawningKit/Handshake/Perform.h +3 -2
  126. data/src/agent/Core/SpawningKit/Handshake/Prepare.h +1 -1
  127. data/src/agent/Core/SpawningKit/Handshake/Session.h +1 -1
  128. data/src/agent/Core/SpawningKit/Handshake/WorkDir.h +1 -1
  129. data/src/agent/Core/SpawningKit/Journey.h +1 -1
  130. data/src/agent/Core/SpawningKit/PipeWatcher.h +1 -1
  131. data/src/agent/Core/SpawningKit/README.md +3 -3
  132. data/src/agent/Core/SpawningKit/Result/AutoGeneratedCode.h +1 -1
  133. data/src/agent/Core/SpawningKit/Result/AutoGeneratedCode.h.cxxcodebuilder +1 -1
  134. data/src/agent/Core/SpawningKit/Result.h +1 -1
  135. data/src/agent/Core/SpawningKit/SmartSpawner.h +17 -17
  136. data/src/agent/Core/SpawningKit/Spawner.h +1 -1
  137. data/src/agent/Core/SpawningKit/UserSwitchingRules.h +1 -1
  138. data/src/agent/Core/TelemetryCollector.h +1 -1
  139. data/src/agent/ExecHelper/ExecHelperMain.cpp +1 -1
  140. data/src/agent/FileReadHelper/FileReadHelperMain.cpp +1 -1
  141. data/src/agent/MainFunctions.h +1 -1
  142. data/src/agent/Shared/ApiAccountUtils.h +4 -3
  143. data/src/agent/Shared/ApiServerUtils.h +2 -3
  144. data/src/agent/Shared/ApplicationPoolApiKey.h +1 -1
  145. data/src/agent/Shared/Fundamentals/AbortHandler.cpp +1 -1
  146. data/src/agent/Shared/Fundamentals/AbortHandler.h +1 -1
  147. data/src/agent/Shared/Fundamentals/Initialization.cpp +1 -1
  148. data/src/agent/Shared/Fundamentals/Initialization.h +1 -1
  149. data/src/agent/Shared/Fundamentals/Utils.cpp +1 -1
  150. data/src/agent/Shared/Fundamentals/Utils.h +1 -1
  151. data/src/agent/SpawnEnvSetupper/SpawnEnvSetupperMain.cpp +1 -1
  152. data/src/agent/SystemMetrics/SystemMetricsMain.cpp +1 -1
  153. data/src/agent/TempDirToucher/TempDirToucherMain.cpp +1 -1
  154. data/src/agent/Watchdog/ApiServer.h +7 -6
  155. data/src/agent/Watchdog/Config.h +2 -2
  156. data/src/apache2_module/Bucket.cpp +1 -1
  157. data/src/apache2_module/Bucket.h +1 -1
  158. data/src/apache2_module/CBindings.cpp +1 -1
  159. data/src/apache2_module/Config.cpp +1 -1
  160. data/src/apache2_module/Config.h +1 -1
  161. data/src/apache2_module/ConfigGeneral/AutoGeneratedDefinitions.cpp +104 -104
  162. data/src/apache2_module/ConfigGeneral/AutoGeneratedDefinitions.cpp.cxxcodebuilder +2 -2
  163. data/src/apache2_module/ConfigGeneral/AutoGeneratedManifestDefaultsInitialization.cpp +1 -1
  164. data/src/apache2_module/ConfigGeneral/AutoGeneratedManifestDefaultsInitialization.cpp.cxxcodebuilder +1 -1
  165. data/src/apache2_module/ConfigGeneral/AutoGeneratedSetterFuncs.cpp +1 -1
  166. data/src/apache2_module/ConfigGeneral/AutoGeneratedSetterFuncs.cpp.cxxcodebuilder +1 -1
  167. data/src/apache2_module/ConfigGeneral/Common.h +1 -1
  168. data/src/apache2_module/ConfigGeneral/ManifestGeneration.h +1 -1
  169. data/src/apache2_module/ConfigGeneral/SetterFuncs.h +1 -1
  170. data/src/apache2_module/DirConfig/AutoGeneratedCreateFunction.cpp +1 -1
  171. data/src/apache2_module/DirConfig/AutoGeneratedCreateFunction.cpp.cxxcodebuilder +1 -1
  172. data/src/apache2_module/DirConfig/AutoGeneratedHeaderSerialization.cpp +1 -1
  173. data/src/apache2_module/DirConfig/AutoGeneratedHeaderSerialization.cpp.cxxcodebuilder +1 -1
  174. data/src/apache2_module/DirConfig/AutoGeneratedManifestGeneration.cpp +1 -1
  175. data/src/apache2_module/DirConfig/AutoGeneratedManifestGeneration.cpp.cxxcodebuilder +1 -1
  176. data/src/apache2_module/DirConfig/AutoGeneratedMergeFunction.cpp +1 -1
  177. data/src/apache2_module/DirConfig/AutoGeneratedMergeFunction.cpp.cxxcodebuilder +1 -1
  178. data/src/apache2_module/DirConfig/AutoGeneratedStruct.h +1 -1
  179. data/src/apache2_module/DirConfig/AutoGeneratedStruct.h.cxxcodebuilder +1 -1
  180. data/src/apache2_module/DirectoryMapper.h +1 -1
  181. data/src/apache2_module/Hooks.cpp +21 -2
  182. data/src/apache2_module/Hooks.h +1 -1
  183. data/src/apache2_module/ServerConfig/AutoGeneratedManifestGeneration.cpp +1 -1
  184. data/src/apache2_module/ServerConfig/AutoGeneratedManifestGeneration.cpp.cxxcodebuilder +1 -1
  185. data/src/apache2_module/ServerConfig/AutoGeneratedStruct.h +1 -1
  186. data/src/apache2_module/ServerConfig/AutoGeneratedStruct.h.cxxcodebuilder +1 -1
  187. data/src/apache2_module/Utils.h +15 -1
  188. data/src/apache2_module/mod_passenger.c +1 -1
  189. data/src/cxx_supportlib/Algorithms/Hasher.cpp +1 -1
  190. data/src/cxx_supportlib/Algorithms/Hasher.h +1 -1
  191. data/src/cxx_supportlib/Algorithms/MovingAverage.h +1 -1
  192. data/src/cxx_supportlib/AppLocalConfigFileUtils.h +1 -1
  193. data/src/cxx_supportlib/AppTypeDetector/CBindings.cpp +1 -1
  194. data/src/cxx_supportlib/AppTypeDetector/CBindings.h +1 -1
  195. data/src/cxx_supportlib/AppTypeDetector/Detector.h +1 -1
  196. data/src/cxx_supportlib/BackgroundEventLoop.cpp +1 -1
  197. data/src/cxx_supportlib/BackgroundEventLoop.h +1 -1
  198. data/src/cxx_supportlib/ConfigKit/AsyncUtils.h +1 -1
  199. data/src/cxx_supportlib/ConfigKit/Common.h +1 -1
  200. data/src/cxx_supportlib/ConfigKit/ConfigKit.h +1 -1
  201. data/src/cxx_supportlib/ConfigKit/DummyTranslator.h +1 -1
  202. data/src/cxx_supportlib/ConfigKit/IN_PRACTICE.md +1 -3
  203. data/src/cxx_supportlib/ConfigKit/PrefixTranslator.h +3 -3
  204. data/src/cxx_supportlib/ConfigKit/Schema.h +1 -1
  205. data/src/cxx_supportlib/ConfigKit/SchemaUtils.h +1 -1
  206. data/src/cxx_supportlib/ConfigKit/Store.h +1 -1
  207. data/src/cxx_supportlib/ConfigKit/SubComponentUtils.h +1 -1
  208. data/src/cxx_supportlib/ConfigKit/TableTranslator.h +1 -1
  209. data/src/cxx_supportlib/ConfigKit/Translator.h +1 -1
  210. data/src/cxx_supportlib/ConfigKit/Utils.h +1 -1
  211. data/src/cxx_supportlib/Constants.h +2 -2
  212. data/src/cxx_supportlib/Constants.h.cxxcodebuilder +1 -1
  213. data/src/cxx_supportlib/DataStructures/HashedStaticString.h +1 -1
  214. data/src/cxx_supportlib/DataStructures/LString.cpp +1 -1
  215. data/src/cxx_supportlib/DataStructures/LString.h +1 -1
  216. data/src/cxx_supportlib/DataStructures/StringKeyTable.h +1 -1
  217. data/src/cxx_supportlib/DataStructures/StringMap.h +1 -1
  218. data/src/cxx_supportlib/Exceptions.cpp +1 -1
  219. data/src/cxx_supportlib/Exceptions.h +1 -1
  220. data/src/cxx_supportlib/FileDescriptor.h +1 -1
  221. data/src/cxx_supportlib/FileTools/FileManip.cpp +28 -4
  222. data/src/cxx_supportlib/FileTools/FileManip.h +1 -1
  223. data/src/cxx_supportlib/FileTools/PathManip.cpp +1 -1
  224. data/src/cxx_supportlib/FileTools/PathManip.h +1 -1
  225. data/src/cxx_supportlib/FileTools/PathManipCBindings.cpp +1 -1
  226. data/src/cxx_supportlib/FileTools/PathManipCBindings.h +1 -1
  227. data/src/cxx_supportlib/FileTools/PathSecurityCheck.cpp +1 -1
  228. data/src/cxx_supportlib/FileTools/PathSecurityCheck.h +1 -1
  229. data/src/cxx_supportlib/Hooks.h +1 -1
  230. data/src/cxx_supportlib/IOTools/BufferedIO.h +1 -1
  231. data/src/cxx_supportlib/IOTools/IOUtils.cpp +10 -10
  232. data/src/cxx_supportlib/IOTools/IOUtils.h +1 -1
  233. data/src/cxx_supportlib/IOTools/MessageIO.h +1 -1
  234. data/src/cxx_supportlib/IOTools/MessageSerialization.h +1 -1
  235. data/src/cxx_supportlib/InstanceDirectory.h +31 -4
  236. data/src/cxx_supportlib/Integrations/LibevJsonUtils.h +1 -1
  237. data/src/cxx_supportlib/JsonTools/Autocast.h +1 -1
  238. data/src/cxx_supportlib/JsonTools/CBindings.cpp +1 -1
  239. data/src/cxx_supportlib/JsonTools/CBindings.h +1 -1
  240. data/src/cxx_supportlib/JsonTools/JsonUtils.h +1 -1
  241. data/src/cxx_supportlib/LoggingKit/Assert.h +1 -1
  242. data/src/cxx_supportlib/LoggingKit/Config.h +2 -1
  243. data/src/cxx_supportlib/LoggingKit/Context.h +1 -1
  244. data/src/cxx_supportlib/LoggingKit/Forward.h +1 -1
  245. data/src/cxx_supportlib/LoggingKit/Implementation.cpp +11 -1
  246. data/src/cxx_supportlib/LoggingKit/Logging.h +1 -1
  247. data/src/cxx_supportlib/LoggingKit/LoggingKit.h +1 -1
  248. data/src/cxx_supportlib/LveLoggingDecorator.h +1 -1
  249. data/src/cxx_supportlib/MemoryKit/mbuf.cpp +1 -1
  250. data/src/cxx_supportlib/MemoryKit/mbuf.h +1 -1
  251. data/src/cxx_supportlib/MemoryKit/palloc.cpp +1 -1
  252. data/src/cxx_supportlib/MemoryKit/palloc.h +1 -1
  253. data/src/cxx_supportlib/ProcessManagement/Ruby.cpp +1 -1
  254. data/src/cxx_supportlib/ProcessManagement/Ruby.h +1 -1
  255. data/src/cxx_supportlib/ProcessManagement/Spawn.cpp +1 -1
  256. data/src/cxx_supportlib/ProcessManagement/Spawn.h +1 -1
  257. data/src/cxx_supportlib/ProcessManagement/Utils.cpp +1 -1
  258. data/src/cxx_supportlib/ProcessManagement/Utils.h +1 -1
  259. data/src/cxx_supportlib/RandomGenerator.h +1 -1
  260. data/src/cxx_supportlib/ResourceLocator.h +1 -1
  261. data/src/cxx_supportlib/SafeLibev.h +1 -1
  262. data/src/cxx_supportlib/SecurityKit/Crypto.cpp +9 -27
  263. data/src/cxx_supportlib/SecurityKit/Crypto.h +2 -2
  264. data/src/cxx_supportlib/SecurityKit/MemZeroGuard.h +1 -1
  265. data/src/cxx_supportlib/ServerKit/AcceptLoadBalancer.h +1 -1
  266. data/src/cxx_supportlib/ServerKit/Channel.h +1 -1
  267. data/src/cxx_supportlib/ServerKit/Client.h +1 -1
  268. data/src/cxx_supportlib/ServerKit/ClientRef.h +1 -1
  269. data/src/cxx_supportlib/ServerKit/Config.h +1 -1
  270. data/src/cxx_supportlib/ServerKit/Context.h +1 -1
  271. data/src/cxx_supportlib/ServerKit/CookieUtils.h +1 -1
  272. data/src/cxx_supportlib/ServerKit/Errors.h +2 -2
  273. data/src/cxx_supportlib/ServerKit/FdSinkChannel.h +1 -1
  274. data/src/cxx_supportlib/ServerKit/FdSourceChannel.h +1 -1
  275. data/src/cxx_supportlib/ServerKit/FileBufferedChannel.h +54 -2
  276. data/src/cxx_supportlib/ServerKit/FileBufferedFdSinkChannel.h +1 -1
  277. data/src/cxx_supportlib/ServerKit/HeaderTable.h +1 -1
  278. data/src/cxx_supportlib/ServerKit/Hooks.h +1 -1
  279. data/src/cxx_supportlib/ServerKit/HttpChunkedBodyParser.h +1 -1
  280. data/src/cxx_supportlib/ServerKit/HttpChunkedBodyParserState.h +1 -1
  281. data/src/cxx_supportlib/ServerKit/HttpClient.h +1 -1
  282. data/src/cxx_supportlib/ServerKit/HttpHeaderParser.h +2 -2
  283. data/src/cxx_supportlib/ServerKit/HttpHeaderParserState.h +2 -2
  284. data/src/cxx_supportlib/ServerKit/HttpRequest.h +2 -2
  285. data/src/cxx_supportlib/ServerKit/HttpRequestRef.h +1 -1
  286. data/src/cxx_supportlib/ServerKit/HttpServer.h +1 -1
  287. data/src/cxx_supportlib/ServerKit/Implementation.cpp +1 -1
  288. data/src/cxx_supportlib/ServerKit/Server.h +4 -2
  289. data/src/cxx_supportlib/ServerKit/llerrors.h +3 -3
  290. data/src/cxx_supportlib/ServerKit/llversion.h +1 -1
  291. data/src/cxx_supportlib/StaticString.h +1 -1
  292. data/src/cxx_supportlib/StrIntTools/DateParsing.h +1 -1
  293. data/src/cxx_supportlib/StrIntTools/StrIntUtils.cpp +1 -1
  294. data/src/cxx_supportlib/StrIntTools/StrIntUtils.h +1 -1
  295. data/src/cxx_supportlib/StrIntTools/StrIntUtilsNoStrictAliasing.cpp +1 -1
  296. data/src/cxx_supportlib/StrIntTools/StringScanning.h +1 -1
  297. data/src/cxx_supportlib/StrIntTools/Template.h +1 -1
  298. data/src/cxx_supportlib/SystemTools/ContainerHelpers.h +1 -1
  299. data/src/cxx_supportlib/SystemTools/ProcessMetricsCollector.h +1 -1
  300. data/src/cxx_supportlib/SystemTools/SystemMetricsCollector.h +1 -1
  301. data/src/cxx_supportlib/SystemTools/SystemTime.cpp +1 -1
  302. data/src/cxx_supportlib/SystemTools/SystemTime.h +1 -1
  303. data/src/cxx_supportlib/SystemTools/UserDatabase.cpp +1 -1
  304. data/src/cxx_supportlib/SystemTools/UserDatabase.h +1 -1
  305. data/src/cxx_supportlib/Utils/AnsiColorConstants.h +1 -1
  306. data/src/cxx_supportlib/Utils/AsyncSignalSafeUtils.h +1 -1
  307. data/src/cxx_supportlib/Utils/BlockingQueue.h +1 -1
  308. data/src/cxx_supportlib/Utils/CachedFileStat.cpp +1 -1
  309. data/src/cxx_supportlib/Utils/CachedFileStat.h +1 -1
  310. data/src/cxx_supportlib/Utils/CachedFileStat.hpp +1 -1
  311. data/src/cxx_supportlib/Utils/ClassUtils.h +1 -1
  312. data/src/cxx_supportlib/Utils/Curl.h +1 -1
  313. data/src/cxx_supportlib/Utils/FastStringStream.h +1 -1
  314. data/src/cxx_supportlib/Utils/FileChangeChecker.h +1 -1
  315. data/src/cxx_supportlib/Utils/HttpConstants.h +1 -1
  316. data/src/cxx_supportlib/Utils/IniFile.h +1 -1
  317. data/src/cxx_supportlib/Utils/MessagePassing.h +1 -1
  318. data/src/cxx_supportlib/Utils/OptionParsing.h +1 -1
  319. data/src/cxx_supportlib/Utils/ReleaseableScopedPointer.h +1 -1
  320. data/src/cxx_supportlib/Utils/ScopeGuard.h +1 -1
  321. data/src/cxx_supportlib/Utils/SpeedMeter.h +1 -1
  322. data/src/cxx_supportlib/Utils/Timer.h +1 -1
  323. data/src/cxx_supportlib/Utils/VariantMap.h +1 -1
  324. data/src/cxx_supportlib/Utils.cpp +1 -1
  325. data/src/cxx_supportlib/Utils.h +1 -1
  326. data/src/cxx_supportlib/WatchdogLauncher.cpp +1 -1
  327. data/src/cxx_supportlib/WatchdogLauncher.h +1 -1
  328. data/src/cxx_supportlib/WrapperRegistry/CBindings.cpp +1 -1
  329. data/src/cxx_supportlib/WrapperRegistry/CBindings.h +1 -1
  330. data/src/cxx_supportlib/WrapperRegistry/Entry.h +1 -1
  331. data/src/cxx_supportlib/WrapperRegistry/Registry.h +1 -1
  332. data/src/cxx_supportlib/oxt/backtrace.hpp +1 -1
  333. data/src/cxx_supportlib/oxt/detail/backtrace_disabled.hpp +1 -1
  334. data/src/cxx_supportlib/oxt/detail/backtrace_enabled.hpp +1 -1
  335. data/src/cxx_supportlib/oxt/detail/context.hpp +1 -1
  336. data/src/cxx_supportlib/oxt/detail/tracable_exception_disabled.hpp +1 -1
  337. data/src/cxx_supportlib/oxt/detail/tracable_exception_enabled.hpp +1 -1
  338. data/src/cxx_supportlib/oxt/dynamic_thread_group.hpp +1 -1
  339. data/src/cxx_supportlib/oxt/implementation.cpp +1 -1
  340. data/src/cxx_supportlib/oxt/initialize.hpp +1 -1
  341. data/src/cxx_supportlib/oxt/macros.hpp +1 -1
  342. data/src/cxx_supportlib/oxt/spin_lock.hpp +1 -1
  343. data/src/cxx_supportlib/oxt/system_calls.cpp +1 -1
  344. data/src/cxx_supportlib/oxt/system_calls.hpp +1 -1
  345. data/src/cxx_supportlib/oxt/thread.hpp +1 -1
  346. data/src/cxx_supportlib/oxt/tracable_exception.hpp +1 -1
  347. data/src/cxx_supportlib/vendor-copy/adhoc_lve.h +1 -1
  348. data/src/cxx_supportlib/vendor-copy/libuv/AUTHORS +353 -3
  349. data/src/cxx_supportlib/vendor-copy/libuv/ChangeLog +3981 -2
  350. data/src/cxx_supportlib/vendor-copy/libuv/LICENSE +1 -28
  351. data/src/cxx_supportlib/vendor-copy/libuv/LICENSE-docs +396 -0
  352. data/src/cxx_supportlib/vendor-copy/libuv/LICENSE-extra +36 -0
  353. data/src/cxx_supportlib/vendor-copy/libuv/Makefile.am +275 -58
  354. data/src/cxx_supportlib/vendor-copy/libuv/Makefile.in +4380 -2125
  355. data/src/cxx_supportlib/vendor-copy/libuv/aclocal.m4 +425 -221
  356. data/src/cxx_supportlib/vendor-copy/libuv/ar-lib +30 -10
  357. data/src/cxx_supportlib/vendor-copy/libuv/compile +31 -14
  358. data/src/cxx_supportlib/vendor-copy/libuv/config.guess +1084 -690
  359. data/src/cxx_supportlib/vendor-copy/libuv/config.sub +1844 -1297
  360. data/src/cxx_supportlib/vendor-copy/libuv/configure +6935 -3664
  361. data/src/cxx_supportlib/vendor-copy/libuv/configure.ac +43 -19
  362. data/src/cxx_supportlib/vendor-copy/libuv/depcomp +12 -11
  363. data/src/cxx_supportlib/vendor-copy/libuv/include/{uv-darwin.h → uv/darwin.h} +3 -3
  364. data/src/cxx_supportlib/vendor-copy/libuv/include/{uv-errno.h → uv/errno.h} +119 -60
  365. data/src/cxx_supportlib/vendor-copy/libuv/include/{uv-linux.h → uv/linux.h} +1 -1
  366. data/src/cxx_supportlib/vendor-copy/libuv/include/uv/os390.h +33 -0
  367. data/src/cxx_supportlib/vendor-copy/libuv/include/uv/posix.h +31 -0
  368. data/src/cxx_supportlib/vendor-copy/libuv/include/{uv-threadpool.h → uv/threadpool.h} +1 -1
  369. data/src/cxx_supportlib/vendor-copy/libuv/include/{tree.h → uv/tree.h} +3 -250
  370. data/src/cxx_supportlib/vendor-copy/libuv/include/{uv-unix.h → uv/unix.h} +186 -60
  371. data/src/cxx_supportlib/vendor-copy/libuv/include/{uv-version.h → uv/version.h} +3 -3
  372. data/src/cxx_supportlib/vendor-copy/libuv/include/uv/win.h +703 -0
  373. data/src/cxx_supportlib/vendor-copy/libuv/include/uv.h +528 -40
  374. data/src/cxx_supportlib/vendor-copy/libuv/install-sh +110 -70
  375. data/src/cxx_supportlib/vendor-copy/libuv/libuv-static.pc.in +12 -0
  376. data/src/cxx_supportlib/vendor-copy/libuv/libuv.pc.in +4 -2
  377. data/src/cxx_supportlib/vendor-copy/libuv/ltmain.sh +995 -619
  378. data/src/cxx_supportlib/vendor-copy/libuv/m4/ax_pthread.m4 +485 -0
  379. data/src/cxx_supportlib/vendor-copy/libuv/m4/libtool.m4 +438 -289
  380. data/src/cxx_supportlib/vendor-copy/libuv/m4/libuv-check-flags.m4 +21 -4
  381. data/src/cxx_supportlib/vendor-copy/libuv/m4/libuv-check-versions.m4 +7 -0
  382. data/src/cxx_supportlib/vendor-copy/libuv/m4/ltoptions.m4 +69 -39
  383. data/src/cxx_supportlib/vendor-copy/libuv/m4/ltsugar.m4 +1 -1
  384. data/src/cxx_supportlib/vendor-copy/libuv/m4/ltversion.m4 +7 -6
  385. data/src/cxx_supportlib/vendor-copy/libuv/m4/lt~obsolete.m4 +2 -2
  386. data/src/cxx_supportlib/vendor-copy/libuv/missing +55 -34
  387. data/src/cxx_supportlib/vendor-copy/libuv/src/fs-poll.c +52 -20
  388. data/src/cxx_supportlib/vendor-copy/libuv/src/idna.c +560 -0
  389. data/src/cxx_supportlib/vendor-copy/libuv/src/idna.h +31 -0
  390. data/src/cxx_supportlib/vendor-copy/libuv/src/inet.c +5 -16
  391. data/src/cxx_supportlib/vendor-copy/libuv/src/queue.h +68 -86
  392. data/src/cxx_supportlib/vendor-copy/libuv/src/random.c +123 -0
  393. data/src/cxx_supportlib/vendor-copy/libuv/src/strscpy.c +38 -0
  394. data/src/cxx_supportlib/vendor-copy/libuv/src/strscpy.h +39 -0
  395. data/src/cxx_supportlib/vendor-copy/libuv/src/strtok.c +52 -0
  396. data/src/cxx_supportlib/vendor-copy/libuv/src/strtok.h +27 -0
  397. data/src/cxx_supportlib/vendor-copy/libuv/src/thread-common.c +175 -0
  398. data/src/cxx_supportlib/vendor-copy/libuv/src/threadpool.c +172 -57
  399. data/src/cxx_supportlib/vendor-copy/libuv/src/{unix/timer.c → timer.c} +57 -29
  400. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/aix-common.c +89 -0
  401. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/aix.c +418 -256
  402. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/async.c +168 -129
  403. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/bsd-ifaddrs.c +163 -0
  404. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/bsd-proctitle.c +99 -0
  405. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/core.c +1312 -378
  406. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/cygwin.c +93 -0
  407. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/darwin-proctitle.c +18 -32
  408. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/darwin-stub.h +97 -0
  409. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/darwin-syscalls.h +17 -0
  410. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/darwin.c +41 -139
  411. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/dl.c +1 -1
  412. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/freebsd.c +75 -235
  413. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/fs.c +1308 -299
  414. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/fsevents.c +150 -148
  415. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/getaddrinfo.c +58 -8
  416. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/getnameinfo.c +3 -2
  417. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/haiku.c +172 -0
  418. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/hurd.c +172 -0
  419. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/ibmi.c +542 -0
  420. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/internal.h +297 -106
  421. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/kqueue.c +325 -94
  422. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/linux.c +2708 -0
  423. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/loop-watcher.c +11 -11
  424. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/loop.c +105 -24
  425. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/netbsd.c +51 -157
  426. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/no-fsevents.c +42 -0
  427. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/no-proctitle.c +45 -0
  428. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/openbsd.c +42 -183
  429. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/os390-proctitle.c +136 -0
  430. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/os390-syscalls.c +536 -0
  431. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/os390-syscalls.h +75 -0
  432. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/os390.c +1070 -0
  433. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/pipe.c +324 -55
  434. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/poll.c +58 -11
  435. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/posix-hrtime.c +36 -0
  436. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/posix-poll.c +385 -0
  437. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/process.c +795 -248
  438. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/procfs-exepath.c +45 -0
  439. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/proctitle.c +77 -22
  440. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/qnx.c +142 -0
  441. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/random-devurandom.c +93 -0
  442. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/random-getentropy.c +57 -0
  443. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/random-getrandom.c +86 -0
  444. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/random-sysctl-linux.c +99 -0
  445. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/signal.c +147 -39
  446. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/stream.c +426 -474
  447. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/sunos.c +240 -98
  448. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/sysinfo-loadavg.c +36 -0
  449. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/sysinfo-memory.c +42 -0
  450. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/tcp.c +402 -91
  451. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/thread.c +497 -145
  452. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/tty.c +269 -45
  453. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/udp.c +695 -165
  454. data/src/cxx_supportlib/vendor-copy/libuv/src/uv-common.c +463 -61
  455. data/src/cxx_supportlib/vendor-copy/libuv/src/uv-common.h +248 -44
  456. data/src/cxx_supportlib/vendor-copy/libuv/src/uv-data-getter-setters.c +119 -0
  457. data/src/cxx_supportlib/vendor-copy/libuv/tsansupp.txt +2 -0
  458. data/src/cxx_supportlib/{ServerKit/llhttp_api.c → vendor-copy/llhttp/api.c} +30 -23
  459. data/src/cxx_supportlib/{ServerKit → vendor-copy/llhttp}/llhttp.c +1756 -1645
  460. data/src/cxx_supportlib/{ServerKit → vendor-copy/llhttp}/llhttp.h +35 -13
  461. data/src/cxx_supportlib/vendor-modified/boost/algorithm/string/classification.hpp +19 -0
  462. data/src/cxx_supportlib/vendor-modified/boost/algorithm/string/formatter.hpp +1 -1
  463. data/src/cxx_supportlib/vendor-modified/boost/algorithm/string/trim_all.hpp +0 -2
  464. data/src/cxx_supportlib/vendor-modified/boost/assert.hpp +20 -13
  465. data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/core_arch_ops_gcc_x86.hpp +2 -2
  466. data/src/cxx_supportlib/vendor-modified/boost/atomic/thread_pause.hpp +4 -0
  467. data/src/cxx_supportlib/vendor-modified/boost/bind/mem_fn.hpp +1 -1
  468. data/src/cxx_supportlib/vendor-modified/boost/circular_buffer/debug.hpp +4 -0
  469. data/src/cxx_supportlib/vendor-modified/boost/config/assert_cxx03.hpp +1 -1
  470. data/src/cxx_supportlib/vendor-modified/boost/config/assert_cxx11.hpp +1 -1
  471. data/src/cxx_supportlib/vendor-modified/boost/config/assert_cxx14.hpp +1 -1
  472. data/src/cxx_supportlib/vendor-modified/boost/config/assert_cxx17.hpp +1 -1
  473. data/src/cxx_supportlib/vendor-modified/boost/config/assert_cxx20.hpp +1 -1
  474. data/src/cxx_supportlib/vendor-modified/boost/config/assert_cxx23.hpp +1 -1
  475. data/src/cxx_supportlib/vendor-modified/boost/config/auto_link.hpp +6 -1
  476. data/src/cxx_supportlib/vendor-modified/boost/config/compiler/clang_version.hpp +10 -1
  477. data/src/cxx_supportlib/vendor-modified/boost/config/compiler/visualc.hpp +5 -3
  478. data/src/cxx_supportlib/vendor-modified/boost/config/detail/cxx_composite.hpp +1 -1
  479. data/src/cxx_supportlib/vendor-modified/boost/config/workaround.hpp +5 -0
  480. data/src/cxx_supportlib/vendor-modified/boost/container/adaptive_pool.hpp +57 -53
  481. data/src/cxx_supportlib/vendor-modified/boost/container/allocator.hpp +10 -10
  482. data/src/cxx_supportlib/vendor-modified/boost/container/allocator_traits.hpp +34 -2
  483. data/src/cxx_supportlib/vendor-modified/boost/container/container_fwd.hpp +14 -2
  484. data/src/cxx_supportlib/vendor-modified/boost/container/deque.hpp +176 -2287
  485. data/src/cxx_supportlib/vendor-modified/boost/container/detail/adaptive_node_pool.hpp +13 -9
  486. data/src/cxx_supportlib/vendor-modified/boost/container/detail/adaptive_node_pool_impl.hpp +186 -70
  487. data/src/cxx_supportlib/vendor-modified/boost/container/detail/algorithm.hpp +2 -2
  488. data/src/cxx_supportlib/vendor-modified/boost/container/detail/aligned_allocation.hpp +149 -0
  489. data/src/cxx_supportlib/vendor-modified/boost/container/detail/alloc_helpers.hpp +35 -0
  490. data/src/cxx_supportlib/vendor-modified/boost/container/detail/alloc_lib.h +1 -0
  491. data/src/cxx_supportlib/vendor-modified/boost/container/detail/bit_utilities.hpp +133 -0
  492. data/src/cxx_supportlib/vendor-modified/boost/container/detail/compare_functors.hpp +18 -3
  493. data/src/cxx_supportlib/vendor-modified/boost/container/detail/config_begin.hpp +5 -0
  494. data/src/cxx_supportlib/vendor-modified/boost/container/detail/config_end.hpp +4 -0
  495. data/src/cxx_supportlib/vendor-modified/boost/container/detail/container_rebind.hpp +1 -1
  496. data/src/cxx_supportlib/vendor-modified/boost/container/detail/copy_move_algo.hpp +20 -10
  497. data/src/cxx_supportlib/vendor-modified/boost/container/detail/deque_impl.hpp +2744 -0
  498. data/src/cxx_supportlib/vendor-modified/boost/container/detail/dispatch_uses_allocator.hpp +202 -104
  499. data/src/cxx_supportlib/vendor-modified/boost/container/detail/dlmalloc.hpp +5 -4
  500. data/src/cxx_supportlib/vendor-modified/boost/container/detail/flat_tree.hpp +161 -85
  501. data/src/cxx_supportlib/vendor-modified/boost/container/detail/is_constructible.hpp +180 -0
  502. data/src/cxx_supportlib/vendor-modified/boost/container/detail/iterators.hpp +3 -2
  503. data/src/cxx_supportlib/vendor-modified/boost/container/detail/math_functions.hpp +12 -0
  504. data/src/cxx_supportlib/vendor-modified/boost/container/detail/mpl.hpp +16 -0
  505. data/src/cxx_supportlib/vendor-modified/boost/container/detail/mutex.hpp +1 -1
  506. data/src/cxx_supportlib/vendor-modified/boost/container/detail/next_capacity.hpp +9 -1
  507. data/src/cxx_supportlib/vendor-modified/boost/container/detail/node_pool.hpp +18 -14
  508. data/src/cxx_supportlib/vendor-modified/boost/container/detail/node_pool_impl.hpp +256 -41
  509. data/src/cxx_supportlib/vendor-modified/boost/container/detail/operator_new_helpers.hpp +75 -24
  510. data/src/cxx_supportlib/vendor-modified/boost/container/detail/pair.hpp +1 -56
  511. data/src/cxx_supportlib/vendor-modified/boost/container/detail/placement_new.hpp +16 -3
  512. data/src/cxx_supportlib/vendor-modified/boost/container/detail/pool_common_alloc.hpp +1 -7
  513. data/src/cxx_supportlib/vendor-modified/boost/container/detail/range_utils.hpp +196 -0
  514. data/src/cxx_supportlib/vendor-modified/boost/container/detail/std_fwd.hpp +33 -1
  515. data/src/cxx_supportlib/vendor-modified/boost/container/detail/tree.hpp +124 -69
  516. data/src/cxx_supportlib/vendor-modified/boost/container/detail/workaround.hpp +109 -7
  517. data/src/cxx_supportlib/vendor-modified/boost/container/devector.hpp +168 -162
  518. data/src/cxx_supportlib/vendor-modified/boost/container/experimental/nest.hpp +2978 -0
  519. data/src/cxx_supportlib/vendor-modified/boost/container/experimental/pmr/nest.hpp +45 -0
  520. data/src/cxx_supportlib/vendor-modified/boost/container/experimental/segmented_all_of.hpp +43 -0
  521. data/src/cxx_supportlib/vendor-modified/boost/container/experimental/segmented_any_of.hpp +42 -0
  522. data/src/cxx_supportlib/vendor-modified/boost/container/experimental/segmented_copy.hpp +229 -0
  523. data/src/cxx_supportlib/vendor-modified/boost/container/experimental/segmented_copy_if.hpp +270 -0
  524. data/src/cxx_supportlib/vendor-modified/boost/container/experimental/segmented_copy_n.hpp +308 -0
  525. data/src/cxx_supportlib/vendor-modified/boost/container/experimental/segmented_count.hpp +101 -0
  526. data/src/cxx_supportlib/vendor-modified/boost/container/experimental/segmented_count_if.hpp +100 -0
  527. data/src/cxx_supportlib/vendor-modified/boost/container/experimental/segmented_equal.hpp +268 -0
  528. data/src/cxx_supportlib/vendor-modified/boost/container/experimental/segmented_fill.hpp +101 -0
  529. data/src/cxx_supportlib/vendor-modified/boost/container/experimental/segmented_fill_n.hpp +171 -0
  530. data/src/cxx_supportlib/vendor-modified/boost/container/experimental/segmented_find.hpp +110 -0
  531. data/src/cxx_supportlib/vendor-modified/boost/container/experimental/segmented_find_if.hpp +110 -0
  532. data/src/cxx_supportlib/vendor-modified/boost/container/experimental/segmented_find_if_not.hpp +43 -0
  533. data/src/cxx_supportlib/vendor-modified/boost/container/experimental/segmented_find_last.hpp +179 -0
  534. data/src/cxx_supportlib/vendor-modified/boost/container/experimental/segmented_find_last_if.hpp +179 -0
  535. data/src/cxx_supportlib/vendor-modified/boost/container/experimental/segmented_find_last_if_not.hpp +43 -0
  536. data/src/cxx_supportlib/vendor-modified/boost/container/experimental/segmented_for_each.hpp +92 -0
  537. data/src/cxx_supportlib/vendor-modified/boost/container/experimental/segmented_generate.hpp +90 -0
  538. data/src/cxx_supportlib/vendor-modified/boost/container/experimental/segmented_generate_n.hpp +162 -0
  539. data/src/cxx_supportlib/vendor-modified/boost/container/experimental/segmented_is_partitioned.hpp +46 -0
  540. data/src/cxx_supportlib/vendor-modified/boost/container/experimental/segmented_is_sorted.hpp +49 -0
  541. data/src/cxx_supportlib/vendor-modified/boost/container/experimental/segmented_is_sorted_until.hpp +169 -0
  542. data/src/cxx_supportlib/vendor-modified/boost/container/experimental/segmented_iterator_traits.hpp +382 -0
  543. data/src/cxx_supportlib/vendor-modified/boost/container/experimental/segmented_merge.hpp +428 -0
  544. data/src/cxx_supportlib/vendor-modified/boost/container/experimental/segmented_mismatch.hpp +350 -0
  545. data/src/cxx_supportlib/vendor-modified/boost/container/experimental/segmented_none_of.hpp +98 -0
  546. data/src/cxx_supportlib/vendor-modified/boost/container/experimental/segmented_partition.hpp +296 -0
  547. data/src/cxx_supportlib/vendor-modified/boost/container/experimental/segmented_partition_copy.hpp +105 -0
  548. data/src/cxx_supportlib/vendor-modified/boost/container/experimental/segmented_partition_point.hpp +116 -0
  549. data/src/cxx_supportlib/vendor-modified/boost/container/experimental/segmented_remove.hpp +57 -0
  550. data/src/cxx_supportlib/vendor-modified/boost/container/experimental/segmented_remove_copy.hpp +207 -0
  551. data/src/cxx_supportlib/vendor-modified/boost/container/experimental/segmented_remove_copy_if.hpp +223 -0
  552. data/src/cxx_supportlib/vendor-modified/boost/container/experimental/segmented_remove_if.hpp +57 -0
  553. data/src/cxx_supportlib/vendor-modified/boost/container/experimental/segmented_replace.hpp +90 -0
  554. data/src/cxx_supportlib/vendor-modified/boost/container/experimental/segmented_replace_if.hpp +90 -0
  555. data/src/cxx_supportlib/vendor-modified/boost/container/experimental/segmented_reverse.hpp +245 -0
  556. data/src/cxx_supportlib/vendor-modified/boost/container/experimental/segmented_reverse_copy.hpp +229 -0
  557. data/src/cxx_supportlib/vendor-modified/boost/container/experimental/segmented_search.hpp +211 -0
  558. data/src/cxx_supportlib/vendor-modified/boost/container/experimental/segmented_search_n.hpp +476 -0
  559. data/src/cxx_supportlib/vendor-modified/boost/container/experimental/segmented_set_difference.hpp +300 -0
  560. data/src/cxx_supportlib/vendor-modified/boost/container/experimental/segmented_set_intersection.hpp +287 -0
  561. data/src/cxx_supportlib/vendor-modified/boost/container/experimental/segmented_set_symmetric_difference.hpp +306 -0
  562. data/src/cxx_supportlib/vendor-modified/boost/container/experimental/segmented_set_union.hpp +294 -0
  563. data/src/cxx_supportlib/vendor-modified/boost/container/experimental/segmented_stable_partition.hpp +153 -0
  564. data/src/cxx_supportlib/vendor-modified/boost/container/experimental/segmented_swap_ranges.hpp +92 -0
  565. data/src/cxx_supportlib/vendor-modified/boost/container/experimental/segmented_transform.hpp +93 -0
  566. data/src/cxx_supportlib/vendor-modified/boost/container/experimental/wrapped_iterator.hpp +142 -0
  567. data/src/cxx_supportlib/vendor-modified/boost/container/flat_map.hpp +642 -417
  568. data/src/cxx_supportlib/vendor-modified/boost/container/flat_set.hpp +141 -30
  569. data/src/cxx_supportlib/vendor-modified/boost/container/hub.hpp +2426 -0
  570. data/src/cxx_supportlib/vendor-modified/boost/container/list.hpp +65 -57
  571. data/src/cxx_supportlib/vendor-modified/boost/container/map.hpp +247 -68
  572. data/src/cxx_supportlib/vendor-modified/boost/container/new_allocator.hpp +7 -0
  573. data/src/cxx_supportlib/vendor-modified/boost/container/node_allocator.hpp +39 -33
  574. data/src/cxx_supportlib/vendor-modified/boost/container/options.hpp +156 -23
  575. data/src/cxx_supportlib/vendor-modified/boost/container/pmr/global_resource.hpp +3 -3
  576. data/src/cxx_supportlib/vendor-modified/boost/container/pmr/hub.hpp +43 -0
  577. data/src/cxx_supportlib/vendor-modified/boost/container/pmr/memory_resource.hpp +5 -3
  578. data/src/cxx_supportlib/vendor-modified/boost/container/pmr/monotonic_buffer_resource.hpp +1 -0
  579. data/src/cxx_supportlib/vendor-modified/boost/container/pmr/polymorphic_allocator.hpp +1 -1
  580. data/src/cxx_supportlib/vendor-modified/boost/container/pmr/resource_adaptor.hpp +4 -0
  581. data/src/cxx_supportlib/vendor-modified/boost/container/pmr/segtor.hpp +45 -0
  582. data/src/cxx_supportlib/vendor-modified/boost/container/scoped_allocator.hpp +5 -4
  583. data/src/cxx_supportlib/vendor-modified/boost/container/segtor.hpp +905 -0
  584. data/src/cxx_supportlib/vendor-modified/boost/container/set.hpp +148 -35
  585. data/src/cxx_supportlib/vendor-modified/boost/container/slist.hpp +59 -52
  586. data/src/cxx_supportlib/vendor-modified/boost/container/small_vector.hpp +632 -5
  587. data/src/cxx_supportlib/vendor-modified/boost/container/stable_vector.hpp +66 -60
  588. data/src/cxx_supportlib/vendor-modified/boost/container/static_vector.hpp +46 -1
  589. data/src/cxx_supportlib/vendor-modified/boost/container/string.hpp +612 -317
  590. data/src/cxx_supportlib/vendor-modified/boost/container/uses_allocator.hpp +54 -111
  591. data/src/cxx_supportlib/vendor-modified/boost/container/uses_allocator_construction.hpp +100 -0
  592. data/src/cxx_supportlib/vendor-modified/boost/container/uses_allocator_fwd.hpp +1 -3
  593. data/src/cxx_supportlib/vendor-modified/boost/container/vector.hpp +233 -116
  594. data/src/cxx_supportlib/vendor-modified/boost/container_hash/hash.hpp +5 -1
  595. data/src/cxx_supportlib/vendor-modified/boost/core/lightweight_test.hpp +17 -10
  596. data/src/cxx_supportlib/vendor-modified/boost/date_time/period.hpp +1 -3
  597. data/src/cxx_supportlib/vendor-modified/boost/describe/detail/config.hpp +16 -0
  598. data/src/cxx_supportlib/vendor-modified/boost/exception/detail/encoder.hpp +114 -0
  599. data/src/cxx_supportlib/vendor-modified/boost/exception/detail/error_info_impl.hpp +4 -0
  600. data/src/cxx_supportlib/vendor-modified/boost/exception/detail/requires_cxx11.hpp +1 -1
  601. data/src/cxx_supportlib/vendor-modified/boost/exception/detail/type_info.hpp +211 -1
  602. data/src/cxx_supportlib/vendor-modified/boost/exception/diagnostic_information.hpp +59 -0
  603. data/src/cxx_supportlib/vendor-modified/boost/exception/exception.hpp +6 -0
  604. data/src/cxx_supportlib/vendor-modified/boost/exception/info.hpp +34 -0
  605. data/src/cxx_supportlib/vendor-modified/boost/intrusive/avltree.hpp +0 -1
  606. data/src/cxx_supportlib/vendor-modified/boost/intrusive/bstree.hpp +12 -3
  607. data/src/cxx_supportlib/vendor-modified/boost/intrusive/derivation_value_traits.hpp +1 -1
  608. data/src/cxx_supportlib/vendor-modified/boost/intrusive/detail/ebo_functor_holder.hpp +29 -174
  609. data/src/cxx_supportlib/vendor-modified/boost/intrusive/detail/generic_hook.hpp +18 -2
  610. data/src/cxx_supportlib/vendor-modified/boost/intrusive/detail/key_nodeptr_comp.hpp +0 -1
  611. data/src/cxx_supportlib/vendor-modified/boost/intrusive/detail/workaround.hpp +4 -5
  612. data/src/cxx_supportlib/vendor-modified/boost/intrusive/hashtable.hpp +20 -11
  613. data/src/cxx_supportlib/vendor-modified/boost/intrusive/list.hpp +42 -14
  614. data/src/cxx_supportlib/vendor-modified/boost/intrusive/slist.hpp +58 -22
  615. data/src/cxx_supportlib/vendor-modified/boost/intrusive/unordered_set.hpp +3 -1
  616. data/src/cxx_supportlib/vendor-modified/boost/iterator/advance.hpp +5 -1
  617. data/src/cxx_supportlib/vendor-modified/boost/iterator/distance.hpp +8 -2
  618. data/src/cxx_supportlib/vendor-modified/boost/iterator/is_iterator.hpp +9 -0
  619. data/src/cxx_supportlib/vendor-modified/boost/lexical_cast/bad_lexical_cast.hpp +11 -1
  620. data/src/cxx_supportlib/vendor-modified/boost/lexical_cast/detail/buffer_view.hpp +9 -1
  621. data/src/cxx_supportlib/vendor-modified/boost/lexical_cast/detail/config.hpp +22 -0
  622. data/src/cxx_supportlib/vendor-modified/boost/lexical_cast/detail/converter_lexical.hpp +15 -7
  623. data/src/cxx_supportlib/vendor-modified/boost/lexical_cast/detail/converter_lexical_streams.hpp +23 -11
  624. data/src/cxx_supportlib/vendor-modified/boost/lexical_cast/detail/converter_numeric.hpp +11 -1
  625. data/src/cxx_supportlib/vendor-modified/boost/lexical_cast/detail/inf_nan.hpp +9 -1
  626. data/src/cxx_supportlib/vendor-modified/boost/lexical_cast/detail/is_character.hpp +11 -2
  627. data/src/cxx_supportlib/vendor-modified/boost/lexical_cast/detail/lcast_basic_unlockedbuf.hpp +10 -1
  628. data/src/cxx_supportlib/vendor-modified/boost/lexical_cast/detail/lcast_char_constants.hpp +8 -1
  629. data/src/cxx_supportlib/vendor-modified/boost/{detail → lexical_cast/detail}/lcast_precision.hpp +13 -1
  630. data/src/cxx_supportlib/vendor-modified/boost/lexical_cast/detail/lcast_unsigned_converters.hpp +11 -1
  631. data/src/cxx_supportlib/vendor-modified/boost/lexical_cast/detail/widest_char.hpp +10 -2
  632. data/src/cxx_supportlib/vendor-modified/boost/lexical_cast/try_lexical_convert.hpp +15 -2
  633. data/src/cxx_supportlib/vendor-modified/boost/lexical_cast.hpp +11 -1
  634. data/src/cxx_supportlib/vendor-modified/boost/libs/thread/src/pthread/once_atomic.cpp +1 -1
  635. data/src/cxx_supportlib/vendor-modified/boost/libs/thread/src/pthread/thread.cpp +48 -46
  636. data/src/cxx_supportlib/vendor-modified/boost/move/detail/meta_utils.hpp +23 -0
  637. data/src/cxx_supportlib/vendor-modified/boost/move/detail/move_helpers.hpp +24 -24
  638. data/src/cxx_supportlib/vendor-modified/boost/move/detail/nsec_clock.hpp +12 -4
  639. data/src/cxx_supportlib/vendor-modified/boost/move/detail/type_traits.hpp +76 -0
  640. data/src/cxx_supportlib/vendor-modified/boost/move/detail/workaround.hpp +1 -1
  641. data/src/cxx_supportlib/vendor-modified/boost/move/traits.hpp +11 -0
  642. data/src/cxx_supportlib/vendor-modified/boost/mp11/algorithm.hpp +58 -37
  643. data/src/cxx_supportlib/vendor-modified/boost/mp11/detail/mp_copy_if.hpp +1 -2
  644. data/src/cxx_supportlib/vendor-modified/boost/mp11/detail/mp_map_find.hpp +17 -9
  645. data/src/cxx_supportlib/vendor-modified/boost/mp11/detail/mp_remove_if.hpp +1 -2
  646. data/src/cxx_supportlib/vendor-modified/boost/mp11/integer_sequence.hpp +6 -0
  647. data/src/cxx_supportlib/vendor-modified/boost/mp11/version.hpp +1 -1
  648. data/src/cxx_supportlib/vendor-modified/boost/none_t.hpp +6 -1
  649. data/src/cxx_supportlib/vendor-modified/boost/optional/detail/optional_common_defs.hpp +188 -0
  650. data/src/cxx_supportlib/vendor-modified/boost/optional/detail/optional_factory_support.hpp +0 -6
  651. data/src/cxx_supportlib/vendor-modified/boost/optional/detail/optional_hash.hpp +1 -1
  652. data/src/cxx_supportlib/vendor-modified/boost/optional/detail/optional_nonmember_interface.hpp +117 -0
  653. data/src/cxx_supportlib/vendor-modified/boost/optional/detail/optional_reference_spec.hpp +108 -83
  654. data/src/cxx_supportlib/vendor-modified/boost/optional/detail/optional_relops.hpp +39 -39
  655. data/src/cxx_supportlib/vendor-modified/boost/optional/detail/optional_select_implementation.hpp +37 -0
  656. data/src/cxx_supportlib/vendor-modified/boost/optional/detail/optional_swap.hpp +1 -1
  657. data/src/cxx_supportlib/vendor-modified/boost/optional/detail/optional_trivially_copyable_base.hpp +8 -8
  658. data/src/cxx_supportlib/vendor-modified/boost/optional/detail/union_optional.hpp +724 -0
  659. data/src/cxx_supportlib/vendor-modified/boost/optional/optional.hpp +93 -220
  660. data/src/cxx_supportlib/vendor-modified/boost/optional/optional_fwd.hpp +14 -4
  661. data/src/cxx_supportlib/vendor-modified/boost/optional/optional_io.hpp +1 -1
  662. data/src/cxx_supportlib/vendor-modified/boost/random/binomial_distribution.hpp +1 -1
  663. data/src/cxx_supportlib/vendor-modified/boost/random/uniform_int_distribution.hpp +1 -1
  664. data/src/cxx_supportlib/vendor-modified/boost/rational.hpp +1 -1
  665. data/src/cxx_supportlib/vendor-modified/boost/static_assert.hpp +4 -6
  666. data/src/cxx_supportlib/vendor-modified/boost/system/api_config.hpp +1 -1
  667. data/src/cxx_supportlib/vendor-modified/boost/system/detail/config.hpp +16 -0
  668. data/src/cxx_supportlib/vendor-modified/boost/system/detail/error_category.hpp +13 -13
  669. data/src/cxx_supportlib/vendor-modified/boost/system/detail/error_category_impl.hpp +5 -5
  670. data/src/cxx_supportlib/vendor-modified/boost/thread/concurrent_queues/detail/sync_deque_base.hpp +3 -2
  671. data/src/cxx_supportlib/vendor-modified/boost/thread/concurrent_queues/detail/sync_queue_base.hpp +3 -2
  672. data/src/cxx_supportlib/vendor-modified/boost/thread/detail/thread.hpp +2 -1
  673. data/src/cxx_supportlib/vendor-modified/boost/thread/experimental/parallel/v2/task_region.hpp +1 -1
  674. data/src/cxx_supportlib/vendor-modified/boost/thread/future.hpp +30 -28
  675. data/src/cxx_supportlib/vendor-modified/boost/thread/pthread/once.hpp +6 -3
  676. data/src/cxx_supportlib/vendor-modified/boost/thread/pthread/once_atomic.hpp +5 -1
  677. data/src/cxx_supportlib/vendor-modified/boost/thread/pthread/pthread_helpers.hpp +1 -0
  678. data/src/cxx_supportlib/vendor-modified/boost/thread/pthread/shared_mutex.hpp +16 -16
  679. data/src/cxx_supportlib/vendor-modified/boost/thread/v2/shared_mutex.hpp +26 -26
  680. data/src/cxx_supportlib/vendor-modified/boost/unordered/concurrent_flat_map.hpp +196 -6
  681. data/src/cxx_supportlib/vendor-modified/boost/unordered/concurrent_flat_set.hpp +191 -6
  682. data/src/cxx_supportlib/vendor-modified/boost/unordered/concurrent_node_map.hpp +196 -5
  683. data/src/cxx_supportlib/vendor-modified/boost/unordered/concurrent_node_set.hpp +192 -5
  684. data/src/cxx_supportlib/vendor-modified/boost/unordered/detail/foa/concurrent_table.hpp +3 -3
  685. data/src/cxx_supportlib/vendor-modified/boost/unordered/detail/foa/core.hpp +2 -2
  686. data/src/cxx_supportlib/vendor-modified/boost/unordered/detail/foa/table.hpp +3 -3
  687. data/src/cxx_supportlib/vendor-modified/boost/unordered/detail/implementation.hpp +52 -16
  688. data/src/cxx_supportlib/vendor-modified/boost/unordered/detail/ranges_support.hpp +104 -0
  689. data/src/cxx_supportlib/vendor-modified/boost/unordered/detail/type_traits.hpp +1 -14
  690. data/src/cxx_supportlib/vendor-modified/boost/unordered/detail/unordered_printers.hpp +10 -4
  691. data/src/cxx_supportlib/vendor-modified/boost/unordered/unordered_flat_map.hpp +121 -3
  692. data/src/cxx_supportlib/vendor-modified/boost/unordered/unordered_flat_set.hpp +118 -3
  693. data/src/cxx_supportlib/vendor-modified/boost/unordered/unordered_map.hpp +338 -1
  694. data/src/cxx_supportlib/vendor-modified/boost/unordered/unordered_node_map.hpp +121 -3
  695. data/src/cxx_supportlib/vendor-modified/boost/unordered/unordered_node_set.hpp +118 -3
  696. data/src/cxx_supportlib/vendor-modified/boost/unordered/unordered_set.hpp +333 -1
  697. data/src/cxx_supportlib/vendor-modified/boost/version.hpp +2 -2
  698. data/src/cxx_supportlib/vendor-modified/jsoncpp/json-forwards.h +276 -143
  699. data/src/cxx_supportlib/vendor-modified/jsoncpp/json.h +1262 -771
  700. data/src/cxx_supportlib/vendor-modified/jsoncpp/jsoncpp.cpp +1704 -1586
  701. data/src/cxx_supportlib/vendor-modified/libev/Changes +109 -0
  702. data/src/cxx_supportlib/vendor-modified/libev/Makefile.am +2 -1
  703. data/src/cxx_supportlib/vendor-modified/libev/Makefile.in +47 -33
  704. data/src/cxx_supportlib/vendor-modified/libev/README +2 -1
  705. data/src/cxx_supportlib/vendor-modified/libev/aclocal.m4 +1653 -1224
  706. data/src/cxx_supportlib/vendor-modified/libev/config.guess +376 -316
  707. data/src/cxx_supportlib/vendor-modified/libev/config.h.in +13 -2
  708. data/src/cxx_supportlib/vendor-modified/libev/config.sub +156 -154
  709. data/src/cxx_supportlib/vendor-modified/libev/configure +1431 -940
  710. data/src/cxx_supportlib/vendor-modified/libev/configure.ac +3 -3
  711. data/src/cxx_supportlib/vendor-modified/libev/depcomp +5 -5
  712. data/src/cxx_supportlib/vendor-modified/libev/ev++.h +109 -107
  713. data/src/cxx_supportlib/vendor-modified/libev/ev.c +807 -319
  714. data/src/cxx_supportlib/vendor-modified/libev/ev.h +111 -105
  715. data/src/cxx_supportlib/vendor-modified/libev/ev_epoll.c +42 -29
  716. data/src/cxx_supportlib/vendor-modified/libev/ev_iouring.c +694 -0
  717. data/src/cxx_supportlib/vendor-modified/libev/ev_kqueue.c +15 -9
  718. data/src/cxx_supportlib/vendor-modified/libev/ev_linuxaio.c +620 -0
  719. data/src/cxx_supportlib/vendor-modified/libev/ev_poll.c +19 -14
  720. data/src/cxx_supportlib/vendor-modified/libev/ev_port.c +8 -5
  721. data/src/cxx_supportlib/vendor-modified/libev/ev_select.c +6 -6
  722. data/src/cxx_supportlib/vendor-modified/libev/ev_vars.h +48 -3
  723. data/src/cxx_supportlib/vendor-modified/libev/ev_win32.c +2 -2
  724. data/src/cxx_supportlib/vendor-modified/libev/ev_wrap.h +72 -0
  725. data/src/cxx_supportlib/vendor-modified/libev/install-sh +23 -13
  726. data/src/cxx_supportlib/vendor-modified/libev/libev.m4 +6 -1
  727. data/src/cxx_supportlib/vendor-modified/libev/ltmain.sh +3581 -1993
  728. data/src/cxx_supportlib/vendor-modified/libev/missing +8 -8
  729. data/src/cxx_supportlib/vendor-modified/libev/mkinstalldirs +3 -3
  730. data/src/cxx_supportlib/vendor-modified/modp_b64_strict_aliasing.cpp +1 -1
  731. data/src/helper-scripts/backtrace-sanitizer.rb +1 -1
  732. data/src/helper-scripts/crash-watch.rb +1 -1
  733. data/src/helper-scripts/download_binaries/extconf.rb +1 -1
  734. data/src/helper-scripts/meteor-loader.rb +1 -1
  735. data/src/helper-scripts/node-loader.js +1 -1
  736. data/src/helper-scripts/prespawn +1 -1
  737. data/src/helper-scripts/rack-loader.rb +1 -1
  738. data/src/helper-scripts/rack-preloader.rb +1 -1
  739. data/src/helper-scripts/wsgi-loader.py +1 -1
  740. data/src/nginx_module/ConfigGeneral/AutoGeneratedDefinitions.c +1 -1
  741. data/src/nginx_module/ConfigGeneral/AutoGeneratedDefinitions.c.cxxcodebuilder +1 -1
  742. data/src/nginx_module/ConfigGeneral/AutoGeneratedManifestDefaultsInitialization.c +1 -1
  743. data/src/nginx_module/ConfigGeneral/AutoGeneratedManifestDefaultsInitialization.c.cxxcodebuilder +1 -1
  744. data/src/nginx_module/ConfigGeneral/AutoGeneratedSetterFuncs.c +1 -1
  745. data/src/nginx_module/ConfigGeneral/AutoGeneratedSetterFuncs.c.cxxcodebuilder +1 -1
  746. data/src/nginx_module/Configuration.c +1 -1
  747. data/src/nginx_module/Configuration.h +1 -1
  748. data/src/nginx_module/ContentHandler.c +36 -1
  749. data/src/nginx_module/ContentHandler.h +1 -1
  750. data/src/nginx_module/LocationConfig/AutoGeneratedCreateFunction.c +1 -1
  751. data/src/nginx_module/LocationConfig/AutoGeneratedCreateFunction.c.cxxcodebuilder +1 -1
  752. data/src/nginx_module/LocationConfig/AutoGeneratedHeaderSerialization.c +1 -1
  753. data/src/nginx_module/LocationConfig/AutoGeneratedHeaderSerialization.c.cxxcodebuilder +1 -1
  754. data/src/nginx_module/LocationConfig/AutoGeneratedManifestGeneration.c +1 -1
  755. data/src/nginx_module/LocationConfig/AutoGeneratedManifestGeneration.c.cxxcodebuilder +1 -1
  756. data/src/nginx_module/LocationConfig/AutoGeneratedMergeFunction.c +1 -1
  757. data/src/nginx_module/LocationConfig/AutoGeneratedMergeFunction.c.cxxcodebuilder +1 -1
  758. data/src/nginx_module/LocationConfig/AutoGeneratedStruct.h +1 -1
  759. data/src/nginx_module/LocationConfig/AutoGeneratedStruct.h.cxxcodebuilder +1 -1
  760. data/src/nginx_module/MainConfig/AutoGeneratedCreateFunction.c +1 -1
  761. data/src/nginx_module/MainConfig/AutoGeneratedCreateFunction.c.cxxcodebuilder +1 -1
  762. data/src/nginx_module/MainConfig/AutoGeneratedManifestGeneration.c +1 -1
  763. data/src/nginx_module/MainConfig/AutoGeneratedManifestGeneration.c.cxxcodebuilder +1 -1
  764. data/src/nginx_module/MainConfig/AutoGeneratedStruct.h +1 -1
  765. data/src/nginx_module/MainConfig/AutoGeneratedStruct.h.cxxcodebuilder +1 -1
  766. data/src/nginx_module/StaticContentHandler.c +1 -1
  767. data/src/nginx_module/StaticContentHandler.h +1 -1
  768. data/src/nginx_module/ngx_http_passenger_module.c +1 -1
  769. data/src/nginx_module/ngx_http_passenger_module.h +1 -1
  770. data/src/nodejs_supportlib/phusion_passenger/line_reader.js +1 -1
  771. data/src/ruby_native_extension/extconf.rb +1 -1
  772. data/src/ruby_native_extension/passenger_native_support.c +1 -1
  773. data/src/ruby_supportlib/phusion_passenger/abstract_installer.rb +1 -1
  774. data/src/ruby_supportlib/phusion_passenger/admin_tools/instance.rb +1 -1
  775. data/src/ruby_supportlib/phusion_passenger/admin_tools/instance_registry.rb +1 -1
  776. data/src/ruby_supportlib/phusion_passenger/admin_tools/memory_stats.rb +2 -12
  777. data/src/ruby_supportlib/phusion_passenger/admin_tools.rb +1 -1
  778. data/src/ruby_supportlib/phusion_passenger/apache2/config_options.rb +1 -1
  779. data/src/ruby_supportlib/phusion_passenger/apache2/config_utils.rb +1 -1
  780. data/src/ruby_supportlib/phusion_passenger/common_library.rb +14 -16
  781. data/src/ruby_supportlib/phusion_passenger/config/about_command.rb +1 -1
  782. data/src/ruby_supportlib/phusion_passenger/config/agent_compiler.rb +1 -1
  783. data/src/ruby_supportlib/phusion_passenger/config/api_call_command.rb +1 -1
  784. data/src/ruby_supportlib/phusion_passenger/config/build_native_support_command.rb +1 -1
  785. data/src/ruby_supportlib/phusion_passenger/config/command.rb +1 -1
  786. data/src/ruby_supportlib/phusion_passenger/config/compile_agent_command.rb +1 -1
  787. data/src/ruby_supportlib/phusion_passenger/config/compile_nginx_engine_command.rb +1 -1
  788. data/src/ruby_supportlib/phusion_passenger/config/detach_process_command.rb +1 -1
  789. data/src/ruby_supportlib/phusion_passenger/config/download_agent_command.rb +1 -1
  790. data/src/ruby_supportlib/phusion_passenger/config/download_nginx_engine_command.rb +1 -1
  791. data/src/ruby_supportlib/phusion_passenger/config/install_agent_command.rb +1 -1
  792. data/src/ruby_supportlib/phusion_passenger/config/install_standalone_runtime_command.rb +1 -1
  793. data/src/ruby_supportlib/phusion_passenger/config/installation_utils.rb +1 -1
  794. data/src/ruby_supportlib/phusion_passenger/config/list_instances_command.rb +1 -1
  795. data/src/ruby_supportlib/phusion_passenger/config/main.rb +1 -1
  796. data/src/ruby_supportlib/phusion_passenger/config/nginx_engine_compiler.rb +3 -2
  797. data/src/ruby_supportlib/phusion_passenger/config/reopen_logs_command.rb +6 -1
  798. data/src/ruby_supportlib/phusion_passenger/config/restart_app_command.rb +1 -1
  799. data/src/ruby_supportlib/phusion_passenger/config/system_metrics_command.rb +1 -1
  800. data/src/ruby_supportlib/phusion_passenger/config/system_properties_command.rb +1 -1
  801. data/src/ruby_supportlib/phusion_passenger/config/utils.rb +1 -1
  802. data/src/ruby_supportlib/phusion_passenger/config/validate_install_command.rb +1 -1
  803. data/src/ruby_supportlib/phusion_passenger/console_text_template.rb +1 -1
  804. data/src/ruby_supportlib/phusion_passenger/constants.rb +1 -1
  805. data/src/ruby_supportlib/phusion_passenger/debug_logging.rb +1 -1
  806. data/src/ruby_supportlib/phusion_passenger/loader_shared_helpers.rb +1 -1
  807. data/src/ruby_supportlib/phusion_passenger/message_channel.rb +1 -1
  808. data/src/ruby_supportlib/phusion_passenger/message_client.rb +1 -1
  809. data/src/ruby_supportlib/phusion_passenger/native_support.rb +1 -1
  810. data/src/ruby_supportlib/phusion_passenger/nginx/config_options.rb +1 -1
  811. data/src/ruby_supportlib/phusion_passenger/packaging.rb +4 -3
  812. data/src/ruby_supportlib/phusion_passenger/platform_info/apache.rb +1 -1
  813. data/src/ruby_supportlib/phusion_passenger/platform_info/apache_detector.rb +1 -1
  814. data/src/ruby_supportlib/phusion_passenger/platform_info/binary_compatibility.rb +1 -1
  815. data/src/ruby_supportlib/phusion_passenger/platform_info/compiler.rb +195 -11
  816. data/src/ruby_supportlib/phusion_passenger/platform_info/crypto.rb +1 -1
  817. data/src/ruby_supportlib/phusion_passenger/platform_info/curl.rb +1 -1
  818. data/src/ruby_supportlib/phusion_passenger/platform_info/cxx_portability.rb +1 -1
  819. data/src/ruby_supportlib/phusion_passenger/platform_info/linux.rb +1 -1
  820. data/src/ruby_supportlib/phusion_passenger/platform_info/networking.rb +1 -1
  821. data/src/ruby_supportlib/phusion_passenger/platform_info/openssl.rb +1 -1
  822. data/src/ruby_supportlib/phusion_passenger/platform_info/operating_system.rb +1 -1
  823. data/src/ruby_supportlib/phusion_passenger/platform_info/pcre.rb +1 -1
  824. data/src/ruby_supportlib/phusion_passenger/platform_info/ruby.rb +1 -1
  825. data/src/ruby_supportlib/phusion_passenger/platform_info/zlib.rb +1 -1
  826. data/src/ruby_supportlib/phusion_passenger/platform_info.rb +1 -1
  827. data/src/ruby_supportlib/phusion_passenger/plugin.rb +1 -1
  828. data/src/ruby_supportlib/phusion_passenger/preloader_shared_helpers.rb +1 -1
  829. data/src/ruby_supportlib/phusion_passenger/public_api.rb +1 -1
  830. data/src/ruby_supportlib/phusion_passenger/rack/handler.rb +1 -1
  831. data/src/ruby_supportlib/phusion_passenger/rack/out_of_band_gc.rb +1 -1
  832. data/src/ruby_supportlib/phusion_passenger/rack/thread_handler_extension.rb +1 -1
  833. data/src/ruby_supportlib/phusion_passenger/rack_handler.rb +1 -1
  834. data/src/ruby_supportlib/phusion_passenger/request_handler/thread_handler.rb +2 -7
  835. data/src/ruby_supportlib/phusion_passenger/request_handler.rb +1 -1
  836. data/src/ruby_supportlib/phusion_passenger/ruby_core_enhancements.rb +1 -1
  837. data/src/ruby_supportlib/phusion_passenger/ruby_core_io_enhancements.rb +1 -1
  838. data/src/ruby_supportlib/phusion_passenger/simple_benchmarking.rb +1 -1
  839. data/src/ruby_supportlib/phusion_passenger/standalone/app_finder.rb +1 -1
  840. data/src/ruby_supportlib/phusion_passenger/standalone/command.rb +1 -1
  841. data/src/ruby_supportlib/phusion_passenger/standalone/config_options_list.rb +1 -1
  842. data/src/ruby_supportlib/phusion_passenger/standalone/config_utils.rb +1 -1
  843. data/src/ruby_supportlib/phusion_passenger/standalone/control_utils.rb +1 -1
  844. data/src/ruby_supportlib/phusion_passenger/standalone/main.rb +1 -1
  845. data/src/ruby_supportlib/phusion_passenger/standalone/start_command/builtin_engine.rb +2 -2
  846. data/src/ruby_supportlib/phusion_passenger/standalone/start_command/nginx_engine.rb +4 -8
  847. data/src/ruby_supportlib/phusion_passenger/standalone/start_command.rb +1 -1
  848. data/src/ruby_supportlib/phusion_passenger/standalone/status_command.rb +1 -1
  849. data/src/ruby_supportlib/phusion_passenger/standalone/stop_command.rb +1 -1
  850. data/src/ruby_supportlib/phusion_passenger/standalone/version_command.rb +1 -1
  851. data/src/ruby_supportlib/phusion_passenger/utils/ansi_colors.rb +1 -1
  852. data/src/ruby_supportlib/phusion_passenger/utils/download.rb +1 -1
  853. data/src/ruby_supportlib/phusion_passenger/utils/file_system_watcher.rb +1 -1
  854. data/src/ruby_supportlib/phusion_passenger/utils/hosts_file_parser.rb +1 -1
  855. data/src/ruby_supportlib/phusion_passenger/utils/json.rb +25 -2
  856. data/src/ruby_supportlib/phusion_passenger/utils/lock.rb +1 -1
  857. data/src/ruby_supportlib/phusion_passenger/utils/native_support_utils.rb +1 -1
  858. data/src/ruby_supportlib/phusion_passenger/utils/progress_bar.rb +1 -1
  859. data/src/ruby_supportlib/phusion_passenger/utils/strscan.rb +1 -1
  860. data/src/ruby_supportlib/phusion_passenger/utils/terminal_choice_menu.rb +1 -1
  861. data/src/ruby_supportlib/phusion_passenger/utils/unseekable_socket.rb +3 -13
  862. data/src/ruby_supportlib/phusion_passenger/utils.rb +1 -1
  863. data/src/ruby_supportlib/phusion_passenger/vendor/crash_watch/app.rb +1 -1
  864. data/src/ruby_supportlib/phusion_passenger/vendor/crash_watch/base.rb +1 -1
  865. data/src/ruby_supportlib/phusion_passenger/vendor/crash_watch/gdb_controller.rb +1 -1
  866. data/src/ruby_supportlib/phusion_passenger/vendor/crash_watch/lldb_controller.rb +1 -1
  867. data/src/ruby_supportlib/phusion_passenger/vendor/crash_watch/utils.rb +1 -1
  868. data/src/ruby_supportlib/phusion_passenger/vendor/crash_watch/version.rb +1 -1
  869. data/src/ruby_supportlib/phusion_passenger/vendor/daemon_controller/lock_file.rb +8 -6
  870. data/src/ruby_supportlib/phusion_passenger/vendor/daemon_controller/spawn.rb +4 -3
  871. data/src/ruby_supportlib/phusion_passenger/vendor/daemon_controller/version.rb +6 -4
  872. data/src/ruby_supportlib/phusion_passenger/vendor/daemon_controller.rb +406 -579
  873. data/src/ruby_supportlib/phusion_passenger.rb +8 -8
  874. data/src/schema_printer/SchemaPrinterMain.cpp +1 -1
  875. data/src/schema_printer/SchemaPrinterMain.cpp.cxxcodebuilder +1 -1
  876. metadata +140 -38
  877. data/doc/DeveloperQuickstart.md +0 -70
  878. data/src/README.md +0 -7
  879. data/src/cxx_supportlib/vendor-copy/libuv/README.md +0 -245
  880. data/src/cxx_supportlib/vendor-copy/libuv/checksparse.sh +0 -234
  881. data/src/cxx_supportlib/vendor-copy/libuv/common.gypi +0 -210
  882. data/src/cxx_supportlib/vendor-copy/libuv/gyp_uv.py +0 -93
  883. data/src/cxx_supportlib/vendor-copy/libuv/include/android-ifaddrs.h +0 -54
  884. data/src/cxx_supportlib/vendor-copy/libuv/include/pthread-fixes.h +0 -72
  885. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/android-ifaddrs.c +0 -703
  886. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/atomic-ops.h +0 -77
  887. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/linux-core.c +0 -899
  888. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/linux-inotify.c +0 -285
  889. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/linux-syscalls.c +0 -471
  890. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/linux-syscalls.h +0 -158
  891. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/pthread-fixes.c +0 -104
  892. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/spinlock.h +0 -53
  893. data/src/cxx_supportlib/vendor-copy/libuv/uv.gyp +0 -508
  894. data/src/cxx_supportlib/vendor-modified/boost/optional/detail/optional_utility.hpp +0 -41
  895. /data/src/cxx_supportlib/vendor-copy/libuv/include/{uv-aix.h → uv/aix.h} +0 -0
  896. /data/src/cxx_supportlib/vendor-copy/libuv/include/{uv-bsd.h → uv/bsd.h} +0 -0
  897. /data/src/cxx_supportlib/vendor-copy/libuv/include/{uv-sunos.h → uv/sunos.h} +0 -0
  898. /data/src/cxx_supportlib/{ServerKit/llhttp_http.c → vendor-copy/llhttp/http.c} +0 -0
@@ -20,40 +20,13 @@
20
20
 
21
21
  #include <boost/container/detail/config_begin.hpp>
22
22
  #include <boost/container/detail/workaround.hpp>
23
+
24
+ //move
25
+ #include <boost/move/utility_core.hpp>
23
26
  // container
24
- #include <boost/container/allocator_traits.hpp>
25
27
  #include <boost/container/container_fwd.hpp>
26
- #include <boost/container/new_allocator.hpp> //new_allocator
27
- #include <boost/container/throw_exception.hpp>
28
- #include <boost/container/options.hpp>
29
- // container/detail
30
- #include <boost/container/detail/advanced_insert_int.hpp>
31
- #include <boost/container/detail/algorithm.hpp> //algo_equal(), algo_lexicographical_compare
32
- #include <boost/container/detail/alloc_helpers.hpp>
33
- #include <boost/container/detail/copy_move_algo.hpp>
34
- #include <boost/container/detail/iterator.hpp>
35
- #include <boost/move/detail/iterator_to_raw_pointer.hpp>
36
- #include <boost/container/detail/iterators.hpp>
37
- #include <boost/container/detail/min_max.hpp>
38
- #include <boost/container/detail/mpl.hpp>
39
- #include <boost/move/detail/to_raw_pointer.hpp>
40
- #include <boost/container/detail/type_traits.hpp>
41
- #include <boost/container/detail/math_functions.hpp>
42
- // move
43
- #include <boost/move/adl_move_swap.hpp>
44
- #include <boost/move/algo/detail/merge.hpp>
45
- #include <boost/move/iterator.hpp>
46
- #include <boost/move/traits.hpp>
47
- #include <boost/move/utility_core.hpp>
48
- // move/detail
49
- #if defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
50
- #include <boost/move/detail/fwd_macros.hpp>
51
- #endif
52
- #include <boost/move/detail/move_helpers.hpp>
53
- // other
54
- #include <boost/assert.hpp>
55
- // std
56
- #include <cstddef>
28
+ #include <boost/container/detail/deque_impl.hpp>
29
+ #include <boost/container/allocator_traits.hpp>
57
30
 
58
31
  #if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
59
32
  #include <initializer_list>
@@ -62,957 +35,6 @@
62
35
  namespace boost {
63
36
  namespace container {
64
37
 
65
- #ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
66
-
67
- template <class T>
68
- struct deque_value_traits
69
- {
70
- typedef T value_type;
71
- BOOST_STATIC_CONSTEXPR bool trivial_dctr = dtl::is_trivially_destructible<value_type>::value;
72
- BOOST_STATIC_CONSTEXPR bool trivial_dctr_after_move = ::boost::has_trivial_destructor_after_move<value_type>::value;
73
- };
74
-
75
- template<class T, std::size_t BlockBytes, std::size_t BlockSize, class StoredSizeType>
76
- struct deque_block_traits
77
- {
78
- BOOST_CONTAINER_STATIC_ASSERT_MSG(!(BlockBytes && BlockSize), "BlockBytes and BlockSize can't be specified at the same time");
79
- //Calculate default block size
80
- BOOST_STATIC_CONSTEXPR std::size_t default_block_bytes = sizeof(void*)*128u;
81
- BOOST_STATIC_CONSTEXPR std::size_t default_block_start = (default_block_bytes - 1u)/sizeof(T) + 1u;
82
- //Round to the next power of two
83
- BOOST_STATIC_CONSTEXPR std::size_t default_block_size_upp_pow2 = dtl::upper_power_of_2_ct<std::size_t, default_block_start>::value;
84
-
85
- //Check minimal size
86
- BOOST_STATIC_CONSTEXPR std::size_t default_min_block_size_pow = 3u;
87
- BOOST_STATIC_CONSTEXPR std::size_t default_min_block_size = 8u;
88
- BOOST_STATIC_CONSTEXPR std::size_t default_block_size_initial = default_block_size_upp_pow2 < default_min_block_size
89
- ? default_min_block_size
90
- : default_block_size_upp_pow2;
91
-
92
- //Limit by stored size max value
93
- BOOST_STATIC_CONSTEXPR std::size_t max_stored_size_block_size = std::size_t(1u) << (sizeof(StoredSizeType)*CHAR_BIT - default_min_block_size_pow);
94
- BOOST_STATIC_CONSTEXPR std::size_t default_block_size = default_block_size_initial > max_stored_size_block_size
95
- ? max_stored_size_block_size
96
- : default_block_size_initial;
97
- //Now select between the default or the specified by the user
98
- BOOST_STATIC_CONSTEXPR std::size_t value = BlockSize ? BlockSize
99
- : BlockBytes ? (BlockBytes-1u)/sizeof(T) + 1u : default_block_size
100
- ;
101
- BOOST_CONTAINER_STATIC_ASSERT_MSG(value <= max_stored_size_block_size, "BlockSize or BlockBytes is too big for the stored_size_type");
102
-
103
- };
104
-
105
- // Class invariants:
106
- // For any nonsingular iterator i:
107
- // i.node is the address of an element in the map array. The
108
- // contents of i.node is a pointer to the beginning of a node.
109
- // i.cur is a pointer in the range [i.first, i.last). NOTE:
110
- // the implication of this is that i.cur is always a dereferenceable
111
- // pointer, even if i is a past-the-end iterator.
112
- // For every node other than start.node and finish.node, every element
113
- // in the node is an initialized object. If start.node == finish.node,
114
- // then [start.cur, finish.cur) are initialized objects, and
115
- // the elements outside that range are uninitialized storage. Otherwise,
116
- // [start.cur, start.last) and [finish.first, finish.cur) are initialized
117
- // objects, and [start.first, start.cur) and [finish.cur, finish.last)
118
- // are uninitialized storage.
119
- // [map, map + map_size) is a valid range.
120
- // [start.node, finish.node] is a valid range contained within
121
- // [map, map + map_size).
122
- // A pointer in the range [map, map + map_size) points to an allocated node
123
- // if and only if the pointer is in the range [start.node, finish.node].
124
- template<class Pointer, bool IsConst, unsigned BlockBytes, unsigned BlockSize, class StoredSizeType>
125
- class deque_iterator
126
- {
127
- public:
128
- typedef std::random_access_iterator_tag iterator_category;
129
- typedef typename boost::intrusive::pointer_traits<Pointer>::element_type value_type;
130
- typedef typename boost::intrusive::pointer_traits<Pointer>::difference_type difference_type;
131
- typedef typename boost::intrusive::pointer_traits<Pointer>::size_type size_type;
132
- typedef typename dtl::if_c
133
- < IsConst
134
- , typename boost::intrusive::pointer_traits<Pointer>::template
135
- rebind_pointer<const value_type>::type
136
- , Pointer
137
- >::type pointer;
138
- typedef typename dtl::if_c
139
- < IsConst
140
- , const value_type&
141
- , value_type&
142
- >::type reference;
143
-
144
- BOOST_CONSTEXPR inline static size_type get_block_size() BOOST_NOEXCEPT_OR_NOTHROW
145
- {
146
- return deque_block_traits<value_type, BlockBytes, BlockSize, StoredSizeType>::value;
147
- }
148
-
149
- BOOST_CONSTEXPR inline static difference_type get_block_ssize() BOOST_NOEXCEPT_OR_NOTHROW
150
- { return difference_type((get_block_size())); }
151
-
152
- typedef Pointer val_alloc_ptr;
153
- typedef typename boost::intrusive::pointer_traits<Pointer>::
154
- template rebind_pointer<Pointer>::type index_pointer;
155
-
156
- class nat
157
- {
158
- public:
159
- inline Pointer get_cur() const { return Pointer(); }
160
- inline index_pointer get_node() const { return index_pointer(); }
161
- };
162
-
163
- typedef typename dtl::if_c< IsConst
164
- , deque_iterator<Pointer, false, BlockBytes, BlockSize, StoredSizeType>
165
- , nat>::type nonconst_iterator_arg;
166
-
167
- typedef deque_iterator<Pointer, false, BlockBytes, BlockSize, StoredSizeType> nonconst_iterator;
168
-
169
- Pointer m_cur;
170
- index_pointer m_node;
171
-
172
- public:
173
-
174
- BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline Pointer get_cur() const { return m_cur; }
175
- BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline index_pointer get_node() const { return m_node; }
176
- BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline Pointer get_first() const { return *m_node; }
177
- BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline Pointer get_last() const { return *m_node + get_block_ssize(); }
178
-
179
- inline deque_iterator(val_alloc_ptr x, index_pointer y) BOOST_NOEXCEPT_OR_NOTHROW
180
- : m_cur(x), m_node(y)
181
- {}
182
-
183
- inline deque_iterator() BOOST_NOEXCEPT_OR_NOTHROW
184
- : m_cur(), m_node() //Value initialization to achieve "null iterators" (N3644)
185
- {}
186
-
187
- inline deque_iterator(const deque_iterator& x) BOOST_NOEXCEPT_OR_NOTHROW
188
- : m_cur(x.get_cur()), m_node(x.get_node())
189
- {}
190
-
191
- inline deque_iterator(const nonconst_iterator_arg& x) BOOST_NOEXCEPT_OR_NOTHROW
192
- : m_cur(x.get_cur()), m_node(x.get_node())
193
- {}
194
-
195
- inline deque_iterator& operator=(const deque_iterator& x) BOOST_NOEXCEPT_OR_NOTHROW
196
- { m_cur = x.get_cur(); m_node = x.get_node(); return *this; }
197
-
198
- inline deque_iterator& operator=(const nonconst_iterator_arg& x) BOOST_NOEXCEPT_OR_NOTHROW
199
- { m_cur = x.get_cur(); m_node = x.get_node(); return *this; }
200
-
201
- inline nonconst_iterator unconst() const BOOST_NOEXCEPT_OR_NOTHROW
202
- {
203
- return nonconst_iterator(this->get_cur(), this->get_node());
204
- }
205
-
206
- inline reference operator*() const BOOST_NOEXCEPT_OR_NOTHROW
207
- { return *this->m_cur; }
208
-
209
- inline pointer operator->() const BOOST_NOEXCEPT_OR_NOTHROW
210
- { return this->m_cur; }
211
-
212
- BOOST_CONTAINER_ATTRIBUTE_NODISCARD difference_type operator-(const deque_iterator& x) const BOOST_NOEXCEPT_OR_NOTHROW
213
- {
214
- if(this->m_cur == x.m_cur){ //Includes when both are null
215
- return 0;
216
- }
217
- BOOST_CONSTEXPR_OR_CONST difference_type block_size = get_block_ssize();
218
- return block_size * (this->m_node - x.m_node) +
219
- (this->m_cur - this->get_first()) - (x.m_cur - x.get_first());
220
- }
221
-
222
- deque_iterator& operator++() BOOST_NOEXCEPT_OR_NOTHROW
223
- {
224
- BOOST_ASSERT(!!m_cur);
225
- ++this->m_cur;
226
- const Pointer last = *m_node + get_block_ssize();
227
- if (BOOST_UNLIKELY(this->m_cur == last)) {
228
- ++this->m_node;
229
- this->m_cur = *this->m_node;
230
- }
231
- return *this;
232
- }
233
-
234
- inline deque_iterator operator++(int) BOOST_NOEXCEPT_OR_NOTHROW
235
- {
236
- deque_iterator tmp(*this);
237
- ++*this;
238
- return tmp;
239
- }
240
-
241
- //Some GCC versions issue bogus warnings about array bounds here
242
- #if defined(BOOST_GCC) && (BOOST_GCC >= 40600)
243
- # pragma GCC diagnostic ignored "-Warray-bounds"
244
- #endif
245
-
246
- deque_iterator& operator--() BOOST_NOEXCEPT_OR_NOTHROW
247
- {
248
- BOOST_ASSERT(!!m_cur);
249
- const Pointer first = *m_node;
250
- if (BOOST_UNLIKELY(this->m_cur == first)) {
251
- --this->m_node;
252
- this->m_cur = *this->m_node;
253
- this->m_cur += get_block_ssize() - 1;
254
- }
255
- else {
256
- --this->m_cur;
257
- }
258
- return *this;
259
- }
260
-
261
- #if defined(BOOST_GCC) && (BOOST_GCC >= 40600)
262
- #pragma GCC diagnostic pop
263
- #endif
264
-
265
- inline deque_iterator operator--(int) BOOST_NOEXCEPT_OR_NOTHROW
266
- {
267
- deque_iterator tmp(*this);
268
- --*this;
269
- return tmp;
270
- }
271
-
272
- deque_iterator& operator+=(difference_type n) BOOST_NOEXCEPT_OR_NOTHROW
273
- {
274
- if (n){
275
- BOOST_CONSTEXPR_OR_CONST difference_type block_size = get_block_ssize();
276
-
277
- const difference_type offset = n + (this->m_cur - *this->m_node);
278
-
279
- if (offset >= 0 && offset < block_size)
280
- this->m_cur += difference_type(n);
281
- else {
282
- const difference_type node_offset =
283
- offset > 0 ? (offset / block_size)
284
- : (-difference_type((-offset - 1) / block_size) - 1);
285
- this->m_node += node_offset;
286
- this->m_cur = *this->m_node + difference_type(offset - node_offset * block_size);
287
- }
288
- }
289
- return *this;
290
- }
291
-
292
- BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline
293
- deque_iterator operator+(difference_type n) const BOOST_NOEXCEPT_OR_NOTHROW
294
- { deque_iterator tmp(*this); return tmp += n; }
295
-
296
- inline
297
- deque_iterator& operator-=(difference_type n) BOOST_NOEXCEPT_OR_NOTHROW
298
- { return *this += -n; }
299
-
300
- BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline
301
- deque_iterator operator-(difference_type n) const BOOST_NOEXCEPT_OR_NOTHROW
302
- { deque_iterator tmp(*this); return tmp -= n; }
303
-
304
- BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline
305
- reference operator[](difference_type n) const BOOST_NOEXCEPT_OR_NOTHROW
306
- {
307
- BOOST_ASSERT(!!m_cur);
308
- BOOST_CONSTEXPR_OR_CONST difference_type block_size = get_block_ssize();
309
-
310
- const difference_type offset = n + (this->m_cur - *this->m_node);
311
-
312
- if (offset >= 0 && offset < block_size)
313
- return this->m_cur[difference_type(n)];
314
- else {
315
- const difference_type node_offset = offset > 0
316
- ? (offset / block_size)
317
- : (-difference_type((-offset - 1) / block_size) - 1);
318
- return (this->m_node[node_offset]) [offset - node_offset * block_size];
319
- }
320
- }
321
-
322
- //Comparisons
323
- BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline
324
- friend bool operator==(const deque_iterator& l, const deque_iterator& r) BOOST_NOEXCEPT_OR_NOTHROW
325
- { return l.m_cur == r.m_cur; }
326
-
327
- BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline
328
- friend bool operator!=(const deque_iterator& l, const deque_iterator& r) BOOST_NOEXCEPT_OR_NOTHROW
329
- { return l.m_cur != r.m_cur; }
330
-
331
- BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline
332
- friend bool operator<(const deque_iterator& l, const deque_iterator& r) BOOST_NOEXCEPT_OR_NOTHROW
333
- { return (l.m_node == r.m_node) ? (l.m_cur < r.m_cur) : (l.m_node < r.m_node); }
334
-
335
- BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline
336
- friend bool operator>(const deque_iterator& l, const deque_iterator& r) BOOST_NOEXCEPT_OR_NOTHROW
337
- { return r < l; }
338
-
339
- BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline
340
- friend bool operator<=(const deque_iterator& l, const deque_iterator& r) BOOST_NOEXCEPT_OR_NOTHROW
341
- { return !(r < l); }
342
-
343
- BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline
344
- friend bool operator>=(const deque_iterator& l, const deque_iterator& r) BOOST_NOEXCEPT_OR_NOTHROW
345
- { return !(l < r); }
346
-
347
- BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline
348
- friend deque_iterator operator+(difference_type n, deque_iterator x) BOOST_NOEXCEPT_OR_NOTHROW
349
- { return x += n; }
350
-
351
- inline void priv_set_node(index_pointer new_node) BOOST_NOEXCEPT_OR_NOTHROW
352
- { this->m_node = new_node; }
353
- };
354
-
355
-
356
- template<class Options, class AllocatorSizeType>
357
- struct get_deque_opt
358
- {
359
- typedef deque_opt< Options::block_bytes, Options::block_size
360
- , typename default_if_void<typename Options::stored_size_type, AllocatorSizeType>::type
361
- , Options::reservable> type;
362
- };
363
-
364
- template<class AllocatorSizeType>
365
- struct get_deque_opt<void, AllocatorSizeType>
366
- {
367
- typedef deque_opt<deque_null_opt::block_bytes, deque_null_opt::block_size, AllocatorSizeType, deque_null_opt::reservable> type;
368
- };
369
-
370
-
371
- // Deque base class. It has two purposes. First, its constructor
372
- // and destructor allocate (but don't initialize) storage. This makes
373
- // exception safety easier.
374
- template <class Allocator, class Options>
375
- class deque_base
376
- {
377
- BOOST_COPYABLE_AND_MOVABLE(deque_base)
378
- public:
379
- typedef allocator_traits<Allocator> val_alloc_traits_type;
380
- typedef typename val_alloc_traits_type::value_type val_alloc_val;
381
- typedef typename val_alloc_traits_type::pointer val_alloc_ptr;
382
- typedef typename val_alloc_traits_type::const_pointer val_alloc_cptr;
383
- typedef typename val_alloc_traits_type::reference val_alloc_ref;
384
- typedef typename val_alloc_traits_type::const_reference val_alloc_cref;
385
- typedef typename val_alloc_traits_type::difference_type val_alloc_diff;
386
- typedef typename val_alloc_traits_type::size_type val_alloc_size;
387
- typedef typename val_alloc_traits_type::template
388
- portable_rebind_alloc<val_alloc_ptr>::type ptr_alloc_t;
389
- typedef allocator_traits<ptr_alloc_t> ptr_alloc_traits_type;
390
- typedef typename ptr_alloc_traits_type::value_type ptr_alloc_val;
391
- typedef typename ptr_alloc_traits_type::pointer ptr_alloc_ptr;
392
- typedef typename ptr_alloc_traits_type::const_pointer ptr_alloc_cptr;
393
- typedef typename ptr_alloc_traits_type::reference ptr_alloc_ref;
394
- typedef typename ptr_alloc_traits_type::const_reference ptr_alloc_cref;
395
- typedef Allocator allocator_type;
396
- typedef allocator_type stored_allocator_type;
397
- typedef val_alloc_size size_type;
398
- typedef val_alloc_diff difference_type;
399
-
400
- private:
401
- typedef typename get_deque_opt<Options, val_alloc_size>::type options_type;
402
-
403
- protected:
404
- typedef typename options_type::stored_size_type stored_size_type;
405
- typedef deque_iterator< val_alloc_ptr, false
406
- , options_type::block_bytes
407
- , options_type::block_size
408
- , stored_size_type> iterator;
409
- typedef deque_iterator< val_alloc_ptr, true
410
- , options_type::block_bytes
411
- , options_type::block_size
412
- , stored_size_type> const_iterator;
413
-
414
- static const bool is_reservable = options_type::reservable;
415
-
416
- BOOST_CONSTEXPR inline static val_alloc_diff get_block_ssize() BOOST_NOEXCEPT_OR_NOTHROW
417
- { return val_alloc_diff((get_block_size())); }
418
-
419
- BOOST_CONSTEXPR inline static size_type get_block_size() BOOST_NOEXCEPT_OR_NOTHROW
420
- { return deque_block_traits<val_alloc_val, options_type::block_bytes, options_type::block_size, stored_size_type>::value; }
421
-
422
- typedef deque_value_traits<val_alloc_val> traits_t;
423
- typedef ptr_alloc_t map_allocator_type;
424
-
425
- inline val_alloc_ptr prot_allocate_node()
426
- {
427
- return this->alloc().allocate(get_block_size());
428
- }
429
-
430
- inline void prot_deallocate_node(val_alloc_ptr p) BOOST_NOEXCEPT_OR_NOTHROW
431
- {
432
- this->alloc().deallocate(p, get_block_size());
433
- }
434
-
435
- inline ptr_alloc_ptr prot_allocate_map(size_type n)
436
- {
437
- return this->ptr_alloc().allocate(n);
438
- }
439
-
440
- inline void prot_deallocate_map(ptr_alloc_ptr p, size_type n) BOOST_NOEXCEPT_OR_NOTHROW
441
- {
442
- this->ptr_alloc().deallocate(p, n);
443
- }
444
-
445
- inline deque_base(size_type num_elements, const allocator_type& a)
446
- : members_(a)
447
- { this->prot_initialize_map_and_nodes(num_elements); }
448
-
449
- inline explicit deque_base(const allocator_type& a)
450
- : members_(a)
451
- {}
452
-
453
- inline deque_base()
454
- : members_()
455
- {}
456
-
457
- inline explicit deque_base(BOOST_RV_REF(deque_base) x)
458
- : members_( boost::move(x.ptr_alloc())
459
- , boost::move(x.alloc()) )
460
- {}
461
-
462
- ~deque_base()
463
- {
464
- if (this->members_.m_map) {
465
- this->prot_deallocate_all_nodes();
466
- this->prot_deallocate_map(this->members_.m_map, this->members_.m_map_size);
467
- }
468
- }
469
-
470
- private:
471
- deque_base(const deque_base&);
472
-
473
- protected:
474
-
475
- void swap_members(deque_base &x) BOOST_NOEXCEPT_OR_NOTHROW
476
- {
477
- this->members_.swap(x.members_);
478
- }
479
-
480
- void test_size_against_max(size_type n)
481
- {
482
- const size_type max_alloc = val_alloc_traits_type::max_size(this->alloc());
483
- const size_type max = max_alloc <= stored_size_type(-1) ? max_alloc : stored_size_type(-1);
484
- if (BOOST_UNLIKELY(max < n) )
485
- boost::container::throw_length_error("get_next_capacity, allocator's max size reached");
486
- }
487
-
488
- void test_size_against_n_nodes(size_type n_nodes)
489
- {
490
- test_size_against_max(size_type(size_type(n_nodes * get_block_size()) - 1u));
491
- }
492
-
493
- void prot_initialize_map_and_nodes(size_type num_elements)
494
- {
495
- BOOST_CONSTEXPR_OR_CONST size_type block_size = get_block_size();
496
- //Even a zero element initialized map+nodes needs at least 1 node (for sentinel finish position)
497
- size_type num_nodes = size_type(num_elements / block_size + 1u);
498
-
499
- //Allocate at least one extra slot on each end to avoid inmediate map reallocation on push/front insertions
500
- const size_type map_size = dtl::max_value(size_type(InitialMapSize), size_type(num_nodes + 2u));
501
- const size_type start_map_pos = size_type(map_size - num_nodes)/2u;
502
-
503
- //The end position must be representable in stored_size_type
504
- this->test_size_against_n_nodes(map_size);
505
-
506
- this->members_.m_map = this->prot_allocate_map(map_size);
507
- this->members_.m_map_size = static_cast<stored_size_type>(map_size);
508
-
509
-
510
- BOOST_CONTAINER_TRY {
511
- BOOST_IF_CONSTEXPR(is_reservable){ //reservable implies all slots are allocated with nodes
512
- this->prot_allocate_nodes(this->members_.m_map, map_size);
513
- }
514
- else{ //Otherwise only create the nodes that will hold values
515
- this->prot_allocate_nodes(this->members_.m_map + difference_type(start_map_pos), num_nodes);
516
- }
517
- }
518
- BOOST_CONTAINER_CATCH(...){
519
- this->prot_deallocate_map(this->members_.m_map, this->members_.m_map_size);
520
- this->members_.m_map = ptr_alloc_ptr();
521
- this->members_.m_map_size = 0;
522
- BOOST_CONTAINER_RETHROW
523
- }
524
- BOOST_CONTAINER_CATCH_END
525
-
526
- this->prot_set_start_finish_from_node(start_map_pos, num_elements);
527
- }
528
-
529
- static size_type priv_new_offset(bool add_at_front, size_type map_size, size_type active_nodes, size_type additional_nodes)
530
- {
531
- return size_type(size_type(map_size - active_nodes) / 2 + (add_at_front ? +additional_nodes : +0));
532
- }
533
-
534
- void prot_reallocate_map_and_nodes //is_reservable == true
535
- (dtl::bool_<true>, const size_type new_elems, const bool add_at_front)
536
- {
537
- const ptr_alloc_ptr start_node = this->prot_start_node();
538
- const size_type old_active_nodes = size_type(this->prot_finish_node() + 1u - start_node);
539
-
540
- const size_type additional_nodes = size_type((new_elems - 1u)/get_block_size() + 1u);
541
- const size_type new_active_nodes = size_type(old_active_nodes + additional_nodes);
542
-
543
- ptr_alloc_ptr new_nstart;
544
- const size_type old_map_size = this->members_.m_map_size;
545
- const ptr_alloc_ptr old_map = this->members_.m_map;
546
-
547
- //Check for 1.5 factor
548
- if (old_map_size/3u >= new_active_nodes/2u) {
549
- new_nstart = old_map + difference_type(priv_new_offset(add_at_front, old_map_size, new_active_nodes, additional_nodes));
550
- const ptr_alloc_ptr end_node = start_node + difference_type(old_active_nodes);
551
- if (new_nstart < start_node)
552
- boost::movelib::rotate_gcd(new_nstart, start_node, end_node);
553
- else
554
- boost::movelib::rotate_gcd(start_node, end_node, new_nstart + old_active_nodes);
555
- }
556
- else {
557
- //1.5 increase, but at least one spare slot on each end
558
- const size_type new_map_size = dtl::max_value(size_type(old_map_size + old_map_size/2u), size_type(new_active_nodes + 2u));
559
-
560
- //The end position must be representable in stored_size_type
561
- this->test_size_against_n_nodes(new_map_size);
562
-
563
- const ptr_alloc_ptr new_map = this->prot_allocate_map(new_map_size);
564
- const size_type new_active_off = priv_new_offset(add_at_front, new_map_size, new_active_nodes, additional_nodes);
565
- new_nstart = new_map + difference_type(new_active_off);
566
-
567
- const size_type new_nodes = size_type(new_map_size - old_map_size);
568
-
569
- BOOST_CONTAINER_TRY {
570
- this->prot_allocate_nodes(new_map, new_nodes);
571
- }
572
- BOOST_CONTAINER_CATCH(...){
573
- this->prot_deallocate_map(new_map, new_map_size);
574
- BOOST_CONTAINER_RETHROW
575
- }
576
- BOOST_CONTAINER_CATCH_END
577
-
578
- const ptr_alloc_ptr new_old_node_limit = new_map + difference_type(new_nodes);
579
-
580
- //Move old nodes from the old map, rotate to the right position and deallocate the old map
581
- boost::container::move_n(old_map, old_map_size, new_old_node_limit);
582
-
583
- const size_type old_active_off = size_type(start_node - old_map);
584
- const ptr_alloc_ptr active_start = new_old_node_limit + difference_type(old_active_off);
585
- const ptr_alloc_ptr active_end = active_start + difference_type(old_active_nodes);
586
- if (new_nstart < active_start)
587
- boost::movelib::rotate_gcd(new_nstart, active_start, active_end);
588
- else
589
- boost::movelib::rotate_gcd(active_start, active_end, new_nstart + difference_type(old_active_nodes));
590
-
591
- this->prot_deallocate_map(old_map, old_map_size);
592
-
593
- this->members_.m_map = new_map;
594
- this->members_.m_map_size = static_cast<stored_size_type>(new_map_size);
595
- }
596
-
597
- this->prot_start_update_node(new_nstart);
598
- this->prot_finish_update_node(new_nstart + difference_type(old_active_nodes - 1u));
599
- }
600
-
601
- void prot_reallocate_map_and_nodes //is_reservable == false
602
- (dtl::bool_<false>, const size_type new_elems, const bool add_at_front)
603
- {
604
- const size_type additional_nodes = size_type((new_elems - 1u)/get_block_size() + 1u);
605
-
606
- const ptr_alloc_ptr start_node = this->prot_start_node();
607
- const ptr_alloc_ptr finish_node = this->prot_finish_node();
608
-
609
- size_type unused_slots = add_at_front ? size_type(start_node - this->members_.m_map)
610
- : size_type(this->members_.m_map_size - 1u - size_type(finish_node - this->members_.m_map));
611
- if (additional_nodes > unused_slots){
612
- const ptr_alloc_ptr next_finish_node = finish_node + 1u;
613
- const size_type old_active_nodes = size_type(next_finish_node - start_node);
614
- const size_type new_active_nodes = size_type(old_active_nodes + additional_nodes);
615
-
616
- ptr_alloc_ptr new_nstart;
617
- const size_type old_map_size = this->members_.m_map_size;
618
- const ptr_alloc_ptr old_map = this->members_.m_map;
619
-
620
- if (old_map_size/2u >= new_active_nodes) {
621
- new_nstart = old_map + difference_type(priv_new_offset(add_at_front, old_map_size, new_active_nodes, additional_nodes));
622
- if (new_nstart < start_node)
623
- boost::container::move_n(start_node, old_active_nodes, new_nstart);
624
- else
625
- boost::container::move_backward_n(next_finish_node, old_active_nodes, new_nstart + difference_type(old_active_nodes));
626
- }
627
- else {
628
- //Doubling size, but at least one spare slot on each end
629
- const size_type new_map_size = dtl::max_value(size_type(old_map_size*2), size_type(new_active_nodes + 2u));
630
-
631
- //The end position must be representable in stored_size_type
632
- this->test_size_against_n_nodes(new_map_size);
633
-
634
- const ptr_alloc_ptr new_map = this->prot_allocate_map(new_map_size);
635
-
636
- new_nstart = new_map + difference_type(priv_new_offset(add_at_front, new_map_size, new_active_nodes, additional_nodes));
637
- boost::container::move_n(start_node, old_active_nodes, new_nstart);
638
-
639
- this->prot_deallocate_map(old_map, old_map_size);
640
-
641
- this->members_.m_map = new_map;
642
- this->members_.m_map_size = static_cast<stored_size_type>(new_map_size);
643
- }
644
-
645
- this->prot_start_update_node(new_nstart);
646
- this->prot_finish_update_node(new_nstart + difference_type(old_active_nodes - 1u));
647
- }
648
-
649
- if(add_at_front)
650
- this->prot_allocate_nodes(this->prot_start_node() - difference_type(additional_nodes), additional_nodes);
651
- else
652
- this->prot_allocate_nodes(this->prot_finish_node() + 1, additional_nodes);
653
- }
654
-
655
- void prot_allocate_nodes(ptr_alloc_ptr start, size_type n)
656
- {
657
- size_type i = 0;
658
- BOOST_CONTAINER_TRY {
659
- for (; i < n; ++i)
660
- start[difference_type(i)] = this->prot_allocate_node();
661
- }
662
- BOOST_CONTAINER_CATCH(...) {
663
- for (size_type j = 0; j < i; ++j)
664
- this->prot_deallocate_node(start[difference_type(j)]);
665
- BOOST_CONTAINER_RETHROW
666
- }
667
- BOOST_CONTAINER_CATCH_END
668
- }
669
-
670
-
671
- void prot_deallocate_nodes(ptr_alloc_ptr nstart, ptr_alloc_ptr nfinish) BOOST_NOEXCEPT_OR_NOTHROW
672
- {
673
- for (ptr_alloc_ptr n = nstart; n < nfinish; ++n){
674
- this->prot_deallocate_node(*n);
675
- }
676
- }
677
-
678
- void prot_deallocate_nodes_if_not_reservable(ptr_alloc_ptr nstart, ptr_alloc_ptr nfinish) BOOST_NOEXCEPT_OR_NOTHROW
679
- {
680
- (void)nstart; (void)nfinish;
681
- BOOST_IF_CONSTEXPR(!is_reservable)
682
- this->prot_deallocate_nodes(nstart, nfinish);
683
- }
684
-
685
- void prot_deallocate_node_if_not_reservable(val_alloc_ptr p) BOOST_NOEXCEPT_OR_NOTHROW
686
- {
687
- (void)p;
688
- BOOST_IF_CONSTEXPR(!is_reservable)
689
- this->prot_deallocate_node(p);
690
- }
691
-
692
- void prot_deallocate_all_nodes()
693
- {
694
- BOOST_IF_CONSTEXPR(is_reservable)
695
- this->prot_deallocate_nodes(this->members_.m_map, this->members_.m_map + difference_type(this->members_.m_map_size));
696
- else
697
- this->prot_deallocate_nodes(this->prot_start_node(), this->prot_finish_node() + 1);
698
- }
699
-
700
-
701
- void prot_clear_map() BOOST_NOEXCEPT_OR_NOTHROW
702
- {
703
- if (this->members_.m_map) {
704
- this->prot_deallocate_all_nodes();
705
- this->prot_deallocate_map(this->members_.m_map, this->members_.m_map_size);
706
- this->members_.m_map = ptr_alloc_ptr();
707
- this->members_.m_map_size = 0u;
708
- this->members_.m_start_off = 0u;
709
- this->members_.m_finish_off = 0u;
710
- }
711
- }
712
-
713
- enum { InitialMapSize = 4 };
714
-
715
- protected:
716
- struct members_holder
717
- : public ptr_alloc_t
718
- , public allocator_type
719
- {
720
- friend class deque_base;
721
- members_holder()
722
- : map_allocator_type(), allocator_type()
723
- , m_map(), m_map_size()
724
- , m_start_off(), m_finish_off()
725
- {}
726
-
727
- explicit members_holder(const allocator_type &a)
728
- : map_allocator_type(a), allocator_type(a)
729
- , m_map(), m_map_size()
730
- , m_start_off(), m_finish_off()
731
- {}
732
-
733
- template<class ValAllocConvertible, class PtrAllocConvertible>
734
- members_holder(BOOST_FWD_REF(PtrAllocConvertible) pa, BOOST_FWD_REF(ValAllocConvertible) va)
735
- : map_allocator_type(boost::forward<PtrAllocConvertible>(pa))
736
- , allocator_type (boost::forward<ValAllocConvertible>(va))
737
- , m_map(), m_map_size()
738
- , m_start_off(), m_finish_off()
739
- {}
740
-
741
- void swap(members_holder &x) BOOST_NOEXCEPT_OR_NOTHROW
742
- {
743
- ::boost::adl_move_swap(this->m_map, x.m_map);
744
- ::boost::adl_move_swap(this->m_map_size, x.m_map_size);
745
- ::boost::adl_move_swap(this->m_start_off, x.m_start_off);
746
- ::boost::adl_move_swap(this->m_finish_off, x.m_finish_off);
747
- }
748
-
749
- ptr_alloc_ptr m_map;
750
- stored_size_type m_map_size;
751
- private:
752
- stored_size_type m_start_off;
753
- stored_size_type m_finish_off;
754
- } members_;
755
-
756
- inline ptr_alloc_t &ptr_alloc() BOOST_NOEXCEPT_OR_NOTHROW
757
- { return members_; }
758
-
759
- inline const ptr_alloc_t &ptr_alloc() const BOOST_NOEXCEPT_OR_NOTHROW
760
- { return members_; }
761
-
762
- inline allocator_type &alloc() BOOST_NOEXCEPT_OR_NOTHROW
763
- { return members_; }
764
-
765
- inline const allocator_type &alloc() const BOOST_NOEXCEPT_OR_NOTHROW
766
- { return members_; }
767
-
768
- static BOOST_CONTAINER_FORCEINLINE val_alloc_ptr prot_node_last(ptr_alloc_ptr idx)
769
- {
770
- BOOST_CONSTEXPR_OR_CONST std::size_t block_size = deque_base::get_block_size();
771
- return *idx + difference_type(block_size - 1u);
772
- }
773
-
774
- BOOST_CONTAINER_FORCEINLINE size_type prot_front_free_capacity() const
775
- {
776
- BOOST_IF_CONSTEXPR(is_reservable){
777
- return static_cast<size_type>(this->members_.m_start_off);
778
- }
779
- else{
780
- BOOST_CONSTEXPR_OR_CONST std::size_t block_size = deque_base::get_block_size();
781
- return static_cast<size_type>(this->members_.m_start_off % block_size);
782
- }
783
- }
784
-
785
- BOOST_CONTAINER_FORCEINLINE size_type prot_back_free_capacity() const
786
- {
787
- BOOST_CONSTEXPR_OR_CONST std::size_t block_size = deque_base::get_block_size();
788
-
789
- BOOST_IF_CONSTEXPR(is_reservable){
790
- return static_cast<size_type>
791
- (size_type(this->members_.m_map_size*block_size) - size_type(this->members_.m_map != ptr_alloc_ptr()) - this->members_.m_finish_off);
792
- }
793
- else {
794
- //m_finish_off points to positions [0....block_size-1], and one position is always needed as the sentinel node resulting [block_size-1....0] capacity
795
- return static_cast<size_type>(this->members_.m_map ? (block_size - 1u) - (this->members_.m_finish_off % block_size) : 0u);
796
- }
797
- }
798
-
799
- //////////////////////////
800
- // it_to_off / off_to_it
801
- //////////////////////////
802
-
803
- BOOST_CONTAINER_FORCEINLINE stored_size_type prot_it_to_off(const_iterator it) const
804
- {
805
- const ptr_alloc_ptr n = it.get_node();
806
- BOOST_ASSERT(!this->members_.m_map == !n); //Both should be null or both non-null
807
- if (n) {
808
- BOOST_CONSTEXPR_OR_CONST std::size_t block_size = deque_base::get_block_size();
809
- return static_cast<stored_size_type>(std::size_t(n - this->members_.m_map)*block_size + std::size_t(it.get_cur() - *n));
810
- }
811
- else{
812
- return 0;
813
- }
814
- }
815
-
816
- BOOST_CONTAINER_FORCEINLINE iterator prot_off_to_it(std::size_t off) const
817
- {
818
- BOOST_CONSTEXPR_OR_CONST std::size_t block_size = deque_base::get_block_size();
819
- const ptr_alloc_ptr node = this->members_.m_map + difference_type(off/block_size);
820
- return iterator(node ? *node + difference_type(off%block_size) : val_alloc_ptr(), node);
821
- }
822
-
823
- stored_size_type prot_it_to_start_off(const_iterator it) const
824
- {
825
- const size_type off = this->prot_it_to_off(it);
826
- BOOST_ASSERT(off >= this->members_.m_start_off);
827
- return static_cast<stored_size_type>(off - this->members_.m_start_off);
828
- }
829
-
830
- /////////////
831
- // xxx_to_node
832
- /////////////
833
-
834
- BOOST_CONTAINER_FORCEINLINE ptr_alloc_ptr prot_off_to_node(std::size_t off) const
835
- {
836
- BOOST_CONSTEXPR_OR_CONST std::size_t block_size = deque_base::get_block_size();
837
- return this->members_.m_map + difference_type(off/block_size);
838
- }
839
-
840
- BOOST_CONTAINER_FORCEINLINE ptr_alloc_ptr prot_start_node() const
841
- {
842
- return this->prot_off_to_node(this->members_.m_start_off);
843
- }
844
-
845
- BOOST_CONTAINER_FORCEINLINE ptr_alloc_ptr prot_finish_node() const
846
- {
847
- return this->prot_off_to_node(this->members_.m_finish_off);
848
- }
849
-
850
- //
851
- // xxx_to_cur_unchecked versions, faster but need non-default constructed deque
852
- //
853
- BOOST_CONTAINER_FORCEINLINE val_alloc_ptr prot_off_to_cur_unchecked(std::size_t off) const
854
- {
855
- BOOST_ASSERT(!!this->members_.m_map);
856
- BOOST_CONSTEXPR_OR_CONST std::size_t block_size = deque_base::get_block_size();
857
- const ptr_alloc_ptr node = this->members_.m_map + difference_type(off/block_size);
858
- return *node + difference_type(off%block_size);
859
- }
860
-
861
- BOOST_CONTAINER_FORCEINLINE val_alloc_ptr prot_start_cur_unchecked() const
862
- {
863
- return this->prot_off_to_cur_unchecked(this->members_.m_start_off);
864
- }
865
-
866
- BOOST_CONTAINER_FORCEINLINE val_alloc_ptr prot_finish_cur_unchecked() const
867
- {
868
- return this->prot_off_to_cur_unchecked(this->members_.m_finish_off);
869
- }
870
-
871
- BOOST_CONTAINER_FORCEINLINE val_alloc_ptr prot_last_cur_unchecked() const
872
- {
873
- BOOST_ASSERT(members_.m_start_off != members_.m_finish_off);
874
- return this->prot_off_to_cur_unchecked(this->members_.m_finish_off-1u);
875
- }
876
-
877
- //
878
- // functions returning iterators to different positions
879
- //
880
- BOOST_CONTAINER_FORCEINLINE const_iterator prot_start() const
881
- { return this->prot_off_to_it(members_.m_start_off); }
882
-
883
- BOOST_CONTAINER_FORCEINLINE iterator prot_start()
884
- { return this->prot_off_to_it(members_.m_start_off); }
885
-
886
- BOOST_CONTAINER_FORCEINLINE const_iterator prot_finish() const
887
- { return this->prot_off_to_it(members_.m_finish_off); }
888
-
889
- BOOST_CONTAINER_FORCEINLINE iterator prot_finish()
890
- { return this->prot_off_to_it(members_.m_finish_off); }
891
-
892
- BOOST_CONTAINER_FORCEINLINE const_iterator prot_nth(size_type n) const
893
- { return this->prot_off_to_it(size_type(members_.m_start_off + n)); }
894
-
895
- BOOST_CONTAINER_FORCEINLINE iterator prot_nth(size_type n)
896
- { return this->prot_off_to_it(size_type(members_.m_start_off + n)); }
897
-
898
- BOOST_CONTAINER_FORCEINLINE iterator prot_back_it()
899
- {
900
- BOOST_ASSERT(members_.m_start_off != members_.m_finish_off);
901
- return this->prot_off_to_it(size_type(members_.m_finish_off - 1u));
902
- }
903
-
904
- //
905
- // size/empty
906
- //
907
- BOOST_CONTAINER_FORCEINLINE size_type prot_size() const
908
- { return size_type(this->members_.m_finish_off - this->members_.m_start_off); }
909
-
910
- BOOST_CONTAINER_FORCEINLINE bool prot_empty() const
911
- { return this->members_.m_finish_off == this->members_.m_start_off; }
912
-
913
- //
914
- // Functions to move start/finish indexes
915
- //
916
- BOOST_CONTAINER_FORCEINLINE void prot_inc_start()
917
- { ++this->members_.m_start_off; }
918
-
919
- BOOST_CONTAINER_FORCEINLINE void prot_dec_start()
920
- { --this->members_.m_start_off; }
921
-
922
- BOOST_CONTAINER_FORCEINLINE void prot_inc_finish()
923
- { ++this->members_.m_finish_off; }
924
-
925
- BOOST_CONTAINER_FORCEINLINE void prot_dec_finish()
926
- { --this->members_.m_finish_off; }
927
-
928
- BOOST_CONTAINER_FORCEINLINE void prot_dec_finish(std::size_t n)
929
- { this->members_.m_finish_off = static_cast<stored_size_type>(this->members_.m_finish_off - n); }
930
-
931
- BOOST_CONTAINER_FORCEINLINE void prot_inc_finish(std::size_t n)
932
- { this->members_.m_finish_off = static_cast<stored_size_type>(this->members_.m_finish_off + n); }
933
-
934
- BOOST_CONTAINER_FORCEINLINE void prot_dec_start(std::size_t n)
935
- { this->members_.m_start_off = static_cast<stored_size_type>(this->members_.m_start_off - n); }
936
-
937
- BOOST_CONTAINER_FORCEINLINE void prot_inc_start(std::size_t n)
938
- { this->members_.m_start_off = static_cast<stored_size_type>(this->members_.m_start_off + n); }
939
-
940
- //
941
- // Functions to obtain indexes from nodes
942
- //
943
- BOOST_CONTAINER_FORCEINLINE stored_size_type prot_non_null_node_to_off(ptr_alloc_ptr n) const
944
- {
945
- BOOST_CONSTEXPR_OR_CONST std::size_t block_size = deque_base::get_block_size();
946
- return static_cast<stored_size_type>(std::size_t(n - this->members_.m_map)*block_size);
947
- }
948
-
949
- void prot_set_start_finish_from_node(size_type node_idx, size_type n_elements)
950
- {
951
- BOOST_CONSTEXPR_OR_CONST std::size_t block_size = deque_base::get_block_size();
952
- this->members_.m_start_off = static_cast<stored_size_type>(node_idx*block_size);
953
- this->members_.m_finish_off = static_cast<stored_size_type>(this->members_.m_start_off + n_elements);
954
- }
955
-
956
- inline void prot_start_update_node(ptr_alloc_ptr new_start)
957
- {
958
- //iG: to-do: optimizable avoiding some division/remainder
959
- std::size_t new_block_off = prot_non_null_node_to_off(new_start);
960
- this->members_.m_start_off = static_cast<stored_size_type>(new_block_off + (this->members_.m_start_off % get_block_size()));
961
- }
962
-
963
- inline void prot_finish_update_node(ptr_alloc_ptr new_finish)
964
- {
965
- //iG: to-do: optimizable avoiding some division/remainder
966
- std::size_t new_block_off = prot_non_null_node_to_off(new_finish);
967
- this->members_.m_finish_off = static_cast<stored_size_type>(new_block_off + (this->members_.m_finish_off % get_block_size()));
968
- }
969
-
970
- inline void prot_reset_finish_to_start()
971
- { this->members_.m_finish_off = this->members_.m_start_off; }
972
-
973
- inline void prot_reset_start_to_finish()
974
- { this->members_.m_start_off = this->members_.m_finish_off; }
975
-
976
- inline val_alloc_val *prot_push_back_simple_pos() const
977
- {
978
- BOOST_CONSTEXPR_OR_CONST std::size_t block_size = deque_base::get_block_size();
979
- const std::size_t last_in_block = block_size - 1u;
980
- const ptr_alloc_val *const map = boost::movelib::to_raw_pointer(this->members_.m_map);
981
- if(BOOST_LIKELY(map != 0)) {
982
- const std::size_t off = this->members_.m_finish_off;
983
- const std::size_t rem = off % block_size;
984
- if(BOOST_LIKELY(rem != last_in_block)){
985
- return boost::movelib::to_raw_pointer(map[difference_type(off/block_size)]) + difference_type(rem);
986
- }
987
- }
988
- return 0;
989
- }
990
-
991
- inline val_alloc_val *prot_push_front_simple_pos() const
992
- {
993
- BOOST_CONSTEXPR_OR_CONST std::size_t block_size = deque_base::get_block_size();
994
- //No need to check !m_map, as m_start_off is zero in that case
995
- const std::size_t off = this->members_.m_start_off;
996
- const std::size_t rem = off % block_size;
997
- if(BOOST_LIKELY(rem != 0u)){
998
- return boost::movelib::to_raw_pointer(this->members_.m_map[difference_type(off/block_size)]) + difference_type(rem-1u);
999
- }
1000
- return 0;
1001
- }
1002
-
1003
- BOOST_CONTAINER_FORCEINLINE bool prot_pop_back_simple_available() const
1004
- {
1005
- return (this->members_.m_finish_off % get_block_size()) != 0u;
1006
- }
1007
-
1008
- BOOST_CONTAINER_FORCEINLINE bool prot_pop_front_simple_available() const
1009
- {
1010
- return size_type(this->members_.m_start_off % get_block_size()) != size_type(get_block_size() - 1u);
1011
- }
1012
-
1013
- };
1014
- #endif //#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
1015
-
1016
38
  #ifdef BOOST_CONTAINER_DOXYGEN_INVOKED
1017
39
  //! A double-ended queue is a sequence that supports random access to elements, constant time insertion
1018
40
  //! and removal of elements at the end of the sequence, and linear time insertion and removal of elements in the middle.
@@ -1025,14 +47,13 @@ template <class T, class Allocator = void, class Options = void>
1025
47
  #else
1026
48
  template <class T, class Allocator, class Options>
1027
49
  #endif
1028
- class deque : protected deque_base<typename real_allocator<T, Allocator>::type, Options>
50
+ class deque : public deque_impl<T, Allocator, false, Options>
1029
51
  {
1030
52
  #ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
53
+ BOOST_COPYABLE_AND_MOVABLE(deque)
1031
54
  private:
1032
- typedef deque_base<typename real_allocator<T, Allocator>::type, Options> Base;
55
+ typedef deque_impl<T, Allocator, false, Options> base_type;
1033
56
  #endif //#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
1034
- typedef typename real_allocator<T, Allocator>::type ValAllocator;
1035
- typedef constant_iterator<T> c_it;
1036
57
 
1037
58
  public:
1038
59
 
@@ -1043,42 +64,26 @@ class deque : protected deque_base<typename real_allocator<T, Allocator>::type,
1043
64
  //////////////////////////////////////////////
1044
65
 
1045
66
  typedef T value_type;
1046
- typedef ValAllocator allocator_type;
1047
- typedef typename ::boost::container::allocator_traits<ValAllocator>::pointer pointer;
1048
- typedef typename ::boost::container::allocator_traits<ValAllocator>::const_pointer const_pointer;
1049
- typedef typename ::boost::container::allocator_traits<ValAllocator>::reference reference;
1050
- typedef typename ::boost::container::allocator_traits<ValAllocator>::const_reference const_reference;
1051
- typedef typename ::boost::container::allocator_traits<ValAllocator>::size_type size_type;
1052
- typedef typename ::boost::container::allocator_traits<ValAllocator>::difference_type difference_type;
1053
- typedef BOOST_CONTAINER_IMPDEF(allocator_type) stored_allocator_type;
1054
- typedef BOOST_CONTAINER_IMPDEF(typename Base::iterator) iterator;
1055
- typedef BOOST_CONTAINER_IMPDEF(typename Base::const_iterator) const_iterator;
1056
- typedef BOOST_CONTAINER_IMPDEF(boost::container::reverse_iterator<iterator>) reverse_iterator;
1057
- typedef BOOST_CONTAINER_IMPDEF(boost::container::reverse_iterator<const_iterator>) const_reverse_iterator;
67
+ typedef typename base_type::allocator_type allocator_type;
68
+ typedef typename base_type::pointer pointer;
69
+ typedef typename base_type::const_pointer const_pointer;
70
+ typedef typename base_type::reference reference;
71
+ typedef typename base_type::const_reference const_reference;
72
+ typedef typename base_type::size_type size_type;
73
+ typedef typename base_type::difference_type difference_type;
74
+ typedef typename base_type::stored_allocator_type stored_allocator_type;
75
+ typedef typename base_type::iterator iterator;
76
+ typedef typename base_type::const_iterator const_iterator;
77
+ typedef typename base_type::reverse_iterator reverse_iterator;
78
+ typedef typename base_type::const_reverse_iterator const_reverse_iterator;
1058
79
 
1059
80
  #ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
1060
81
 
1061
- private: // Internal typedefs
1062
-
1063
- //`allocator_type::value_type` must match container's `value type`. If this
1064
- //assertion fails, please review your allocator definition.
1065
- BOOST_CONTAINER_STATIC_ASSERT((dtl::is_same<value_type, typename allocator_traits<ValAllocator>::value_type>::value));
1066
-
1067
- BOOST_COPYABLE_AND_MOVABLE(deque)
1068
- typedef typename Base::ptr_alloc_ptr index_pointer;
1069
- typedef allocator_traits<ValAllocator> allocator_traits_type;
1070
- typedef typename Base::stored_size_type stored_size_type;
1071
-
82
+ using base_type::get_block_size;
83
+ using base_type::get_segment_size;
84
+ using base_type::is_reservable;
1072
85
  #endif //#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
1073
86
 
1074
- using Base::get_block_ssize;
1075
-
1076
- public:
1077
-
1078
- using Base::get_block_size;
1079
-
1080
- static const std::size_t is_reservable = Base::is_reservable;
1081
-
1082
87
  //////////////////////////////////////////////
1083
88
  //
1084
89
  // construct/copy/destroy
@@ -1091,8 +96,8 @@ class deque : protected deque_base<typename real_allocator<T, Allocator>::type,
1091
96
  //!
1092
97
  //! <b>Complexity</b>: Constant.
1093
98
  inline deque()
1094
- BOOST_NOEXCEPT_IF(dtl::is_nothrow_default_constructible<ValAllocator>::value)
1095
- : Base()
99
+ BOOST_NOEXCEPT_IF(dtl::is_nothrow_default_constructible<allocator_type>::value)
100
+ : base_type()
1096
101
  {}
1097
102
 
1098
103
  //! <b>Effects</b>: Constructs a deque taking the allocator as parameter.
@@ -1101,7 +106,7 @@ class deque : protected deque_base<typename real_allocator<T, Allocator>::type,
1101
106
  //!
1102
107
  //! <b>Complexity</b>: Constant.
1103
108
  inline explicit deque(const allocator_type& a) BOOST_NOEXCEPT_OR_NOTHROW
1104
- : Base(a)
109
+ : base_type(a)
1105
110
  {}
1106
111
 
1107
112
  //! <b>Effects</b>: Constructs a deque
@@ -1112,12 +117,8 @@ class deque : protected deque_base<typename real_allocator<T, Allocator>::type,
1112
117
  //!
1113
118
  //! <b>Complexity</b>: Linear to n.
1114
119
  inline explicit deque(size_type n)
1115
- : Base(n, allocator_type())
1116
- {
1117
- dtl::insert_value_initialized_n_proxy<ValAllocator> proxy;
1118
- this->priv_segmented_proxy_uninitialized_copy_n_and_update(this->begin(), n, proxy);
1119
- //deque_base will deallocate in case of exception...
1120
- }
120
+ : base_type(n)
121
+ {}
1121
122
 
1122
123
  //! <b>Effects</b>: Constructs a deque
1123
124
  //! and inserts n default initialized values.
@@ -1129,12 +130,8 @@ class deque : protected deque_base<typename real_allocator<T, Allocator>::type,
1129
130
  //!
1130
131
  //! <b>Note</b>: Non-standard extension
1131
132
  inline deque(size_type n, default_init_t)
1132
- : Base(n, allocator_type())
1133
- {
1134
- dtl::insert_default_initialized_n_proxy<ValAllocator> proxy;
1135
- this->priv_segmented_proxy_uninitialized_copy_n_and_update(this->begin(), n, proxy);
1136
- //deque_base will deallocate in case of exception...
1137
- }
133
+ : base_type(n, default_init)
134
+ {}
1138
135
 
1139
136
  //! <b>Effects</b>: Constructs a deque that will use a copy of allocator a
1140
137
  //! and inserts n value initialized values.
@@ -1144,12 +141,8 @@ class deque : protected deque_base<typename real_allocator<T, Allocator>::type,
1144
141
  //!
1145
142
  //! <b>Complexity</b>: Linear to n.
1146
143
  inline explicit deque(size_type n, const allocator_type &a)
1147
- : Base(n, a)
1148
- {
1149
- dtl::insert_value_initialized_n_proxy<ValAllocator> proxy;
1150
- this->priv_segmented_proxy_uninitialized_copy_n_and_update(this->begin(), n, proxy);
1151
- //deque_base will deallocate in case of exception...
1152
- }
144
+ : base_type(n, a)
145
+ {}
1153
146
 
1154
147
  //! <b>Effects</b>: Constructs a deque that will use a copy of allocator a
1155
148
  //! and inserts n default initialized values.
@@ -1161,12 +154,8 @@ class deque : protected deque_base<typename real_allocator<T, Allocator>::type,
1161
154
  //!
1162
155
  //! <b>Note</b>: Non-standard extension
1163
156
  inline deque(size_type n, default_init_t, const allocator_type &a)
1164
- : Base(n, a)
1165
- {
1166
- dtl::insert_default_initialized_n_proxy<ValAllocator> proxy;
1167
- this->priv_segmented_proxy_uninitialized_copy_n_and_update(this->begin(), n, proxy);
1168
- //deque_base will deallocate in case of exception...
1169
- }
157
+ : base_type(n, default_init, a)
158
+ {}
1170
159
 
1171
160
  //! <b>Effects</b>: Constructs a deque that will use a copy of allocator a
1172
161
  //! and inserts n copies of value.
@@ -1176,8 +165,8 @@ class deque : protected deque_base<typename real_allocator<T, Allocator>::type,
1176
165
  //!
1177
166
  //! <b>Complexity</b>: Linear to n.
1178
167
  inline deque(size_type n, const value_type& value)
1179
- : Base(n, allocator_type())
1180
- { this->priv_fill_initialize(n, value); }
168
+ : base_type(n, value)
169
+ {}
1181
170
 
1182
171
  //! <b>Effects</b>: Constructs a deque that will use a copy of allocator a
1183
172
  //! and inserts n copies of value.
@@ -1187,8 +176,8 @@ class deque : protected deque_base<typename real_allocator<T, Allocator>::type,
1187
176
  //!
1188
177
  //! <b>Complexity</b>: Linear to n.
1189
178
  inline deque(size_type n, const value_type& value, const allocator_type& a)
1190
- : Base(n, a)
1191
- { this->priv_fill_initialize(n, value); }
179
+ : base_type(n, value, a)
180
+ {}
1192
181
 
1193
182
  //! <b>Effects</b>: Constructs a deque that will use a copy of allocator a
1194
183
  //! and inserts a copy of the range [first, last) in the deque.
@@ -1204,10 +193,8 @@ class deque : protected deque_base<typename real_allocator<T, Allocator>::type,
1204
193
  <InIt, size_type>::type * = 0
1205
194
  #endif
1206
195
  )
1207
- : Base(allocator_type())
1208
- {
1209
- this->priv_range_initialize(first, last);
1210
- }
196
+ : base_type(first, last)
197
+ {}
1211
198
 
1212
199
  //! <b>Effects</b>: Constructs a deque that will use a copy of allocator a
1213
200
  //! and inserts a copy of the range [first, last) in the deque.
@@ -1223,10 +210,8 @@ class deque : protected deque_base<typename real_allocator<T, Allocator>::type,
1223
210
  <InIt, size_type>::type * = 0
1224
211
  #endif
1225
212
  )
1226
- : Base(a)
1227
- {
1228
- this->priv_range_initialize(first, last);
1229
- }
213
+ : base_type(first, last, a)
214
+ {}
1230
215
 
1231
216
  #if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
1232
217
  //! <b>Effects</b>: Constructs a deque that will use a copy of allocator a
@@ -1237,10 +222,8 @@ class deque : protected deque_base<typename real_allocator<T, Allocator>::type,
1237
222
  //!
1238
223
  //! <b>Complexity</b>: Linear to the range [il.begin(), il.end()).
1239
224
  inline deque(std::initializer_list<value_type> il, const allocator_type& a = allocator_type())
1240
- : Base(a)
1241
- {
1242
- this->priv_range_initialize(il.begin(), il.end());
1243
- }
225
+ : base_type(il, a)
226
+ {}
1244
227
  #endif
1245
228
 
1246
229
  //! <b>Effects</b>: Copy constructs a deque.
@@ -1249,13 +232,8 @@ class deque : protected deque_base<typename real_allocator<T, Allocator>::type,
1249
232
  //!
1250
233
  //! <b>Complexity</b>: Linear to the elements x contains.
1251
234
  inline deque(const deque& x)
1252
- : Base(allocator_traits_type::select_on_container_copy_construction(x.alloc()))
1253
- {
1254
- if(x.size()){
1255
- this->prot_initialize_map_and_nodes(x.size());
1256
- this->priv_segmented_uninitialized_copy_alloc_n(x.begin(), x.size(), this->begin());
1257
- }
1258
- }
235
+ : base_type(x)
236
+ {}
1259
237
 
1260
238
  //! <b>Effects</b>: Move constructor. Moves x's resources to *this.
1261
239
  //!
@@ -1263,8 +241,8 @@ class deque : protected deque_base<typename real_allocator<T, Allocator>::type,
1263
241
  //!
1264
242
  //! <b>Complexity</b>: Constant.
1265
243
  inline deque(BOOST_RV_REF(deque) x) BOOST_NOEXCEPT_OR_NOTHROW
1266
- : Base(BOOST_MOVE_BASE(Base, x))
1267
- { this->swap_members(x); }
244
+ : base_type(boost::move(static_cast<base_type&>(x)))
245
+ {}
1268
246
 
1269
247
  //! <b>Effects</b>: Copy constructs a vector using the specified allocator.
1270
248
  //!
@@ -1274,14 +252,9 @@ class deque : protected deque_base<typename real_allocator<T, Allocator>::type,
1274
252
  //! throws or T's copy constructor throws.
1275
253
  //!
1276
254
  //! <b>Complexity</b>: Linear to the elements x contains.
1277
- deque(const deque& x, const allocator_type &a)
1278
- : Base(a)
1279
- {
1280
- if(x.size()){
1281
- this->prot_initialize_map_and_nodes(x.size());
1282
- this->priv_segmented_uninitialized_copy_alloc_n(x.begin(), x.size(), this->begin());
1283
- }
1284
- }
255
+ deque(const deque& x, const BOOST_CONTAINER_DOC1ST(allocator_type, typename dtl::type_identity<allocator_type>::type) &a)
256
+ : base_type(x, a)
257
+ {}
1285
258
 
1286
259
  //! <b>Effects</b>: Move constructor using the specified allocator.
1287
260
  //! Moves x's resources to *this if a == allocator_type().
@@ -1290,19 +263,9 @@ class deque : protected deque_base<typename real_allocator<T, Allocator>::type,
1290
263
  //! <b>Throws</b>: If allocation or T's copy constructor throws.
1291
264
  //!
1292
265
  //! <b>Complexity</b>: Constant if a == x.get_allocator(), linear otherwise.
1293
- deque(BOOST_RV_REF(deque) x, const allocator_type &a)
1294
- : Base(a)
1295
- {
1296
- if(x.alloc() == a){
1297
- this->swap_members(x);
1298
- }
1299
- else{
1300
- if(x.size()){
1301
- this->prot_initialize_map_and_nodes(x.size());
1302
- this->priv_segmented_uninitialized_move_alloc_n(x.begin(), x.size(), this->begin());
1303
- }
1304
- }
1305
- }
266
+ deque(BOOST_RV_REF(deque) x, const BOOST_CONTAINER_DOC1ST(allocator_type, typename dtl::type_identity<allocator_type>::type) &a)
267
+ : base_type(boost::move(static_cast<base_type&>(x)), a)
268
+ {}
1306
269
 
1307
270
  //! <b>Effects</b>: Destroys the deque. All stored values are destroyed
1308
271
  //! and used memory is deallocated.
@@ -1311,9 +274,7 @@ class deque : protected deque_base<typename real_allocator<T, Allocator>::type,
1311
274
  //!
1312
275
  //! <b>Complexity</b>: Linear to the number of elements.
1313
276
  inline ~deque() BOOST_NOEXCEPT_OR_NOTHROW
1314
- {
1315
- this->prot_destroy_range(this->prot_start(), this->prot_finish());
1316
- }
277
+ {}
1317
278
 
1318
279
  //! <b>Effects</b>: Makes *this contain the same elements as x.
1319
280
  //!
@@ -1325,19 +286,7 @@ class deque : protected deque_base<typename real_allocator<T, Allocator>::type,
1325
286
  //! <b>Complexity</b>: Linear to the number of elements in x.
1326
287
  deque& operator= (BOOST_COPY_ASSIGN_REF(deque) x)
1327
288
  {
1328
- if (BOOST_LIKELY(&x != this)){
1329
- allocator_type &this_alloc = this->alloc();
1330
- const allocator_type &x_alloc = x.alloc();
1331
- dtl::bool_<allocator_traits_type::
1332
- propagate_on_container_copy_assignment::value> flag;
1333
- if(flag && this_alloc != x_alloc){
1334
- this->clear();
1335
- this->shrink_to_fit();
1336
- }
1337
- dtl::assign_alloc(this->alloc(), x.alloc(), flag);
1338
- dtl::assign_alloc(this->ptr_alloc(), x.ptr_alloc(), flag);
1339
- this->assign(x.cbegin(), x.cend());
1340
- }
289
+ base_type::operator=(static_cast<const base_type&>(x));
1341
290
  return *this;
1342
291
  }
1343
292
 
@@ -1348,49 +297,55 @@ class deque : protected deque_base<typename real_allocator<T, Allocator>::type,
1348
297
  //!
1349
298
  //! <b>Complexity</b>: Constant if allocator_traits_type::
1350
299
  //! propagate_on_container_move_assignment is true or
1351
- //! this->get>allocator() == x.get_allocator(). Linear otherwise.
300
+ //! this->get_allocator() == x.get_allocator(). Linear otherwise.
1352
301
  deque& operator= (BOOST_RV_REF(deque) x)
1353
- BOOST_NOEXCEPT_IF(allocator_traits_type::propagate_on_container_move_assignment::value
1354
- || allocator_traits_type::is_always_equal::value)
302
+ BOOST_NOEXCEPT_IF(allocator_traits<allocator_type>::propagate_on_container_move_assignment::value
303
+ || allocator_traits<allocator_type>::is_always_equal::value)
1355
304
  {
1356
- if (BOOST_LIKELY(this != &x)) {
1357
- //We know resources can be transferred at comiple time if both allocators are
1358
- //always equal or the allocator is going to be propagated
1359
- const bool can_steal_resources_alloc
1360
- = allocator_traits_type::propagate_on_container_move_assignment::value
1361
- || allocator_traits_type::is_always_equal::value;
1362
- dtl::bool_<can_steal_resources_alloc> flag;
1363
- this->priv_move_assign(boost::move(x), flag);
1364
- }
305
+ base_type::operator=(BOOST_MOVE_BASE(base_type, x));
1365
306
  return *this;
1366
307
  }
1367
308
 
1368
- #if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
309
+ #if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
1369
310
  //! <b>Effects</b>: Makes *this contain the same elements as il.
1370
311
  //!
1371
312
  //! <b>Postcondition</b>: this->size() == il.size(). *this contains a copy
1372
- //! of each of x's elements.
313
+ //! of each of il's elements.
1373
314
  //!
1374
315
  //! <b>Throws</b>: If memory allocation throws or T's copy constructor throws.
1375
316
  //!
1376
317
  //! <b>Complexity</b>: Linear to the number of elements in il.
1377
318
  inline deque& operator=(std::initializer_list<value_type> il)
1378
319
  {
1379
- this->assign(il.begin(), il.end());
320
+ base_type::operator=(il);
1380
321
  return *this;
1381
322
  }
1382
- #endif
323
+ #endif
324
+
325
+ #ifdef BOOST_CONTAINER_DOXYGEN_INVOKED
326
+
327
+ //! <b>Effects</b>: Returns the number of continguous elements per segment/block.
328
+ //! Same as get_block_size().
329
+ //!
330
+ //! <b>Throws</b>: Nothing.
331
+ //!
332
+ //! <b>Complexity</b>: Constant.
333
+ static size_type get_segment_size() BOOST_NOEXCEPT_OR_NOTHROW;
334
+
335
+ //! <b>Effects</b>: Returns the number of continguous elements per segment/block.
336
+ //! Same as get_segment_size().
337
+ //!
338
+ //! <b>Throws</b>: Nothing.
339
+ //!
340
+ //! <b>Complexity</b>: Constant.
341
+ static size_type get_block_size() BOOST_NOEXCEPT_OR_NOTHROW;
1383
342
 
1384
343
  //! <b>Effects</b>: Assigns the n copies of val to *this.
1385
344
  //!
1386
345
  //! <b>Throws</b>: If memory allocation throws or T's copy constructor throws.
1387
346
  //!
1388
347
  //! <b>Complexity</b>: Linear to n.
1389
- inline void assign(size_type n, const T& val)
1390
- {
1391
- dtl::insert_n_copies_proxy<ValAllocator> proxy(val);
1392
- this->priv_assign(n, proxy);
1393
- }
348
+ void assign(size_type n, const value_type& val);
1394
349
 
1395
350
  //! <b>Effects</b>: Assigns the the range [first, last) to *this.
1396
351
  //!
@@ -1398,69 +353,23 @@ class deque : protected deque_base<typename real_allocator<T, Allocator>::type,
1398
353
  //! T's constructor from dereferencing InIt throws.
1399
354
  //!
1400
355
  //! <b>Complexity</b>: Linear to n.
1401
- template <class InIt>
1402
- void assign(InIt first, InIt last
1403
- #if !defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
1404
- , typename dtl::disable_if_or
1405
- < void
1406
- , dtl::is_convertible<InIt, size_type>
1407
- , dtl::is_not_input_iterator<InIt>
1408
- >::type * = 0
1409
- #endif
1410
- )
1411
- {
1412
- iterator cur = this->begin();
1413
- for ( ; first != last && cur != end(); ++cur, ++first){
1414
- *cur = *first;
1415
- }
1416
- if (first == last){
1417
- this->erase(cur, this->cend());
1418
- }
1419
- else{
1420
- this->insert(this->cend(), first, last);
1421
- }
1422
- }
1423
-
1424
- #if !defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
1425
- template <class FwdIt>
1426
- void assign(FwdIt first, FwdIt last
1427
- , typename dtl::disable_if_or
1428
- < void
1429
- , dtl::is_convertible<FwdIt, size_type>
1430
- , dtl::is_input_iterator<FwdIt>
1431
- >::type * = 0
1432
- )
1433
- {
1434
- typedef typename iter_size<FwdIt>::type it_size_type;
1435
- const it_size_type sz = boost::container::iterator_udistance(first, last);
1436
- if (BOOST_UNLIKELY(sz > size_type(-1))){
1437
- boost::container::throw_length_error("vector::insert, FwdIt's max length reached");
1438
- }
1439
- const size_type n = static_cast<size_type>(sz);
1440
- dtl::insert_range_proxy<ValAllocator, FwdIt> proxy(first);
1441
- this->priv_assign(n, proxy);
1442
- }
1443
- #endif
356
+ template <class InputIterator>
357
+ void assign(InputIterator first, InputIterator last);
1444
358
 
1445
- #if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
1446
359
  //! <b>Effects</b>: Assigns the the range [il.begin(), il.end()) to *this.
1447
360
  //!
1448
361
  //! <b>Throws</b>: If memory allocation throws or
1449
362
  //! T's constructor from dereferencing std::initializer_list iterator throws.
1450
363
  //!
1451
364
  //! <b>Complexity</b>: Linear to il.size().
1452
- inline void assign(std::initializer_list<value_type> il)
1453
- { this->assign(il.begin(), il.end()); }
1454
- #endif
365
+ void assign(std::initializer_list<value_type> il);
1455
366
 
1456
367
  //! <b>Effects</b>: Returns a copy of the internal allocator.
1457
368
  //!
1458
369
  //! <b>Throws</b>: If allocator's copy constructor throws.
1459
370
  //!
1460
371
  //! <b>Complexity</b>: Constant.
1461
- BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline
1462
- allocator_type get_allocator() const BOOST_NOEXCEPT_OR_NOTHROW
1463
- { return Base::alloc(); }
372
+ allocator_type get_allocator() const;
1464
373
 
1465
374
  //! <b>Effects</b>: Returns a reference to the internal allocator.
1466
375
  //!
@@ -1469,15 +378,7 @@ class deque : protected deque_base<typename real_allocator<T, Allocator>::type,
1469
378
  //! <b>Complexity</b>: Constant.
1470
379
  //!
1471
380
  //! <b>Note</b>: Non-standard extension.
1472
- BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline
1473
- const stored_allocator_type &get_stored_allocator() const BOOST_NOEXCEPT_OR_NOTHROW
1474
- { return Base::alloc(); }
1475
-
1476
- //////////////////////////////////////////////
1477
- //
1478
- // iterators
1479
- //
1480
- //////////////////////////////////////////////
381
+ const stored_allocator_type& get_stored_allocator() const;
1481
382
 
1482
383
  //! <b>Effects</b>: Returns a reference to the internal allocator.
1483
384
  //!
@@ -1486,55 +387,48 @@ class deque : protected deque_base<typename real_allocator<T, Allocator>::type,
1486
387
  //! <b>Complexity</b>: Constant.
1487
388
  //!
1488
389
  //! <b>Note</b>: Non-standard extension.
1489
- BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline
1490
- stored_allocator_type &get_stored_allocator() BOOST_NOEXCEPT_OR_NOTHROW
1491
- { return Base::alloc(); }
390
+ stored_allocator_type& get_stored_allocator();
391
+
392
+ //////////////////////////////////////////////
393
+ //
394
+ // iterators
395
+ //
396
+ //////////////////////////////////////////////
1492
397
 
1493
398
  //! <b>Effects</b>: Returns an iterator to the first element contained in the deque.
1494
399
  //!
1495
400
  //! <b>Throws</b>: Nothing.
1496
401
  //!
1497
402
  //! <b>Complexity</b>: Constant.
1498
- BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline
1499
- iterator begin() BOOST_NOEXCEPT_OR_NOTHROW
1500
- { return this->prot_start(); }
403
+ iterator begin() noexcept;
1501
404
 
1502
405
  //! <b>Effects</b>: Returns a const_iterator to the first element contained in the deque.
1503
406
  //!
1504
407
  //! <b>Throws</b>: Nothing.
1505
408
  //!
1506
409
  //! <b>Complexity</b>: Constant.
1507
- BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline
1508
- const_iterator begin() const BOOST_NOEXCEPT_OR_NOTHROW
1509
- { return this->prot_start(); }
410
+ const_iterator begin() const noexcept;
1510
411
 
1511
412
  //! <b>Effects</b>: Returns an iterator to the end of the deque.
1512
413
  //!
1513
414
  //! <b>Throws</b>: Nothing.
1514
415
  //!
1515
416
  //! <b>Complexity</b>: Constant.
1516
- BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline
1517
- iterator end() BOOST_NOEXCEPT_OR_NOTHROW
1518
- { return this->prot_finish(); }
417
+ iterator end() noexcept;
1519
418
 
1520
419
  //! <b>Effects</b>: Returns a const_iterator to the end of the deque.
1521
420
  //!
1522
421
  //! <b>Throws</b>: Nothing.
1523
422
  //!
1524
423
  //! <b>Complexity</b>: Constant.
1525
- BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline
1526
- const_iterator end() const BOOST_NOEXCEPT_OR_NOTHROW
1527
- { return this->prot_finish(); }
1528
-
424
+ const_iterator end() const noexcept;
1529
425
  //! <b>Effects</b>: Returns a reverse_iterator pointing to the beginning
1530
426
  //! of the reversed deque.
1531
427
  //!
1532
428
  //! <b>Throws</b>: Nothing.
1533
429
  //!
1534
430
  //! <b>Complexity</b>: Constant.
1535
- BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline
1536
- reverse_iterator rbegin() BOOST_NOEXCEPT_OR_NOTHROW
1537
- { return reverse_iterator(this->prot_finish()); }
431
+ reverse_iterator rbegin() noexcept;
1538
432
 
1539
433
  //! <b>Effects</b>: Returns a const_reverse_iterator pointing to the beginning
1540
434
  //! of the reversed deque.
@@ -1542,9 +436,7 @@ class deque : protected deque_base<typename real_allocator<T, Allocator>::type,
1542
436
  //! <b>Throws</b>: Nothing.
1543
437
  //!
1544
438
  //! <b>Complexity</b>: Constant.
1545
- BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline
1546
- const_reverse_iterator rbegin() const BOOST_NOEXCEPT_OR_NOTHROW
1547
- { return const_reverse_iterator(this->prot_finish()); }
439
+ const_reverse_iterator rbegin() const noexcept;
1548
440
 
1549
441
  //! <b>Effects</b>: Returns a reverse_iterator pointing to the end
1550
442
  //! of the reversed deque.
@@ -1552,9 +444,7 @@ class deque : protected deque_base<typename real_allocator<T, Allocator>::type,
1552
444
  //! <b>Throws</b>: Nothing.
1553
445
  //!
1554
446
  //! <b>Complexity</b>: Constant.
1555
- BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline
1556
- reverse_iterator rend() BOOST_NOEXCEPT_OR_NOTHROW
1557
- { return reverse_iterator(this->prot_start()); }
447
+ reverse_iterator rend() noexcept;
1558
448
 
1559
449
  //! <b>Effects</b>: Returns a const_reverse_iterator pointing to the end
1560
450
  //! of the reversed deque.
@@ -1562,27 +452,21 @@ class deque : protected deque_base<typename real_allocator<T, Allocator>::type,
1562
452
  //! <b>Throws</b>: Nothing.
1563
453
  //!
1564
454
  //! <b>Complexity</b>: Constant.
1565
- BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline
1566
- const_reverse_iterator rend() const BOOST_NOEXCEPT_OR_NOTHROW
1567
- { return const_reverse_iterator(this->prot_start()); }
455
+ const_reverse_iterator rend() const noexcept;
1568
456
 
1569
457
  //! <b>Effects</b>: Returns a const_iterator to the first element contained in the deque.
1570
458
  //!
1571
459
  //! <b>Throws</b>: Nothing.
1572
460
  //!
1573
461
  //! <b>Complexity</b>: Constant.
1574
- BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline
1575
- const_iterator cbegin() const BOOST_NOEXCEPT_OR_NOTHROW
1576
- { return this->prot_start(); }
462
+ const_iterator cbegin() const noexcept;
1577
463
 
1578
464
  //! <b>Effects</b>: Returns a const_iterator to the end of the deque.
1579
465
  //!
1580
466
  //! <b>Throws</b>: Nothing.
1581
467
  //!
1582
468
  //! <b>Complexity</b>: Constant.
1583
- BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline
1584
- const_iterator cend() const BOOST_NOEXCEPT_OR_NOTHROW
1585
- { return this->prot_finish(); }
469
+ const_iterator cend() const noexcept;
1586
470
 
1587
471
  //! <b>Effects</b>: Returns a const_reverse_iterator pointing to the beginning
1588
472
  //! of the reversed deque.
@@ -1590,9 +474,7 @@ class deque : protected deque_base<typename real_allocator<T, Allocator>::type,
1590
474
  //! <b>Throws</b>: Nothing.
1591
475
  //!
1592
476
  //! <b>Complexity</b>: Constant.
1593
- BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline
1594
- const_reverse_iterator crbegin() const BOOST_NOEXCEPT_OR_NOTHROW
1595
- { return const_reverse_iterator(this->prot_finish()); }
477
+ const_reverse_iterator crbegin() const noexcept;
1596
478
 
1597
479
  //! <b>Effects</b>: Returns a const_reverse_iterator pointing to the end
1598
480
  //! of the reversed deque.
@@ -1600,9 +482,7 @@ class deque : protected deque_base<typename real_allocator<T, Allocator>::type,
1600
482
  //! <b>Throws</b>: Nothing.
1601
483
  //!
1602
484
  //! <b>Complexity</b>: Constant.
1603
- BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline
1604
- const_reverse_iterator crend() const BOOST_NOEXCEPT_OR_NOTHROW
1605
- { return const_reverse_iterator(this->prot_start()); }
485
+ const_reverse_iterator crend() const noexcept;
1606
486
 
1607
487
  //////////////////////////////////////////////
1608
488
  //
@@ -1615,18 +495,14 @@ class deque : protected deque_base<typename real_allocator<T, Allocator>::type,
1615
495
  //! <b>Throws</b>: Nothing.
1616
496
  //!
1617
497
  //! <b>Complexity</b>: Constant.
1618
- BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline
1619
- bool empty() const BOOST_NOEXCEPT_OR_NOTHROW
1620
- { return this->prot_empty(); }
498
+ bool empty() const noexcept;
1621
499
 
1622
500
  //! <b>Effects</b>: Returns the number of the elements contained in the deque.
1623
501
  //!
1624
502
  //! <b>Throws</b>: Nothing.
1625
503
  //!
1626
504
  //! <b>Complexity</b>: Constant.
1627
- BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline
1628
- size_type size() const BOOST_NOEXCEPT_OR_NOTHROW
1629
- { return this->prot_size(); }
505
+ size_type size() const noexcept;
1630
506
 
1631
507
  //! <b>Effects</b>: Returns the number of the elements that can be inserted
1632
508
  //! at the back without allocating additional memory.
@@ -1636,9 +512,7 @@ class deque : protected deque_base<typename real_allocator<T, Allocator>::type,
1636
512
  //! <b>Complexity</b>: Constant.
1637
513
  //!
1638
514
  //! <b>Note</b>: Non-standard extension.
1639
- BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline
1640
- size_type back_capacity() const BOOST_NOEXCEPT_OR_NOTHROW
1641
- { return size_type(this->size() + this->prot_back_free_capacity()); }
515
+ size_type back_capacity() const noexcept;
1642
516
 
1643
517
  //! <b>Effects</b>: Returns the number of the elements that can be inserted
1644
518
  //! at the front without allocating additional memory.
@@ -1648,9 +522,7 @@ class deque : protected deque_base<typename real_allocator<T, Allocator>::type,
1648
522
  //! <b>Complexity</b>: Constant.
1649
523
  //!
1650
524
  //! <b>Note</b>: Non-standard extension.
1651
- BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline
1652
- size_type front_capacity() const BOOST_NOEXCEPT_OR_NOTHROW
1653
- { return size_type(this->size() + this->prot_front_free_capacity()); }
525
+ size_type front_capacity() const noexcept;
1654
526
 
1655
527
  //! <b>Requires</b>: The container must be "reservable" (is_reservable == true)
1656
528
  //!
@@ -1664,46 +536,28 @@ class deque : protected deque_base<typename real_allocator<T, Allocator>::type,
1664
536
  //! <b>Complexity</b>: Linear to n.
1665
537
  //!
1666
538
  //! <b>Note</b>: Non-standard extension.
1667
- void reserve_back(size_type n)
1668
- {
1669
- (void)n;
1670
- BOOST_IF_CONSTEXPR(is_reservable){
1671
- const size_type cur_back_cap = this->back_capacity();
1672
- if (this->back_capacity() < n)
1673
- this->priv_reserve_elements_at_back(size_type(n - cur_back_cap) );
1674
- }
1675
- }
539
+ void reserve_back(size_type n);
1676
540
 
1677
541
  //! <b>Requires</b>: The container must be "reservable" (is_reservable == true)
1678
542
  //!
1679
- //! <b>Effects</b>: If n is less than or equal to back_capacity() or the container is not reservable,
1680
- //! this call has no effect. Otherwise, if it is a request for allocation of additional memory.
1681
- //! If the request is successful, then back_capacity() is greater than or equal to
1682
- //! n; otherwise, back_capacity() is unchanged. In either case, size() is unchanged.
543
+ //! <b>Effects</b>: If n is less than or equal to front_capacity() or the container is not reservable,
544
+ //! this call has no effect. Otherwise, it is a request for allocation of additional memory.
545
+ //! If the request is successful, then front_capacity() is greater than or equal to
546
+ //! n; otherwise, front_capacity() is unchanged. In either case, size() is unchanged.
1683
547
  //!
1684
548
  //! <b>Throws</b>: If memory allocation throws.
1685
549
  //!
1686
550
  //! <b>Complexity</b>: Linear to n.
1687
551
  //!
1688
552
  //! <b>Note</b>: Non-standard extension.
1689
- void reserve_front(size_type n)
1690
- {
1691
- (void)n;
1692
- BOOST_IF_CONSTEXPR(is_reservable){
1693
- const size_type cur_back_cap = this->front_capacity();
1694
- if (this->front_capacity() < n)
1695
- this->priv_reserve_elements_at_front(size_type(n - cur_back_cap) );
1696
- }
1697
- }
553
+ void reserve_front(size_type n);
1698
554
 
1699
555
  //! <b>Effects</b>: Returns the largest possible size of the deque.
1700
556
  //!
1701
557
  //! <b>Throws</b>: Nothing.
1702
558
  //!
1703
559
  //! <b>Complexity</b>: Constant.
1704
- BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline
1705
- size_type max_size() const BOOST_NOEXCEPT_OR_NOTHROW
1706
- { return allocator_traits_type::max_size(this->alloc()); }
560
+ size_type max_size() const noexcept;
1707
561
 
1708
562
  //! <b>Effects</b>: Inserts or erases elements at the end such that
1709
563
  //! the size becomes n. New elements are value initialized.
@@ -1711,55 +565,14 @@ class deque : protected deque_base<typename real_allocator<T, Allocator>::type,
1711
565
  //! <b>Throws</b>: If memory allocation throws, or T's constructor throws.
1712
566
  //!
1713
567
  //! <b>Complexity</b>: Linear to the difference between size() and new_size.
1714
- void resize(size_type new_size)
1715
- {
1716
- const size_type len = this->size();
1717
- if (new_size < len)
1718
- this->priv_erase_last_n(size_type(len - new_size));
1719
- else{
1720
- const size_type n = size_type(new_size - this->size());
1721
- dtl::insert_value_initialized_n_proxy<ValAllocator> proxy;
1722
- this->priv_insert_back_aux_impl(n, proxy);
1723
- }
1724
- }
1725
-
1726
- //! <b>Effects</b>: Inserts or erases elements at the end such that
1727
- //! the size becomes n. New elements are default initialized.
1728
- //!
1729
- //! <b>Throws</b>: If memory allocation throws, or T's constructor throws.
1730
- //!
1731
- //! <b>Complexity</b>: Linear to the difference between size() and new_size.
1732
- //!
1733
- //! <b>Note</b>: Non-standard extension
1734
- void resize(size_type new_size, default_init_t)
1735
- {
1736
- const size_type len = size();
1737
- if (new_size < len)
1738
- this->priv_erase_last_n(size_type(len - new_size));
1739
- else{
1740
- const size_type n = size_type(new_size - this->size());
1741
- dtl::insert_default_initialized_n_proxy<ValAllocator> proxy;
1742
- this->priv_insert_back_aux_impl(n, proxy);
1743
- }
1744
- }
1745
-
568
+ void resize(size_type new_size);
1746
569
  //! <b>Effects</b>: Inserts or erases elements at the end such that
1747
570
  //! the size becomes n. New elements are copy constructed from x.
1748
571
  //!
1749
572
  //! <b>Throws</b>: If memory allocation throws, or T's copy constructor throws.
1750
573
  //!
1751
574
  //! <b>Complexity</b>: Linear to the difference between size() and new_size.
1752
- void resize(size_type new_size, const value_type& x)
1753
- {
1754
- const size_type sz = this->size();
1755
- if (new_size < sz)
1756
- this->priv_erase_last_n(size_type(sz - new_size));
1757
- else {
1758
- const size_type n = size_type(new_size - sz);
1759
- dtl::insert_n_copies_proxy<ValAllocator> proxy(x);
1760
- this->priv_insert_back_aux_impl(n, proxy);
1761
- }
1762
- }
575
+ void resize(size_type new_size, const value_type& x);
1763
576
 
1764
577
  //! <b>Effects</b>: Tries to deallocate the excess of memory created
1765
578
  //! with previous allocations. The size of the deque is unchanged
@@ -1767,16 +580,7 @@ class deque : protected deque_base<typename real_allocator<T, Allocator>::type,
1767
580
  //! <b>Throws</b>: If memory allocation throws.
1768
581
  //!
1769
582
  //! <b>Complexity</b>: Constant.
1770
- void shrink_to_fit()
1771
- {
1772
- //This deque implementation already
1773
- //deallocates excess nodes when erasing
1774
- //so there is nothing to do except for
1775
- //empty deque
1776
- if(this->empty()){
1777
- this->prot_clear_map();
1778
- }
1779
- }
583
+ void shrink_to_fit();
1780
584
 
1781
585
  //////////////////////////////////////////////
1782
586
  //
@@ -1792,13 +596,7 @@ class deque : protected deque_base<typename real_allocator<T, Allocator>::type,
1792
596
  //! <b>Throws</b>: Nothing.
1793
597
  //!
1794
598
  //! <b>Complexity</b>: Constant.
1795
- BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline
1796
- reference front() BOOST_NOEXCEPT_OR_NOTHROW
1797
- {
1798
- BOOST_ASSERT(!this->empty());
1799
- return *this->prot_start_cur_unchecked();
1800
- }
1801
-
599
+ reference front();
1802
600
  //! <b>Requires</b>: !empty()
1803
601
  //!
1804
602
  //! <b>Effects</b>: Returns a const reference to the first element
@@ -1807,12 +605,7 @@ class deque : protected deque_base<typename real_allocator<T, Allocator>::type,
1807
605
  //! <b>Throws</b>: Nothing.
1808
606
  //!
1809
607
  //! <b>Complexity</b>: Constant.
1810
- BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline
1811
- const_reference front() const BOOST_NOEXCEPT_OR_NOTHROW
1812
- {
1813
- BOOST_ASSERT(!this->empty());
1814
- return *this->prot_start_cur_unchecked();
1815
- }
608
+ const_reference front() const;
1816
609
 
1817
610
  //! <b>Requires</b>: !empty()
1818
611
  //!
@@ -1822,12 +615,7 @@ class deque : protected deque_base<typename real_allocator<T, Allocator>::type,
1822
615
  //! <b>Throws</b>: Nothing.
1823
616
  //!
1824
617
  //! <b>Complexity</b>: Constant.
1825
- BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline
1826
- reference back() BOOST_NOEXCEPT_OR_NOTHROW
1827
- {
1828
- BOOST_ASSERT(!this->empty());
1829
- return *this->prot_last_cur_unchecked();
1830
- }
618
+ reference back();
1831
619
 
1832
620
  //! <b>Requires</b>: !empty()
1833
621
  //!
@@ -1837,12 +625,7 @@ class deque : protected deque_base<typename real_allocator<T, Allocator>::type,
1837
625
  //! <b>Throws</b>: Nothing.
1838
626
  //!
1839
627
  //! <b>Complexity</b>: Constant.
1840
- BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline
1841
- const_reference back() const BOOST_NOEXCEPT_OR_NOTHROW
1842
- {
1843
- BOOST_ASSERT(!this->empty());
1844
- return *this->prot_last_cur_unchecked();
1845
- }
628
+ const_reference back() const;
1846
629
 
1847
630
  //! <b>Requires</b>: size() > n.
1848
631
  //!
@@ -1852,12 +635,7 @@ class deque : protected deque_base<typename real_allocator<T, Allocator>::type,
1852
635
  //! <b>Throws</b>: Nothing.
1853
636
  //!
1854
637
  //! <b>Complexity</b>: Constant.
1855
- BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline
1856
- reference operator[](size_type n) BOOST_NOEXCEPT_OR_NOTHROW
1857
- {
1858
- BOOST_ASSERT(this->size() > n);
1859
- return *this->prot_nth(n);
1860
- }
638
+ reference operator[](size_type n);
1861
639
 
1862
640
  //! <b>Requires</b>: size() > n.
1863
641
  //!
@@ -1867,12 +645,7 @@ class deque : protected deque_base<typename real_allocator<T, Allocator>::type,
1867
645
  //! <b>Throws</b>: Nothing.
1868
646
  //!
1869
647
  //! <b>Complexity</b>: Constant.
1870
- BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline
1871
- const_reference operator[](size_type n) const BOOST_NOEXCEPT_OR_NOTHROW
1872
- {
1873
- BOOST_ASSERT(this->size() > n);
1874
- return *this->prot_nth(n);
1875
- }
648
+ const_reference operator[](size_type n) const;
1876
649
 
1877
650
  //! <b>Requires</b>: size() >= n.
1878
651
  //!
@@ -1885,12 +658,7 @@ class deque : protected deque_base<typename real_allocator<T, Allocator>::type,
1885
658
  //! <b>Complexity</b>: Constant.
1886
659
  //!
1887
660
  //! <b>Note</b>: Non-standard extension
1888
- BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline
1889
- iterator nth(size_type n) BOOST_NOEXCEPT_OR_NOTHROW
1890
- {
1891
- BOOST_ASSERT(this->size() >= n);
1892
- return this->prot_nth(n);
1893
- }
661
+ iterator nth(size_type n);
1894
662
 
1895
663
  //! <b>Requires</b>: size() >= n.
1896
664
  //!
@@ -1903,12 +671,7 @@ class deque : protected deque_base<typename real_allocator<T, Allocator>::type,
1903
671
  //! <b>Complexity</b>: Constant.
1904
672
  //!
1905
673
  //! <b>Note</b>: Non-standard extension
1906
- BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline
1907
- const_iterator nth(size_type n) const BOOST_NOEXCEPT_OR_NOTHROW
1908
- {
1909
- BOOST_ASSERT(this->size() >= n);
1910
- return this->prot_nth(n);
1911
- }
674
+ const_iterator nth(size_type n) const;
1912
675
 
1913
676
  //! <b>Requires</b>: begin() <= p <= end().
1914
677
  //!
@@ -1920,13 +683,8 @@ class deque : protected deque_base<typename real_allocator<T, Allocator>::type,
1920
683
  //! <b>Complexity</b>: Constant.
1921
684
  //!
1922
685
  //! <b>Note</b>: Non-standard extension
1923
- BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline
1924
- size_type index_of(iterator p) BOOST_NOEXCEPT_OR_NOTHROW
1925
- {
1926
- //Range checked priv_index_of
1927
- return this->priv_index_of(p);
1928
- }
1929
-
686
+ size_type index_of(iterator p);
687
+
1930
688
  //! <b>Requires</b>: begin() <= p <= end().
1931
689
  //!
1932
690
  //! <b>Effects</b>: Returns the index of the element pointed by p
@@ -1937,12 +695,7 @@ class deque : protected deque_base<typename real_allocator<T, Allocator>::type,
1937
695
  //! <b>Complexity</b>: Constant.
1938
696
  //!
1939
697
  //! <b>Note</b>: Non-standard extension
1940
- BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline
1941
- size_type index_of(const_iterator p) const BOOST_NOEXCEPT_OR_NOTHROW
1942
- {
1943
- //Range checked priv_index_of
1944
- return this->priv_index_of(p);
1945
- }
698
+ size_type index_of(const_iterator p) const;
1946
699
 
1947
700
  //! <b>Requires</b>: size() > n.
1948
701
  //!
@@ -1952,13 +705,7 @@ class deque : protected deque_base<typename real_allocator<T, Allocator>::type,
1952
705
  //! <b>Throws</b>: range_error if n >= size()
1953
706
  //!
1954
707
  //! <b>Complexity</b>: Constant.
1955
- BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline
1956
- reference at(size_type n)
1957
- {
1958
- this->priv_throw_if_out_of_range(n);
1959
- return (*this)[n];
1960
- }
1961
-
708
+ reference at(size_type n);
1962
709
  //! <b>Requires</b>: size() > n.
1963
710
  //!
1964
711
  //! <b>Effects</b>: Returns a const reference to the nth element
@@ -1967,12 +714,7 @@ class deque : protected deque_base<typename real_allocator<T, Allocator>::type,
1967
714
  //! <b>Throws</b>: range_error if n >= size()
1968
715
  //!
1969
716
  //! <b>Complexity</b>: Constant.
1970
- BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline
1971
- const_reference at(size_type n) const
1972
- {
1973
- this->priv_throw_if_out_of_range(n);
1974
- return (*this)[n];
1975
- }
717
+ const_reference at(size_type n) const;
1976
718
 
1977
719
  //////////////////////////////////////////////
1978
720
  //
@@ -1980,8 +722,6 @@ class deque : protected deque_base<typename real_allocator<T, Allocator>::type,
1980
722
  //
1981
723
  //////////////////////////////////////////////
1982
724
 
1983
- #if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) || defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
1984
-
1985
725
  //! <b>Effects</b>: Inserts an object of type T constructed with
1986
726
  //! std::forward<Args>(args)... in the beginning of the deque.
1987
727
  //!
@@ -1991,22 +731,7 @@ class deque : protected deque_base<typename real_allocator<T, Allocator>::type,
1991
731
  //!
1992
732
  //! <b>Complexity</b>: Amortized constant time
1993
733
  template <class... Args>
1994
- reference emplace_front(BOOST_FWD_REF(Args)... args)
1995
- {
1996
- value_type *pr = this->prot_push_front_simple_pos();
1997
- if(BOOST_LIKELY(pr != 0)){
1998
- allocator_traits_type::construct
1999
- ( this->alloc()
2000
- , pr
2001
- , boost::forward<Args>(args)...);
2002
- this->prot_dec_start();
2003
- return *pr;
2004
- }
2005
- else{
2006
- typedef dtl::insert_nonmovable_emplace_proxy<ValAllocator, Args...> type;
2007
- return *this->priv_insert_front_aux_impl(1, type(boost::forward<Args>(args)...));
2008
- }
2009
- }
734
+ reference emplace_front(Args&&... args);
2010
735
 
2011
736
  //! <b>Effects</b>: Inserts an object of type T constructed with
2012
737
  //! std::forward<Args>(args)... in the end of the deque.
@@ -2017,20 +742,7 @@ class deque : protected deque_base<typename real_allocator<T, Allocator>::type,
2017
742
  //!
2018
743
  //! <b>Complexity</b>: Amortized constant time
2019
744
  template <class... Args>
2020
- reference emplace_back(BOOST_FWD_REF(Args)... args)
2021
- {
2022
- value_type *pr = this->prot_push_back_simple_pos();
2023
- if(BOOST_LIKELY(pr != 0)){
2024
- allocator_traits_type::construct
2025
- ( this->alloc(), pr, boost::forward<Args>(args)...);
2026
- this->prot_inc_finish();
2027
- return *pr;
2028
- }
2029
- else{
2030
- typedef dtl::insert_nonmovable_emplace_proxy<ValAllocator, Args...> type;
2031
- return *this->priv_insert_back_aux_impl(1, type(boost::forward<Args>(args)...));
2032
- }
2033
- }
745
+ reference emplace_back(Args&&... args);
2034
746
 
2035
747
  //! <b>Requires</b>: p must be a valid iterator of *this.
2036
748
  //!
@@ -2039,99 +751,18 @@ class deque : protected deque_base<typename real_allocator<T, Allocator>::type,
2039
751
  //!
2040
752
  //! <b>Throws</b>: If memory allocation throws or the in-place constructor throws.
2041
753
  //!
2042
- //! <b>Complexity</b>: If p is end(), amortized constant time
754
+ //! <b>Complexity</b>: If p is end() or begin(), amortized constant time
2043
755
  //! Linear time otherwise.
2044
756
  template <class... Args>
2045
- iterator emplace(const_iterator p, BOOST_FWD_REF(Args)... args)
2046
- {
2047
- const size_type elemsbefore = this->prot_it_to_start_off(p);
2048
- const size_type length = this->prot_size();
2049
-
2050
- if (!elemsbefore) {
2051
- this->emplace_front(boost::forward<Args>(args)...);
2052
- return this->begin();
2053
- }
2054
- else if (elemsbefore == length) {
2055
- this->emplace_back(boost::forward<Args>(args)...);
2056
- return this->prot_back_it();
2057
- }
2058
- else {
2059
- typedef dtl::insert_emplace_proxy<ValAllocator, Args...> type;
2060
- return this->priv_insert_middle_aux_impl(elemsbefore, 1, type(boost::forward<Args>(args)...));
2061
- }
2062
- }
2063
-
2064
- #else //!defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
2065
-
2066
- #define BOOST_CONTAINER_DEQUE_EMPLACE_CODE(N) \
2067
- BOOST_MOVE_TMPL_LT##N BOOST_MOVE_CLASS##N BOOST_MOVE_GT##N\
2068
- reference emplace_front(BOOST_MOVE_UREF##N)\
2069
- {\
2070
- value_type *pr = this->prot_push_front_simple_pos();\
2071
- if(BOOST_LIKELY(pr != 0)){\
2072
- allocator_traits_type::construct\
2073
- ( this->alloc(), pr BOOST_MOVE_I##N BOOST_MOVE_FWD##N);\
2074
- this->prot_dec_start();\
2075
- return *pr;\
2076
- }\
2077
- else{\
2078
- typedef dtl::insert_nonmovable_emplace_proxy##N\
2079
- <ValAllocator BOOST_MOVE_I##N BOOST_MOVE_TARG##N> type;\
2080
- return *priv_insert_front_aux_impl(1, type(BOOST_MOVE_FWD##N));\
2081
- }\
2082
- }\
2083
- \
2084
- BOOST_MOVE_TMPL_LT##N BOOST_MOVE_CLASS##N BOOST_MOVE_GT##N\
2085
- reference emplace_back(BOOST_MOVE_UREF##N)\
2086
- {\
2087
- value_type *pr = this->prot_push_back_simple_pos();\
2088
- if(BOOST_LIKELY(pr != 0)){\
2089
- allocator_traits_type::construct\
2090
- ( this->alloc(), pr BOOST_MOVE_I##N BOOST_MOVE_FWD##N);\
2091
- this->prot_inc_finish();\
2092
- return *pr;\
2093
- }\
2094
- else{\
2095
- typedef dtl::insert_nonmovable_emplace_proxy##N\
2096
- <ValAllocator BOOST_MOVE_I##N BOOST_MOVE_TARG##N> type;\
2097
- return *priv_insert_back_aux_impl(1, type(BOOST_MOVE_FWD##N));\
2098
- }\
2099
- }\
2100
- \
2101
- BOOST_MOVE_TMPL_LT##N BOOST_MOVE_CLASS##N BOOST_MOVE_GT##N\
2102
- iterator emplace(const_iterator p BOOST_MOVE_I##N BOOST_MOVE_UREF##N)\
2103
- {\
2104
- const size_type elemsbefore = this->prot_it_to_start_off(p);\
2105
- const size_type length = this->prot_size();\
2106
- \
2107
- if (!elemsbefore) {\
2108
- this->emplace_front(BOOST_MOVE_FWD##N);\
2109
- return this->begin();\
2110
- }\
2111
- else if (elemsbefore == length) {\
2112
- this->emplace_back(BOOST_MOVE_FWD##N);\
2113
- return this->prot_back_it();\
2114
- }\
2115
- else {\
2116
- typedef dtl::insert_emplace_proxy_arg##N\
2117
- <ValAllocator BOOST_MOVE_I##N BOOST_MOVE_TARG##N> type;\
2118
- return this->priv_insert_middle_aux_impl(elemsbefore, 1, type(BOOST_MOVE_FWD##N));\
2119
- }\
2120
- }\
2121
- //
2122
- BOOST_MOVE_ITERATE_0TO9(BOOST_CONTAINER_DEQUE_EMPLACE_CODE)
2123
- #undef BOOST_CONTAINER_DEQUE_EMPLACE_CODE
2124
-
2125
- #endif // !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
757
+ iterator emplace(const_iterator p, Args&&... args);
2126
758
 
2127
- #if defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
2128
759
  //! <b>Effects</b>: Inserts a copy of x at the front of the deque.
2129
760
  //!
2130
761
  //! <b>Throws</b>: If memory allocation throws or
2131
762
  //! T's copy constructor throws.
2132
763
  //!
2133
764
  //! <b>Complexity</b>: Amortized constant time.
2134
- void push_front(const T &x);
765
+ void push_front(const value_type& x);
2135
766
 
2136
767
  //! <b>Effects</b>: Constructs a new element in the front of the deque
2137
768
  //! and moves the resources of x to this new element.
@@ -2139,19 +770,15 @@ class deque : protected deque_base<typename real_allocator<T, Allocator>::type,
2139
770
  //! <b>Throws</b>: If memory allocation throws.
2140
771
  //!
2141
772
  //! <b>Complexity</b>: Amortized constant time.
2142
- void push_front(T &&x);
2143
- #else
2144
- BOOST_MOVE_CONVERSION_AWARE_CATCH(push_front, T, void, priv_push_front)
2145
- #endif
773
+ void push_front(value_type&& x);
2146
774
 
2147
- #if defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
2148
775
  //! <b>Effects</b>: Inserts a copy of x at the end of the deque.
2149
776
  //!
2150
777
  //! <b>Throws</b>: If memory allocation throws or
2151
778
  //! T's copy constructor throws.
2152
779
  //!
2153
780
  //! <b>Complexity</b>: Amortized constant time.
2154
- void push_back(const T &x);
781
+ void push_back(const value_type& x);
2155
782
 
2156
783
  //! <b>Effects</b>: Constructs a new element in the end of the deque
2157
784
  //! and moves the resources of x to this new element.
@@ -2159,12 +786,7 @@ class deque : protected deque_base<typename real_allocator<T, Allocator>::type,
2159
786
  //! <b>Throws</b>: If memory allocation throws.
2160
787
  //!
2161
788
  //! <b>Complexity</b>: Amortized constant time.
2162
- void push_back(T &&x);
2163
- #else
2164
- BOOST_MOVE_CONVERSION_AWARE_CATCH(push_back, T, void, priv_push_back)
2165
- #endif
2166
-
2167
- #if defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
789
+ void push_back(value_type&& x);
2168
790
 
2169
791
  //! <b>Requires</b>: p must be a valid iterator of *this.
2170
792
  //!
@@ -2174,7 +796,7 @@ class deque : protected deque_base<typename real_allocator<T, Allocator>::type,
2174
796
  //!
2175
797
  //! <b>Throws</b>: If memory allocation throws or x's copy constructor throws.
2176
798
  //!
2177
- //! <b>Complexity</b>: If p is end(), amortized constant time
799
+ //! <b>Complexity</b>: If p is end() or begin(), amortized constant time
2178
800
  //! Linear time otherwise.
2179
801
  iterator insert(const_iterator p, const T &x);
2180
802
 
@@ -2186,12 +808,9 @@ class deque : protected deque_base<typename real_allocator<T, Allocator>::type,
2186
808
  //!
2187
809
  //! <b>Throws</b>: If memory allocation throws.
2188
810
  //!
2189
- //! <b>Complexity</b>: If p is end(), amortized constant time
811
+ //! <b>Complexity</b>: If p is end() or begin(), amortized constant time
2190
812
  //! Linear time otherwise.
2191
813
  iterator insert(const_iterator p, T &&x);
2192
- #else
2193
- BOOST_MOVE_CONVERSION_AWARE_CATCH_1ARG(insert, T, iterator, priv_insert, const_iterator, const_iterator)
2194
- #endif
2195
814
 
2196
815
  //! <b>Requires</b>: pos must be a valid iterator of *this.
2197
816
  //!
@@ -2202,12 +821,7 @@ class deque : protected deque_base<typename real_allocator<T, Allocator>::type,
2202
821
  //! <b>Throws</b>: If memory allocation throws or T's copy constructor throws.
2203
822
  //!
2204
823
  //! <b>Complexity</b>: Linear to n.
2205
- inline iterator insert(const_iterator pos, size_type n, const value_type& x)
2206
- {
2207
- BOOST_ASSERT(this->priv_in_range_or_end(pos));
2208
- dtl::insert_n_copies_proxy<ValAllocator> proxy(x);
2209
- return this->priv_insert_aux_impl(pos, n, proxy);
2210
- }
824
+ inline iterator insert(const_iterator pos, size_type n, const value_type& x);
2211
825
 
2212
826
  //! <b>Requires</b>: pos must be a valid iterator of *this.
2213
827
  //!
@@ -2220,28 +834,8 @@ class deque : protected deque_base<typename real_allocator<T, Allocator>::type,
2220
834
  //!
2221
835
  //! <b>Complexity</b>: Linear to distance [first, last).
2222
836
  template <class InIt>
2223
- iterator insert(const_iterator pos, InIt first, InIt last
2224
- #if !defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
2225
- , typename dtl::disable_if_or
2226
- < void
2227
- , dtl::is_convertible<InIt, size_type>
2228
- , dtl::is_not_input_iterator<InIt>
2229
- >::type * = 0
2230
- #endif
2231
- )
2232
- {
2233
- BOOST_ASSERT(this->priv_in_range_or_end(pos));
2234
- size_type n = 0;
2235
- iterator it(pos.unconst());
2236
- for(;first != last; ++first, ++n){
2237
- it = this->emplace(it, *first);
2238
- ++it;
2239
- }
2240
- it -= difference_type(n);
2241
- return it;
2242
- }
837
+ iterator insert(const_iterator pos, InIt first, InIt last);
2243
838
 
2244
- #if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
2245
839
  //! <b>Requires</b>: pos must be a valid iterator of *this.
2246
840
  //!
2247
841
  //! <b>Effects</b>: Insert a copy of the [il.begin(), il.end()) range before pos.
@@ -2252,76 +846,21 @@ class deque : protected deque_base<typename real_allocator<T, Allocator>::type,
2252
846
  //! dereferenced std::initializer_list throws or T's copy constructor throws.
2253
847
  //!
2254
848
  //! <b>Complexity</b>: Linear to distance [il.begin(), il.end()).
2255
- inline iterator insert(const_iterator pos, std::initializer_list<value_type> il)
2256
- {
2257
- //Range check os pos is done in insert()
2258
- return insert(pos, il.begin(), il.end());
2259
- }
2260
- #endif
2261
-
2262
- #if !defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
2263
- template <class FwdIt>
2264
- inline iterator insert(const_iterator p, FwdIt first, FwdIt last
2265
- #if !defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
2266
- , typename dtl::disable_if_or
2267
- < void
2268
- , dtl::is_convertible<FwdIt, size_type>
2269
- , dtl::is_input_iterator<FwdIt>
2270
- >::type * = 0
2271
- #endif
2272
- )
2273
- {
2274
- BOOST_ASSERT(this->priv_in_range_or_end(p));
2275
-
2276
- typedef typename iter_size<FwdIt>::type it_size_type;
2277
- const it_size_type sz = boost::container::iterator_udistance(first, last);
2278
- if (BOOST_UNLIKELY(sz > size_type(-1))){
2279
- boost::container::throw_length_error("vector::insert, FwdIt's max length reached");
2280
- }
2281
- const size_type n = static_cast<size_type>(sz);
2282
-
2283
- dtl::insert_range_proxy<ValAllocator, FwdIt> proxy(first);
2284
- return this->priv_insert_aux_impl( p, n, proxy);
2285
- }
2286
- #endif
849
+ iterator insert(const_iterator pos, std::initializer_list<value_type> il);
2287
850
 
2288
851
  //! <b>Effects</b>: Removes the first element from the deque.
2289
852
  //!
2290
853
  //! <b>Throws</b>: Nothing.
2291
854
  //!
2292
855
  //! <b>Complexity</b>: Constant time.
2293
- void pop_front() BOOST_NOEXCEPT_OR_NOTHROW
2294
- {
2295
- BOOST_ASSERT(!this->empty());
2296
- if (BOOST_LIKELY(this->prot_pop_front_simple_available())) {
2297
- allocator_traits_type::destroy
2298
- ( this->alloc()
2299
- , boost::movelib::to_raw_pointer(this->prot_start_cur_unchecked())
2300
- );
2301
- this->prot_inc_start();
2302
- }
2303
- else
2304
- this->priv_pop_front_aux();
2305
- }
856
+ void pop_front();
2306
857
 
2307
858
  //! <b>Effects</b>: Removes the last element from the deque.
2308
859
  //!
2309
860
  //! <b>Throws</b>: Nothing.
2310
861
  //!
2311
862
  //! <b>Complexity</b>: Constant time.
2312
- void pop_back() BOOST_NOEXCEPT_OR_NOTHROW
2313
- {
2314
- BOOST_ASSERT(!this->empty());
2315
- if (BOOST_LIKELY(this->prot_pop_back_simple_available())) {
2316
- this->prot_dec_finish();
2317
- allocator_traits_type::destroy
2318
- ( this->alloc()
2319
- , boost::movelib::to_raw_pointer(this->prot_finish_cur_unchecked())
2320
- );
2321
- }
2322
- else
2323
- this->priv_pop_back_aux();
2324
- }
863
+ void pop_back();
2325
864
 
2326
865
  //! <b>Effects</b>: Erases the element at p.
2327
866
  //!
@@ -2331,25 +870,6 @@ class deque : protected deque_base<typename real_allocator<T, Allocator>::type,
2331
870
  //! last element (if pos is near the end) or the first element
2332
871
  //! if(pos is near the beginning).
2333
872
  //! Constant if pos is the first or the last element.
2334
- iterator erase(const_iterator pos) BOOST_NOEXCEPT_OR_NOTHROW
2335
- {
2336
- BOOST_ASSERT(this->priv_in_range(pos));
2337
- iterator next = pos.unconst();
2338
- ++next;
2339
- const size_type index = this->prot_it_to_start_off(pos);
2340
- const size_type sz = this->prot_size();
2341
- if (index < sz/2u) {
2342
- this->priv_segmented_move_backward_n(pos.unconst(), index, next);
2343
- pop_front();
2344
- return next;
2345
- }
2346
- else {
2347
- this->priv_segmented_move_n(next, size_type(sz - size_type(index + 1u)), pos.unconst());
2348
- pop_back();
2349
- return pos.unconst();
2350
- }
2351
- }
2352
-
2353
873
  //! <b>Effects</b>: Erases the elements pointed by [first, last).
2354
874
  //!
2355
875
  //! <b>Throws</b>: Nothing.
@@ -2358,709 +878,84 @@ class deque : protected deque_base<typename real_allocator<T, Allocator>::type,
2358
878
  //! last plus the elements between pos and the
2359
879
  //! last element (if pos is near the end) or the first element
2360
880
  //! if(pos is near the beginning).
2361
- iterator erase(const_iterator first, const_iterator last) BOOST_NOEXCEPT_OR_NOTHROW
2362
- {
2363
- BOOST_ASSERT(first == last ||
2364
- (first < last && this->priv_in_range(first) && this->priv_in_range_or_end(last)));
2365
- const size_type n = static_cast<size_type>(last - first);
2366
- if (n == this->prot_size()) {
2367
- this->clear();
2368
- return this->end();
2369
- }
2370
- else {
2371
- const size_type elems_before = this->prot_it_to_start_off(first);
2372
- const size_type elems_after = size_type(this->prot_size() - n - elems_before);
2373
- if (elems_before < elems_after) {
2374
- const iterator old_start = this->begin();
2375
- iterator new_start = this->priv_segmented_move_backward_n(first.unconst(), elems_before, last.unconst());
2376
- this->prot_destroy_range(old_start, new_start);
2377
- this->prot_deallocate_nodes_if_not_reservable(old_start.get_node(), new_start.m_node);
2378
- this->prot_inc_start(n);
2379
- }
2380
- else {
2381
- const iterator old_finish = this->end();
2382
- iterator new_finish = this->priv_segmented_move_n(last.unconst(), elems_after, first.unconst());
2383
- this->prot_destroy_range(new_finish, old_finish);
2384
- this->prot_deallocate_nodes_if_not_reservable(new_finish.m_node + 1, old_finish.get_node() + 1);
2385
- this->prot_dec_finish(n);
2386
- }
2387
- return this->nth(elems_before);
2388
- }
2389
- }
881
+ iterator erase(const_iterator first, const_iterator last);
2390
882
 
2391
883
  //! <b>Effects</b>: Swaps the contents of *this and x.
2392
884
  //!
2393
885
  //! <b>Throws</b>: Nothing.
2394
886
  //!
2395
887
  //! <b>Complexity</b>: Constant.
2396
- inline void swap(deque &x)
2397
- BOOST_NOEXCEPT_IF(allocator_traits_type::propagate_on_container_swap::value
2398
- || allocator_traits_type::is_always_equal::value)
2399
- {
2400
- this->swap_members(x);
2401
- dtl::bool_<allocator_traits_type::propagate_on_container_swap::value> flag;
2402
- dtl::swap_alloc(this->alloc(), x.alloc(), flag);
2403
- dtl::swap_alloc(this->ptr_alloc(), x.ptr_alloc(), flag);
2404
- }
888
+ void swap(deque& x);
2405
889
 
2406
890
  //! <b>Effects</b>: Erases all the elements of the deque.
2407
891
  //!
2408
892
  //! <b>Throws</b>: Nothing.
2409
893
  //!
2410
894
  //! <b>Complexity</b>: Linear to the number of elements in the deque.
2411
- void clear() BOOST_NOEXCEPT_OR_NOTHROW
2412
- {
2413
- if (!this->empty()) {
2414
- const iterator start = this->prot_start();
2415
- const iterator finish = this->prot_finish();
2416
- const index_pointer start_node = start.get_node();
2417
- const index_pointer finish_node = finish.get_node();
2418
- for (index_pointer node = start_node + 1; node < finish_node; ++node) {
2419
- this->prot_destroy_range(*node, *node + get_block_ssize());
2420
- this->prot_deallocate_node_if_not_reservable(*node);
2421
- }
2422
-
2423
- if (start_node != finish_node) {
2424
- this->prot_destroy_range(start.get_cur(), start.get_last());
2425
- this->prot_destroy_range(finish.get_first(), finish.get_cur());
2426
- this->prot_deallocate_node_if_not_reservable(finish.get_first());
2427
- }
2428
- else
2429
- this->prot_destroy_range(start.get_cur(), finish.get_cur());
2430
-
2431
- this->prot_reset_finish_to_start();
2432
- }
2433
- }
895
+ void clear();
896
+
897
+ #endif // BOOST_CONTAINER_DOXYGEN_INVOKED
2434
898
 
2435
899
  //! <b>Effects</b>: Returns true if x and y are equal
2436
900
  //!
2437
901
  //! <b>Complexity</b>: Linear to the number of elements in the container.
2438
- BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline
902
+ BOOST_CONTAINER_NODISCARD inline
2439
903
  friend bool operator==(const deque& x, const deque& y)
2440
- { return x.size() == y.size() && ::boost::container::algo_equal(x.begin(), x.end(), y.begin()); }
904
+ { return static_cast<const base_type&>(x) == static_cast<const base_type&>(y); }
2441
905
 
2442
906
  //! <b>Effects</b>: Returns true if x and y are unequal
2443
907
  //!
2444
908
  //! <b>Complexity</b>: Linear to the number of elements in the container.
2445
- BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline
909
+ BOOST_CONTAINER_NODISCARD inline
2446
910
  friend bool operator!=(const deque& x, const deque& y)
2447
- { return !(x == y); }
911
+ { return static_cast<const base_type&>(x) != static_cast<const base_type&>(y); }
2448
912
 
2449
913
  //! <b>Effects</b>: Returns true if x is less than y
2450
914
  //!
2451
915
  //! <b>Complexity</b>: Linear to the number of elements in the container.
2452
- BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline
916
+ BOOST_CONTAINER_NODISCARD inline
2453
917
  friend bool operator<(const deque& x, const deque& y)
2454
- { return ::boost::container::algo_lexicographical_compare(x.begin(), x.end(), y.begin(), y.end()); }
918
+ { return static_cast<const base_type&>(x) < static_cast<const base_type&>(y); }
2455
919
 
2456
920
  //! <b>Effects</b>: Returns true if x is greater than y
2457
921
  //!
2458
922
  //! <b>Complexity</b>: Linear to the number of elements in the container.
2459
- BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline
923
+ BOOST_CONTAINER_NODISCARD inline
2460
924
  friend bool operator>(const deque& x, const deque& y)
2461
- { return y < x; }
925
+ { return static_cast<const base_type&>(x) > static_cast<const base_type&>(y); }
2462
926
 
2463
927
  //! <b>Effects</b>: Returns true if x is equal or less than y
2464
928
  //!
2465
929
  //! <b>Complexity</b>: Linear to the number of elements in the container.
2466
- BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline
930
+ BOOST_CONTAINER_NODISCARD inline
2467
931
  friend bool operator<=(const deque& x, const deque& y)
2468
- { return !(y < x); }
932
+ { return static_cast<const base_type&>(x) <= static_cast<const base_type&>(y); }
2469
933
 
2470
934
  //! <b>Effects</b>: Returns true if x is equal or greater than y
2471
935
  //!
2472
936
  //! <b>Complexity</b>: Linear to the number of elements in the container.
2473
- BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline
937
+ BOOST_CONTAINER_NODISCARD inline
2474
938
  friend bool operator>=(const deque& x, const deque& y)
2475
- { return !(x < y); }
939
+ { return static_cast<const base_type&>(x) >= static_cast<const base_type&>(y); }
2476
940
 
2477
941
  //! <b>Effects</b>: x.swap(y)
2478
942
  //!
2479
943
  //! <b>Complexity</b>: Constant.
2480
944
  inline friend void swap(deque& x, deque& y)
2481
945
  BOOST_NOEXCEPT_IF(BOOST_NOEXCEPT(x.swap(y)))
2482
- { x.swap(y); }
2483
-
2484
- #ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
2485
- private:
2486
-
2487
- template <class InsertProxy>
2488
- void priv_assign(size_type n, InsertProxy proxy)
2489
- {
2490
- const size_type sz = this->prot_size();
2491
- this->priv_segmented_proxy_copy_n_and_update(this->begin(), sz < n ? sz : n, proxy);
2492
- if (n > sz) {
2493
- this->priv_insert_back_aux_impl(size_type(n - sz), proxy);
2494
- }
2495
- else{
2496
- this->priv_erase_last_n(size_type(sz - n));
2497
- }
2498
- }
2499
-
2500
- void priv_move_assign(BOOST_RV_REF(deque) x, dtl::bool_<true> /*steal_resources*/)
2501
- {
2502
- //Destroy objects but retain memory in case x reuses it in the future
2503
- this->clear();
2504
- //Move allocator if needed
2505
- dtl::bool_<allocator_traits_type::propagate_on_container_move_assignment::value> flag;
2506
- dtl::move_alloc(this->alloc(), x.alloc(), flag);
2507
- dtl::move_alloc(this->ptr_alloc(), x.ptr_alloc(), flag);
2508
- //Nothrow swap
2509
- this->swap_members(x);
2510
- }
2511
-
2512
- void priv_move_assign(BOOST_RV_REF(deque) x, dtl::bool_<false> /*steal_resources*/)
2513
- {
2514
- //We can't guarantee a compile-time equal allocator or propagation so fallback to runtime
2515
- //Resources can be transferred if both allocators are equal
2516
- if (this->alloc() == x.alloc()) {
2517
- this->priv_move_assign(boost::move(x), dtl::true_());
2518
- }
2519
- else {
2520
- this->assign(boost::make_move_iterator(x.begin()), boost::make_move_iterator(x.end()));
2521
- }
2522
- }
2523
-
2524
- inline size_type priv_index_of(const_iterator p) const
2525
- {
2526
- BOOST_ASSERT(this->cbegin() <= p);
2527
- BOOST_ASSERT(p <= this->cend());
2528
- return this->prot_it_to_start_off(p);
2529
- }
2530
-
2531
- void priv_erase_last_n(size_type n)
2532
- {
2533
- const size_type sz = this->prot_size();
2534
- BOOST_ASSERT(n <= sz);
2535
-
2536
- if(sz) {
2537
- const iterator old_finish = this->prot_finish();
2538
- const iterator new_finish = old_finish - difference_type(n);
2539
- this->prot_destroy_range(new_finish, old_finish);
2540
- this->prot_deallocate_nodes_if_not_reservable(new_finish.get_node() + 1, old_finish.get_node() + 1);
2541
- this->prot_dec_finish(n);
2542
- }
2543
- }
2544
-
2545
- void priv_throw_if_out_of_range(size_type n) const
2546
- {
2547
- if (n >= this->size())
2548
- throw_out_of_range("deque::at out of range");
2549
- }
2550
-
2551
- inline bool priv_in_range(const_iterator pos) const
2552
- {
2553
- return (this->begin() <= pos) && (pos < this->end());
2554
- }
2555
-
2556
- inline bool priv_in_range_or_end(const_iterator pos) const
2557
- {
2558
- return (this->begin() <= pos) && (pos <= this->end());
2559
- }
2560
-
2561
- template <class U>
2562
- BOOST_CONTAINER_FORCEINLINE iterator priv_insert(const_iterator p, BOOST_FWD_REF(U) x)
2563
- {
2564
- return this->emplace(p, ::boost::forward<U>(x));
2565
- }
2566
-
2567
- template <class U>
2568
- BOOST_CONTAINER_FORCEINLINE void priv_push_back(BOOST_FWD_REF(U) u)
2569
- {
2570
- this->emplace_back(::boost::forward<U>(u));
2571
- }
2572
-
2573
- template <class U>
2574
- BOOST_CONTAINER_FORCEINLINE void priv_push_front(BOOST_FWD_REF(U) u)
2575
- {
2576
- this->emplace_front(::boost::forward<U>(u));
2577
- }
2578
-
2579
- void prot_destroy_range(iterator start, iterator finish)
2580
- {
2581
- (void)start; (void)finish;
2582
- BOOST_IF_CONSTEXPR(!Base::traits_t::trivial_dctr){
2583
- const index_pointer start_node = start.get_node();
2584
- const index_pointer finish_node = finish.get_node();
2585
-
2586
- //In a sane deque both should be null or non-null
2587
- BOOST_ASSERT(!start_node == !finish_node);
2588
- if(start_node){
2589
- for (index_pointer node = start_node + 1; node < finish_node; ++node) {
2590
- this->prot_destroy_range(*node, *node + get_block_ssize());
2591
- }
2592
-
2593
- if (start_node != finish_node) {
2594
- this->prot_destroy_range(start.get_cur(), start.get_last());
2595
- this->prot_destroy_range(finish.get_first(), finish.get_cur());
2596
- }
2597
- else
2598
- this->prot_destroy_range(start.get_cur(), finish.get_cur());
2599
- }
2600
- }
2601
- }
2602
-
2603
- void prot_destroy_range(pointer p, pointer p2)
2604
- {
2605
- (void)p; (void)p2;
2606
- BOOST_IF_CONSTEXPR(!Base::traits_t::trivial_dctr){
2607
- for(;p != p2; ++p){
2608
- allocator_traits_type::destroy(this->alloc(), boost::movelib::iterator_to_raw_pointer(p));
2609
- }
2610
- }
2611
- }
2612
-
2613
- template<class InsertProxy>
2614
- iterator priv_insert_middle_aux_impl(const size_type elemsbefore, const size_type n, InsertProxy proxy)
2615
- {
2616
- typedef dtl::bool_<dtl::is_single_value_proxy<InsertProxy>::value> single_t;
2617
- BOOST_ASSERT(!single_t::value || n == 1);
2618
-
2619
- const size_type length = this->prot_size();
2620
- if (elemsbefore < length / 2) {
2621
- this->priv_reserve_elements_at_front(n);
2622
- const iterator old_start = this->prot_start();
2623
- iterator new_start = old_start;
2624
- priv_itsub(new_start, n, single_t());
2625
-
2626
- BOOST_ASSERT(!single_t::value || elemsbefore >= 1);
2627
-
2628
- if(single_t::value || elemsbefore >= n) {
2629
- iterator start_n = old_start;
2630
- priv_itadd(start_n, n, single_t());
2631
- BOOST_CONTAINER_TRY {
2632
- this->priv_segmented_uninitialized_move_alloc_n(old_start, n, new_start, single_t());
2633
- }
2634
- BOOST_CONTAINER_CATCH(...) {
2635
- this->prot_deallocate_nodes_if_not_reservable(new_start.m_node, old_start.m_node);
2636
- BOOST_CONTAINER_RETHROW
2637
- }
2638
- BOOST_CONTAINER_CATCH_END
2639
-
2640
- this->prot_dec_start(n);
2641
- iterator p = this->priv_segmented_move_n(start_n, size_type(elemsbefore - n), old_start);
2642
- this->priv_segmented_proxy_copy_n_and_update(p, n, proxy);
2643
- return p;
2644
- }
2645
- else {
2646
- const size_type mid_count = size_type(n - elemsbefore);
2647
- iterator mid_start = old_start - difference_type(mid_count);
2648
-
2649
- BOOST_CONTAINER_TRY {
2650
- this->priv_segmented_proxy_uninitialized_copy_n_and_update(mid_start, mid_count, proxy);
2651
- this->prot_dec_start(mid_count);
2652
- this->priv_segmented_uninitialized_move_alloc_n(old_start, elemsbefore, new_start);
2653
- }
2654
- BOOST_CONTAINER_CATCH(...) {
2655
- this->prot_deallocate_nodes_if_not_reservable(new_start.m_node, old_start.get_node());
2656
- BOOST_CONTAINER_RETHROW
2657
- }
2658
- BOOST_CONTAINER_CATCH_END
2659
- this->prot_dec_start(size_type(n - mid_count));
2660
- this->priv_segmented_proxy_copy_n_and_update(old_start, elemsbefore, proxy);
2661
- return mid_start;
2662
- }
2663
- }
2664
- else {
2665
- this->priv_reserve_elements_at_back(n);
2666
- const iterator old_finish = this->prot_finish();
2667
- const size_type elemsafter = size_type(length - elemsbefore);
2668
-
2669
- BOOST_ASSERT(!single_t::value || elemsafter >= 1);
2670
-
2671
- if(single_t::value || elemsafter >= n) {
2672
- iterator finish_n = old_finish;
2673
- priv_itsub(finish_n, n, single_t());
2674
- BOOST_CONTAINER_TRY {
2675
- this->priv_segmented_uninitialized_move_alloc_n(finish_n, n, old_finish, single_t());
2676
- }
2677
- BOOST_CONTAINER_CATCH(...) {
2678
- this->prot_deallocate_nodes_if_not_reservable(old_finish.get_node() + 1, (old_finish + difference_type(n)).m_node + 1);
2679
- BOOST_CONTAINER_RETHROW
2680
- }
2681
- BOOST_CONTAINER_CATCH_END
2682
-
2683
- this->prot_inc_finish(n);
2684
- const size_type move_n = size_type(elemsafter - n);
2685
- this->priv_segmented_move_backward_n(finish_n, move_n, old_finish);
2686
- finish_n -= difference_type(move_n);
2687
- this->priv_segmented_proxy_copy_n_and_update(finish_n, n, proxy);
2688
- return finish_n;
2689
- }
2690
- else {
2691
- const size_type raw_gap = size_type(n - elemsafter);
2692
- iterator pos = old_finish - difference_type(elemsafter);
2693
-
2694
- BOOST_CONTAINER_TRY{
2695
- this->priv_segmented_uninitialized_move_alloc_n(pos, elemsafter, old_finish + difference_type(raw_gap));
2696
- BOOST_CONTAINER_TRY{
2697
- this->priv_segmented_proxy_copy_n_and_update(pos, elemsafter, proxy);
2698
- this->priv_segmented_proxy_uninitialized_copy_n_and_update(old_finish, raw_gap, proxy);
2699
- }
2700
- BOOST_CONTAINER_CATCH(...) {
2701
- this->prot_destroy_range(old_finish, old_finish + difference_type(elemsafter));
2702
- BOOST_CONTAINER_RETHROW
2703
- }
2704
- BOOST_CONTAINER_CATCH_END
2705
- }
2706
- BOOST_CONTAINER_CATCH(...) {
2707
- this->prot_deallocate_nodes_if_not_reservable(old_finish.get_node() + 1, (old_finish + difference_type(n)).m_node + 1);
2708
- BOOST_CONTAINER_RETHROW
2709
- }
2710
- BOOST_CONTAINER_CATCH_END
2711
- this->prot_inc_finish(n);
2712
- return pos;
2713
- }
2714
- }
2715
- }
2716
-
2717
- template<class InsertProxy>
2718
- iterator priv_insert_aux_impl(const_iterator p, size_type n, InsertProxy proxy)
2719
- {
2720
- const size_type elemsbefore = this->prot_it_to_start_off(p);
2721
-
2722
- if (!elemsbefore) {
2723
- return this->priv_insert_front_aux_impl(n, proxy);
2724
- }
2725
- else if (elemsbefore == this->prot_size()) {
2726
- return this->priv_insert_back_aux_impl(n, proxy);
2727
- }
2728
- else {
2729
- return this->priv_insert_middle_aux_impl(elemsbefore, n, proxy);
2730
- }
2731
- }
946
+ { static_cast<base_type&>(x).swap(static_cast<base_type&>(y)); }
2732
947
 
2733
- template <class InsertProxy>
2734
- void priv_segmented_proxy_uninitialized_copy_n_and_update(const iterator first, size_type n, InsertProxy &proxy)
2735
- {
2736
- BOOST_IF_CONSTEXPR (dtl::is_single_value_proxy<InsertProxy>::value) {
2737
- (void)n;
2738
- proxy.uninitialized_copy_n_and_update(this->alloc(), boost::movelib::to_raw_pointer(first.get_cur()), 1u);
2739
- }
2740
- else if (BOOST_LIKELY(n != 0)){ //We might initialize an empty range and current_node might be null
2741
- BOOST_CONSTEXPR_OR_CONST size_type block_size = get_block_size();
2742
-
2743
- index_pointer current_node = first.get_node();
2744
-
2745
- BOOST_CONTAINER_TRY{
2746
- const pointer cur = first.get_cur();
2747
- const size_type block = size_type(block_size - size_type(cur - *current_node));
2748
- size_type cnt = n < block ? n: block;
2749
- proxy.uninitialized_copy_n_and_update(this->alloc(), boost::movelib::to_raw_pointer(cur), cnt);
2750
- n = size_type(n - cnt);
2751
-
2752
- while (n) {
2753
- ++current_node;
2754
- cnt = n < block_size ? n: block_size;
2755
- proxy.uninitialized_copy_n_and_update(this->alloc(), boost::movelib::to_raw_pointer(*current_node), cnt);
2756
- n = size_type(n - cnt);
2757
- }
2758
- }
2759
- BOOST_CONTAINER_CATCH(...) {
2760
- this->prot_destroy_range(first, iterator(*current_node, current_node));
2761
- BOOST_CONTAINER_RETHROW
2762
- }
2763
- BOOST_CONTAINER_CATCH_END
2764
- }
2765
- }
2766
-
2767
-
2768
- template <class InsertProxy>
2769
- void priv_segmented_proxy_copy_n_and_update(const iterator first, size_type n, InsertProxy &proxy)
2770
- {
2771
- BOOST_IF_CONSTEXPR (dtl::is_single_value_proxy<InsertProxy>::value) {
2772
- (void)n;
2773
- proxy.copy_n_and_update(this->alloc(), boost::movelib::to_raw_pointer(first.get_cur()), 1u);
2774
- }
2775
- else if (BOOST_LIKELY(n != 0)){ //We might assign an empty range in a default constructed deque
2776
- BOOST_CONSTEXPR_OR_CONST size_type block_size = get_block_size();
2777
-
2778
- index_pointer current_node = first.get_node();
2779
-
2780
- const pointer cur = first.get_cur();
2781
- const size_type block = size_type(block_size - size_type(cur - *current_node));
2782
- size_type cnt = n < block ? n: block;
2783
- proxy.copy_n_and_update(this->alloc(), boost::movelib::to_raw_pointer(cur), cnt);
2784
- n = size_type(n - cnt);
2785
-
2786
- while (n) {
2787
- ++current_node;
2788
- cnt = n < block_size ? n: block_size;
2789
- proxy.copy_n_and_update(this->alloc(), boost::movelib::to_raw_pointer(*current_node), cnt);
2790
- n = size_type(n - cnt);
2791
- }
2792
- }
2793
- }
2794
-
2795
- template <class InsertProxy>
2796
- void priv_insert_segmented_uninitialized_copy_n_and_update(const iterator first, size_type n, InsertProxy proxy)
2797
- {
2798
- BOOST_CONTAINER_TRY{
2799
- this->priv_segmented_proxy_uninitialized_copy_n_and_update(first, n, proxy);
2800
- }
2801
- BOOST_CONTAINER_CATCH(...) {
2802
- this->prot_deallocate_nodes_if_not_reservable(first.get_node() + 1, (first+difference_type(n)).get_node() + 1);
2803
- BOOST_CONTAINER_RETHROW
2804
- }
2805
- BOOST_CONTAINER_CATCH_END
2806
- }
2807
-
2808
- template<class It>
2809
- static BOOST_CONTAINER_FORCEINLINE void priv_itadd(It &it, size_type, dtl::bool_<true> /*single element*/)
2810
- { ++it; }
2811
-
2812
- template<class It>
2813
- static BOOST_CONTAINER_FORCEINLINE void priv_itadd(It &it, size_type n, dtl::bool_<false> /*!single element*/)
2814
- { it += difference_type(n); }
2815
-
2816
- template<class It>
2817
- static BOOST_CONTAINER_FORCEINLINE void priv_itsub(It &it, size_type, dtl::bool_<true> /*single element*/)
2818
- { --it; }
2819
-
2820
- template<class It>
2821
- static BOOST_CONTAINER_FORCEINLINE void priv_itsub(It &it, size_type n, dtl::bool_<false> /*!single element*/)
2822
- { it -= difference_type(n); }
2823
-
2824
- void priv_segmented_uninitialized_move_alloc_n(iterator first, size_type n, iterator dest, dtl::bool_<true> /*single element*/)
2825
- {
2826
- BOOST_ASSERT(n == 1); (void)n;
2827
- allocator_traits_type::construct
2828
- ( this->alloc()
2829
- , boost::movelib::to_raw_pointer(dest.get_cur())
2830
- , boost::move(*first));
2831
- }
2832
-
2833
- void priv_segmented_uninitialized_move_alloc_n(iterator first, size_type n, iterator dest, dtl::bool_<false> /*!single element*/)
2834
- {
2835
- if (BOOST_LIKELY(n != 0)) { //Check for empty range, current_node might be null
2836
- BOOST_CONSTEXPR_OR_CONST size_type block_size = get_block_size();
2837
-
2838
- index_pointer current_node = first.get_node();
2839
-
2840
- BOOST_CONTAINER_TRY{
2841
- const pointer cur = first.get_cur();
2842
- const size_type block = size_type(block_size - size_type(cur - *current_node));
2843
- size_type cnt = n < block ? n: block;
2844
- dest = ::boost::container::uninitialized_move_alloc_n(this->alloc(), boost::movelib::to_raw_pointer(cur), cnt, dest);
2845
- n = size_type(n - cnt);
2846
-
2847
- while (n) {
2848
- ++current_node;
2849
- cnt = n < block_size ? n: block_size;
2850
- dest = ::boost::container::uninitialized_move_alloc_n(this->alloc(), boost::movelib::to_raw_pointer(*current_node), cnt, dest);
2851
- n = size_type(n - cnt);
2852
- }
2853
- }
2854
- BOOST_CONTAINER_CATCH(...) {
2855
- this->prot_destroy_range(first, iterator(*current_node, current_node));
2856
- BOOST_CONTAINER_RETHROW
2857
- }
2858
- BOOST_CONTAINER_CATCH_END
2859
- }
2860
- }
2861
-
2862
- BOOST_CONTAINER_FORCEINLINE void priv_segmented_uninitialized_move_alloc_n(iterator first, size_type n, iterator dest)
2863
- {
2864
- this->priv_segmented_uninitialized_move_alloc_n(first, n, dest, dtl::bool_<false>());
2865
- }
2866
-
2867
- void priv_segmented_uninitialized_copy_alloc_n(const_iterator first, size_type n, iterator dest)
2868
- {
2869
- if (BOOST_LIKELY(n != 0)) { //We might initialize an empty range and current_node might be null
2870
- BOOST_CONSTEXPR_OR_CONST size_type block_size = get_block_size();
2871
-
2872
- index_pointer current_node = first.get_node();
2873
-
2874
- BOOST_CONTAINER_TRY{
2875
- const pointer cur = first.get_cur();
2876
- const size_type block = size_type(block_size - size_type(cur - *current_node));
2877
- size_type cnt = n < block ? n: block;
2878
- dest = ::boost::container::uninitialized_copy_alloc_n(this->alloc(), boost::movelib::to_raw_pointer(cur), cnt, dest);
2879
- n = size_type(n - cnt);
2880
-
2881
- while (n) {
2882
- ++current_node;
2883
- cnt = n < block_size ? n: block_size;
2884
- dest = ::boost::container::uninitialized_copy_alloc_n(this->alloc(), boost::movelib::to_raw_pointer(*current_node), cnt, dest);
2885
- n = size_type(n - cnt);
2886
- }
2887
- }
2888
- BOOST_CONTAINER_CATCH(...) {
2889
- this->prot_destroy_range(first.unconst(), iterator(*current_node, current_node));
2890
- BOOST_CONTAINER_RETHROW
2891
- }
2892
- BOOST_CONTAINER_CATCH_END
2893
- }
2894
- }
2895
-
2896
- static iterator priv_segmented_move_n(const_iterator first, size_type n, iterator dest)
2897
- {
2898
- index_pointer current_node = first.get_node();
2899
- BOOST_ASSERT(current_node != index_pointer());
2900
-
2901
- const pointer cur = first.get_cur();
2902
- BOOST_CONSTEXPR_OR_CONST size_type block_size = get_block_size();
2903
-
2904
- const size_type block = size_type(block_size - size_type(cur - *current_node));
2905
- size_type cnt = n < block ? n: block;
2906
- dest = ::boost::container::move_n(boost::movelib::to_raw_pointer(cur), cnt, dest);
2907
- n = size_type(n - cnt);
2908
-
2909
- while (n) {
2910
- ++current_node;
2911
- cnt = n < block_size ? n: block_size;
2912
- dest = ::boost::container::move_n(boost::movelib::to_raw_pointer(*current_node), cnt, dest);
2913
- n = size_type(n - cnt);
2914
- }
2915
- return dest;
2916
- }
2917
-
2918
- static iterator priv_segmented_move_backward_n(iterator last, size_type n, iterator dest_last)
2919
- {
2920
- index_pointer current_node = last.get_node();
2921
- BOOST_ASSERT(current_node != index_pointer());
2922
-
2923
- const pointer cur = last.get_cur();
2924
- const size_type block = size_type(cur - *current_node);
2925
- size_type cnt = n < block ? n: block;
2926
- dest_last = ::boost::container::move_backward_n(boost::movelib::to_raw_pointer(cur), cnt, dest_last);
2927
- n = size_type(n - cnt);
2928
-
2929
- BOOST_CONSTEXPR_OR_CONST size_type block_size = get_block_size();
2930
-
2931
- while (n) {
2932
- --current_node;
2933
- cnt = n < block_size ? n: block_size;
2934
- dest_last = ::boost::container::move_backward_n(boost::movelib::to_raw_pointer(*current_node + difference_type(block_size)), cnt, dest_last);
2935
- n = size_type(n - cnt);
2936
- }
2937
- return dest_last;
2938
- }
2939
-
2940
- template <class InsertProxy>
2941
- iterator priv_insert_back_aux_impl(size_type n, InsertProxy proxy)
2942
- {
2943
- this->priv_reserve_elements_at_back(n);
2944
- const iterator old_finish = this->prot_finish();
2945
- this->priv_insert_segmented_uninitialized_copy_n_and_update(old_finish, n, proxy);
2946
- this->prot_inc_finish(n);
2947
- return old_finish;
2948
- }
2949
-
2950
- template <class InsertProxy>
2951
- iterator priv_insert_front_aux_impl(size_type n, InsertProxy proxy)
2952
- {
2953
- this->priv_reserve_elements_at_front(n);
2954
- const iterator old_start = this->prot_start();
2955
- const iterator new_start = old_start - difference_type(n);
2956
- this->priv_insert_segmented_uninitialized_copy_n_and_update(new_start, n, proxy);
2957
- this->prot_dec_start(n);
2958
- return new_start;
2959
- }
2960
-
2961
- // Precondition: this->prot_start() and this->prot_finish() have already been initialized,
2962
- // but none of the deque's elements have yet been constructed.
2963
- void priv_fill_initialize(size_type n, const value_type& value)
2964
- {
2965
- dtl::insert_n_copies_proxy<ValAllocator> proxy(value);
2966
- this->priv_segmented_proxy_uninitialized_copy_n_and_update(this->begin(), n, proxy);
2967
- }
2968
-
2969
- template <class InIt>
2970
- void priv_range_initialize(InIt first, InIt last, typename iterator_enable_if_tag<InIt, std::input_iterator_tag>::type* =0)
2971
- {
2972
- BOOST_CONTAINER_TRY {
2973
- for ( ; first != last; ++first)
2974
- this->emplace_back(*first);
2975
- }
2976
- BOOST_CONTAINER_CATCH(...){
2977
- this->clear();
2978
- BOOST_CONTAINER_RETHROW
2979
- }
2980
- BOOST_CONTAINER_CATCH_END
2981
- }
2982
-
2983
- template <class FwdIt>
2984
- void priv_range_initialize(FwdIt first, FwdIt last, typename iterator_disable_if_tag<FwdIt, std::input_iterator_tag>::type* =0)
2985
- {
2986
- typedef typename iter_size<FwdIt>::type it_size_type;
2987
- const it_size_type sz = boost::container::iterator_udistance(first, last);
2988
- if (BOOST_UNLIKELY(sz > size_type(-1))){
2989
- boost::container::throw_length_error("vector::insert, FwdIt's max length reached");
2990
- }
2991
- const size_type n = static_cast<size_type>(sz);
2992
- this->prot_initialize_map_and_nodes(n);
2993
-
2994
- dtl::insert_range_proxy<ValAllocator, FwdIt> proxy(first);
2995
- this->priv_segmented_proxy_uninitialized_copy_n_and_update(this->begin(), n, proxy);
2996
- }
2997
-
2998
- // Called only if this->prot_finish_cur() == this->prot_finish().get_first().
2999
- void priv_pop_back_aux() BOOST_NOEXCEPT_OR_NOTHROW
3000
- {
3001
- index_pointer ip = this->prot_finish_node();
3002
- this->prot_deallocate_node_if_not_reservable(*ip);
3003
- this->prot_dec_finish();
3004
- --ip;
3005
- allocator_traits_type::destroy
3006
- ( this->alloc()
3007
- , boost::movelib::to_raw_pointer(this->prot_node_last(ip))
3008
- );
3009
- }
3010
-
3011
- // Called only if this->prot_start_cur() == this->prot_start().get_last() - 1. Note that
3012
- // if the deque has at least one element (a precondition for this member
3013
- // function), and if this->prot_start_cur() == this->prot_start().get_last(), then the deque
3014
- // must have at least two nodes.
3015
- void priv_pop_front_aux() BOOST_NOEXCEPT_OR_NOTHROW
3016
- {
3017
- const index_pointer ip = this->prot_start_node();
3018
- allocator_traits_type::destroy
3019
- ( this->alloc()
3020
- , boost::movelib::to_raw_pointer(this->prot_node_last(ip))
3021
- );
3022
- this->prot_deallocate_node_if_not_reservable(*ip);
3023
- this->prot_inc_start();
3024
- }
3025
-
3026
- void priv_reserve_elements_at_front(size_type n)
3027
- {
3028
- const size_type vacancies = this->prot_front_free_capacity();
3029
- typedef dtl::bool_<is_reservable> res_t;
3030
-
3031
- if (n > vacancies){ //n == 0 handled in the else part
3032
- if(this->members_.m_map){
3033
- this->prot_reallocate_map_and_nodes(res_t(), size_type(n - vacancies), true);
3034
- }
3035
- else {
3036
- this->prot_initialize_map_and_nodes(n);
3037
- this->prot_reset_start_to_finish();
3038
- }
3039
- }
3040
- }
3041
-
3042
- void priv_reserve_elements_at_back(size_type n)
3043
- {
3044
- const size_type vacancies = this->prot_back_free_capacity();
3045
- typedef dtl::bool_<is_reservable> res_t;
3046
-
3047
- if (n > vacancies){ //n == 0 handled in the else part
3048
- if(this->members_.m_map){
3049
- this->prot_reallocate_map_and_nodes(res_t(), size_type(n - vacancies), false);
3050
- }
3051
- else{
3052
- this->prot_initialize_map_and_nodes(n);
3053
- this->prot_reset_finish_to_start();
3054
- }
3055
- }
3056
- }
3057
-
3058
- #endif //#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
3059
948
  };
3060
949
 
3061
950
  #ifndef BOOST_CONTAINER_NO_CXX17_CTAD
951
+ //! <b>Deduction guide</b>: allows a `deque` to be constructed from the iterator
952
+ //! range <code>[first, last)</code>, deducing the element type from the value type
953
+ //! of `InputIterator` and using the default allocator.
3062
954
  template <typename InputIterator>
3063
955
  deque(InputIterator, InputIterator) -> deque<typename iterator_traits<InputIterator>::value_type>;
956
+ //! <b>Deduction guide</b>: allows a `deque` to be constructed from the iterator
957
+ //! range <code>[first, last)</code>, deducing the element type from the value type
958
+ //! of `InputIterator` and taking the allocator type from the supplied allocator.
3064
959
  template <typename InputIterator, typename Allocator>
3065
960
  deque(InputIterator, InputIterator, Allocator const&) -> deque<typename iterator_traits<InputIterator>::value_type, Allocator>;
3066
961
  #endif
@@ -3094,18 +989,12 @@ inline typename deque<T, A, O>::size_type erase_if(deque<T, A, O>& c, Pred pred)
3094
989
 
3095
990
  namespace boost {
3096
991
 
3097
- //!has_trivial_destructor_after_move<> == true_type
3098
- //!specialization for optimizations
3099
992
  template <class T, class Allocator, class Options>
3100
993
  struct has_trivial_destructor_after_move<boost::container::deque<T, Allocator, Options> >
3101
- {
3102
- typedef typename boost::container::deque<T, Allocator, Options>::allocator_type allocator_type;
3103
- typedef typename ::boost::container::allocator_traits<allocator_type>::pointer pointer;
3104
- BOOST_STATIC_CONSTEXPR bool value = ::boost::has_trivial_destructor_after_move<allocator_type>::value &&
3105
- ::boost::has_trivial_destructor_after_move<pointer>::value;
3106
- };
994
+ : has_trivial_destructor_after_move<boost::container::deque_impl<T, Allocator, false, Options> >
995
+ {};
3107
996
 
3108
- }
997
+ } //namespace boost {
3109
998
 
3110
999
  #endif //#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
3111
1000