licenses.list.txt 44 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228
  1. ====================Apache-2.0====================
  2. Apache License
  3. Version 2.0, January 2004
  4. http://www.apache.org/licenses/
  5. TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
  6. 1. Definitions.
  7. "License" shall mean the terms and conditions for use, reproduction,
  8. and distribution as defined by Sections 1 through 9 of this document.
  9. "Licensor" shall mean the copyright owner or entity authorized by
  10. the copyright owner that is granting the License.
  11. "Legal Entity" shall mean the union of the acting entity and all
  12. other entities that control, are controlled by, or are under common
  13. control with that entity. For the purposes of this definition,
  14. "control" means (i) the power, direct or indirect, to cause the
  15. direction or management of such entity, whether by contract or
  16. otherwise, or (ii) ownership of fifty percent (50%) or more of the
  17. outstanding shares, or (iii) beneficial ownership of such entity.
  18. "You" (or "Your") shall mean an individual or Legal Entity
  19. exercising permissions granted by this License.
  20. "Source" form shall mean the preferred form for making modifications,
  21. including but not limited to software source code, documentation
  22. source, and configuration files.
  23. "Object" form shall mean any form resulting from mechanical
  24. transformation or translation of a Source form, including but
  25. not limited to compiled object code, generated documentation,
  26. and conversions to other media types.
  27. "Work" shall mean the work of authorship, whether in Source or
  28. Object form, made available under the License, as indicated by a
  29. copyright notice that is included in or attached to the work
  30. (an example is provided in the Appendix below).
  31. "Derivative Works" shall mean any work, whether in Source or Object
  32. form, that is based on (or derived from) the Work and for which the
  33. editorial revisions, annotations, elaborations, or other modifications
  34. represent, as a whole, an original work of authorship. For the purposes
  35. of this License, Derivative Works shall not include works that remain
  36. separable from, or merely link (or bind by name) to the interfaces of,
  37. the Work and Derivative Works thereof.
  38. "Contribution" shall mean any work of authorship, including
  39. the original version of the Work and any modifications or additions
  40. to that Work or Derivative Works thereof, that is intentionally
  41. submitted to Licensor for inclusion in the Work by the copyright owner
  42. or by an individual or Legal Entity authorized to submit on behalf of
  43. the copyright owner. For the purposes of this definition, "submitted"
  44. means any form of electronic, verbal, or written communication sent
  45. to the Licensor or its representatives, including but not limited to
  46. communication on electronic mailing lists, source code control systems,
  47. and issue tracking systems that are managed by, or on behalf of, the
  48. Licensor for the purpose of discussing and improving the Work, but
  49. excluding communication that is conspicuously marked or otherwise
  50. designated in writing by the copyright owner as "Not a Contribution."
  51. "Contributor" shall mean Licensor and any individual or Legal Entity
  52. on behalf of whom a Contribution has been received by Licensor and
  53. subsequently incorporated within the Work.
  54. 2. Grant of Copyright License. Subject to the terms and conditions of
  55. this License, each Contributor hereby grants to You a perpetual,
  56. worldwide, non-exclusive, no-charge, royalty-free, irrevocable
  57. copyright license to reproduce, prepare Derivative Works of,
  58. publicly display, publicly perform, sublicense, and distribute the
  59. Work and such Derivative Works in Source or Object form.
  60. 3. Grant of Patent License. Subject to the terms and conditions of
  61. this License, each Contributor hereby grants to You a perpetual,
  62. worldwide, non-exclusive, no-charge, royalty-free, irrevocable
  63. (except as stated in this section) patent license to make, have made,
  64. use, offer to sell, sell, import, and otherwise transfer the Work,
  65. where such license applies only to those patent claims licensable
  66. by such Contributor that are necessarily infringed by their
  67. Contribution(s) alone or by combination of their Contribution(s)
  68. with the Work to which such Contribution(s) was submitted. If You
  69. institute patent litigation against any entity (including a
  70. cross-claim or counterclaim in a lawsuit) alleging that the Work
  71. or a Contribution incorporated within the Work constitutes direct
  72. or contributory patent infringement, then any patent licenses
  73. granted to You under this License for that Work shall terminate
  74. as of the date such litigation is filed.
  75. 4. Redistribution. You may reproduce and distribute copies of the
  76. Work or Derivative Works thereof in any medium, with or without
  77. modifications, and in Source or Object form, provided that You
  78. meet the following conditions:
  79. (a) You must give any other recipients of the Work or
  80. Derivative Works a copy of this License; and
  81. (b) You must cause any modified files to carry prominent notices
  82. stating that You changed the files; and
  83. (c) You must retain, in the Source form of any Derivative Works
  84. that You distribute, all copyright, patent, trademark, and
  85. attribution notices from the Source form of the Work,
  86. excluding those notices that do not pertain to any part of
  87. the Derivative Works; and
  88. (d) If the Work includes a "NOTICE" text file as part of its
  89. distribution, then any Derivative Works that You distribute must
  90. include a readable copy of the attribution notices contained
  91. within such NOTICE file, excluding those notices that do not
  92. pertain to any part of the Derivative Works, in at least one
  93. of the following places: within a NOTICE text file distributed
  94. as part of the Derivative Works; within the Source form or
  95. documentation, if provided along with the Derivative Works; or,
  96. within a display generated by the Derivative Works, if and
  97. wherever such third-party notices normally appear. The contents
  98. of the NOTICE file are for informational purposes only and
  99. do not modify the License. You may add Your own attribution
  100. notices within Derivative Works that You distribute, alongside
  101. or as an addendum to the NOTICE text from the Work, provided
  102. that such additional attribution notices cannot be construed
  103. as modifying the License.
  104. You may add Your own copyright statement to Your modifications and
  105. may provide additional or different license terms and conditions
  106. for use, reproduction, or distribution of Your modifications, or
  107. for any such Derivative Works as a whole, provided Your use,
  108. reproduction, and distribution of the Work otherwise complies with
  109. the conditions stated in this License.
  110. 5. Submission of Contributions. Unless You explicitly state otherwise,
  111. any Contribution intentionally submitted for inclusion in the Work
  112. by You to the Licensor shall be under the terms and conditions of
  113. this License, without any additional terms or conditions.
  114. Notwithstanding the above, nothing herein shall supersede or modify
  115. the terms of any separate license agreement you may have executed
  116. with Licensor regarding such Contributions.
  117. 6. Trademarks. This License does not grant permission to use the trade
  118. names, trademarks, service marks, or product names of the Licensor,
  119. except as required for reasonable and customary use in describing the
  120. origin of the Work and reproducing the content of the NOTICE file.
  121. 7. Disclaimer of Warranty. Unless required by applicable law or
  122. agreed to in writing, Licensor provides the Work (and each
  123. Contributor provides its Contributions) on an "AS IS" BASIS,
  124. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
  125. implied, including, without limitation, any warranties or conditions
  126. of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
  127. PARTICULAR PURPOSE. You are solely responsible for determining the
  128. appropriateness of using or redistributing the Work and assume any
  129. risks associated with Your exercise of permissions under this License.
  130. 8. Limitation of Liability. In no event and under no legal theory,
  131. whether in tort (including negligence), contract, or otherwise,
  132. unless required by applicable law (such as deliberate and grossly
  133. negligent acts) or agreed to in writing, shall any Contributor be
  134. liable to You for damages, including any direct, indirect, special,
  135. incidental, or consequential damages of any character arising as a
  136. result of this License or out of the use or inability to use the
  137. Work (including but not limited to damages for loss of goodwill,
  138. work stoppage, computer failure or malfunction, or any and all
  139. other commercial damages or losses), even if such Contributor
  140. has been advised of the possibility of such damages.
  141. 9. Accepting Warranty or Additional Liability. While redistributing
  142. the Work or Derivative Works thereof, You may choose to offer,
  143. and charge a fee for, acceptance of support, warranty, indemnity,
  144. or other liability obligations and/or rights consistent with this
  145. License. However, in accepting such obligations, You may act only
  146. on Your own behalf and on Your sole responsibility, not on behalf
  147. of any other Contributor, and only if You agree to indemnify,
  148. defend, and hold each Contributor harmless for any liability
  149. incurred by, or claims asserted against, such Contributor by reason
  150. of your accepting any such warranty or additional liability.
  151. END OF TERMS AND CONDITIONS
  152. APPENDIX: How to apply the Apache License to your work.
  153. To apply the Apache License to your work, attach the following
  154. boilerplate notice, with the fields enclosed by brackets "[]"
  155. replaced with your own identifying information. (Don't include
  156. the brackets!) The text should be enclosed in the appropriate
  157. comment syntax for the file format. We also recommend that a
  158. file or class name and description of purpose be included on the
  159. same "printed page" as the copyright notice for easier
  160. identification within third-party archives.
  161. Copyright [yyyy] [name of copyright owner]
  162. Licensed under the Apache License, Version 2.0 (the "License");
  163. you may not use this file except in compliance with the License.
  164. You may obtain a copy of the License at
  165. http://www.apache.org/licenses/LICENSE-2.0
  166. Unless required by applicable law or agreed to in writing, software
  167. distributed under the License is distributed on an "AS IS" BASIS,
  168. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  169. See the License for the specific language governing permissions and
  170. limitations under the License.
  171. ====================Apache-2.0 WITH LLVM-exception====================
  172. * Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  173. * See https://llvm.org/LICENSE.txt for license information.
  174. ====================Apache-2.0 WITH LLVM-exception====================
  175. * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  176. ====================Apache-2.0 WITH LLVM-exception====================
  177. ---- LLVM Exceptions to the Apache 2.0 License ----
  178. As an exception, if, as a result of your compiling your source code, portions
  179. of this Software are embedded into an Object form of such source code, you
  180. may redistribute such embedded portions in such Object form without complying
  181. with the conditions of Sections 4(a), 4(b) and 4(d) of the License.
  182. In addition, if you combine or link compiled forms of this Software with
  183. software that is licensed under the GPLv2 ("Combined Software") and if a
  184. court of competent jurisdiction determines that the patent provision (Section
  185. 3), the indemnity provision (Section 9) or other Section of the License
  186. conflicts with the conditions of the GPLv2, you may retroactively and
  187. prospectively choose to deem waived or otherwise exclude such Section(s) of
  188. the License, but only in their entirety and only with respect to the Combined
  189. Software.
  190. ====================Apache-2.0 WITH LLVM-exception====================
  191. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  192. // See https://llvm.org/LICENSE.txt for license information.
  193. ====================Apache-2.0 WITH LLVM-exception====================
  194. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  195. ====================Apache-2.0 WITH LLVM-exception====================
  196. The LLVM Project is under the Apache License v2.0 with LLVM Exceptions:
  197. ====================BSL-1.0====================
  198. // Boost Software License - Version 1.0 - August 17th, 2003
  199. // Permission is hereby granted, free of charge, to any person or organization
  200. // obtaining a copy of the software and accompanying documentation covered by
  201. // this license (the "Software") to use, reproduce, display, distribute,
  202. // execute, and transmit the Software, and to prepare derivative works of the
  203. // Software, and to permit third-parties to whom the Software is furnished to
  204. // do so, all subject to the following:
  205. // The copyright notices in the Software and this entire statement, including
  206. // the above license grant, this restriction and the following disclaimer,
  207. // must be included in all copies of the Software, in whole or in part, and
  208. // all derivative works of the Software, unless such copies or derivative
  209. // works are solely in the form of machine-executable object code generated by
  210. // a source language processor.
  211. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  212. // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  213. // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
  214. // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
  215. // FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
  216. // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  217. // DEALINGS IN THE SOFTWARE.
  218. ====================COPYRIGHT====================
  219. // Copyright (2022) National Technology & Engineering
  220. // Solutions of Sandia, LLC (NTESS).
  221. ====================COPYRIGHT====================
  222. // Copyright (c) 1991-2022 Unicode, Inc. All rights reserved.
  223. ====================COPYRIGHT====================
  224. // Copyright (c) Microsoft Corporation.
  225. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  226. ====================COPYRIGHT====================
  227. // Copyright 2018 Ulf Adams
  228. // Copyright (c) Microsoft Corporation. All rights reserved.
  229. ====================COPYRIGHT====================
  230. Copyright (c) 2009-2014 by the contributors listed in CREDITS.TXT
  231. ====================COPYRIGHT====================
  232. Copyright (c) 2009-2019 by the contributors listed in CREDITS.TXT
  233. ====================File: CREDITS.TXT====================
  234. This file is a partial list of people who have contributed to the LLVM/libc++
  235. project. If you have contributed a patch or made some other contribution to
  236. LLVM/libc++, please submit a patch to this file to add yourself, and it will be
  237. done!
  238. The list is sorted by surname and formatted to allow easy grepping and
  239. beautification by scripts. The fields are: name (N), email (E), web-address
  240. (W), PGP key ID and fingerprint (P), description (D), and snail-mail address
  241. (S).
  242. N: Saleem Abdulrasool
  243. E: compnerd@compnerd.org
  244. D: Minor patches and Linux fixes.
  245. N: Ulf Adams
  246. D: Invented the Ryu and Ryu Printf algorithms used in floating-point to_chars, and wrote the initial code.
  247. N: Muiez Ahmed
  248. E: muiez@ibm.com
  249. D: z/OS port.
  250. N: Dan Albert
  251. E: danalbert@google.com
  252. D: Android support and test runner improvements.
  253. N: Dimitry Andric
  254. E: dimitry@andric.com
  255. D: Visibility fixes, minor FreeBSD portability patches.
  256. N: Holger Arnold
  257. E: holgerar@gmail.com
  258. D: Minor fix.
  259. N: Jorg Brown
  260. D: Ported floating-point to_chars from MSVC to libc++.
  261. N: David Chisnall
  262. E: theraven at theravensnest dot org
  263. D: FreeBSD and Solaris ports, libcxxrt support, some atomics work.
  264. N: Marshall Clow
  265. E: mclow.lists@gmail.com
  266. E: marshall@idio.com
  267. D: C++14 support, patches and bug fixes.
  268. N: Jonathan B Coe
  269. E: jbcoe@me.com
  270. D: Implementation of propagate_const.
  271. N: Matthew Dempsky
  272. E: matthew@dempsky.org
  273. D: Minor patches and bug fixes.
  274. N: Christopher Di Bella
  275. E: cjdb@google.com
  276. E: cjdb.ns@gmail.com
  277. D: Library concepts.
  278. N: Glen Joseph Fernandes
  279. E: glenjofe@gmail.com
  280. D: Implementation of to_address.
  281. N: Eric Fiselier
  282. E: eric@efcs.ca
  283. D: LFTS support, patches and bug fixes.
  284. N: Bill Fisher
  285. E: william.w.fisher@gmail.com
  286. D: Regex bug fixes.
  287. N: Google Inc.
  288. D: Copyright owner and contributor of the CityHash algorithm
  289. N: Howard Hinnant
  290. E: hhinnant@apple.com
  291. D: Architect and primary author of libc++
  292. N: Sergej Jaskiewicz
  293. E: jaskiewiczs@icloud.com
  294. D: Minor improvements in the testing infrastructure
  295. N: Hyeon-bin Jeong
  296. E: tuhertz@gmail.com
  297. D: Minor patches and bug fixes.
  298. N: Argyrios Kyrtzidis
  299. E: kyrtzidis@apple.com
  300. D: Bug fixes.
  301. N: Stephan T. Lavavej
  302. E: stl@microsoft.com
  303. E: stl@nuwen.net
  304. D: Implemented floating-point to_chars.
  305. N: Damien Lebrun-Grandie
  306. E: dalg24@gmail.com
  307. E: lebrungrandt@ornl.gov
  308. D: Implementation of mdspan.
  309. N: Microsoft Corporation
  310. D: Contributed floating-point to_chars.
  311. N: Bruce Mitchener, Jr.
  312. E: bruce.mitchener@gmail.com
  313. D: Emscripten-related changes.
  314. N: Michel Morin
  315. E: mimomorin@gmail.com
  316. D: Minor patches to is_convertible.
  317. N: Andrew Morrow
  318. E: andrew.c.morrow@gmail.com
  319. D: Minor patches and Linux fixes.
  320. N: Michael Park
  321. E: mcypark@gmail.com
  322. D: Implementation of <variant>.
  323. N: Arvid Picciani
  324. E: aep at exys dot org
  325. D: Minor patches and musl port.
  326. N: Bjorn Reese
  327. E: breese@users.sourceforge.net
  328. D: Initial regex prototype
  329. N: Nico Rieck
  330. E: nico.rieck@gmail.com
  331. D: Windows fixes
  332. N: Jon Roelofs
  333. E: jroelofS@jroelofs.com
  334. D: Remote testing, Newlib port, baremetal/single-threaded support.
  335. N: Kent Ross
  336. E: k@mad.cash
  337. D: Patches for operator<=> support
  338. N: Jonathan Sauer
  339. D: Minor patches, mostly related to constexpr
  340. N: Craig Silverstein
  341. E: csilvers@google.com
  342. D: Implemented Cityhash as the string hash function on 64-bit machines
  343. N: Richard Smith
  344. D: Minor patches.
  345. N: Joerg Sonnenberger
  346. E: joerg@NetBSD.org
  347. D: NetBSD port.
  348. N: Stephan Tolksdorf
  349. E: st@quanttec.com
  350. D: Minor <atomic> fix
  351. N: Christian Trott
  352. E: crtrott@sandia.gov
  353. D: Implementation of mdspan.
  354. N: Ruben Van Boxem
  355. E: vanboxem dot ruben at gmail dot com
  356. D: Initial Windows patches.
  357. N: Michael van der Westhuizen
  358. E: r1mikey at gmail dot com
  359. N: Larisse Voufo
  360. D: Minor patches.
  361. N: Klaas de Vries
  362. E: klaas at klaasgaaf dot nl
  363. D: Minor bug fix.
  364. N: Mark de Wever
  365. E: koraq at xs4all dot nl
  366. D: Format library support.
  367. D: Finalized the porting of MSVC's to_chars to libc++.
  368. N: Zhang Xiongpang
  369. E: zhangxiongpang@gmail.com
  370. D: Minor patches and bug fixes.
  371. N: Xing Xue
  372. E: xingxue@ca.ibm.com
  373. D: AIX port
  374. N: Jeffrey Yasskin
  375. E: jyasskin@gmail.com
  376. E: jyasskin@google.com
  377. D: Linux fixes.
  378. N: Zhihao Yuan
  379. E: lichray@gmail.com
  380. D: Standard compatibility fixes.
  381. ====================File: include/any====================
  382. // -*- C++ -*-
  383. //===----------------------------------------------------------------------===//
  384. //
  385. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  386. // See https://llvm.org/LICENSE.txt for license information.
  387. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  388. //
  389. //===----------------------------------------------------------------------===//
  390. #ifndef _LIBCPP_ANY
  391. #define _LIBCPP_ANY
  392. /*
  393. any synopsis
  394. namespace std {
  395. class bad_any_cast : public bad_cast
  396. {
  397. public:
  398. virtual const char* what() const noexcept;
  399. };
  400. class any
  401. {
  402. public:
  403. // 6.3.1 any construct/destruct
  404. any() noexcept;
  405. any(const any& other);
  406. any(any&& other) noexcept;
  407. template <class ValueType>
  408. any(ValueType&& value);
  409. ~any();
  410. // 6.3.2 any assignments
  411. any& operator=(const any& rhs);
  412. any& operator=(any&& rhs) noexcept;
  413. template <class ValueType>
  414. any& operator=(ValueType&& rhs);
  415. // 6.3.3 any modifiers
  416. template <class ValueType, class... Args>
  417. decay_t<ValueType>& emplace(Args&&... args);
  418. template <class ValueType, class U, class... Args>
  419. decay_t<ValueType>& emplace(initializer_list<U>, Args&&...);
  420. void reset() noexcept;
  421. void swap(any& rhs) noexcept;
  422. // 6.3.4 any observers
  423. bool has_value() const noexcept;
  424. const type_info& type() const noexcept;
  425. };
  426. // 6.4 Non-member functions
  427. void swap(any& x, any& y) noexcept;
  428. template <class T, class ...Args>
  429. any make_any(Args&& ...args);
  430. template <class T, class U, class ...Args>
  431. any make_any(initializer_list<U>, Args&& ...args);
  432. template<class ValueType>
  433. ValueType any_cast(const any& operand);
  434. template<class ValueType>
  435. ValueType any_cast(any& operand);
  436. template<class ValueType>
  437. ValueType any_cast(any&& operand);
  438. template<class ValueType>
  439. const ValueType* any_cast(const any* operand) noexcept;
  440. template<class ValueType>
  441. ValueType* any_cast(any* operand) noexcept;
  442. } // namespace std
  443. */
  444. #include <__availability>
  445. #include <__config>
  446. #include <__memory/allocator.h>
  447. #include <__memory/allocator_destructor.h>
  448. #include <__memory/allocator_traits.h>
  449. #include <__memory/unique_ptr.h>
  450. #include <__type_traits/add_const.h>
  451. #include <__type_traits/add_pointer.h>
  452. #include <__type_traits/aligned_storage.h>
  453. #include <__type_traits/conditional.h>
  454. #include <__type_traits/decay.h>
  455. #include <__type_traits/is_constructible.h>
  456. #include <__type_traits/is_copy_constructible.h>
  457. #include <__type_traits/is_function.h>
  458. #include <__type_traits/is_nothrow_move_constructible.h>
  459. #include <__type_traits/is_reference.h>
  460. #include <__type_traits/is_same.h>
  461. #include <__type_traits/is_void.h>
  462. #include <__type_traits/remove_cv.h>
  463. #include <__type_traits/remove_cvref.h>
  464. #include <__type_traits/remove_reference.h>
  465. #include <__utility/forward.h>
  466. #include <__utility/in_place.h>
  467. #include <__utility/move.h>
  468. #include <__utility/unreachable.h>
  469. #include <__verbose_abort>
  470. #include <initializer_list>
  471. #include <typeinfo>
  472. #include <version>
  473. #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
  474. # pragma GCC system_header
  475. #endif
  476. _LIBCPP_PUSH_MACROS
  477. #include <__undef_macros>
  478. namespace std {
  479. class _LIBCPP_EXPORTED_FROM_ABI _LIBCPP_AVAILABILITY_BAD_ANY_CAST bad_any_cast : public bad_cast {
  480. public:
  481. const char* what() const _NOEXCEPT override;
  482. };
  483. } // namespace std
  484. _LIBCPP_BEGIN_NAMESPACE_STD
  485. #if _LIBCPP_STD_VER >= 17
  486. _LIBCPP_NORETURN inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_THROW_BAD_ANY_CAST void __throw_bad_any_cast() {
  487. # ifndef _LIBCPP_HAS_NO_EXCEPTIONS
  488. throw bad_any_cast();
  489. # else
  490. _LIBCPP_VERBOSE_ABORT("bad_any_cast was thrown in -fno-exceptions mode");
  491. # endif
  492. }
  493. // Forward declarations
  494. class _LIBCPP_TEMPLATE_VIS any;
  495. template <class _ValueType>
  496. _LIBCPP_HIDE_FROM_ABI add_pointer_t<add_const_t<_ValueType>> any_cast(any const*) _NOEXCEPT;
  497. template <class _ValueType>
  498. _LIBCPP_HIDE_FROM_ABI add_pointer_t<_ValueType> any_cast(any*) _NOEXCEPT;
  499. namespace __any_imp {
  500. _LIBCPP_SUPPRESS_DEPRECATED_PUSH
  501. using _Buffer = aligned_storage_t<3 * sizeof(void*), alignof(void*)>;
  502. _LIBCPP_SUPPRESS_DEPRECATED_POP
  503. template <class _Tp>
  504. using _IsSmallObject =
  505. integral_constant<bool,
  506. sizeof(_Tp) <= sizeof(_Buffer) && alignof(_Buffer) % alignof(_Tp) == 0 &&
  507. is_nothrow_move_constructible<_Tp>::value >;
  508. enum class _Action { _Destroy, _Copy, _Move, _Get, _TypeInfo };
  509. template <class _Tp>
  510. struct _SmallHandler;
  511. template <class _Tp>
  512. struct _LargeHandler;
  513. template <class _Tp>
  514. struct _LIBCPP_TEMPLATE_VIS __unique_typeinfo {
  515. static constexpr int __id = 0;
  516. };
  517. template <class _Tp>
  518. constexpr int __unique_typeinfo<_Tp>::__id;
  519. template <class _Tp>
  520. inline _LIBCPP_HIDE_FROM_ABI constexpr const void* __get_fallback_typeid() {
  521. return &__unique_typeinfo<remove_cv_t<remove_reference_t<_Tp>>>::__id;
  522. }
  523. template <class _Tp>
  524. inline _LIBCPP_HIDE_FROM_ABI bool __compare_typeid(type_info const* __id, const void* __fallback_id) {
  525. # if !defined(_LIBCPP_HAS_NO_RTTI)
  526. if (__id && *__id == typeid(_Tp))
  527. return true;
  528. # endif
  529. return !__id && __fallback_id == __any_imp::__get_fallback_typeid<_Tp>();
  530. }
  531. template <class _Tp>
  532. using _Handler = conditional_t< _IsSmallObject<_Tp>::value, _SmallHandler<_Tp>, _LargeHandler<_Tp>>;
  533. } // namespace __any_imp
  534. class _LIBCPP_TEMPLATE_VIS any {
  535. public:
  536. // construct/destruct
  537. _LIBCPP_HIDE_FROM_ABI constexpr any() _NOEXCEPT : __h_(nullptr) {}
  538. _LIBCPP_HIDE_FROM_ABI any(any const& __other) : __h_(nullptr) {
  539. if (__other.__h_)
  540. __other.__call(_Action::_Copy, this);
  541. }
  542. _LIBCPP_HIDE_FROM_ABI any(any&& __other) _NOEXCEPT : __h_(nullptr) {
  543. if (__other.__h_)
  544. __other.__call(_Action::_Move, this);
  545. }
  546. template < class _ValueType,
  547. class _Tp = decay_t<_ValueType>,
  548. class = enable_if_t< !is_same<_Tp, any>::value && !__is_inplace_type<_ValueType>::value &&
  549. is_copy_constructible<_Tp>::value> >
  550. _LIBCPP_HIDE_FROM_ABI any(_ValueType&& __value);
  551. template <class _ValueType,
  552. class... _Args,
  553. class _Tp = decay_t<_ValueType>,
  554. class = enable_if_t< is_constructible<_Tp, _Args...>::value && is_copy_constructible<_Tp>::value > >
  555. _LIBCPP_HIDE_FROM_ABI explicit any(in_place_type_t<_ValueType>, _Args&&... __args);
  556. template <class _ValueType,
  557. class _Up,
  558. class... _Args,
  559. class _Tp = decay_t<_ValueType>,
  560. class = enable_if_t< is_constructible<_Tp, initializer_list<_Up>&, _Args...>::value &&
  561. is_copy_constructible<_Tp>::value> >
  562. _LIBCPP_HIDE_FROM_ABI explicit any(in_place_type_t<_ValueType>, initializer_list<_Up>, _Args&&... __args);
  563. _LIBCPP_HIDE_FROM_ABI ~any() { this->reset(); }
  564. // assignments
  565. _LIBCPP_HIDE_FROM_ABI any& operator=(any const& __rhs) {
  566. any(__rhs).swap(*this);
  567. return *this;
  568. }
  569. _LIBCPP_HIDE_FROM_ABI any& operator=(any&& __rhs) _NOEXCEPT {
  570. any(std::move(__rhs)).swap(*this);
  571. return *this;
  572. }
  573. template < class _ValueType,
  574. class _Tp = decay_t<_ValueType>,
  575. class = enable_if_t< !is_same<_Tp, any>::value && is_copy_constructible<_Tp>::value> >
  576. _LIBCPP_HIDE_FROM_ABI any& operator=(_ValueType&& __rhs);
  577. template <class _ValueType,
  578. class... _Args,
  579. class _Tp = decay_t<_ValueType>,
  580. class = enable_if_t< is_constructible<_Tp, _Args...>::value && is_copy_constructible<_Tp>::value> >
  581. _LIBCPP_HIDE_FROM_ABI _Tp& emplace(_Args&&...);
  582. template <class _ValueType,
  583. class _Up,
  584. class... _Args,
  585. class _Tp = decay_t<_ValueType>,
  586. class = enable_if_t< is_constructible<_Tp, initializer_list<_Up>&, _Args...>::value &&
  587. is_copy_constructible<_Tp>::value> >
  588. _LIBCPP_HIDE_FROM_ABI _Tp& emplace(initializer_list<_Up>, _Args&&...);
  589. // 6.3.3 any modifiers
  590. _LIBCPP_HIDE_FROM_ABI void reset() _NOEXCEPT {
  591. if (__h_)
  592. this->__call(_Action::_Destroy);
  593. }
  594. _LIBCPP_HIDE_FROM_ABI void swap(any& __rhs) _NOEXCEPT;
  595. // 6.3.4 any observers
  596. _LIBCPP_HIDE_FROM_ABI bool has_value() const _NOEXCEPT { return __h_ != nullptr; }
  597. # if !defined(_LIBCPP_HAS_NO_RTTI)
  598. _LIBCPP_HIDE_FROM_ABI const type_info& type() const _NOEXCEPT {
  599. if (__h_) {
  600. return *static_cast<type_info const*>(this->__call(_Action::_TypeInfo));
  601. } else {
  602. return typeid(void);
  603. }
  604. }
  605. # endif
  606. private:
  607. typedef __any_imp::_Action _Action;
  608. using _HandleFuncPtr = void* (*)(_Action, any const*, any*, const type_info*, const void* __fallback_info);
  609. union _Storage {
  610. _LIBCPP_HIDE_FROM_ABI constexpr _Storage() : __ptr(nullptr) {}
  611. void* __ptr;
  612. __any_imp::_Buffer __buf;
  613. };
  614. _LIBCPP_HIDE_FROM_ABI void*
  615. __call(_Action __a, any* __other = nullptr, type_info const* __info = nullptr, const void* __fallback_info = nullptr)
  616. const {
  617. return __h_(__a, this, __other, __info, __fallback_info);
  618. }
  619. _LIBCPP_HIDE_FROM_ABI void* __call(
  620. _Action __a, any* __other = nullptr, type_info const* __info = nullptr, const void* __fallback_info = nullptr) {
  621. return __h_(__a, this, __other, __info, __fallback_info);
  622. }
  623. template <class>
  624. friend struct __any_imp::_SmallHandler;
  625. template <class>
  626. friend struct __any_imp::_LargeHandler;
  627. template <class _ValueType>
  628. friend add_pointer_t<add_const_t<_ValueType>> any_cast(any const*) _NOEXCEPT;
  629. template <class _ValueType>
  630. friend add_pointer_t<_ValueType> any_cast(any*) _NOEXCEPT;
  631. _HandleFuncPtr __h_ = nullptr;
  632. _Storage __s_;
  633. };
  634. namespace __any_imp {
  635. template <class _Tp>
  636. struct _LIBCPP_TEMPLATE_VIS _SmallHandler {
  637. _LIBCPP_HIDE_FROM_ABI static void*
  638. __handle(_Action __act, any const* __this, any* __other, type_info const* __info, const void* __fallback_info) {
  639. switch (__act) {
  640. case _Action::_Destroy:
  641. __destroy(const_cast<any&>(*__this));
  642. return nullptr;
  643. case _Action::_Copy:
  644. __copy(*__this, *__other);
  645. return nullptr;
  646. case _Action::_Move:
  647. __move(const_cast<any&>(*__this), *__other);
  648. return nullptr;
  649. case _Action::_Get:
  650. return __get(const_cast<any&>(*__this), __info, __fallback_info);
  651. case _Action::_TypeInfo:
  652. return __type_info();
  653. }
  654. __libcpp_unreachable();
  655. }
  656. template <class... _Args>
  657. _LIBCPP_HIDE_FROM_ABI static _Tp& __create(any& __dest, _Args&&... __args) {
  658. typedef allocator<_Tp> _Alloc;
  659. typedef allocator_traits<_Alloc> _ATraits;
  660. _Alloc __a;
  661. _Tp* __ret = static_cast<_Tp*>(static_cast<void*>(&__dest.__s_.__buf));
  662. _ATraits::construct(__a, __ret, std::forward<_Args>(__args)...);
  663. __dest.__h_ = &_SmallHandler::__handle;
  664. return *__ret;
  665. }
  666. private:
  667. _LIBCPP_HIDE_FROM_ABI static void __destroy(any& __this) {
  668. typedef allocator<_Tp> _Alloc;
  669. typedef allocator_traits<_Alloc> _ATraits;
  670. _Alloc __a;
  671. _Tp* __p = static_cast<_Tp*>(static_cast<void*>(&__this.__s_.__buf));
  672. _ATraits::destroy(__a, __p);
  673. __this.__h_ = nullptr;
  674. }
  675. _LIBCPP_HIDE_FROM_ABI static void __copy(any const& __this, any& __dest) {
  676. _SmallHandler::__create(__dest, *static_cast<_Tp const*>(static_cast<void const*>(&__this.__s_.__buf)));
  677. }
  678. _LIBCPP_HIDE_FROM_ABI static void __move(any& __this, any& __dest) {
  679. _SmallHandler::__create(__dest, std::move(*static_cast<_Tp*>(static_cast<void*>(&__this.__s_.__buf))));
  680. __destroy(__this);
  681. }
  682. _LIBCPP_HIDE_FROM_ABI static void* __get(any& __this, type_info const* __info, const void* __fallback_id) {
  683. if (__any_imp::__compare_typeid<_Tp>(__info, __fallback_id))
  684. return static_cast<void*>(&__this.__s_.__buf);
  685. return nullptr;
  686. }
  687. _LIBCPP_HIDE_FROM_ABI static void* __type_info() {
  688. # if !defined(_LIBCPP_HAS_NO_RTTI)
  689. return const_cast<void*>(static_cast<void const*>(&typeid(_Tp)));
  690. # else
  691. return nullptr;
  692. # endif
  693. }
  694. };
  695. template <class _Tp>
  696. struct _LIBCPP_TEMPLATE_VIS _LargeHandler {
  697. _LIBCPP_HIDE_FROM_ABI static void*
  698. __handle(_Action __act, any const* __this, any* __other, type_info const* __info, void const* __fallback_info) {
  699. switch (__act) {
  700. case _Action::_Destroy:
  701. __destroy(const_cast<any&>(*__this));
  702. return nullptr;
  703. case _Action::_Copy:
  704. __copy(*__this, *__other);
  705. return nullptr;
  706. case _Action::_Move:
  707. __move(const_cast<any&>(*__this), *__other);
  708. return nullptr;
  709. case _Action::_Get:
  710. return __get(const_cast<any&>(*__this), __info, __fallback_info);
  711. case _Action::_TypeInfo:
  712. return __type_info();
  713. }
  714. __libcpp_unreachable();
  715. }
  716. template <class... _Args>
  717. _LIBCPP_HIDE_FROM_ABI static _Tp& __create(any& __dest, _Args&&... __args) {
  718. typedef allocator<_Tp> _Alloc;
  719. typedef allocator_traits<_Alloc> _ATraits;
  720. typedef __allocator_destructor<_Alloc> _Dp;
  721. _Alloc __a;
  722. unique_ptr<_Tp, _Dp> __hold(_ATraits::allocate(__a, 1), _Dp(__a, 1));
  723. _Tp* __ret = __hold.get();
  724. _ATraits::construct(__a, __ret, std::forward<_Args>(__args)...);
  725. __dest.__s_.__ptr = __hold.release();
  726. __dest.__h_ = &_LargeHandler::__handle;
  727. return *__ret;
  728. }
  729. private:
  730. _LIBCPP_HIDE_FROM_ABI static void __destroy(any& __this) {
  731. typedef allocator<_Tp> _Alloc;
  732. typedef allocator_traits<_Alloc> _ATraits;
  733. _Alloc __a;
  734. _Tp* __p = static_cast<_Tp*>(__this.__s_.__ptr);
  735. _ATraits::destroy(__a, __p);
  736. _ATraits::deallocate(__a, __p, 1);
  737. __this.__h_ = nullptr;
  738. }
  739. _LIBCPP_HIDE_FROM_ABI static void __copy(any const& __this, any& __dest) {
  740. _LargeHandler::__create(__dest, *static_cast<_Tp const*>(__this.__s_.__ptr));
  741. }
  742. _LIBCPP_HIDE_FROM_ABI static void __move(any& __this, any& __dest) {
  743. __dest.__s_.__ptr = __this.__s_.__ptr;
  744. __dest.__h_ = &_LargeHandler::__handle;
  745. __this.__h_ = nullptr;
  746. }
  747. _LIBCPP_HIDE_FROM_ABI static void* __get(any& __this, type_info const* __info, void const* __fallback_info) {
  748. if (__any_imp::__compare_typeid<_Tp>(__info, __fallback_info))
  749. return static_cast<void*>(__this.__s_.__ptr);
  750. return nullptr;
  751. }
  752. _LIBCPP_HIDE_FROM_ABI static void* __type_info() {
  753. # if !defined(_LIBCPP_HAS_NO_RTTI)
  754. return const_cast<void*>(static_cast<void const*>(&typeid(_Tp)));
  755. # else
  756. return nullptr;
  757. # endif
  758. }
  759. };
  760. } // namespace __any_imp
  761. template <class _ValueType, class _Tp, class>
  762. any::any(_ValueType&& __v) : __h_(nullptr) {
  763. __any_imp::_Handler<_Tp>::__create(*this, std::forward<_ValueType>(__v));
  764. }
  765. template <class _ValueType, class... _Args, class _Tp, class>
  766. any::any(in_place_type_t<_ValueType>, _Args&&... __args) {
  767. __any_imp::_Handler<_Tp>::__create(*this, std::forward<_Args>(__args)...);
  768. }
  769. template <class _ValueType, class _Up, class... _Args, class _Tp, class>
  770. any::any(in_place_type_t<_ValueType>, initializer_list<_Up> __il, _Args&&... __args) {
  771. __any_imp::_Handler<_Tp>::__create(*this, __il, std::forward<_Args>(__args)...);
  772. }
  773. template <class _ValueType, class, class>
  774. inline _LIBCPP_HIDE_FROM_ABI any& any::operator=(_ValueType&& __v) {
  775. any(std::forward<_ValueType>(__v)).swap(*this);
  776. return *this;
  777. }
  778. template <class _ValueType, class... _Args, class _Tp, class>
  779. inline _LIBCPP_HIDE_FROM_ABI _Tp& any::emplace(_Args&&... __args) {
  780. reset();
  781. return __any_imp::_Handler<_Tp>::__create(*this, std::forward<_Args>(__args)...);
  782. }
  783. template <class _ValueType, class _Up, class... _Args, class _Tp, class>
  784. inline _LIBCPP_HIDE_FROM_ABI _Tp& any::emplace(initializer_list<_Up> __il, _Args&&... __args) {
  785. reset();
  786. return __any_imp::_Handler<_Tp>::__create(*this, __il, std::forward<_Args>(__args)...);
  787. }
  788. inline _LIBCPP_HIDE_FROM_ABI void any::swap(any& __rhs) _NOEXCEPT {
  789. if (this == &__rhs)
  790. return;
  791. if (__h_ && __rhs.__h_) {
  792. any __tmp;
  793. __rhs.__call(_Action::_Move, &__tmp);
  794. this->__call(_Action::_Move, &__rhs);
  795. __tmp.__call(_Action::_Move, this);
  796. } else if (__h_) {
  797. this->__call(_Action::_Move, &__rhs);
  798. } else if (__rhs.__h_) {
  799. __rhs.__call(_Action::_Move, this);
  800. }
  801. }
  802. // 6.4 Non-member functions
  803. inline _LIBCPP_HIDE_FROM_ABI void swap(any& __lhs, any& __rhs) _NOEXCEPT { __lhs.swap(__rhs); }
  804. template <class _Tp, class... _Args>
  805. inline _LIBCPP_HIDE_FROM_ABI any make_any(_Args&&... __args) {
  806. return any(in_place_type<_Tp>, std::forward<_Args>(__args)...);
  807. }
  808. template <class _Tp, class _Up, class... _Args>
  809. inline _LIBCPP_HIDE_FROM_ABI any make_any(initializer_list<_Up> __il, _Args&&... __args) {
  810. return any(in_place_type<_Tp>, __il, std::forward<_Args>(__args)...);
  811. }
  812. template <class _ValueType>
  813. inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_THROW_BAD_ANY_CAST _ValueType any_cast(any const& __v) {
  814. using _RawValueType = __remove_cvref_t<_ValueType>;
  815. static_assert(is_constructible<_ValueType, _RawValueType const&>::value,
  816. "ValueType is required to be a const lvalue reference "
  817. "or a CopyConstructible type");
  818. auto __tmp = std::any_cast<add_const_t<_RawValueType>>(&__v);
  819. if (__tmp == nullptr)
  820. __throw_bad_any_cast();
  821. return static_cast<_ValueType>(*__tmp);
  822. }
  823. template <class _ValueType>
  824. inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_THROW_BAD_ANY_CAST _ValueType any_cast(any& __v) {
  825. using _RawValueType = __remove_cvref_t<_ValueType>;
  826. static_assert(is_constructible<_ValueType, _RawValueType&>::value,
  827. "ValueType is required to be an lvalue reference "
  828. "or a CopyConstructible type");
  829. auto __tmp = std::any_cast<_RawValueType>(&__v);
  830. if (__tmp == nullptr)
  831. __throw_bad_any_cast();
  832. return static_cast<_ValueType>(*__tmp);
  833. }
  834. template <class _ValueType>
  835. inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_THROW_BAD_ANY_CAST _ValueType any_cast(any&& __v) {
  836. using _RawValueType = __remove_cvref_t<_ValueType>;
  837. static_assert(is_constructible<_ValueType, _RawValueType>::value,
  838. "ValueType is required to be an rvalue reference "
  839. "or a CopyConstructible type");
  840. auto __tmp = std::any_cast<_RawValueType>(&__v);
  841. if (__tmp == nullptr)
  842. __throw_bad_any_cast();
  843. return static_cast<_ValueType>(std::move(*__tmp));
  844. }
  845. template <class _ValueType>
  846. inline _LIBCPP_HIDE_FROM_ABI add_pointer_t<add_const_t<_ValueType>> any_cast(any const* __any) _NOEXCEPT {
  847. static_assert(!is_void_v<_ValueType>, "_ValueType may not be void.");
  848. static_assert(!is_reference<_ValueType>::value, "_ValueType may not be a reference.");
  849. return std::any_cast<_ValueType>(const_cast<any*>(__any));
  850. }
  851. template <class _RetType>
  852. inline _LIBCPP_HIDE_FROM_ABI _RetType __pointer_or_func_cast(void* __p, /*IsFunction*/ false_type) noexcept {
  853. return static_cast<_RetType>(__p);
  854. }
  855. template <class _RetType>
  856. inline _LIBCPP_HIDE_FROM_ABI _RetType __pointer_or_func_cast(void*, /*IsFunction*/ true_type) noexcept {
  857. return nullptr;
  858. }
  859. template <class _ValueType>
  860. _LIBCPP_HIDE_FROM_ABI add_pointer_t<_ValueType> any_cast(any* __any) _NOEXCEPT {
  861. using __any_imp::_Action;
  862. static_assert(!is_void_v<_ValueType>, "_ValueType may not be void.");
  863. static_assert(!is_reference<_ValueType>::value, "_ValueType may not be a reference.");
  864. typedef add_pointer_t<_ValueType> _ReturnType;
  865. if (__any && __any->__h_) {
  866. void* __p = __any->__call(
  867. _Action::_Get,
  868. nullptr,
  869. # if !defined(_LIBCPP_HAS_NO_RTTI)
  870. &typeid(_ValueType),
  871. # else
  872. nullptr,
  873. # endif
  874. __any_imp::__get_fallback_typeid<_ValueType>());
  875. return std::__pointer_or_func_cast<_ReturnType>(__p, is_function<_ValueType>{});
  876. }
  877. return nullptr;
  878. }
  879. #endif // _LIBCPP_STD_VER >= 17
  880. _LIBCPP_END_NAMESPACE_STD
  881. _LIBCPP_POP_MACROS
  882. #if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 17
  883. # include <chrono>
  884. #endif
  885. #if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
  886. # include <atomic>
  887. # include <concepts>
  888. # include <cstdlib>
  889. # include <iosfwd>
  890. # include <iterator>
  891. # include <memory>
  892. # include <stdexcept>
  893. # include <type_traits>
  894. # include <variant>
  895. #endif
  896. #endif // _LIBCPP_ANY
  897. ====================MIT====================
  898. Permission is hereby granted, free of charge, to any person obtaining a copy
  899. of this software and associated documentation files (the "Software"), to deal
  900. in the Software without restriction, including without limitation the rights
  901. to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  902. copies of the Software, and to permit persons to whom the Software is
  903. furnished to do so, subject to the following conditions:
  904. The above copyright notice and this permission notice shall be included in
  905. all copies or substantial portions of the Software.
  906. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  907. IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  908. FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  909. AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  910. LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  911. OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  912. THE SOFTWARE.
  913. ====================NCSA====================
  914. Legacy LLVM License (https://llvm.org/docs/DeveloperPolicy.html#legacy):
  915. ====================NCSA====================
  916. Permission is hereby granted, free of charge, to any person obtaining a copy of
  917. this software and associated documentation files (the "Software"), to deal with
  918. the Software without restriction, including without limitation the rights to
  919. use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
  920. of the Software, and to permit persons to whom the Software is furnished to do
  921. so, subject to the following conditions:
  922. * Redistributions of source code must retain the above copyright notice,
  923. this list of conditions and the following disclaimers.
  924. * Redistributions in binary form must reproduce the above copyright notice,
  925. this list of conditions and the following disclaimers in the
  926. documentation and/or other materials provided with the distribution.
  927. * Neither the names of the LLVM Team, University of Illinois at
  928. Urbana-Champaign, nor the names of its contributors may be used to
  929. endorse or promote products derived from this Software without specific
  930. prior written permission.
  931. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  932. IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
  933. FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  934. CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  935. LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  936. OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE
  937. SOFTWARE.
  938. ====================NCSA====================
  939. University of Illinois/NCSA
  940. Open Source License
  941. ====================NCSA AND MIT====================
  942. The libc++ library is dual licensed under both the University of Illinois
  943. "BSD-Like" license and the MIT license. As a user of this code you may choose
  944. to use it under either license. As a contributor, you agree to allow your code
  945. to be used under both.
  946. Full text of the relevant licenses is included below.
  947. ====================Public-Domain====================
  948. // These files can be found at https://data.iana.org/time-zones/ and are in the
  949. // public domain. Information regarding the input can be found at
  950. ====================Unicode====================
  951. // Distributed under the Terms of Use in https://www.unicode.org/copyright.html.
  952. //
  953. // Permission is hereby granted, free of charge, to any person obtaining
  954. // a copy of the Unicode data files and any associated documentation
  955. // (the "Data Files") or Unicode software and any associated documentation
  956. // (the "Software") to deal in the Data Files or Software
  957. // without restriction, including without limitation the rights to use,
  958. // copy, modify, merge, publish, distribute, and/or sell copies of
  959. // the Data Files or Software, and to permit persons to whom the Data Files
  960. // or Software are furnished to do so, provided that either
  961. // (a) this copyright and permission notice appear with all copies
  962. // of the Data Files or Software, or
  963. // (b) this copyright and permission notice appear in associated
  964. // Documentation.
  965. //
  966. // THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF
  967. // ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  968. // WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  969. // NONINFRINGEMENT OF THIRD PARTY RIGHTS.
  970. // IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS
  971. // NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL
  972. // DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  973. // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  974. // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  975. // PERFORMANCE OF THE DATA FILES OR SOFTWARE.
  976. //
  977. // Except as contained in this notice, the name of a copyright holder
  978. // shall not be used in advertising or otherwise to promote the sale,
  979. // use or other dealings in these Data Files or Software without prior
  980. // written authorization of the copyright holder.
  981. ====================Unicode====================
  982. // NOTICE TO USER: Carefully read the following legal agreement.
  983. // BY DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING UNICODE INC.'S
  984. // DATA FILES ("DATA FILES"), AND/OR SOFTWARE ("SOFTWARE"),
  985. // YOU UNEQUIVOCALLY ACCEPT, AND AGREE TO BE BOUND BY, ALL OF THE
  986. // TERMS AND CONDITIONS OF THIS AGREEMENT.
  987. // IF YOU DO NOT AGREE, DO NOT DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE
  988. // THE DATA FILES OR SOFTWARE.
  989. //
  990. // COPYRIGHT AND PERMISSION NOTICE