| author | |
| committer | |
| log | 70e05c67ce6f044b5b99e01a5d972bbe92c38344 |
| tree | 6f13ca6ee7147f053b88d33e62bfdd1e284d9019 |
| parent | dab0cf6428d96af540399563f2e2d5a79c3a7d5e |
| signature | Commit is signed but in an unrecognized format. |
upstream commit 1931d3cb20a00da732c5210b123656632982fde0181 files changed, 5576 insertions(+), 4763 deletions(-)
lib/libcxx/include/__bit_reference+17-18| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===----------------------------------------------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 | |
| ... | ... | @@ -69,7 +68,7 @@ public: |
| 69 | 68 | |
| 70 | 69 | _LIBCPP_INLINE_VISIBILITY void flip() _NOEXCEPT {*__seg_ ^= __mask_;} |
| 71 | 70 | _LIBCPP_INLINE_VISIBILITY __bit_iterator<_Cp, false> operator&() const _NOEXCEPT |
| 72 | {return __bit_iterator<_Cp, false>(__seg_, static_cast<unsigned>(__ctz(__mask_)));} | |
| 71 | {return __bit_iterator<_Cp, false>(__seg_, static_cast<unsigned>(__libcpp_ctz(__mask_)));} | |
| 73 | 72 | private: |
| 74 | 73 | _LIBCPP_INLINE_VISIBILITY |
| 75 | 74 | __bit_reference(__storage_pointer __s, __storage_type __m) _NOEXCEPT |
| ... | ... | @@ -141,7 +140,7 @@ public: |
| 141 | 140 | {return static_cast<bool>(*__seg_ & __mask_);} |
| 142 | 141 | |
| 143 | 142 | _LIBCPP_INLINE_VISIBILITY __bit_iterator<_Cp, true> operator&() const _NOEXCEPT |
| 144 | {return __bit_iterator<_Cp, true>(__seg_, static_cast<unsigned>(__ctz(__mask_)));} | |
| 143 | {return __bit_iterator<_Cp, true>(__seg_, static_cast<unsigned>(__libcpp_ctz(__mask_)));} | |
| 145 | 144 | private: |
| 146 | 145 | _LIBCPP_INLINE_VISIBILITY |
| 147 | 146 | _LIBCPP_CONSTEXPR |
| ... | ... | @@ -168,7 +167,7 @@ __find_bool_true(__bit_iterator<_Cp, _IsConst> __first, typename _Cp::size_type |
| 168 | 167 | __storage_type __m = (~__storage_type(0) << __first.__ctz_) & (~__storage_type(0) >> (__clz_f - __dn)); |
| 169 | 168 | __storage_type __b = *__first.__seg_ & __m; |
| 170 | 169 | if (__b) |
| 171 | return _It(__first.__seg_, static_cast<unsigned>(_VSTD::__ctz(__b))); | |
| 170 | return _It(__first.__seg_, static_cast<unsigned>(_VSTD::__libcpp_ctz(__b))); | |
| 172 | 171 | if (__n == __dn) |
| 173 | 172 | return __first + __n; |
| 174 | 173 | __n -= __dn; |
| ... | ... | @@ -177,14 +176,14 @@ __find_bool_true(__bit_iterator<_Cp, _IsConst> __first, typename _Cp::size_type |
| 177 | 176 | // do middle whole words |
| 178 | 177 | for (; __n >= __bits_per_word; ++__first.__seg_, __n -= __bits_per_word) |
| 179 | 178 | if (*__first.__seg_) |
| 180 | return _It(__first.__seg_, static_cast<unsigned>(_VSTD::__ctz(*__first.__seg_))); | |
| 179 | return _It(__first.__seg_, static_cast<unsigned>(_VSTD::__libcpp_ctz(*__first.__seg_))); | |
| 181 | 180 | // do last partial word |
| 182 | 181 | if (__n > 0) |
| 183 | 182 | { |
| 184 | 183 | __storage_type __m = ~__storage_type(0) >> (__bits_per_word - __n); |
| 185 | 184 | __storage_type __b = *__first.__seg_ & __m; |
| 186 | 185 | if (__b) |
| 187 | return _It(__first.__seg_, static_cast<unsigned>(_VSTD::__ctz(__b))); | |
| 186 | return _It(__first.__seg_, static_cast<unsigned>(_VSTD::__libcpp_ctz(__b))); | |
| 188 | 187 | } |
| 189 | 188 | return _It(__first.__seg_, static_cast<unsigned>(__n)); |
| 190 | 189 | } |
| ... | ... | @@ -204,7 +203,7 @@ __find_bool_false(__bit_iterator<_Cp, _IsConst> __first, typename _Cp::size_type |
| 204 | 203 | __storage_type __m = (~__storage_type(0) << __first.__ctz_) & (~__storage_type(0) >> (__clz_f - __dn)); |
| 205 | 204 | __storage_type __b = ~*__first.__seg_ & __m; |
| 206 | 205 | if (__b) |
| 207 | return _It(__first.__seg_, static_cast<unsigned>(_VSTD::__ctz(__b))); | |
| 206 | return _It(__first.__seg_, static_cast<unsigned>(_VSTD::__libcpp_ctz(__b))); | |
| 208 | 207 | if (__n == __dn) |
| 209 | 208 | return __first + __n; |
| 210 | 209 | __n -= __dn; |
| ... | ... | @@ -215,7 +214,7 @@ __find_bool_false(__bit_iterator<_Cp, _IsConst> __first, typename _Cp::size_type |
| 215 | 214 | { |
| 216 | 215 | __storage_type __b = ~*__first.__seg_; |
| 217 | 216 | if (__b) |
| 218 | return _It(__first.__seg_, static_cast<unsigned>(_VSTD::__ctz(__b))); | |
| 217 | return _It(__first.__seg_, static_cast<unsigned>(_VSTD::__libcpp_ctz(__b))); | |
| 219 | 218 | } |
| 220 | 219 | // do last partial word |
| 221 | 220 | if (__n > 0) |
| ... | ... | @@ -223,7 +222,7 @@ __find_bool_false(__bit_iterator<_Cp, _IsConst> __first, typename _Cp::size_type |
| 223 | 222 | __storage_type __m = ~__storage_type(0) >> (__bits_per_word - __n); |
| 224 | 223 | __storage_type __b = ~*__first.__seg_ & __m; |
| 225 | 224 | if (__b) |
| 226 | return _It(__first.__seg_, static_cast<unsigned>(_VSTD::__ctz(__b))); | |
| 225 | return _It(__first.__seg_, static_cast<unsigned>(_VSTD::__libcpp_ctz(__b))); | |
| 227 | 226 | } |
| 228 | 227 | return _It(__first.__seg_, static_cast<unsigned>(__n)); |
| 229 | 228 | } |
| ... | ... | @@ -255,18 +254,18 @@ __count_bool_true(__bit_iterator<_Cp, _IsConst> __first, typename _Cp::size_type |
| 255 | 254 | __storage_type __clz_f = static_cast<__storage_type>(__bits_per_word - __first.__ctz_); |
| 256 | 255 | __storage_type __dn = _VSTD::min(__clz_f, __n); |
| 257 | 256 | __storage_type __m = (~__storage_type(0) << __first.__ctz_) & (~__storage_type(0) >> (__clz_f - __dn)); |
| 258 | __r = _VSTD::__popcount(*__first.__seg_ & __m); | |
| 257 | __r = _VSTD::__libcpp_popcount(*__first.__seg_ & __m); | |
| 259 | 258 | __n -= __dn; |
| 260 | 259 | ++__first.__seg_; |
| 261 | 260 | } |
| 262 | 261 | // do middle whole words |
| 263 | 262 | for (; __n >= __bits_per_word; ++__first.__seg_, __n -= __bits_per_word) |
| 264 | __r += _VSTD::__popcount(*__first.__seg_); | |
| 263 | __r += _VSTD::__libcpp_popcount(*__first.__seg_); | |
| 265 | 264 | // do last partial word |
| 266 | 265 | if (__n > 0) |
| 267 | 266 | { |
| 268 | 267 | __storage_type __m = ~__storage_type(0) >> (__bits_per_word - __n); |
| 269 | __r += _VSTD::__popcount(*__first.__seg_ & __m); | |
| 268 | __r += _VSTD::__libcpp_popcount(*__first.__seg_ & __m); | |
| 270 | 269 | } |
| 271 | 270 | return __r; |
| 272 | 271 | } |
| ... | ... | @@ -286,18 +285,18 @@ __count_bool_false(__bit_iterator<_Cp, _IsConst> __first, typename _Cp::size_typ |
| 286 | 285 | __storage_type __clz_f = static_cast<__storage_type>(__bits_per_word - __first.__ctz_); |
| 287 | 286 | __storage_type __dn = _VSTD::min(__clz_f, __n); |
| 288 | 287 | __storage_type __m = (~__storage_type(0) << __first.__ctz_) & (~__storage_type(0) >> (__clz_f - __dn)); |
| 289 | __r = _VSTD::__popcount(~*__first.__seg_ & __m); | |
| 288 | __r = _VSTD::__libcpp_popcount(~*__first.__seg_ & __m); | |
| 290 | 289 | __n -= __dn; |
| 291 | 290 | ++__first.__seg_; |
| 292 | 291 | } |
| 293 | 292 | // do middle whole words |
| 294 | 293 | for (; __n >= __bits_per_word; ++__first.__seg_, __n -= __bits_per_word) |
| 295 | __r += _VSTD::__popcount(~*__first.__seg_); | |
| 294 | __r += _VSTD::__libcpp_popcount(~*__first.__seg_); | |
| 296 | 295 | // do last partial word |
| 297 | 296 | if (__n > 0) |
| 298 | 297 | { |
| 299 | 298 | __storage_type __m = ~__storage_type(0) >> (__bits_per_word - __n); |
| 300 | __r += _VSTD::__popcount(~*__first.__seg_ & __m); | |
| 299 | __r += _VSTD::__libcpp_popcount(~*__first.__seg_ & __m); | |
| 301 | 300 | } |
| 302 | 301 | return __r; |
| 303 | 302 | } |
lib/libcxx/include/__bsd_locale_defaults.h+3-4| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===---------------------- __bsd_locale_defaults.h -----------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 | // The BSDs have lots of *_l functions. We don't want to define those symbols |
lib/libcxx/include/__bsd_locale_fallbacks.h+3-4| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===---------------------- __bsd_locale_fallbacks.h ----------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 | // The BSDs have lots of *_l functions. This file provides reimplementations |
lib/libcxx/include/__config+130-157| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===--------------------------- __config ---------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 | |
| ... | ... | @@ -33,12 +32,16 @@ |
| 33 | 32 | # define _GNUC_VER_NEW 0 |
| 34 | 33 | #endif |
| 35 | 34 | |
| 36 | #define _LIBCPP_VERSION 8000 | |
| 35 | #define _LIBCPP_VERSION 9000 | |
| 37 | 36 | |
| 38 | 37 | #ifndef _LIBCPP_ABI_VERSION |
| 39 | 38 | # define _LIBCPP_ABI_VERSION 1 |
| 40 | 39 | #endif |
| 41 | 40 | |
| 41 | #ifndef __STDC_HOSTED__ | |
| 42 | # define _LIBCPP_FREESTANDING | |
| 43 | #endif | |
| 44 | ||
| 42 | 45 | #ifndef _LIBCPP_STD_VER |
| 43 | 46 | # if __cplusplus <= 201103L |
| 44 | 47 | # define _LIBCPP_STD_VER 11 |
| ... | ... | @@ -93,10 +96,12 @@ |
| 93 | 96 | // Enable optimized version of __do_get_(un)signed which avoids redundant copies. |
| 94 | 97 | # define _LIBCPP_ABI_OPTIMIZED_LOCALE_NUM_GET |
| 95 | 98 | // Use the smallest possible integer type to represent the index of the variant. |
| 96 | // Previously libc++ used "unsigned int" exclusivly. | |
| 99 | // Previously libc++ used "unsigned int" exclusively. | |
| 97 | 100 | # define _LIBCPP_ABI_VARIANT_INDEX_TYPE_OPTIMIZATION |
| 98 | 101 | // Unstable attempt to provide a more optimized std::function |
| 99 | 102 | # define _LIBCPP_ABI_OPTIMIZED_FUNCTION |
| 103 | // All the regex constants must be distinct and nonzero. | |
| 104 | # define _LIBCPP_ABI_REGEX_CONSTANTS_NONZERO | |
| 100 | 105 | #elif _LIBCPP_ABI_VERSION == 1 |
| 101 | 106 | # if !defined(_LIBCPP_OBJECT_FORMAT_COFF) |
| 102 | 107 | // Enable compiling copies of now inline methods into the dylib to support |
| ... | ... | @@ -182,6 +187,10 @@ |
| 182 | 187 | #define _LIBCPP_CLANG_VER 0 |
| 183 | 188 | #endif |
| 184 | 189 | |
| 190 | #if defined(_LIBCPP_COMPILER_GCC) && __cplusplus < 201103L | |
| 191 | #error "libc++ does not support using GCC with C++03. Please enable C++11" | |
| 192 | #endif | |
| 193 | ||
| 185 | 194 | // FIXME: ABI detection should be done via compiler builtin macros. This |
| 186 | 195 | // is just a placeholder until Clang implements such macros. For now assume |
| 187 | 196 | // that Windows compilers pretending to be MSVC++ target the Microsoft ABI, |
| ... | ... | @@ -201,6 +210,10 @@ |
| 201 | 210 | # endif |
| 202 | 211 | #endif |
| 203 | 212 | |
| 213 | #if defined(_LIBCPP_ABI_MICROSOFT) && !defined(_LIBCPP_NO_VCRUNTIME) | |
| 214 | # define _LIBCPP_ABI_VCRUNTIME | |
| 215 | #endif | |
| 216 | ||
| 204 | 217 | // Need to detect which libc we're using if we're on Linux. |
| 205 | 218 | #if defined(__linux__) |
| 206 | 219 | # include <features.h> |
| ... | ... | @@ -257,7 +270,7 @@ |
| 257 | 270 | # define _LIBCPP_WIN32API |
| 258 | 271 | # define _LIBCPP_LITTLE_ENDIAN |
| 259 | 272 | # define _LIBCPP_SHORT_WCHAR 1 |
| 260 | // Both MinGW and native MSVC provide a "MSVC"-like enviroment | |
| 273 | // Both MinGW and native MSVC provide a "MSVC"-like environment | |
| 261 | 274 | # define _LIBCPP_MSVCRT_LIKE |
| 262 | 275 | // If mingw not explicitly detected, assume using MS C runtime only if |
| 263 | 276 | // a MS compatibility version is specified. |
| ... | ... | @@ -298,7 +311,7 @@ |
| 298 | 311 | // random data even when using sandboxing mechanisms such as chroots, |
| 299 | 312 | // Capsicum, etc. |
| 300 | 313 | # define _LIBCPP_USING_ARC4_RANDOM |
| 301 | #elif defined(__Fuchsia__) | |
| 314 | #elif defined(__Fuchsia__) || defined(__wasi__) | |
| 302 | 315 | # define _LIBCPP_USING_GETENTROPY |
| 303 | 316 | #elif defined(__native_client__) |
| 304 | 317 | // NaCl's sandbox (which PNaCl also runs in) doesn't allow filesystem access, |
| ... | ... | @@ -332,7 +345,7 @@ |
| 332 | 345 | # if defined(__FreeBSD__) |
| 333 | 346 | # define _LIBCPP_HAS_QUICK_EXIT |
| 334 | 347 | # define _LIBCPP_HAS_C11_FEATURES |
| 335 | # elif defined(__Fuchsia__) | |
| 348 | # elif defined(__Fuchsia__) || defined(__wasi__) | |
| 336 | 349 | # define _LIBCPP_HAS_QUICK_EXIT |
| 337 | 350 | # define _LIBCPP_HAS_TIMESPEC_GET |
| 338 | 351 | # define _LIBCPP_HAS_C11_FEATURES |
| ... | ... | @@ -400,10 +413,6 @@ typedef __char32_t char32_t; |
| 400 | 413 | #define _LIBCPP_HAS_NO_STRONG_ENUMS |
| 401 | 414 | #endif |
| 402 | 415 | |
| 403 | #if !(__has_feature(cxx_decltype)) | |
| 404 | #define _LIBCPP_HAS_NO_DECLTYPE | |
| 405 | #endif | |
| 406 | ||
| 407 | 416 | #if __has_feature(cxx_attributes) |
| 408 | 417 | # define _LIBCPP_NORETURN [[noreturn]] |
| 409 | 418 | #else |
| ... | ... | @@ -434,18 +443,6 @@ typedef __char32_t char32_t; |
| 434 | 443 | #define _LIBCPP_HAS_NO_VARIADICS |
| 435 | 444 | #endif |
| 436 | 445 | |
| 437 | #if !(__has_feature(cxx_generalized_initializers)) | |
| 438 | #define _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS | |
| 439 | #endif | |
| 440 | ||
| 441 | #if __has_feature(is_base_of) | |
| 442 | #define _LIBCPP_HAS_IS_BASE_OF | |
| 443 | #endif | |
| 444 | ||
| 445 | #if __has_feature(is_final) | |
| 446 | #define _LIBCPP_HAS_IS_FINAL | |
| 447 | #endif | |
| 448 | ||
| 449 | 446 | // Objective-C++ features (opt-in) |
| 450 | 447 | #if __has_feature(objc_arc) |
| 451 | 448 | #define _LIBCPP_HAS_OBJC_ARC |
| ... | ... | @@ -455,10 +452,6 @@ typedef __char32_t char32_t; |
| 455 | 452 | #define _LIBCPP_HAS_OBJC_ARC_WEAK |
| 456 | 453 | #endif |
| 457 | 454 | |
| 458 | #if !(__has_feature(cxx_constexpr)) | |
| 459 | #define _LIBCPP_HAS_NO_CONSTEXPR | |
| 460 | #endif | |
| 461 | ||
| 462 | 455 | #if !(__has_feature(cxx_relaxed_constexpr)) |
| 463 | 456 | #define _LIBCPP_HAS_NO_CXX14_CONSTEXPR |
| 464 | 457 | #endif |
| ... | ... | @@ -471,14 +464,6 @@ typedef __char32_t char32_t; |
| 471 | 464 | #define _LIBCPP_HAS_NO_NOEXCEPT |
| 472 | 465 | #endif |
| 473 | 466 | |
| 474 | #if __has_feature(underlying_type) | |
| 475 | #define _LIBCPP_UNDERLYING_TYPE(T) __underlying_type(T) | |
| 476 | #endif | |
| 477 | ||
| 478 | #if __has_feature(is_literal) | |
| 479 | #define _LIBCPP_IS_LITERAL(T) __is_literal(T) | |
| 480 | #endif | |
| 481 | ||
| 482 | 467 | #if !defined(_LIBCPP_HAS_NO_ASAN) && !__has_feature(address_sanitizer) |
| 483 | 468 | #define _LIBCPP_HAS_NO_ASAN |
| 484 | 469 | #endif |
| ... | ... | @@ -510,69 +495,20 @@ typedef __char32_t char32_t; |
| 510 | 495 | |
| 511 | 496 | #define _LIBCPP_NORETURN __attribute__((noreturn)) |
| 512 | 497 | |
| 513 | #if _GNUC_VER >= 407 | |
| 514 | #define _LIBCPP_UNDERLYING_TYPE(T) __underlying_type(T) | |
| 515 | #define _LIBCPP_IS_LITERAL(T) __is_literal_type(T) | |
| 516 | #define _LIBCPP_HAS_IS_FINAL | |
| 517 | #endif | |
| 518 | ||
| 519 | #if defined(__GNUC__) && _GNUC_VER >= 403 | |
| 520 | #define _LIBCPP_HAS_IS_BASE_OF | |
| 521 | #endif | |
| 522 | ||
| 523 | 498 | #if !__EXCEPTIONS && !defined(_LIBCPP_NO_EXCEPTIONS) |
| 524 | 499 | #define _LIBCPP_NO_EXCEPTIONS |
| 525 | 500 | #endif |
| 526 | 501 | |
| 527 | // constexpr was added to GCC in 4.6. | |
| 528 | #if _GNUC_VER < 406 | |
| 529 | # define _LIBCPP_HAS_NO_CONSTEXPR | |
| 530 | // Can only use constexpr in c++11 mode. | |
| 531 | #elif !defined(__GXX_EXPERIMENTAL_CXX0X__) && __cplusplus < 201103L | |
| 532 | # define _LIBCPP_HAS_NO_CONSTEXPR | |
| 533 | #endif | |
| 534 | ||
| 535 | 502 | // Determine if GCC supports relaxed constexpr |
| 536 | 503 | #if !defined(__cpp_constexpr) || __cpp_constexpr < 201304L |
| 537 | 504 | #define _LIBCPP_HAS_NO_CXX14_CONSTEXPR |
| 538 | 505 | #endif |
| 539 | 506 | |
| 540 | // GCC 5 will support variable templates | |
| 507 | // GCC 5 supports variable templates | |
| 541 | 508 | #if !defined(__cpp_variable_templates) || __cpp_variable_templates < 201304L |
| 542 | 509 | #define _LIBCPP_HAS_NO_VARIABLE_TEMPLATES |
| 543 | 510 | #endif |
| 544 | 511 | |
| 545 | #ifndef __GXX_EXPERIMENTAL_CXX0X__ | |
| 546 | ||
| 547 | #define _LIBCPP_HAS_NO_DECLTYPE | |
| 548 | #define _LIBCPP_HAS_NO_NULLPTR | |
| 549 | #define _LIBCPP_HAS_NO_UNICODE_CHARS | |
| 550 | #define _LIBCPP_HAS_NO_VARIADICS | |
| 551 | #define _LIBCPP_HAS_NO_RVALUE_REFERENCES | |
| 552 | #define _LIBCPP_HAS_NO_STRONG_ENUMS | |
| 553 | #define _LIBCPP_HAS_NO_NOEXCEPT | |
| 554 | ||
| 555 | #else // __GXX_EXPERIMENTAL_CXX0X__ | |
| 556 | ||
| 557 | #if _GNUC_VER < 403 | |
| 558 | #define _LIBCPP_HAS_NO_RVALUE_REFERENCES | |
| 559 | #endif | |
| 560 | ||
| 561 | ||
| 562 | #if _GNUC_VER < 404 | |
| 563 | #define _LIBCPP_HAS_NO_DECLTYPE | |
| 564 | #define _LIBCPP_HAS_NO_UNICODE_CHARS | |
| 565 | #define _LIBCPP_HAS_NO_VARIADICS | |
| 566 | #define _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS | |
| 567 | #endif // _GNUC_VER < 404 | |
| 568 | ||
| 569 | #if _GNUC_VER < 406 | |
| 570 | #define _LIBCPP_HAS_NO_NOEXCEPT | |
| 571 | #define _LIBCPP_HAS_NO_NULLPTR | |
| 572 | #endif | |
| 573 | ||
| 574 | #endif // __GXX_EXPERIMENTAL_CXX0X__ | |
| 575 | ||
| 576 | 512 | #if !defined(_LIBCPP_HAS_NO_ASAN) && !defined(__SANITIZE_ADDRESS__) |
| 577 | 513 | #define _LIBCPP_HAS_NO_ASAN |
| 578 | 514 | #endif |
| ... | ... | @@ -597,16 +533,12 @@ typedef __char32_t char32_t; |
| 597 | 533 | #error "MSVC versions prior to Visual Studio 2015 are not supported" |
| 598 | 534 | #endif |
| 599 | 535 | |
| 600 | #define _LIBCPP_HAS_IS_BASE_OF | |
| 601 | #define _LIBCPP_HAS_NO_CONSTEXPR | |
| 602 | 536 | #define _LIBCPP_HAS_NO_CXX14_CONSTEXPR |
| 603 | 537 | #define _LIBCPP_HAS_NO_VARIABLE_TEMPLATES |
| 604 | #define _LIBCPP_HAS_NO_NOEXCEPT | |
| 605 | 538 | #define __alignof__ __alignof |
| 606 | 539 | #define _LIBCPP_NORETURN __declspec(noreturn) |
| 607 | 540 | #define _ALIGNAS(x) __declspec(align(x)) |
| 608 | 541 | #define _ALIGNAS_TYPE(x) alignas(x) |
| 609 | #define _LIBCPP_HAS_NO_VARIADICS | |
| 610 | 542 | |
| 611 | 543 | #define _LIBCPP_WEAK |
| 612 | 544 | |
| ... | ... | @@ -623,12 +555,7 @@ typedef __char32_t char32_t; |
| 623 | 555 | #define _ATTRIBUTE(x) __attribute__((x)) |
| 624 | 556 | #define _LIBCPP_NORETURN __attribute__((noreturn)) |
| 625 | 557 | |
| 626 | #define _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS | |
| 627 | #define _LIBCPP_HAS_NO_NOEXCEPT | |
| 628 | #define _LIBCPP_HAS_NO_NULLPTR | |
| 629 | 558 | #define _LIBCPP_HAS_NO_UNICODE_CHARS |
| 630 | #define _LIBCPP_HAS_IS_BASE_OF | |
| 631 | #define _LIBCPP_HAS_IS_FINAL | |
| 632 | 559 | #define _LIBCPP_HAS_NO_VARIABLE_TEMPLATES |
| 633 | 560 | |
| 634 | 561 | #if defined(_AIX) |
| ... | ... | @@ -659,8 +586,13 @@ typedef __char32_t char32_t; |
| 659 | 586 | # define _LIBCPP_EXPORTED_FROM_ABI |
| 660 | 587 | #elif defined(_LIBCPP_BUILDING_LIBRARY) |
| 661 | 588 | # define _LIBCPP_DLL_VIS __declspec(dllexport) |
| 662 | # define _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS | |
| 663 | # define _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS _LIBCPP_DLL_VIS | |
| 589 | # if defined(__MINGW32__) | |
| 590 | # define _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS _LIBCPP_DLL_VIS | |
| 591 | # define _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS | |
| 592 | # else | |
| 593 | # define _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS | |
| 594 | # define _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS _LIBCPP_DLL_VIS | |
| 595 | # endif | |
| 664 | 596 | # define _LIBCPP_OVERRIDABLE_FUNC_VIS _LIBCPP_DLL_VIS |
| 665 | 597 | # define _LIBCPP_EXPORTED_FROM_ABI __declspec(dllexport) |
| 666 | 598 | #else |
| ... | ... | @@ -777,7 +709,7 @@ typedef __char32_t char32_t; |
| 777 | 709 | #else |
| 778 | 710 | // Try to approximate the effect of exclude_from_explicit_instantiation |
| 779 | 711 | // (which is that entities are not assumed to be provided by explicit |
| 780 | // template instantitations in the dylib) by always inlining those entities. | |
| 712 | // template instantiations in the dylib) by always inlining those entities. | |
| 781 | 713 | # define _LIBCPP_EXCLUDE_FROM_EXPLICIT_INSTANTIATION _LIBCPP_ALWAYS_INLINE |
| 782 | 714 | #endif |
| 783 | 715 | |
| ... | ... | @@ -789,6 +721,16 @@ typedef __char32_t char32_t; |
| 789 | 721 | # endif |
| 790 | 722 | #endif |
| 791 | 723 | |
| 724 | #ifndef _LIBCPP_HAS_MERGED_TYPEINFO_NAMES_DEFAULT | |
| 725 | # ifdef _LIBCPP_OBJECT_FORMAT_COFF // Windows binaries can't merge typeinfos. | |
| 726 | # define _LIBCPP_HAS_MERGED_TYPEINFO_NAMES_DEFAULT 0 | |
| 727 | #else | |
| 728 | // TODO: This isn't strictly correct on ELF platforms due to llvm.org/PR37398 | |
| 729 | // And we should consider defaulting to OFF. | |
| 730 | # define _LIBCPP_HAS_MERGED_TYPEINFO_NAMES_DEFAULT 1 | |
| 731 | #endif | |
| 732 | #endif | |
| 733 | ||
| 792 | 734 | #ifndef _LIBCPP_HIDE_FROM_ABI |
| 793 | 735 | # if _LIBCPP_HIDE_FROM_ABI_PER_TU |
| 794 | 736 | # define _LIBCPP_HIDE_FROM_ABI _LIBCPP_HIDDEN _LIBCPP_INTERNAL_LINKAGE |
| ... | ... | @@ -843,22 +785,6 @@ _LIBCPP_BEGIN_NAMESPACE_STD _LIBCPP_END_NAMESPACE_STD |
| 843 | 785 | # define _NOEXCEPT_(x) |
| 844 | 786 | #endif |
| 845 | 787 | |
| 846 | #if defined(_LIBCPP_DEBUG_USE_EXCEPTIONS) | |
| 847 | # if !defined(_LIBCPP_DEBUG) | |
| 848 | # error cannot use _LIBCPP_DEBUG_USE_EXCEPTIONS unless _LIBCPP_DEBUG is defined | |
| 849 | # endif | |
| 850 | # ifdef _LIBCPP_HAS_NO_NOEXCEPT | |
| 851 | # define _NOEXCEPT_DEBUG | |
| 852 | # define _NOEXCEPT_DEBUG_(x) | |
| 853 | # else | |
| 854 | # define _NOEXCEPT_DEBUG noexcept(false) | |
| 855 | # define _NOEXCEPT_DEBUG_(x) noexcept(false) | |
| 856 | # endif | |
| 857 | #else | |
| 858 | # define _NOEXCEPT_DEBUG _NOEXCEPT | |
| 859 | # define _NOEXCEPT_DEBUG_(x) _NOEXCEPT_(x) | |
| 860 | #endif | |
| 861 | ||
| 862 | 788 | #ifdef _LIBCPP_HAS_NO_UNICODE_CHARS |
| 863 | 789 | typedef unsigned short char16_t; |
| 864 | 790 | typedef unsigned int char32_t; |
| ... | ... | @@ -869,30 +795,11 @@ typedef unsigned int char32_t; |
| 869 | 795 | #endif |
| 870 | 796 | |
| 871 | 797 | #ifdef _LIBCPP_CXX03_LANG |
| 872 | # if __has_extension(c_static_assert) | |
| 873 | # define static_assert(__b, __m) _Static_assert(__b, __m) | |
| 874 | # else | |
| 875 | extern "C++" { | |
| 876 | template <bool> struct __static_assert_test; | |
| 877 | template <> struct __static_assert_test<true> {}; | |
| 878 | template <unsigned> struct __static_assert_check {}; | |
| 879 | } | |
| 880 | # define static_assert(__b, __m) \ | |
| 881 | typedef __static_assert_check<sizeof(__static_assert_test<(__b)>)> \ | |
| 882 | _LIBCPP_CONCAT(__t, __LINE__) | |
| 883 | # endif // __has_extension(c_static_assert) | |
| 798 | # define static_assert(...) _Static_assert(__VA_ARGS__) | |
| 799 | # define decltype(...) __decltype(__VA_ARGS__) | |
| 884 | 800 | #endif // _LIBCPP_CXX03_LANG |
| 885 | 801 | |
| 886 | #ifdef _LIBCPP_HAS_NO_DECLTYPE | |
| 887 | // GCC 4.6 provides __decltype in all standard modes. | |
| 888 | # if __has_keyword(__decltype) || _LIBCPP_CLANG_VER >= 304 || _GNUC_VER >= 406 | |
| 889 | # define decltype(__x) __decltype(__x) | |
| 890 | # else | |
| 891 | # define decltype(__x) __typeof__(__x) | |
| 892 | # endif | |
| 893 | #endif | |
| 894 | ||
| 895 | #ifdef _LIBCPP_HAS_NO_CONSTEXPR | |
| 802 | #ifdef _LIBCPP_CXX03_LANG | |
| 896 | 803 | # define _LIBCPP_CONSTEXPR |
| 897 | 804 | #else |
| 898 | 805 | # define _LIBCPP_CONSTEXPR constexpr |
| ... | ... | @@ -911,9 +818,9 @@ template <unsigned> struct __static_assert_check {}; |
| 911 | 818 | #endif |
| 912 | 819 | |
| 913 | 820 | #ifdef __GNUC__ |
| 914 | # define _NOALIAS __attribute__((__malloc__)) | |
| 821 | # define _LIBCPP_NOALIAS __attribute__((__malloc__)) | |
| 915 | 822 | #else |
| 916 | # define _NOALIAS | |
| 823 | # define _LIBCPP_NOALIAS | |
| 917 | 824 | #endif |
| 918 | 825 | |
| 919 | 826 | #if __has_feature(cxx_explicit_conversions) || defined(__IBMCPP__) || \ |
| ... | ... | @@ -966,10 +873,6 @@ template <unsigned> struct __static_assert_check {}; |
| 966 | 873 | #define _LIBCPP_EXTERN_TEMPLATE2(...) extern template __VA_ARGS__; |
| 967 | 874 | #endif |
| 968 | 875 | |
| 969 | #if defined(__APPLE__) && defined(__LP64__) && !defined(__x86_64__) | |
| 970 | #define _LIBCPP_NONUNIQUE_RTTI_BIT (1ULL << 63) | |
| 971 | #endif | |
| 972 | ||
| 973 | 876 | #if defined(__APPLE__) || defined(__FreeBSD__) || defined(_LIBCPP_MSVCRT_LIKE) || \ |
| 974 | 877 | defined(__sun__) || defined(__NetBSD__) || defined(__CloudABI__) |
| 975 | 878 | #define _LIBCPP_LOCALE__L_EXTENSIONS 1 |
| ... | ... | @@ -990,13 +893,10 @@ template <unsigned> struct __static_assert_check {}; |
| 990 | 893 | // for align_val_t were added in 19.12, aka VS 2017 version 15.3. |
| 991 | 894 | #if defined(_LIBCPP_MSVCRT) && defined(_MSC_VER) && _MSC_VER < 1912 |
| 992 | 895 | # define _LIBCPP_HAS_NO_LIBRARY_ALIGNED_ALLOCATION |
| 993 | #elif defined(_LIBCPP_ABI_MICROSOFT) && !defined(_LIBCPP_NO_VCRUNTIME) | |
| 994 | # define _LIBCPP_DEFER_NEW_TO_VCRUNTIME | |
| 995 | # if !defined(__cpp_aligned_new) | |
| 996 | // We're defering to Microsoft's STL to provide aligned new et al. We don't | |
| 997 | // have it unless the language feature test macro is defined. | |
| 998 | # define _LIBCPP_HAS_NO_LIBRARY_ALIGNED_ALLOCATION | |
| 999 | # endif | |
| 896 | #elif defined(_LIBCPP_ABI_VCRUNTIME) && !defined(__cpp_aligned_new) | |
| 897 | // We're deferring to Microsoft's STL to provide aligned new et al. We don't | |
| 898 | // have it unless the language feature test macro is defined. | |
| 899 | # define _LIBCPP_HAS_NO_LIBRARY_ALIGNED_ALLOCATION | |
| 1000 | 900 | #endif |
| 1001 | 901 | |
| 1002 | 902 | #if defined(__APPLE__) |
| ... | ... | @@ -1025,8 +925,10 @@ template <unsigned> struct __static_assert_check {}; |
| 1025 | 925 | #endif |
| 1026 | 926 | |
| 1027 | 927 | // Deprecation macros. |
| 1028 | // Deprecations warnings are only enabled when _LIBCPP_ENABLE_DEPRECATION_WARNINGS is defined. | |
| 1029 | #if defined(_LIBCPP_ENABLE_DEPRECATION_WARNINGS) | |
| 928 | // | |
| 929 | // Deprecations warnings are always enabled, except when users explicitly opt-out | |
| 930 | // by defining _LIBCPP_DISABLE_DEPRECATION_WARNINGS. | |
| 931 | #if !defined(_LIBCPP_DISABLE_DEPRECATION_WARNINGS) | |
| 1030 | 932 | # if __has_attribute(deprecated) |
| 1031 | 933 | # define _LIBCPP_DEPRECATED __attribute__ ((deprecated)) |
| 1032 | 934 | # elif _LIBCPP_STD_VER > 11 |
| ... | ... | @@ -1128,6 +1030,12 @@ template <unsigned> struct __static_assert_check {}; |
| 1128 | 1030 | #endif |
| 1129 | 1031 | #endif |
| 1130 | 1032 | |
| 1033 | #if __has_attribute(no_destroy) | |
| 1034 | # define _LIBCPP_NO_DESTROY __attribute__((__no_destroy__)) | |
| 1035 | #else | |
| 1036 | # define _LIBCPP_NO_DESTROY | |
| 1037 | #endif | |
| 1038 | ||
| 1131 | 1039 | #ifndef _LIBCPP_HAS_NO_ASAN |
| 1132 | 1040 | _LIBCPP_FUNC_VIS extern "C" void __sanitizer_annotate_contiguous_container( |
| 1133 | 1041 | const void *, const void *, const void *, const void *); |
| ... | ... | @@ -1158,6 +1066,7 @@ _LIBCPP_FUNC_VIS extern "C" void __sanitizer_annotate_contiguous_container( |
| 1158 | 1066 | !defined(_LIBCPP_HAS_THREAD_API_EXTERNAL) |
| 1159 | 1067 | # if defined(__FreeBSD__) || \ |
| 1160 | 1068 | defined(__Fuchsia__) || \ |
| 1069 | defined(__wasi__) || \ | |
| 1161 | 1070 | defined(__NetBSD__) || \ |
| 1162 | 1071 | defined(__linux__) || \ |
| 1163 | 1072 | defined(__GNU__) || \ |
| ... | ... | @@ -1188,6 +1097,23 @@ _LIBCPP_FUNC_VIS extern "C" void __sanitizer_annotate_contiguous_container( |
| 1188 | 1097 | _LIBCPP_HAS_NO_THREADS is defined. |
| 1189 | 1098 | #endif |
| 1190 | 1099 | |
| 1100 | // The Apple, glibc, and Bionic implementation of pthreads implements | |
| 1101 | // pthread_mutex_destroy as nop for regular mutexes. Additionally, Win32 | |
| 1102 | // mutexes have no destroy mechanism. | |
| 1103 | // TODO(EricWF): Enable this optimization on Apple and Bionic platforms after | |
| 1104 | // speaking to their respective stakeholders. | |
| 1105 | #if (defined(_LIBCPP_HAS_THREAD_API_PTHREAD) && defined(__GLIBC__)) \ | |
| 1106 | || defined(_LIBCPP_HAS_THREAD_API_WIN32) | |
| 1107 | # define _LIBCPP_HAS_TRIVIAL_MUTEX_DESTRUCTION | |
| 1108 | #endif | |
| 1109 | ||
| 1110 | // Destroying a condvar is a nop on Windows. | |
| 1111 | // TODO(EricWF): This is potentially true for some pthread implementations | |
| 1112 | // as well. | |
| 1113 | #if defined(_LIBCPP_HAS_THREAD_API_WIN32) | |
| 1114 | # define _LIBCPP_HAS_TRIVIAL_CONDVAR_DESTRUCTION | |
| 1115 | #endif | |
| 1116 | ||
| 1191 | 1117 | // Systems that use capability-based security (FreeBSD with Capsicum, |
| 1192 | 1118 | // Nuxi CloudABI) may only provide local filesystem access (using *at()). |
| 1193 | 1119 | // Functions like open(), rename(), unlink() and stat() should not be |
| ... | ... | @@ -1204,7 +1130,7 @@ _LIBCPP_FUNC_VIS extern "C" void __sanitizer_annotate_contiguous_container( |
| 1204 | 1130 | #endif |
| 1205 | 1131 | |
| 1206 | 1132 | #if defined(__BIONIC__) || defined(__CloudABI__) || \ |
| 1207 | defined(__Fuchsia__) || defined(_LIBCPP_HAS_MUSL_LIBC) | |
| 1133 | defined(__Fuchsia__) || defined(__wasi__) || defined(_LIBCPP_HAS_MUSL_LIBC) | |
| 1208 | 1134 | #define _LIBCPP_PROVIDES_DEFAULT_RUNE_TABLE |
| 1209 | 1135 | #endif |
| 1210 | 1136 | |
| ... | ... | @@ -1216,13 +1142,22 @@ _LIBCPP_FUNC_VIS extern "C" void __sanitizer_annotate_contiguous_container( |
| 1216 | 1142 | |
| 1217 | 1143 | #if __has_feature(cxx_atomic) || __has_extension(c_atomic) || __has_keyword(_Atomic) |
| 1218 | 1144 | # define _LIBCPP_HAS_C_ATOMIC_IMP |
| 1219 | #elif _GNUC_VER > 407 | |
| 1145 | #elif defined(_LIBCPP_COMPILER_GCC) | |
| 1220 | 1146 | # define _LIBCPP_HAS_GCC_ATOMIC_IMP |
| 1221 | 1147 | #endif |
| 1222 | 1148 | |
| 1223 | #if (!defined(_LIBCPP_HAS_C_ATOMIC_IMP) && !defined(_LIBCPP_HAS_GCC_ATOMIC_IMP)) \ | |
| 1149 | #if (!defined(_LIBCPP_HAS_C_ATOMIC_IMP) && \ | |
| 1150 | !defined(_LIBCPP_HAS_GCC_ATOMIC_IMP) && \ | |
| 1151 | !defined(_LIBCPP_HAS_EXTERNAL_ATOMIC_IMP)) \ | |
| 1224 | 1152 | || defined(_LIBCPP_HAS_NO_THREADS) |
| 1225 | #define _LIBCPP_HAS_NO_ATOMIC_HEADER | |
| 1153 | # define _LIBCPP_HAS_NO_ATOMIC_HEADER | |
| 1154 | #else | |
| 1155 | # ifndef _LIBCPP_ATOMIC_FLAG_TYPE | |
| 1156 | # define _LIBCPP_ATOMIC_FLAG_TYPE bool | |
| 1157 | # endif | |
| 1158 | # ifdef _LIBCPP_FREESTANDING | |
| 1159 | # define _LIBCPP_ATOMIC_ONLY_USE_BUILTINS | |
| 1160 | # endif | |
| 1226 | 1161 | #endif |
| 1227 | 1162 | |
| 1228 | 1163 | #ifndef _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK |
| ... | ... | @@ -1250,6 +1185,10 @@ _LIBCPP_FUNC_VIS extern "C" void __sanitizer_annotate_contiguous_container( |
| 1250 | 1185 | #define _LIBCPP_HAS_NO_BUILTIN_ADDRESSOF |
| 1251 | 1186 | #endif |
| 1252 | 1187 | |
| 1188 | #if !__has_builtin(__builtin_is_constant_evaluated) && _GNUC_VER < 900 | |
| 1189 | #define _LIBCPP_HAS_NO_BUILTIN_IS_CONSTANT_EVALUATED | |
| 1190 | #endif | |
| 1191 | ||
| 1253 | 1192 | #if !defined(_LIBCPP_HAS_NO_OFF_T_FUNCTIONS) |
| 1254 | 1193 | # if defined(_LIBCPP_MSVCRT) || defined(_NEWLIB_VERSION) |
| 1255 | 1194 | # define _LIBCPP_HAS_NO_OFF_T_FUNCTIONS |
| ... | ... | @@ -1277,6 +1216,21 @@ _LIBCPP_FUNC_VIS extern "C" void __sanitizer_annotate_contiguous_container( |
| 1277 | 1216 | # define _LIBCPP_FALLTHROUGH() ((void)0) |
| 1278 | 1217 | #endif |
| 1279 | 1218 | |
| 1219 | #if __has_attribute(__nodebug__) | |
| 1220 | #define _LIBCPP_NODEBUG __attribute__((__nodebug__)) | |
| 1221 | #else | |
| 1222 | #define _LIBCPP_NODEBUG | |
| 1223 | #endif | |
| 1224 | ||
| 1225 | #ifndef _LIBCPP_NODEBUG_TYPE | |
| 1226 | #if __has_attribute(__nodebug__) && \ | |
| 1227 | (defined(_LIBCPP_COMPILER_CLANG) && _LIBCPP_CLANG_VER >= 900) | |
| 1228 | #define _LIBCPP_NODEBUG_TYPE __attribute__((nodebug)) | |
| 1229 | #else | |
| 1230 | #define _LIBCPP_NODEBUG_TYPE | |
| 1231 | #endif | |
| 1232 | #endif // !defined(_LIBCPP_NODEBUG_TYPE) | |
| 1233 | ||
| 1280 | 1234 | #if defined(_LIBCPP_ABI_MICROSOFT) && \ |
| 1281 | 1235 | (defined(_LIBCPP_COMPILER_MSVC) || __has_declspec_attribute(empty_bases)) |
| 1282 | 1236 | # define _LIBCPP_DECLSPEC_EMPTY_BASES __declspec(empty_bases) |
| ... | ... | @@ -1312,7 +1266,8 @@ _LIBCPP_FUNC_VIS extern "C" void __sanitizer_annotate_contiguous_container( |
| 1312 | 1266 | #if !defined(_LIBCPP_BUILDING_LIBRARY) && \ |
| 1313 | 1267 | !defined(_LIBCPP_DISABLE_AVAILABILITY) && \ |
| 1314 | 1268 | __has_feature(attribute_availability_with_strict) && \ |
| 1315 | __has_feature(attribute_availability_in_templates) | |
| 1269 | __has_feature(attribute_availability_in_templates) && \ | |
| 1270 | __has_extension(pragma_clang_attribute_external_declaration) | |
| 1316 | 1271 | # ifdef __APPLE__ |
| 1317 | 1272 | # define _LIBCPP_USE_AVAILABILITY_APPLE |
| 1318 | 1273 | # endif |
| ... | ... | @@ -1355,6 +1310,21 @@ _LIBCPP_FUNC_VIS extern "C" void __sanitizer_annotate_contiguous_container( |
| 1355 | 1310 | # define _LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR \ |
| 1356 | 1311 | __attribute__((availability(macosx,strict,introduced=10.9))) \ |
| 1357 | 1312 | __attribute__((availability(ios,strict,introduced=7.0))) |
| 1313 | # define _LIBCPP_AVAILABILITY_FILESYSTEM \ | |
| 1314 | __attribute__((availability(macosx,strict,introduced=10.15))) \ | |
| 1315 | __attribute__((availability(ios,strict,introduced=13.0))) \ | |
| 1316 | __attribute__((availability(tvos,strict,introduced=13.0))) \ | |
| 1317 | __attribute__((availability(watchos,strict,introduced=6.0))) | |
| 1318 | # define _LIBCPP_AVAILABILITY_FILESYSTEM_PUSH \ | |
| 1319 | _Pragma("clang attribute push(__attribute__((availability(macosx,strict,introduced=10.15))), apply_to=any(function,record))") \ | |
| 1320 | _Pragma("clang attribute push(__attribute__((availability(ios,strict,introduced=13.0))), apply_to=any(function,record))") \ | |
| 1321 | _Pragma("clang attribute push(__attribute__((availability(tvos,strict,introduced=13.0))), apply_to=any(function,record))") \ | |
| 1322 | _Pragma("clang attribute push(__attribute__((availability(watchos,strict,introduced=6.0))), apply_to=any(function,record))") | |
| 1323 | # define _LIBCPP_AVAILABILITY_FILESYSTEM_POP \ | |
| 1324 | _Pragma("clang attribute pop") \ | |
| 1325 | _Pragma("clang attribute pop") \ | |
| 1326 | _Pragma("clang attribute pop") \ | |
| 1327 | _Pragma("clang attribute pop") | |
| 1358 | 1328 | #else |
| 1359 | 1329 | # define _LIBCPP_AVAILABILITY_SHARED_MUTEX |
| 1360 | 1330 | # define _LIBCPP_AVAILABILITY_BAD_VARIANT_ACCESS |
| ... | ... | @@ -1366,6 +1336,9 @@ _LIBCPP_FUNC_VIS extern "C" void __sanitizer_annotate_contiguous_container( |
| 1366 | 1336 | # define _LIBCPP_AVAILABILITY_TYPEINFO_VTABLE |
| 1367 | 1337 | # define _LIBCPP_AVAILABILITY_LOCALE_CATEGORY |
| 1368 | 1338 | # define _LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR |
| 1339 | # define _LIBCPP_AVAILABILITY_FILESYSTEM | |
| 1340 | # define _LIBCPP_AVAILABILITY_FILESYSTEM_PUSH | |
| 1341 | # define _LIBCPP_AVAILABILITY_FILESYSTEM_POP | |
| 1369 | 1342 | #endif |
| 1370 | 1343 | |
| 1371 | 1344 | // Define availability that depends on _LIBCPP_NO_EXCEPTIONS. |
lib/libcxx/include/__config_site.in+4-4| ... | ... | @@ -1,9 +1,8 @@ |
| 1 | 1 | //===----------------------------------------------------------------------===// |
| 2 | 2 | // |
| 3 | // The LLVM Compiler Infrastructure | |
| 4 | // | |
| 5 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 6 | // Source Licenses. See LICENSE.TXT for details. | |
| 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 4 | // See https://llvm.org/LICENSE.txt for license information. | |
| 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 7 | 6 | // |
| 8 | 7 | //===----------------------------------------------------------------------===// |
| 9 | 8 | |
| ... | ... | @@ -28,6 +27,7 @@ |
| 28 | 27 | #cmakedefine _LIBCPP_HAS_THREAD_LIBRARY_EXTERNAL |
| 29 | 28 | #cmakedefine _LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS |
| 30 | 29 | #cmakedefine _LIBCPP_NO_VCRUNTIME |
| 30 | #cmakedefine01 _LIBCPP_HAS_MERGED_TYPEINFO_NAMES_DEFAULT | |
| 31 | 31 | #cmakedefine _LIBCPP_ABI_NAMESPACE @_LIBCPP_ABI_NAMESPACE@ |
| 32 | 32 | |
| 33 | 33 | @_LIBCPP_ABI_DEFINES@ |
lib/libcxx/include/__debug+16-39| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===--------------------------- __debug ----------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 | |
| ... | ... | @@ -12,6 +11,7 @@ |
| 12 | 11 | #define _LIBCPP_DEBUG_H |
| 13 | 12 | |
| 14 | 13 | #include <__config> |
| 14 | #include <iosfwd> | |
| 15 | 15 | |
| 16 | 16 | #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) |
| 17 | 17 | #pragma GCC system_header |
| ... | ... | @@ -25,7 +25,6 @@ |
| 25 | 25 | # include <cstdlib> |
| 26 | 26 | # include <cstdio> |
| 27 | 27 | # include <cstddef> |
| 28 | # include <exception> | |
| 29 | 28 | #endif |
| 30 | 29 | |
| 31 | 30 | #if _LIBCPP_DEBUG_LEVEL >= 1 && !defined(_LIBCPP_ASSERT) |
| ... | ... | @@ -50,10 +49,6 @@ |
| 50 | 49 | #define _LIBCPP_DEBUG_MODE(...) ((void)0) |
| 51 | 50 | #endif |
| 52 | 51 | |
| 53 | #if _LIBCPP_DEBUG_LEVEL < 1 | |
| 54 | class _LIBCPP_EXCEPTION_ABI __libcpp_debug_exception; | |
| 55 | #endif | |
| 56 | ||
| 57 | 52 | _LIBCPP_BEGIN_NAMESPACE_STD |
| 58 | 53 | |
| 59 | 54 | struct _LIBCPP_TEMPLATE_VIS __libcpp_debug_info { |
| ... | ... | @@ -63,6 +58,9 @@ struct _LIBCPP_TEMPLATE_VIS __libcpp_debug_info { |
| 63 | 58 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR |
| 64 | 59 | __libcpp_debug_info(const char* __f, int __l, const char* __p, const char* __m) |
| 65 | 60 | : __file_(__f), __line_(__l), __pred_(__p), __msg_(__m) {} |
| 61 | ||
| 62 | _LIBCPP_FUNC_VIS std::string what() const; | |
| 63 | ||
| 66 | 64 | const char* __file_; |
| 67 | 65 | int __line_; |
| 68 | 66 | const char* __pred_; |
| ... | ... | @@ -80,38 +78,11 @@ extern _LIBCPP_EXPORTED_FROM_ABI __libcpp_debug_function_type __libcpp_debug_fun |
| 80 | 78 | _LIBCPP_NORETURN _LIBCPP_FUNC_VIS |
| 81 | 79 | void __libcpp_abort_debug_function(__libcpp_debug_info const&); |
| 82 | 80 | |
| 83 | /// __libcpp_throw_debug_function - A debug handler that throws | |
| 84 | /// an instance of __libcpp_debug_exception when called. | |
| 85 | _LIBCPP_NORETURN _LIBCPP_FUNC_VIS | |
| 86 | void __libcpp_throw_debug_function(__libcpp_debug_info const&); | |
| 87 | ||
| 88 | 81 | /// __libcpp_set_debug_function - Set the debug handler to the specified |
| 89 | 82 | /// function. |
| 90 | 83 | _LIBCPP_FUNC_VIS |
| 91 | 84 | bool __libcpp_set_debug_function(__libcpp_debug_function_type __func); |
| 92 | 85 | |
| 93 | // Setup the throwing debug handler during dynamic initialization. | |
| 94 | #if _LIBCPP_DEBUG_LEVEL >= 1 && defined(_LIBCPP_DEBUG_USE_EXCEPTIONS) | |
| 95 | # if defined(_LIBCPP_NO_EXCEPTIONS) | |
| 96 | # error _LIBCPP_DEBUG_USE_EXCEPTIONS cannot be used when exceptions are disabled. | |
| 97 | # endif | |
| 98 | static bool __init_dummy = __libcpp_set_debug_function(__libcpp_throw_debug_function); | |
| 99 | #endif | |
| 100 | ||
| 101 | #if _LIBCPP_DEBUG_LEVEL >= 1 || defined(_LIBCPP_BUILDING_LIBRARY) | |
| 102 | class _LIBCPP_EXCEPTION_ABI __libcpp_debug_exception : public exception { | |
| 103 | public: | |
| 104 | __libcpp_debug_exception() _NOEXCEPT; | |
| 105 | explicit __libcpp_debug_exception(__libcpp_debug_info const& __i); | |
| 106 | __libcpp_debug_exception(__libcpp_debug_exception const&); | |
| 107 | ~__libcpp_debug_exception() _NOEXCEPT; | |
| 108 | const char* what() const _NOEXCEPT; | |
| 109 | private: | |
| 110 | struct __libcpp_debug_exception_imp; | |
| 111 | __libcpp_debug_exception_imp *__imp_; | |
| 112 | }; | |
| 113 | #endif | |
| 114 | ||
| 115 | 86 | #if _LIBCPP_DEBUG_LEVEL >= 2 || defined(_LIBCPP_BUILDING_LIBRARY) |
| 116 | 87 | |
| 117 | 88 | struct _LIBCPP_TYPE_VIS __c_node; |
| ... | ... | @@ -251,16 +222,22 @@ public: |
| 251 | 222 | __db_c_const_iterator __c_end() const; |
| 252 | 223 | __db_i_const_iterator __i_end() const; |
| 253 | 224 | |
| 225 | typedef __c_node*(_InsertConstruct)(void*, void*, __c_node*); | |
| 226 | ||
| 227 | template <class _Cont> | |
| 228 | _LIBCPP_INLINE_VISIBILITY static __c_node* __create_C_node(void *__mem, void *__c, __c_node *__next) { | |
| 229 | return ::new(__mem) _C_node<_Cont>(__c, __next); | |
| 230 | } | |
| 231 | ||
| 254 | 232 | template <class _Cont> |
| 255 | 233 | _LIBCPP_INLINE_VISIBILITY |
| 256 | 234 | void __insert_c(_Cont* __c) |
| 257 | 235 | { |
| 258 | __c_node* __n = __insert_c(static_cast<void*>(__c)); | |
| 259 | ::new(__n) _C_node<_Cont>(__n->__c_, __n->__next_); | |
| 236 | __insert_c(static_cast<void*>(__c), &__create_C_node<_Cont>); | |
| 260 | 237 | } |
| 261 | 238 | |
| 262 | 239 | void __insert_i(void* __i); |
| 263 | __c_node* __insert_c(void* __c); | |
| 240 | void __insert_c(void* __c, _InsertConstruct* __fn); | |
| 264 | 241 | void __erase_c(void* __c); |
| 265 | 242 | |
| 266 | 243 | void __insert_ic(void* __i, const void* __c); |
lib/libcxx/include/__errc+3-4| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===---------------------------- __errc ----------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 |
lib/libcxx/include/__functional_03+3-4| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===----------------------------------------------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 |
lib/libcxx/include/__functional_base+8-9| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===----------------------------------------------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 | |
| ... | ... | @@ -126,7 +125,7 @@ struct __weak_result_type_imp // bool is true |
| 126 | 125 | : public __maybe_derive_from_unary_function<_Tp>, |
| 127 | 126 | public __maybe_derive_from_binary_function<_Tp> |
| 128 | 127 | { |
| 129 | typedef typename _Tp::result_type result_type; | |
| 128 | typedef _LIBCPP_NODEBUG_TYPE typename _Tp::result_type result_type; | |
| 130 | 129 | }; |
| 131 | 130 | |
| 132 | 131 | template <class _Tp> |
| ... | ... | @@ -147,19 +146,19 @@ struct __weak_result_type |
| 147 | 146 | template <class _Rp> |
| 148 | 147 | struct __weak_result_type<_Rp ()> |
| 149 | 148 | { |
| 150 | typedef _Rp result_type; | |
| 149 | typedef _LIBCPP_NODEBUG_TYPE _Rp result_type; | |
| 151 | 150 | }; |
| 152 | 151 | |
| 153 | 152 | template <class _Rp> |
| 154 | 153 | struct __weak_result_type<_Rp (&)()> |
| 155 | 154 | { |
| 156 | typedef _Rp result_type; | |
| 155 | typedef _LIBCPP_NODEBUG_TYPE _Rp result_type; | |
| 157 | 156 | }; |
| 158 | 157 | |
| 159 | 158 | template <class _Rp> |
| 160 | 159 | struct __weak_result_type<_Rp (*)()> |
| 161 | 160 | { |
| 162 | typedef _Rp result_type; | |
| 161 | typedef _LIBCPP_NODEBUG_TYPE _Rp result_type; | |
| 163 | 162 | }; |
| 164 | 163 | |
| 165 | 164 | // 1 argument case |
| ... | ... | @@ -611,7 +610,7 @@ _LIBCPP_INLINE_VAR constexpr size_t uses_allocator_v = uses_allocator<_Tp, _Allo |
| 611 | 610 | template <class _Tp, class _Alloc, class ..._Args> |
| 612 | 611 | struct __uses_alloc_ctor_imp |
| 613 | 612 | { |
| 614 | typedef typename __uncvref<_Alloc>::type _RawAlloc; | |
| 613 | typedef _LIBCPP_NODEBUG_TYPE typename __uncvref<_Alloc>::type _RawAlloc; | |
| 615 | 614 | static const bool __ua = uses_allocator<_Tp, _RawAlloc>::value; |
| 616 | 615 | static const bool __ic = |
| 617 | 616 | is_constructible<_Tp, allocator_arg_t, _Alloc, _Args...>::value; |
lib/libcxx/include/__functional_base_03+3-4| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===----------------------------------------------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 |
lib/libcxx/include/__hash_table+15-15| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===----------------------------------------------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 | |
| ... | ... | @@ -123,7 +122,7 @@ inline _LIBCPP_INLINE_VISIBILITY |
| 123 | 122 | size_t |
| 124 | 123 | __next_hash_pow2(size_t __n) |
| 125 | 124 | { |
| 126 | return __n < 2 ? __n : (size_t(1) << (std::numeric_limits<size_t>::digits - __clz(__n-1))); | |
| 125 | return __n < 2 ? __n : (size_t(1) << (std::numeric_limits<size_t>::digits - __libcpp_clz(__n-1))); | |
| 127 | 126 | } |
| 128 | 127 | |
| 129 | 128 | |
| ... | ... | @@ -876,9 +875,9 @@ struct __enforce_unordered_container_requirements { |
| 876 | 875 | template <class _Key, class _Hash, class _Equal> |
| 877 | 876 | #ifndef _LIBCPP_CXX03_LANG |
| 878 | 877 | _LIBCPP_DIAGNOSE_WARNING(!__invokable<_Equal const&, _Key const&, _Key const&>::value, |
| 879 | "the specified comparator type does not provide a const call operator") | |
| 878 | "the specified comparator type does not provide a viable const call operator") | |
| 880 | 879 | _LIBCPP_DIAGNOSE_WARNING(!__invokable<_Hash const&, _Key const&>::value, |
| 881 | "the specified hash functor does not provide a const call operator") | |
| 880 | "the specified hash functor does not provide a viable const call operator") | |
| 882 | 881 | #endif |
| 883 | 882 | typename __enforce_unordered_container_requirements<_Key, _Hash, _Equal>::type |
| 884 | 883 | __diagnose_unordered_container_requirements(int); |
| ... | ... | @@ -1261,7 +1260,7 @@ public: |
| 1261 | 1260 | |
| 1262 | 1261 | void swap(__hash_table& __u) |
| 1263 | 1262 | #if _LIBCPP_STD_VER <= 11 |
| 1264 | _NOEXCEPT_DEBUG_( | |
| 1263 | _NOEXCEPT_( | |
| 1265 | 1264 | __is_nothrow_swappable<hasher>::value && __is_nothrow_swappable<key_equal>::value |
| 1266 | 1265 | && (!allocator_traits<__pointer_allocator>::propagate_on_container_swap::value |
| 1267 | 1266 | || __is_nothrow_swappable<__pointer_allocator>::value) |
| ... | ... | @@ -1269,7 +1268,7 @@ public: |
| 1269 | 1268 | || __is_nothrow_swappable<__node_allocator>::value) |
| 1270 | 1269 | ); |
| 1271 | 1270 | #else |
| 1272 | _NOEXCEPT_DEBUG_(__is_nothrow_swappable<hasher>::value && __is_nothrow_swappable<key_equal>::value); | |
| 1271 | _NOEXCEPT_(__is_nothrow_swappable<hasher>::value && __is_nothrow_swappable<key_equal>::value); | |
| 1273 | 1272 | #endif |
| 1274 | 1273 | |
| 1275 | 1274 | _LIBCPP_INLINE_VISIBILITY |
| ... | ... | @@ -2249,7 +2248,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__node_handle_insert_unique( |
| 2249 | 2248 | return _InsertReturnType{end(), false, _NodeHandle()}; |
| 2250 | 2249 | pair<iterator, bool> __result = __node_insert_unique(__nh.__ptr_); |
| 2251 | 2250 | if (__result.second) |
| 2252 | __nh.__release(); | |
| 2251 | __nh.__release_ptr(); | |
| 2253 | 2252 | return _InsertReturnType{__result.first, __result.second, _VSTD::move(__nh)}; |
| 2254 | 2253 | } |
| 2255 | 2254 | |
| ... | ... | @@ -2264,7 +2263,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__node_handle_insert_unique( |
| 2264 | 2263 | return end(); |
| 2265 | 2264 | pair<iterator, bool> __result = __node_insert_unique(__nh.__ptr_); |
| 2266 | 2265 | if (__result.second) |
| 2267 | __nh.__release(); | |
| 2266 | __nh.__release_ptr(); | |
| 2268 | 2267 | return __result.first; |
| 2269 | 2268 | } |
| 2270 | 2269 | |
| ... | ... | @@ -2328,7 +2327,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__node_handle_insert_multi( |
| 2328 | 2327 | if (__nh.empty()) |
| 2329 | 2328 | return end(); |
| 2330 | 2329 | iterator __result = __node_insert_multi(__nh.__ptr_); |
| 2331 | __nh.__release(); | |
| 2330 | __nh.__release_ptr(); | |
| 2332 | 2331 | return __result; |
| 2333 | 2332 | } |
| 2334 | 2333 | |
| ... | ... | @@ -2342,7 +2341,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__node_handle_insert_multi( |
| 2342 | 2341 | if (__nh.empty()) |
| 2343 | 2342 | return end(); |
| 2344 | 2343 | iterator __result = __node_insert_multi(__hint, __nh.__ptr_); |
| 2345 | __nh.__release(); | |
| 2344 | __nh.__release_ptr(); | |
| 2346 | 2345 | return __result; |
| 2347 | 2346 | } |
| 2348 | 2347 | |
| ... | ... | @@ -2372,6 +2371,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__node_handle_merge_multi( |
| 2372 | 2371 | template <class _Tp, class _Hash, class _Equal, class _Alloc> |
| 2373 | 2372 | void |
| 2374 | 2373 | __hash_table<_Tp, _Hash, _Equal, _Alloc>::rehash(size_type __n) |
| 2374 | _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK | |
| 2375 | 2375 | { |
| 2376 | 2376 | if (__n == 1) |
| 2377 | 2377 | __n = 2; |
| ... | ... | @@ -2807,7 +2807,7 @@ template <class _Tp, class _Hash, class _Equal, class _Alloc> |
| 2807 | 2807 | void |
| 2808 | 2808 | __hash_table<_Tp, _Hash, _Equal, _Alloc>::swap(__hash_table& __u) |
| 2809 | 2809 | #if _LIBCPP_STD_VER <= 11 |
| 2810 | _NOEXCEPT_DEBUG_( | |
| 2810 | _NOEXCEPT_( | |
| 2811 | 2811 | __is_nothrow_swappable<hasher>::value && __is_nothrow_swappable<key_equal>::value |
| 2812 | 2812 | && (!allocator_traits<__pointer_allocator>::propagate_on_container_swap::value |
| 2813 | 2813 | || __is_nothrow_swappable<__pointer_allocator>::value) |
| ... | ... | @@ -2815,7 +2815,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::swap(__hash_table& __u) |
| 2815 | 2815 | || __is_nothrow_swappable<__node_allocator>::value) |
| 2816 | 2816 | ) |
| 2817 | 2817 | #else |
| 2818 | _NOEXCEPT_DEBUG_(__is_nothrow_swappable<hasher>::value && __is_nothrow_swappable<key_equal>::value) | |
| 2818 | _NOEXCEPT_(__is_nothrow_swappable<hasher>::value && __is_nothrow_swappable<key_equal>::value) | |
| 2819 | 2819 | #endif |
| 2820 | 2820 | { |
| 2821 | 2821 | _LIBCPP_ASSERT(__node_traits::propagate_on_container_swap::value || |
lib/libcxx/include/__libcpp_version+1-1| ... | ... | @@ -1 +1 @@ |
| 1 | 8000 | |
| 1 | 9000 |
lib/libcxx/include/__locale+55-25| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===----------------------------------------------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 | |
| ... | ... | @@ -20,6 +19,7 @@ |
| 20 | 19 | #include <cctype> |
| 21 | 20 | #include <locale.h> |
| 22 | 21 | #if defined(_LIBCPP_MSVCRT_LIKE) |
| 22 | # include <cstring> | |
| 23 | 23 | # include <support/win32/locale_win32.h> |
| 24 | 24 | #elif defined(_AIX) |
| 25 | 25 | # include <support/ibm/xlocale.h> |
| ... | ... | @@ -35,6 +35,9 @@ |
| 35 | 35 | # include <xlocale.h> |
| 36 | 36 | #elif defined(__Fuchsia__) |
| 37 | 37 | # include <support/fuchsia/xlocale.h> |
| 38 | #elif defined(__wasi__) | |
| 39 | // WASI libc uses musl's locales support. | |
| 40 | # include <support/musl/xlocale.h> | |
| 38 | 41 | #elif defined(_LIBCPP_HAS_MUSL_LIBC) |
| 39 | 42 | # include <support/musl/xlocale.h> |
| 40 | 43 | #endif |
| ... | ... | @@ -64,28 +67,41 @@ private: |
| 64 | 67 | #elif defined(_LIBCPP_MSVCRT_LIKE) |
| 65 | 68 | struct __libcpp_locale_guard { |
| 66 | 69 | __libcpp_locale_guard(locale_t __l) : |
| 67 | __status(_configthreadlocale(_ENABLE_PER_THREAD_LOCALE)), | |
| 68 | __locale_collate(setlocale(LC_COLLATE, __l.__get_locale())), | |
| 69 | __locale_ctype(setlocale(LC_CTYPE, __l.__get_locale())), | |
| 70 | __locale_monetary(setlocale(LC_MONETARY, __l.__get_locale())), | |
| 71 | __locale_numeric(setlocale(LC_NUMERIC, __l.__get_locale())), | |
| 72 | __locale_time(setlocale(LC_TIME, __l.__get_locale())) | |
| 73 | // LC_MESSAGES is not supported on Windows. | |
| 74 | {} | |
| 70 | __status(_configthreadlocale(_ENABLE_PER_THREAD_LOCALE)) { | |
| 71 | // Setting the locale can be expensive even when the locale given is | |
| 72 | // already the current locale, so do an explicit check to see if the | |
| 73 | // current locale is already the one we want. | |
| 74 | const char* __lc = __setlocale(nullptr); | |
| 75 | // If every category is the same, the locale string will simply be the | |
| 76 | // locale name, otherwise it will be a semicolon-separated string listing | |
| 77 | // each category. In the second case, we know at least one category won't | |
| 78 | // be what we want, so we only have to check the first case. | |
| 79 | if (strcmp(__l.__get_locale(), __lc) != 0) { | |
| 80 | __locale_all = _strdup(__lc); | |
| 81 | if (__locale_all == nullptr) | |
| 82 | __throw_bad_alloc(); | |
| 83 | __setlocale(__l.__get_locale()); | |
| 84 | } | |
| 85 | } | |
| 75 | 86 | ~__libcpp_locale_guard() { |
| 76 | setlocale(LC_COLLATE, __locale_collate); | |
| 77 | setlocale(LC_CTYPE, __locale_ctype); | |
| 78 | setlocale(LC_MONETARY, __locale_monetary); | |
| 79 | setlocale(LC_NUMERIC, __locale_numeric); | |
| 80 | setlocale(LC_TIME, __locale_time); | |
| 81 | _configthreadlocale(__status); | |
| 87 | // The CRT documentation doesn't explicitly say, but setlocale() does the | |
| 88 | // right thing when given a semicolon-separated list of locale settings | |
| 89 | // for the different categories in the same format as returned by | |
| 90 | // setlocale(LC_ALL, nullptr). | |
| 91 | if (__locale_all != nullptr) { | |
| 92 | __setlocale(__locale_all); | |
| 93 | free(__locale_all); | |
| 94 | } | |
| 95 | _configthreadlocale(__status); | |
| 96 | } | |
| 97 | static const char* __setlocale(const char* __locale) { | |
| 98 | const char* __new_locale = setlocale(LC_ALL, __locale); | |
| 99 | if (__new_locale == nullptr) | |
| 100 | __throw_bad_alloc(); | |
| 101 | return __new_locale; | |
| 82 | 102 | } |
| 83 | 103 | int __status; |
| 84 | char* __locale_collate; | |
| 85 | char* __locale_ctype; | |
| 86 | char* __locale_monetary; | |
| 87 | char* __locale_numeric; | |
| 88 | char* __locale_time; | |
| 104 | char* __locale_all = nullptr; | |
| 89 | 105 | }; |
| 90 | 106 | #endif |
| 91 | 107 | |
| ... | ... | @@ -255,7 +271,10 @@ public: |
| 255 | 271 | return do_compare(__lo1, __hi1, __lo2, __hi2); |
| 256 | 272 | } |
| 257 | 273 | |
| 274 | // FIXME(EricWF): The _LIBCPP_ALWAYS_INLINE is needed on Windows to work | |
| 275 | // around a dllimport bug that expects an external instantiation. | |
| 258 | 276 | _LIBCPP_INLINE_VISIBILITY |
| 277 | _LIBCPP_ALWAYS_INLINE | |
| 259 | 278 | string_type transform(const char_type* __lo, const char_type* __hi) const |
| 260 | 279 | { |
| 261 | 280 | return do_transform(__lo, __hi); |
| ... | ... | @@ -389,6 +408,11 @@ public: |
| 389 | 408 | static const mask punct = _ISpunct; |
| 390 | 409 | static const mask xdigit = _ISxdigit; |
| 391 | 410 | static const mask blank = _ISblank; |
| 411 | #if defined(__mips__) | |
| 412 | static const mask __regex_word = static_cast<char_class_type>(_ISbit(15)); | |
| 413 | #else | |
| 414 | static const mask __regex_word = 0x80; | |
| 415 | #endif | |
| 392 | 416 | #elif defined(_LIBCPP_MSVCRT_LIKE) |
| 393 | 417 | typedef unsigned short mask; |
| 394 | 418 | static const mask space = _SPACE; |
| ... | ... | @@ -401,6 +425,7 @@ public: |
| 401 | 425 | static const mask punct = _PUNCT; |
| 402 | 426 | static const mask xdigit = _HEX; |
| 403 | 427 | static const mask blank = _BLANK; |
| 428 | static const mask __regex_word = 0x80; | |
| 404 | 429 | # define _LIBCPP_CTYPE_MASK_IS_COMPOSITE_PRINT |
| 405 | 430 | #elif defined(__APPLE__) || defined(__FreeBSD__) || defined(__EMSCRIPTEN__) || defined(__NetBSD__) |
| 406 | 431 | # ifdef __APPLE__ |
| ... | ... | @@ -422,8 +447,12 @@ public: |
| 422 | 447 | |
| 423 | 448 | # if defined(__NetBSD__) |
| 424 | 449 | static const mask blank = _CTYPE_BL; |
| 450 | // NetBSD defines classes up to 0x2000 | |
| 451 | // see sys/ctype_bits.h, _CTYPE_Q | |
| 452 | static const mask __regex_word = 0x8000; | |
| 425 | 453 | # else |
| 426 | 454 | static const mask blank = _CTYPE_B; |
| 455 | static const mask __regex_word = 0x80; | |
| 427 | 456 | # endif |
| 428 | 457 | #elif defined(__sun__) || defined(_AIX) |
| 429 | 458 | typedef unsigned int mask; |
| ... | ... | @@ -437,6 +466,7 @@ public: |
| 437 | 466 | static const mask punct = _ISPUNCT; |
| 438 | 467 | static const mask xdigit = _ISXDIGIT; |
| 439 | 468 | static const mask blank = _ISBLANK; |
| 469 | static const mask __regex_word = 0x80; | |
| 440 | 470 | #elif defined(_NEWLIB_VERSION) |
| 441 | 471 | // Same type as Newlib's _ctype_ array in newlib/libc/include/ctype.h. |
| 442 | 472 | typedef char mask; |
| ... | ... | @@ -450,6 +480,7 @@ public: |
| 450 | 480 | static const mask punct = _P; |
| 451 | 481 | static const mask xdigit = _X | _N; |
| 452 | 482 | static const mask blank = _B; |
| 483 | static const mask __regex_word = 0x80; | |
| 453 | 484 | # define _LIBCPP_CTYPE_MASK_IS_COMPOSITE_PRINT |
| 454 | 485 | # define _LIBCPP_CTYPE_MASK_IS_COMPOSITE_ALPHA |
| 455 | 486 | # define _LIBCPP_CTYPE_MASK_IS_COMPOSITE_XDIGIT |
| ... | ... | @@ -465,6 +496,7 @@ public: |
| 465 | 496 | static const mask punct = 1<<7; |
| 466 | 497 | static const mask xdigit = 1<<8; |
| 467 | 498 | static const mask blank = 1<<9; |
| 499 | static const mask __regex_word = 1<<10; | |
| 468 | 500 | #endif |
| 469 | 501 | static const mask alnum = alpha | digit; |
| 470 | 502 | static const mask graph = alnum | punct; |
| ... | ... | @@ -1230,8 +1262,6 @@ _LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS codecvt_byname<w |
| 1230 | 1262 | _LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS codecvt_byname<char16_t, char, mbstate_t>) |
| 1231 | 1263 | _LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS codecvt_byname<char32_t, char, mbstate_t>) |
| 1232 | 1264 | |
| 1233 | _LIBCPP_NORETURN _LIBCPP_FUNC_VIS void __throw_runtime_error(const char*); | |
| 1234 | ||
| 1235 | 1265 | template <size_t _Np> |
| 1236 | 1266 | struct __narrow_to_utf8 |
| 1237 | 1267 | { |
lib/libcxx/include/__mutex_base+19-30| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===----------------------------------------------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 | |
| ... | ... | @@ -37,28 +36,24 @@ _LIBCPP_BEGIN_NAMESPACE_STD |
| 37 | 36 | # endif |
| 38 | 37 | #endif // _LIBCPP_THREAD_SAFETY_ANNOTATION |
| 39 | 38 | |
| 39 | ||
| 40 | 40 | class _LIBCPP_TYPE_VIS _LIBCPP_THREAD_SAFETY_ANNOTATION(capability("mutex")) mutex |
| 41 | 41 | { |
| 42 | #ifndef _LIBCPP_CXX03_LANG | |
| 43 | 42 | __libcpp_mutex_t __m_ = _LIBCPP_MUTEX_INITIALIZER; |
| 44 | #else | |
| 45 | __libcpp_mutex_t __m_; | |
| 46 | #endif | |
| 47 | 43 | |
| 48 | 44 | public: |
| 49 | 45 | _LIBCPP_INLINE_VISIBILITY |
| 50 | #ifndef _LIBCPP_CXX03_LANG | |
| 51 | constexpr mutex() = default; | |
| 46 | _LIBCPP_CONSTEXPR mutex() = default; | |
| 47 | ||
| 48 | mutex(const mutex&) = delete; | |
| 49 | mutex& operator=(const mutex&) = delete; | |
| 50 | ||
| 51 | #if defined(_LIBCPP_HAS_TRIVIAL_MUTEX_DESTRUCTION) | |
| 52 | ~mutex() = default; | |
| 52 | 53 | #else |
| 53 | mutex() _NOEXCEPT {__m_ = (__libcpp_mutex_t)_LIBCPP_MUTEX_INITIALIZER;} | |
| 54 | ~mutex() _NOEXCEPT; | |
| 54 | 55 | #endif |
| 55 | ~mutex(); | |
| 56 | 56 | |
| 57 | private: | |
| 58 | mutex(const mutex&);// = delete; | |
| 59 | mutex& operator=(const mutex&);// = delete; | |
| 60 | ||
| 61 | public: | |
| 62 | 57 | void lock() _LIBCPP_THREAD_SAFETY_ANNOTATION(acquire_capability()); |
| 63 | 58 | bool try_lock() _NOEXCEPT _LIBCPP_THREAD_SAFETY_ANNOTATION(try_acquire_capability(true)); |
| 64 | 59 | void unlock() _NOEXCEPT _LIBCPP_THREAD_SAFETY_ANNOTATION(release_capability()); |
| ... | ... | @@ -287,26 +282,20 @@ _LIBCPP_DECLARE_STRONG_ENUM_EPILOG(cv_status) |
| 287 | 282 | |
| 288 | 283 | class _LIBCPP_TYPE_VIS condition_variable |
| 289 | 284 | { |
| 290 | #ifndef _LIBCPP_CXX03_LANG | |
| 291 | 285 | __libcpp_condvar_t __cv_ = _LIBCPP_CONDVAR_INITIALIZER; |
| 292 | #else | |
| 293 | __libcpp_condvar_t __cv_; | |
| 294 | #endif | |
| 295 | ||
| 296 | 286 | public: |
| 297 | 287 | _LIBCPP_INLINE_VISIBILITY |
| 298 | #ifndef _LIBCPP_CXX03_LANG | |
| 299 | constexpr condition_variable() _NOEXCEPT = default; | |
| 288 | _LIBCPP_CONSTEXPR condition_variable() _NOEXCEPT = default; | |
| 289 | ||
| 290 | #ifdef _LIBCPP_HAS_TRIVIAL_CONDVAR_DESTRUCTION | |
| 291 | ~condition_variable() = default; | |
| 300 | 292 | #else |
| 301 | condition_variable() _NOEXCEPT {__cv_ = (__libcpp_condvar_t)_LIBCPP_CONDVAR_INITIALIZER;} | |
| 302 | #endif | |
| 303 | 293 | ~condition_variable(); |
| 294 | #endif | |
| 304 | 295 | |
| 305 | private: | |
| 306 | condition_variable(const condition_variable&); // = delete; | |
| 307 | condition_variable& operator=(const condition_variable&); // = delete; | |
| 296 | condition_variable(const condition_variable&) = delete; | |
| 297 | condition_variable& operator=(const condition_variable&) = delete; | |
| 308 | 298 | |
| 309 | public: | |
| 310 | 299 | void notify_one() _NOEXCEPT; |
| 311 | 300 | void notify_all() _NOEXCEPT; |
| 312 | 301 |
lib/libcxx/include/__node_handle+5-7| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===----------------------------------------------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 | |
| ... | ... | @@ -57,7 +56,7 @@ private: |
| 57 | 56 | optional<allocator_type> __alloc_; |
| 58 | 57 | |
| 59 | 58 | _LIBCPP_INLINE_VISIBILITY |
| 60 | void __release() | |
| 59 | void __release_ptr() | |
| 61 | 60 | { |
| 62 | 61 | __ptr_ = nullptr; |
| 63 | 62 | __alloc_ = _VSTD::nullopt; |
| ... | ... | @@ -194,8 +193,7 @@ using __map_node_handle = |
| 194 | 193 | __basic_node_handle< _NodeType, _Alloc, __map_node_handle_specifics>; |
| 195 | 194 | |
| 196 | 195 | template <class _Iterator, class _NodeType> |
| 197 | _LIBCPP_TEMPLATE_VIS | |
| 198 | struct __insert_return_type | |
| 196 | struct _LIBCPP_TEMPLATE_VIS __insert_return_type | |
| 199 | 197 | { |
| 200 | 198 | _Iterator position; |
| 201 | 199 | bool inserted; |
lib/libcxx/include/__nullptr+3-4| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===--------------------------- __nullptr --------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 |
lib/libcxx/include/__sso_allocator+3-4| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===----------------------------------------------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 |
lib/libcxx/include/__std_stream+3-4| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===----------------------------------------------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 |
lib/libcxx/include/__string+3-4| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===-------------------------- __string ----------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is distributed under the University of Illinois Open Source | |
| 7 | // License. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 |
lib/libcxx/include/__threading_support+10-9| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===----------------------------------------------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 | |
| ... | ... | @@ -23,6 +22,8 @@ |
| 23 | 22 | # include <__external_threading> |
| 24 | 23 | #elif !defined(_LIBCPP_HAS_NO_THREADS) |
| 25 | 24 | |
| 25 | typedef ::timespec __libcpp_timespec_t; | |
| 26 | ||
| 26 | 27 | #if defined(_LIBCPP_HAS_THREAD_API_PTHREAD) |
| 27 | 28 | # include <pthread.h> |
| 28 | 29 | # include <sched.h> |
| ... | ... | @@ -149,7 +150,7 @@ int __libcpp_condvar_wait(__libcpp_condvar_t* __cv, __libcpp_mutex_t* __m); |
| 149 | 150 | |
| 150 | 151 | _LIBCPP_THREAD_ABI_VISIBILITY _LIBCPP_NO_THREAD_SAFETY_ANALYSIS |
| 151 | 152 | int __libcpp_condvar_timedwait(__libcpp_condvar_t *__cv, __libcpp_mutex_t *__m, |
| 152 | timespec *__ts); | |
| 153 | __libcpp_timespec_t *__ts); | |
| 153 | 154 | |
| 154 | 155 | _LIBCPP_THREAD_ABI_VISIBILITY |
| 155 | 156 | int __libcpp_condvar_destroy(__libcpp_condvar_t* __cv); |
| ... | ... | @@ -157,7 +158,7 @@ int __libcpp_condvar_destroy(__libcpp_condvar_t* __cv); |
| 157 | 158 | // Execute once |
| 158 | 159 | _LIBCPP_THREAD_ABI_VISIBILITY |
| 159 | 160 | int __libcpp_execute_once(__libcpp_exec_once_flag *flag, |
| 160 | void (*init_routine)(void)); | |
| 161 | void (*init_routine)()); | |
| 161 | 162 | |
| 162 | 163 | // Thread id |
| 163 | 164 | _LIBCPP_THREAD_ABI_VISIBILITY |
| ... | ... | @@ -288,7 +289,7 @@ int __libcpp_condvar_wait(__libcpp_condvar_t *__cv, __libcpp_mutex_t *__m) |
| 288 | 289 | } |
| 289 | 290 | |
| 290 | 291 | int __libcpp_condvar_timedwait(__libcpp_condvar_t *__cv, __libcpp_mutex_t *__m, |
| 291 | timespec *__ts) | |
| 292 | __libcpp_timespec_t *__ts) | |
| 292 | 293 | { |
| 293 | 294 | return pthread_cond_timedwait(__cv, __m, __ts); |
| 294 | 295 | } |
| ... | ... | @@ -300,7 +301,7 @@ int __libcpp_condvar_destroy(__libcpp_condvar_t *__cv) |
| 300 | 301 | |
| 301 | 302 | // Execute once |
| 302 | 303 | int __libcpp_execute_once(__libcpp_exec_once_flag *flag, |
| 303 | void (*init_routine)(void)) { | |
| 304 | void (*init_routine)()) { | |
| 304 | 305 | return pthread_once(flag, init_routine); |
| 305 | 306 | } |
| 306 | 307 | |
| ... | ... | @@ -357,7 +358,7 @@ void __libcpp_thread_sleep_for(const chrono::nanoseconds& __ns) |
| 357 | 358 | { |
| 358 | 359 | using namespace chrono; |
| 359 | 360 | seconds __s = duration_cast<seconds>(__ns); |
| 360 | timespec __ts; | |
| 361 | __libcpp_timespec_t __ts; | |
| 361 | 362 | typedef decltype(__ts.tv_sec) ts_sec; |
| 362 | 363 | _LIBCPP_CONSTEXPR ts_sec __ts_sec_max = numeric_limits<ts_sec>::max(); |
| 363 | 364 |
lib/libcxx/include/__tree+91-127| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===----------------------------------------------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 | |
| ... | ... | @@ -27,6 +26,13 @@ _LIBCPP_PUSH_MACROS |
| 27 | 26 | |
| 28 | 27 | _LIBCPP_BEGIN_NAMESPACE_STD |
| 29 | 28 | |
| 29 | #if defined(__GNUC__) && !defined(__clang__) // gcc.gnu.org/PR37804 | |
| 30 | template <class, class, class, class> class _LIBCPP_TEMPLATE_VIS map; | |
| 31 | template <class, class, class, class> class _LIBCPP_TEMPLATE_VIS multimap; | |
| 32 | template <class, class, class> class _LIBCPP_TEMPLATE_VIS set; | |
| 33 | template <class, class, class> class _LIBCPP_TEMPLATE_VIS multiset; | |
| 34 | #endif | |
| 35 | ||
| 30 | 36 | template <class _Tp, class _Compare, class _Allocator> class __tree; |
| 31 | 37 | template <class _Tp, class _NodePtr, class _DiffType> |
| 32 | 38 | class _LIBCPP_TEMPLATE_VIS __tree_iterator; |
| ... | ... | @@ -965,7 +971,7 @@ private: |
| 965 | 971 | template<class _Tp, class _Compare> |
| 966 | 972 | #ifndef _LIBCPP_CXX03_LANG |
| 967 | 973 | _LIBCPP_DIAGNOSE_WARNING(!std::__invokable<_Compare const&, _Tp const&, _Tp const&>::value, |
| 968 | "the specified comparator type does not provide a const call operator") | |
| 974 | "the specified comparator type does not provide a viable const call operator") | |
| 969 | 975 | #endif |
| 970 | 976 | int __diagnose_non_const_comparator(); |
| 971 | 977 | |
| ... | ... | @@ -1090,8 +1096,8 @@ public: |
| 1090 | 1096 | __tree(const value_compare& __comp, const allocator_type& __a); |
| 1091 | 1097 | __tree(const __tree& __t); |
| 1092 | 1098 | __tree& operator=(const __tree& __t); |
| 1093 | template <class _InputIterator> | |
| 1094 | void __assign_unique(_InputIterator __first, _InputIterator __last); | |
| 1099 | template <class _ForwardIterator> | |
| 1100 | void __assign_unique(_ForwardIterator __first, _ForwardIterator __last); | |
| 1095 | 1101 | template <class _InputIterator> |
| 1096 | 1102 | void __assign_multi(_InputIterator __first, _InputIterator __last); |
| 1097 | 1103 | #ifndef _LIBCPP_CXX03_LANG |
| ... | ... | @@ -1326,10 +1332,7 @@ public: |
| 1326 | 1332 | #endif // !_LIBCPP_CXX03_LANG |
| 1327 | 1333 | |
| 1328 | 1334 | _LIBCPP_INLINE_VISIBILITY |
| 1329 | pair<iterator, bool> __node_insert_unique(__node_pointer __nd); | |
| 1330 | _LIBCPP_INLINE_VISIBILITY | |
| 1331 | iterator __node_insert_unique(const_iterator __p, | |
| 1332 | __node_pointer __nd); | |
| 1335 | pair<iterator, bool> __node_assign_unique(const __container_value_type& __v, __node_pointer __dest); | |
| 1333 | 1336 | |
| 1334 | 1337 | _LIBCPP_INLINE_VISIBILITY |
| 1335 | 1338 | iterator __node_insert_multi(__node_pointer __nd); |
| ... | ... | @@ -1509,8 +1512,50 @@ private: |
| 1509 | 1512 | _LIBCPP_INLINE_VISIBILITY |
| 1510 | 1513 | void __move_assign_alloc(__tree&, false_type) _NOEXCEPT {} |
| 1511 | 1514 | |
| 1512 | __node_pointer __detach(); | |
| 1513 | static __node_pointer __detach(__node_pointer); | |
| 1515 | struct _DetachedTreeCache { | |
| 1516 | _LIBCPP_INLINE_VISIBILITY | |
| 1517 | explicit _DetachedTreeCache(__tree *__t) _NOEXCEPT : __t_(__t), | |
| 1518 | __cache_root_(__detach_from_tree(__t)) { | |
| 1519 | __advance(); | |
| 1520 | } | |
| 1521 | ||
| 1522 | _LIBCPP_INLINE_VISIBILITY | |
| 1523 | __node_pointer __get() const _NOEXCEPT { | |
| 1524 | return __cache_elem_; | |
| 1525 | } | |
| 1526 | ||
| 1527 | _LIBCPP_INLINE_VISIBILITY | |
| 1528 | void __advance() _NOEXCEPT { | |
| 1529 | __cache_elem_ = __cache_root_; | |
| 1530 | if (__cache_root_) { | |
| 1531 | __cache_root_ = __detach_next(__cache_root_); | |
| 1532 | } | |
| 1533 | } | |
| 1534 | ||
| 1535 | _LIBCPP_INLINE_VISIBILITY | |
| 1536 | ~_DetachedTreeCache() { | |
| 1537 | __t_->destroy(__cache_elem_); | |
| 1538 | if (__cache_root_) { | |
| 1539 | while (__cache_root_->__parent_ != nullptr) | |
| 1540 | __cache_root_ = static_cast<__node_pointer>(__cache_root_->__parent_); | |
| 1541 | __t_->destroy(__cache_root_); | |
| 1542 | } | |
| 1543 | } | |
| 1544 | ||
| 1545 | _DetachedTreeCache(_DetachedTreeCache const&) = delete; | |
| 1546 | _DetachedTreeCache& operator=(_DetachedTreeCache const&) = delete; | |
| 1547 | ||
| 1548 | private: | |
| 1549 | _LIBCPP_INLINE_VISIBILITY | |
| 1550 | static __node_pointer __detach_from_tree(__tree *__t) _NOEXCEPT; | |
| 1551 | _LIBCPP_INLINE_VISIBILITY | |
| 1552 | static __node_pointer __detach_next(__node_pointer) _NOEXCEPT; | |
| 1553 | ||
| 1554 | __tree *__t_; | |
| 1555 | __node_pointer __cache_root_; | |
| 1556 | __node_pointer __cache_elem_; | |
| 1557 | }; | |
| 1558 | ||
| 1514 | 1559 | |
| 1515 | 1560 | template <class, class, class, class> friend class _LIBCPP_TEMPLATE_VIS map; |
| 1516 | 1561 | template <class, class, class, class> friend class _LIBCPP_TEMPLATE_VIS multimap; |
| ... | ... | @@ -1548,13 +1593,13 @@ __tree<_Tp, _Compare, _Allocator>::__tree(const value_compare& __comp, |
| 1548 | 1593 | // Precondition: size() != 0 |
| 1549 | 1594 | template <class _Tp, class _Compare, class _Allocator> |
| 1550 | 1595 | typename __tree<_Tp, _Compare, _Allocator>::__node_pointer |
| 1551 | __tree<_Tp, _Compare, _Allocator>::__detach() | |
| 1596 | __tree<_Tp, _Compare, _Allocator>::_DetachedTreeCache::__detach_from_tree(__tree *__t) _NOEXCEPT | |
| 1552 | 1597 | { |
| 1553 | __node_pointer __cache = static_cast<__node_pointer>(__begin_node()); | |
| 1554 | __begin_node() = __end_node(); | |
| 1555 | __end_node()->__left_->__parent_ = nullptr; | |
| 1556 | __end_node()->__left_ = nullptr; | |
| 1557 | size() = 0; | |
| 1598 | __node_pointer __cache = static_cast<__node_pointer>(__t->__begin_node()); | |
| 1599 | __t->__begin_node() = __t->__end_node(); | |
| 1600 | __t->__end_node()->__left_->__parent_ = nullptr; | |
| 1601 | __t->__end_node()->__left_ = nullptr; | |
| 1602 | __t->size() = 0; | |
| 1558 | 1603 | // __cache->__left_ == nullptr |
| 1559 | 1604 | if (__cache->__right_ != nullptr) |
| 1560 | 1605 | __cache = static_cast<__node_pointer>(__cache->__right_); |
| ... | ... | @@ -1569,7 +1614,7 @@ __tree<_Tp, _Compare, _Allocator>::__detach() |
| 1569 | 1614 | // This is no longer a red-black tree |
| 1570 | 1615 | template <class _Tp, class _Compare, class _Allocator> |
| 1571 | 1616 | typename __tree<_Tp, _Compare, _Allocator>::__node_pointer |
| 1572 | __tree<_Tp, _Compare, _Allocator>::__detach(__node_pointer __cache) | |
| 1617 | __tree<_Tp, _Compare, _Allocator>::_DetachedTreeCache::__detach_next(__node_pointer __cache) _NOEXCEPT | |
| 1573 | 1618 | { |
| 1574 | 1619 | if (__cache->__parent_ == nullptr) |
| 1575 | 1620 | return nullptr; |
| ... | ... | @@ -1603,45 +1648,23 @@ __tree<_Tp, _Compare, _Allocator>::operator=(const __tree& __t) |
| 1603 | 1648 | } |
| 1604 | 1649 | |
| 1605 | 1650 | template <class _Tp, class _Compare, class _Allocator> |
| 1606 | template <class _InputIterator> | |
| 1651 | template <class _ForwardIterator> | |
| 1607 | 1652 | void |
| 1608 | __tree<_Tp, _Compare, _Allocator>::__assign_unique(_InputIterator __first, _InputIterator __last) | |
| 1653 | __tree<_Tp, _Compare, _Allocator>::__assign_unique(_ForwardIterator __first, _ForwardIterator __last) | |
| 1609 | 1654 | { |
| 1610 | typedef iterator_traits<_InputIterator> _ITraits; | |
| 1655 | typedef iterator_traits<_ForwardIterator> _ITraits; | |
| 1611 | 1656 | typedef typename _ITraits::value_type _ItValueType; |
| 1612 | 1657 | static_assert((is_same<_ItValueType, __container_value_type>::value), |
| 1613 | 1658 | "__assign_unique may only be called with the containers value type"); |
| 1614 | ||
| 1659 | static_assert(__is_forward_iterator<_ForwardIterator>::value, | |
| 1660 | "__assign_unique requires a forward iterator"); | |
| 1615 | 1661 | if (size() != 0) |
| 1616 | 1662 | { |
| 1617 | __node_pointer __cache = __detach(); | |
| 1618 | #ifndef _LIBCPP_NO_EXCEPTIONS | |
| 1619 | try | |
| 1620 | { | |
| 1621 | #endif // _LIBCPP_NO_EXCEPTIONS | |
| 1622 | for (; __cache != nullptr && __first != __last; ++__first) | |
| 1623 | { | |
| 1624 | __cache->__value_ = *__first; | |
| 1625 | __node_pointer __next = __detach(__cache); | |
| 1626 | __node_insert_unique(__cache); | |
| 1627 | __cache = __next; | |
| 1663 | _DetachedTreeCache __cache(this); | |
| 1664 | for (; __cache.__get() != nullptr && __first != __last; ++__first) { | |
| 1665 | if (__node_assign_unique(*__first, __cache.__get()).second) | |
| 1666 | __cache.__advance(); | |
| 1628 | 1667 | } |
| 1629 | #ifndef _LIBCPP_NO_EXCEPTIONS | |
| 1630 | } | |
| 1631 | catch (...) | |
| 1632 | { | |
| 1633 | while (__cache->__parent_ != nullptr) | |
| 1634 | __cache = static_cast<__node_pointer>(__cache->__parent_); | |
| 1635 | destroy(__cache); | |
| 1636 | throw; | |
| 1637 | } | |
| 1638 | #endif // _LIBCPP_NO_EXCEPTIONS | |
| 1639 | if (__cache != nullptr) | |
| 1640 | { | |
| 1641 | while (__cache->__parent_ != nullptr) | |
| 1642 | __cache = static_cast<__node_pointer>(__cache->__parent_); | |
| 1643 | destroy(__cache); | |
| 1644 | } | |
| 1645 | 1668 | } |
| 1646 | 1669 | for (; __first != __last; ++__first) |
| 1647 | 1670 | __insert_unique(*__first); |
| ... | ... | @@ -1660,33 +1683,11 @@ __tree<_Tp, _Compare, _Allocator>::__assign_multi(_InputIterator __first, _Input |
| 1660 | 1683 | " or the nodes value type"); |
| 1661 | 1684 | if (size() != 0) |
| 1662 | 1685 | { |
| 1663 | __node_pointer __cache = __detach(); | |
| 1664 | #ifndef _LIBCPP_NO_EXCEPTIONS | |
| 1665 | try | |
| 1666 | { | |
| 1667 | #endif // _LIBCPP_NO_EXCEPTIONS | |
| 1668 | for (; __cache != nullptr && __first != __last; ++__first) | |
| 1669 | { | |
| 1670 | __cache->__value_ = *__first; | |
| 1671 | __node_pointer __next = __detach(__cache); | |
| 1672 | __node_insert_multi(__cache); | |
| 1673 | __cache = __next; | |
| 1674 | } | |
| 1675 | #ifndef _LIBCPP_NO_EXCEPTIONS | |
| 1676 | } | |
| 1677 | catch (...) | |
| 1678 | { | |
| 1679 | while (__cache->__parent_ != nullptr) | |
| 1680 | __cache = static_cast<__node_pointer>(__cache->__parent_); | |
| 1681 | destroy(__cache); | |
| 1682 | throw; | |
| 1683 | } | |
| 1684 | #endif // _LIBCPP_NO_EXCEPTIONS | |
| 1685 | if (__cache != nullptr) | |
| 1686 | { | |
| 1687 | while (__cache->__parent_ != nullptr) | |
| 1688 | __cache = static_cast<__node_pointer>(__cache->__parent_); | |
| 1689 | destroy(__cache); | |
| 1686 | _DetachedTreeCache __cache(this); | |
| 1687 | for (; __cache.__get() && __first != __last; ++__first) { | |
| 1688 | __cache.__get()->__value_ = *__first; | |
| 1689 | __node_insert_multi(__cache.__get()); | |
| 1690 | __cache.__advance(); | |
| 1690 | 1691 | } |
| 1691 | 1692 | } |
| 1692 | 1693 | for (; __first != __last; ++__first) |
| ... | ... | @@ -1784,33 +1785,11 @@ __tree<_Tp, _Compare, _Allocator>::__move_assign(__tree& __t, false_type) |
| 1784 | 1785 | const_iterator __e = end(); |
| 1785 | 1786 | if (size() != 0) |
| 1786 | 1787 | { |
| 1787 | __node_pointer __cache = __detach(); | |
| 1788 | #ifndef _LIBCPP_NO_EXCEPTIONS | |
| 1789 | try | |
| 1790 | { | |
| 1791 | #endif // _LIBCPP_NO_EXCEPTIONS | |
| 1792 | while (__cache != nullptr && __t.size() != 0) | |
| 1793 | { | |
| 1794 | __cache->__value_ = _VSTD::move(__t.remove(__t.begin())->__value_); | |
| 1795 | __node_pointer __next = __detach(__cache); | |
| 1796 | __node_insert_multi(__cache); | |
| 1797 | __cache = __next; | |
| 1798 | } | |
| 1799 | #ifndef _LIBCPP_NO_EXCEPTIONS | |
| 1800 | } | |
| 1801 | catch (...) | |
| 1802 | { | |
| 1803 | while (__cache->__parent_ != nullptr) | |
| 1804 | __cache = static_cast<__node_pointer>(__cache->__parent_); | |
| 1805 | destroy(__cache); | |
| 1806 | throw; | |
| 1807 | } | |
| 1808 | #endif // _LIBCPP_NO_EXCEPTIONS | |
| 1809 | if (__cache != nullptr) | |
| 1810 | { | |
| 1811 | while (__cache->__parent_ != nullptr) | |
| 1812 | __cache = static_cast<__node_pointer>(__cache->__parent_); | |
| 1813 | destroy(__cache); | |
| 1788 | _DetachedTreeCache __cache(this); | |
| 1789 | while (__cache.__get() != nullptr && __t.size() != 0) { | |
| 1790 | __cache.__get()->__value_ = _VSTD::move(__t.remove(__t.begin())->__value_); | |
| 1791 | __node_insert_multi(__cache.__get()); | |
| 1792 | __cache.__advance(); | |
| 1814 | 1793 | } |
| 1815 | 1794 | } |
| 1816 | 1795 | while (__t.size() != 0) |
| ... | ... | @@ -2319,14 +2298,15 @@ __tree<_Tp, _Compare, _Allocator>::__insert_multi(const_iterator __p, const __co |
| 2319 | 2298 | |
| 2320 | 2299 | template <class _Tp, class _Compare, class _Allocator> |
| 2321 | 2300 | pair<typename __tree<_Tp, _Compare, _Allocator>::iterator, bool> |
| 2322 | __tree<_Tp, _Compare, _Allocator>::__node_insert_unique(__node_pointer __nd) | |
| 2301 | __tree<_Tp, _Compare, _Allocator>::__node_assign_unique(const __container_value_type& __v, __node_pointer __nd) | |
| 2323 | 2302 | { |
| 2324 | 2303 | __parent_pointer __parent; |
| 2325 | __node_base_pointer& __child = __find_equal(__parent, __nd->__value_); | |
| 2304 | __node_base_pointer& __child = __find_equal(__parent, _NodeTypes::__get_key(__v)); | |
| 2326 | 2305 | __node_pointer __r = static_cast<__node_pointer>(__child); |
| 2327 | 2306 | bool __inserted = false; |
| 2328 | 2307 | if (__child == nullptr) |
| 2329 | 2308 | { |
| 2309 | __nd->__value_ = __v; | |
| 2330 | 2310 | __insert_node_at(__parent, __child, static_cast<__node_base_pointer>(__nd)); |
| 2331 | 2311 | __r = __nd; |
| 2332 | 2312 | __inserted = true; |
| ... | ... | @@ -2334,22 +2314,6 @@ __tree<_Tp, _Compare, _Allocator>::__node_insert_unique(__node_pointer __nd) |
| 2334 | 2314 | return pair<iterator, bool>(iterator(__r), __inserted); |
| 2335 | 2315 | } |
| 2336 | 2316 | |
| 2337 | template <class _Tp, class _Compare, class _Allocator> | |
| 2338 | typename __tree<_Tp, _Compare, _Allocator>::iterator | |
| 2339 | __tree<_Tp, _Compare, _Allocator>::__node_insert_unique(const_iterator __p, | |
| 2340 | __node_pointer __nd) | |
| 2341 | { | |
| 2342 | __parent_pointer __parent; | |
| 2343 | __node_base_pointer __dummy; | |
| 2344 | __node_base_pointer& __child = __find_equal(__p, __parent, __nd->__value_); | |
| 2345 | __node_pointer __r = static_cast<__node_pointer>(__child); | |
| 2346 | if (__child == nullptr) | |
| 2347 | { | |
| 2348 | __insert_node_at(__parent, __child, static_cast<__node_base_pointer>(__nd)); | |
| 2349 | __r = __nd; | |
| 2350 | } | |
| 2351 | return iterator(__r); | |
| 2352 | } | |
| 2353 | 2317 | |
| 2354 | 2318 | template <class _Tp, class _Compare, class _Allocator> |
| 2355 | 2319 | typename __tree<_Tp, _Compare, _Allocator>::iterator |
| ... | ... | @@ -2408,7 +2372,7 @@ __tree<_Tp, _Compare, _Allocator>::__node_handle_insert_unique( |
| 2408 | 2372 | |
| 2409 | 2373 | __insert_node_at(__parent, __child, |
| 2410 | 2374 | static_cast<__node_base_pointer>(__ptr)); |
| 2411 | __nh.__release(); | |
| 2375 | __nh.__release_ptr(); | |
| 2412 | 2376 | return _InsertReturnType{iterator(__ptr), true, _NodeHandle()}; |
| 2413 | 2377 | } |
| 2414 | 2378 | |
| ... | ... | @@ -2433,7 +2397,7 @@ __tree<_Tp, _Compare, _Allocator>::__node_handle_insert_unique( |
| 2433 | 2397 | __insert_node_at(__parent, __child, |
| 2434 | 2398 | static_cast<__node_base_pointer>(__ptr)); |
| 2435 | 2399 | __r = __ptr; |
| 2436 | __nh.__release(); | |
| 2400 | __nh.__release_ptr(); | |
| 2437 | 2401 | } |
| 2438 | 2402 | return iterator(__r); |
| 2439 | 2403 | } |
| ... | ... | @@ -2498,7 +2462,7 @@ __tree<_Tp, _Compare, _Allocator>::__node_handle_insert_multi(_NodeHandle&& __nh |
| 2498 | 2462 | __node_base_pointer& __child = __find_leaf_high( |
| 2499 | 2463 | __parent, _NodeTypes::__get_key(__ptr->__value_)); |
| 2500 | 2464 | __insert_node_at(__parent, __child, static_cast<__node_base_pointer>(__ptr)); |
| 2501 | __nh.__release(); | |
| 2465 | __nh.__release_ptr(); | |
| 2502 | 2466 | return iterator(__ptr); |
| 2503 | 2467 | } |
| 2504 | 2468 | |
| ... | ... | @@ -2517,7 +2481,7 @@ __tree<_Tp, _Compare, _Allocator>::__node_handle_insert_multi( |
| 2517 | 2481 | __node_base_pointer& __child = __find_leaf(__hint, __parent, |
| 2518 | 2482 | _NodeTypes::__get_key(__ptr->__value_)); |
| 2519 | 2483 | __insert_node_at(__parent, __child, static_cast<__node_base_pointer>(__ptr)); |
| 2520 | __nh.__release(); | |
| 2484 | __nh.__release_ptr(); | |
| 2521 | 2485 | return iterator(__ptr); |
| 2522 | 2486 | } |
| 2523 | 2487 |
lib/libcxx/include/__tuple+31-37| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===----------------------------------------------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 | |
| ... | ... | @@ -54,27 +53,24 @@ template <class _Tp> struct _LIBCPP_TEMPLATE_VIS tuple_size<volatile _Tp> : publ |
| 54 | 53 | template <class _Tp> struct _LIBCPP_TEMPLATE_VIS tuple_size<const volatile _Tp> : public tuple_size<_Tp> {}; |
| 55 | 54 | #endif |
| 56 | 55 | |
| 57 | template <size_t _Ip, class _Tp> class _LIBCPP_TEMPLATE_VIS tuple_element; | |
| 56 | template <size_t _Ip, class _Tp> struct _LIBCPP_TEMPLATE_VIS tuple_element; | |
| 58 | 57 | |
| 59 | 58 | template <size_t _Ip, class _Tp> |
| 60 | class _LIBCPP_TEMPLATE_VIS tuple_element<_Ip, const _Tp> | |
| 59 | struct _LIBCPP_TEMPLATE_VIS tuple_element<_Ip, const _Tp> | |
| 61 | 60 | { |
| 62 | public: | |
| 63 | typedef typename add_const<typename tuple_element<_Ip, _Tp>::type>::type type; | |
| 61 | typedef _LIBCPP_NODEBUG_TYPE typename add_const<typename tuple_element<_Ip, _Tp>::type>::type type; | |
| 64 | 62 | }; |
| 65 | 63 | |
| 66 | 64 | template <size_t _Ip, class _Tp> |
| 67 | class _LIBCPP_TEMPLATE_VIS tuple_element<_Ip, volatile _Tp> | |
| 65 | struct _LIBCPP_TEMPLATE_VIS tuple_element<_Ip, volatile _Tp> | |
| 68 | 66 | { |
| 69 | public: | |
| 70 | typedef typename add_volatile<typename tuple_element<_Ip, _Tp>::type>::type type; | |
| 67 | typedef _LIBCPP_NODEBUG_TYPE typename add_volatile<typename tuple_element<_Ip, _Tp>::type>::type type; | |
| 71 | 68 | }; |
| 72 | 69 | |
| 73 | 70 | template <size_t _Ip, class _Tp> |
| 74 | class _LIBCPP_TEMPLATE_VIS tuple_element<_Ip, const volatile _Tp> | |
| 71 | struct _LIBCPP_TEMPLATE_VIS tuple_element<_Ip, const volatile _Tp> | |
| 75 | 72 | { |
| 76 | public: | |
| 77 | typedef typename add_cv<typename tuple_element<_Ip, _Tp>::type>::type type; | |
| 73 | typedef _LIBCPP_NODEBUG_TYPE typename add_cv<typename tuple_element<_Ip, _Tp>::type>::type type; | |
| 78 | 74 | }; |
| 79 | 75 | |
| 80 | 76 | template <class _Tp> struct __tuple_like : false_type {}; |
| ... | ... | @@ -103,7 +99,7 @@ namespace __detail { |
| 103 | 99 | |
| 104 | 100 | template<typename _Tp, size_t ..._Extra> struct __repeat; |
| 105 | 101 | template<typename _Tp, _Tp ..._Np, size_t ..._Extra> struct __repeat<__integer_sequence<_Tp, _Np...>, _Extra...> { |
| 106 | typedef __integer_sequence<_Tp, | |
| 102 | typedef _LIBCPP_NODEBUG_TYPE __integer_sequence<_Tp, | |
| 107 | 103 | _Np..., |
| 108 | 104 | sizeof...(_Np) + _Np..., |
| 109 | 105 | 2 * sizeof...(_Np) + _Np..., |
| ... | ... | @@ -257,7 +253,7 @@ template <class ..._Tp> struct __tuple_types {}; |
| 257 | 253 | namespace __indexer_detail { |
| 258 | 254 | |
| 259 | 255 | template <size_t _Idx, class _Tp> |
| 260 | struct __indexed { using type = _Tp; }; | |
| 256 | struct __indexed { using type _LIBCPP_NODEBUG_TYPE = _Tp; }; | |
| 261 | 257 | |
| 262 | 258 | template <class _Types, class _Indexes> struct __indexer; |
| 263 | 259 | |
| ... | ... | @@ -272,7 +268,7 @@ __indexed<_Idx, _Tp> __at_index(__indexed<_Idx, _Tp> const&); |
| 272 | 268 | } // namespace __indexer_detail |
| 273 | 269 | |
| 274 | 270 | template <size_t _Idx, class ..._Types> |
| 275 | using __type_pack_element = typename decltype( | |
| 271 | using __type_pack_element _LIBCPP_NODEBUG_TYPE = typename decltype( | |
| 276 | 272 | __indexer_detail::__at_index<_Idx>( |
| 277 | 273 | __indexer_detail::__indexer< |
| 278 | 274 | __tuple_types<_Types...>, |
| ... | ... | @@ -282,11 +278,10 @@ using __type_pack_element = typename decltype( |
| 282 | 278 | #endif |
| 283 | 279 | |
| 284 | 280 | template <size_t _Ip, class ..._Types> |
| 285 | class _LIBCPP_TEMPLATE_VIS tuple_element<_Ip, __tuple_types<_Types...>> | |
| 281 | struct _LIBCPP_TEMPLATE_VIS tuple_element<_Ip, __tuple_types<_Types...>> | |
| 286 | 282 | { |
| 287 | public: | |
| 288 | 283 | static_assert(_Ip < sizeof...(_Types), "tuple_element index out of range"); |
| 289 | typedef __type_pack_element<_Ip, _Types...> type; | |
| 284 | typedef _LIBCPP_NODEBUG_TYPE __type_pack_element<_Ip, _Types...> type; | |
| 290 | 285 | }; |
| 291 | 286 | |
| 292 | 287 | |
| ... | ... | @@ -306,34 +301,34 @@ struct __apply_cv_mf<false, false, false> { |
| 306 | 301 | }; |
| 307 | 302 | template <> |
| 308 | 303 | struct __apply_cv_mf<false, true, false> { |
| 309 | template <class _Tp> using __apply = const _Tp; | |
| 304 | template <class _Tp> using __apply _LIBCPP_NODEBUG_TYPE = const _Tp; | |
| 310 | 305 | }; |
| 311 | 306 | template <> |
| 312 | 307 | struct __apply_cv_mf<false, false, true> { |
| 313 | template <class _Tp> using __apply = volatile _Tp; | |
| 308 | template <class _Tp> using __apply _LIBCPP_NODEBUG_TYPE = volatile _Tp; | |
| 314 | 309 | }; |
| 315 | 310 | template <> |
| 316 | 311 | struct __apply_cv_mf<false, true, true> { |
| 317 | template <class _Tp> using __apply = const volatile _Tp; | |
| 312 | template <class _Tp> using __apply _LIBCPP_NODEBUG_TYPE = const volatile _Tp; | |
| 318 | 313 | }; |
| 319 | 314 | template <> |
| 320 | 315 | struct __apply_cv_mf<true, false, false> { |
| 321 | template <class _Tp> using __apply = _Tp&; | |
| 316 | template <class _Tp> using __apply _LIBCPP_NODEBUG_TYPE = _Tp&; | |
| 322 | 317 | }; |
| 323 | 318 | template <> |
| 324 | 319 | struct __apply_cv_mf<true, true, false> { |
| 325 | template <class _Tp> using __apply = const _Tp&; | |
| 320 | template <class _Tp> using __apply _LIBCPP_NODEBUG_TYPE = const _Tp&; | |
| 326 | 321 | }; |
| 327 | 322 | template <> |
| 328 | 323 | struct __apply_cv_mf<true, false, true> { |
| 329 | template <class _Tp> using __apply = volatile _Tp&; | |
| 324 | template <class _Tp> using __apply _LIBCPP_NODEBUG_TYPE = volatile _Tp&; | |
| 330 | 325 | }; |
| 331 | 326 | template <> |
| 332 | 327 | struct __apply_cv_mf<true, true, true> { |
| 333 | template <class _Tp> using __apply = const volatile _Tp&; | |
| 328 | template <class _Tp> using __apply _LIBCPP_NODEBUG_TYPE = const volatile _Tp&; | |
| 334 | 329 | }; |
| 335 | 330 | template <class _Tp, class _RawTp = typename remove_reference<_Tp>::type> |
| 336 | using __apply_cv_t = __apply_cv_mf< | |
| 331 | using __apply_cv_t _LIBCPP_NODEBUG_TYPE = __apply_cv_mf< | |
| 337 | 332 | is_lvalue_reference<_Tp>::value, |
| 338 | 333 | is_const<_RawTp>::value, |
| 339 | 334 | is_volatile<_RawTp>::value>; |
| ... | ... | @@ -352,7 +347,7 @@ template <template <class...> class _Tuple, class ..._Types, size_t ..._Idx> |
| 352 | 347 | struct __make_tuple_types_flat<_Tuple<_Types...>, __tuple_indices<_Idx...>> { |
| 353 | 348 | // Specialization for pair, tuple, and __tuple_types |
| 354 | 349 | template <class _Tp, class _ApplyFn = __apply_cv_t<_Tp>> |
| 355 | using __apply_quals = __tuple_types< | |
| 350 | using __apply_quals _LIBCPP_NODEBUG_TYPE = __tuple_types< | |
| 356 | 351 | typename _ApplyFn::template __apply<__type_pack_element<_Idx, _Types...>>... |
| 357 | 352 | >; |
| 358 | 353 | }; |
| ... | ... | @@ -380,19 +375,19 @@ struct __make_tuple_types |
| 380 | 375 | |
| 381 | 376 | template <class ..._Types, size_t _Ep> |
| 382 | 377 | struct __make_tuple_types<tuple<_Types...>, _Ep, 0, true> { |
| 383 | typedef __tuple_types<_Types...> type; | |
| 378 | typedef _LIBCPP_NODEBUG_TYPE __tuple_types<_Types...> type; | |
| 384 | 379 | }; |
| 385 | 380 | |
| 386 | 381 | template <class ..._Types, size_t _Ep> |
| 387 | 382 | struct __make_tuple_types<__tuple_types<_Types...>, _Ep, 0, true> { |
| 388 | typedef __tuple_types<_Types...> type; | |
| 383 | typedef _LIBCPP_NODEBUG_TYPE __tuple_types<_Types...> type; | |
| 389 | 384 | }; |
| 390 | 385 | |
| 391 | 386 | template <bool ..._Preds> |
| 392 | 387 | struct __all_dummy; |
| 393 | 388 | |
| 394 | 389 | template <bool ..._Pred> |
| 395 | using __all = is_same<__all_dummy<_Pred...>, __all_dummy<((void)_Pred, true)...>>; | |
| 390 | using __all = _IsSame<__all_dummy<_Pred...>, __all_dummy<((void)_Pred, true)...>>; | |
| 396 | 391 | |
| 397 | 392 | struct __tuple_sfinae_base { |
| 398 | 393 | template <template <class, class...> class _Trait, |
| ... | ... | @@ -457,15 +452,14 @@ struct __tuple_assignable<_Tp, _Up, true, true> |
| 457 | 452 | |
| 458 | 453 | |
| 459 | 454 | template <size_t _Ip, class ..._Tp> |
| 460 | class _LIBCPP_TEMPLATE_VIS tuple_element<_Ip, tuple<_Tp...> > | |
| 455 | struct _LIBCPP_TEMPLATE_VIS tuple_element<_Ip, tuple<_Tp...> > | |
| 461 | 456 | { |
| 462 | public: | |
| 463 | typedef typename tuple_element<_Ip, __tuple_types<_Tp...> >::type type; | |
| 457 | typedef _LIBCPP_NODEBUG_TYPE typename tuple_element<_Ip, __tuple_types<_Tp...> >::type type; | |
| 464 | 458 | }; |
| 465 | 459 | |
| 466 | 460 | #if _LIBCPP_STD_VER > 11 |
| 467 | 461 | template <size_t _Ip, class ..._Tp> |
| 468 | using tuple_element_t = typename tuple_element <_Ip, _Tp...>::type; | |
| 462 | using tuple_element_t _LIBCPP_NODEBUG_TYPE = typename tuple_element <_Ip, _Tp...>::type; | |
| 469 | 463 | #endif |
| 470 | 464 | |
| 471 | 465 | template <bool _IsTuple, class _SizeTrait, size_t _Expected> |
| ... | ... | @@ -477,7 +471,7 @@ struct __tuple_like_with_size_imp<true, _SizeTrait, _Expected> |
| 477 | 471 | |
| 478 | 472 | template <class _Tuple, size_t _ExpectedSize, |
| 479 | 473 | class _RawTuple = typename __uncvref<_Tuple>::type> |
| 480 | using __tuple_like_with_size = __tuple_like_with_size_imp< | |
| 474 | using __tuple_like_with_size _LIBCPP_NODEBUG_TYPE = __tuple_like_with_size_imp< | |
| 481 | 475 | __tuple_like<_RawTuple>::value, |
| 482 | 476 | tuple_size<_RawTuple>, _ExpectedSize |
| 483 | 477 | >; |
lib/libcxx/include/__undef_macros+3-4| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===------------------------ __undef_macros ------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is distributed under the University of Illinois Open Source | |
| 7 | // License. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 |
lib/libcxx/include/algorithm+215-244| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===-------------------------- algorithm ---------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 | |
| ... | ... | @@ -781,11 +780,23 @@ __half_positive(_Tp __value) |
| 781 | 780 | template <class _Compare> |
| 782 | 781 | struct __debug_less |
| 783 | 782 | { |
| 784 | _Compare __comp_; | |
| 783 | _Compare &__comp_; | |
| 784 | _LIBCPP_CONSTEXPR_AFTER_CXX17 | |
| 785 | 785 | __debug_less(_Compare& __c) : __comp_(__c) {} |
| 786 | 786 | |
| 787 | 787 | template <class _Tp, class _Up> |
| 788 | bool operator()(const _Tp& __x, const _Up& __y) | |
| 788 | _LIBCPP_CONSTEXPR_AFTER_CXX17 | |
| 789 | bool operator()(const _Tp& __x, const _Up& __y) | |
| 790 | { | |
| 791 | bool __r = __comp_(__x, __y); | |
| 792 | if (__r) | |
| 793 | __do_compare_assert(0, __y, __x); | |
| 794 | return __r; | |
| 795 | } | |
| 796 | ||
| 797 | template <class _Tp, class _Up> | |
| 798 | _LIBCPP_CONSTEXPR_AFTER_CXX17 | |
| 799 | bool operator()(_Tp& __x, _Up& __y) | |
| 789 | 800 | { |
| 790 | 801 | bool __r = __comp_(__x, __y); |
| 791 | 802 | if (__r) |
| ... | ... | @@ -794,25 +805,39 @@ struct __debug_less |
| 794 | 805 | } |
| 795 | 806 | |
| 796 | 807 | template <class _LHS, class _RHS> |
| 808 | _LIBCPP_CONSTEXPR_AFTER_CXX17 | |
| 797 | 809 | inline _LIBCPP_INLINE_VISIBILITY |
| 798 | 810 | decltype((void)_VSTD::declval<_Compare&>()( |
| 799 | _VSTD::declval<_LHS const&>(), _VSTD::declval<_RHS const&>())) | |
| 800 | __do_compare_assert(int, _LHS const& __l, _RHS const& __r) { | |
| 811 | _VSTD::declval<_LHS &>(), _VSTD::declval<_RHS &>())) | |
| 812 | __do_compare_assert(int, _LHS & __l, _RHS & __r) { | |
| 801 | 813 | _LIBCPP_ASSERT(!__comp_(__l, __r), |
| 802 | 814 | "Comparator does not induce a strict weak ordering"); |
| 803 | 815 | } |
| 804 | 816 | |
| 805 | 817 | template <class _LHS, class _RHS> |
| 818 | _LIBCPP_CONSTEXPR_AFTER_CXX17 | |
| 806 | 819 | inline _LIBCPP_INLINE_VISIBILITY |
| 807 | void __do_compare_assert(long, _LHS const&, _RHS const&) {} | |
| 820 | void __do_compare_assert(long, _LHS &, _RHS &) {} | |
| 808 | 821 | }; |
| 809 | 822 | |
| 810 | #endif // _LIBCPP_DEBUG | |
| 823 | #endif // _LIBCPP_DEBUG | |
| 824 | ||
| 825 | template <class _Comp> | |
| 826 | struct __comp_ref_type { | |
| 827 | // Pass the comparator by lvalue reference. Or in debug mode, using a | |
| 828 | // debugging wrapper that stores a reference. | |
| 829 | #ifndef _LIBCPP_DEBUG | |
| 830 | typedef typename add_lvalue_reference<_Comp>::type type; | |
| 831 | #else | |
| 832 | typedef __debug_less<_Comp> type; | |
| 833 | #endif | |
| 834 | }; | |
| 811 | 835 | |
| 812 | 836 | // all_of |
| 813 | 837 | |
| 814 | 838 | template <class _InputIterator, class _Predicate> |
| 815 | inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 | |
| 839 | _LIBCPP_NODISCARD_EXT inline | |
| 840 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 | |
| 816 | 841 | bool |
| 817 | 842 | all_of(_InputIterator __first, _InputIterator __last, _Predicate __pred) |
| 818 | 843 | { |
| ... | ... | @@ -825,7 +850,8 @@ all_of(_InputIterator __first, _InputIterator __last, _Predicate __pred) |
| 825 | 850 | // any_of |
| 826 | 851 | |
| 827 | 852 | template <class _InputIterator, class _Predicate> |
| 828 | inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 | |
| 853 | _LIBCPP_NODISCARD_EXT inline | |
| 854 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 | |
| 829 | 855 | bool |
| 830 | 856 | any_of(_InputIterator __first, _InputIterator __last, _Predicate __pred) |
| 831 | 857 | { |
| ... | ... | @@ -838,7 +864,8 @@ any_of(_InputIterator __first, _InputIterator __last, _Predicate __pred) |
| 838 | 864 | // none_of |
| 839 | 865 | |
| 840 | 866 | template <class _InputIterator, class _Predicate> |
| 841 | inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 | |
| 867 | _LIBCPP_NODISCARD_EXT inline | |
| 868 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 | |
| 842 | 869 | bool |
| 843 | 870 | none_of(_InputIterator __first, _InputIterator __last, _Predicate __pred) |
| 844 | 871 | { |
| ... | ... | @@ -883,7 +910,8 @@ for_each_n(_InputIterator __first, _Size __orig_n, _Function __f) |
| 883 | 910 | // find |
| 884 | 911 | |
| 885 | 912 | template <class _InputIterator, class _Tp> |
| 886 | inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 | |
| 913 | _LIBCPP_NODISCARD_EXT inline | |
| 914 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 | |
| 887 | 915 | _InputIterator |
| 888 | 916 | find(_InputIterator __first, _InputIterator __last, const _Tp& __value_) |
| 889 | 917 | { |
| ... | ... | @@ -896,7 +924,8 @@ find(_InputIterator __first, _InputIterator __last, const _Tp& __value_) |
| 896 | 924 | // find_if |
| 897 | 925 | |
| 898 | 926 | template <class _InputIterator, class _Predicate> |
| 899 | inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 | |
| 927 | _LIBCPP_NODISCARD_EXT inline | |
| 928 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 | |
| 900 | 929 | _InputIterator |
| 901 | 930 | find_if(_InputIterator __first, _InputIterator __last, _Predicate __pred) |
| 902 | 931 | { |
| ... | ... | @@ -909,7 +938,8 @@ find_if(_InputIterator __first, _InputIterator __last, _Predicate __pred) |
| 909 | 938 | // find_if_not |
| 910 | 939 | |
| 911 | 940 | template<class _InputIterator, class _Predicate> |
| 912 | inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 | |
| 941 | _LIBCPP_NODISCARD_EXT inline | |
| 942 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 | |
| 913 | 943 | _InputIterator |
| 914 | 944 | find_if_not(_InputIterator __first, _InputIterator __last, _Predicate __pred) |
| 915 | 945 | { |
| ... | ... | @@ -1044,7 +1074,8 @@ __find_end(_RandomAccessIterator1 __first1, _RandomAccessIterator1 __last1, |
| 1044 | 1074 | } |
| 1045 | 1075 | |
| 1046 | 1076 | template <class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate> |
| 1047 | inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 | |
| 1077 | _LIBCPP_NODISCARD_EXT inline | |
| 1078 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 | |
| 1048 | 1079 | _ForwardIterator1 |
| 1049 | 1080 | find_end(_ForwardIterator1 __first1, _ForwardIterator1 __last1, |
| 1050 | 1081 | _ForwardIterator2 __first2, _ForwardIterator2 __last2, _BinaryPredicate __pred) |
| ... | ... | @@ -1056,7 +1087,8 @@ find_end(_ForwardIterator1 __first1, _ForwardIterator1 __last1, |
| 1056 | 1087 | } |
| 1057 | 1088 | |
| 1058 | 1089 | template <class _ForwardIterator1, class _ForwardIterator2> |
| 1059 | inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 | |
| 1090 | _LIBCPP_NODISCARD_EXT inline | |
| 1091 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 | |
| 1060 | 1092 | _ForwardIterator1 |
| 1061 | 1093 | find_end(_ForwardIterator1 __first1, _ForwardIterator1 __last1, |
| 1062 | 1094 | _ForwardIterator2 __first2, _ForwardIterator2 __last2) |
| ... | ... | @@ -1082,7 +1114,8 @@ __find_first_of_ce(_ForwardIterator1 __first1, _ForwardIterator1 __last1, |
| 1082 | 1114 | |
| 1083 | 1115 | |
| 1084 | 1116 | template <class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate> |
| 1085 | inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 | |
| 1117 | _LIBCPP_NODISCARD_EXT inline | |
| 1118 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 | |
| 1086 | 1119 | _ForwardIterator1 |
| 1087 | 1120 | find_first_of(_ForwardIterator1 __first1, _ForwardIterator1 __last1, |
| 1088 | 1121 | _ForwardIterator2 __first2, _ForwardIterator2 __last2, _BinaryPredicate __pred) |
| ... | ... | @@ -1091,7 +1124,8 @@ find_first_of(_ForwardIterator1 __first1, _ForwardIterator1 __last1, |
| 1091 | 1124 | } |
| 1092 | 1125 | |
| 1093 | 1126 | template <class _ForwardIterator1, class _ForwardIterator2> |
| 1094 | inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 | |
| 1127 | _LIBCPP_NODISCARD_EXT inline | |
| 1128 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 | |
| 1095 | 1129 | _ForwardIterator1 |
| 1096 | 1130 | find_first_of(_ForwardIterator1 __first1, _ForwardIterator1 __last1, |
| 1097 | 1131 | _ForwardIterator2 __first2, _ForwardIterator2 __last2) |
| ... | ... | @@ -1104,7 +1138,8 @@ find_first_of(_ForwardIterator1 __first1, _ForwardIterator1 __last1, |
| 1104 | 1138 | // adjacent_find |
| 1105 | 1139 | |
| 1106 | 1140 | template <class _ForwardIterator, class _BinaryPredicate> |
| 1107 | inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 | |
| 1141 | _LIBCPP_NODISCARD_EXT inline | |
| 1142 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 | |
| 1108 | 1143 | _ForwardIterator |
| 1109 | 1144 | adjacent_find(_ForwardIterator __first, _ForwardIterator __last, _BinaryPredicate __pred) |
| 1110 | 1145 | { |
| ... | ... | @@ -1122,7 +1157,8 @@ adjacent_find(_ForwardIterator __first, _ForwardIterator __last, _BinaryPredicat |
| 1122 | 1157 | } |
| 1123 | 1158 | |
| 1124 | 1159 | template <class _ForwardIterator> |
| 1125 | inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 | |
| 1160 | _LIBCPP_NODISCARD_EXT inline | |
| 1161 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 | |
| 1126 | 1162 | _ForwardIterator |
| 1127 | 1163 | adjacent_find(_ForwardIterator __first, _ForwardIterator __last) |
| 1128 | 1164 | { |
| ... | ... | @@ -1133,7 +1169,8 @@ adjacent_find(_ForwardIterator __first, _ForwardIterator __last) |
| 1133 | 1169 | // count |
| 1134 | 1170 | |
| 1135 | 1171 | template <class _InputIterator, class _Tp> |
| 1136 | inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 | |
| 1172 | _LIBCPP_NODISCARD_EXT inline | |
| 1173 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 | |
| 1137 | 1174 | typename iterator_traits<_InputIterator>::difference_type |
| 1138 | 1175 | count(_InputIterator __first, _InputIterator __last, const _Tp& __value_) |
| 1139 | 1176 | { |
| ... | ... | @@ -1147,7 +1184,8 @@ count(_InputIterator __first, _InputIterator __last, const _Tp& __value_) |
| 1147 | 1184 | // count_if |
| 1148 | 1185 | |
| 1149 | 1186 | template <class _InputIterator, class _Predicate> |
| 1150 | inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 | |
| 1187 | _LIBCPP_NODISCARD_EXT inline | |
| 1188 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 | |
| 1151 | 1189 | typename iterator_traits<_InputIterator>::difference_type |
| 1152 | 1190 | count_if(_InputIterator __first, _InputIterator __last, _Predicate __pred) |
| 1153 | 1191 | { |
| ... | ... | @@ -1161,7 +1199,8 @@ count_if(_InputIterator __first, _InputIterator __last, _Predicate __pred) |
| 1161 | 1199 | // mismatch |
| 1162 | 1200 | |
| 1163 | 1201 | template <class _InputIterator1, class _InputIterator2, class _BinaryPredicate> |
| 1164 | inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 | |
| 1202 | _LIBCPP_NODISCARD_EXT inline | |
| 1203 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 | |
| 1165 | 1204 | pair<_InputIterator1, _InputIterator2> |
| 1166 | 1205 | mismatch(_InputIterator1 __first1, _InputIterator1 __last1, |
| 1167 | 1206 | _InputIterator2 __first2, _BinaryPredicate __pred) |
| ... | ... | @@ -1173,7 +1212,8 @@ mismatch(_InputIterator1 __first1, _InputIterator1 __last1, |
| 1173 | 1212 | } |
| 1174 | 1213 | |
| 1175 | 1214 | template <class _InputIterator1, class _InputIterator2> |
| 1176 | inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 | |
| 1215 | _LIBCPP_NODISCARD_EXT inline | |
| 1216 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 | |
| 1177 | 1217 | pair<_InputIterator1, _InputIterator2> |
| 1178 | 1218 | mismatch(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2) |
| 1179 | 1219 | { |
| ... | ... | @@ -1184,7 +1224,8 @@ mismatch(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __fi |
| 1184 | 1224 | |
| 1185 | 1225 | #if _LIBCPP_STD_VER > 11 |
| 1186 | 1226 | template <class _InputIterator1, class _InputIterator2, class _BinaryPredicate> |
| 1187 | inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 | |
| 1227 | _LIBCPP_NODISCARD_EXT inline | |
| 1228 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 | |
| 1188 | 1229 | pair<_InputIterator1, _InputIterator2> |
| 1189 | 1230 | mismatch(_InputIterator1 __first1, _InputIterator1 __last1, |
| 1190 | 1231 | _InputIterator2 __first2, _InputIterator2 __last2, |
| ... | ... | @@ -1197,7 +1238,8 @@ mismatch(_InputIterator1 __first1, _InputIterator1 __last1, |
| 1197 | 1238 | } |
| 1198 | 1239 | |
| 1199 | 1240 | template <class _InputIterator1, class _InputIterator2> |
| 1200 | inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 | |
| 1241 | _LIBCPP_NODISCARD_EXT inline | |
| 1242 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 | |
| 1201 | 1243 | pair<_InputIterator1, _InputIterator2> |
| 1202 | 1244 | mismatch(_InputIterator1 __first1, _InputIterator1 __last1, |
| 1203 | 1245 | _InputIterator2 __first2, _InputIterator2 __last2) |
| ... | ... | @@ -1211,7 +1253,8 @@ mismatch(_InputIterator1 __first1, _InputIterator1 __last1, |
| 1211 | 1253 | // equal |
| 1212 | 1254 | |
| 1213 | 1255 | template <class _InputIterator1, class _InputIterator2, class _BinaryPredicate> |
| 1214 | inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 | |
| 1256 | _LIBCPP_NODISCARD_EXT inline | |
| 1257 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 | |
| 1215 | 1258 | bool |
| 1216 | 1259 | equal(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _BinaryPredicate __pred) |
| 1217 | 1260 | { |
| ... | ... | @@ -1222,7 +1265,8 @@ equal(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first |
| 1222 | 1265 | } |
| 1223 | 1266 | |
| 1224 | 1267 | template <class _InputIterator1, class _InputIterator2> |
| 1225 | inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 | |
| 1268 | _LIBCPP_NODISCARD_EXT inline | |
| 1269 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 | |
| 1226 | 1270 | bool |
| 1227 | 1271 | equal(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2) |
| 1228 | 1272 | { |
| ... | ... | @@ -1260,7 +1304,8 @@ __equal(_RandomAccessIterator1 __first1, _RandomAccessIterator1 __last1, |
| 1260 | 1304 | } |
| 1261 | 1305 | |
| 1262 | 1306 | template <class _InputIterator1, class _InputIterator2, class _BinaryPredicate> |
| 1263 | inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 | |
| 1307 | _LIBCPP_NODISCARD_EXT inline | |
| 1308 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 | |
| 1264 | 1309 | bool |
| 1265 | 1310 | equal(_InputIterator1 __first1, _InputIterator1 __last1, |
| 1266 | 1311 | _InputIterator2 __first2, _InputIterator2 __last2, _BinaryPredicate __pred ) |
| ... | ... | @@ -1272,7 +1317,8 @@ equal(_InputIterator1 __first1, _InputIterator1 __last1, |
| 1272 | 1317 | } |
| 1273 | 1318 | |
| 1274 | 1319 | template <class _InputIterator1, class _InputIterator2> |
| 1275 | inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 | |
| 1320 | _LIBCPP_NODISCARD_EXT inline | |
| 1321 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 | |
| 1276 | 1322 | bool |
| 1277 | 1323 | equal(_InputIterator1 __first1, _InputIterator1 __last1, |
| 1278 | 1324 | _InputIterator2 __first2, _InputIterator2 __last2) |
| ... | ... | @@ -1288,7 +1334,7 @@ equal(_InputIterator1 __first1, _InputIterator1 __last1, |
| 1288 | 1334 | // is_permutation |
| 1289 | 1335 | |
| 1290 | 1336 | template<class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate> |
| 1291 | _LIBCPP_CONSTEXPR_AFTER_CXX17 bool | |
| 1337 | _LIBCPP_NODISCARD_EXT _LIBCPP_CONSTEXPR_AFTER_CXX17 bool | |
| 1292 | 1338 | is_permutation(_ForwardIterator1 __first1, _ForwardIterator1 __last1, |
| 1293 | 1339 | _ForwardIterator2 __first2, _BinaryPredicate __pred) |
| 1294 | 1340 | { |
| ... | ... | @@ -1335,7 +1381,8 @@ is_permutation(_ForwardIterator1 __first1, _ForwardIterator1 __last1, |
| 1335 | 1381 | } |
| 1336 | 1382 | |
| 1337 | 1383 | template<class _ForwardIterator1, class _ForwardIterator2> |
| 1338 | inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 | |
| 1384 | _LIBCPP_NODISCARD_EXT inline | |
| 1385 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 | |
| 1339 | 1386 | bool |
| 1340 | 1387 | is_permutation(_ForwardIterator1 __first1, _ForwardIterator1 __last1, |
| 1341 | 1388 | _ForwardIterator2 __first2) |
| ... | ... | @@ -1414,7 +1461,8 @@ __is_permutation(_RandomAccessIterator1 __first1, _RandomAccessIterator2 __last1 |
| 1414 | 1461 | } |
| 1415 | 1462 | |
| 1416 | 1463 | template<class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate> |
| 1417 | inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 | |
| 1464 | _LIBCPP_NODISCARD_EXT inline | |
| 1465 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 | |
| 1418 | 1466 | bool |
| 1419 | 1467 | is_permutation(_ForwardIterator1 __first1, _ForwardIterator1 __last1, |
| 1420 | 1468 | _ForwardIterator2 __first2, _ForwardIterator2 __last2, |
| ... | ... | @@ -1427,7 +1475,8 @@ is_permutation(_ForwardIterator1 __first1, _ForwardIterator1 __last1, |
| 1427 | 1475 | } |
| 1428 | 1476 | |
| 1429 | 1477 | template<class _ForwardIterator1, class _ForwardIterator2> |
| 1430 | inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 | |
| 1478 | _LIBCPP_NODISCARD_EXT inline | |
| 1479 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 | |
| 1431 | 1480 | bool |
| 1432 | 1481 | is_permutation(_ForwardIterator1 __first1, _ForwardIterator1 __last1, |
| 1433 | 1482 | _ForwardIterator2 __first2, _ForwardIterator2 __last2) |
| ... | ... | @@ -1445,7 +1494,8 @@ is_permutation(_ForwardIterator1 __first1, _ForwardIterator1 __last1, |
| 1445 | 1494 | // __search is in <functional> |
| 1446 | 1495 | |
| 1447 | 1496 | template <class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate> |
| 1448 | inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 | |
| 1497 | _LIBCPP_NODISCARD_EXT inline | |
| 1498 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 | |
| 1449 | 1499 | _ForwardIterator1 |
| 1450 | 1500 | search(_ForwardIterator1 __first1, _ForwardIterator1 __last1, |
| 1451 | 1501 | _ForwardIterator2 __first2, _ForwardIterator2 __last2, _BinaryPredicate __pred) |
| ... | ... | @@ -1458,7 +1508,8 @@ search(_ForwardIterator1 __first1, _ForwardIterator1 __last1, |
| 1458 | 1508 | } |
| 1459 | 1509 | |
| 1460 | 1510 | template <class _ForwardIterator1, class _ForwardIterator2> |
| 1461 | inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 | |
| 1511 | _LIBCPP_NODISCARD_EXT inline | |
| 1512 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 | |
| 1462 | 1513 | _ForwardIterator1 |
| 1463 | 1514 | search(_ForwardIterator1 __first1, _ForwardIterator1 __last1, |
| 1464 | 1515 | _ForwardIterator2 __first2, _ForwardIterator2 __last2) |
| ... | ... | @@ -1471,7 +1522,7 @@ search(_ForwardIterator1 __first1, _ForwardIterator1 __last1, |
| 1471 | 1522 | |
| 1472 | 1523 | #if _LIBCPP_STD_VER > 14 |
| 1473 | 1524 | template <class _ForwardIterator, class _Searcher> |
| 1474 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 | |
| 1525 | _LIBCPP_NODISCARD_EXT _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 | |
| 1475 | 1526 | _ForwardIterator search(_ForwardIterator __f, _ForwardIterator __l, const _Searcher &__s) |
| 1476 | 1527 | { return __s(__f, __l).first; } |
| 1477 | 1528 | #endif |
| ... | ... | @@ -1556,7 +1607,8 @@ __search_n(_RandomAccessIterator __first, _RandomAccessIterator __last, |
| 1556 | 1607 | } |
| 1557 | 1608 | |
| 1558 | 1609 | template <class _ForwardIterator, class _Size, class _Tp, class _BinaryPredicate> |
| 1559 | inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 | |
| 1610 | _LIBCPP_NODISCARD_EXT inline | |
| 1611 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 | |
| 1560 | 1612 | _ForwardIterator |
| 1561 | 1613 | search_n(_ForwardIterator __first, _ForwardIterator __last, |
| 1562 | 1614 | _Size __count, const _Tp& __value_, _BinaryPredicate __pred) |
| ... | ... | @@ -1567,7 +1619,8 @@ search_n(_ForwardIterator __first, _ForwardIterator __last, |
| 1567 | 1619 | } |
| 1568 | 1620 | |
| 1569 | 1621 | template <class _ForwardIterator, class _Size, class _Tp> |
| 1570 | inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 | |
| 1622 | _LIBCPP_NODISCARD_EXT inline | |
| 1623 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 | |
| 1571 | 1624 | _ForwardIterator |
| 1572 | 1625 | search_n(_ForwardIterator __first, _ForwardIterator __last, _Size __count, const _Tp& __value_) |
| 1573 | 1626 | { |
| ... | ... | @@ -1611,6 +1664,18 @@ __unwrap_iter(__wrap_iter<_Tp*> __i) |
| 1611 | 1664 | return __i.base(); |
| 1612 | 1665 | } |
| 1613 | 1666 | |
| 1667 | template <class _Tp> | |
| 1668 | inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG | |
| 1669 | typename enable_if | |
| 1670 | < | |
| 1671 | is_trivially_copy_assignable<_Tp>::value, | |
| 1672 | const _Tp* | |
| 1673 | >::type | |
| 1674 | __unwrap_iter(__wrap_iter<const _Tp*> __i) | |
| 1675 | { | |
| 1676 | return __i.base(); | |
| 1677 | } | |
| 1678 | ||
| 1614 | 1679 | #else |
| 1615 | 1680 | |
| 1616 | 1681 | template <class _Tp> |
| ... | ... | @@ -1984,7 +2049,7 @@ generate(_ForwardIterator __first, _ForwardIterator __last, _Generator __gen) |
| 1984 | 2049 | // generate_n |
| 1985 | 2050 | |
| 1986 | 2051 | template <class _OutputIterator, class _Size, class _Generator> |
| 1987 | inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 | |
| 2052 | inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 | |
| 1988 | 2053 | _OutputIterator |
| 1989 | 2054 | generate_n(_OutputIterator __first, _Size __orig_n, _Generator __gen) |
| 1990 | 2055 | { |
| ... | ... | @@ -1998,7 +2063,7 @@ generate_n(_OutputIterator __first, _Size __orig_n, _Generator __gen) |
| 1998 | 2063 | // remove |
| 1999 | 2064 | |
| 2000 | 2065 | template <class _ForwardIterator, class _Tp> |
| 2001 | _LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator | |
| 2066 | _LIBCPP_NODISCARD_EXT _LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator | |
| 2002 | 2067 | remove(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_) |
| 2003 | 2068 | { |
| 2004 | 2069 | __first = _VSTD::find(__first, __last, __value_); |
| ... | ... | @@ -2020,7 +2085,7 @@ remove(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_) |
| 2020 | 2085 | // remove_if |
| 2021 | 2086 | |
| 2022 | 2087 | template <class _ForwardIterator, class _Predicate> |
| 2023 | _LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator | |
| 2088 | _LIBCPP_NODISCARD_EXT _LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator | |
| 2024 | 2089 | remove_if(_ForwardIterator __first, _ForwardIterator __last, _Predicate __pred) |
| 2025 | 2090 | { |
| 2026 | 2091 | __first = _VSTD::find_if<_ForwardIterator, typename add_lvalue_reference<_Predicate>::type> |
| ... | ... | @@ -2079,7 +2144,7 @@ remove_copy_if(_InputIterator __first, _InputIterator __last, _OutputIterator __ |
| 2079 | 2144 | // unique |
| 2080 | 2145 | |
| 2081 | 2146 | template <class _ForwardIterator, class _BinaryPredicate> |
| 2082 | _LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator | |
| 2147 | _LIBCPP_NODISCARD_EXT _LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator | |
| 2083 | 2148 | unique(_ForwardIterator __first, _ForwardIterator __last, _BinaryPredicate __pred) |
| 2084 | 2149 | { |
| 2085 | 2150 | __first = _VSTD::adjacent_find<_ForwardIterator, typename add_lvalue_reference<_BinaryPredicate>::type> |
| ... | ... | @@ -2098,7 +2163,8 @@ unique(_ForwardIterator __first, _ForwardIterator __last, _BinaryPredicate __pre |
| 2098 | 2163 | } |
| 2099 | 2164 | |
| 2100 | 2165 | template <class _ForwardIterator> |
| 2101 | inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 | |
| 2166 | _LIBCPP_NODISCARD_EXT inline | |
| 2167 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 | |
| 2102 | 2168 | _ForwardIterator |
| 2103 | 2169 | unique(_ForwardIterator __first, _ForwardIterator __last) |
| 2104 | 2170 | { |
| ... | ... | @@ -2421,7 +2487,8 @@ rotate_copy(_ForwardIterator __first, _ForwardIterator __middle, _ForwardIterato |
| 2421 | 2487 | // min_element |
| 2422 | 2488 | |
| 2423 | 2489 | template <class _ForwardIterator, class _Compare> |
| 2424 | inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 | |
| 2490 | _LIBCPP_NODISCARD_EXT inline | |
| 2491 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 | |
| 2425 | 2492 | _ForwardIterator |
| 2426 | 2493 | min_element(_ForwardIterator __first, _ForwardIterator __last, _Compare __comp) |
| 2427 | 2494 | { |
| ... | ... | @@ -2438,7 +2505,8 @@ min_element(_ForwardIterator __first, _ForwardIterator __last, _Compare __comp) |
| 2438 | 2505 | } |
| 2439 | 2506 | |
| 2440 | 2507 | template <class _ForwardIterator> |
| 2441 | inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 | |
| 2508 | _LIBCPP_NODISCARD_EXT inline | |
| 2509 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 | |
| 2442 | 2510 | _ForwardIterator |
| 2443 | 2511 | min_element(_ForwardIterator __first, _ForwardIterator __last) |
| 2444 | 2512 | { |
| ... | ... | @@ -2449,7 +2517,8 @@ min_element(_ForwardIterator __first, _ForwardIterator __last) |
| 2449 | 2517 | // min |
| 2450 | 2518 | |
| 2451 | 2519 | template <class _Tp, class _Compare> |
| 2452 | inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 | |
| 2520 | _LIBCPP_NODISCARD_EXT inline | |
| 2521 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 | |
| 2453 | 2522 | const _Tp& |
| 2454 | 2523 | min(const _Tp& __a, const _Tp& __b, _Compare __comp) |
| 2455 | 2524 | { |
| ... | ... | @@ -2457,7 +2526,8 @@ min(const _Tp& __a, const _Tp& __b, _Compare __comp) |
| 2457 | 2526 | } |
| 2458 | 2527 | |
| 2459 | 2528 | template <class _Tp> |
| 2460 | inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 | |
| 2529 | _LIBCPP_NODISCARD_EXT inline | |
| 2530 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 | |
| 2461 | 2531 | const _Tp& |
| 2462 | 2532 | min(const _Tp& __a, const _Tp& __b) |
| 2463 | 2533 | { |
| ... | ... | @@ -2467,7 +2537,8 @@ min(const _Tp& __a, const _Tp& __b) |
| 2467 | 2537 | #ifndef _LIBCPP_CXX03_LANG |
| 2468 | 2538 | |
| 2469 | 2539 | template<class _Tp, class _Compare> |
| 2470 | inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 | |
| 2540 | _LIBCPP_NODISCARD_EXT inline | |
| 2541 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 | |
| 2471 | 2542 | _Tp |
| 2472 | 2543 | min(initializer_list<_Tp> __t, _Compare __comp) |
| 2473 | 2544 | { |
| ... | ... | @@ -2475,7 +2546,8 @@ min(initializer_list<_Tp> __t, _Compare __comp) |
| 2475 | 2546 | } |
| 2476 | 2547 | |
| 2477 | 2548 | template<class _Tp> |
| 2478 | inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 | |
| 2549 | _LIBCPP_NODISCARD_EXT inline | |
| 2550 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 | |
| 2479 | 2551 | _Tp |
| 2480 | 2552 | min(initializer_list<_Tp> __t) |
| 2481 | 2553 | { |
| ... | ... | @@ -2487,7 +2559,8 @@ min(initializer_list<_Tp> __t) |
| 2487 | 2559 | // max_element |
| 2488 | 2560 | |
| 2489 | 2561 | template <class _ForwardIterator, class _Compare> |
| 2490 | inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 | |
| 2562 | _LIBCPP_NODISCARD_EXT inline | |
| 2563 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 | |
| 2491 | 2564 | _ForwardIterator |
| 2492 | 2565 | max_element(_ForwardIterator __first, _ForwardIterator __last, _Compare __comp) |
| 2493 | 2566 | { |
| ... | ... | @@ -2505,7 +2578,8 @@ max_element(_ForwardIterator __first, _ForwardIterator __last, _Compare __comp) |
| 2505 | 2578 | |
| 2506 | 2579 | |
| 2507 | 2580 | template <class _ForwardIterator> |
| 2508 | inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 | |
| 2581 | _LIBCPP_NODISCARD_EXT inline | |
| 2582 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 | |
| 2509 | 2583 | _ForwardIterator |
| 2510 | 2584 | max_element(_ForwardIterator __first, _ForwardIterator __last) |
| 2511 | 2585 | { |
| ... | ... | @@ -2516,7 +2590,8 @@ max_element(_ForwardIterator __first, _ForwardIterator __last) |
| 2516 | 2590 | // max |
| 2517 | 2591 | |
| 2518 | 2592 | template <class _Tp, class _Compare> |
| 2519 | inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 | |
| 2593 | _LIBCPP_NODISCARD_EXT inline | |
| 2594 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 | |
| 2520 | 2595 | const _Tp& |
| 2521 | 2596 | max(const _Tp& __a, const _Tp& __b, _Compare __comp) |
| 2522 | 2597 | { |
| ... | ... | @@ -2524,7 +2599,8 @@ max(const _Tp& __a, const _Tp& __b, _Compare __comp) |
| 2524 | 2599 | } |
| 2525 | 2600 | |
| 2526 | 2601 | template <class _Tp> |
| 2527 | inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 | |
| 2602 | _LIBCPP_NODISCARD_EXT inline | |
| 2603 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 | |
| 2528 | 2604 | const _Tp& |
| 2529 | 2605 | max(const _Tp& __a, const _Tp& __b) |
| 2530 | 2606 | { |
| ... | ... | @@ -2534,7 +2610,8 @@ max(const _Tp& __a, const _Tp& __b) |
| 2534 | 2610 | #ifndef _LIBCPP_CXX03_LANG |
| 2535 | 2611 | |
| 2536 | 2612 | template<class _Tp, class _Compare> |
| 2537 | inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 | |
| 2613 | _LIBCPP_NODISCARD_EXT inline | |
| 2614 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 | |
| 2538 | 2615 | _Tp |
| 2539 | 2616 | max(initializer_list<_Tp> __t, _Compare __comp) |
| 2540 | 2617 | { |
| ... | ... | @@ -2542,7 +2619,8 @@ max(initializer_list<_Tp> __t, _Compare __comp) |
| 2542 | 2619 | } |
| 2543 | 2620 | |
| 2544 | 2621 | template<class _Tp> |
| 2545 | inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 | |
| 2622 | _LIBCPP_NODISCARD_EXT inline | |
| 2623 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 | |
| 2546 | 2624 | _Tp |
| 2547 | 2625 | max(initializer_list<_Tp> __t) |
| 2548 | 2626 | { |
| ... | ... | @@ -2554,7 +2632,8 @@ max(initializer_list<_Tp> __t) |
| 2554 | 2632 | #if _LIBCPP_STD_VER > 14 |
| 2555 | 2633 | // clamp |
| 2556 | 2634 | template<class _Tp, class _Compare> |
| 2557 | inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR | |
| 2635 | _LIBCPP_NODISCARD_EXT inline | |
| 2636 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR | |
| 2558 | 2637 | const _Tp& |
| 2559 | 2638 | clamp(const _Tp& __v, const _Tp& __lo, const _Tp& __hi, _Compare __comp) |
| 2560 | 2639 | { |
| ... | ... | @@ -2564,7 +2643,8 @@ clamp(const _Tp& __v, const _Tp& __lo, const _Tp& __hi, _Compare __comp) |
| 2564 | 2643 | } |
| 2565 | 2644 | |
| 2566 | 2645 | template<class _Tp> |
| 2567 | inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR | |
| 2646 | _LIBCPP_NODISCARD_EXT inline | |
| 2647 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR | |
| 2568 | 2648 | const _Tp& |
| 2569 | 2649 | clamp(const _Tp& __v, const _Tp& __lo, const _Tp& __hi) |
| 2570 | 2650 | { |
| ... | ... | @@ -2575,7 +2655,7 @@ clamp(const _Tp& __v, const _Tp& __lo, const _Tp& __hi) |
| 2575 | 2655 | // minmax_element |
| 2576 | 2656 | |
| 2577 | 2657 | template <class _ForwardIterator, class _Compare> |
| 2578 | _LIBCPP_CONSTEXPR_AFTER_CXX11 | |
| 2658 | _LIBCPP_NODISCARD_EXT _LIBCPP_CONSTEXPR_AFTER_CXX11 | |
| 2579 | 2659 | std::pair<_ForwardIterator, _ForwardIterator> |
| 2580 | 2660 | minmax_element(_ForwardIterator __first, _ForwardIterator __last, _Compare __comp) |
| 2581 | 2661 | { |
| ... | ... | @@ -2625,7 +2705,8 @@ minmax_element(_ForwardIterator __first, _ForwardIterator __last, _Compare __com |
| 2625 | 2705 | } |
| 2626 | 2706 | |
| 2627 | 2707 | template <class _ForwardIterator> |
| 2628 | inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 | |
| 2708 | _LIBCPP_NODISCARD_EXT inline | |
| 2709 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 | |
| 2629 | 2710 | std::pair<_ForwardIterator, _ForwardIterator> |
| 2630 | 2711 | minmax_element(_ForwardIterator __first, _ForwardIterator __last) |
| 2631 | 2712 | { |
| ... | ... | @@ -2636,7 +2717,8 @@ minmax_element(_ForwardIterator __first, _ForwardIterator __last) |
| 2636 | 2717 | // minmax |
| 2637 | 2718 | |
| 2638 | 2719 | template<class _Tp, class _Compare> |
| 2639 | inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 | |
| 2720 | _LIBCPP_NODISCARD_EXT inline | |
| 2721 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 | |
| 2640 | 2722 | pair<const _Tp&, const _Tp&> |
| 2641 | 2723 | minmax(const _Tp& __a, const _Tp& __b, _Compare __comp) |
| 2642 | 2724 | { |
| ... | ... | @@ -2645,7 +2727,8 @@ minmax(const _Tp& __a, const _Tp& __b, _Compare __comp) |
| 2645 | 2727 | } |
| 2646 | 2728 | |
| 2647 | 2729 | template<class _Tp> |
| 2648 | inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 | |
| 2730 | _LIBCPP_NODISCARD_EXT inline | |
| 2731 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 | |
| 2649 | 2732 | pair<const _Tp&, const _Tp&> |
| 2650 | 2733 | minmax(const _Tp& __a, const _Tp& __b) |
| 2651 | 2734 | { |
| ... | ... | @@ -2655,7 +2738,8 @@ minmax(const _Tp& __a, const _Tp& __b) |
| 2655 | 2738 | #ifndef _LIBCPP_CXX03_LANG |
| 2656 | 2739 | |
| 2657 | 2740 | template<class _Tp, class _Compare> |
| 2658 | inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 | |
| 2741 | _LIBCPP_NODISCARD_EXT inline | |
| 2742 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 | |
| 2659 | 2743 | pair<_Tp, _Tp> |
| 2660 | 2744 | minmax(initializer_list<_Tp> __t, _Compare __comp) |
| 2661 | 2745 | { |
| ... | ... | @@ -2692,7 +2776,8 @@ minmax(initializer_list<_Tp> __t, _Compare __comp) |
| 2692 | 2776 | } |
| 2693 | 2777 | |
| 2694 | 2778 | template<class _Tp> |
| 2695 | inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 | |
| 2779 | _LIBCPP_NODISCARD_EXT inline | |
| 2780 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 | |
| 2696 | 2781 | pair<_Tp, _Tp> |
| 2697 | 2782 | minmax(initializer_list<_Tp> __t) |
| 2698 | 2783 | { |
| ... | ... | @@ -2936,7 +3021,7 @@ _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK |
| 2936 | 3021 | typedef __independent_bits_engine<_URNG, _UIntType> _Eng; |
| 2937 | 3022 | if (_Rp == 0) |
| 2938 | 3023 | return static_cast<result_type>(_Eng(__g, _Dt)()); |
| 2939 | size_t __w = _Dt - __clz(_Rp) - 1; | |
| 3024 | size_t __w = _Dt - __libcpp_clz(_Rp) - 1; | |
| 2940 | 3025 | if ((_Rp & (std::numeric_limits<_UIntType>::max() >> (_Dt - __w))) != 0) |
| 2941 | 3026 | ++__w; |
| 2942 | 3027 | _Eng __e(__g, __w); |
| ... | ... | @@ -2990,7 +3075,7 @@ random_shuffle(_RandomAccessIterator __first, _RandomAccessIterator __last) |
| 2990 | 3075 | { |
| 2991 | 3076 | _Dp __uid; |
| 2992 | 3077 | __rs_default __g = __rs_get(); |
| 2993 | for (--__last, --__d; __first < __last; ++__first, --__d) | |
| 3078 | for (--__last, (void) --__d; __first < __last; ++__first, (void) --__d) | |
| 2994 | 3079 | { |
| 2995 | 3080 | difference_type __i = __uid(__g, _Pp(0, __d)); |
| 2996 | 3081 | if (__i != difference_type(0)) |
| ... | ... | @@ -3012,7 +3097,7 @@ random_shuffle(_RandomAccessIterator __first, _RandomAccessIterator __last, |
| 3012 | 3097 | difference_type __d = __last - __first; |
| 3013 | 3098 | if (__d > 1) |
| 3014 | 3099 | { |
| 3015 | for (--__last; __first < __last; ++__first, --__d) | |
| 3100 | for (--__last; __first < __last; ++__first, (void) --__d) | |
| 3016 | 3101 | { |
| 3017 | 3102 | difference_type __i = __rand(__d); |
| 3018 | 3103 | if (__i != difference_type(0)) |
| ... | ... | @@ -3096,11 +3181,7 @@ _SampleIterator sample(_PopulationIterator __first, |
| 3096 | 3181 | |
| 3097 | 3182 | template<class _RandomAccessIterator, class _UniformRandomNumberGenerator> |
| 3098 | 3183 | void shuffle(_RandomAccessIterator __first, _RandomAccessIterator __last, |
| 3099 | #ifndef _LIBCPP_CXX03_LANG | |
| 3100 | 3184 | _UniformRandomNumberGenerator&& __g) |
| 3101 | #else | |
| 3102 | _UniformRandomNumberGenerator& __g) | |
| 3103 | #endif | |
| 3104 | 3185 | { |
| 3105 | 3186 | typedef typename iterator_traits<_RandomAccessIterator>::difference_type difference_type; |
| 3106 | 3187 | typedef uniform_int_distribution<ptrdiff_t> _Dp; |
| ... | ... | @@ -3119,7 +3200,7 @@ template<class _RandomAccessIterator, class _UniformRandomNumberGenerator> |
| 3119 | 3200 | } |
| 3120 | 3201 | |
| 3121 | 3202 | template <class _InputIterator, class _Predicate> |
| 3122 | _LIBCPP_CONSTEXPR_AFTER_CXX17 bool | |
| 3203 | _LIBCPP_NODISCARD_EXT _LIBCPP_CONSTEXPR_AFTER_CXX17 bool | |
| 3123 | 3204 | is_partitioned(_InputIterator __first, _InputIterator __last, _Predicate __pred) |
| 3124 | 3205 | { |
| 3125 | 3206 | for (; __first != __last; ++__first) |
| ... | ... | @@ -3527,7 +3608,7 @@ stable_partition(_ForwardIterator __first, _ForwardIterator __last, _Predicate _ |
| 3527 | 3608 | // is_sorted_until |
| 3528 | 3609 | |
| 3529 | 3610 | template <class _ForwardIterator, class _Compare> |
| 3530 | _LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator | |
| 3611 | _LIBCPP_NODISCARD_EXT _LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator | |
| 3531 | 3612 | is_sorted_until(_ForwardIterator __first, _ForwardIterator __last, _Compare __comp) |
| 3532 | 3613 | { |
| 3533 | 3614 | if (__first != __last) |
| ... | ... | @@ -3544,7 +3625,8 @@ is_sorted_until(_ForwardIterator __first, _ForwardIterator __last, _Compare __co |
| 3544 | 3625 | } |
| 3545 | 3626 | |
| 3546 | 3627 | template<class _ForwardIterator> |
| 3547 | inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 | |
| 3628 | _LIBCPP_NODISCARD_EXT inline | |
| 3629 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 | |
| 3548 | 3630 | _ForwardIterator |
| 3549 | 3631 | is_sorted_until(_ForwardIterator __first, _ForwardIterator __last) |
| 3550 | 3632 | { |
| ... | ... | @@ -3554,7 +3636,8 @@ is_sorted_until(_ForwardIterator __first, _ForwardIterator __last) |
| 3554 | 3636 | // is_sorted |
| 3555 | 3637 | |
| 3556 | 3638 | template <class _ForwardIterator, class _Compare> |
| 3557 | inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 | |
| 3639 | _LIBCPP_NODISCARD_EXT inline | |
| 3640 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 | |
| 3558 | 3641 | bool |
| 3559 | 3642 | is_sorted(_ForwardIterator __first, _ForwardIterator __last, _Compare __comp) |
| 3560 | 3643 | { |
| ... | ... | @@ -3562,7 +3645,8 @@ is_sorted(_ForwardIterator __first, _ForwardIterator __last, _Compare __comp) |
| 3562 | 3645 | } |
| 3563 | 3646 | |
| 3564 | 3647 | template<class _ForwardIterator> |
| 3565 | inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 | |
| 3648 | _LIBCPP_NODISCARD_EXT inline | |
| 3649 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 | |
| 3566 | 3650 | bool |
| 3567 | 3651 | is_sorted(_ForwardIterator __first, _ForwardIterator __last) |
| 3568 | 3652 | { |
| ... | ... | @@ -4009,14 +4093,8 @@ inline _LIBCPP_INLINE_VISIBILITY |
| 4009 | 4093 | void |
| 4010 | 4094 | sort(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp) |
| 4011 | 4095 | { |
| 4012 | #ifdef _LIBCPP_DEBUG | |
| 4013 | typedef typename add_lvalue_reference<__debug_less<_Compare> >::type _Comp_ref; | |
| 4014 | __debug_less<_Compare> __c(__comp); | |
| 4015 | __sort<_Comp_ref>(__first, __last, __c); | |
| 4016 | #else // _LIBCPP_DEBUG | |
| 4017 | typedef typename add_lvalue_reference<_Compare>::type _Comp_ref; | |
| 4018 | __sort<_Comp_ref>(__first, __last, __comp); | |
| 4019 | #endif // _LIBCPP_DEBUG | |
| 4096 | typedef typename __comp_ref_type<_Compare>::type _Comp_ref; | |
| 4097 | _VSTD::__sort<_Comp_ref>(__first, __last, _Comp_ref(__comp)); | |
| 4020 | 4098 | } |
| 4021 | 4099 | |
| 4022 | 4100 | template <class _RandomAccessIterator> |
| ... | ... | @@ -4111,7 +4189,8 @@ __lower_bound(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __va |
| 4111 | 4189 | } |
| 4112 | 4190 | |
| 4113 | 4191 | template <class _ForwardIterator, class _Tp, class _Compare> |
| 4114 | inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 | |
| 4192 | _LIBCPP_NODISCARD_EXT inline | |
| 4193 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 | |
| 4115 | 4194 | _ForwardIterator |
| 4116 | 4195 | lower_bound(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_, _Compare __comp) |
| 4117 | 4196 | { |
| ... | ... | @@ -4120,7 +4199,8 @@ lower_bound(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __valu |
| 4120 | 4199 | } |
| 4121 | 4200 | |
| 4122 | 4201 | template <class _ForwardIterator, class _Tp> |
| 4123 | inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 | |
| 4202 | _LIBCPP_NODISCARD_EXT inline | |
| 4203 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 | |
| 4124 | 4204 | _ForwardIterator |
| 4125 | 4205 | lower_bound(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_) |
| 4126 | 4206 | { |
| ... | ... | @@ -4153,7 +4233,8 @@ __upper_bound(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __va |
| 4153 | 4233 | } |
| 4154 | 4234 | |
| 4155 | 4235 | template <class _ForwardIterator, class _Tp, class _Compare> |
| 4156 | inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 | |
| 4236 | _LIBCPP_NODISCARD_EXT inline | |
| 4237 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 | |
| 4157 | 4238 | _ForwardIterator |
| 4158 | 4239 | upper_bound(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_, _Compare __comp) |
| 4159 | 4240 | { |
| ... | ... | @@ -4162,7 +4243,8 @@ upper_bound(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __valu |
| 4162 | 4243 | } |
| 4163 | 4244 | |
| 4164 | 4245 | template <class _ForwardIterator, class _Tp> |
| 4165 | inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 | |
| 4246 | _LIBCPP_NODISCARD_EXT inline | |
| 4247 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 | |
| 4166 | 4248 | _ForwardIterator |
| 4167 | 4249 | upper_bound(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_) |
| 4168 | 4250 | { |
| ... | ... | @@ -4207,22 +4289,18 @@ __equal_range(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __va |
| 4207 | 4289 | } |
| 4208 | 4290 | |
| 4209 | 4291 | template <class _ForwardIterator, class _Tp, class _Compare> |
| 4210 | inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 | |
| 4292 | _LIBCPP_NODISCARD_EXT inline | |
| 4293 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 | |
| 4211 | 4294 | pair<_ForwardIterator, _ForwardIterator> |
| 4212 | 4295 | equal_range(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_, _Compare __comp) |
| 4213 | 4296 | { |
| 4214 | #ifdef _LIBCPP_DEBUG | |
| 4215 | typedef typename add_lvalue_reference<__debug_less<_Compare> >::type _Comp_ref; | |
| 4216 | __debug_less<_Compare> __c(__comp); | |
| 4217 | return __equal_range<_Comp_ref>(__first, __last, __value_, __c); | |
| 4218 | #else // _LIBCPP_DEBUG | |
| 4219 | typedef typename add_lvalue_reference<_Compare>::type _Comp_ref; | |
| 4297 | typedef typename __comp_ref_type<_Compare>::type _Comp_ref; | |
| 4220 | 4298 | return __equal_range<_Comp_ref>(__first, __last, __value_, __comp); |
| 4221 | #endif // _LIBCPP_DEBUG | |
| 4222 | 4299 | } |
| 4223 | 4300 | |
| 4224 | 4301 | template <class _ForwardIterator, class _Tp> |
| 4225 | inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 | |
| 4302 | _LIBCPP_NODISCARD_EXT inline | |
| 4303 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 | |
| 4226 | 4304 | pair<_ForwardIterator, _ForwardIterator> |
| 4227 | 4305 | equal_range(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_) |
| 4228 | 4306 | { |
| ... | ... | @@ -4242,22 +4320,18 @@ __binary_search(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __ |
| 4242 | 4320 | } |
| 4243 | 4321 | |
| 4244 | 4322 | template <class _ForwardIterator, class _Tp, class _Compare> |
| 4245 | inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 | |
| 4323 | _LIBCPP_NODISCARD_EXT inline | |
| 4324 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 | |
| 4246 | 4325 | bool |
| 4247 | 4326 | binary_search(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_, _Compare __comp) |
| 4248 | 4327 | { |
| 4249 | #ifdef _LIBCPP_DEBUG | |
| 4250 | typedef typename add_lvalue_reference<__debug_less<_Compare> >::type _Comp_ref; | |
| 4251 | __debug_less<_Compare> __c(__comp); | |
| 4252 | return __binary_search<_Comp_ref>(__first, __last, __value_, __c); | |
| 4253 | #else // _LIBCPP_DEBUG | |
| 4254 | typedef typename add_lvalue_reference<_Compare>::type _Comp_ref; | |
| 4328 | typedef typename __comp_ref_type<_Compare>::type _Comp_ref; | |
| 4255 | 4329 | return __binary_search<_Comp_ref>(__first, __last, __value_, __comp); |
| 4256 | #endif // _LIBCPP_DEBUG | |
| 4257 | 4330 | } |
| 4258 | 4331 | |
| 4259 | 4332 | template <class _ForwardIterator, class _Tp> |
| 4260 | inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 | |
| 4333 | _LIBCPP_NODISCARD_EXT inline | |
| 4334 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 | |
| 4261 | 4335 | bool |
| 4262 | 4336 | binary_search(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_) |
| 4263 | 4337 | { |
| ... | ... | @@ -4296,14 +4370,8 @@ _OutputIterator |
| 4296 | 4370 | merge(_InputIterator1 __first1, _InputIterator1 __last1, |
| 4297 | 4371 | _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result, _Compare __comp) |
| 4298 | 4372 | { |
| 4299 | #ifdef _LIBCPP_DEBUG | |
| 4300 | typedef typename add_lvalue_reference<__debug_less<_Compare> >::type _Comp_ref; | |
| 4301 | __debug_less<_Compare> __c(__comp); | |
| 4302 | return _VSTD::__merge<_Comp_ref>(__first1, __last1, __first2, __last2, __result, __c); | |
| 4303 | #else // _LIBCPP_DEBUG | |
| 4304 | typedef typename add_lvalue_reference<_Compare>::type _Comp_ref; | |
| 4373 | typedef typename __comp_ref_type<_Compare>::type _Comp_ref; | |
| 4305 | 4374 | return _VSTD::__merge<_Comp_ref>(__first1, __last1, __first2, __last2, __result, __comp); |
| 4306 | #endif // _LIBCPP_DEBUG | |
| 4307 | 4375 | } |
| 4308 | 4376 | |
| 4309 | 4377 | template <class _InputIterator1, class _InputIterator2, class _OutputIterator> |
| ... | ... | @@ -4478,17 +4546,9 @@ inplace_merge(_BidirectionalIterator __first, _BidirectionalIterator __middle, _ |
| 4478 | 4546 | difference_type __buf_size = _VSTD::min(__len1, __len2); |
| 4479 | 4547 | pair<value_type*, ptrdiff_t> __buf = _VSTD::get_temporary_buffer<value_type>(__buf_size); |
| 4480 | 4548 | unique_ptr<value_type, __return_temporary_buffer> __h(__buf.first); |
| 4481 | ||
| 4482 | #ifdef _LIBCPP_DEBUG | |
| 4483 | typedef typename add_lvalue_reference<__debug_less<_Compare> >::type _Comp_ref; | |
| 4484 | __debug_less<_Compare> __c(__comp); | |
| 4485 | return _VSTD::__inplace_merge<_Comp_ref>(__first, __middle, __last, __c, __len1, __len2, | |
| 4486 | __buf.first, __buf.second); | |
| 4487 | #else // _LIBCPP_DEBUG | |
| 4488 | typedef typename add_lvalue_reference<_Compare>::type _Comp_ref; | |
| 4549 | typedef typename __comp_ref_type<_Compare>::type _Comp_ref; | |
| 4489 | 4550 | return _VSTD::__inplace_merge<_Comp_ref>(__first, __middle, __last, __comp, __len1, __len2, |
| 4490 | 4551 | __buf.first, __buf.second); |
| 4491 | #endif // _LIBCPP_DEBUG | |
| 4492 | 4552 | } |
| 4493 | 4553 | |
| 4494 | 4554 | template <class _BidirectionalIterator> |
| ... | ... | @@ -4690,14 +4750,8 @@ stable_sort(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compar |
| 4690 | 4750 | __buf = _VSTD::get_temporary_buffer<value_type>(__len); |
| 4691 | 4751 | __h.reset(__buf.first); |
| 4692 | 4752 | } |
| 4693 | #ifdef _LIBCPP_DEBUG | |
| 4694 | typedef typename add_lvalue_reference<__debug_less<_Compare> >::type _Comp_ref; | |
| 4695 | __debug_less<_Compare> __c(__comp); | |
| 4696 | __stable_sort<_Comp_ref>(__first, __last, __c, __len, __buf.first, __buf.second); | |
| 4697 | #else // _LIBCPP_DEBUG | |
| 4698 | typedef typename add_lvalue_reference<_Compare>::type _Comp_ref; | |
| 4753 | typedef typename __comp_ref_type<_Compare>::type _Comp_ref; | |
| 4699 | 4754 | __stable_sort<_Comp_ref>(__first, __last, __comp, __len, __buf.first, __buf.second); |
| 4700 | #endif // _LIBCPP_DEBUG | |
| 4701 | 4755 | } |
| 4702 | 4756 | |
| 4703 | 4757 | template <class _RandomAccessIterator> |
| ... | ... | @@ -4711,7 +4765,7 @@ stable_sort(_RandomAccessIterator __first, _RandomAccessIterator __last) |
| 4711 | 4765 | // is_heap_until |
| 4712 | 4766 | |
| 4713 | 4767 | template <class _RandomAccessIterator, class _Compare> |
| 4714 | _LIBCPP_CONSTEXPR_AFTER_CXX17 _RandomAccessIterator | |
| 4768 | _LIBCPP_NODISCARD_EXT _LIBCPP_CONSTEXPR_AFTER_CXX17 _RandomAccessIterator | |
| 4715 | 4769 | is_heap_until(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp) |
| 4716 | 4770 | { |
| 4717 | 4771 | typedef typename _VSTD::iterator_traits<_RandomAccessIterator>::difference_type difference_type; |
| ... | ... | @@ -4738,7 +4792,8 @@ is_heap_until(_RandomAccessIterator __first, _RandomAccessIterator __last, _Comp |
| 4738 | 4792 | } |
| 4739 | 4793 | |
| 4740 | 4794 | template<class _RandomAccessIterator> |
| 4741 | inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 | |
| 4795 | _LIBCPP_NODISCARD_EXT inline | |
| 4796 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 | |
| 4742 | 4797 | _RandomAccessIterator |
| 4743 | 4798 | is_heap_until(_RandomAccessIterator __first, _RandomAccessIterator __last) |
| 4744 | 4799 | { |
| ... | ... | @@ -4748,7 +4803,8 @@ is_heap_until(_RandomAccessIterator __first, _RandomAccessIterator __last) |
| 4748 | 4803 | // is_heap |
| 4749 | 4804 | |
| 4750 | 4805 | template <class _RandomAccessIterator, class _Compare> |
| 4751 | inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 | |
| 4806 | _LIBCPP_NODISCARD_EXT inline | |
| 4807 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 | |
| 4752 | 4808 | bool |
| 4753 | 4809 | is_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp) |
| 4754 | 4810 | { |
| ... | ... | @@ -4756,7 +4812,8 @@ is_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __ |
| 4756 | 4812 | } |
| 4757 | 4813 | |
| 4758 | 4814 | template<class _RandomAccessIterator> |
| 4759 | inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 | |
| 4815 | _LIBCPP_NODISCARD_EXT inline | |
| 4816 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 | |
| 4760 | 4817 | bool |
| 4761 | 4818 | is_heap(_RandomAccessIterator __first, _RandomAccessIterator __last) |
| 4762 | 4819 | { |
| ... | ... | @@ -4797,14 +4854,8 @@ inline _LIBCPP_INLINE_VISIBILITY |
| 4797 | 4854 | void |
| 4798 | 4855 | push_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp) |
| 4799 | 4856 | { |
| 4800 | #ifdef _LIBCPP_DEBUG | |
| 4801 | typedef typename add_lvalue_reference<__debug_less<_Compare> >::type _Comp_ref; | |
| 4802 | __debug_less<_Compare> __c(__comp); | |
| 4803 | __sift_up<_Comp_ref>(__first, __last, __c, __last - __first); | |
| 4804 | #else // _LIBCPP_DEBUG | |
| 4805 | typedef typename add_lvalue_reference<_Compare>::type _Comp_ref; | |
| 4857 | typedef typename __comp_ref_type<_Compare>::type _Comp_ref; | |
| 4806 | 4858 | __sift_up<_Comp_ref>(__first, __last, __comp, __last - __first); |
| 4807 | #endif // _LIBCPP_DEBUG | |
| 4808 | 4859 | } |
| 4809 | 4860 | |
| 4810 | 4861 | template <class _RandomAccessIterator> |
| ... | ... | @@ -4890,14 +4941,8 @@ inline _LIBCPP_INLINE_VISIBILITY |
| 4890 | 4941 | void |
| 4891 | 4942 | pop_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp) |
| 4892 | 4943 | { |
| 4893 | #ifdef _LIBCPP_DEBUG | |
| 4894 | typedef typename add_lvalue_reference<__debug_less<_Compare> >::type _Comp_ref; | |
| 4895 | __debug_less<_Compare> __c(__comp); | |
| 4896 | __pop_heap<_Comp_ref>(__first, __last, __c, __last - __first); | |
| 4897 | #else // _LIBCPP_DEBUG | |
| 4898 | typedef typename add_lvalue_reference<_Compare>::type _Comp_ref; | |
| 4944 | typedef typename __comp_ref_type<_Compare>::type _Comp_ref; | |
| 4899 | 4945 | __pop_heap<_Comp_ref>(__first, __last, __comp, __last - __first); |
| 4900 | #endif // _LIBCPP_DEBUG | |
| 4901 | 4946 | } |
| 4902 | 4947 | |
| 4903 | 4948 | template <class _RandomAccessIterator> |
| ... | ... | @@ -4931,14 +4976,8 @@ inline _LIBCPP_INLINE_VISIBILITY |
| 4931 | 4976 | void |
| 4932 | 4977 | make_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp) |
| 4933 | 4978 | { |
| 4934 | #ifdef _LIBCPP_DEBUG | |
| 4935 | typedef typename add_lvalue_reference<__debug_less<_Compare> >::type _Comp_ref; | |
| 4936 | __debug_less<_Compare> __c(__comp); | |
| 4937 | __make_heap<_Comp_ref>(__first, __last, __c); | |
| 4938 | #else // _LIBCPP_DEBUG | |
| 4939 | typedef typename add_lvalue_reference<_Compare>::type _Comp_ref; | |
| 4979 | typedef typename __comp_ref_type<_Compare>::type _Comp_ref; | |
| 4940 | 4980 | __make_heap<_Comp_ref>(__first, __last, __comp); |
| 4941 | #endif // _LIBCPP_DEBUG | |
| 4942 | 4981 | } |
| 4943 | 4982 | |
| 4944 | 4983 | template <class _RandomAccessIterator> |
| ... | ... | @@ -4965,14 +5004,8 @@ inline _LIBCPP_INLINE_VISIBILITY |
| 4965 | 5004 | void |
| 4966 | 5005 | sort_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp) |
| 4967 | 5006 | { |
| 4968 | #ifdef _LIBCPP_DEBUG | |
| 4969 | typedef typename add_lvalue_reference<__debug_less<_Compare> >::type _Comp_ref; | |
| 4970 | __debug_less<_Compare> __c(__comp); | |
| 4971 | __sort_heap<_Comp_ref>(__first, __last, __c); | |
| 4972 | #else // _LIBCPP_DEBUG | |
| 4973 | typedef typename add_lvalue_reference<_Compare>::type _Comp_ref; | |
| 5007 | typedef typename __comp_ref_type<_Compare>::type _Comp_ref; | |
| 4974 | 5008 | __sort_heap<_Comp_ref>(__first, __last, __comp); |
| 4975 | #endif // _LIBCPP_DEBUG | |
| 4976 | 5009 | } |
| 4977 | 5010 | |
| 4978 | 5011 | template <class _RandomAccessIterator> |
| ... | ... | @@ -5009,14 +5042,8 @@ void |
| 5009 | 5042 | partial_sort(_RandomAccessIterator __first, _RandomAccessIterator __middle, _RandomAccessIterator __last, |
| 5010 | 5043 | _Compare __comp) |
| 5011 | 5044 | { |
| 5012 | #ifdef _LIBCPP_DEBUG | |
| 5013 | typedef typename add_lvalue_reference<__debug_less<_Compare> >::type _Comp_ref; | |
| 5014 | __debug_less<_Compare> __c(__comp); | |
| 5015 | __partial_sort<_Comp_ref>(__first, __middle, __last, __c); | |
| 5016 | #else // _LIBCPP_DEBUG | |
| 5017 | typedef typename add_lvalue_reference<_Compare>::type _Comp_ref; | |
| 5045 | typedef typename __comp_ref_type<_Compare>::type _Comp_ref; | |
| 5018 | 5046 | __partial_sort<_Comp_ref>(__first, __middle, __last, __comp); |
| 5019 | #endif // _LIBCPP_DEBUG | |
| 5020 | 5047 | } |
| 5021 | 5048 | |
| 5022 | 5049 | template <class _RandomAccessIterator> |
| ... | ... | @@ -5059,14 +5086,8 @@ _RandomAccessIterator |
| 5059 | 5086 | partial_sort_copy(_InputIterator __first, _InputIterator __last, |
| 5060 | 5087 | _RandomAccessIterator __result_first, _RandomAccessIterator __result_last, _Compare __comp) |
| 5061 | 5088 | { |
| 5062 | #ifdef _LIBCPP_DEBUG | |
| 5063 | typedef typename add_lvalue_reference<__debug_less<_Compare> >::type _Comp_ref; | |
| 5064 | __debug_less<_Compare> __c(__comp); | |
| 5065 | return __partial_sort_copy<_Comp_ref>(__first, __last, __result_first, __result_last, __c); | |
| 5066 | #else // _LIBCPP_DEBUG | |
| 5067 | typedef typename add_lvalue_reference<_Compare>::type _Comp_ref; | |
| 5089 | typedef typename __comp_ref_type<_Compare>::type _Comp_ref; | |
| 5068 | 5090 | return __partial_sort_copy<_Comp_ref>(__first, __last, __result_first, __result_last, __comp); |
| 5069 | #endif // _LIBCPP_DEBUG | |
| 5070 | 5091 | } |
| 5071 | 5092 | |
| 5072 | 5093 | template <class _InputIterator, class _RandomAccessIterator> |
| ... | ... | @@ -5273,14 +5294,8 @@ inline _LIBCPP_INLINE_VISIBILITY |
| 5273 | 5294 | void |
| 5274 | 5295 | nth_element(_RandomAccessIterator __first, _RandomAccessIterator __nth, _RandomAccessIterator __last, _Compare __comp) |
| 5275 | 5296 | { |
| 5276 | #ifdef _LIBCPP_DEBUG | |
| 5277 | typedef typename add_lvalue_reference<__debug_less<_Compare> >::type _Comp_ref; | |
| 5278 | __debug_less<_Compare> __c(__comp); | |
| 5279 | __nth_element<_Comp_ref>(__first, __nth, __last, __c); | |
| 5280 | #else // _LIBCPP_DEBUG | |
| 5281 | typedef typename add_lvalue_reference<_Compare>::type _Comp_ref; | |
| 5297 | typedef typename __comp_ref_type<_Compare>::type _Comp_ref; | |
| 5282 | 5298 | __nth_element<_Comp_ref>(__first, __nth, __last, __comp); |
| 5283 | #endif // _LIBCPP_DEBUG | |
| 5284 | 5299 | } |
| 5285 | 5300 | |
| 5286 | 5301 | template <class _RandomAccessIterator> |
| ... | ... | @@ -5309,23 +5324,19 @@ __includes(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __ |
| 5309 | 5324 | } |
| 5310 | 5325 | |
| 5311 | 5326 | template <class _InputIterator1, class _InputIterator2, class _Compare> |
| 5312 | inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 | |
| 5327 | _LIBCPP_NODISCARD_EXT inline | |
| 5328 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 | |
| 5313 | 5329 | bool |
| 5314 | 5330 | includes(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2, |
| 5315 | 5331 | _Compare __comp) |
| 5316 | 5332 | { |
| 5317 | #ifdef _LIBCPP_DEBUG | |
| 5318 | typedef typename add_lvalue_reference<__debug_less<_Compare> >::type _Comp_ref; | |
| 5319 | __debug_less<_Compare> __c(__comp); | |
| 5320 | return __includes<_Comp_ref>(__first1, __last1, __first2, __last2, __c); | |
| 5321 | #else // _LIBCPP_DEBUG | |
| 5322 | typedef typename add_lvalue_reference<_Compare>::type _Comp_ref; | |
| 5333 | typedef typename __comp_ref_type<_Compare>::type _Comp_ref; | |
| 5323 | 5334 | return __includes<_Comp_ref>(__first1, __last1, __first2, __last2, __comp); |
| 5324 | #endif // _LIBCPP_DEBUG | |
| 5325 | 5335 | } |
| 5326 | 5336 | |
| 5327 | 5337 | template <class _InputIterator1, class _InputIterator2> |
| 5328 | inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 | |
| 5338 | _LIBCPP_NODISCARD_EXT inline | |
| 5339 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 | |
| 5329 | 5340 | bool |
| 5330 | 5341 | includes(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2) |
| 5331 | 5342 | { |
| ... | ... | @@ -5367,14 +5378,8 @@ _OutputIterator |
| 5367 | 5378 | set_union(_InputIterator1 __first1, _InputIterator1 __last1, |
| 5368 | 5379 | _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result, _Compare __comp) |
| 5369 | 5380 | { |
| 5370 | #ifdef _LIBCPP_DEBUG | |
| 5371 | typedef typename add_lvalue_reference<__debug_less<_Compare> >::type _Comp_ref; | |
| 5372 | __debug_less<_Compare> __c(__comp); | |
| 5373 | return __set_union<_Comp_ref>(__first1, __last1, __first2, __last2, __result, __c); | |
| 5374 | #else // _LIBCPP_DEBUG | |
| 5375 | typedef typename add_lvalue_reference<_Compare>::type _Comp_ref; | |
| 5381 | typedef typename __comp_ref_type<_Compare>::type _Comp_ref; | |
| 5376 | 5382 | return __set_union<_Comp_ref>(__first1, __last1, __first2, __last2, __result, __comp); |
| 5377 | #endif // _LIBCPP_DEBUG | |
| 5378 | 5383 | } |
| 5379 | 5384 | |
| 5380 | 5385 | template <class _InputIterator1, class _InputIterator2, class _OutputIterator> |
| ... | ... | @@ -5419,14 +5424,8 @@ _OutputIterator |
| 5419 | 5424 | set_intersection(_InputIterator1 __first1, _InputIterator1 __last1, |
| 5420 | 5425 | _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result, _Compare __comp) |
| 5421 | 5426 | { |
| 5422 | #ifdef _LIBCPP_DEBUG | |
| 5423 | typedef typename add_lvalue_reference<__debug_less<_Compare> >::type _Comp_ref; | |
| 5424 | __debug_less<_Compare> __c(__comp); | |
| 5425 | return __set_intersection<_Comp_ref>(__first1, __last1, __first2, __last2, __result, __c); | |
| 5426 | #else // _LIBCPP_DEBUG | |
| 5427 | typedef typename add_lvalue_reference<_Compare>::type _Comp_ref; | |
| 5427 | typedef typename __comp_ref_type<_Compare>::type _Comp_ref; | |
| 5428 | 5428 | return __set_intersection<_Comp_ref>(__first1, __last1, __first2, __last2, __result, __comp); |
| 5429 | #endif // _LIBCPP_DEBUG | |
| 5430 | 5429 | } |
| 5431 | 5430 | |
| 5432 | 5431 | template <class _InputIterator1, class _InputIterator2, class _OutputIterator> |
| ... | ... | @@ -5473,14 +5472,8 @@ _OutputIterator |
| 5473 | 5472 | set_difference(_InputIterator1 __first1, _InputIterator1 __last1, |
| 5474 | 5473 | _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result, _Compare __comp) |
| 5475 | 5474 | { |
| 5476 | #ifdef _LIBCPP_DEBUG | |
| 5477 | typedef typename add_lvalue_reference<__debug_less<_Compare> >::type _Comp_ref; | |
| 5478 | __debug_less<_Compare> __c(__comp); | |
| 5479 | return __set_difference<_Comp_ref>(__first1, __last1, __first2, __last2, __result, __c); | |
| 5480 | #else // _LIBCPP_DEBUG | |
| 5481 | typedef typename add_lvalue_reference<_Compare>::type _Comp_ref; | |
| 5475 | typedef typename __comp_ref_type<_Compare>::type _Comp_ref; | |
| 5482 | 5476 | return __set_difference<_Comp_ref>(__first1, __last1, __first2, __last2, __result, __comp); |
| 5483 | #endif // _LIBCPP_DEBUG | |
| 5484 | 5477 | } |
| 5485 | 5478 | |
| 5486 | 5479 | template <class _InputIterator1, class _InputIterator2, class _OutputIterator> |
| ... | ... | @@ -5532,14 +5525,8 @@ _OutputIterator |
| 5532 | 5525 | set_symmetric_difference(_InputIterator1 __first1, _InputIterator1 __last1, |
| 5533 | 5526 | _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result, _Compare __comp) |
| 5534 | 5527 | { |
| 5535 | #ifdef _LIBCPP_DEBUG | |
| 5536 | typedef typename add_lvalue_reference<__debug_less<_Compare> >::type _Comp_ref; | |
| 5537 | __debug_less<_Compare> __c(__comp); | |
| 5538 | return __set_symmetric_difference<_Comp_ref>(__first1, __last1, __first2, __last2, __result, __c); | |
| 5539 | #else // _LIBCPP_DEBUG | |
| 5540 | typedef typename add_lvalue_reference<_Compare>::type _Comp_ref; | |
| 5528 | typedef typename __comp_ref_type<_Compare>::type _Comp_ref; | |
| 5541 | 5529 | return __set_symmetric_difference<_Comp_ref>(__first1, __last1, __first2, __last2, __result, __comp); |
| 5542 | #endif // _LIBCPP_DEBUG | |
| 5543 | 5530 | } |
| 5544 | 5531 | |
| 5545 | 5532 | template <class _InputIterator1, class _InputIterator2, class _OutputIterator> |
| ... | ... | @@ -5571,23 +5558,19 @@ __lexicographical_compare(_InputIterator1 __first1, _InputIterator1 __last1, |
| 5571 | 5558 | } |
| 5572 | 5559 | |
| 5573 | 5560 | template <class _InputIterator1, class _InputIterator2, class _Compare> |
| 5574 | inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 | |
| 5561 | _LIBCPP_NODISCARD_EXT inline | |
| 5562 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 | |
| 5575 | 5563 | bool |
| 5576 | 5564 | lexicographical_compare(_InputIterator1 __first1, _InputIterator1 __last1, |
| 5577 | 5565 | _InputIterator2 __first2, _InputIterator2 __last2, _Compare __comp) |
| 5578 | 5566 | { |
| 5579 | #ifdef _LIBCPP_DEBUG | |
| 5580 | typedef typename add_lvalue_reference<__debug_less<_Compare> >::type _Comp_ref; | |
| 5581 | __debug_less<_Compare> __c(__comp); | |
| 5582 | return __lexicographical_compare<_Comp_ref>(__first1, __last1, __first2, __last2, __c); | |
| 5583 | #else // _LIBCPP_DEBUG | |
| 5584 | typedef typename add_lvalue_reference<_Compare>::type _Comp_ref; | |
| 5567 | typedef typename __comp_ref_type<_Compare>::type _Comp_ref; | |
| 5585 | 5568 | return __lexicographical_compare<_Comp_ref>(__first1, __last1, __first2, __last2, __comp); |
| 5586 | #endif // _LIBCPP_DEBUG | |
| 5587 | 5569 | } |
| 5588 | 5570 | |
| 5589 | 5571 | template <class _InputIterator1, class _InputIterator2> |
| 5590 | inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 | |
| 5572 | _LIBCPP_NODISCARD_EXT inline | |
| 5573 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 | |
| 5591 | 5574 | bool |
| 5592 | 5575 | lexicographical_compare(_InputIterator1 __first1, _InputIterator1 __last1, |
| 5593 | 5576 | _InputIterator2 __first2, _InputIterator2 __last2) |
| ... | ... | @@ -5631,14 +5614,8 @@ inline _LIBCPP_INLINE_VISIBILITY |
| 5631 | 5614 | bool |
| 5632 | 5615 | next_permutation(_BidirectionalIterator __first, _BidirectionalIterator __last, _Compare __comp) |
| 5633 | 5616 | { |
| 5634 | #ifdef _LIBCPP_DEBUG | |
| 5635 | typedef typename add_lvalue_reference<__debug_less<_Compare> >::type _Comp_ref; | |
| 5636 | __debug_less<_Compare> __c(__comp); | |
| 5637 | return __next_permutation<_Comp_ref>(__first, __last, __c); | |
| 5638 | #else // _LIBCPP_DEBUG | |
| 5639 | typedef typename add_lvalue_reference<_Compare>::type _Comp_ref; | |
| 5617 | typedef typename __comp_ref_type<_Compare>::type _Comp_ref; | |
| 5640 | 5618 | return __next_permutation<_Comp_ref>(__first, __last, __comp); |
| 5641 | #endif // _LIBCPP_DEBUG | |
| 5642 | 5619 | } |
| 5643 | 5620 | |
| 5644 | 5621 | template <class _BidirectionalIterator> |
| ... | ... | @@ -5684,14 +5661,8 @@ inline _LIBCPP_INLINE_VISIBILITY |
| 5684 | 5661 | bool |
| 5685 | 5662 | prev_permutation(_BidirectionalIterator __first, _BidirectionalIterator __last, _Compare __comp) |
| 5686 | 5663 | { |
| 5687 | #ifdef _LIBCPP_DEBUG | |
| 5688 | typedef typename add_lvalue_reference<__debug_less<_Compare> >::type _Comp_ref; | |
| 5689 | __debug_less<_Compare> __c(__comp); | |
| 5690 | return __prev_permutation<_Comp_ref>(__first, __last, __c); | |
| 5691 | #else // _LIBCPP_DEBUG | |
| 5692 | typedef typename add_lvalue_reference<_Compare>::type _Comp_ref; | |
| 5664 | typedef typename __comp_ref_type<_Compare>::type _Comp_ref; | |
| 5693 | 5665 | return __prev_permutation<_Comp_ref>(__first, __last, __comp); |
| 5694 | #endif // _LIBCPP_DEBUG | |
| 5695 | 5666 | } |
| 5696 | 5667 | |
| 5697 | 5668 | template <class _BidirectionalIterator> |
lib/libcxx/include/any+4-5| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===------------------------------ any -----------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is distributed under the University of Illinois Open Source | |
| 7 | // License. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 | |
| ... | ... | @@ -508,7 +507,7 @@ any::any(_ValueType && __v) : __h(nullptr) |
| 508 | 507 | template <class _ValueType, class ..._Args, class _Tp, class> |
| 509 | 508 | any::any(in_place_type_t<_ValueType>, _Args&&... __args) { |
| 510 | 509 | __any_imp::_Handler<_Tp>::__create(*this, _VSTD::forward<_Args>(__args)...); |
| 511 | }; | |
| 510 | } | |
| 512 | 511 | |
| 513 | 512 | template <class _ValueType, class _Up, class ..._Args, class _Tp, class> |
| 514 | 513 | any::any(in_place_type_t<_ValueType>, initializer_list<_Up> __il, _Args&&... __args) { |
lib/libcxx/include/array+17-19| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===---------------------------- array -----------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 | |
| ... | ... | @@ -92,7 +91,7 @@ template <class T, size_t N > |
| 92 | 91 | void swap(array<T,N>& x, array<T,N>& y) noexcept(noexcept(x.swap(y))); // C++17 |
| 93 | 92 | |
| 94 | 93 | template <class T> struct tuple_size; |
| 95 | template <size_t I, class T> class tuple_element; | |
| 94 | template <size_t I, class T> struct tuple_element; | |
| 96 | 95 | template <class T, size_t N> struct tuple_size<array<T, N>>; |
| 97 | 96 | template <size_t I, class T, size_t N> struct tuple_element<I, array<T, N>>; |
| 98 | 97 | template <size_t I, class T, size_t N> T& get(array<T, N>&) noexcept; // constexpr in C++14 |
| ... | ... | @@ -191,17 +190,17 @@ struct _LIBCPP_TEMPLATE_VIS array |
| 191 | 190 | |
| 192 | 191 | // element access: |
| 193 | 192 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 |
| 194 | reference operator[](size_type __n) {return __elems_[__n];} | |
| 193 | reference operator[](size_type __n) _NOEXCEPT {return __elems_[__n];} | |
| 195 | 194 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 |
| 196 | const_reference operator[](size_type __n) const {return __elems_[__n];} | |
| 195 | const_reference operator[](size_type __n) const _NOEXCEPT {return __elems_[__n];} | |
| 197 | 196 | |
| 198 | 197 | _LIBCPP_CONSTEXPR_AFTER_CXX14 reference at(size_type __n); |
| 199 | 198 | _LIBCPP_CONSTEXPR_AFTER_CXX11 const_reference at(size_type __n) const; |
| 200 | 199 | |
| 201 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 reference front() {return __elems_[0];} | |
| 202 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 const_reference front() const {return __elems_[0];} | |
| 203 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 reference back() {return __elems_[_Size - 1];} | |
| 204 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 const_reference back() const {return __elems_[_Size - 1];} | |
| 200 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 reference front() _NOEXCEPT {return __elems_[0];} | |
| 201 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 const_reference front() const _NOEXCEPT {return __elems_[0];} | |
| 202 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 reference back() _NOEXCEPT {return __elems_[_Size - 1];} | |
| 203 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 const_reference back() const _NOEXCEPT {return __elems_[_Size - 1];} | |
| 205 | 204 | |
| 206 | 205 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 |
| 207 | 206 | value_type* data() _NOEXCEPT {return __elems_;} |
| ... | ... | @@ -304,13 +303,13 @@ struct _LIBCPP_TEMPLATE_VIS array<_Tp, 0> |
| 304 | 303 | |
| 305 | 304 | // element access: |
| 306 | 305 | _LIBCPP_INLINE_VISIBILITY |
| 307 | reference operator[](size_type) { | |
| 306 | reference operator[](size_type) _NOEXCEPT { | |
| 308 | 307 | _LIBCPP_ASSERT(false, "cannot call array<T, 0>::operator[] on a zero-sized array"); |
| 309 | 308 | _LIBCPP_UNREACHABLE(); |
| 310 | 309 | } |
| 311 | 310 | |
| 312 | 311 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 |
| 313 | const_reference operator[](size_type) const { | |
| 312 | const_reference operator[](size_type) const _NOEXCEPT { | |
| 314 | 313 | _LIBCPP_ASSERT(false, "cannot call array<T, 0>::operator[] on a zero-sized array"); |
| 315 | 314 | _LIBCPP_UNREACHABLE(); |
| 316 | 315 | } |
| ... | ... | @@ -328,25 +327,25 @@ struct _LIBCPP_TEMPLATE_VIS array<_Tp, 0> |
| 328 | 327 | } |
| 329 | 328 | |
| 330 | 329 | _LIBCPP_INLINE_VISIBILITY |
| 331 | reference front() { | |
| 330 | reference front() _NOEXCEPT { | |
| 332 | 331 | _LIBCPP_ASSERT(false, "cannot call array<T, 0>::front() on a zero-sized array"); |
| 333 | 332 | _LIBCPP_UNREACHABLE(); |
| 334 | 333 | } |
| 335 | 334 | |
| 336 | 335 | _LIBCPP_INLINE_VISIBILITY |
| 337 | const_reference front() const { | |
| 336 | const_reference front() const _NOEXCEPT { | |
| 338 | 337 | _LIBCPP_ASSERT(false, "cannot call array<T, 0>::front() on a zero-sized array"); |
| 339 | 338 | _LIBCPP_UNREACHABLE(); |
| 340 | 339 | } |
| 341 | 340 | |
| 342 | 341 | _LIBCPP_INLINE_VISIBILITY |
| 343 | reference back() { | |
| 342 | reference back() _NOEXCEPT { | |
| 344 | 343 | _LIBCPP_ASSERT(false, "cannot call array<T, 0>::back() on a zero-sized array"); |
| 345 | 344 | _LIBCPP_UNREACHABLE(); |
| 346 | 345 | } |
| 347 | 346 | |
| 348 | 347 | _LIBCPP_INLINE_VISIBILITY |
| 349 | const_reference back() const { | |
| 348 | const_reference back() const _NOEXCEPT { | |
| 350 | 349 | _LIBCPP_ASSERT(false, "cannot call array<T, 0>::back() on a zero-sized array"); |
| 351 | 350 | _LIBCPP_UNREACHABLE(); |
| 352 | 351 | } |
| ... | ... | @@ -434,10 +433,9 @@ struct _LIBCPP_TEMPLATE_VIS tuple_size<array<_Tp, _Size> > |
| 434 | 433 | : public integral_constant<size_t, _Size> {}; |
| 435 | 434 | |
| 436 | 435 | template <size_t _Ip, class _Tp, size_t _Size> |
| 437 | class _LIBCPP_TEMPLATE_VIS tuple_element<_Ip, array<_Tp, _Size> > | |
| 436 | struct _LIBCPP_TEMPLATE_VIS tuple_element<_Ip, array<_Tp, _Size> > | |
| 438 | 437 | { |
| 439 | 438 | static_assert(_Ip < _Size, "Index out of bounds in std::tuple_element<> (std::array)"); |
| 440 | public: | |
| 441 | 439 | typedef _Tp type; |
| 442 | 440 | }; |
| 443 | 441 |
lib/libcxx/include/atomic+811-257| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===--------------------------- atomic -----------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is distributed under the University of Illinois Open Source | |
| 7 | // License. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 | |
| ... | ... | @@ -21,17 +20,24 @@ namespace std |
| 21 | 20 | |
| 22 | 21 | #define __cpp_lib_atomic_is_always_lock_free // as specified by SG10 |
| 23 | 22 | |
| 24 | // order and consistency | |
| 25 | ||
| 26 | typedef enum memory_order | |
| 27 | { | |
| 28 | memory_order_relaxed, | |
| 29 | memory_order_consume, // load-consume | |
| 30 | memory_order_acquire, // load-acquire | |
| 31 | memory_order_release, // store-release | |
| 32 | memory_order_acq_rel, // store-release load-acquire | |
| 33 | memory_order_seq_cst // store-release load-acquire | |
| 34 | } memory_order; | |
| 23 | // order and consistency | |
| 24 | ||
| 25 | enum memory_order: unspecified // enum class in C++20 | |
| 26 | { | |
| 27 | relaxed, | |
| 28 | consume, // load-consume | |
| 29 | acquire, // load-acquire | |
| 30 | release, // store-release | |
| 31 | acq_rel, // store-release load-acquire | |
| 32 | seq_cst // store-release load-acquire | |
| 33 | }; | |
| 34 | ||
| 35 | inline constexpr auto memory_order_relaxed = memory_order::relaxed; | |
| 36 | inline constexpr auto memory_order_consume = memory_order::consume; | |
| 37 | inline constexpr auto memory_order_acquire = memory_order::acquire; | |
| 38 | inline constexpr auto memory_order_release = memory_order::release; | |
| 39 | inline constexpr auto memory_order_acq_rel = memory_order::acq_rel; | |
| 40 | inline constexpr auto memory_order_seq_cst = memory_order::seq_cst; | |
| 35 | 41 | |
| 36 | 42 | template <class T> T kill_dependency(T y) noexcept; |
| 37 | 43 | |
| ... | ... | @@ -551,13 +557,13 @@ void atomic_signal_fence(memory_order m) noexcept; |
| 551 | 557 | #endif |
| 552 | 558 | |
| 553 | 559 | #ifdef _LIBCPP_HAS_NO_THREADS |
| 554 | #error <atomic> is not supported on this single threaded system | |
| 560 | # error <atomic> is not supported on this single threaded system | |
| 555 | 561 | #endif |
| 556 | #if !defined(_LIBCPP_HAS_C_ATOMIC_IMP) && !defined(_LIBCPP_HAS_GCC_ATOMIC_IMP) | |
| 557 | #error <atomic> is not implemented | |
| 562 | #ifdef _LIBCPP_HAS_NO_ATOMIC_HEADER | |
| 563 | # error <atomic> is not implemented | |
| 558 | 564 | #endif |
| 559 | 565 | #ifdef kill_dependency |
| 560 | #error C++ standard library is incompatible with <stdatomic.h> | |
| 566 | # error C++ standard library is incompatible with <stdatomic.h> | |
| 561 | 567 | #endif |
| 562 | 568 | |
| 563 | 569 | #define _LIBCPP_CHECK_STORE_MEMORY_ORDER(__m) \ |
| ... | ... | @@ -578,49 +584,94 @@ void atomic_signal_fence(memory_order m) noexcept; |
| 578 | 584 | |
| 579 | 585 | _LIBCPP_BEGIN_NAMESPACE_STD |
| 580 | 586 | |
| 581 | typedef enum memory_order | |
| 582 | { | |
| 583 | memory_order_relaxed, memory_order_consume, memory_order_acquire, | |
| 584 | memory_order_release, memory_order_acq_rel, memory_order_seq_cst | |
| 587 | // Figure out what the underlying type for `memory_order` would be if it were | |
| 588 | // declared as an unscoped enum (accounting for -fshort-enums). Use this result | |
| 589 | // to pin the underlying type in C++20. | |
| 590 | enum __legacy_memory_order { | |
| 591 | __mo_relaxed, | |
| 592 | __mo_consume, | |
| 593 | __mo_acquire, | |
| 594 | __mo_release, | |
| 595 | __mo_acq_rel, | |
| 596 | __mo_seq_cst | |
| 597 | }; | |
| 598 | ||
| 599 | typedef underlying_type<__legacy_memory_order>::type __memory_order_underlying_t; | |
| 600 | ||
| 601 | #if _LIBCPP_STD_VER > 17 | |
| 602 | ||
| 603 | enum class memory_order : __memory_order_underlying_t { | |
| 604 | relaxed = __mo_relaxed, | |
| 605 | consume = __mo_consume, | |
| 606 | acquire = __mo_acquire, | |
| 607 | release = __mo_release, | |
| 608 | acq_rel = __mo_acq_rel, | |
| 609 | seq_cst = __mo_seq_cst | |
| 610 | }; | |
| 611 | ||
| 612 | inline constexpr auto memory_order_relaxed = memory_order::relaxed; | |
| 613 | inline constexpr auto memory_order_consume = memory_order::consume; | |
| 614 | inline constexpr auto memory_order_acquire = memory_order::acquire; | |
| 615 | inline constexpr auto memory_order_release = memory_order::release; | |
| 616 | inline constexpr auto memory_order_acq_rel = memory_order::acq_rel; | |
| 617 | inline constexpr auto memory_order_seq_cst = memory_order::seq_cst; | |
| 618 | ||
| 619 | #else | |
| 620 | ||
| 621 | typedef enum memory_order { | |
| 622 | memory_order_relaxed = __mo_relaxed, | |
| 623 | memory_order_consume = __mo_consume, | |
| 624 | memory_order_acquire = __mo_acquire, | |
| 625 | memory_order_release = __mo_release, | |
| 626 | memory_order_acq_rel = __mo_acq_rel, | |
| 627 | memory_order_seq_cst = __mo_seq_cst, | |
| 585 | 628 | } memory_order; |
| 586 | 629 | |
| 587 | #if defined(_LIBCPP_HAS_GCC_ATOMIC_IMP) | |
| 588 | namespace __gcc_atomic { | |
| 589 | template <typename _Tp> | |
| 590 | struct __gcc_atomic_t { | |
| 630 | #endif // _LIBCPP_STD_VER > 17 | |
| 631 | ||
| 632 | static_assert((is_same<underlying_type<memory_order>::type, __memory_order_underlying_t>::value), | |
| 633 | "unexpected underlying type for std::memory_order"); | |
| 634 | ||
| 635 | #if defined(_LIBCPP_HAS_GCC_ATOMIC_IMP) || \ | |
| 636 | 	defined(_LIBCPP_ATOMIC_ONLY_USE_BUILTINS) | |
| 637 | ||
| 638 | // [atomics.types.generic]p1 guarantees _Tp is trivially copyable. Because | |
| 639 | // the default operator= in an object is not volatile, a byte-by-byte copy | |
| 640 | // is required. | |
| 641 | template <typename _Tp, typename _Tv> _LIBCPP_INLINE_VISIBILITY | |
| 642 | typename enable_if<is_assignable<_Tp&, _Tv>::value>::type | |
| 643 | __cxx_atomic_assign_volatile(_Tp& __a_value, _Tv const& __val) { | |
| 644 | __a_value = __val; | |
| 645 | } | |
| 646 | template <typename _Tp, typename _Tv> _LIBCPP_INLINE_VISIBILITY | |
| 647 | typename enable_if<is_assignable<_Tp&, _Tv>::value>::type | |
| 648 | __cxx_atomic_assign_volatile(_Tp volatile& __a_value, _Tv volatile const& __val) { | |
| 649 | volatile char* __to = reinterpret_cast<volatile char*>(&__a_value); | |
| 650 | volatile char* __end = __to + sizeof(_Tp); | |
| 651 | volatile const char* __from = reinterpret_cast<volatile const char*>(&__val); | |
| 652 | while (__to != __end) | |
| 653 | *__to++ = *__from++; | |
| 654 | } | |
| 591 | 655 | |
| 592 | #if _GNUC_VER >= 501 | |
| 593 | static_assert(is_trivially_copyable<_Tp>::value, | |
| 594 | "std::atomic<Tp> requires that 'Tp' be a trivially copyable type"); | |
| 595 | 656 | #endif |
| 596 | 657 | |
| 658 | #if defined(_LIBCPP_HAS_GCC_ATOMIC_IMP) | |
| 659 | ||
| 660 | template <typename _Tp> | |
| 661 | struct __cxx_atomic_base_impl { | |
| 662 | ||
| 597 | 663 | _LIBCPP_INLINE_VISIBILITY |
| 598 | 664 | #ifndef _LIBCPP_CXX03_LANG |
| 599 | __gcc_atomic_t() _NOEXCEPT = default; | |
| 665 | __cxx_atomic_base_impl() _NOEXCEPT = default; | |
| 600 | 666 | #else |
| 601 | __gcc_atomic_t() _NOEXCEPT : __a_value() {} | |
| 667 | __cxx_atomic_base_impl() _NOEXCEPT : __a_value() {} | |
| 602 | 668 | #endif // _LIBCPP_CXX03_LANG |
| 603 | _LIBCPP_CONSTEXPR explicit __gcc_atomic_t(_Tp value) _NOEXCEPT | |
| 669 | _LIBCPP_CONSTEXPR explicit __cxx_atomic_base_impl(_Tp value) _NOEXCEPT | |
| 604 | 670 | : __a_value(value) {} |
| 605 | 671 | _Tp __a_value; |
| 606 | 672 | }; |
| 607 | #define _Atomic(x) __gcc_atomic::__gcc_atomic_t<x> | |
| 608 | ||
| 609 | template <typename _Tp> _Tp __create(); | |
| 610 | ||
| 611 | template <typename _Tp, typename _Td> | |
| 612 | typename enable_if<sizeof(_Tp()->__a_value = __create<_Td>()), char>::type | |
| 613 | __test_atomic_assignable(int); | |
| 614 | template <typename _Tp, typename _Up> | |
| 615 | __two __test_atomic_assignable(...); | |
| 616 | ||
| 617 | template <typename _Tp, typename _Td> | |
| 618 | struct __can_assign { | |
| 619 | static const bool value = | |
| 620 | sizeof(__test_atomic_assignable<_Tp, _Td>(1)) == sizeof(char); | |
| 621 | }; | |
| 622 | 673 | |
| 623 | static inline _LIBCPP_CONSTEXPR int __to_gcc_order(memory_order __order) { | |
| 674 | _LIBCPP_INLINE_VISIBILITY inline _LIBCPP_CONSTEXPR int __to_gcc_order(memory_order __order) { | |
| 624 | 675 | // Avoid switch statement to make this a constexpr. |
| 625 | 676 | return __order == memory_order_relaxed ? __ATOMIC_RELAXED: |
| 626 | 677 | (__order == memory_order_acquire ? __ATOMIC_ACQUIRE: |
| ... | ... | @@ -630,7 +681,7 @@ static inline _LIBCPP_CONSTEXPR int __to_gcc_order(memory_order __order) { |
| 630 | 681 | __ATOMIC_CONSUME)))); |
| 631 | 682 | } |
| 632 | 683 | |
| 633 | static inline _LIBCPP_CONSTEXPR int __to_gcc_failure_order(memory_order __order) { | |
| 684 | _LIBCPP_INLINE_VISIBILITY inline _LIBCPP_CONSTEXPR int __to_gcc_failure_order(memory_order __order) { | |
| 634 | 685 | // Avoid switch statement to make this a constexpr. |
| 635 | 686 | return __order == memory_order_relaxed ? __ATOMIC_RELAXED: |
| 636 | 687 | (__order == memory_order_acquire ? __ATOMIC_ACQUIRE: |
| ... | ... | @@ -640,133 +691,125 @@ static inline _LIBCPP_CONSTEXPR int __to_gcc_failure_order(memory_order __order) |
| 640 | 691 | __ATOMIC_CONSUME)))); |
| 641 | 692 | } |
| 642 | 693 | |
| 643 | } // namespace __gcc_atomic | |
| 644 | ||
| 645 | template <typename _Tp> | |
| 646 | static inline | |
| 647 | typename enable_if< | |
| 648 | __gcc_atomic::__can_assign<volatile _Atomic(_Tp)*, _Tp>::value>::type | |
| 649 | __c11_atomic_init(volatile _Atomic(_Tp)* __a, _Tp __val) { | |
| 650 | __a->__a_value = __val; | |
| 651 | } | |
| 652 | ||
| 653 | 694 | template <typename _Tp> |
| 654 | static inline | |
| 655 | typename enable_if< | |
| 656 | !__gcc_atomic::__can_assign<volatile _Atomic(_Tp)*, _Tp>::value && | |
| 657 | __gcc_atomic::__can_assign< _Atomic(_Tp)*, _Tp>::value>::type | |
| 658 | __c11_atomic_init(volatile _Atomic(_Tp)* __a, _Tp __val) { | |
| 659 | // [atomics.types.generic]p1 guarantees _Tp is trivially copyable. Because | |
| 660 | // the default operator= in an object is not volatile, a byte-by-byte copy | |
| 661 | // is required. | |
| 662 | volatile char* to = reinterpret_cast<volatile char*>(&__a->__a_value); | |
| 663 | volatile char* end = to + sizeof(_Tp); | |
| 664 | char* from = reinterpret_cast<char*>(&__val); | |
| 665 | while (to != end) { | |
| 666 | *to++ = *from++; | |
| 667 | } | |
| 695 | _LIBCPP_INLINE_VISIBILITY | |
| 696 | void __cxx_atomic_init(volatile __cxx_atomic_base_impl<_Tp>* __a, _Tp __val) { | |
| 697 | __cxx_atomic_assign_volatile(__a->__a_value, __val); | |
| 668 | 698 | } |
| 669 | 699 | |
| 670 | 700 | template <typename _Tp> |
| 671 | static inline void __c11_atomic_init(_Atomic(_Tp)* __a, _Tp __val) { | |
| 701 | _LIBCPP_INLINE_VISIBILITY | |
| 702 | void __cxx_atomic_init(__cxx_atomic_base_impl<_Tp>* __a, _Tp __val) { | |
| 672 | 703 | __a->__a_value = __val; |
| 673 | 704 | } |
| 674 | 705 | |
| 675 | static inline void __c11_atomic_thread_fence(memory_order __order) { | |
| 676 | __atomic_thread_fence(__gcc_atomic::__to_gcc_order(__order)); | |
| 706 | _LIBCPP_INLINE_VISIBILITY inline | |
| 707 | void __cxx_atomic_thread_fence(memory_order __order) { | |
| 708 | __atomic_thread_fence(__to_gcc_order(__order)); | |
| 677 | 709 | } |
| 678 | 710 | |
| 679 | static inline void __c11_atomic_signal_fence(memory_order __order) { | |
| 680 | __atomic_signal_fence(__gcc_atomic::__to_gcc_order(__order)); | |
| 711 | _LIBCPP_INLINE_VISIBILITY inline | |
| 712 | void __cxx_atomic_signal_fence(memory_order __order) { | |
| 713 | __atomic_signal_fence(__to_gcc_order(__order)); | |
| 681 | 714 | } |
| 682 | 715 | |
| 683 | 716 | template <typename _Tp> |
| 684 | static inline void __c11_atomic_store(volatile _Atomic(_Tp)* __a, _Tp __val, | |
| 685 | memory_order __order) { | |
| 686 | return __atomic_store(&__a->__a_value, &__val, | |
| 687 | __gcc_atomic::__to_gcc_order(__order)); | |
| 717 | _LIBCPP_INLINE_VISIBILITY | |
| 718 | void __cxx_atomic_store(volatile __cxx_atomic_base_impl<_Tp>* __a, _Tp __val, | |
| 719 | memory_order __order) { | |
| 720 | __atomic_store(&__a->__a_value, &__val, | |
| 721 | __to_gcc_order(__order)); | |
| 688 | 722 | } |
| 689 | 723 | |
| 690 | 724 | template <typename _Tp> |
| 691 | static inline void __c11_atomic_store(_Atomic(_Tp)* __a, _Tp __val, | |
| 692 | memory_order __order) { | |
| 725 | _LIBCPP_INLINE_VISIBILITY | |
| 726 | void __cxx_atomic_store(__cxx_atomic_base_impl<_Tp>* __a, _Tp __val, | |
| 727 | memory_order __order) { | |
| 693 | 728 | __atomic_store(&__a->__a_value, &__val, |
| 694 | __gcc_atomic::__to_gcc_order(__order)); | |
| 729 | __to_gcc_order(__order)); | |
| 695 | 730 | } |
| 696 | 731 | |
| 697 | 732 | template <typename _Tp> |
| 698 | static inline _Tp __c11_atomic_load(const volatile _Atomic(_Tp)* __a, | |
| 699 | memory_order __order) { | |
| 733 | _LIBCPP_INLINE_VISIBILITY | |
| 734 | _Tp __cxx_atomic_load(const volatile __cxx_atomic_base_impl<_Tp>* __a, | |
| 735 | memory_order __order) { | |
| 700 | 736 | _Tp __ret; |
| 701 | 737 | __atomic_load(&__a->__a_value, &__ret, |
| 702 | __gcc_atomic::__to_gcc_order(__order)); | |
| 738 | __to_gcc_order(__order)); | |
| 703 | 739 | return __ret; |
| 704 | 740 | } |
| 705 | 741 | |
| 706 | 742 | template <typename _Tp> |
| 707 | static inline _Tp __c11_atomic_load(const _Atomic(_Tp)* __a, memory_order __order) { | |
| 743 | _LIBCPP_INLINE_VISIBILITY | |
| 744 | _Tp __cxx_atomic_load(const __cxx_atomic_base_impl<_Tp>* __a, memory_order __order) { | |
| 708 | 745 | _Tp __ret; |
| 709 | 746 | __atomic_load(&__a->__a_value, &__ret, |
| 710 | __gcc_atomic::__to_gcc_order(__order)); | |
| 747 | __to_gcc_order(__order)); | |
| 711 | 748 | return __ret; |
| 712 | 749 | } |
| 713 | 750 | |
| 714 | 751 | template <typename _Tp> |
| 715 | static inline _Tp __c11_atomic_exchange(volatile _Atomic(_Tp)* __a, | |
| 716 | _Tp __value, memory_order __order) { | |
| 752 | _LIBCPP_INLINE_VISIBILITY | |
| 753 | _Tp __cxx_atomic_exchange(volatile __cxx_atomic_base_impl<_Tp>* __a, | |
| 754 | _Tp __value, memory_order __order) { | |
| 717 | 755 | _Tp __ret; |
| 718 | 756 | __atomic_exchange(&__a->__a_value, &__value, &__ret, |
| 719 | __gcc_atomic::__to_gcc_order(__order)); | |
| 757 | __to_gcc_order(__order)); | |
| 720 | 758 | return __ret; |
| 721 | 759 | } |
| 722 | 760 | |
| 723 | 761 | template <typename _Tp> |
| 724 | static inline _Tp __c11_atomic_exchange(_Atomic(_Tp)* __a, _Tp __value, | |
| 725 | memory_order __order) { | |
| 762 | _LIBCPP_INLINE_VISIBILITY | |
| 763 | _Tp __cxx_atomic_exchange(__cxx_atomic_base_impl<_Tp>* __a, _Tp __value, | |
| 764 | memory_order __order) { | |
| 726 | 765 | _Tp __ret; |
| 727 | 766 | __atomic_exchange(&__a->__a_value, &__value, &__ret, |
| 728 | __gcc_atomic::__to_gcc_order(__order)); | |
| 767 | __to_gcc_order(__order)); | |
| 729 | 768 | return __ret; |
| 730 | 769 | } |
| 731 | 770 | |
| 732 | 771 | template <typename _Tp> |
| 733 | static inline bool __c11_atomic_compare_exchange_strong( | |
| 734 | volatile _Atomic(_Tp)* __a, _Tp* __expected, _Tp __value, | |
| 772 | _LIBCPP_INLINE_VISIBILITY | |
| 773 | bool __cxx_atomic_compare_exchange_strong( | |
| 774 | volatile __cxx_atomic_base_impl<_Tp>* __a, _Tp* __expected, _Tp __value, | |
| 735 | 775 | memory_order __success, memory_order __failure) { |
| 736 | 776 | return __atomic_compare_exchange(&__a->__a_value, __expected, &__value, |
| 737 | 777 | false, |
| 738 | __gcc_atomic::__to_gcc_order(__success), | |
| 739 | __gcc_atomic::__to_gcc_failure_order(__failure)); | |
| 778 | __to_gcc_order(__success), | |
| 779 | __to_gcc_failure_order(__failure)); | |
| 740 | 780 | } |
| 741 | 781 | |
| 742 | 782 | template <typename _Tp> |
| 743 | static inline bool __c11_atomic_compare_exchange_strong( | |
| 744 | _Atomic(_Tp)* __a, _Tp* __expected, _Tp __value, memory_order __success, | |
| 783 | _LIBCPP_INLINE_VISIBILITY | |
| 784 | bool __cxx_atomic_compare_exchange_strong( | |
| 785 | __cxx_atomic_base_impl<_Tp>* __a, _Tp* __expected, _Tp __value, memory_order __success, | |
| 745 | 786 | memory_order __failure) { |
| 746 | 787 | return __atomic_compare_exchange(&__a->__a_value, __expected, &__value, |
| 747 | 788 | false, |
| 748 | __gcc_atomic::__to_gcc_order(__success), | |
| 749 | __gcc_atomic::__to_gcc_failure_order(__failure)); | |
| 789 | __to_gcc_order(__success), | |
| 790 | __to_gcc_failure_order(__failure)); | |
| 750 | 791 | } |
| 751 | 792 | |
| 752 | 793 | template <typename _Tp> |
| 753 | static inline bool __c11_atomic_compare_exchange_weak( | |
| 754 | volatile _Atomic(_Tp)* __a, _Tp* __expected, _Tp __value, | |
| 794 | _LIBCPP_INLINE_VISIBILITY | |
| 795 | bool __cxx_atomic_compare_exchange_weak( | |
| 796 | volatile __cxx_atomic_base_impl<_Tp>* __a, _Tp* __expected, _Tp __value, | |
| 755 | 797 | memory_order __success, memory_order __failure) { |
| 756 | 798 | return __atomic_compare_exchange(&__a->__a_value, __expected, &__value, |
| 757 | 799 | true, |
| 758 | __gcc_atomic::__to_gcc_order(__success), | |
| 759 | __gcc_atomic::__to_gcc_failure_order(__failure)); | |
| 800 | __to_gcc_order(__success), | |
| 801 | __to_gcc_failure_order(__failure)); | |
| 760 | 802 | } |
| 761 | 803 | |
| 762 | 804 | template <typename _Tp> |
| 763 | static inline bool __c11_atomic_compare_exchange_weak( | |
| 764 | _Atomic(_Tp)* __a, _Tp* __expected, _Tp __value, memory_order __success, | |
| 805 | _LIBCPP_INLINE_VISIBILITY | |
| 806 | bool __cxx_atomic_compare_exchange_weak( | |
| 807 | __cxx_atomic_base_impl<_Tp>* __a, _Tp* __expected, _Tp __value, memory_order __success, | |
| 765 | 808 | memory_order __failure) { |
| 766 | 809 | return __atomic_compare_exchange(&__a->__a_value, __expected, &__value, |
| 767 | 810 | true, |
| 768 | __gcc_atomic::__to_gcc_order(__success), | |
| 769 | __gcc_atomic::__to_gcc_failure_order(__failure)); | |
| 811 | __to_gcc_order(__success), | |
| 812 | __to_gcc_failure_order(__failure)); | |
| 770 | 813 | } |
| 771 | 814 | |
| 772 | 815 | template <typename _Tp> |
| ... | ... | @@ -783,80 +826,264 @@ template <typename _Tp, int n> |
| 783 | 826 | struct __skip_amt<_Tp[n]> { }; |
| 784 | 827 | |
| 785 | 828 | template <typename _Tp, typename _Td> |
| 786 | static inline _Tp __c11_atomic_fetch_add(volatile _Atomic(_Tp)* __a, | |
| 787 | _Td __delta, memory_order __order) { | |
| 829 | _LIBCPP_INLINE_VISIBILITY | |
| 830 | _Tp __cxx_atomic_fetch_add(volatile __cxx_atomic_base_impl<_Tp>* __a, | |
| 831 | _Td __delta, memory_order __order) { | |
| 788 | 832 | return __atomic_fetch_add(&__a->__a_value, __delta * __skip_amt<_Tp>::value, |
| 789 | __gcc_atomic::__to_gcc_order(__order)); | |
| 833 | __to_gcc_order(__order)); | |
| 790 | 834 | } |
| 791 | 835 | |
| 792 | 836 | template <typename _Tp, typename _Td> |
| 793 | static inline _Tp __c11_atomic_fetch_add(_Atomic(_Tp)* __a, _Td __delta, | |
| 794 | memory_order __order) { | |
| 837 | _LIBCPP_INLINE_VISIBILITY | |
| 838 | _Tp __cxx_atomic_fetch_add(__cxx_atomic_base_impl<_Tp>* __a, _Td __delta, | |
| 839 | memory_order __order) { | |
| 795 | 840 | return __atomic_fetch_add(&__a->__a_value, __delta * __skip_amt<_Tp>::value, |
| 796 | __gcc_atomic::__to_gcc_order(__order)); | |
| 841 | __to_gcc_order(__order)); | |
| 797 | 842 | } |
| 798 | 843 | |
| 799 | 844 | template <typename _Tp, typename _Td> |
| 800 | static inline _Tp __c11_atomic_fetch_sub(volatile _Atomic(_Tp)* __a, | |
| 801 | _Td __delta, memory_order __order) { | |
| 845 | _LIBCPP_INLINE_VISIBILITY | |
| 846 | _Tp __cxx_atomic_fetch_sub(volatile __cxx_atomic_base_impl<_Tp>* __a, | |
| 847 | _Td __delta, memory_order __order) { | |
| 802 | 848 | return __atomic_fetch_sub(&__a->__a_value, __delta * __skip_amt<_Tp>::value, |
| 803 | __gcc_atomic::__to_gcc_order(__order)); | |
| 849 | __to_gcc_order(__order)); | |
| 804 | 850 | } |
| 805 | 851 | |
| 806 | 852 | template <typename _Tp, typename _Td> |
| 807 | static inline _Tp __c11_atomic_fetch_sub(_Atomic(_Tp)* __a, _Td __delta, | |
| 808 | memory_order __order) { | |
| 853 | _LIBCPP_INLINE_VISIBILITY | |
| 854 | _Tp __cxx_atomic_fetch_sub(__cxx_atomic_base_impl<_Tp>* __a, _Td __delta, | |
| 855 | memory_order __order) { | |
| 809 | 856 | return __atomic_fetch_sub(&__a->__a_value, __delta * __skip_amt<_Tp>::value, |
| 810 | __gcc_atomic::__to_gcc_order(__order)); | |
| 857 | __to_gcc_order(__order)); | |
| 811 | 858 | } |
| 812 | 859 | |
| 813 | 860 | template <typename _Tp> |
| 814 | static inline _Tp __c11_atomic_fetch_and(volatile _Atomic(_Tp)* __a, | |
| 815 | _Tp __pattern, memory_order __order) { | |
| 861 | _LIBCPP_INLINE_VISIBILITY | |
| 862 | _Tp __cxx_atomic_fetch_and(volatile __cxx_atomic_base_impl<_Tp>* __a, | |
| 863 | _Tp __pattern, memory_order __order) { | |
| 816 | 864 | return __atomic_fetch_and(&__a->__a_value, __pattern, |
| 817 | __gcc_atomic::__to_gcc_order(__order)); | |
| 865 | __to_gcc_order(__order)); | |
| 818 | 866 | } |
| 819 | 867 | |
| 820 | 868 | template <typename _Tp> |
| 821 | static inline _Tp __c11_atomic_fetch_and(_Atomic(_Tp)* __a, | |
| 822 | _Tp __pattern, memory_order __order) { | |
| 869 | _LIBCPP_INLINE_VISIBILITY | |
| 870 | _Tp __cxx_atomic_fetch_and(__cxx_atomic_base_impl<_Tp>* __a, | |
| 871 | _Tp __pattern, memory_order __order) { | |
| 823 | 872 | return __atomic_fetch_and(&__a->__a_value, __pattern, |
| 824 | __gcc_atomic::__to_gcc_order(__order)); | |
| 873 | __to_gcc_order(__order)); | |
| 825 | 874 | } |
| 826 | 875 | |
| 827 | 876 | template <typename _Tp> |
| 828 | static inline _Tp __c11_atomic_fetch_or(volatile _Atomic(_Tp)* __a, | |
| 829 | _Tp __pattern, memory_order __order) { | |
| 877 | _LIBCPP_INLINE_VISIBILITY | |
| 878 | _Tp __cxx_atomic_fetch_or(volatile __cxx_atomic_base_impl<_Tp>* __a, | |
| 879 | _Tp __pattern, memory_order __order) { | |
| 830 | 880 | return __atomic_fetch_or(&__a->__a_value, __pattern, |
| 831 | __gcc_atomic::__to_gcc_order(__order)); | |
| 881 | __to_gcc_order(__order)); | |
| 832 | 882 | } |
| 833 | 883 | |
| 834 | 884 | template <typename _Tp> |
| 835 | static inline _Tp __c11_atomic_fetch_or(_Atomic(_Tp)* __a, _Tp __pattern, | |
| 836 | memory_order __order) { | |
| 885 | _LIBCPP_INLINE_VISIBILITY | |
| 886 | _Tp __cxx_atomic_fetch_or(__cxx_atomic_base_impl<_Tp>* __a, _Tp __pattern, | |
| 887 | memory_order __order) { | |
| 837 | 888 | return __atomic_fetch_or(&__a->__a_value, __pattern, |
| 838 | __gcc_atomic::__to_gcc_order(__order)); | |
| 889 | __to_gcc_order(__order)); | |
| 839 | 890 | } |
| 840 | 891 | |
| 841 | 892 | template <typename _Tp> |
| 842 | static inline _Tp __c11_atomic_fetch_xor(volatile _Atomic(_Tp)* __a, | |
| 843 | _Tp __pattern, memory_order __order) { | |
| 893 | _LIBCPP_INLINE_VISIBILITY | |
| 894 | _Tp __cxx_atomic_fetch_xor(volatile __cxx_atomic_base_impl<_Tp>* __a, | |
| 895 | _Tp __pattern, memory_order __order) { | |
| 844 | 896 | return __atomic_fetch_xor(&__a->__a_value, __pattern, |
| 845 | __gcc_atomic::__to_gcc_order(__order)); | |
| 897 | __to_gcc_order(__order)); | |
| 846 | 898 | } |
| 847 | 899 | |
| 848 | 900 | template <typename _Tp> |
| 849 | static inline _Tp __c11_atomic_fetch_xor(_Atomic(_Tp)* __a, _Tp __pattern, | |
| 850 | memory_order __order) { | |
| 901 | _LIBCPP_INLINE_VISIBILITY | |
| 902 | _Tp __cxx_atomic_fetch_xor(__cxx_atomic_base_impl<_Tp>* __a, _Tp __pattern, | |
| 903 | memory_order __order) { | |
| 851 | 904 | return __atomic_fetch_xor(&__a->__a_value, __pattern, |
| 852 | __gcc_atomic::__to_gcc_order(__order)); | |
| 905 | __to_gcc_order(__order)); | |
| 906 | } | |
| 907 | ||
| 908 | #define __cxx_atomic_is_lock_free(__s) __atomic_is_lock_free(__s, 0) | |
| 909 | ||
| 910 | #elif defined(_LIBCPP_HAS_C_ATOMIC_IMP) | |
| 911 | ||
| 912 | template <typename _Tp> | |
| 913 | struct __cxx_atomic_base_impl { | |
| 914 | ||
| 915 | _LIBCPP_INLINE_VISIBILITY | |
| 916 | #ifndef _LIBCPP_CXX03_LANG | |
| 917 | __cxx_atomic_base_impl() _NOEXCEPT = default; | |
| 918 | #else | |
| 919 | __cxx_atomic_base_impl() _NOEXCEPT : __a_value() {} | |
| 920 | #endif // _LIBCPP_CXX03_LANG | |
| 921 | _LIBCPP_CONSTEXPR explicit __cxx_atomic_base_impl(_Tp value) _NOEXCEPT | |
| 922 | : __a_value(value) {} | |
| 923 | _Atomic(_Tp) __a_value; | |
| 924 | }; | |
| 925 | ||
| 926 | #define __cxx_atomic_is_lock_free(__s) __c11_atomic_is_lock_free(__s) | |
| 927 | ||
| 928 | _LIBCPP_INLINE_VISIBILITY inline | |
| 929 | void __cxx_atomic_thread_fence(memory_order __order) _NOEXCEPT { | |
| 930 | __c11_atomic_thread_fence(static_cast<__memory_order_underlying_t>(__order)); | |
| 931 | } | |
| 932 | ||
| 933 | _LIBCPP_INLINE_VISIBILITY inline | |
| 934 | void __cxx_atomic_signal_fence(memory_order __order) _NOEXCEPT { | |
| 935 | __c11_atomic_signal_fence(static_cast<__memory_order_underlying_t>(__order)); | |
| 936 | } | |
| 937 | ||
| 938 | template<class _Tp> | |
| 939 | _LIBCPP_INLINE_VISIBILITY | |
| 940 | void __cxx_atomic_init(__cxx_atomic_base_impl<_Tp> volatile* __a, _Tp __val) _NOEXCEPT { | |
| 941 | __c11_atomic_init(&__a->__a_value, __val); | |
| 942 | } | |
| 943 | template<class _Tp> | |
| 944 | _LIBCPP_INLINE_VISIBILITY | |
| 945 | void __cxx_atomic_init(__cxx_atomic_base_impl<_Tp> * __a, _Tp __val) _NOEXCEPT { | |
| 946 | __c11_atomic_init(&__a->__a_value, __val); | |
| 947 | } | |
| 948 | ||
| 949 | template<class _Tp> | |
| 950 | _LIBCPP_INLINE_VISIBILITY | |
| 951 | void __cxx_atomic_store(__cxx_atomic_base_impl<_Tp> volatile* __a, _Tp __val, memory_order __order) _NOEXCEPT { | |
| 952 | __c11_atomic_store(&__a->__a_value, __val, static_cast<__memory_order_underlying_t>(__order)); | |
| 953 | } | |
| 954 | template<class _Tp> | |
| 955 | _LIBCPP_INLINE_VISIBILITY | |
| 956 | void __cxx_atomic_store(__cxx_atomic_base_impl<_Tp> * __a, _Tp __val, memory_order __order) _NOEXCEPT { | |
| 957 | __c11_atomic_store(&__a->__a_value, __val, static_cast<__memory_order_underlying_t>(__order)); | |
| 958 | } | |
| 959 | ||
| 960 | template<class _Tp> | |
| 961 | _LIBCPP_INLINE_VISIBILITY | |
| 962 | _Tp __cxx_atomic_load(__cxx_atomic_base_impl<_Tp> const volatile* __a, memory_order __order) _NOEXCEPT { | |
| 963 | using __ptr_type = typename remove_const<decltype(__a->__a_value)>::type*; | |
| 964 | return __c11_atomic_load(const_cast<__ptr_type>(&__a->__a_value), static_cast<__memory_order_underlying_t>(__order)); | |
| 965 | } | |
| 966 | template<class _Tp> | |
| 967 | _LIBCPP_INLINE_VISIBILITY | |
| 968 | _Tp __cxx_atomic_load(__cxx_atomic_base_impl<_Tp> const* __a, memory_order __order) _NOEXCEPT { | |
| 969 | using __ptr_type = typename remove_const<decltype(__a->__a_value)>::type*; | |
| 970 | return __c11_atomic_load(const_cast<__ptr_type>(&__a->__a_value), static_cast<__memory_order_underlying_t>(__order)); | |
| 971 | } | |
| 972 | ||
| 973 | template<class _Tp> | |
| 974 | _LIBCPP_INLINE_VISIBILITY | |
| 975 | _Tp __cxx_atomic_exchange(__cxx_atomic_base_impl<_Tp> volatile* __a, _Tp __value, memory_order __order) _NOEXCEPT { | |
| 976 | return __c11_atomic_exchange(&__a->__a_value, __value, static_cast<__memory_order_underlying_t>(__order)); | |
| 977 | } | |
| 978 | template<class _Tp> | |
| 979 | _LIBCPP_INLINE_VISIBILITY | |
| 980 | _Tp __cxx_atomic_exchange(__cxx_atomic_base_impl<_Tp> * __a, _Tp __value, memory_order __order) _NOEXCEPT { | |
| 981 | return __c11_atomic_exchange(&__a->__a_value, __value, static_cast<__memory_order_underlying_t>(__order)); | |
| 982 | } | |
| 983 | ||
| 984 | template<class _Tp> | |
| 985 | _LIBCPP_INLINE_VISIBILITY | |
| 986 | bool __cxx_atomic_compare_exchange_strong(__cxx_atomic_base_impl<_Tp> volatile* __a, _Tp* __expected, _Tp __value, memory_order __success, memory_order __failure) _NOEXCEPT { | |
| 987 | return __c11_atomic_compare_exchange_strong(&__a->__a_value, __expected, __value, static_cast<__memory_order_underlying_t>(__success), static_cast<__memory_order_underlying_t>(__failure)); | |
| 988 | } | |
| 989 | template<class _Tp> | |
| 990 | _LIBCPP_INLINE_VISIBILITY | |
| 991 | bool __cxx_atomic_compare_exchange_strong(__cxx_atomic_base_impl<_Tp> * __a, _Tp* __expected, _Tp __value, memory_order __success, memory_order __failure) _NOEXCEPT { | |
| 992 | return __c11_atomic_compare_exchange_strong(&__a->__a_value, __expected, __value, static_cast<__memory_order_underlying_t>(__success), static_cast<__memory_order_underlying_t>(__failure)); | |
| 993 | } | |
| 994 | ||
| 995 | template<class _Tp> | |
| 996 | _LIBCPP_INLINE_VISIBILITY | |
| 997 | bool __cxx_atomic_compare_exchange_weak(__cxx_atomic_base_impl<_Tp> volatile* __a, _Tp* __expected, _Tp __value, memory_order __success, memory_order __failure) _NOEXCEPT { | |
| 998 | return __c11_atomic_compare_exchange_weak(&__a->__a_value, __expected, __value, static_cast<__memory_order_underlying_t>(__success), static_cast<__memory_order_underlying_t>(__failure)); | |
| 999 | } | |
| 1000 | template<class _Tp> | |
| 1001 | _LIBCPP_INLINE_VISIBILITY | |
| 1002 | bool __cxx_atomic_compare_exchange_weak(__cxx_atomic_base_impl<_Tp> * __a, _Tp* __expected, _Tp __value, memory_order __success, memory_order __failure) _NOEXCEPT { | |
| 1003 | return __c11_atomic_compare_exchange_weak(&__a->__a_value, __expected, __value, static_cast<__memory_order_underlying_t>(__success), static_cast<__memory_order_underlying_t>(__failure)); | |
| 1004 | } | |
| 1005 | ||
| 1006 | template<class _Tp> | |
| 1007 | _LIBCPP_INLINE_VISIBILITY | |
| 1008 | _Tp __cxx_atomic_fetch_add(__cxx_atomic_base_impl<_Tp> volatile* __a, _Tp __delta, memory_order __order) _NOEXCEPT { | |
| 1009 | return __c11_atomic_fetch_add(&__a->__a_value, __delta, static_cast<__memory_order_underlying_t>(__order)); | |
| 1010 | } | |
| 1011 | template<class _Tp> | |
| 1012 | _LIBCPP_INLINE_VISIBILITY | |
| 1013 | _Tp __cxx_atomic_fetch_add(__cxx_atomic_base_impl<_Tp> * __a, _Tp __delta, memory_order __order) _NOEXCEPT { | |
| 1014 | return __c11_atomic_fetch_add(&__a->__a_value, __delta, static_cast<__memory_order_underlying_t>(__order)); | |
| 1015 | } | |
| 1016 | ||
| 1017 | template<class _Tp> | |
| 1018 | _LIBCPP_INLINE_VISIBILITY | |
| 1019 | _Tp* __cxx_atomic_fetch_add(__cxx_atomic_base_impl<_Tp*> volatile* __a, ptrdiff_t __delta, memory_order __order) _NOEXCEPT { | |
| 1020 | return __c11_atomic_fetch_add(&__a->__a_value, __delta, static_cast<__memory_order_underlying_t>(__order)); | |
| 853 | 1021 | } |
| 854 | #endif // _LIBCPP_HAS_GCC_ATOMIC_IMP | |
| 1022 | template<class _Tp> | |
| 1023 | _LIBCPP_INLINE_VISIBILITY | |
| 1024 | _Tp* __cxx_atomic_fetch_add(__cxx_atomic_base_impl<_Tp*> * __a, ptrdiff_t __delta, memory_order __order) _NOEXCEPT { | |
| 1025 | return __c11_atomic_fetch_add(&__a->__a_value, __delta, static_cast<__memory_order_underlying_t>(__order)); | |
| 1026 | } | |
| 1027 | ||
| 1028 | template<class _Tp> | |
| 1029 | _LIBCPP_INLINE_VISIBILITY | |
| 1030 | _Tp __cxx_atomic_fetch_sub(__cxx_atomic_base_impl<_Tp> volatile* __a, _Tp __delta, memory_order __order) _NOEXCEPT { | |
| 1031 | return __c11_atomic_fetch_sub(&__a->__a_value, __delta, static_cast<__memory_order_underlying_t>(__order)); | |
| 1032 | } | |
| 1033 | template<class _Tp> | |
| 1034 | _LIBCPP_INLINE_VISIBILITY | |
| 1035 | _Tp __cxx_atomic_fetch_sub(__cxx_atomic_base_impl<_Tp> * __a, _Tp __delta, memory_order __order) _NOEXCEPT { | |
| 1036 | return __c11_atomic_fetch_sub(&__a->__a_value, __delta, static_cast<__memory_order_underlying_t>(__order)); | |
| 1037 | } | |
| 1038 | template<class _Tp> | |
| 1039 | _LIBCPP_INLINE_VISIBILITY | |
| 1040 | _Tp* __cxx_atomic_fetch_sub(__cxx_atomic_base_impl<_Tp*> volatile* __a, ptrdiff_t __delta, memory_order __order) _NOEXCEPT { | |
| 1041 | return __c11_atomic_fetch_sub(&__a->__a_value, __delta, static_cast<__memory_order_underlying_t>(__order)); | |
| 1042 | } | |
| 1043 | template<class _Tp> | |
| 1044 | _LIBCPP_INLINE_VISIBILITY | |
| 1045 | _Tp* __cxx_atomic_fetch_sub(__cxx_atomic_base_impl<_Tp*> * __a, ptrdiff_t __delta, memory_order __order) _NOEXCEPT { | |
| 1046 | return __c11_atomic_fetch_sub(&__a->__a_value, __delta, static_cast<__memory_order_underlying_t>(__order)); | |
| 1047 | } | |
| 1048 | ||
| 1049 | template<class _Tp> | |
| 1050 | _LIBCPP_INLINE_VISIBILITY | |
| 1051 | _Tp __cxx_atomic_fetch_and(__cxx_atomic_base_impl<_Tp> volatile* __a, _Tp __pattern, memory_order __order) _NOEXCEPT { | |
| 1052 | return __c11_atomic_fetch_and(&__a->__a_value, __pattern, static_cast<__memory_order_underlying_t>(__order)); | |
| 1053 | } | |
| 1054 | template<class _Tp> | |
| 1055 | _LIBCPP_INLINE_VISIBILITY | |
| 1056 | _Tp __cxx_atomic_fetch_and(__cxx_atomic_base_impl<_Tp> * __a, _Tp __pattern, memory_order __order) _NOEXCEPT { | |
| 1057 | return __c11_atomic_fetch_and(&__a->__a_value, __pattern, static_cast<__memory_order_underlying_t>(__order)); | |
| 1058 | } | |
| 1059 | ||
| 1060 | template<class _Tp> | |
| 1061 | _LIBCPP_INLINE_VISIBILITY | |
| 1062 | _Tp __cxx_atomic_fetch_or(__cxx_atomic_base_impl<_Tp> volatile* __a, _Tp __pattern, memory_order __order) _NOEXCEPT { | |
| 1063 | return __c11_atomic_fetch_or(&__a->__a_value, __pattern, static_cast<__memory_order_underlying_t>(__order)); | |
| 1064 | } | |
| 1065 | template<class _Tp> | |
| 1066 | _LIBCPP_INLINE_VISIBILITY | |
| 1067 | _Tp __cxx_atomic_fetch_or(__cxx_atomic_base_impl<_Tp> * __a, _Tp __pattern, memory_order __order) _NOEXCEPT { | |
| 1068 | return __c11_atomic_fetch_or(&__a->__a_value, __pattern, static_cast<__memory_order_underlying_t>(__order)); | |
| 1069 | } | |
| 1070 | ||
| 1071 | template<class _Tp> | |
| 1072 | _LIBCPP_INLINE_VISIBILITY | |
| 1073 | _Tp __cxx_atomic_fetch_xor(__cxx_atomic_base_impl<_Tp> volatile* __a, _Tp __pattern, memory_order __order) _NOEXCEPT { | |
| 1074 | return __c11_atomic_fetch_xor(&__a->__a_value, __pattern, static_cast<__memory_order_underlying_t>(__order)); | |
| 1075 | } | |
| 1076 | template<class _Tp> | |
| 1077 | _LIBCPP_INLINE_VISIBILITY | |
| 1078 | _Tp __cxx_atomic_fetch_xor(__cxx_atomic_base_impl<_Tp> * __a, _Tp __pattern, memory_order __order) _NOEXCEPT { | |
| 1079 | return __c11_atomic_fetch_xor(&__a->__a_value, __pattern, static_cast<__memory_order_underlying_t>(__order)); | |
| 1080 | } | |
| 1081 | ||
| 1082 | #endif // _LIBCPP_HAS_GCC_ATOMIC_IMP, _LIBCPP_HAS_C_ATOMIC_IMP | |
| 855 | 1083 | |
| 856 | 1084 | template <class _Tp> |
| 857 | inline _LIBCPP_INLINE_VISIBILITY | |
| 858 | _Tp | |
| 859 | kill_dependency(_Tp __y) _NOEXCEPT | |
| 1085 | _LIBCPP_INLINE_VISIBILITY | |
| 1086 | _Tp kill_dependency(_Tp __y) _NOEXCEPT | |
| 860 | 1087 | { |
| 861 | 1088 | return __y; |
| 862 | 1089 | } |
| ... | ... | @@ -872,7 +1099,7 @@ kill_dependency(_Tp __y) _NOEXCEPT |
| 872 | 1099 | # define ATOMIC_LONG_LOCK_FREE __CLANG_ATOMIC_LONG_LOCK_FREE |
| 873 | 1100 | # define ATOMIC_LLONG_LOCK_FREE __CLANG_ATOMIC_LLONG_LOCK_FREE |
| 874 | 1101 | # define ATOMIC_POINTER_LOCK_FREE __CLANG_ATOMIC_POINTER_LOCK_FREE |
| 875 | #else | |
| 1102 | #elif defined(__GCC_ATOMIC_BOOL_LOCK_FREE) | |
| 876 | 1103 | # define ATOMIC_BOOL_LOCK_FREE __GCC_ATOMIC_BOOL_LOCK_FREE |
| 877 | 1104 | # define ATOMIC_CHAR_LOCK_FREE __GCC_ATOMIC_CHAR_LOCK_FREE |
| 878 | 1105 | # define ATOMIC_CHAR16_T_LOCK_FREE __GCC_ATOMIC_CHAR16_T_LOCK_FREE |
| ... | ... | @@ -885,12 +1112,352 @@ kill_dependency(_Tp __y) _NOEXCEPT |
| 885 | 1112 | # define ATOMIC_POINTER_LOCK_FREE __GCC_ATOMIC_POINTER_LOCK_FREE |
| 886 | 1113 | #endif |
| 887 | 1114 | |
| 1115 | #ifdef _LIBCPP_ATOMIC_ONLY_USE_BUILTINS | |
| 1116 | ||
| 1117 | template<typename _Tp> | |
| 1118 | struct __cxx_atomic_lock_impl { | |
| 1119 | ||
| 1120 | _LIBCPP_INLINE_VISIBILITY | |
| 1121 | __cxx_atomic_lock_impl() _NOEXCEPT | |
| 1122 | : __a_value(), __a_lock(0) {} | |
| 1123 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR explicit | |
| 1124 | __cxx_atomic_lock_impl(_Tp value) _NOEXCEPT | |
| 1125 | : __a_value(value), __a_lock(0) {} | |
| 1126 | ||
| 1127 | _Tp __a_value; | |
| 1128 | mutable __cxx_atomic_base_impl<_LIBCPP_ATOMIC_FLAG_TYPE> __a_lock; | |
| 1129 | ||
| 1130 | _LIBCPP_INLINE_VISIBILITY void __lock() const volatile { | |
| 1131 | while(1 == __cxx_atomic_exchange(&__a_lock, _LIBCPP_ATOMIC_FLAG_TYPE(true), memory_order_acquire)) | |
| 1132 | /*spin*/; | |
| 1133 | } | |
| 1134 | _LIBCPP_INLINE_VISIBILITY void __lock() const { | |
| 1135 | while(1 == __cxx_atomic_exchange(&__a_lock, _LIBCPP_ATOMIC_FLAG_TYPE(true), memory_order_acquire)) | |
| 1136 | /*spin*/; | |
| 1137 | } | |
| 1138 | _LIBCPP_INLINE_VISIBILITY void __unlock() const volatile { | |
| 1139 | __cxx_atomic_store(&__a_lock, _LIBCPP_ATOMIC_FLAG_TYPE(false), memory_order_release); | |
| 1140 | } | |
| 1141 | _LIBCPP_INLINE_VISIBILITY void __unlock() const { | |
| 1142 | __cxx_atomic_store(&__a_lock, _LIBCPP_ATOMIC_FLAG_TYPE(false), memory_order_release); | |
| 1143 | } | |
| 1144 | _LIBCPP_INLINE_VISIBILITY _Tp __read() const volatile { | |
| 1145 | __lock(); | |
| 1146 | _Tp __old; | |
| 1147 | __cxx_atomic_assign_volatile(__old, __a_value); | |
| 1148 | __unlock(); | |
| 1149 | return __old; | |
| 1150 | } | |
| 1151 | _LIBCPP_INLINE_VISIBILITY _Tp __read() const { | |
| 1152 | __lock(); | |
| 1153 | _Tp __old = __a_value; | |
| 1154 | __unlock(); | |
| 1155 | return __old; | |
| 1156 | } | |
| 1157 | }; | |
| 1158 | ||
| 1159 | template <typename _Tp> | |
| 1160 | _LIBCPP_INLINE_VISIBILITY | |
| 1161 | void __cxx_atomic_init(volatile __cxx_atomic_lock_impl<_Tp>* __a, _Tp __val) { | |
| 1162 | __cxx_atomic_assign_volatile(__a->__a_value, __val); | |
| 1163 | } | |
| 1164 | template <typename _Tp> | |
| 1165 | _LIBCPP_INLINE_VISIBILITY | |
| 1166 | void __cxx_atomic_init(__cxx_atomic_lock_impl<_Tp>* __a, _Tp __val) { | |
| 1167 | __a->__a_value = __val; | |
| 1168 | } | |
| 1169 | ||
| 1170 | template <typename _Tp> | |
| 1171 | _LIBCPP_INLINE_VISIBILITY | |
| 1172 | void __cxx_atomic_store(volatile __cxx_atomic_lock_impl<_Tp>* __a, _Tp __val, memory_order) { | |
| 1173 | __a->__lock(); | |
| 1174 | __cxx_atomic_assign_volatile(__a->__a_value, __val); | |
| 1175 | __a->__unlock(); | |
| 1176 | } | |
| 1177 | template <typename _Tp> | |
| 1178 | _LIBCPP_INLINE_VISIBILITY | |
| 1179 | void __cxx_atomic_store(__cxx_atomic_lock_impl<_Tp>* __a, _Tp __val, memory_order) { | |
| 1180 | __a->__lock(); | |
| 1181 | __a->__a_value = __val; | |
| 1182 | __a->__unlock(); | |
| 1183 | } | |
| 1184 | ||
| 1185 | template <typename _Tp> | |
| 1186 | _LIBCPP_INLINE_VISIBILITY | |
| 1187 | _Tp __cxx_atomic_load(const volatile __cxx_atomic_lock_impl<_Tp>* __a, memory_order) { | |
| 1188 | return __a->__read(); | |
| 1189 | } | |
| 1190 | template <typename _Tp> | |
| 1191 | _LIBCPP_INLINE_VISIBILITY | |
| 1192 | _Tp __cxx_atomic_load(const __cxx_atomic_lock_impl<_Tp>* __a, memory_order) { | |
| 1193 | return __a->__read(); | |
| 1194 | } | |
| 1195 | ||
| 1196 | template <typename _Tp> | |
| 1197 | _LIBCPP_INLINE_VISIBILITY | |
| 1198 | _Tp __cxx_atomic_exchange(volatile __cxx_atomic_lock_impl<_Tp>* __a, _Tp __value, memory_order) { | |
| 1199 | __a->__lock(); | |
| 1200 | _Tp __old; | |
| 1201 | __cxx_atomic_assign_volatile(__old, __a->__a_value); | |
| 1202 | __cxx_atomic_assign_volatile(__a->__a_value, __value); | |
| 1203 | __a->__unlock(); | |
| 1204 | return __old; | |
| 1205 | } | |
| 1206 | template <typename _Tp> | |
| 1207 | _LIBCPP_INLINE_VISIBILITY | |
| 1208 | _Tp __cxx_atomic_exchange(__cxx_atomic_lock_impl<_Tp>* __a, _Tp __value, memory_order) { | |
| 1209 | __a->__lock(); | |
| 1210 | _Tp __old = __a->__a_value; | |
| 1211 | __a->__a_value = __value; | |
| 1212 | __a->__unlock(); | |
| 1213 | return __old; | |
| 1214 | } | |
| 1215 | ||
| 1216 | template <typename _Tp> | |
| 1217 | _LIBCPP_INLINE_VISIBILITY | |
| 1218 | bool __cxx_atomic_compare_exchange_strong(volatile __cxx_atomic_lock_impl<_Tp>* __a, | |
| 1219 | _Tp* __expected, _Tp __value, memory_order, memory_order) { | |
| 1220 | __a->__lock(); | |
| 1221 | _Tp temp; | |
| 1222 | __cxx_atomic_assign_volatile(temp, __a->__a_value); | |
| 1223 | bool __ret = temp == *__expected; | |
| 1224 | if(__ret) | |
| 1225 | __cxx_atomic_assign_volatile(__a->__a_value, __value); | |
| 1226 | else | |
| 1227 | __cxx_atomic_assign_volatile(*__expected, __a->__a_value); | |
| 1228 | __a->__unlock(); | |
| 1229 | return __ret; | |
| 1230 | } | |
| 1231 | template <typename _Tp> | |
| 1232 | _LIBCPP_INLINE_VISIBILITY | |
| 1233 | bool __cxx_atomic_compare_exchange_strong(__cxx_atomic_lock_impl<_Tp>* __a, | |
| 1234 | _Tp* __expected, _Tp __value, memory_order, memory_order) { | |
| 1235 | __a->__lock(); | |
| 1236 | bool __ret = __a->__a_value == *__expected; | |
| 1237 | if(__ret) | |
| 1238 | __a->__a_value = __value; | |
| 1239 | else | |
| 1240 | *__expected = __a->__a_value; | |
| 1241 | __a->__unlock(); | |
| 1242 | return __ret; | |
| 1243 | } | |
| 1244 | ||
| 1245 | template <typename _Tp> | |
| 1246 | _LIBCPP_INLINE_VISIBILITY | |
| 1247 | bool __cxx_atomic_compare_exchange_weak(volatile __cxx_atomic_lock_impl<_Tp>* __a, | |
| 1248 | _Tp* __expected, _Tp __value, memory_order, memory_order) { | |
| 1249 | __a->__lock(); | |
| 1250 | _Tp temp; | |
| 1251 | __cxx_atomic_assign_volatile(temp, __a->__a_value); | |
| 1252 | bool __ret = temp == *__expected; | |
| 1253 | if(__ret) | |
| 1254 | __cxx_atomic_assign_volatile(__a->__a_value, __value); | |
| 1255 | else | |
| 1256 | __cxx_atomic_assign_volatile(*__expected, __a->__a_value); | |
| 1257 | __a->__unlock(); | |
| 1258 | return __ret; | |
| 1259 | } | |
| 1260 | template <typename _Tp> | |
| 1261 | _LIBCPP_INLINE_VISIBILITY | |
| 1262 | bool __cxx_atomic_compare_exchange_weak(__cxx_atomic_lock_impl<_Tp>* __a, | |
| 1263 | _Tp* __expected, _Tp __value, memory_order, memory_order) { | |
| 1264 | __a->__lock(); | |
| 1265 | bool __ret = __a->__a_value == *__expected; | |
| 1266 | if(__ret) | |
| 1267 | __a->__a_value = __value; | |
| 1268 | else | |
| 1269 | *__expected = __a->__a_value; | |
| 1270 | __a->__unlock(); | |
| 1271 | return __ret; | |
| 1272 | } | |
| 1273 | ||
| 1274 | template <typename _Tp, typename _Td> | |
| 1275 | _LIBCPP_INLINE_VISIBILITY | |
| 1276 | _Tp __cxx_atomic_fetch_add(volatile __cxx_atomic_lock_impl<_Tp>* __a, | |
| 1277 | _Td __delta, memory_order) { | |
| 1278 | __a->__lock(); | |
| 1279 | _Tp __old; | |
| 1280 | __cxx_atomic_assign_volatile(__old, __a->__a_value); | |
| 1281 | __cxx_atomic_assign_volatile(__a->__a_value, _Tp(__old + __delta)); | |
| 1282 | __a->__unlock(); | |
| 1283 | return __old; | |
| 1284 | } | |
| 1285 | template <typename _Tp, typename _Td> | |
| 1286 | _LIBCPP_INLINE_VISIBILITY | |
| 1287 | _Tp __cxx_atomic_fetch_add(__cxx_atomic_lock_impl<_Tp>* __a, | |
| 1288 | _Td __delta, memory_order) { | |
| 1289 | __a->__lock(); | |
| 1290 | _Tp __old = __a->__a_value; | |
| 1291 | __a->__a_value += __delta; | |
| 1292 | __a->__unlock(); | |
| 1293 | return __old; | |
| 1294 | } | |
| 1295 | ||
| 1296 | template <typename _Tp, typename _Td> | |
| 1297 | _LIBCPP_INLINE_VISIBILITY | |
| 1298 | _Tp* __cxx_atomic_fetch_add(volatile __cxx_atomic_lock_impl<_Tp*>* __a, | |
| 1299 | ptrdiff_t __delta, memory_order) { | |
| 1300 | __a->__lock(); | |
| 1301 | _Tp* __old; | |
| 1302 | __cxx_atomic_assign_volatile(__old, __a->__a_value); | |
| 1303 | __cxx_atomic_assign_volatile(__a->__a_value, __old + __delta); | |
| 1304 | __a->__unlock(); | |
| 1305 | return __old; | |
| 1306 | } | |
| 1307 | template <typename _Tp, typename _Td> | |
| 1308 | _LIBCPP_INLINE_VISIBILITY | |
| 1309 | _Tp* __cxx_atomic_fetch_add(__cxx_atomic_lock_impl<_Tp*>* __a, | |
| 1310 | ptrdiff_t __delta, memory_order) { | |
| 1311 | __a->__lock(); | |
| 1312 | _Tp* __old = __a->__a_value; | |
| 1313 | __a->__a_value += __delta; | |
| 1314 | __a->__unlock(); | |
| 1315 | return __old; | |
| 1316 | } | |
| 1317 | ||
| 1318 | template <typename _Tp, typename _Td> | |
| 1319 | _LIBCPP_INLINE_VISIBILITY | |
| 1320 | _Tp __cxx_atomic_fetch_sub(volatile __cxx_atomic_lock_impl<_Tp>* __a, | |
| 1321 | _Td __delta, memory_order) { | |
| 1322 | __a->__lock(); | |
| 1323 | _Tp __old; | |
| 1324 | __cxx_atomic_assign_volatile(__old, __a->__a_value); | |
| 1325 | __cxx_atomic_assign_volatile(__a->__a_value, _Tp(__old - __delta)); | |
| 1326 | __a->__unlock(); | |
| 1327 | return __old; | |
| 1328 | } | |
| 1329 | template <typename _Tp, typename _Td> | |
| 1330 | _LIBCPP_INLINE_VISIBILITY | |
| 1331 | _Tp __cxx_atomic_fetch_sub(__cxx_atomic_lock_impl<_Tp>* __a, | |
| 1332 | _Td __delta, memory_order) { | |
| 1333 | __a->__lock(); | |
| 1334 | _Tp __old = __a->__a_value; | |
| 1335 | __a->__a_value -= __delta; | |
| 1336 | __a->__unlock(); | |
| 1337 | return __old; | |
| 1338 | } | |
| 1339 | ||
| 1340 | template <typename _Tp> | |
| 1341 | _LIBCPP_INLINE_VISIBILITY | |
| 1342 | _Tp __cxx_atomic_fetch_and(volatile __cxx_atomic_lock_impl<_Tp>* __a, | |
| 1343 | _Tp __pattern, memory_order) { | |
| 1344 | __a->__lock(); | |
| 1345 | _Tp __old; | |
| 1346 | __cxx_atomic_assign_volatile(__old, __a->__a_value); | |
| 1347 | __cxx_atomic_assign_volatile(__a->__a_value, _Tp(__old & __pattern)); | |
| 1348 | __a->__unlock(); | |
| 1349 | return __old; | |
| 1350 | } | |
| 1351 | template <typename _Tp> | |
| 1352 | _LIBCPP_INLINE_VISIBILITY | |
| 1353 | _Tp __cxx_atomic_fetch_and(__cxx_atomic_lock_impl<_Tp>* __a, | |
| 1354 | _Tp __pattern, memory_order) { | |
| 1355 | __a->__lock(); | |
| 1356 | _Tp __old = __a->__a_value; | |
| 1357 | __a->__a_value &= __pattern; | |
| 1358 | __a->__unlock(); | |
| 1359 | return __old; | |
| 1360 | } | |
| 1361 | ||
| 1362 | template <typename _Tp> | |
| 1363 | _LIBCPP_INLINE_VISIBILITY | |
| 1364 | _Tp __cxx_atomic_fetch_or(volatile __cxx_atomic_lock_impl<_Tp>* __a, | |
| 1365 | _Tp __pattern, memory_order) { | |
| 1366 | __a->__lock(); | |
| 1367 | _Tp __old; | |
| 1368 | __cxx_atomic_assign_volatile(__old, __a->__a_value); | |
| 1369 | __cxx_atomic_assign_volatile(__a->__a_value, _Tp(__old | __pattern)); | |
| 1370 | __a->__unlock(); | |
| 1371 | return __old; | |
| 1372 | } | |
| 1373 | template <typename _Tp> | |
| 1374 | _LIBCPP_INLINE_VISIBILITY | |
| 1375 | _Tp __cxx_atomic_fetch_or(__cxx_atomic_lock_impl<_Tp>* __a, | |
| 1376 | _Tp __pattern, memory_order) { | |
| 1377 | __a->__lock(); | |
| 1378 | _Tp __old = __a->__a_value; | |
| 1379 | __a->__a_value |= __pattern; | |
| 1380 | __a->__unlock(); | |
| 1381 | return __old; | |
| 1382 | } | |
| 1383 | ||
| 1384 | template <typename _Tp> | |
| 1385 | _LIBCPP_INLINE_VISIBILITY | |
| 1386 | _Tp __cxx_atomic_fetch_xor(volatile __cxx_atomic_lock_impl<_Tp>* __a, | |
| 1387 | _Tp __pattern, memory_order) { | |
| 1388 | __a->__lock(); | |
| 1389 | _Tp __old; | |
| 1390 | __cxx_atomic_assign_volatile(__old, __a->__a_value); | |
| 1391 | __cxx_atomic_assign_volatile(__a->__a_value, _Tp(__old ^ __pattern)); | |
| 1392 | __a->__unlock(); | |
| 1393 | return __old; | |
| 1394 | } | |
| 1395 | template <typename _Tp> | |
| 1396 | _LIBCPP_INLINE_VISIBILITY | |
| 1397 | _Tp __cxx_atomic_fetch_xor(__cxx_atomic_lock_impl<_Tp>* __a, | |
| 1398 | _Tp __pattern, memory_order) { | |
| 1399 | __a->__lock(); | |
| 1400 | _Tp __old = __a->__a_value; | |
| 1401 | __a->__a_value ^= __pattern; | |
| 1402 | __a->__unlock(); | |
| 1403 | return __old; | |
| 1404 | } | |
| 1405 | ||
| 1406 | #ifdef __cpp_lib_atomic_is_always_lock_free | |
| 1407 | ||
| 1408 | template<typename _Tp> struct __cxx_is_always_lock_free { | |
| 1409 | enum { __value = __atomic_always_lock_free(sizeof(_Tp), 0) }; }; | |
| 1410 | ||
| 1411 | #else | |
| 1412 | ||
| 1413 | template<typename _Tp> struct __cxx_is_always_lock_free { enum { __value = false }; }; | |
| 1414 | // Implementations must match the C ATOMIC_*_LOCK_FREE macro values. | |
| 1415 | template<> struct __cxx_is_always_lock_free<bool> { enum { __value = 2 == ATOMIC_BOOL_LOCK_FREE }; }; | |
| 1416 | template<> struct __cxx_is_always_lock_free<char> { enum { __value = 2 == ATOMIC_CHAR_LOCK_FREE }; }; | |
| 1417 | template<> struct __cxx_is_always_lock_free<signed char> { enum { __value = 2 == ATOMIC_CHAR_LOCK_FREE }; }; | |
| 1418 | template<> struct __cxx_is_always_lock_free<unsigned char> { enum { __value = 2 == ATOMIC_CHAR_LOCK_FREE }; }; | |
| 1419 | template<> struct __cxx_is_always_lock_free<char16_t> { enum { __value = 2 == ATOMIC_CHAR16_T_LOCK_FREE }; }; | |
| 1420 | template<> struct __cxx_is_always_lock_free<char32_t> { enum { __value = 2 == ATOMIC_CHAR32_T_LOCK_FREE }; }; | |
| 1421 | template<> struct __cxx_is_always_lock_free<wchar_t> { enum { __value = 2 == ATOMIC_WCHAR_T_LOCK_FREE }; }; | |
| 1422 | template<> struct __cxx_is_always_lock_free<short> { enum { __value = 2 == ATOMIC_SHORT_LOCK_FREE }; }; | |
| 1423 | template<> struct __cxx_is_always_lock_free<unsigned short> { enum { __value = 2 == ATOMIC_SHORT_LOCK_FREE }; }; | |
| 1424 | template<> struct __cxx_is_always_lock_free<int> { enum { __value = 2 == ATOMIC_INT_LOCK_FREE }; }; | |
| 1425 | template<> struct __cxx_is_always_lock_free<unsigned int> { enum { __value = 2 == ATOMIC_INT_LOCK_FREE }; }; | |
| 1426 | template<> struct __cxx_is_always_lock_free<long> { enum { __value = 2 == ATOMIC_LONG_LOCK_FREE }; }; | |
| 1427 | template<> struct __cxx_is_always_lock_free<unsigned long> { enum { __value = 2 == ATOMIC_LONG_LOCK_FREE }; }; | |
| 1428 | template<> struct __cxx_is_always_lock_free<long long> { enum { __value = 2 == ATOMIC_LLONG_LOCK_FREE }; }; | |
| 1429 | template<> struct __cxx_is_always_lock_free<unsigned long long> { enum { __value = 2 == ATOMIC_LLONG_LOCK_FREE }; }; | |
| 1430 | template<typename _Tp> struct __cxx_is_always_lock_free<_Tp*> { enum { __value = 2 == ATOMIC_POINTER_LOCK_FREE }; }; | |
| 1431 | template<> struct __cxx_is_always_lock_free<std::nullptr_t> { enum { __value = 2 == ATOMIC_POINTER_LOCK_FREE }; }; | |
| 1432 | ||
| 1433 | #endif //__cpp_lib_atomic_is_always_lock_free | |
| 1434 | ||
| 1435 | template <typename _Tp, | |
| 1436 | typename _Base = typename conditional<__cxx_is_always_lock_free<_Tp>::__value, | |
| 1437 | __cxx_atomic_base_impl<_Tp>, | |
| 1438 | __cxx_atomic_lock_impl<_Tp> >::type> | |
| 1439 | #else | |
| 1440 | template <typename _Tp, | |
| 1441 | typename _Base = __cxx_atomic_base_impl<_Tp> > | |
| 1442 | #endif //_LIBCPP_ATOMIC_ONLY_USE_BUILTINS | |
| 1443 | struct __cxx_atomic_impl : public _Base { | |
| 1444 | ||
| 1445 | #if _GNUC_VER >= 501 | |
| 1446 | static_assert(is_trivially_copyable<_Tp>::value, | |
| 1447 | "std::atomic<Tp> requires that 'Tp' be a trivially copyable type"); | |
| 1448 | #endif | |
| 1449 | ||
| 1450 | _LIBCPP_INLINE_VISIBILITY __cxx_atomic_impl() _NOEXCEPT _LIBCPP_DEFAULT | |
| 1451 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR explicit __cxx_atomic_impl(_Tp value) _NOEXCEPT | |
| 1452 | : _Base(value) {} | |
| 1453 | }; | |
| 1454 | ||
| 888 | 1455 | // general atomic<T> |
| 889 | 1456 | |
| 890 | 1457 | template <class _Tp, bool = is_integral<_Tp>::value && !is_same<_Tp, bool>::value> |
| 891 | 1458 | struct __atomic_base // false |
| 892 | 1459 | { |
| 893 | mutable _Atomic(_Tp) __a_; | |
| 1460 | mutable __cxx_atomic_impl<_Tp> __a_; | |
| 894 | 1461 | |
| 895 | 1462 | #if defined(__cpp_lib_atomic_is_always_lock_free) |
| 896 | 1463 | static _LIBCPP_CONSTEXPR bool is_always_lock_free = __atomic_always_lock_free(sizeof(__a_), 0); |
| ... | ... | @@ -898,88 +1465,79 @@ struct __atomic_base // false |
| 898 | 1465 | |
| 899 | 1466 | _LIBCPP_INLINE_VISIBILITY |
| 900 | 1467 | bool is_lock_free() const volatile _NOEXCEPT |
| 901 | { | |
| 902 | #if defined(_LIBCPP_HAS_C_ATOMIC_IMP) | |
| 903 | return __c11_atomic_is_lock_free(sizeof(_Tp)); | |
| 904 | #else | |
| 905 | return __atomic_is_lock_free(sizeof(_Tp), 0); | |
| 906 | #endif | |
| 907 | } | |
| 1468 | {return __cxx_atomic_is_lock_free(sizeof(_Tp));} | |
| 908 | 1469 | _LIBCPP_INLINE_VISIBILITY |
| 909 | 1470 | bool is_lock_free() const _NOEXCEPT |
| 910 | 1471 | {return static_cast<__atomic_base const volatile*>(this)->is_lock_free();} |
| 911 | 1472 | _LIBCPP_INLINE_VISIBILITY |
| 912 | 1473 | void store(_Tp __d, memory_order __m = memory_order_seq_cst) volatile _NOEXCEPT |
| 913 | 1474 | _LIBCPP_CHECK_STORE_MEMORY_ORDER(__m) |
| 914 | {__c11_atomic_store(&__a_, __d, __m);} | |
| 1475 | {__cxx_atomic_store(&__a_, __d, __m);} | |
| 915 | 1476 | _LIBCPP_INLINE_VISIBILITY |
| 916 | 1477 | void store(_Tp __d, memory_order __m = memory_order_seq_cst) _NOEXCEPT |
| 917 | 1478 | _LIBCPP_CHECK_STORE_MEMORY_ORDER(__m) |
| 918 | {__c11_atomic_store(&__a_, __d, __m);} | |
| 1479 | {__cxx_atomic_store(&__a_, __d, __m);} | |
| 919 | 1480 | _LIBCPP_INLINE_VISIBILITY |
| 920 | 1481 | _Tp load(memory_order __m = memory_order_seq_cst) const volatile _NOEXCEPT |
| 921 | 1482 | _LIBCPP_CHECK_LOAD_MEMORY_ORDER(__m) |
| 922 | {return __c11_atomic_load(&__a_, __m);} | |
| 1483 | {return __cxx_atomic_load(&__a_, __m);} | |
| 923 | 1484 | _LIBCPP_INLINE_VISIBILITY |
| 924 | 1485 | _Tp load(memory_order __m = memory_order_seq_cst) const _NOEXCEPT |
| 925 | 1486 | _LIBCPP_CHECK_LOAD_MEMORY_ORDER(__m) |
| 926 | {return __c11_atomic_load(&__a_, __m);} | |
| 1487 | {return __cxx_atomic_load(&__a_, __m);} | |
| 927 | 1488 | _LIBCPP_INLINE_VISIBILITY |
| 928 | 1489 | operator _Tp() const volatile _NOEXCEPT {return load();} |
| 929 | 1490 | _LIBCPP_INLINE_VISIBILITY |
| 930 | 1491 | operator _Tp() const _NOEXCEPT {return load();} |
| 931 | 1492 | _LIBCPP_INLINE_VISIBILITY |
| 932 | 1493 | _Tp exchange(_Tp __d, memory_order __m = memory_order_seq_cst) volatile _NOEXCEPT |
| 933 | {return __c11_atomic_exchange(&__a_, __d, __m);} | |
| 1494 | {return __cxx_atomic_exchange(&__a_, __d, __m);} | |
| 934 | 1495 | _LIBCPP_INLINE_VISIBILITY |
| 935 | 1496 | _Tp exchange(_Tp __d, memory_order __m = memory_order_seq_cst) _NOEXCEPT |
| 936 | {return __c11_atomic_exchange(&__a_, __d, __m);} | |
| 1497 | {return __cxx_atomic_exchange(&__a_, __d, __m);} | |
| 937 | 1498 | _LIBCPP_INLINE_VISIBILITY |
| 938 | 1499 | bool compare_exchange_weak(_Tp& __e, _Tp __d, |
| 939 | 1500 | memory_order __s, memory_order __f) volatile _NOEXCEPT |
| 940 | 1501 | _LIBCPP_CHECK_EXCHANGE_MEMORY_ORDER(__s, __f) |
| 941 | {return __c11_atomic_compare_exchange_weak(&__a_, &__e, __d, __s, __f);} | |
| 1502 | {return __cxx_atomic_compare_exchange_weak(&__a_, &__e, __d, __s, __f);} | |
| 942 | 1503 | _LIBCPP_INLINE_VISIBILITY |
| 943 | 1504 | bool compare_exchange_weak(_Tp& __e, _Tp __d, |
| 944 | 1505 | memory_order __s, memory_order __f) _NOEXCEPT |
| 945 | 1506 | _LIBCPP_CHECK_EXCHANGE_MEMORY_ORDER(__s, __f) |
| 946 | {return __c11_atomic_compare_exchange_weak(&__a_, &__e, __d, __s, __f);} | |
| 1507 | {return __cxx_atomic_compare_exchange_weak(&__a_, &__e, __d, __s, __f);} | |
| 947 | 1508 | _LIBCPP_INLINE_VISIBILITY |
| 948 | 1509 | bool compare_exchange_strong(_Tp& __e, _Tp __d, |
| 949 | 1510 | memory_order __s, memory_order __f) volatile _NOEXCEPT |
| 950 | 1511 | _LIBCPP_CHECK_EXCHANGE_MEMORY_ORDER(__s, __f) |
| 951 | {return __c11_atomic_compare_exchange_strong(&__a_, &__e, __d, __s, __f);} | |
| 1512 | {return __cxx_atomic_compare_exchange_strong(&__a_, &__e, __d, __s, __f);} | |
| 952 | 1513 | _LIBCPP_INLINE_VISIBILITY |
| 953 | 1514 | bool compare_exchange_strong(_Tp& __e, _Tp __d, |
| 954 | 1515 | memory_order __s, memory_order __f) _NOEXCEPT |
| 955 | 1516 | _LIBCPP_CHECK_EXCHANGE_MEMORY_ORDER(__s, __f) |
| 956 | {return __c11_atomic_compare_exchange_strong(&__a_, &__e, __d, __s, __f);} | |
| 1517 | {return __cxx_atomic_compare_exchange_strong(&__a_, &__e, __d, __s, __f);} | |
| 957 | 1518 | _LIBCPP_INLINE_VISIBILITY |
| 958 | 1519 | bool compare_exchange_weak(_Tp& __e, _Tp __d, |
| 959 | 1520 | memory_order __m = memory_order_seq_cst) volatile _NOEXCEPT |
| 960 | {return __c11_atomic_compare_exchange_weak(&__a_, &__e, __d, __m, __m);} | |
| 1521 | {return __cxx_atomic_compare_exchange_weak(&__a_, &__e, __d, __m, __m);} | |
| 961 | 1522 | _LIBCPP_INLINE_VISIBILITY |
| 962 | 1523 | bool compare_exchange_weak(_Tp& __e, _Tp __d, |
| 963 | 1524 | memory_order __m = memory_order_seq_cst) _NOEXCEPT |
| 964 | {return __c11_atomic_compare_exchange_weak(&__a_, &__e, __d, __m, __m);} | |
| 1525 | {return __cxx_atomic_compare_exchange_weak(&__a_, &__e, __d, __m, __m);} | |
| 965 | 1526 | _LIBCPP_INLINE_VISIBILITY |
| 966 | 1527 | bool compare_exchange_strong(_Tp& __e, _Tp __d, |
| 967 | 1528 | memory_order __m = memory_order_seq_cst) volatile _NOEXCEPT |
| 968 | {return __c11_atomic_compare_exchange_strong(&__a_, &__e, __d, __m, __m);} | |
| 1529 | {return __cxx_atomic_compare_exchange_strong(&__a_, &__e, __d, __m, __m);} | |
| 969 | 1530 | _LIBCPP_INLINE_VISIBILITY |
| 970 | 1531 | bool compare_exchange_strong(_Tp& __e, _Tp __d, |
| 971 | 1532 | memory_order __m = memory_order_seq_cst) _NOEXCEPT |
| 972 | {return __c11_atomic_compare_exchange_strong(&__a_, &__e, __d, __m, __m);} | |
| 1533 | {return __cxx_atomic_compare_exchange_strong(&__a_, &__e, __d, __m, __m);} | |
| 973 | 1534 | |
| 974 | 1535 | _LIBCPP_INLINE_VISIBILITY |
| 975 | #ifndef _LIBCPP_CXX03_LANG | |
| 976 | __atomic_base() _NOEXCEPT = default; | |
| 977 | #else | |
| 978 | __atomic_base() _NOEXCEPT : __a_() {} | |
| 979 | #endif // _LIBCPP_CXX03_LANG | |
| 1536 | __atomic_base() _NOEXCEPT _LIBCPP_DEFAULT | |
| 1537 | ||
| 1538 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR | |
| 1539 | __atomic_base(_Tp __d) _NOEXCEPT : __a_(__d) {} | |
| 980 | 1540 | |
| 981 | _LIBCPP_INLINE_VISIBILITY | |
| 982 | _LIBCPP_CONSTEXPR __atomic_base(_Tp __d) _NOEXCEPT : __a_(__d) {} | |
| 983 | 1541 | #ifndef _LIBCPP_CXX03_LANG |
| 984 | 1542 | __atomic_base(const __atomic_base&) = delete; |
| 985 | 1543 | __atomic_base& operator=(const __atomic_base&) = delete; |
| ... | ... | @@ -1011,34 +1569,34 @@ struct __atomic_base<_Tp, true> |
| 1011 | 1569 | |
| 1012 | 1570 | _LIBCPP_INLINE_VISIBILITY |
| 1013 | 1571 | _Tp fetch_add(_Tp __op, memory_order __m = memory_order_seq_cst) volatile _NOEXCEPT |
| 1014 | {return __c11_atomic_fetch_add(&this->__a_, __op, __m);} | |
| 1572 | {return __cxx_atomic_fetch_add(&this->__a_, __op, __m);} | |
| 1015 | 1573 | _LIBCPP_INLINE_VISIBILITY |
| 1016 | 1574 | _Tp fetch_add(_Tp __op, memory_order __m = memory_order_seq_cst) _NOEXCEPT |
| 1017 | {return __c11_atomic_fetch_add(&this->__a_, __op, __m);} | |
| 1575 | {return __cxx_atomic_fetch_add(&this->__a_, __op, __m);} | |
| 1018 | 1576 | _LIBCPP_INLINE_VISIBILITY |
| 1019 | 1577 | _Tp fetch_sub(_Tp __op, memory_order __m = memory_order_seq_cst) volatile _NOEXCEPT |
| 1020 | {return __c11_atomic_fetch_sub(&this->__a_, __op, __m);} | |
| 1578 | {return __cxx_atomic_fetch_sub(&this->__a_, __op, __m);} | |
| 1021 | 1579 | _LIBCPP_INLINE_VISIBILITY |
| 1022 | 1580 | _Tp fetch_sub(_Tp __op, memory_order __m = memory_order_seq_cst) _NOEXCEPT |
| 1023 | {return __c11_atomic_fetch_sub(&this->__a_, __op, __m);} | |
| 1581 | {return __cxx_atomic_fetch_sub(&this->__a_, __op, __m);} | |
| 1024 | 1582 | _LIBCPP_INLINE_VISIBILITY |
| 1025 | 1583 | _Tp fetch_and(_Tp __op, memory_order __m = memory_order_seq_cst) volatile _NOEXCEPT |
| 1026 | {return __c11_atomic_fetch_and(&this->__a_, __op, __m);} | |
| 1584 | {return __cxx_atomic_fetch_and(&this->__a_, __op, __m);} | |
| 1027 | 1585 | _LIBCPP_INLINE_VISIBILITY |
| 1028 | 1586 | _Tp fetch_and(_Tp __op, memory_order __m = memory_order_seq_cst) _NOEXCEPT |
| 1029 | {return __c11_atomic_fetch_and(&this->__a_, __op, __m);} | |
| 1587 | {return __cxx_atomic_fetch_and(&this->__a_, __op, __m);} | |
| 1030 | 1588 | _LIBCPP_INLINE_VISIBILITY |
| 1031 | 1589 | _Tp fetch_or(_Tp __op, memory_order __m = memory_order_seq_cst) volatile _NOEXCEPT |
| 1032 | {return __c11_atomic_fetch_or(&this->__a_, __op, __m);} | |
| 1590 | {return __cxx_atomic_fetch_or(&this->__a_, __op, __m);} | |
| 1033 | 1591 | _LIBCPP_INLINE_VISIBILITY |
| 1034 | 1592 | _Tp fetch_or(_Tp __op, memory_order __m = memory_order_seq_cst) _NOEXCEPT |
| 1035 | {return __c11_atomic_fetch_or(&this->__a_, __op, __m);} | |
| 1593 | {return __cxx_atomic_fetch_or(&this->__a_, __op, __m);} | |
| 1036 | 1594 | _LIBCPP_INLINE_VISIBILITY |
| 1037 | 1595 | _Tp fetch_xor(_Tp __op, memory_order __m = memory_order_seq_cst) volatile _NOEXCEPT |
| 1038 | {return __c11_atomic_fetch_xor(&this->__a_, __op, __m);} | |
| 1596 | {return __cxx_atomic_fetch_xor(&this->__a_, __op, __m);} | |
| 1039 | 1597 | _LIBCPP_INLINE_VISIBILITY |
| 1040 | 1598 | _Tp fetch_xor(_Tp __op, memory_order __m = memory_order_seq_cst) _NOEXCEPT |
| 1041 | {return __c11_atomic_fetch_xor(&this->__a_, __op, __m);} | |
| 1599 | {return __cxx_atomic_fetch_xor(&this->__a_, __op, __m);} | |
| 1042 | 1600 | |
| 1043 | 1601 | _LIBCPP_INLINE_VISIBILITY |
| 1044 | 1602 | _Tp operator++(int) volatile _NOEXCEPT {return fetch_add(_Tp(1));} |
| ... | ... | @@ -1120,17 +1678,17 @@ struct atomic<_Tp*> |
| 1120 | 1678 | _LIBCPP_INLINE_VISIBILITY |
| 1121 | 1679 | _Tp* fetch_add(ptrdiff_t __op, memory_order __m = memory_order_seq_cst) |
| 1122 | 1680 | volatile _NOEXCEPT |
| 1123 | {return __c11_atomic_fetch_add(&this->__a_, __op, __m);} | |
| 1681 | {return __cxx_atomic_fetch_add(&this->__a_, __op, __m);} | |
| 1124 | 1682 | _LIBCPP_INLINE_VISIBILITY |
| 1125 | 1683 | _Tp* fetch_add(ptrdiff_t __op, memory_order __m = memory_order_seq_cst) _NOEXCEPT |
| 1126 | {return __c11_atomic_fetch_add(&this->__a_, __op, __m);} | |
| 1684 | {return __cxx_atomic_fetch_add(&this->__a_, __op, __m);} | |
| 1127 | 1685 | _LIBCPP_INLINE_VISIBILITY |
| 1128 | 1686 | _Tp* fetch_sub(ptrdiff_t __op, memory_order __m = memory_order_seq_cst) |
| 1129 | 1687 | volatile _NOEXCEPT |
| 1130 | {return __c11_atomic_fetch_sub(&this->__a_, __op, __m);} | |
| 1688 | {return __cxx_atomic_fetch_sub(&this->__a_, __op, __m);} | |
| 1131 | 1689 | _LIBCPP_INLINE_VISIBILITY |
| 1132 | 1690 | _Tp* fetch_sub(ptrdiff_t __op, memory_order __m = memory_order_seq_cst) _NOEXCEPT |
| 1133 | {return __c11_atomic_fetch_sub(&this->__a_, __op, __m);} | |
| 1691 | {return __cxx_atomic_fetch_sub(&this->__a_, __op, __m);} | |
| 1134 | 1692 | |
| 1135 | 1693 | _LIBCPP_INLINE_VISIBILITY |
| 1136 | 1694 | _Tp* operator++(int) volatile _NOEXCEPT {return fetch_add(1);} |
| ... | ... | @@ -1161,7 +1719,7 @@ struct atomic<_Tp*> |
| 1161 | 1719 | // atomic_is_lock_free |
| 1162 | 1720 | |
| 1163 | 1721 | template <class _Tp> |
| 1164 | inline _LIBCPP_INLINE_VISIBILITY | |
| 1722 | _LIBCPP_INLINE_VISIBILITY | |
| 1165 | 1723 | bool |
| 1166 | 1724 | atomic_is_lock_free(const volatile atomic<_Tp>* __o) _NOEXCEPT |
| 1167 | 1725 | { |
| ... | ... | @@ -1169,7 +1727,7 @@ atomic_is_lock_free(const volatile atomic<_Tp>* __o) _NOEXCEPT |
| 1169 | 1727 | } |
| 1170 | 1728 | |
| 1171 | 1729 | template <class _Tp> |
| 1172 | inline _LIBCPP_INLINE_VISIBILITY | |
| 1730 | _LIBCPP_INLINE_VISIBILITY | |
| 1173 | 1731 | bool |
| 1174 | 1732 | atomic_is_lock_free(const atomic<_Tp>* __o) _NOEXCEPT |
| 1175 | 1733 | { |
| ... | ... | @@ -1179,25 +1737,25 @@ atomic_is_lock_free(const atomic<_Tp>* __o) _NOEXCEPT |
| 1179 | 1737 | // atomic_init |
| 1180 | 1738 | |
| 1181 | 1739 | template <class _Tp> |
| 1182 | inline _LIBCPP_INLINE_VISIBILITY | |
| 1740 | _LIBCPP_INLINE_VISIBILITY | |
| 1183 | 1741 | void |
| 1184 | 1742 | atomic_init(volatile atomic<_Tp>* __o, _Tp __d) _NOEXCEPT |
| 1185 | 1743 | { |
| 1186 | __c11_atomic_init(&__o->__a_, __d); | |
| 1744 | __cxx_atomic_init(&__o->__a_, __d); | |
| 1187 | 1745 | } |
| 1188 | 1746 | |
| 1189 | 1747 | template <class _Tp> |
| 1190 | inline _LIBCPP_INLINE_VISIBILITY | |
| 1748 | _LIBCPP_INLINE_VISIBILITY | |
| 1191 | 1749 | void |
| 1192 | 1750 | atomic_init(atomic<_Tp>* __o, _Tp __d) _NOEXCEPT |
| 1193 | 1751 | { |
| 1194 | __c11_atomic_init(&__o->__a_, __d); | |
| 1752 | __cxx_atomic_init(&__o->__a_, __d); | |
| 1195 | 1753 | } |
| 1196 | 1754 | |
| 1197 | 1755 | // atomic_store |
| 1198 | 1756 | |
| 1199 | 1757 | template <class _Tp> |
| 1200 | inline _LIBCPP_INLINE_VISIBILITY | |
| 1758 | _LIBCPP_INLINE_VISIBILITY | |
| 1201 | 1759 | void |
| 1202 | 1760 | atomic_store(volatile atomic<_Tp>* __o, _Tp __d) _NOEXCEPT |
| 1203 | 1761 | { |
| ... | ... | @@ -1205,7 +1763,7 @@ atomic_store(volatile atomic<_Tp>* __o, _Tp __d) _NOEXCEPT |
| 1205 | 1763 | } |
| 1206 | 1764 | |
| 1207 | 1765 | template <class _Tp> |
| 1208 | inline _LIBCPP_INLINE_VISIBILITY | |
| 1766 | _LIBCPP_INLINE_VISIBILITY | |
| 1209 | 1767 | void |
| 1210 | 1768 | atomic_store(atomic<_Tp>* __o, _Tp __d) _NOEXCEPT |
| 1211 | 1769 | { |
| ... | ... | @@ -1215,7 +1773,7 @@ atomic_store(atomic<_Tp>* __o, _Tp __d) _NOEXCEPT |
| 1215 | 1773 | // atomic_store_explicit |
| 1216 | 1774 | |
| 1217 | 1775 | template <class _Tp> |
| 1218 | inline _LIBCPP_INLINE_VISIBILITY | |
| 1776 | _LIBCPP_INLINE_VISIBILITY | |
| 1219 | 1777 | void |
| 1220 | 1778 | atomic_store_explicit(volatile atomic<_Tp>* __o, _Tp __d, memory_order __m) _NOEXCEPT |
| 1221 | 1779 | _LIBCPP_CHECK_STORE_MEMORY_ORDER(__m) |
| ... | ... | @@ -1224,7 +1782,7 @@ atomic_store_explicit(volatile atomic<_Tp>* __o, _Tp __d, memory_order __m) _NOE |
| 1224 | 1782 | } |
| 1225 | 1783 | |
| 1226 | 1784 | template <class _Tp> |
| 1227 | inline _LIBCPP_INLINE_VISIBILITY | |
| 1785 | _LIBCPP_INLINE_VISIBILITY | |
| 1228 | 1786 | void |
| 1229 | 1787 | atomic_store_explicit(atomic<_Tp>* __o, _Tp __d, memory_order __m) _NOEXCEPT |
| 1230 | 1788 | _LIBCPP_CHECK_STORE_MEMORY_ORDER(__m) |
| ... | ... | @@ -1235,7 +1793,7 @@ atomic_store_explicit(atomic<_Tp>* __o, _Tp __d, memory_order __m) _NOEXCEPT |
| 1235 | 1793 | // atomic_load |
| 1236 | 1794 | |
| 1237 | 1795 | template <class _Tp> |
| 1238 | inline _LIBCPP_INLINE_VISIBILITY | |
| 1796 | _LIBCPP_INLINE_VISIBILITY | |
| 1239 | 1797 | _Tp |
| 1240 | 1798 | atomic_load(const volatile atomic<_Tp>* __o) _NOEXCEPT |
| 1241 | 1799 | { |
| ... | ... | @@ -1243,7 +1801,7 @@ atomic_load(const volatile atomic<_Tp>* __o) _NOEXCEPT |
| 1243 | 1801 | } |
| 1244 | 1802 | |
| 1245 | 1803 | template <class _Tp> |
| 1246 | inline _LIBCPP_INLINE_VISIBILITY | |
| 1804 | _LIBCPP_INLINE_VISIBILITY | |
| 1247 | 1805 | _Tp |
| 1248 | 1806 | atomic_load(const atomic<_Tp>* __o) _NOEXCEPT |
| 1249 | 1807 | { |
| ... | ... | @@ -1253,7 +1811,7 @@ atomic_load(const atomic<_Tp>* __o) _NOEXCEPT |
| 1253 | 1811 | // atomic_load_explicit |
| 1254 | 1812 | |
| 1255 | 1813 | template <class _Tp> |
| 1256 | inline _LIBCPP_INLINE_VISIBILITY | |
| 1814 | _LIBCPP_INLINE_VISIBILITY | |
| 1257 | 1815 | _Tp |
| 1258 | 1816 | atomic_load_explicit(const volatile atomic<_Tp>* __o, memory_order __m) _NOEXCEPT |
| 1259 | 1817 | _LIBCPP_CHECK_LOAD_MEMORY_ORDER(__m) |
| ... | ... | @@ -1262,7 +1820,7 @@ atomic_load_explicit(const volatile atomic<_Tp>* __o, memory_order __m) _NOEXCEP |
| 1262 | 1820 | } |
| 1263 | 1821 | |
| 1264 | 1822 | template <class _Tp> |
| 1265 | inline _LIBCPP_INLINE_VISIBILITY | |
| 1823 | _LIBCPP_INLINE_VISIBILITY | |
| 1266 | 1824 | _Tp |
| 1267 | 1825 | atomic_load_explicit(const atomic<_Tp>* __o, memory_order __m) _NOEXCEPT |
| 1268 | 1826 | _LIBCPP_CHECK_LOAD_MEMORY_ORDER(__m) |
| ... | ... | @@ -1273,7 +1831,7 @@ atomic_load_explicit(const atomic<_Tp>* __o, memory_order __m) _NOEXCEPT |
| 1273 | 1831 | // atomic_exchange |
| 1274 | 1832 | |
| 1275 | 1833 | template <class _Tp> |
| 1276 | inline _LIBCPP_INLINE_VISIBILITY | |
| 1834 | _LIBCPP_INLINE_VISIBILITY | |
| 1277 | 1835 | _Tp |
| 1278 | 1836 | atomic_exchange(volatile atomic<_Tp>* __o, _Tp __d) _NOEXCEPT |
| 1279 | 1837 | { |
| ... | ... | @@ -1281,7 +1839,7 @@ atomic_exchange(volatile atomic<_Tp>* __o, _Tp __d) _NOEXCEPT |
| 1281 | 1839 | } |
| 1282 | 1840 | |
| 1283 | 1841 | template <class _Tp> |
| 1284 | inline _LIBCPP_INLINE_VISIBILITY | |
| 1842 | _LIBCPP_INLINE_VISIBILITY | |
| 1285 | 1843 | _Tp |
| 1286 | 1844 | atomic_exchange(atomic<_Tp>* __o, _Tp __d) _NOEXCEPT |
| 1287 | 1845 | { |
| ... | ... | @@ -1291,7 +1849,7 @@ atomic_exchange(atomic<_Tp>* __o, _Tp __d) _NOEXCEPT |
| 1291 | 1849 | // atomic_exchange_explicit |
| 1292 | 1850 | |
| 1293 | 1851 | template <class _Tp> |
| 1294 | inline _LIBCPP_INLINE_VISIBILITY | |
| 1852 | _LIBCPP_INLINE_VISIBILITY | |
| 1295 | 1853 | _Tp |
| 1296 | 1854 | atomic_exchange_explicit(volatile atomic<_Tp>* __o, _Tp __d, memory_order __m) _NOEXCEPT |
| 1297 | 1855 | { |
| ... | ... | @@ -1299,7 +1857,7 @@ atomic_exchange_explicit(volatile atomic<_Tp>* __o, _Tp __d, memory_order __m) _ |
| 1299 | 1857 | } |
| 1300 | 1858 | |
| 1301 | 1859 | template <class _Tp> |
| 1302 | inline _LIBCPP_INLINE_VISIBILITY | |
| 1860 | _LIBCPP_INLINE_VISIBILITY | |
| 1303 | 1861 | _Tp |
| 1304 | 1862 | atomic_exchange_explicit(atomic<_Tp>* __o, _Tp __d, memory_order __m) _NOEXCEPT |
| 1305 | 1863 | { |
| ... | ... | @@ -1309,7 +1867,7 @@ atomic_exchange_explicit(atomic<_Tp>* __o, _Tp __d, memory_order __m) _NOEXCEPT |
| 1309 | 1867 | // atomic_compare_exchange_weak |
| 1310 | 1868 | |
| 1311 | 1869 | template <class _Tp> |
| 1312 | inline _LIBCPP_INLINE_VISIBILITY | |
| 1870 | _LIBCPP_INLINE_VISIBILITY | |
| 1313 | 1871 | bool |
| 1314 | 1872 | atomic_compare_exchange_weak(volatile atomic<_Tp>* __o, _Tp* __e, _Tp __d) _NOEXCEPT |
| 1315 | 1873 | { |
| ... | ... | @@ -1317,7 +1875,7 @@ atomic_compare_exchange_weak(volatile atomic<_Tp>* __o, _Tp* __e, _Tp __d) _NOEX |
| 1317 | 1875 | } |
| 1318 | 1876 | |
| 1319 | 1877 | template <class _Tp> |
| 1320 | inline _LIBCPP_INLINE_VISIBILITY | |
| 1878 | _LIBCPP_INLINE_VISIBILITY | |
| 1321 | 1879 | bool |
| 1322 | 1880 | atomic_compare_exchange_weak(atomic<_Tp>* __o, _Tp* __e, _Tp __d) _NOEXCEPT |
| 1323 | 1881 | { |
| ... | ... | @@ -1327,7 +1885,7 @@ atomic_compare_exchange_weak(atomic<_Tp>* __o, _Tp* __e, _Tp __d) _NOEXCEPT |
| 1327 | 1885 | // atomic_compare_exchange_strong |
| 1328 | 1886 | |
| 1329 | 1887 | template <class _Tp> |
| 1330 | inline _LIBCPP_INLINE_VISIBILITY | |
| 1888 | _LIBCPP_INLINE_VISIBILITY | |
| 1331 | 1889 | bool |
| 1332 | 1890 | atomic_compare_exchange_strong(volatile atomic<_Tp>* __o, _Tp* __e, _Tp __d) _NOEXCEPT |
| 1333 | 1891 | { |
| ... | ... | @@ -1335,7 +1893,7 @@ atomic_compare_exchange_strong(volatile atomic<_Tp>* __o, _Tp* __e, _Tp __d) _NO |
| 1335 | 1893 | } |
| 1336 | 1894 | |
| 1337 | 1895 | template <class _Tp> |
| 1338 | inline _LIBCPP_INLINE_VISIBILITY | |
| 1896 | _LIBCPP_INLINE_VISIBILITY | |
| 1339 | 1897 | bool |
| 1340 | 1898 | atomic_compare_exchange_strong(atomic<_Tp>* __o, _Tp* __e, _Tp __d) _NOEXCEPT |
| 1341 | 1899 | { |
| ... | ... | @@ -1345,7 +1903,7 @@ atomic_compare_exchange_strong(atomic<_Tp>* __o, _Tp* __e, _Tp __d) _NOEXCEPT |
| 1345 | 1903 | // atomic_compare_exchange_weak_explicit |
| 1346 | 1904 | |
| 1347 | 1905 | template <class _Tp> |
| 1348 | inline _LIBCPP_INLINE_VISIBILITY | |
| 1906 | _LIBCPP_INLINE_VISIBILITY | |
| 1349 | 1907 | bool |
| 1350 | 1908 | atomic_compare_exchange_weak_explicit(volatile atomic<_Tp>* __o, _Tp* __e, |
| 1351 | 1909 | _Tp __d, |
| ... | ... | @@ -1356,7 +1914,7 @@ atomic_compare_exchange_weak_explicit(volatile atomic<_Tp>* __o, _Tp* __e, |
| 1356 | 1914 | } |
| 1357 | 1915 | |
| 1358 | 1916 | template <class _Tp> |
| 1359 | inline _LIBCPP_INLINE_VISIBILITY | |
| 1917 | _LIBCPP_INLINE_VISIBILITY | |
| 1360 | 1918 | bool |
| 1361 | 1919 | atomic_compare_exchange_weak_explicit(atomic<_Tp>* __o, _Tp* __e, _Tp __d, |
| 1362 | 1920 | memory_order __s, memory_order __f) _NOEXCEPT |
| ... | ... | @@ -1368,7 +1926,7 @@ atomic_compare_exchange_weak_explicit(atomic<_Tp>* __o, _Tp* __e, _Tp __d, |
| 1368 | 1926 | // atomic_compare_exchange_strong_explicit |
| 1369 | 1927 | |
| 1370 | 1928 | template <class _Tp> |
| 1371 | inline _LIBCPP_INLINE_VISIBILITY | |
| 1929 | _LIBCPP_INLINE_VISIBILITY | |
| 1372 | 1930 | bool |
| 1373 | 1931 | atomic_compare_exchange_strong_explicit(volatile atomic<_Tp>* __o, |
| 1374 | 1932 | _Tp* __e, _Tp __d, |
| ... | ... | @@ -1379,7 +1937,7 @@ atomic_compare_exchange_strong_explicit(volatile atomic<_Tp>* __o, |
| 1379 | 1937 | } |
| 1380 | 1938 | |
| 1381 | 1939 | template <class _Tp> |
| 1382 | inline _LIBCPP_INLINE_VISIBILITY | |
| 1940 | _LIBCPP_INLINE_VISIBILITY | |
| 1383 | 1941 | bool |
| 1384 | 1942 | atomic_compare_exchange_strong_explicit(atomic<_Tp>* __o, _Tp* __e, |
| 1385 | 1943 | _Tp __d, |
| ... | ... | @@ -1392,7 +1950,7 @@ atomic_compare_exchange_strong_explicit(atomic<_Tp>* __o, _Tp* __e, |
| 1392 | 1950 | // atomic_fetch_add |
| 1393 | 1951 | |
| 1394 | 1952 | template <class _Tp> |
| 1395 | inline _LIBCPP_INLINE_VISIBILITY | |
| 1953 | _LIBCPP_INLINE_VISIBILITY | |
| 1396 | 1954 | typename enable_if |
| 1397 | 1955 | < |
| 1398 | 1956 | is_integral<_Tp>::value && !is_same<_Tp, bool>::value, |
| ... | ... | @@ -1404,7 +1962,7 @@ atomic_fetch_add(volatile atomic<_Tp>* __o, _Tp __op) _NOEXCEPT |
| 1404 | 1962 | } |
| 1405 | 1963 | |
| 1406 | 1964 | template <class _Tp> |
| 1407 | inline _LIBCPP_INLINE_VISIBILITY | |
| 1965 | _LIBCPP_INLINE_VISIBILITY | |
| 1408 | 1966 | typename enable_if |
| 1409 | 1967 | < |
| 1410 | 1968 | is_integral<_Tp>::value && !is_same<_Tp, bool>::value, |
| ... | ... | @@ -1416,7 +1974,7 @@ atomic_fetch_add(atomic<_Tp>* __o, _Tp __op) _NOEXCEPT |
| 1416 | 1974 | } |
| 1417 | 1975 | |
| 1418 | 1976 | template <class _Tp> |
| 1419 | inline _LIBCPP_INLINE_VISIBILITY | |
| 1977 | _LIBCPP_INLINE_VISIBILITY | |
| 1420 | 1978 | _Tp* |
| 1421 | 1979 | atomic_fetch_add(volatile atomic<_Tp*>* __o, ptrdiff_t __op) _NOEXCEPT |
| 1422 | 1980 | { |
| ... | ... | @@ -1424,7 +1982,7 @@ atomic_fetch_add(volatile atomic<_Tp*>* __o, ptrdiff_t __op) _NOEXCEPT |
| 1424 | 1982 | } |
| 1425 | 1983 | |
| 1426 | 1984 | template <class _Tp> |
| 1427 | inline _LIBCPP_INLINE_VISIBILITY | |
| 1985 | _LIBCPP_INLINE_VISIBILITY | |
| 1428 | 1986 | _Tp* |
| 1429 | 1987 | atomic_fetch_add(atomic<_Tp*>* __o, ptrdiff_t __op) _NOEXCEPT |
| 1430 | 1988 | { |
| ... | ... | @@ -1434,7 +1992,7 @@ atomic_fetch_add(atomic<_Tp*>* __o, ptrdiff_t __op) _NOEXCEPT |
| 1434 | 1992 | // atomic_fetch_add_explicit |
| 1435 | 1993 | |
| 1436 | 1994 | template <class _Tp> |
| 1437 | inline _LIBCPP_INLINE_VISIBILITY | |
| 1995 | _LIBCPP_INLINE_VISIBILITY | |
| 1438 | 1996 | typename enable_if |
| 1439 | 1997 | < |
| 1440 | 1998 | is_integral<_Tp>::value && !is_same<_Tp, bool>::value, |
| ... | ... | @@ -1446,7 +2004,7 @@ atomic_fetch_add_explicit(volatile atomic<_Tp>* __o, _Tp __op, memory_order __m) |
| 1446 | 2004 | } |
| 1447 | 2005 | |
| 1448 | 2006 | template <class _Tp> |
| 1449 | inline _LIBCPP_INLINE_VISIBILITY | |
| 2007 | _LIBCPP_INLINE_VISIBILITY | |
| 1450 | 2008 | typename enable_if |
| 1451 | 2009 | < |
| 1452 | 2010 | is_integral<_Tp>::value && !is_same<_Tp, bool>::value, |
| ... | ... | @@ -1458,7 +2016,7 @@ atomic_fetch_add_explicit(atomic<_Tp>* __o, _Tp __op, memory_order __m) _NOEXCEP |
| 1458 | 2016 | } |
| 1459 | 2017 | |
| 1460 | 2018 | template <class _Tp> |
| 1461 | inline _LIBCPP_INLINE_VISIBILITY | |
| 2019 | _LIBCPP_INLINE_VISIBILITY | |
| 1462 | 2020 | _Tp* |
| 1463 | 2021 | atomic_fetch_add_explicit(volatile atomic<_Tp*>* __o, ptrdiff_t __op, |
| 1464 | 2022 | memory_order __m) _NOEXCEPT |
| ... | ... | @@ -1467,7 +2025,7 @@ atomic_fetch_add_explicit(volatile atomic<_Tp*>* __o, ptrdiff_t __op, |
| 1467 | 2025 | } |
| 1468 | 2026 | |
| 1469 | 2027 | template <class _Tp> |
| 1470 | inline _LIBCPP_INLINE_VISIBILITY | |
| 2028 | _LIBCPP_INLINE_VISIBILITY | |
| 1471 | 2029 | _Tp* |
| 1472 | 2030 | atomic_fetch_add_explicit(atomic<_Tp*>* __o, ptrdiff_t __op, memory_order __m) _NOEXCEPT |
| 1473 | 2031 | { |
| ... | ... | @@ -1477,7 +2035,7 @@ atomic_fetch_add_explicit(atomic<_Tp*>* __o, ptrdiff_t __op, memory_order __m) _ |
| 1477 | 2035 | // atomic_fetch_sub |
| 1478 | 2036 | |
| 1479 | 2037 | template <class _Tp> |
| 1480 | inline _LIBCPP_INLINE_VISIBILITY | |
| 2038 | _LIBCPP_INLINE_VISIBILITY | |
| 1481 | 2039 | typename enable_if |
| 1482 | 2040 | < |
| 1483 | 2041 | is_integral<_Tp>::value && !is_same<_Tp, bool>::value, |
| ... | ... | @@ -1489,7 +2047,7 @@ atomic_fetch_sub(volatile atomic<_Tp>* __o, _Tp __op) _NOEXCEPT |
| 1489 | 2047 | } |
| 1490 | 2048 | |
| 1491 | 2049 | template <class _Tp> |
| 1492 | inline _LIBCPP_INLINE_VISIBILITY | |
| 2050 | _LIBCPP_INLINE_VISIBILITY | |
| 1493 | 2051 | typename enable_if |
| 1494 | 2052 | < |
| 1495 | 2053 | is_integral<_Tp>::value && !is_same<_Tp, bool>::value, |
| ... | ... | @@ -1501,7 +2059,7 @@ atomic_fetch_sub(atomic<_Tp>* __o, _Tp __op) _NOEXCEPT |
| 1501 | 2059 | } |
| 1502 | 2060 | |
| 1503 | 2061 | template <class _Tp> |
| 1504 | inline _LIBCPP_INLINE_VISIBILITY | |
| 2062 | _LIBCPP_INLINE_VISIBILITY | |
| 1505 | 2063 | _Tp* |
| 1506 | 2064 | atomic_fetch_sub(volatile atomic<_Tp*>* __o, ptrdiff_t __op) _NOEXCEPT |
| 1507 | 2065 | { |
| ... | ... | @@ -1509,7 +2067,7 @@ atomic_fetch_sub(volatile atomic<_Tp*>* __o, ptrdiff_t __op) _NOEXCEPT |
| 1509 | 2067 | } |
| 1510 | 2068 | |
| 1511 | 2069 | template <class _Tp> |
| 1512 | inline _LIBCPP_INLINE_VISIBILITY | |
| 2070 | _LIBCPP_INLINE_VISIBILITY | |
| 1513 | 2071 | _Tp* |
| 1514 | 2072 | atomic_fetch_sub(atomic<_Tp*>* __o, ptrdiff_t __op) _NOEXCEPT |
| 1515 | 2073 | { |
| ... | ... | @@ -1519,7 +2077,7 @@ atomic_fetch_sub(atomic<_Tp*>* __o, ptrdiff_t __op) _NOEXCEPT |
| 1519 | 2077 | // atomic_fetch_sub_explicit |
| 1520 | 2078 | |
| 1521 | 2079 | template <class _Tp> |
| 1522 | inline _LIBCPP_INLINE_VISIBILITY | |
| 2080 | _LIBCPP_INLINE_VISIBILITY | |
| 1523 | 2081 | typename enable_if |
| 1524 | 2082 | < |
| 1525 | 2083 | is_integral<_Tp>::value && !is_same<_Tp, bool>::value, |
| ... | ... | @@ -1531,7 +2089,7 @@ atomic_fetch_sub_explicit(volatile atomic<_Tp>* __o, _Tp __op, memory_order __m) |
| 1531 | 2089 | } |
| 1532 | 2090 | |
| 1533 | 2091 | template <class _Tp> |
| 1534 | inline _LIBCPP_INLINE_VISIBILITY | |
| 2092 | _LIBCPP_INLINE_VISIBILITY | |
| 1535 | 2093 | typename enable_if |
| 1536 | 2094 | < |
| 1537 | 2095 | is_integral<_Tp>::value && !is_same<_Tp, bool>::value, |
| ... | ... | @@ -1543,7 +2101,7 @@ atomic_fetch_sub_explicit(atomic<_Tp>* __o, _Tp __op, memory_order __m) _NOEXCEP |
| 1543 | 2101 | } |
| 1544 | 2102 | |
| 1545 | 2103 | template <class _Tp> |
| 1546 | inline _LIBCPP_INLINE_VISIBILITY | |
| 2104 | _LIBCPP_INLINE_VISIBILITY | |
| 1547 | 2105 | _Tp* |
| 1548 | 2106 | atomic_fetch_sub_explicit(volatile atomic<_Tp*>* __o, ptrdiff_t __op, |
| 1549 | 2107 | memory_order __m) _NOEXCEPT |
| ... | ... | @@ -1552,7 +2110,7 @@ atomic_fetch_sub_explicit(volatile atomic<_Tp*>* __o, ptrdiff_t __op, |
| 1552 | 2110 | } |
| 1553 | 2111 | |
| 1554 | 2112 | template <class _Tp> |
| 1555 | inline _LIBCPP_INLINE_VISIBILITY | |
| 2113 | _LIBCPP_INLINE_VISIBILITY | |
| 1556 | 2114 | _Tp* |
| 1557 | 2115 | atomic_fetch_sub_explicit(atomic<_Tp*>* __o, ptrdiff_t __op, memory_order __m) _NOEXCEPT |
| 1558 | 2116 | { |
| ... | ... | @@ -1562,7 +2120,7 @@ atomic_fetch_sub_explicit(atomic<_Tp*>* __o, ptrdiff_t __op, memory_order __m) _ |
| 1562 | 2120 | // atomic_fetch_and |
| 1563 | 2121 | |
| 1564 | 2122 | template <class _Tp> |
| 1565 | inline _LIBCPP_INLINE_VISIBILITY | |
| 2123 | _LIBCPP_INLINE_VISIBILITY | |
| 1566 | 2124 | typename enable_if |
| 1567 | 2125 | < |
| 1568 | 2126 | is_integral<_Tp>::value && !is_same<_Tp, bool>::value, |
| ... | ... | @@ -1574,7 +2132,7 @@ atomic_fetch_and(volatile atomic<_Tp>* __o, _Tp __op) _NOEXCEPT |
| 1574 | 2132 | } |
| 1575 | 2133 | |
| 1576 | 2134 | template <class _Tp> |
| 1577 | inline _LIBCPP_INLINE_VISIBILITY | |
| 2135 | _LIBCPP_INLINE_VISIBILITY | |
| 1578 | 2136 | typename enable_if |
| 1579 | 2137 | < |
| 1580 | 2138 | is_integral<_Tp>::value && !is_same<_Tp, bool>::value, |
| ... | ... | @@ -1588,7 +2146,7 @@ atomic_fetch_and(atomic<_Tp>* __o, _Tp __op) _NOEXCEPT |
| 1588 | 2146 | // atomic_fetch_and_explicit |
| 1589 | 2147 | |
| 1590 | 2148 | template <class _Tp> |
| 1591 | inline _LIBCPP_INLINE_VISIBILITY | |
| 2149 | _LIBCPP_INLINE_VISIBILITY | |
| 1592 | 2150 | typename enable_if |
| 1593 | 2151 | < |
| 1594 | 2152 | is_integral<_Tp>::value && !is_same<_Tp, bool>::value, |
| ... | ... | @@ -1600,7 +2158,7 @@ atomic_fetch_and_explicit(volatile atomic<_Tp>* __o, _Tp __op, memory_order __m) |
| 1600 | 2158 | } |
| 1601 | 2159 | |
| 1602 | 2160 | template <class _Tp> |
| 1603 | inline _LIBCPP_INLINE_VISIBILITY | |
| 2161 | _LIBCPP_INLINE_VISIBILITY | |
| 1604 | 2162 | typename enable_if |
| 1605 | 2163 | < |
| 1606 | 2164 | is_integral<_Tp>::value && !is_same<_Tp, bool>::value, |
| ... | ... | @@ -1614,7 +2172,7 @@ atomic_fetch_and_explicit(atomic<_Tp>* __o, _Tp __op, memory_order __m) _NOEXCEP |
| 1614 | 2172 | // atomic_fetch_or |
| 1615 | 2173 | |
| 1616 | 2174 | template <class _Tp> |
| 1617 | inline _LIBCPP_INLINE_VISIBILITY | |
| 2175 | _LIBCPP_INLINE_VISIBILITY | |
| 1618 | 2176 | typename enable_if |
| 1619 | 2177 | < |
| 1620 | 2178 | is_integral<_Tp>::value && !is_same<_Tp, bool>::value, |
| ... | ... | @@ -1626,7 +2184,7 @@ atomic_fetch_or(volatile atomic<_Tp>* __o, _Tp __op) _NOEXCEPT |
| 1626 | 2184 | } |
| 1627 | 2185 | |
| 1628 | 2186 | template <class _Tp> |
| 1629 | inline _LIBCPP_INLINE_VISIBILITY | |
| 2187 | _LIBCPP_INLINE_VISIBILITY | |
| 1630 | 2188 | typename enable_if |
| 1631 | 2189 | < |
| 1632 | 2190 | is_integral<_Tp>::value && !is_same<_Tp, bool>::value, |
| ... | ... | @@ -1640,7 +2198,7 @@ atomic_fetch_or(atomic<_Tp>* __o, _Tp __op) _NOEXCEPT |
| 1640 | 2198 | // atomic_fetch_or_explicit |
| 1641 | 2199 | |
| 1642 | 2200 | template <class _Tp> |
| 1643 | inline _LIBCPP_INLINE_VISIBILITY | |
| 2201 | _LIBCPP_INLINE_VISIBILITY | |
| 1644 | 2202 | typename enable_if |
| 1645 | 2203 | < |
| 1646 | 2204 | is_integral<_Tp>::value && !is_same<_Tp, bool>::value, |
| ... | ... | @@ -1652,7 +2210,7 @@ atomic_fetch_or_explicit(volatile atomic<_Tp>* __o, _Tp __op, memory_order __m) |
| 1652 | 2210 | } |
| 1653 | 2211 | |
| 1654 | 2212 | template <class _Tp> |
| 1655 | inline _LIBCPP_INLINE_VISIBILITY | |
| 2213 | _LIBCPP_INLINE_VISIBILITY | |
| 1656 | 2214 | typename enable_if |
| 1657 | 2215 | < |
| 1658 | 2216 | is_integral<_Tp>::value && !is_same<_Tp, bool>::value, |
| ... | ... | @@ -1666,7 +2224,7 @@ atomic_fetch_or_explicit(atomic<_Tp>* __o, _Tp __op, memory_order __m) _NOEXCEPT |
| 1666 | 2224 | // atomic_fetch_xor |
| 1667 | 2225 | |
| 1668 | 2226 | template <class _Tp> |
| 1669 | inline _LIBCPP_INLINE_VISIBILITY | |
| 2227 | _LIBCPP_INLINE_VISIBILITY | |
| 1670 | 2228 | typename enable_if |
| 1671 | 2229 | < |
| 1672 | 2230 | is_integral<_Tp>::value && !is_same<_Tp, bool>::value, |
| ... | ... | @@ -1678,7 +2236,7 @@ atomic_fetch_xor(volatile atomic<_Tp>* __o, _Tp __op) _NOEXCEPT |
| 1678 | 2236 | } |
| 1679 | 2237 | |
| 1680 | 2238 | template <class _Tp> |
| 1681 | inline _LIBCPP_INLINE_VISIBILITY | |
| 2239 | _LIBCPP_INLINE_VISIBILITY | |
| 1682 | 2240 | typename enable_if |
| 1683 | 2241 | < |
| 1684 | 2242 | is_integral<_Tp>::value && !is_same<_Tp, bool>::value, |
| ... | ... | @@ -1692,7 +2250,7 @@ atomic_fetch_xor(atomic<_Tp>* __o, _Tp __op) _NOEXCEPT |
| 1692 | 2250 | // atomic_fetch_xor_explicit |
| 1693 | 2251 | |
| 1694 | 2252 | template <class _Tp> |
| 1695 | inline _LIBCPP_INLINE_VISIBILITY | |
| 2253 | _LIBCPP_INLINE_VISIBILITY | |
| 1696 | 2254 | typename enable_if |
| 1697 | 2255 | < |
| 1698 | 2256 | is_integral<_Tp>::value && !is_same<_Tp, bool>::value, |
| ... | ... | @@ -1704,7 +2262,7 @@ atomic_fetch_xor_explicit(volatile atomic<_Tp>* __o, _Tp __op, memory_order __m) |
| 1704 | 2262 | } |
| 1705 | 2263 | |
| 1706 | 2264 | template <class _Tp> |
| 1707 | inline _LIBCPP_INLINE_VISIBILITY | |
| 2265 | _LIBCPP_INLINE_VISIBILITY | |
| 1708 | 2266 | typename enable_if |
| 1709 | 2267 | < |
| 1710 | 2268 | is_integral<_Tp>::value && !is_same<_Tp, bool>::value, |
| ... | ... | @@ -1719,27 +2277,23 @@ atomic_fetch_xor_explicit(atomic<_Tp>* __o, _Tp __op, memory_order __m) _NOEXCEP |
| 1719 | 2277 | |
| 1720 | 2278 | typedef struct atomic_flag |
| 1721 | 2279 | { |
| 1722 | _Atomic(bool) __a_; | |
| 2280 | __cxx_atomic_impl<_LIBCPP_ATOMIC_FLAG_TYPE> __a_; | |
| 1723 | 2281 | |
| 1724 | 2282 | _LIBCPP_INLINE_VISIBILITY |
| 1725 | 2283 | bool test_and_set(memory_order __m = memory_order_seq_cst) volatile _NOEXCEPT |
| 1726 | {return __c11_atomic_exchange(&__a_, true, __m);} | |
| 2284 | {return __cxx_atomic_exchange(&__a_, _LIBCPP_ATOMIC_FLAG_TYPE(true), __m);} | |
| 1727 | 2285 | _LIBCPP_INLINE_VISIBILITY |
| 1728 | 2286 | bool test_and_set(memory_order __m = memory_order_seq_cst) _NOEXCEPT |
| 1729 | {return __c11_atomic_exchange(&__a_, true, __m);} | |
| 2287 | {return __cxx_atomic_exchange(&__a_, _LIBCPP_ATOMIC_FLAG_TYPE(true), __m);} | |
| 1730 | 2288 | _LIBCPP_INLINE_VISIBILITY |
| 1731 | 2289 | void clear(memory_order __m = memory_order_seq_cst) volatile _NOEXCEPT |
| 1732 | {__c11_atomic_store(&__a_, false, __m);} | |
| 2290 | {__cxx_atomic_store(&__a_, _LIBCPP_ATOMIC_FLAG_TYPE(false), __m);} | |
| 1733 | 2291 | _LIBCPP_INLINE_VISIBILITY |
| 1734 | 2292 | void clear(memory_order __m = memory_order_seq_cst) _NOEXCEPT |
| 1735 | {__c11_atomic_store(&__a_, false, __m);} | |
| 2293 | {__cxx_atomic_store(&__a_, _LIBCPP_ATOMIC_FLAG_TYPE(false), __m);} | |
| 1736 | 2294 | |
| 1737 | 2295 | _LIBCPP_INLINE_VISIBILITY |
| 1738 | #ifndef _LIBCPP_CXX03_LANG | |
| 1739 | atomic_flag() _NOEXCEPT = default; | |
| 1740 | #else | |
| 1741 | atomic_flag() _NOEXCEPT : __a_() {} | |
| 1742 | #endif // _LIBCPP_CXX03_LANG | |
| 2296 | atomic_flag() _NOEXCEPT _LIBCPP_DEFAULT | |
| 1743 | 2297 | |
| 1744 | 2298 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR |
| 1745 | 2299 | atomic_flag(bool __b) _NOEXCEPT : __a_(__b) {} // EXTENSION |
| ... | ... | @@ -1818,14 +2372,14 @@ inline _LIBCPP_INLINE_VISIBILITY |
| 1818 | 2372 | void |
| 1819 | 2373 | atomic_thread_fence(memory_order __m) _NOEXCEPT |
| 1820 | 2374 | { |
| 1821 | __c11_atomic_thread_fence(__m); | |
| 2375 | __cxx_atomic_thread_fence(__m); | |
| 1822 | 2376 | } |
| 1823 | 2377 | |
| 1824 | 2378 | inline _LIBCPP_INLINE_VISIBILITY |
| 1825 | 2379 | void |
| 1826 | 2380 | atomic_signal_fence(memory_order __m) _NOEXCEPT |
| 1827 | 2381 | { |
| 1828 | __c11_atomic_signal_fence(__m); | |
| 2382 | __cxx_atomic_signal_fence(__m); | |
| 1829 | 2383 | } |
| 1830 | 2384 | |
| 1831 | 2385 | // Atomics for standard typedef types |
lib/libcxx/include/bit+339-32| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===------------------------------ bit ----------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===---------------------------------------------------------------------===// |
| 10 | 9 | |
| ... | ... | @@ -16,12 +15,42 @@ |
| 16 | 15 | |
| 17 | 16 | namespace std { |
| 18 | 17 | |
| 18 | template <class T> | |
| 19 | constexpr bool ispow2(T x) noexcept; // C++20 | |
| 20 | template <class T> | |
| 21 | constexpr T ceil2(T x); // C++20 | |
| 22 | template <class T> | |
| 23 | constexpr T floor2(T x) noexcept; // C++20 | |
| 24 | template <class T> | |
| 25 | constexpr T log2p1(T x) noexcept; // C++20 | |
| 26 | ||
| 27 | // 23.20.2, rotating | |
| 28 | template<class T> | |
| 29 | constexpr T rotl(T x, unsigned int s) noexcept; // C++20 | |
| 30 | template<class T> | |
| 31 | constexpr T rotr(T x, unsigned int s) noexcept; // C++20 | |
| 32 | ||
| 33 | // 23.20.3, counting | |
| 34 | template<class T> | |
| 35 | constexpr int countl_zero(T x) noexcept; // C++20 | |
| 36 | template<class T> | |
| 37 | constexpr int countl_one(T x) noexcept; // C++20 | |
| 38 | template<class T> | |
| 39 | constexpr int countr_zero(T x) noexcept; // C++20 | |
| 40 | template<class T> | |
| 41 | constexpr int countr_one(T x) noexcept; // C++20 | |
| 42 | template<class T> | |
| 43 | constexpr int popcount(T x) noexcept; // C++20 | |
| 44 | ||
| 19 | 45 | } // namespace std |
| 20 | 46 | |
| 21 | 47 | */ |
| 22 | 48 | |
| 23 | 49 | #include <__config> |
| 50 | #include <limits> | |
| 51 | #include <type_traits> | |
| 24 | 52 | #include <version> |
| 53 | #include <__debug> | |
| 25 | 54 | |
| 26 | 55 | #if defined(__IBMCPP__) |
| 27 | 56 | #include "support/ibm/support.h" |
| ... | ... | @@ -34,44 +63,47 @@ namespace std { |
| 34 | 63 | #pragma GCC system_header |
| 35 | 64 | #endif |
| 36 | 65 | |
| 66 | _LIBCPP_PUSH_MACROS | |
| 67 | #include <__undef_macros> | |
| 68 | ||
| 37 | 69 | _LIBCPP_BEGIN_NAMESPACE_STD |
| 38 | 70 | |
| 39 | 71 | #ifndef _LIBCPP_COMPILER_MSVC |
| 40 | 72 | |
| 41 | inline _LIBCPP_INLINE_VISIBILITY | |
| 42 | int __ctz(unsigned __x) { return __builtin_ctz(__x); } | |
| 73 | inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR | |
| 74 | int __libcpp_ctz(unsigned __x) _NOEXCEPT { return __builtin_ctz(__x); } | |
| 43 | 75 | |
| 44 | inline _LIBCPP_INLINE_VISIBILITY | |
| 45 | int __ctz(unsigned long __x) { return __builtin_ctzl(__x); } | |
| 76 | inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR | |
| 77 | int __libcpp_ctz(unsigned long __x) _NOEXCEPT { return __builtin_ctzl(__x); } | |
| 46 | 78 | |
| 47 | inline _LIBCPP_INLINE_VISIBILITY | |
| 48 | int __ctz(unsigned long long __x) { return __builtin_ctzll(__x); } | |
| 79 | inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR | |
| 80 | int __libcpp_ctz(unsigned long long __x) _NOEXCEPT { return __builtin_ctzll(__x); } | |
| 49 | 81 | |
| 50 | 82 | |
| 51 | inline _LIBCPP_INLINE_VISIBILITY | |
| 52 | int __clz(unsigned __x) { return __builtin_clz(__x); } | |
| 83 | inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR | |
| 84 | int __libcpp_clz(unsigned __x) _NOEXCEPT { return __builtin_clz(__x); } | |
| 53 | 85 | |
| 54 | inline _LIBCPP_INLINE_VISIBILITY | |
| 55 | int __clz(unsigned long __x) { return __builtin_clzl(__x); } | |
| 86 | inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR | |
| 87 | int __libcpp_clz(unsigned long __x) _NOEXCEPT { return __builtin_clzl(__x); } | |
| 56 | 88 | |
| 57 | inline _LIBCPP_INLINE_VISIBILITY | |
| 58 | int __clz(unsigned long long __x) { return __builtin_clzll(__x); } | |
| 89 | inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR | |
| 90 | int __libcpp_clz(unsigned long long __x) _NOEXCEPT { return __builtin_clzll(__x); } | |
| 59 | 91 | |
| 60 | 92 | |
| 61 | inline _LIBCPP_INLINE_VISIBILITY | |
| 62 | int __popcount(unsigned __x) { return __builtin_popcount(__x); } | |
| 93 | inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR | |
| 94 | int __libcpp_popcount(unsigned __x) _NOEXCEPT { return __builtin_popcount(__x); } | |
| 63 | 95 | |
| 64 | inline _LIBCPP_INLINE_VISIBILITY | |
| 65 | int __popcount(unsigned long __x) { return __builtin_popcountl(__x); } | |
| 96 | inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR | |
| 97 | int __libcpp_popcount(unsigned long __x) _NOEXCEPT { return __builtin_popcountl(__x); } | |
| 66 | 98 | |
| 67 | inline _LIBCPP_INLINE_VISIBILITY | |
| 68 | int __popcount(unsigned long long __x) { return __builtin_popcountll(__x); } | |
| 99 | inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR | |
| 100 | int __libcpp_popcount(unsigned long long __x) _NOEXCEPT { return __builtin_popcountll(__x); } | |
| 69 | 101 | |
| 70 | 102 | #else // _LIBCPP_COMPILER_MSVC |
| 71 | 103 | |
| 72 | 104 | // Precondition: __x != 0 |
| 73 | 105 | inline _LIBCPP_INLINE_VISIBILITY |
| 74 | int __ctz(unsigned __x) { | |
| 106 | int __libcpp_ctz(unsigned __x) { | |
| 75 | 107 | static_assert(sizeof(unsigned) == sizeof(unsigned long), ""); |
| 76 | 108 | static_assert(sizeof(unsigned long) == 4, ""); |
| 77 | 109 | unsigned long __where; |
| ... | ... | @@ -81,13 +113,13 @@ int __ctz(unsigned __x) { |
| 81 | 113 | } |
| 82 | 114 | |
| 83 | 115 | inline _LIBCPP_INLINE_VISIBILITY |
| 84 | int __ctz(unsigned long __x) { | |
| 116 | int __libcpp_ctz(unsigned long __x) { | |
| 85 | 117 | static_assert(sizeof(unsigned long) == sizeof(unsigned), ""); |
| 86 | 118 | return __ctz(static_cast<unsigned>(__x)); |
| 87 | 119 | } |
| 88 | 120 | |
| 89 | 121 | inline _LIBCPP_INLINE_VISIBILITY |
| 90 | int __ctz(unsigned long long __x) { | |
| 122 | int __libcpp_ctz(unsigned long long __x) { | |
| 91 | 123 | unsigned long __where; |
| 92 | 124 | #if defined(_LIBCPP_HAS_BITSCAN64) |
| 93 | 125 | (defined(_M_AMD64) || defined(__x86_64__)) |
| ... | ... | @@ -105,7 +137,7 @@ int __ctz(unsigned long long __x) { |
| 105 | 137 | |
| 106 | 138 | // Precondition: __x != 0 |
| 107 | 139 | inline _LIBCPP_INLINE_VISIBILITY |
| 108 | int __clz(unsigned __x) { | |
| 140 | int __libcpp_clz(unsigned __x) { | |
| 109 | 141 | static_assert(sizeof(unsigned) == sizeof(unsigned long), ""); |
| 110 | 142 | static_assert(sizeof(unsigned long) == 4, ""); |
| 111 | 143 | unsigned long __where; |
| ... | ... | @@ -115,13 +147,13 @@ int __clz(unsigned __x) { |
| 115 | 147 | } |
| 116 | 148 | |
| 117 | 149 | inline _LIBCPP_INLINE_VISIBILITY |
| 118 | int __clz(unsigned long __x) { | |
| 150 | int __libcpp_clz(unsigned long __x) { | |
| 119 | 151 | static_assert(sizeof(unsigned) == sizeof(unsigned long), ""); |
| 120 | return __clz(static_cast<unsigned>(__x)); | |
| 152 | return __libcpp_clz(static_cast<unsigned>(__x)); | |
| 121 | 153 | } |
| 122 | 154 | |
| 123 | 155 | inline _LIBCPP_INLINE_VISIBILITY |
| 124 | int __clz(unsigned long long __x) { | |
| 156 | int __libcpp_clz(unsigned long long __x) { | |
| 125 | 157 | unsigned long __where; |
| 126 | 158 | #if defined(_LIBCPP_HAS_BITSCAN64) |
| 127 | 159 | if (_BitScanReverse64(&__where, __x)) |
| ... | ... | @@ -136,23 +168,298 @@ int __clz(unsigned long long __x) { |
| 136 | 168 | return 64; // Undefined Behavior. |
| 137 | 169 | } |
| 138 | 170 | |
| 139 | inline _LIBCPP_INLINE_VISIBILITY int __popcount(unsigned __x) { | |
| 171 | inline _LIBCPP_INLINE_VISIBILITY int __libcpp_popcount(unsigned __x) { | |
| 140 | 172 | static_assert(sizeof(unsigned) == 4, ""); |
| 141 | 173 | return __popcnt(__x); |
| 142 | 174 | } |
| 143 | 175 | |
| 144 | inline _LIBCPP_INLINE_VISIBILITY int __popcount(unsigned long __x) { | |
| 176 | inline _LIBCPP_INLINE_VISIBILITY int __libcpp_popcount(unsigned long __x) { | |
| 145 | 177 | static_assert(sizeof(unsigned long) == 4, ""); |
| 146 | 178 | return __popcnt(__x); |
| 147 | 179 | } |
| 148 | 180 | |
| 149 | inline _LIBCPP_INLINE_VISIBILITY int __popcount(unsigned long long __x) { | |
| 181 | inline _LIBCPP_INLINE_VISIBILITY int __libcpp_popcount(unsigned long long __x) { | |
| 150 | 182 | static_assert(sizeof(unsigned long long) == 8, ""); |
| 151 | 183 | return __popcnt64(__x); |
| 152 | 184 | } |
| 153 | 185 | |
| 154 | 186 | #endif // _LIBCPP_COMPILER_MSVC |
| 155 | 187 | |
| 188 | template <class _Tp> | |
| 189 | using __bitop_unsigned_integer _LIBCPP_NODEBUG_TYPE = integral_constant<bool, | |
| 190 | is_integral<_Tp>::value && | |
| 191 | is_unsigned<_Tp>::value && | |
| 192 | _IsNotSame<typename remove_cv<_Tp>::type, bool>::value && | |
| 193 | _IsNotSame<typename remove_cv<_Tp>::type, signed char>::value && | |
| 194 | _IsNotSame<typename remove_cv<_Tp>::type, wchar_t>::value && | |
| 195 | _IsNotSame<typename remove_cv<_Tp>::type, char16_t>::value && | |
| 196 | _IsNotSame<typename remove_cv<_Tp>::type, char32_t>::value | |
| 197 | >; | |
| 198 | ||
| 199 | ||
| 200 | template<class _Tp> | |
| 201 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 | |
| 202 | _Tp __rotl(_Tp __t, unsigned int __cnt) _NOEXCEPT | |
| 203 | { | |
| 204 | static_assert(__bitop_unsigned_integer<_Tp>::value, "__rotl requires unsigned"); | |
| 205 | const unsigned int __dig = numeric_limits<_Tp>::digits; | |
| 206 | if ((__cnt % __dig) == 0) | |
| 207 | return __t; | |
| 208 | return (__t << (__cnt % __dig)) | (__t >> (__dig - (__cnt % __dig))); | |
| 209 | } | |
| 210 | ||
| 211 | ||
| 212 | template<class _Tp> | |
| 213 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 | |
| 214 | _Tp __rotr(_Tp __t, unsigned int __cnt) _NOEXCEPT | |
| 215 | { | |
| 216 | static_assert(__bitop_unsigned_integer<_Tp>::value, "__rotr requires unsigned"); | |
| 217 | const unsigned int __dig = numeric_limits<_Tp>::digits; | |
| 218 | if ((__cnt % __dig) == 0) | |
| 219 | return __t; | |
| 220 | return (__t >> (__cnt % __dig)) | (__t << (__dig - (__cnt % __dig))); | |
| 221 | } | |
| 222 | ||
| 223 | ||
| 224 | ||
| 225 | template<class _Tp> | |
| 226 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 | |
| 227 | int __countr_zero(_Tp __t) _NOEXCEPT | |
| 228 | { | |
| 229 | static_assert(__bitop_unsigned_integer<_Tp>::value, "__countr_zero requires unsigned"); | |
| 230 | if (__t == 0) | |
| 231 | return numeric_limits<_Tp>::digits; | |
| 232 | ||
| 233 | if (sizeof(_Tp) <= sizeof(unsigned int)) | |
| 234 | return __libcpp_ctz(static_cast<unsigned int>(__t)); | |
| 235 | else if (sizeof(_Tp) <= sizeof(unsigned long)) | |
| 236 | return __libcpp_ctz(static_cast<unsigned long>(__t)); | |
| 237 | else if (sizeof(_Tp) <= sizeof(unsigned long long)) | |
| 238 | return __libcpp_ctz(static_cast<unsigned long long>(__t)); | |
| 239 | else | |
| 240 | { | |
| 241 | int __ret = 0; | |
| 242 | int __iter = 0; | |
| 243 | const unsigned int __ulldigits = numeric_limits<unsigned long long>::digits; | |
| 244 | while ((__iter = __libcpp_ctz(static_cast<unsigned long long>(__t))) == __ulldigits) | |
| 245 | { | |
| 246 | __ret += __iter; | |
| 247 | __t >>= __ulldigits; | |
| 248 | } | |
| 249 | return __ret + __iter; | |
| 250 | } | |
| 251 | } | |
| 252 | ||
| 253 | template<class _Tp> | |
| 254 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 | |
| 255 | int __countl_zero(_Tp __t) _NOEXCEPT | |
| 256 | { | |
| 257 | static_assert(__bitop_unsigned_integer<_Tp>::value, "__countl_zero requires unsigned"); | |
| 258 | if (__t == 0) | |
| 259 | return numeric_limits<_Tp>::digits; | |
| 260 | ||
| 261 | if (sizeof(_Tp) <= sizeof(unsigned int)) | |
| 262 | return __libcpp_clz(static_cast<unsigned int>(__t)) | |
| 263 | - (numeric_limits<unsigned int>::digits - numeric_limits<_Tp>::digits); | |
| 264 | else if (sizeof(_Tp) <= sizeof(unsigned long)) | |
| 265 | return __libcpp_clz(static_cast<unsigned long>(__t)) | |
| 266 | - (numeric_limits<unsigned long>::digits - numeric_limits<_Tp>::digits); | |
| 267 | else if (sizeof(_Tp) <= sizeof(unsigned long long)) | |
| 268 | return __libcpp_clz(static_cast<unsigned long long>(__t)) | |
| 269 | - (numeric_limits<unsigned long long>::digits - numeric_limits<_Tp>::digits); | |
| 270 | else | |
| 271 | { | |
| 272 | int __ret = 0; | |
| 273 | int __iter = 0; | |
| 274 | const unsigned int __ulldigits = numeric_limits<unsigned long long>::digits; | |
| 275 | while (true) { | |
| 276 | __t = __rotr(__t, __ulldigits); | |
| 277 | if ((__iter = __countl_zero(static_cast<unsigned long long>(__t))) != __ulldigits) | |
| 278 | break; | |
| 279 | __ret += __iter; | |
| 280 | } | |
| 281 | return __ret + __iter; | |
| 282 | } | |
| 283 | } | |
| 284 | ||
| 285 | template<class _Tp> | |
| 286 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 | |
| 287 | int __countl_one(_Tp __t) _NOEXCEPT | |
| 288 | { | |
| 289 | static_assert(__bitop_unsigned_integer<_Tp>::value, "__countl_one requires unsigned"); | |
| 290 | return __t != numeric_limits<_Tp>::max() | |
| 291 | ? __countl_zero(static_cast<_Tp>(~__t)) | |
| 292 | : numeric_limits<_Tp>::digits; | |
| 293 | } | |
| 294 | ||
| 295 | ||
| 296 | template<class _Tp> | |
| 297 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 | |
| 298 | int __countr_one(_Tp __t) _NOEXCEPT | |
| 299 | { | |
| 300 | static_assert(__bitop_unsigned_integer<_Tp>::value, "__countr_one requires unsigned"); | |
| 301 | return __t != numeric_limits<_Tp>::max() | |
| 302 | ? __countr_zero(static_cast<_Tp>(~__t)) | |
| 303 | : numeric_limits<_Tp>::digits; | |
| 304 | } | |
| 305 | ||
| 306 | ||
| 307 | template<class _Tp> | |
| 308 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 | |
| 309 | int | |
| 310 | __popcount(_Tp __t) _NOEXCEPT | |
| 311 | { | |
| 312 | static_assert(__bitop_unsigned_integer<_Tp>::value, "__libcpp_popcount requires unsigned"); | |
| 313 | if (sizeof(_Tp) <= sizeof(unsigned int)) | |
| 314 | return __libcpp_popcount(static_cast<unsigned int>(__t)); | |
| 315 | else if (sizeof(_Tp) <= sizeof(unsigned long)) | |
| 316 | return __libcpp_popcount(static_cast<unsigned long>(__t)); | |
| 317 | else if (sizeof(_Tp) <= sizeof(unsigned long long)) | |
| 318 | return __libcpp_popcount(static_cast<unsigned long long>(__t)); | |
| 319 | else | |
| 320 | { | |
| 321 | int __ret = 0; | |
| 322 | while (__t != 0) | |
| 323 | { | |
| 324 | __ret += __libcpp_popcount(static_cast<unsigned long long>(__t)); | |
| 325 | __t >>= numeric_limits<unsigned long long>::digits; | |
| 326 | } | |
| 327 | return __ret; | |
| 328 | } | |
| 329 | } | |
| 330 | ||
| 331 | ||
| 332 | // integral log base 2 | |
| 333 | template<class _Tp> | |
| 334 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 | |
| 335 | unsigned __bit_log2(_Tp __t) _NOEXCEPT | |
| 336 | { | |
| 337 | static_assert(__bitop_unsigned_integer<_Tp>::value, "__bit_log2 requires unsigned"); | |
| 338 | return std::numeric_limits<_Tp>::digits - 1 - __countl_zero(__t); | |
| 339 | } | |
| 340 | ||
| 341 | template <class _Tp> | |
| 342 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR | |
| 343 | bool __ispow2(_Tp __t) _NOEXCEPT | |
| 344 | { | |
| 345 | static_assert(__bitop_unsigned_integer<_Tp>::value, "__ispow2 requires unsigned"); | |
| 346 | 	return __t != 0 && (((__t & (__t - 1)) == 0)); | |
| 347 | } | |
| 348 | ||
| 349 | ||
| 350 | #if _LIBCPP_STD_VER > 17 | |
| 351 | ||
| 352 | template<class _Tp> | |
| 353 | _LIBCPP_INLINE_VISIBILITY constexpr | |
| 354 | enable_if_t<__bitop_unsigned_integer<_Tp>::value, _Tp> | |
| 355 | rotl(_Tp __t, unsigned int __cnt) noexcept | |
| 356 | { | |
| 357 | return __rotl(__t, __cnt); | |
| 358 | } | |
| 359 | ||
| 360 | ||
| 361 | // rotr | |
| 362 | template<class _Tp> | |
| 363 | _LIBCPP_INLINE_VISIBILITY constexpr | |
| 364 | enable_if_t<__bitop_unsigned_integer<_Tp>::value, _Tp> | |
| 365 | rotr(_Tp __t, unsigned int __cnt) noexcept | |
| 366 | { | |
| 367 | return __rotr(__t, __cnt); | |
| 368 | } | |
| 369 | ||
| 370 | ||
| 371 | template<class _Tp> | |
| 372 | _LIBCPP_INLINE_VISIBILITY constexpr | |
| 373 | enable_if_t<__bitop_unsigned_integer<_Tp>::value, int> | |
| 374 | countl_zero(_Tp __t) noexcept | |
| 375 | { | |
| 376 | return __countl_zero(__t); | |
| 377 | } | |
| 378 | ||
| 379 | ||
| 380 | template<class _Tp> | |
| 381 | _LIBCPP_INLINE_VISIBILITY constexpr | |
| 382 | enable_if_t<__bitop_unsigned_integer<_Tp>::value, int> | |
| 383 | countl_one(_Tp __t) noexcept | |
| 384 | { | |
| 385 | return __countl_one(__t); | |
| 386 | } | |
| 387 | ||
| 388 | ||
| 389 | template<class _Tp> | |
| 390 | _LIBCPP_INLINE_VISIBILITY constexpr | |
| 391 | enable_if_t<__bitop_unsigned_integer<_Tp>::value, int> | |
| 392 | countr_zero(_Tp __t) noexcept | |
| 393 | { | |
| 394 | 	return __countr_zero(__t); | |
| 395 | } | |
| 396 | ||
| 397 | ||
| 398 | template<class _Tp> | |
| 399 | _LIBCPP_INLINE_VISIBILITY constexpr | |
| 400 | enable_if_t<__bitop_unsigned_integer<_Tp>::value, int> | |
| 401 | countr_one(_Tp __t) noexcept | |
| 402 | { | |
| 403 | return __countr_one(__t); | |
| 404 | } | |
| 405 | ||
| 406 | ||
| 407 | template<class _Tp> | |
| 408 | _LIBCPP_INLINE_VISIBILITY constexpr | |
| 409 | enable_if_t<__bitop_unsigned_integer<_Tp>::value, int> | |
| 410 | popcount(_Tp __t) noexcept | |
| 411 | { | |
| 412 | return __popcount(__t); | |
| 413 | } | |
| 414 | ||
| 415 | ||
| 416 | template <class _Tp> | |
| 417 | _LIBCPP_INLINE_VISIBILITY constexpr | |
| 418 | enable_if_t<__bitop_unsigned_integer<_Tp>::value, bool> | |
| 419 | ispow2(_Tp __t) noexcept | |
| 420 | { | |
| 421 | return __ispow2(__t); | |
| 422 | } | |
| 423 | ||
| 424 | template <class _Tp> | |
| 425 | _LIBCPP_INLINE_VISIBILITY constexpr | |
| 426 | enable_if_t<__bitop_unsigned_integer<_Tp>::value, _Tp> | |
| 427 | floor2(_Tp __t) noexcept | |
| 428 | { | |
| 429 | return __t == 0 ? 0 : _Tp{1} << __bit_log2(__t); | |
| 430 | } | |
| 431 | ||
| 432 | template <class _Tp> | |
| 433 | _LIBCPP_INLINE_VISIBILITY constexpr | |
| 434 | enable_if_t<__bitop_unsigned_integer<_Tp>::value, _Tp> | |
| 435 | ceil2(_Tp __t) noexcept | |
| 436 | { | |
| 437 | if (__t < 2) return 1; | |
| 438 | const unsigned __n = numeric_limits<_Tp>::digits - countl_zero((_Tp)(__t - 1u)); | |
| 439 | _LIBCPP_DEBUG_ASSERT(__libcpp_is_constant_evaluated() || __n != numeric_limits<_Tp>::digits, "Bad input to ceil2"); | |
| 440 | ||
| 441 | if constexpr (sizeof(_Tp) >= sizeof(unsigned)) | |
| 442 | return _Tp{1} << __n; | |
| 443 | else | |
| 444 | { | |
| 445 | const unsigned __extra = numeric_limits<unsigned>::digits - numeric_limits<_Tp>::digits; | |
| 446 | const unsigned __retVal = 1u << (__n + __extra); | |
| 447 | return (_Tp) (__retVal >> __extra); | |
| 448 | } | |
| 449 | } | |
| 450 | ||
| 451 | template <class _Tp> | |
| 452 | _LIBCPP_INLINE_VISIBILITY constexpr | |
| 453 | enable_if_t<__bitop_unsigned_integer<_Tp>::value, _Tp> | |
| 454 | log2p1(_Tp __t) noexcept | |
| 455 | { | |
| 456 | return __t == 0 ? 0 : __bit_log2(__t) + 1; | |
| 457 | } | |
| 458 | ||
| 459 | #endif // _LIBCPP_STD_VER > 17 | |
| 460 | ||
| 156 | 461 | _LIBCPP_END_NAMESPACE_STD |
| 157 | 462 | |
| 463 | _LIBCPP_POP_MACROS | |
| 464 | ||
| 158 | 465 | #endif // _LIBCPP_BIT |
lib/libcxx/include/bitset+5-6| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===---------------------------- bitset ----------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 | |
| ... | ... | @@ -680,7 +679,7 @@ public: |
| 680 | 679 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR bitset() _NOEXCEPT {} |
| 681 | 680 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR |
| 682 | 681 | bitset(unsigned long long __v) _NOEXCEPT : base(__v) {} |
| 683 | template<class _CharT> | |
| 682 | template<class _CharT, class = _EnableIf<_IsCharLikeType<_CharT>::value> > | |
| 684 | 683 | explicit bitset(const _CharT* __str, |
| 685 | 684 | typename basic_string<_CharT>::size_type __n = basic_string<_CharT>::npos, |
| 686 | 685 | _CharT __zero = _CharT('0'), _CharT __one = _CharT('1')); |
| ... | ... | @@ -761,7 +760,7 @@ private: |
| 761 | 760 | }; |
| 762 | 761 | |
| 763 | 762 | template <size_t _Size> |
| 764 | template<class _CharT> | |
| 763 | template<class _CharT, class> | |
| 765 | 764 | bitset<_Size>::bitset(const _CharT* __str, |
| 766 | 765 | typename basic_string<_CharT>::size_type __n, |
| 767 | 766 | _CharT __zero, _CharT __one) |
lib/libcxx/include/cassert+3-4| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===-------------------------- cassert -----------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 |
lib/libcxx/include/ccomplex+3-4| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===--------------------------- ccomplex ---------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 |
lib/libcxx/include/cctype+3-4| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===---------------------------- cctype ----------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 |
lib/libcxx/include/cerrno+3-4| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===-------------------------- cerrno ------------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 |
lib/libcxx/include/cfenv+3-4| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===---------------------------- cfenv -----------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 |
lib/libcxx/include/cfloat+3-4| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===--------------------------- cfloat -----------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 |
lib/libcxx/include/charconv+21-22| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===------------------------------ charconv ------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 | |
| ... | ... | @@ -97,7 +96,7 @@ _LIBCPP_FUNC_VIS char* __u64toa(uint64_t __value, char* __buffer); |
| 97 | 96 | _LIBCPP_FUNC_VIS char* __u32toa(uint32_t __value, char* __buffer); |
| 98 | 97 | } |
| 99 | 98 | |
| 100 | #if _LIBCPP_STD_VER > 11 | |
| 99 | #ifndef _LIBCPP_CXX03_LANG | |
| 101 | 100 | |
| 102 | 101 | enum class _LIBCPP_ENUM_VIS chars_format |
| 103 | 102 | { |
| ... | ... | @@ -125,7 +124,7 @@ void from_chars(const char*, const char*, bool, int = 10) = delete; |
| 125 | 124 | namespace __itoa |
| 126 | 125 | { |
| 127 | 126 | |
| 128 | static constexpr uint64_t __pow10_64[] = { | |
| 127 | static _LIBCPP_CONSTEXPR uint64_t __pow10_64[] = { | |
| 129 | 128 | UINT64_C(0), |
| 130 | 129 | UINT64_C(10), |
| 131 | 130 | UINT64_C(100), |
| ... | ... | @@ -148,7 +147,7 @@ static constexpr uint64_t __pow10_64[] = { |
| 148 | 147 | UINT64_C(10000000000000000000), |
| 149 | 148 | }; |
| 150 | 149 | |
| 151 | static constexpr uint32_t __pow10_32[] = { | |
| 150 | static _LIBCPP_CONSTEXPR uint32_t __pow10_32[] = { | |
| 152 | 151 | UINT32_C(0), UINT32_C(10), UINT32_C(100), |
| 153 | 152 | UINT32_C(1000), UINT32_C(10000), UINT32_C(100000), |
| 154 | 153 | UINT32_C(1000000), UINT32_C(10000000), UINT32_C(100000000), |
| ... | ... | @@ -173,7 +172,7 @@ struct _LIBCPP_HIDDEN __traits_base |
| 173 | 172 | return __u64toa(__v, __p); |
| 174 | 173 | } |
| 175 | 174 | |
| 176 | static _LIBCPP_INLINE_VISIBILITY auto& __pow() { return __pow10_64; } | |
| 175 | static _LIBCPP_INLINE_VISIBILITY decltype(__pow10_64)& __pow() { return __pow10_64; } | |
| 177 | 176 | }; |
| 178 | 177 | |
| 179 | 178 | template <typename _Tp> |
| ... | ... | @@ -195,7 +194,7 @@ struct _LIBCPP_HIDDEN |
| 195 | 194 | return __u32toa(__v, __p); |
| 196 | 195 | } |
| 197 | 196 | |
| 198 | static _LIBCPP_INLINE_VISIBILITY auto& __pow() { return __pow10_32; } | |
| 197 | static _LIBCPP_INLINE_VISIBILITY decltype(__pow10_32)& __pow() { return __pow10_32; } | |
| 199 | 198 | }; |
| 200 | 199 | |
| 201 | 200 | template <typename _Tp> |
| ... | ... | @@ -240,7 +239,7 @@ __mul_overflowed(_Tp __a, _Up __b, _Tp& __r) |
| 240 | 239 | template <typename _Tp> |
| 241 | 240 | struct _LIBCPP_HIDDEN __traits : __traits_base<_Tp> |
| 242 | 241 | { |
| 243 | static constexpr int digits = numeric_limits<_Tp>::digits10 + 1; | |
| 242 | static _LIBCPP_CONSTEXPR int digits = numeric_limits<_Tp>::digits10 + 1; | |
| 244 | 243 | using __traits_base<_Tp>::__pow; |
| 245 | 244 | using typename __traits_base<_Tp>::type; |
| 246 | 245 | |
| ... | ... | @@ -286,10 +285,10 @@ __complement(_Tp __x) |
| 286 | 285 | } |
| 287 | 286 | |
| 288 | 287 | template <typename _Tp> |
| 289 | inline _LIBCPP_INLINE_VISIBILITY auto | |
| 288 | inline _LIBCPP_INLINE_VISIBILITY typename make_unsigned<_Tp>::type | |
| 290 | 289 | __to_unsigned(_Tp __x) |
| 291 | 290 | { |
| 292 | return static_cast<make_unsigned_t<_Tp>>(__x); | |
| 291 | return static_cast<typename make_unsigned<_Tp>::type>(__x); | |
| 293 | 292 | } |
| 294 | 293 | |
| 295 | 294 | template <typename _Tp> |
| ... | ... | @@ -315,7 +314,7 @@ __to_chars_itoa(char* __first, char* __last, _Tp __value, false_type) |
| 315 | 314 | |
| 316 | 315 | #if !defined(_LIBCPP_COMPILER_MSVC) |
| 317 | 316 | if (__tx::digits <= __diff || __tx::__width(__value) <= __diff) |
| 318 | return {__tx::__convert(__value, __first), {}}; | |
| 317 | return {__tx::__convert(__value, __first), errc(0)}; | |
| 319 | 318 | else |
| 320 | 319 | return {__last, errc::value_too_large}; |
| 321 | 320 | #else |
| ... | ... | @@ -380,14 +379,14 @@ __to_chars_integral(char* __first, char* __last, _Tp __value, int __base, |
| 380 | 379 | } |
| 381 | 380 | } |
| 382 | 381 | |
| 383 | template <typename _Tp, enable_if_t<is_integral<_Tp>::value, int> = 0> | |
| 382 | template <typename _Tp, typename enable_if<is_integral<_Tp>::value, int>::type = 0> | |
| 384 | 383 | inline _LIBCPP_INLINE_VISIBILITY to_chars_result |
| 385 | 384 | to_chars(char* __first, char* __last, _Tp __value) |
| 386 | 385 | { |
| 387 | 386 | return __to_chars_itoa(__first, __last, __value, is_signed<_Tp>()); |
| 388 | 387 | } |
| 389 | 388 | |
| 390 | template <typename _Tp, enable_if_t<is_integral<_Tp>::value, int> = 0> | |
| 389 | template <typename _Tp, typename enable_if<is_integral<_Tp>::value, int>::type = 0> | |
| 391 | 390 | inline _LIBCPP_INLINE_VISIBILITY to_chars_result |
| 392 | 391 | to_chars(char* __first, char* __last, _Tp __value, int __base) |
| 393 | 392 | { |
| ... | ... | @@ -502,7 +501,7 @@ __subject_seq_combinator(_It __first, _It __last, _Tp& __value, _Fn __f, |
| 502 | 501 | return __r; |
| 503 | 502 | } |
| 504 | 503 | |
| 505 | template <typename _Tp, enable_if_t<is_unsigned<_Tp>::value, int> = 0> | |
| 504 | template <typename _Tp, typename enable_if<is_unsigned<_Tp>::value, int>::type = 0> | |
| 506 | 505 | inline _LIBCPP_INLINE_VISIBILITY from_chars_result |
| 507 | 506 | __from_chars_atoi(const char* __first, const char* __last, _Tp& __value) |
| 508 | 507 | { |
| ... | ... | @@ -528,7 +527,7 @@ __from_chars_atoi(const char* __first, const char* __last, _Tp& __value) |
| 528 | 527 | }); |
| 529 | 528 | } |
| 530 | 529 | |
| 531 | template <typename _Tp, enable_if_t<is_signed<_Tp>::value, int> = 0> | |
| 530 | template <typename _Tp, typename enable_if<is_signed<_Tp>::value, int>::type = 0> | |
| 532 | 531 | inline _LIBCPP_INLINE_VISIBILITY from_chars_result |
| 533 | 532 | __from_chars_atoi(const char* __first, const char* __last, _Tp& __value) |
| 534 | 533 | { |
| ... | ... | @@ -536,7 +535,7 @@ __from_chars_atoi(const char* __first, const char* __last, _Tp& __value) |
| 536 | 535 | return __sign_combinator(__first, __last, __value, __from_chars_atoi<__t>); |
| 537 | 536 | } |
| 538 | 537 | |
| 539 | template <typename _Tp, enable_if_t<is_unsigned<_Tp>::value, int> = 0> | |
| 538 | template <typename _Tp, typename enable_if<is_unsigned<_Tp>::value, int>::type = 0> | |
| 540 | 539 | inline _LIBCPP_INLINE_VISIBILITY from_chars_result |
| 541 | 540 | __from_chars_integral(const char* __first, const char* __last, _Tp& __value, |
| 542 | 541 | int __base) |
| ... | ... | @@ -583,7 +582,7 @@ __from_chars_integral(const char* __first, const char* __last, _Tp& __value, |
| 583 | 582 | __base); |
| 584 | 583 | } |
| 585 | 584 | |
| 586 | template <typename _Tp, enable_if_t<is_signed<_Tp>::value, int> = 0> | |
| 585 | template <typename _Tp, typename enable_if<is_signed<_Tp>::value, int>::type = 0> | |
| 587 | 586 | inline _LIBCPP_INLINE_VISIBILITY from_chars_result |
| 588 | 587 | __from_chars_integral(const char* __first, const char* __last, _Tp& __value, |
| 589 | 588 | int __base) |
| ... | ... | @@ -593,14 +592,14 @@ __from_chars_integral(const char* __first, const char* __last, _Tp& __value, |
| 593 | 592 | __from_chars_integral<__t>, __base); |
| 594 | 593 | } |
| 595 | 594 | |
| 596 | template <typename _Tp, enable_if_t<is_integral<_Tp>::value, int> = 0> | |
| 595 | template <typename _Tp, typename enable_if<is_integral<_Tp>::value, int>::type = 0> | |
| 597 | 596 | inline _LIBCPP_INLINE_VISIBILITY from_chars_result |
| 598 | 597 | from_chars(const char* __first, const char* __last, _Tp& __value) |
| 599 | 598 | { |
| 600 | 599 | return __from_chars_atoi(__first, __last, __value); |
| 601 | 600 | } |
| 602 | 601 | |
| 603 | template <typename _Tp, enable_if_t<is_integral<_Tp>::value, int> = 0> | |
| 602 | template <typename _Tp, typename enable_if<is_integral<_Tp>::value, int>::type = 0> | |
| 604 | 603 | inline _LIBCPP_INLINE_VISIBILITY from_chars_result |
| 605 | 604 | from_chars(const char* __first, const char* __last, _Tp& __value, int __base) |
| 606 | 605 | { |
| ... | ... | @@ -608,7 +607,7 @@ from_chars(const char* __first, const char* __last, _Tp& __value, int __base) |
| 608 | 607 | return __from_chars_integral(__first, __last, __value, __base); |
| 609 | 608 | } |
| 610 | 609 | |
| 611 | #endif // _LIBCPP_STD_VER > 11 | |
| 610 | #endif // _LIBCPP_CXX03_LANG | |
| 612 | 611 | |
| 613 | 612 | _LIBCPP_END_NAMESPACE_STD |
| 614 | 613 |
lib/libcxx/include/chrono+47-62| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===---------------------------- chrono ----------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 | |
| ... | ... | @@ -1263,34 +1262,15 @@ operator*(const _Rep1& __s, const duration<_Rep2, _Period>& __d) |
| 1263 | 1262 | |
| 1264 | 1263 | // Duration / |
| 1265 | 1264 | |
| 1266 | template <class _Duration, class _Rep, bool = __is_duration<_Rep>::value> | |
| 1267 | struct __duration_divide_result | |
| 1268 | { | |
| 1269 | }; | |
| 1270 | ||
| 1271 | template <class _Duration, class _Rep2, | |
| 1272 | bool = is_convertible<_Rep2, | |
| 1273 | typename common_type<typename _Duration::rep, _Rep2>::type>::value> | |
| 1274 | struct __duration_divide_imp | |
| 1275 | { | |
| 1276 | }; | |
| 1277 | ||
| 1278 | template <class _Rep1, class _Period, class _Rep2> | |
| 1279 | struct __duration_divide_imp<duration<_Rep1, _Period>, _Rep2, true> | |
| 1280 | { | |
| 1281 | typedef duration<typename common_type<_Rep1, _Rep2>::type, _Period> type; | |
| 1282 | }; | |
| 1283 | ||
| 1284 | template <class _Rep1, class _Period, class _Rep2> | |
| 1285 | struct __duration_divide_result<duration<_Rep1, _Period>, _Rep2, false> | |
| 1286 | : __duration_divide_imp<duration<_Rep1, _Period>, _Rep2> | |
| 1287 | { | |
| 1288 | }; | |
| 1289 | ||
| 1290 | 1265 | template <class _Rep1, class _Period, class _Rep2> |
| 1291 | 1266 | inline _LIBCPP_INLINE_VISIBILITY |
| 1292 | 1267 | _LIBCPP_CONSTEXPR |
| 1293 | typename __duration_divide_result<duration<_Rep1, _Period>, _Rep2>::type | |
| 1268 | typename enable_if | |
| 1269 | < | |
| 1270 | !__is_duration<_Rep2>::value && | |
| 1271 | is_convertible<_Rep2, typename common_type<_Rep1, _Rep2>::type>::value, | |
| 1272 | duration<typename common_type<_Rep1, _Rep2>::type, _Period> | |
| 1273 | >::type | |
| 1294 | 1274 | operator/(const duration<_Rep1, _Period>& __d, const _Rep2& __s) |
| 1295 | 1275 | { |
| 1296 | 1276 | typedef typename common_type<_Rep1, _Rep2>::type _Cr; |
| ... | ... | @@ -1313,7 +1293,12 @@ operator/(const duration<_Rep1, _Period1>& __lhs, const duration<_Rep2, _Period2 |
| 1313 | 1293 | template <class _Rep1, class _Period, class _Rep2> |
| 1314 | 1294 | inline _LIBCPP_INLINE_VISIBILITY |
| 1315 | 1295 | _LIBCPP_CONSTEXPR |
| 1316 | typename __duration_divide_result<duration<_Rep1, _Period>, _Rep2>::type | |
| 1296 | typename enable_if | |
| 1297 | < | |
| 1298 | !__is_duration<_Rep2>::value && | |
| 1299 | is_convertible<_Rep2, typename common_type<_Rep1, _Rep2>::type>::value, | |
| 1300 | duration<typename common_type<_Rep1, _Rep2>::type, _Period> | |
| 1301 | >::type | |
| 1317 | 1302 | operator%(const duration<_Rep1, _Period>& __d, const _Rep2& __s) |
| 1318 | 1303 | { |
| 1319 | 1304 | typedef typename common_type<_Rep1, _Rep2>::type _Cr; |
| ... | ... | @@ -1605,9 +1590,9 @@ using local_seconds = local_time<seconds>; |
| 1605 | 1590 | using local_days = local_time<days>; |
| 1606 | 1591 | |
| 1607 | 1592 | |
| 1608 | struct _LIBCPP_TYPE_VIS last_spec { explicit last_spec() = default; }; | |
| 1593 | struct last_spec { explicit last_spec() = default; }; | |
| 1609 | 1594 | |
| 1610 | class _LIBCPP_TYPE_VIS day { | |
| 1595 | class day { | |
| 1611 | 1596 | private: |
| 1612 | 1597 | unsigned char __d; |
| 1613 | 1598 | public: |
| ... | ... | @@ -1672,7 +1657,7 @@ inline constexpr day& day::operator-=(const days& __dd) noexcept |
| 1672 | 1657 | { *this = *this - __dd; return *this; } |
| 1673 | 1658 | |
| 1674 | 1659 | |
| 1675 | class _LIBCPP_TYPE_VIS month { | |
| 1660 | class month { | |
| 1676 | 1661 | private: |
| 1677 | 1662 | unsigned char __m; |
| 1678 | 1663 | public: |
| ... | ... | @@ -1743,21 +1728,21 @@ inline constexpr month& month::operator-=(const months& __dm) noexcept |
| 1743 | 1728 | { *this = *this - __dm; return *this; } |
| 1744 | 1729 | |
| 1745 | 1730 | |
| 1746 | class _LIBCPP_TYPE_VIS year { | |
| 1731 | class year { | |
| 1747 | 1732 | private: |
| 1748 | 1733 | short __y; |
| 1749 | 1734 | public: |
| 1750 | 1735 | year() = default; |
| 1751 | 1736 | explicit inline constexpr year(int __val) noexcept : __y(static_cast<short>(__val)) {} |
| 1752 | 1737 | |
| 1753 | inline constexpr year& operator++() noexcept { ++__y; return *this; }; | |
| 1754 | inline constexpr year operator++(int) noexcept { year __tmp = *this; ++(*this); return __tmp; }; | |
| 1755 | inline constexpr year& operator--() noexcept { --__y; return *this; }; | |
| 1756 | inline constexpr year operator--(int) noexcept { year __tmp = *this; --(*this); return __tmp; }; | |
| 1738 | inline constexpr year& operator++() noexcept { ++__y; return *this; } | |
| 1739 | inline constexpr year operator++(int) noexcept { year __tmp = *this; ++(*this); return __tmp; } | |
| 1740 | inline constexpr year& operator--() noexcept { --__y; return *this; } | |
| 1741 | inline constexpr year operator--(int) noexcept { year __tmp = *this; --(*this); return __tmp; } | |
| 1757 | 1742 | constexpr year& operator+=(const years& __dy) noexcept; |
| 1758 | 1743 | constexpr year& operator-=(const years& __dy) noexcept; |
| 1759 | 1744 | inline constexpr year operator+() const noexcept { return *this; } |
| 1760 | inline constexpr year operator-() const noexcept { return year{-__y}; }; | |
| 1745 | inline constexpr year operator-() const noexcept { return year{-__y}; } | |
| 1761 | 1746 | |
| 1762 | 1747 | inline constexpr bool is_leap() const noexcept { return __y % 4 == 0 && (__y % 100 != 0 || __y % 400 == 0); } |
| 1763 | 1748 | explicit inline constexpr operator int() const noexcept { return __y; } |
| ... | ... | @@ -1817,10 +1802,10 @@ inline constexpr year& year::operator-=(const years& __dy) noexcept |
| 1817 | 1802 | inline constexpr bool year::ok() const noexcept |
| 1818 | 1803 | { return static_cast<int>(min()) <= __y && __y <= static_cast<int>(max()); } |
| 1819 | 1804 | |
| 1820 | class _LIBCPP_TYPE_VIS weekday_indexed; | |
| 1821 | class _LIBCPP_TYPE_VIS weekday_last; | |
| 1805 | class weekday_indexed; | |
| 1806 | class weekday_last; | |
| 1822 | 1807 | |
| 1823 | class _LIBCPP_TYPE_VIS weekday { | |
| 1808 | class weekday { | |
| 1824 | 1809 | private: |
| 1825 | 1810 | unsigned char __wd; |
| 1826 | 1811 | public: |
| ... | ... | @@ -1906,7 +1891,7 @@ inline constexpr weekday& weekday::operator-=(const days& __dd) noexcept |
| 1906 | 1891 | { *this = *this - __dd; return *this; } |
| 1907 | 1892 | |
| 1908 | 1893 | |
| 1909 | class _LIBCPP_TYPE_VIS weekday_indexed { | |
| 1894 | class weekday_indexed { | |
| 1910 | 1895 | private: |
| 1911 | 1896 | _VSTD::chrono::weekday __wd; |
| 1912 | 1897 | unsigned char __idx; |
| ... | ... | @@ -1928,7 +1913,7 @@ bool operator!=(const weekday_indexed& __lhs, const weekday_indexed& __rhs) noex |
| 1928 | 1913 | { return !(__lhs == __rhs); } |
| 1929 | 1914 | |
| 1930 | 1915 | |
| 1931 | class _LIBCPP_TYPE_VIS weekday_last { | |
| 1916 | class weekday_last { | |
| 1932 | 1917 | private: |
| 1933 | 1918 | _VSTD::chrono::weekday __wd; |
| 1934 | 1919 | public: |
| ... | ... | @@ -1949,7 +1934,7 @@ bool operator!=(const weekday_last& __lhs, const weekday_last& __rhs) noexcept |
| 1949 | 1934 | inline constexpr |
| 1950 | 1935 | weekday_indexed weekday::operator[](unsigned __index) const noexcept { return weekday_indexed{*this, __index}; } |
| 1951 | 1936 | |
| 1952 | inline constexpr | |
| 1937 | inline constexpr | |
| 1953 | 1938 | weekday_last weekday::operator[](last_spec) const noexcept { return weekday_last{*this}; } |
| 1954 | 1939 | |
| 1955 | 1940 | |
| ... | ... | @@ -1976,7 +1961,7 @@ inline constexpr month November{11}; |
| 1976 | 1961 | inline constexpr month December{12}; |
| 1977 | 1962 | |
| 1978 | 1963 | |
| 1979 | class _LIBCPP_TYPE_VIS month_day { | |
| 1964 | class month_day { | |
| 1980 | 1965 | private: |
| 1981 | 1966 | chrono::month __m; |
| 1982 | 1967 | chrono::day __d; |
| ... | ... | @@ -2051,7 +2036,7 @@ bool operator>=(const month_day& __lhs, const month_day& __rhs) noexcept |
| 2051 | 2036 | |
| 2052 | 2037 | |
| 2053 | 2038 | |
| 2054 | class _LIBCPP_TYPE_VIS month_day_last { | |
| 2039 | class month_day_last { | |
| 2055 | 2040 | private: |
| 2056 | 2041 | chrono::month __m; |
| 2057 | 2042 | public: |
| ... | ... | @@ -2102,7 +2087,7 @@ month_day_last operator/(last_spec, int __rhs) noexcept |
| 2102 | 2087 | { return month_day_last{month(__rhs)}; } |
| 2103 | 2088 | |
| 2104 | 2089 | |
| 2105 | class _LIBCPP_TYPE_VIS month_weekday { | |
| 2090 | class month_weekday { | |
| 2106 | 2091 | private: |
| 2107 | 2092 | chrono::month __m; |
| 2108 | 2093 | chrono::weekday_indexed __wdi; |
| ... | ... | @@ -2140,7 +2125,7 @@ month_weekday operator/(const weekday_indexed& __lhs, int __rhs) noexcept |
| 2140 | 2125 | { return month_weekday{month(__rhs), __lhs}; } |
| 2141 | 2126 | |
| 2142 | 2127 | |
| 2143 | class _LIBCPP_TYPE_VIS month_weekday_last { | |
| 2128 | class month_weekday_last { | |
| 2144 | 2129 | chrono::month __m; |
| 2145 | 2130 | chrono::weekday_last __wdl; |
| 2146 | 2131 | public: |
| ... | ... | @@ -2177,7 +2162,7 @@ month_weekday_last operator/(const weekday_last& __lhs, int __rhs) noexcept |
| 2177 | 2162 | { return month_weekday_last{month(__rhs), __lhs}; } |
| 2178 | 2163 | |
| 2179 | 2164 | |
| 2180 | class _LIBCPP_TYPE_VIS year_month { | |
| 2165 | class year_month { | |
| 2181 | 2166 | chrono::year __y; |
| 2182 | 2167 | chrono::month __m; |
| 2183 | 2168 | public: |
| ... | ... | @@ -2251,7 +2236,7 @@ constexpr year_month operator-(const year_month& __lhs, const years& __rhs) noex |
| 2251 | 2236 | |
| 2252 | 2237 | class year_month_day_last; |
| 2253 | 2238 | |
| 2254 | class _LIBCPP_TYPE_VIS year_month_day { | |
| 2239 | class year_month_day { | |
| 2255 | 2240 | private: |
| 2256 | 2241 | chrono::year __y; |
| 2257 | 2242 | chrono::month __m; |
| ... | ... | @@ -2260,7 +2245,7 @@ public: |
| 2260 | 2245 | year_month_day() = default; |
| 2261 | 2246 | inline constexpr year_month_day( |
| 2262 | 2247 | const chrono::year& __yval, const chrono::month& __mval, const chrono::day& __dval) noexcept |
| 2263 | : __y{__yval}, __m{__mval}, __d{__dval} {} | |
| 2248 | : __y{__yval}, __m{__mval}, __d{__dval} {} | |
| 2264 | 2249 | constexpr year_month_day(const year_month_day_last& __ymdl) noexcept; |
| 2265 | 2250 | inline constexpr year_month_day(const sys_days& __sysd) noexcept |
| 2266 | 2251 | : year_month_day(__from_days(__sysd.time_since_epoch())) {} |
| ... | ... | @@ -2405,7 +2390,7 @@ inline constexpr year_month_day& year_month_day::operator-=(const months& __dm) |
| 2405 | 2390 | inline constexpr year_month_day& year_month_day::operator+=(const years& __dy) noexcept { *this = *this + __dy; return *this; } |
| 2406 | 2391 | inline constexpr year_month_day& year_month_day::operator-=(const years& __dy) noexcept { *this = *this - __dy; return *this; } |
| 2407 | 2392 | |
| 2408 | class _LIBCPP_TYPE_VIS year_month_day_last { | |
| 2393 | class year_month_day_last { | |
| 2409 | 2394 | private: |
| 2410 | 2395 | chrono::year __y; |
| 2411 | 2396 | chrono::month_day_last __mdl; |
| ... | ... | @@ -2515,7 +2500,7 @@ inline constexpr year_month_day_last& year_month_day_last::operator+=(const year |
| 2515 | 2500 | inline constexpr year_month_day_last& year_month_day_last::operator-=(const years& __dy) noexcept { *this = *this - __dy; return *this; } |
| 2516 | 2501 | |
| 2517 | 2502 | inline constexpr year_month_day::year_month_day(const year_month_day_last& __ymdl) noexcept |
| 2518 | : __y{__ymdl.year()}, __m{__ymdl.month()}, __d{__ymdl.day()} {} | |
| 2503 | : __y{__ymdl.year()}, __m{__ymdl.month()}, __d{__ymdl.day()} {} | |
| 2519 | 2504 | |
| 2520 | 2505 | inline constexpr bool year_month_day::ok() const noexcept |
| 2521 | 2506 | { |
| ... | ... | @@ -2523,7 +2508,7 @@ inline constexpr bool year_month_day::ok() const noexcept |
| 2523 | 2508 | return chrono::day{1} <= __d && __d <= (__y / __m / last).day(); |
| 2524 | 2509 | } |
| 2525 | 2510 | |
| 2526 | class _LIBCPP_TYPE_VIS year_month_weekday { | |
| 2511 | class year_month_weekday { | |
| 2527 | 2512 | chrono::year __y; |
| 2528 | 2513 | chrono::month __m; |
| 2529 | 2514 | chrono::weekday_indexed __wdi; |
| ... | ... | @@ -2566,7 +2551,7 @@ year_month_weekday year_month_weekday::__from_days(days __d) noexcept |
| 2566 | 2551 | const sys_days __sysd{__d}; |
| 2567 | 2552 | const chrono::weekday __wd = chrono::weekday(__sysd); |
| 2568 | 2553 | const year_month_day __ymd = year_month_day(__sysd); |
| 2569 | return year_month_weekday{__ymd.year(), __ymd.month(), | |
| 2554 | return year_month_weekday{__ymd.year(), __ymd.month(), | |
| 2570 | 2555 | __wd[(static_cast<unsigned>(__ymd.day())-1)/7+1]}; |
| 2571 | 2556 | } |
| 2572 | 2557 | |
| ... | ... | @@ -2637,7 +2622,7 @@ inline constexpr year_month_weekday& year_month_weekday::operator-=(const months |
| 2637 | 2622 | inline constexpr year_month_weekday& year_month_weekday::operator+=(const years& __dy) noexcept { *this = *this + __dy; return *this; } |
| 2638 | 2623 | inline constexpr year_month_weekday& year_month_weekday::operator-=(const years& __dy) noexcept { *this = *this - __dy; return *this; } |
| 2639 | 2624 | |
| 2640 | class _LIBCPP_TYPE_VIS year_month_weekday_last { | |
| 2625 | class year_month_weekday_last { | |
| 2641 | 2626 | private: |
| 2642 | 2627 | chrono::year __y; |
| 2643 | 2628 | chrono::month __m; |
| ... | ... | @@ -2658,9 +2643,9 @@ public: |
| 2658 | 2643 | inline constexpr operator sys_days() const noexcept { return sys_days{__to_days()}; } |
| 2659 | 2644 | inline explicit constexpr operator local_days() const noexcept { return local_days{__to_days()}; } |
| 2660 | 2645 | inline constexpr bool ok() const noexcept { return __y.ok() && __m.ok() && __wdl.ok(); } |
| 2661 | ||
| 2646 | ||
| 2662 | 2647 | constexpr days __to_days() const noexcept; |
| 2663 | ||
| 2648 | ||
| 2664 | 2649 | }; |
| 2665 | 2650 | |
| 2666 | 2651 | inline constexpr |
| ... | ... | @@ -2698,7 +2683,7 @@ year_month_weekday_last operator/(const month_weekday_last& __lhs, const year& _ |
| 2698 | 2683 | |
| 2699 | 2684 | inline constexpr |
| 2700 | 2685 | year_month_weekday_last operator/(const month_weekday_last& __lhs, int __rhs) noexcept |
| 2701 | { return year(__rhs) / __lhs; } | |
| 2686 | { return year(__rhs) / __lhs; } | |
| 2702 | 2687 | |
| 2703 | 2688 | |
| 2704 | 2689 | inline constexpr |
| ... | ... | @@ -2810,7 +2795,7 @@ inline namespace literals |
| 2810 | 2795 | { |
| 2811 | 2796 | return chrono::day(static_cast<unsigned>(__d)); |
| 2812 | 2797 | } |
| 2813 | ||
| 2798 | ||
| 2814 | 2799 | constexpr chrono::year operator ""y(unsigned long long __y) noexcept |
| 2815 | 2800 | { |
| 2816 | 2801 | return chrono::year(static_cast<int>(__y)); |
| ... | ... | @@ -2842,7 +2827,7 @@ struct _FilesystemClock { |
| 2842 | 2827 | |
| 2843 | 2828 | static _LIBCPP_CONSTEXPR_AFTER_CXX11 const bool is_steady = false; |
| 2844 | 2829 | |
| 2845 | _LIBCPP_FUNC_VIS static time_point now() noexcept; | |
| 2830 | _LIBCPP_AVAILABILITY_FILESYSTEM _LIBCPP_FUNC_VIS static time_point now() noexcept; | |
| 2846 | 2831 | |
| 2847 | 2832 | _LIBCPP_INLINE_VISIBILITY |
| 2848 | 2833 | static time_t to_time_t(const time_point& __t) noexcept { |
lib/libcxx/include/cinttypes+3-4| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===--------------------------- cinttypes --------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is distributed under the University of Illinois Open Source | |
| 7 | // License. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 |
lib/libcxx/include/ciso646+3-4| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===--------------------------- ciso646 ----------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 |
lib/libcxx/include/climits+3-4| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===--------------------------- climits ----------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 |
lib/libcxx/include/clocale+3-4| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===--------------------------- clocale ----------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 |
lib/libcxx/include/cmath+30-5| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===---------------------------- cmath -----------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 | |
| ... | ... | @@ -530,7 +529,7 @@ inline _LIBCPP_INLINE_VISIBILITY long double hypot( long double x, long double y |
| 530 | 529 | |
| 531 | 530 | template <class _A1, class _A2, class _A3> |
| 532 | 531 | inline _LIBCPP_INLINE_VISIBILITY |
| 533 | typename __lazy_enable_if | |
| 532 | typename _EnableIf | |
| 534 | 533 | < |
| 535 | 534 | is_arithmetic<_A1>::value && |
| 536 | 535 | is_arithmetic<_A2>::value && |
| ... | ... | @@ -607,6 +606,32 @@ __libcpp_isfinite_or_builtin(_A1 __lcpp_x) _NOEXCEPT |
| 607 | 606 | return isfinite(__lcpp_x); |
| 608 | 607 | } |
| 609 | 608 | |
| 609 | #if _LIBCPP_STD_VER > 17 | |
| 610 | template <typename _Fp> | |
| 611 | constexpr | |
| 612 | _Fp __lerp(_Fp __a, _Fp __b, _Fp __t) noexcept { | |
| 613 | if ((__a <= 0 && __b >= 0) || (__a >= 0 && __b <= 0)) | |
| 614 | return __t * __b + (1 - __t) * __a; | |
| 615 | ||
| 616 | if (__t == 1) return __b; | |
| 617 | const _Fp __x = __a + __t * (__b - __a); | |
| 618 | if (__t > 1 == __b > __a) | |
| 619 | 	return __b < __x ? __x : __b; | |
| 620 | else | |
| 621 | 	return __x < __b ? __x : __b; | |
| 622 | } | |
| 623 | ||
| 624 | constexpr float | |
| 625 | lerp(float __a, float __b, float __t) _NOEXCEPT { return __lerp(__a, __b, __t); } | |
| 626 | ||
| 627 | constexpr double | |
| 628 | lerp(double __a, double __b, double __t) _NOEXCEPT { return __lerp(__a, __b, __t); } | |
| 629 | ||
| 630 | constexpr long double | |
| 631 | lerp(long double __a, long double __b, long double __t) _NOEXCEPT { return __lerp(__a, __b, __t); } | |
| 632 | ||
| 633 | #endif // _LIBCPP_STD_VER > 17 | |
| 634 | ||
| 610 | 635 | _LIBCPP_END_NAMESPACE_STD |
| 611 | 636 | |
| 612 | 637 | #endif // _LIBCPP_CMATH |
lib/libcxx/include/codecvt+3-4| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===-------------------------- codecvt -----------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 |
lib/libcxx/include/compare+3-4| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===-------------------------- compare -----------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 |
lib/libcxx/include/complex+5-6| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===--------------------------- complex ----------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 | |
| ... | ... | @@ -1450,10 +1449,10 @@ operator<<(basic_ostream<_CharT, _Traits>& __os, const complex<_Tp>& __x) |
| 1450 | 1449 | return __os << __s.str(); |
| 1451 | 1450 | } |
| 1452 | 1451 | |
| 1453 | #if _LIBCPP_STD_VER > 11 | |
| 1452 | #if _LIBCPP_STD_VER > 11 | |
| 1454 | 1453 | // Literal suffix for complex number literals [complex.literals] |
| 1455 | 1454 | inline namespace literals |
| 1456 | { | |
| 1455 | { | |
| 1457 | 1456 | inline namespace complex_literals |
| 1458 | 1457 | { |
| 1459 | 1458 | constexpr complex<long double> operator""il(long double __im) |
lib/libcxx/include/complex.h+3-4| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===--------------------------- complex.h --------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 |
lib/libcxx/include/condition_variable+3-4| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===---------------------- condition_variable ----------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 |
lib/libcxx/include/csetjmp+3-4| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===--------------------------- csetjmp ----------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 |
lib/libcxx/include/csignal+3-4| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===--------------------------- csignal ----------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 |
lib/libcxx/include/cstdarg+3-4| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===--------------------------- cstdarg ----------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 |
lib/libcxx/include/cstdbool+3-4| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===--------------------------- cstdbool ---------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 |
lib/libcxx/include/cstddef+3-4| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===--------------------------- cstddef ----------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 |
lib/libcxx/include/cstdint+3-4| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===--------------------------- cstdint ----------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 |
lib/libcxx/include/cstdio+3-4| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===---------------------------- cstdio ----------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 |
lib/libcxx/include/cstdlib+3-4| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===--------------------------- cstdlib ----------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 |
lib/libcxx/include/cstring+3-4| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===--------------------------- cstring ----------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is distributed under the University of Illinois Open Source | |
| 7 | // License. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 |
lib/libcxx/include/ctgmath+3-4| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===-------------------------- ctgmath -----------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 |
lib/libcxx/include/ctime+3-4| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===---------------------------- ctime -----------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 |
lib/libcxx/include/ctype.h+3-4| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===---------------------------- ctype.h ---------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 |
lib/libcxx/include/cwchar+3-4| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===--------------------------- cwchar -----------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 |
lib/libcxx/include/cwctype+3-4| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===--------------------------- cwctype ----------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 |
lib/libcxx/include/deque+15-16| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===---------------------------- deque -----------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 | |
| ... | ... | @@ -1331,21 +1330,21 @@ public: |
| 1331 | 1330 | |
| 1332 | 1331 | // element access: |
| 1333 | 1332 | _LIBCPP_INLINE_VISIBILITY |
| 1334 | reference operator[](size_type __i); | |
| 1333 | reference operator[](size_type __i) _NOEXCEPT; | |
| 1335 | 1334 | _LIBCPP_INLINE_VISIBILITY |
| 1336 | const_reference operator[](size_type __i) const; | |
| 1335 | const_reference operator[](size_type __i) const _NOEXCEPT; | |
| 1337 | 1336 | _LIBCPP_INLINE_VISIBILITY |
| 1338 | 1337 | reference at(size_type __i); |
| 1339 | 1338 | _LIBCPP_INLINE_VISIBILITY |
| 1340 | 1339 | const_reference at(size_type __i) const; |
| 1341 | 1340 | _LIBCPP_INLINE_VISIBILITY |
| 1342 | reference front(); | |
| 1341 | reference front() _NOEXCEPT; | |
| 1343 | 1342 | _LIBCPP_INLINE_VISIBILITY |
| 1344 | const_reference front() const; | |
| 1343 | const_reference front() const _NOEXCEPT; | |
| 1345 | 1344 | _LIBCPP_INLINE_VISIBILITY |
| 1346 | reference back(); | |
| 1345 | reference back() _NOEXCEPT; | |
| 1347 | 1346 | _LIBCPP_INLINE_VISIBILITY |
| 1348 | const_reference back() const; | |
| 1347 | const_reference back() const _NOEXCEPT; | |
| 1349 | 1348 | |
| 1350 | 1349 | // 23.2.2.3 modifiers: |
| 1351 | 1350 | void push_front(const value_type& __v); |
| ... | ... | @@ -1746,7 +1745,7 @@ deque<_Tp, _Allocator>::shrink_to_fit() _NOEXCEPT |
| 1746 | 1745 | template <class _Tp, class _Allocator> |
| 1747 | 1746 | inline |
| 1748 | 1747 | typename deque<_Tp, _Allocator>::reference |
| 1749 | deque<_Tp, _Allocator>::operator[](size_type __i) | |
| 1748 | deque<_Tp, _Allocator>::operator[](size_type __i) _NOEXCEPT | |
| 1750 | 1749 | { |
| 1751 | 1750 | size_type __p = __base::__start_ + __i; |
| 1752 | 1751 | return *(*(__base::__map_.begin() + __p / __base::__block_size) + __p % __base::__block_size); |
| ... | ... | @@ -1755,7 +1754,7 @@ deque<_Tp, _Allocator>::operator[](size_type __i) |
| 1755 | 1754 | template <class _Tp, class _Allocator> |
| 1756 | 1755 | inline |
| 1757 | 1756 | typename deque<_Tp, _Allocator>::const_reference |
| 1758 | deque<_Tp, _Allocator>::operator[](size_type __i) const | |
| 1757 | deque<_Tp, _Allocator>::operator[](size_type __i) const _NOEXCEPT | |
| 1759 | 1758 | { |
| 1760 | 1759 | size_type __p = __base::__start_ + __i; |
| 1761 | 1760 | return *(*(__base::__map_.begin() + __p / __base::__block_size) + __p % __base::__block_size); |
| ... | ... | @@ -1786,7 +1785,7 @@ deque<_Tp, _Allocator>::at(size_type __i) const |
| 1786 | 1785 | template <class _Tp, class _Allocator> |
| 1787 | 1786 | inline |
| 1788 | 1787 | typename deque<_Tp, _Allocator>::reference |
| 1789 | deque<_Tp, _Allocator>::front() | |
| 1788 | deque<_Tp, _Allocator>::front() _NOEXCEPT | |
| 1790 | 1789 | { |
| 1791 | 1790 | return *(*(__base::__map_.begin() + __base::__start_ / __base::__block_size) |
| 1792 | 1791 | + __base::__start_ % __base::__block_size); |
| ... | ... | @@ -1795,7 +1794,7 @@ deque<_Tp, _Allocator>::front() |
| 1795 | 1794 | template <class _Tp, class _Allocator> |
| 1796 | 1795 | inline |
| 1797 | 1796 | typename deque<_Tp, _Allocator>::const_reference |
| 1798 | deque<_Tp, _Allocator>::front() const | |
| 1797 | deque<_Tp, _Allocator>::front() const _NOEXCEPT | |
| 1799 | 1798 | { |
| 1800 | 1799 | return *(*(__base::__map_.begin() + __base::__start_ / __base::__block_size) |
| 1801 | 1800 | + __base::__start_ % __base::__block_size); |
| ... | ... | @@ -1804,7 +1803,7 @@ deque<_Tp, _Allocator>::front() const |
| 1804 | 1803 | template <class _Tp, class _Allocator> |
| 1805 | 1804 | inline |
| 1806 | 1805 | typename deque<_Tp, _Allocator>::reference |
| 1807 | deque<_Tp, _Allocator>::back() | |
| 1806 | deque<_Tp, _Allocator>::back() _NOEXCEPT | |
| 1808 | 1807 | { |
| 1809 | 1808 | size_type __p = __base::size() + __base::__start_ - 1; |
| 1810 | 1809 | return *(*(__base::__map_.begin() + __p / __base::__block_size) + __p % __base::__block_size); |
| ... | ... | @@ -1813,7 +1812,7 @@ deque<_Tp, _Allocator>::back() |
| 1813 | 1812 | template <class _Tp, class _Allocator> |
| 1814 | 1813 | inline |
| 1815 | 1814 | typename deque<_Tp, _Allocator>::const_reference |
| 1816 | deque<_Tp, _Allocator>::back() const | |
| 1815 | deque<_Tp, _Allocator>::back() const _NOEXCEPT | |
| 1817 | 1816 | { |
| 1818 | 1817 | size_type __p = __base::size() + __base::__start_ - 1; |
| 1819 | 1818 | return *(*(__base::__map_.begin() + __p / __base::__block_size) + __p % __base::__block_size); |
lib/libcxx/include/errno.h+3-4| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===-------------------------- errno.h -----------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 |
lib/libcxx/include/exception+6-15| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===-------------------------- exception ---------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 | |
| ... | ... | @@ -83,7 +82,7 @@ template <class E> void rethrow_if_nested(const E& e); |
| 83 | 82 | #include <type_traits> |
| 84 | 83 | #include <version> |
| 85 | 84 | |
| 86 | #if defined(_LIBCPP_ABI_MICROSOFT) && !defined(_LIBCPP_NO_VCRUNTIME) | |
| 85 | #if defined(_LIBCPP_ABI_VCRUNTIME) | |
| 87 | 86 | #include <vcruntime_exception.h> |
| 88 | 87 | #endif |
| 89 | 88 | |
| ... | ... | @@ -94,7 +93,7 @@ template <class E> void rethrow_if_nested(const E& e); |
| 94 | 93 | namespace std // purposefully not using versioning namespace |
| 95 | 94 | { |
| 96 | 95 | |
| 97 | #if !defined(_LIBCPP_ABI_MICROSOFT) || defined(_LIBCPP_NO_VCRUNTIME) | |
| 96 | #if !defined(_LIBCPP_ABI_VCRUNTIME) | |
| 98 | 97 | class _LIBCPP_EXCEPTION_ABI exception |
| 99 | 98 | { |
| 100 | 99 | public: |
| ... | ... | @@ -111,7 +110,7 @@ public: |
| 111 | 110 | virtual ~bad_exception() _NOEXCEPT; |
| 112 | 111 | virtual const char* what() const _NOEXCEPT; |
| 113 | 112 | }; |
| 114 | #endif // !_LIBCPP_ABI_MICROSOFT || _LIBCPP_NO_VCRUNTIME | |
| 113 | #endif // !_LIBCPP_ABI_VCRUNTIME | |
| 115 | 114 | |
| 116 | 115 | #if _LIBCPP_STD_VER <= 14 \ |
| 117 | 116 | || defined(_LIBCPP_ENABLE_CXX17_REMOVED_UNEXPECTED_FUNCTIONS) \ |
| ... | ... | @@ -261,11 +260,7 @@ struct __throw_with_nested; |
| 261 | 260 | template <class _Tp, class _Up> |
| 262 | 261 | struct __throw_with_nested<_Tp, _Up, true> { |
| 263 | 262 | _LIBCPP_NORETURN static inline _LIBCPP_INLINE_VISIBILITY void |
| 264 | #ifndef _LIBCPP_CXX03_LANG | |
| 265 | 263 | __do_throw(_Tp&& __t) |
| 266 | #else | |
| 267 | __do_throw (_Tp& __t) | |
| 268 | #endif // _LIBCPP_CXX03_LANG | |
| 269 | 264 | { |
| 270 | 265 | throw __nested<_Up>(_VSTD::forward<_Tp>(__t)); |
| 271 | 266 | } |
| ... | ... | @@ -288,11 +283,7 @@ struct __throw_with_nested<_Tp, _Up, false> { |
| 288 | 283 | template <class _Tp> |
| 289 | 284 | _LIBCPP_NORETURN |
| 290 | 285 | void |
| 291 | #ifndef _LIBCPP_CXX03_LANG | |
| 292 | 286 | throw_with_nested(_Tp&& __t) |
| 293 | #else | |
| 294 | throw_with_nested (_Tp& __t) | |
| 295 | #endif // _LIBCPP_CXX03_LANG | |
| 296 | 287 | { |
| 297 | 288 | #ifndef _LIBCPP_NO_EXCEPTIONS |
| 298 | 289 | typedef typename decay<_Tp>::type _Up; |
lib/libcxx/include/experimental/__config+10-5| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===--------------------------- __config ---------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 | |
| ... | ... | @@ -37,8 +36,14 @@ |
| 37 | 36 | namespace chrono { namespace experimental { inline namespace fundamentals_v1 { |
| 38 | 37 | #define _LIBCPP_END_NAMESPACE_CHRONO_LFTS _LIBCPP_END_NAMESPACE_STD } } } |
| 39 | 38 | |
| 39 | #if defined(_LIBCPP_NO_EXPERIMENTAL_DEPRECATION_WARNING_FILESYSTEM) | |
| 40 | # define _LIBCPP_DEPRECATED_EXPERIMENTAL_FILESYSTEM /* nothing */ | |
| 41 | #else | |
| 42 | # define _LIBCPP_DEPRECATED_EXPERIMENTAL_FILESYSTEM __attribute__((deprecated("std::experimental::filesystem has now been deprecated in favor of C++17's std::filesystem. Please stop using it and start using std::filesystem. This experimental version will be removed in LLVM 11. You can remove this warning by defining the _LIBCPP_NO_EXPERIMENTAL_DEPRECATION_WARNING_FILESYSTEM macro."))) | |
| 43 | #endif | |
| 44 | ||
| 40 | 45 | #define _LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL_FILESYSTEM \ |
| 41 | _LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL namespace filesystem { \ | |
| 46 | _LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL namespace filesystem _LIBCPP_DEPRECATED_EXPERIMENTAL_FILESYSTEM { \ | |
| 42 | 47 | inline namespace v1 { |
| 43 | 48 | |
| 44 | 49 | #define _LIBCPP_END_NAMESPACE_EXPERIMENTAL_FILESYSTEM \ |
lib/libcxx/include/experimental/__memory+3-4| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===----------------------------------------------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 |
lib/libcxx/include/experimental/algorithm+3-4| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===-------------------------- algorithm ---------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 |
lib/libcxx/include/experimental/any deleted-21| ... | ... | @@ -1,21 +0,0 @@ |
| 1 | // -*- C++ -*- | |
| 2 | //===------------------------------- any ----------------------------------===// | |
| 3 | // | |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 8 | // | |
| 9 | //===----------------------------------------------------------------------===// | |
| 10 | #ifndef _LIBCPP_EXPERIMENTAL_ANY | |
| 11 | #define _LIBCPP_EXPERIMENTAL_ANY | |
| 12 | ||
| 13 | #include <__config> | |
| 14 | ||
| 15 | #ifdef _LIBCPP_WARNING | |
| 16 | _LIBCPP_WARNING("<experimental/any> has been removed. Use <any> instead.") | |
| 17 | #else | |
| 18 | # warning "<experimental/any> has been removed. Use <any> instead." | |
| 19 | #endif | |
| 20 | ||
| 21 | #endif // _LIBCPP_EXPERIMENTAL_ANY |
lib/libcxx/include/experimental/chrono deleted-21| ... | ... | @@ -1,21 +0,0 @@ |
| 1 | // -*- C++ -*- | |
| 2 | //===---------------------------- chrono ----------------------------------===// | |
| 3 | // | |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 8 | // | |
| 9 | //===----------------------------------------------------------------------===// | |
| 10 | #ifndef _LIBCPP_EXPERIMENTAL_CHRONO | |
| 11 | #define _LIBCPP_EXPERIMENTAL_CHRONO | |
| 12 | ||
| 13 | #include <__config> | |
| 14 | ||
| 15 | #ifdef _LIBCPP_WARNING | |
| 16 | _LIBCPP_WARNING("<experimental/chrono> has been removed. Use <chrono> instead.") | |
| 17 | #else | |
| 18 | # warning "<experimental/chrono> has been removed. Use <chrono> instead." | |
| 19 | #endif | |
| 20 | ||
| 21 | #endif // _LIBCPP_EXPERIMENTAL_CHRONO |
lib/libcxx/include/experimental/coroutine+6-7| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===----------------------------- coroutine -----------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is distributed under the University of Illinois Open Source | |
| 7 | // License. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 | |
| ... | ... | @@ -82,7 +81,7 @@ struct __coroutine_traits_sfinae< |
| 82 | 81 | }; |
| 83 | 82 | |
| 84 | 83 | template <typename _Ret, typename... _Args> |
| 85 | struct _LIBCPP_TEMPLATE_VIS coroutine_traits | |
| 84 | struct coroutine_traits | |
| 86 | 85 | : public __coroutine_traits_sfinae<_Ret> |
| 87 | 86 | { |
| 88 | 87 | }; |
| ... | ... | @@ -299,7 +298,7 @@ noop_coroutine_handle noop_coroutine() _NOEXCEPT { |
| 299 | 298 | } |
| 300 | 299 | #endif // __has_builtin(__builtin_coro_noop) |
| 301 | 300 | |
| 302 | struct _LIBCPP_TYPE_VIS suspend_never { | |
| 301 | struct suspend_never { | |
| 303 | 302 | _LIBCPP_INLINE_VISIBILITY |
| 304 | 303 | bool await_ready() const _NOEXCEPT { return true; } |
| 305 | 304 | _LIBCPP_INLINE_VISIBILITY |
| ... | ... | @@ -308,7 +307,7 @@ struct _LIBCPP_TYPE_VIS suspend_never { |
| 308 | 307 | void await_resume() const _NOEXCEPT {} |
| 309 | 308 | }; |
| 310 | 309 | |
| 311 | struct _LIBCPP_TYPE_VIS suspend_always { | |
| 310 | struct suspend_always { | |
| 312 | 311 | _LIBCPP_INLINE_VISIBILITY |
| 313 | 312 | bool await_ready() const _NOEXCEPT { return false; } |
| 314 | 313 | _LIBCPP_INLINE_VISIBILITY |
lib/libcxx/include/experimental/deque+3-4| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===--------------------------- deque ------------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 |
lib/libcxx/include/experimental/filesystem+3-4| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===--------------------------- filesystem -------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 | #ifndef _LIBCPP_EXPERIMENTAL_FILESYSTEM |
lib/libcxx/include/experimental/forward_list+3-4| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===--------------------------- forward_list -----------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 |
lib/libcxx/include/experimental/functional+6-10| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===-------------------------- functional --------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 | |
| ... | ... | @@ -110,8 +109,7 @@ _LIBCPP_BEGIN_NAMESPACE_LFTS |
| 110 | 109 | #if _LIBCPP_STD_VER > 11 |
| 111 | 110 | // default searcher |
| 112 | 111 | template<class _ForwardIterator, class _BinaryPredicate = equal_to<>> |
| 113 | _LIBCPP_TYPE_VIS | |
| 114 | class default_searcher { | |
| 112 | class _LIBCPP_TYPE_VIS default_searcher { | |
| 115 | 113 | public: |
| 116 | 114 | _LIBCPP_INLINE_VISIBILITY |
| 117 | 115 | default_searcher(_ForwardIterator __f, _ForwardIterator __l, |
| ... | ... | @@ -209,8 +207,7 @@ public: |
| 209 | 207 | template <class _RandomAccessIterator1, |
| 210 | 208 | class _Hash = hash<typename iterator_traits<_RandomAccessIterator1>::value_type>, |
| 211 | 209 | class _BinaryPredicate = equal_to<>> |
| 212 | _LIBCPP_TYPE_VIS | |
| 213 | class boyer_moore_searcher { | |
| 210 | class _LIBCPP_TYPE_VIS boyer_moore_searcher { | |
| 214 | 211 | private: |
| 215 | 212 | typedef typename std::iterator_traits<_RandomAccessIterator1>::difference_type difference_type; |
| 216 | 213 | typedef typename std::iterator_traits<_RandomAccessIterator1>::value_type value_type; |
| ... | ... | @@ -361,8 +358,7 @@ make_boyer_moore_searcher( _RandomAccessIterator __f, _RandomAccessIterator __l, |
| 361 | 358 | template <class _RandomAccessIterator1, |
| 362 | 359 | class _Hash = hash<typename iterator_traits<_RandomAccessIterator1>::value_type>, |
| 363 | 360 | class _BinaryPredicate = equal_to<>> |
| 364 | _LIBCPP_TYPE_VIS | |
| 365 | class boyer_moore_horspool_searcher { | |
| 361 | class _LIBCPP_TYPE_VIS boyer_moore_horspool_searcher { | |
| 366 | 362 | private: |
| 367 | 363 | typedef typename std::iterator_traits<_RandomAccessIterator1>::difference_type difference_type; |
| 368 | 364 | typedef typename std::iterator_traits<_RandomAccessIterator1>::value_type value_type; |
lib/libcxx/include/experimental/iterator+3-4| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===----------------------------- iterator -------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is distributed under the University of Illinois Open Source | |
| 7 | // License. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 |
lib/libcxx/include/experimental/list+3-4| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===--------------------------- list ------------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 |
lib/libcxx/include/experimental/map+3-4| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===----------------------------- map ------------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 |
lib/libcxx/include/experimental/memory_resource+3-4| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===------------------------ memory_resource -----------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is distributed under the University of Illinois Open Source | |
| 7 | // License. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 |
lib/libcxx/include/experimental/numeric deleted-21| ... | ... | @@ -1,21 +0,0 @@ |
| 1 | // -*- C++ -*- | |
| 2 | //===--------------------------- numeric ----------------------------------===// | |
| 3 | // | |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 8 | // | |
| 9 | //===----------------------------------------------------------------------===// | |
| 10 | #ifndef _LIBCPP_EXPERIMENTAL_NUMERIC | |
| 11 | #define _LIBCPP_EXPERIMENTAL_NUMERIC | |
| 12 | ||
| 13 | #include <__config> | |
| 14 | ||
| 15 | #ifdef _LIBCPP_WARNING | |
| 16 | _LIBCPP_WARNING("<experimental/numeric> has been removed. Use <numeric> instead.") | |
| 17 | #else | |
| 18 | # warning "<experimental/numeric> has been removed. Use <numeric> instead." | |
| 19 | #endif | |
| 20 | ||
| 21 | #endif // _LIBCPP_EXPERIMENTAL_NUMERIC |
lib/libcxx/include/experimental/optional deleted-21| ... | ... | @@ -1,21 +0,0 @@ |
| 1 | // -*- C++ -*- | |
| 2 | //===-------------------------- optional ----------------------------------===// | |
| 3 | // | |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 8 | // | |
| 9 | //===----------------------------------------------------------------------===// | |
| 10 | #ifndef _LIBCPP_EXPERIMENTAL_OPTIONAL | |
| 11 | #define _LIBCPP_EXPERIMENTAL_OPTIONAL | |
| 12 | ||
| 13 | #include <__config> | |
| 14 | ||
| 15 | #ifdef _LIBCPP_WARNING | |
| 16 | _LIBCPP_WARNING("<experimental/optional> has been removed. Use <optional> instead.") | |
| 17 | #else | |
| 18 | # warning "<experimental/optional> has been removed. Use <optional> instead." | |
| 19 | #endif | |
| 20 | ||
| 21 | #endif // _LIBCPP_EXPERIMENTAL_OPTIONAL |
lib/libcxx/include/experimental/propagate_const+3-4| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===------------------------ propagate_const -----------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 |
lib/libcxx/include/experimental/ratio deleted-21| ... | ... | @@ -1,21 +0,0 @@ |
| 1 | // -*- C++ -*- | |
| 2 | //===----------------------------- ratio ----------------------------------===// | |
| 3 | // | |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 8 | // | |
| 9 | //===----------------------------------------------------------------------===// | |
| 10 | #ifndef _LIBCPP_EXPERIMENTAL_RATIO | |
| 11 | #define _LIBCPP_EXPERIMENTAL_RATIO | |
| 12 | ||
| 13 | #include <__config> | |
| 14 | ||
| 15 | #ifdef _LIBCPP_WARNING | |
| 16 | _LIBCPP_WARNING("<experimental/ratio> has been removed. Use <ratio> instead.") | |
| 17 | #else | |
| 18 | # warning "<experimental/ratio> has been removed. Use <ratio> instead." | |
| 19 | #endif | |
| 20 | ||
| 21 | #endif // _LIBCPP_EXPERIMENTAL_RATIO |
lib/libcxx/include/experimental/regex+3-4| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===----------------------------- regex ----------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 |
lib/libcxx/include/experimental/set+3-4| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===--------------------------- list ------------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 |
lib/libcxx/include/experimental/simd+3-4| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===------------------------------- simd ---------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 | #ifndef _LIBCPP_EXPERIMENTAL_SIMD |
lib/libcxx/include/experimental/string+3-4| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===--------------------------- string ----------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 |
lib/libcxx/include/experimental/string_view deleted-21| ... | ... | @@ -1,21 +0,0 @@ |
| 1 | // -*- C++ -*- | |
| 2 | //===------------------------ string_view ---------------------------------===// | |
| 3 | // | |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 8 | // | |
| 9 | //===----------------------------------------------------------------------===// | |
| 10 | #ifndef _LIBCPP_EXPERIMENTAL_STRING_VIEW | |
| 11 | #define _LIBCPP_EXPERIMENTAL_STRING_VIEW | |
| 12 | ||
| 13 | #include <__config> | |
| 14 | ||
| 15 | #ifdef _LIBCPP_WARNING | |
| 16 | _LIBCPP_WARNING("<experimental/string_view> has been removed. Use <string_view> instead.") | |
| 17 | #else | |
| 18 | # warning "<experimental/string_view> has been removed. Use <string_view> instead." | |
| 19 | #endif | |
| 20 | ||
| 21 | #endif // _LIBCPP_EXPERIMENTAL_STRING_VIEW |
lib/libcxx/include/experimental/system_error deleted-21| ... | ... | @@ -1,21 +0,0 @@ |
| 1 | // -*- C++ -*- | |
| 2 | //===-------------------------- system_error ------------------------------===// | |
| 3 | // | |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 8 | // | |
| 9 | //===----------------------------------------------------------------------===// | |
| 10 | #ifndef _LIBCPP_EXPERIMENTAL_SYSTEM_ERROR | |
| 11 | #define _LIBCPP_EXPERIMENTAL_SYSTEM_ERROR | |
| 12 | ||
| 13 | #include <__config> | |
| 14 | ||
| 15 | #ifdef _LIBCPP_WARNING | |
| 16 | _LIBCPP_WARNING("<experimental/system_error> has been removed. Use <system_error> instead.") | |
| 17 | #else | |
| 18 | # warning "<experimental/system_error> has been removed. Use <system_error> instead." | |
| 19 | #endif | |
| 20 | ||
| 21 | #endif // _LIBCPP_EXPERIMENTAL_SYSTEM_ERROR |
lib/libcxx/include/experimental/tuple deleted-21| ... | ... | @@ -1,21 +0,0 @@ |
| 1 | // -*- C++ -*- | |
| 2 | //===----------------------------- tuple ----------------------------------===// | |
| 3 | // | |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 8 | // | |
| 9 | //===----------------------------------------------------------------------===// | |
| 10 | #ifndef _LIBCPP_EXPERIMENTAL_TUPLE | |
| 11 | #define _LIBCPP_EXPERIMENTAL_TUPLE | |
| 12 | ||
| 13 | #include <__config> | |
| 14 | ||
| 15 | #ifdef _LIBCPP_WARNING | |
| 16 | _LIBCPP_WARNING("<experimental/tuple> has been removed. Use <tuple> instead.") | |
| 17 | #else | |
| 18 | # warning "<experimental/tuple> has been removed. Use <tuple> instead." | |
| 19 | #endif | |
| 20 | ||
| 21 | #endif // _LIBCPP_EXPERIMENTAL_TUPLE |
lib/libcxx/include/experimental/type_traits+8-9| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===-------------------------- type_traits -------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 | |
| ... | ... | @@ -73,6 +72,7 @@ inline namespace fundamentals_v1 { |
| 73 | 72 | |
| 74 | 73 | #if _LIBCPP_STD_VER > 11 |
| 75 | 74 | |
| 75 | #include <initializer_list> | |
| 76 | 76 | #include <type_traits> |
| 77 | 77 | |
| 78 | 78 | #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) |
| ... | ... | @@ -105,11 +105,10 @@ using raw_invocation_type_t = typename raw_invocation_type<_Tp>::type; |
| 105 | 105 | // 3.3.4, Detection idiom |
| 106 | 106 | template <class...> using void_t = void; |
| 107 | 107 | |
| 108 | struct nonesuch { | |
| 109 | nonesuch() = delete; | |
| 110 | ~nonesuch() = delete; | |
| 111 | nonesuch (nonesuch const&) = delete; | |
| 112 | void operator=(nonesuch const&) = delete; | |
| 108 | struct nonesuch : private _VSTD::__nat { // make nonesuch "not an aggregate" | |
| 109 | ~nonesuch() = delete; | |
| 110 | nonesuch (nonesuch const&) = delete; | |
| 111 | void operator=(nonesuch const&) = delete; | |
| 113 | 112 | }; |
| 114 | 113 | |
| 115 | 114 | template <class _Default, class _AlwaysVoid, template <class...> class _Op, class... _Args> |
lib/libcxx/include/experimental/unordered_map+3-4| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===------------------------- unordered_map ------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 |
lib/libcxx/include/experimental/unordered_set+3-4| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===------------------------- unordered_set ------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 |
lib/libcxx/include/experimental/utility+3-4| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===-------------------------- utility ----------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 |
lib/libcxx/include/experimental/vector+3-4| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===--------------------------- vector ------------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 |
lib/libcxx/include/ext/__hash+16-18| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===------------------------- hash_set ------------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 | |
| ... | ... | @@ -17,32 +16,31 @@ |
| 17 | 16 | #include <cstring> |
| 18 | 17 | |
| 19 | 18 | namespace __gnu_cxx { |
| 20 | using namespace std; | |
| 21 | 19 | |
| 22 | 20 | template <typename _Tp> struct _LIBCPP_TEMPLATE_VIS hash { }; |
| 23 | 21 | |
| 24 | 22 | template <> struct _LIBCPP_TEMPLATE_VIS hash<const char*> |
| 25 | : public unary_function<const char*, size_t> | |
| 23 | : public std::unary_function<const char*, size_t> | |
| 26 | 24 | { |
| 27 | 25 | _LIBCPP_INLINE_VISIBILITY |
| 28 | 26 | size_t operator()(const char *__c) const _NOEXCEPT |
| 29 | 27 | { |
| 30 | return __do_string_hash(__c, __c + strlen(__c)); | |
| 28 | return std::__do_string_hash(__c, __c + strlen(__c)); | |
| 31 | 29 | } |
| 32 | 30 | }; |
| 33 | 31 | |
| 34 | 32 | template <> struct _LIBCPP_TEMPLATE_VIS hash<char *> |
| 35 | : public unary_function<char*, size_t> | |
| 33 | : public std::unary_function<char*, size_t> | |
| 36 | 34 | { |
| 37 | 35 | _LIBCPP_INLINE_VISIBILITY |
| 38 | 36 | size_t operator()(char *__c) const _NOEXCEPT |
| 39 | 37 | { |
| 40 | return __do_string_hash<const char *>(__c, __c + strlen(__c)); | |
| 38 | return std::__do_string_hash<const char *>(__c, __c + strlen(__c)); | |
| 41 | 39 | } |
| 42 | 40 | }; |
| 43 | 41 | |
| 44 | 42 | template <> struct _LIBCPP_TEMPLATE_VIS hash<char> |
| 45 | : public unary_function<char, size_t> | |
| 43 | : public std::unary_function<char, size_t> | |
| 46 | 44 | { |
| 47 | 45 | _LIBCPP_INLINE_VISIBILITY |
| 48 | 46 | size_t operator()(char __c) const _NOEXCEPT |
| ... | ... | @@ -52,7 +50,7 @@ template <> struct _LIBCPP_TEMPLATE_VIS hash<char> |
| 52 | 50 | }; |
| 53 | 51 | |
| 54 | 52 | template <> struct _LIBCPP_TEMPLATE_VIS hash<signed char> |
| 55 | : public unary_function<signed char, size_t> | |
| 53 | : public std::unary_function<signed char, size_t> | |
| 56 | 54 | { |
| 57 | 55 | _LIBCPP_INLINE_VISIBILITY |
| 58 | 56 | size_t operator()(signed char __c) const _NOEXCEPT |
| ... | ... | @@ -62,7 +60,7 @@ template <> struct _LIBCPP_TEMPLATE_VIS hash<signed char> |
| 62 | 60 | }; |
| 63 | 61 | |
| 64 | 62 | template <> struct _LIBCPP_TEMPLATE_VIS hash<unsigned char> |
| 65 | : public unary_function<unsigned char, size_t> | |
| 63 | : public std::unary_function<unsigned char, size_t> | |
| 66 | 64 | { |
| 67 | 65 | _LIBCPP_INLINE_VISIBILITY |
| 68 | 66 | size_t operator()(unsigned char __c) const _NOEXCEPT |
| ... | ... | @@ -72,7 +70,7 @@ template <> struct _LIBCPP_TEMPLATE_VIS hash<unsigned char> |
| 72 | 70 | }; |
| 73 | 71 | |
| 74 | 72 | template <> struct _LIBCPP_TEMPLATE_VIS hash<short> |
| 75 | : public unary_function<short, size_t> | |
| 73 | : public std::unary_function<short, size_t> | |
| 76 | 74 | { |
| 77 | 75 | _LIBCPP_INLINE_VISIBILITY |
| 78 | 76 | size_t operator()(short __c) const _NOEXCEPT |
| ... | ... | @@ -82,7 +80,7 @@ template <> struct _LIBCPP_TEMPLATE_VIS hash<short> |
| 82 | 80 | }; |
| 83 | 81 | |
| 84 | 82 | template <> struct _LIBCPP_TEMPLATE_VIS hash<unsigned short> |
| 85 | : public unary_function<unsigned short, size_t> | |
| 83 | : public std::unary_function<unsigned short, size_t> | |
| 86 | 84 | { |
| 87 | 85 | _LIBCPP_INLINE_VISIBILITY |
| 88 | 86 | size_t operator()(unsigned short __c) const _NOEXCEPT |
| ... | ... | @@ -92,7 +90,7 @@ template <> struct _LIBCPP_TEMPLATE_VIS hash<unsigned short> |
| 92 | 90 | }; |
| 93 | 91 | |
| 94 | 92 | template <> struct _LIBCPP_TEMPLATE_VIS hash<int> |
| 95 | : public unary_function<int, size_t> | |
| 93 | : public std::unary_function<int, size_t> | |
| 96 | 94 | { |
| 97 | 95 | _LIBCPP_INLINE_VISIBILITY |
| 98 | 96 | size_t operator()(int __c) const _NOEXCEPT |
| ... | ... | @@ -102,7 +100,7 @@ template <> struct _LIBCPP_TEMPLATE_VIS hash<int> |
| 102 | 100 | }; |
| 103 | 101 | |
| 104 | 102 | template <> struct _LIBCPP_TEMPLATE_VIS hash<unsigned int> |
| 105 | : public unary_function<unsigned int, size_t> | |
| 103 | : public std::unary_function<unsigned int, size_t> | |
| 106 | 104 | { |
| 107 | 105 | _LIBCPP_INLINE_VISIBILITY |
| 108 | 106 | size_t operator()(unsigned int __c) const _NOEXCEPT |
| ... | ... | @@ -112,7 +110,7 @@ template <> struct _LIBCPP_TEMPLATE_VIS hash<unsigned int> |
| 112 | 110 | }; |
| 113 | 111 | |
| 114 | 112 | template <> struct _LIBCPP_TEMPLATE_VIS hash<long> |
| 115 | : public unary_function<long, size_t> | |
| 113 | : public std::unary_function<long, size_t> | |
| 116 | 114 | { |
| 117 | 115 | _LIBCPP_INLINE_VISIBILITY |
| 118 | 116 | size_t operator()(long __c) const _NOEXCEPT |
| ... | ... | @@ -122,7 +120,7 @@ template <> struct _LIBCPP_TEMPLATE_VIS hash<long> |
| 122 | 120 | }; |
| 123 | 121 | |
| 124 | 122 | template <> struct _LIBCPP_TEMPLATE_VIS hash<unsigned long> |
| 125 | : public unary_function<unsigned long, size_t> | |
| 123 | : public std::unary_function<unsigned long, size_t> | |
| 126 | 124 | { |
| 127 | 125 | _LIBCPP_INLINE_VISIBILITY |
| 128 | 126 | size_t operator()(unsigned long __c) const _NOEXCEPT |
lib/libcxx/include/ext/hash_map+38-40| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===-------------------------- hash_map ----------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 | |
| ... | ... | @@ -220,10 +219,8 @@ template <class Key, class T, class Hash, class Pred, class Alloc> |
| 220 | 219 | |
| 221 | 220 | namespace __gnu_cxx { |
| 222 | 221 | |
| 223 | using namespace std; | |
| 224 | ||
| 225 | 222 | template <class _Tp, class _Hash, |
| 226 | bool = is_empty<_Hash>::value && !__libcpp_is_final<_Hash>::value | |
| 223 | bool = std::is_empty<_Hash>::value && !std::__libcpp_is_final<_Hash>::value | |
| 227 | 224 | > |
| 228 | 225 | class __hash_map_hasher |
| 229 | 226 | : private _Hash |
| ... | ... | @@ -257,7 +254,7 @@ public: |
| 257 | 254 | }; |
| 258 | 255 | |
| 259 | 256 | template <class _Tp, class _Pred, |
| 260 | bool = is_empty<_Pred>::value && !__libcpp_is_final<_Pred>::value | |
| 257 | bool = std::is_empty<_Pred>::value && !std::__libcpp_is_final<_Pred>::value | |
| 261 | 258 | > |
| 262 | 259 | class __hash_map_equal |
| 263 | 260 | : private _Pred |
| ... | ... | @@ -308,7 +305,7 @@ template <class _Alloc> |
| 308 | 305 | class __hash_map_node_destructor |
| 309 | 306 | { |
| 310 | 307 | typedef _Alloc allocator_type; |
| 311 | typedef allocator_traits<allocator_type> __alloc_traits; | |
| 308 | typedef std::allocator_traits<allocator_type> __alloc_traits; | |
| 312 | 309 | typedef typename __alloc_traits::value_type::__node_value_type value_type; |
| 313 | 310 | public: |
| 314 | 311 | typedef typename __alloc_traits::pointer pointer; |
| ... | ... | @@ -333,7 +330,7 @@ public: |
| 333 | 330 | |
| 334 | 331 | #ifndef _LIBCPP_CXX03_LANG |
| 335 | 332 | _LIBCPP_INLINE_VISIBILITY |
| 336 | __hash_map_node_destructor(__hash_node_destructor<allocator_type>&& __x) | |
| 333 | __hash_map_node_destructor(std::__hash_node_destructor<allocator_type>&& __x) | |
| 337 | 334 | : __na_(__x.__na_), |
| 338 | 335 | __first_constructed(__x.__value_constructed), |
| 339 | 336 | __second_constructed(__x.__value_constructed) |
| ... | ... | @@ -342,7 +339,7 @@ public: |
| 342 | 339 | } |
| 343 | 340 | #else // _LIBCPP_CXX03_LANG |
| 344 | 341 | _LIBCPP_INLINE_VISIBILITY |
| 345 | __hash_map_node_destructor(const __hash_node_destructor<allocator_type>& __x) | |
| 342 | __hash_map_node_destructor(const std::__hash_node_destructor<allocator_type>& __x) | |
| 346 | 343 | : __na_(__x.__na_), |
| 347 | 344 | __first_constructed(__x.__value_constructed), |
| 348 | 345 | __second_constructed(__x.__value_constructed) |
| ... | ... | @@ -371,11 +368,11 @@ class _LIBCPP_TEMPLATE_VIS __hash_map_iterator |
| 371 | 368 | typedef const typename _HashIterator::value_type::first_type key_type; |
| 372 | 369 | typedef typename _HashIterator::value_type::second_type mapped_type; |
| 373 | 370 | public: |
| 374 | typedef forward_iterator_tag iterator_category; | |
| 375 | typedef pair<key_type, mapped_type> value_type; | |
| 371 | typedef std::forward_iterator_tag iterator_category; | |
| 372 | typedef std::pair<key_type, mapped_type> value_type; | |
| 376 | 373 | typedef typename _HashIterator::difference_type difference_type; |
| 377 | 374 | typedef value_type& reference; |
| 378 | typedef typename __rebind_pointer<typename _HashIterator::pointer, value_type>::type | |
| 375 | typedef typename std::__rebind_pointer<typename _HashIterator::pointer, value_type>::type | |
| 379 | 376 | pointer; |
| 380 | 377 | |
| 381 | 378 | _LIBCPP_INLINE_VISIBILITY __hash_map_iterator() {} |
| ... | ... | @@ -416,11 +413,11 @@ class _LIBCPP_TEMPLATE_VIS __hash_map_const_iterator |
| 416 | 413 | typedef const typename _HashIterator::value_type::first_type key_type; |
| 417 | 414 | typedef typename _HashIterator::value_type::second_type mapped_type; |
| 418 | 415 | public: |
| 419 | typedef forward_iterator_tag iterator_category; | |
| 420 | typedef pair<key_type, mapped_type> value_type; | |
| 416 | typedef std::forward_iterator_tag iterator_category; | |
| 417 | typedef std::pair<key_type, mapped_type> value_type; | |
| 421 | 418 | typedef typename _HashIterator::difference_type difference_type; |
| 422 | 419 | typedef const value_type& reference; |
| 423 | typedef typename __rebind_pointer<typename _HashIterator::pointer, const value_type>::type | |
| 420 | typedef typename std::__rebind_pointer<typename _HashIterator::pointer, const value_type>::type | |
| 424 | 421 | pointer; |
| 425 | 422 | |
| 426 | 423 | _LIBCPP_INLINE_VISIBILITY __hash_map_const_iterator() {} |
| ... | ... | @@ -460,8 +457,8 @@ public: |
| 460 | 457 | template <class> friend class _LIBCPP_TEMPLATE_VIS __hash_const_local_iterator; |
| 461 | 458 | }; |
| 462 | 459 | |
| 463 | template <class _Key, class _Tp, class _Hash = hash<_Key>, class _Pred = equal_to<_Key>, | |
| 464 | class _Alloc = allocator<pair<const _Key, _Tp> > > | |
| 460 | template <class _Key, class _Tp, class _Hash = hash<_Key>, class _Pred = std::equal_to<_Key>, | |
| 461 | class _Alloc = std::allocator<std::pair<const _Key, _Tp> > > | |
| 465 | 462 | class _LIBCPP_TEMPLATE_VIS hash_map |
| 466 | 463 | { |
| 467 | 464 | public: |
| ... | ... | @@ -472,17 +469,18 @@ public: |
| 472 | 469 | typedef _Hash hasher; |
| 473 | 470 | typedef _Pred key_equal; |
| 474 | 471 | typedef _Alloc allocator_type; |
| 475 | typedef pair<const key_type, mapped_type> value_type; | |
| 472 | typedef std::pair<const key_type, mapped_type> value_type; | |
| 476 | 473 | typedef value_type& reference; |
| 477 | 474 | typedef const value_type& const_reference; |
| 478 | 475 | |
| 479 | 476 | private: |
| 480 | typedef pair<key_type, mapped_type> __value_type; | |
| 477 | typedef std::pair<key_type, mapped_type> __value_type; | |
| 481 | 478 | typedef __hash_map_hasher<__value_type, hasher> __hasher; |
| 482 | 479 | typedef __hash_map_equal<__value_type, key_equal> __key_equal; |
| 483 | typedef typename __rebind_alloc_helper<allocator_traits<allocator_type>, __value_type>::type __allocator_type; | |
| 480 | typedef typename std::__rebind_alloc_helper< | |
| 481 | std::allocator_traits<allocator_type>, __value_type>::type __allocator_type; | |
| 484 | 482 | |
| 485 | typedef __hash_table<__value_type, __hasher, | |
| 483 | typedef std::__hash_table<__value_type, __hasher, | |
| 486 | 484 | __key_equal, __allocator_type> __table; |
| 487 | 485 | |
| 488 | 486 | __table __table_; |
| ... | ... | @@ -493,8 +491,8 @@ private: |
| 493 | 491 | typedef typename __table::__node_allocator __node_allocator; |
| 494 | 492 | typedef typename __table::__node __node; |
| 495 | 493 | typedef __hash_map_node_destructor<__node_allocator> _Dp; |
| 496 | typedef unique_ptr<__node, _Dp> __node_holder; | |
| 497 | typedef allocator_traits<allocator_type> __alloc_traits; | |
| 494 | typedef std::unique_ptr<__node, _Dp> __node_holder; | |
| 495 | typedef std::allocator_traits<allocator_type> __alloc_traits; | |
| 498 | 496 | public: |
| 499 | 497 | typedef typename __alloc_traits::pointer pointer; |
| 500 | 498 | typedef typename __alloc_traits::const_pointer const_pointer; |
| ... | ... | @@ -544,7 +542,7 @@ public: |
| 544 | 542 | const_iterator end() const {return __table_.end();} |
| 545 | 543 | |
| 546 | 544 | _LIBCPP_INLINE_VISIBILITY |
| 547 | pair<iterator, bool> insert(const value_type& __x) | |
| 545 | std::pair<iterator, bool> insert(const value_type& __x) | |
| 548 | 546 | {return __table_.__insert_unique(__x);} |
| 549 | 547 | _LIBCPP_INLINE_VISIBILITY |
| 550 | 548 | iterator insert(const_iterator, const value_type& __x) {return insert(__x).first;} |
| ... | ... | @@ -579,10 +577,10 @@ public: |
| 579 | 577 | _LIBCPP_INLINE_VISIBILITY |
| 580 | 578 | size_type count(const key_type& __k) const {return __table_.__count_unique(__k);} |
| 581 | 579 | _LIBCPP_INLINE_VISIBILITY |
| 582 | pair<iterator, iterator> equal_range(const key_type& __k) | |
| 580 | std::pair<iterator, iterator> equal_range(const key_type& __k) | |
| 583 | 581 | {return __table_.__equal_range_unique(__k);} |
| 584 | 582 | _LIBCPP_INLINE_VISIBILITY |
| 585 | pair<const_iterator, const_iterator> equal_range(const key_type& __k) const | |
| 583 | std::pair<const_iterator, const_iterator> equal_range(const key_type& __k) const | |
| 586 | 584 | {return __table_.__equal_range_unique(__k);} |
| 587 | 585 | |
| 588 | 586 | mapped_type& operator[](const key_type& __k); |
| ... | ... | @@ -692,7 +690,7 @@ hash_map<_Key, _Tp, _Hash, _Pred, _Alloc>::operator[](const key_type& __k) |
| 692 | 690 | if (__i != end()) |
| 693 | 691 | return __i->second; |
| 694 | 692 | __node_holder __h = __construct_node(__k); |
| 695 | pair<iterator, bool> __r = __table_.__node_insert_unique(__h.get()); | |
| 693 | std::pair<iterator, bool> __r = __table_.__node_insert_unique(__h.get()); | |
| 696 | 694 | __h.release(); |
| 697 | 695 | return __r.first->second; |
| 698 | 696 | } |
| ... | ... | @@ -734,8 +732,8 @@ operator!=(const hash_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __x, |
| 734 | 732 | return !(__x == __y); |
| 735 | 733 | } |
| 736 | 734 | |
| 737 | template <class _Key, class _Tp, class _Hash = hash<_Key>, class _Pred = equal_to<_Key>, | |
| 738 | class _Alloc = allocator<pair<const _Key, _Tp> > > | |
| 735 | template <class _Key, class _Tp, class _Hash = hash<_Key>, class _Pred = std::equal_to<_Key>, | |
| 736 | class _Alloc = std::allocator<std::pair<const _Key, _Tp> > > | |
| 739 | 737 | class _LIBCPP_TEMPLATE_VIS hash_multimap |
| 740 | 738 | { |
| 741 | 739 | public: |
| ... | ... | @@ -746,17 +744,17 @@ public: |
| 746 | 744 | typedef _Hash hasher; |
| 747 | 745 | typedef _Pred key_equal; |
| 748 | 746 | typedef _Alloc allocator_type; |
| 749 | typedef pair<const key_type, mapped_type> value_type; | |
| 747 | typedef std::pair<const key_type, mapped_type> value_type; | |
| 750 | 748 | typedef value_type& reference; |
| 751 | 749 | typedef const value_type& const_reference; |
| 752 | 750 | |
| 753 | 751 | private: |
| 754 | typedef pair<key_type, mapped_type> __value_type; | |
| 752 | typedef std::pair<key_type, mapped_type> __value_type; | |
| 755 | 753 | typedef __hash_map_hasher<__value_type, hasher> __hasher; |
| 756 | 754 | typedef __hash_map_equal<__value_type, key_equal> __key_equal; |
| 757 | typedef typename __rebind_alloc_helper<allocator_traits<allocator_type>, __value_type>::type __allocator_type; | |
| 755 | typedef typename std::__rebind_alloc_helper<std::allocator_traits<allocator_type>, __value_type>::type __allocator_type; | |
| 758 | 756 | |
| 759 | typedef __hash_table<__value_type, __hasher, | |
| 757 | typedef std::__hash_table<__value_type, __hasher, | |
| 760 | 758 | __key_equal, __allocator_type> __table; |
| 761 | 759 | |
| 762 | 760 | __table __table_; |
| ... | ... | @@ -765,8 +763,8 @@ private: |
| 765 | 763 | typedef typename __table::__node_allocator __node_allocator; |
| 766 | 764 | typedef typename __table::__node __node; |
| 767 | 765 | typedef __hash_map_node_destructor<__node_allocator> _Dp; |
| 768 | typedef unique_ptr<__node, _Dp> __node_holder; | |
| 769 | typedef allocator_traits<allocator_type> __alloc_traits; | |
| 766 | typedef std::unique_ptr<__node, _Dp> __node_holder; | |
| 767 | typedef std::allocator_traits<allocator_type> __alloc_traits; | |
| 770 | 768 | public: |
| 771 | 769 | typedef typename __alloc_traits::pointer pointer; |
| 772 | 770 | typedef typename __alloc_traits::const_pointer const_pointer; |
| ... | ... | @@ -851,10 +849,10 @@ public: |
| 851 | 849 | _LIBCPP_INLINE_VISIBILITY |
| 852 | 850 | size_type count(const key_type& __k) const {return __table_.__count_multi(__k);} |
| 853 | 851 | _LIBCPP_INLINE_VISIBILITY |
| 854 | pair<iterator, iterator> equal_range(const key_type& __k) | |
| 852 | std::pair<iterator, iterator> equal_range(const key_type& __k) | |
| 855 | 853 | {return __table_.__equal_range_multi(__k);} |
| 856 | 854 | _LIBCPP_INLINE_VISIBILITY |
| 857 | pair<const_iterator, const_iterator> equal_range(const key_type& __k) const | |
| 855 | std::pair<const_iterator, const_iterator> equal_range(const key_type& __k) const | |
| 858 | 856 | {return __table_.__equal_range_multi(__k);} |
| 859 | 857 | |
| 860 | 858 | _LIBCPP_INLINE_VISIBILITY |
| ... | ... | @@ -956,7 +954,7 @@ operator==(const hash_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __x, |
| 956 | 954 | return false; |
| 957 | 955 | typedef typename hash_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::const_iterator |
| 958 | 956 | const_iterator; |
| 959 | typedef pair<const_iterator, const_iterator> _EqRng; | |
| 957 | typedef std::pair<const_iterator, const_iterator> _EqRng; | |
| 960 | 958 | for (const_iterator __i = __x.begin(), __ex = __x.end(); __i != __ex;) |
| 961 | 959 | { |
| 962 | 960 | _EqRng __xeq = __x.equal_range(__i->first); |
lib/libcxx/include/ext/hash_set+16-18| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===------------------------- hash_set ------------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 | |
| ... | ... | @@ -208,10 +207,9 @@ template <class Value, class Hash, class Pred, class Alloc> |
| 208 | 207 | |
| 209 | 208 | namespace __gnu_cxx { |
| 210 | 209 | |
| 211 | using namespace std; | |
| 212 | 210 | |
| 213 | template <class _Value, class _Hash = hash<_Value>, class _Pred = equal_to<_Value>, | |
| 214 | class _Alloc = allocator<_Value> > | |
| 211 | template <class _Value, class _Hash = hash<_Value>, class _Pred = std::equal_to<_Value>, | |
| 212 | class _Alloc = std::allocator<_Value> > | |
| 215 | 213 | class _LIBCPP_TEMPLATE_VIS hash_set |
| 216 | 214 | { |
| 217 | 215 | public: |
| ... | ... | @@ -225,7 +223,7 @@ public: |
| 225 | 223 | typedef const value_type& const_reference; |
| 226 | 224 | |
| 227 | 225 | private: |
| 228 | typedef __hash_table<value_type, hasher, key_equal, allocator_type> __table; | |
| 226 | typedef std::__hash_table<value_type, hasher, key_equal, allocator_type> __table; | |
| 229 | 227 | |
| 230 | 228 | __table __table_; |
| 231 | 229 | |
| ... | ... | @@ -277,7 +275,7 @@ public: |
| 277 | 275 | const_iterator end() const {return __table_.end();} |
| 278 | 276 | |
| 279 | 277 | _LIBCPP_INLINE_VISIBILITY |
| 280 | pair<iterator, bool> insert(const value_type& __x) | |
| 278 | std::pair<iterator, bool> insert(const value_type& __x) | |
| 281 | 279 | {return __table_.__insert_unique(__x);} |
| 282 | 280 | _LIBCPP_INLINE_VISIBILITY |
| 283 | 281 | iterator insert(const_iterator, const value_type& __x) {return insert(__x).first;} |
| ... | ... | @@ -310,10 +308,10 @@ public: |
| 310 | 308 | _LIBCPP_INLINE_VISIBILITY |
| 311 | 309 | size_type count(const key_type& __k) const {return __table_.__count_unique(__k);} |
| 312 | 310 | _LIBCPP_INLINE_VISIBILITY |
| 313 | pair<iterator, iterator> equal_range(const key_type& __k) | |
| 311 | std::pair<iterator, iterator> equal_range(const key_type& __k) | |
| 314 | 312 | {return __table_.__equal_range_unique(__k);} |
| 315 | 313 | _LIBCPP_INLINE_VISIBILITY |
| 316 | pair<const_iterator, const_iterator> equal_range(const key_type& __k) const | |
| 314 | std::pair<const_iterator, const_iterator> equal_range(const key_type& __k) const | |
| 317 | 315 | {return __table_.__equal_range_unique(__k);} |
| 318 | 316 | |
| 319 | 317 | _LIBCPP_INLINE_VISIBILITY |
| ... | ... | @@ -432,8 +430,8 @@ operator!=(const hash_set<_Value, _Hash, _Pred, _Alloc>& __x, |
| 432 | 430 | return !(__x == __y); |
| 433 | 431 | } |
| 434 | 432 | |
| 435 | template <class _Value, class _Hash = hash<_Value>, class _Pred = equal_to<_Value>, | |
| 436 | class _Alloc = allocator<_Value> > | |
| 433 | template <class _Value, class _Hash = hash<_Value>, class _Pred = std::equal_to<_Value>, | |
| 434 | class _Alloc = std::allocator<_Value> > | |
| 437 | 435 | class _LIBCPP_TEMPLATE_VIS hash_multiset |
| 438 | 436 | { |
| 439 | 437 | public: |
| ... | ... | @@ -447,7 +445,7 @@ public: |
| 447 | 445 | typedef const value_type& const_reference; |
| 448 | 446 | |
| 449 | 447 | private: |
| 450 | typedef __hash_table<value_type, hasher, key_equal, allocator_type> __table; | |
| 448 | typedef std::__hash_table<value_type, hasher, key_equal, allocator_type> __table; | |
| 451 | 449 | |
| 452 | 450 | __table __table_; |
| 453 | 451 | |
| ... | ... | @@ -531,10 +529,10 @@ public: |
| 531 | 529 | _LIBCPP_INLINE_VISIBILITY |
| 532 | 530 | size_type count(const key_type& __k) const {return __table_.__count_multi(__k);} |
| 533 | 531 | _LIBCPP_INLINE_VISIBILITY |
| 534 | pair<iterator, iterator> equal_range(const key_type& __k) | |
| 532 | std::pair<iterator, iterator> equal_range(const key_type& __k) | |
| 535 | 533 | {return __table_.__equal_range_multi(__k);} |
| 536 | 534 | _LIBCPP_INLINE_VISIBILITY |
| 537 | pair<const_iterator, const_iterator> equal_range(const key_type& __k) const | |
| 535 | std::pair<const_iterator, const_iterator> equal_range(const key_type& __k) const | |
| 538 | 536 | {return __table_.__equal_range_multi(__k);} |
| 539 | 537 | |
| 540 | 538 | _LIBCPP_INLINE_VISIBILITY |
| ... | ... | @@ -611,7 +609,7 @@ template <class _InputIterator> |
| 611 | 609 | inline |
| 612 | 610 | void |
| 613 | 611 | hash_multiset<_Value, _Hash, _Pred, _Alloc>::insert(_InputIterator __first, |
| 614 | _InputIterator __last) | |
| 612 | _InputIterator __last) | |
| 615 | 613 | { |
| 616 | 614 | for (; __first != __last; ++__first) |
| 617 | 615 | __table_.__insert_multi(*__first); |
| ... | ... | @@ -635,7 +633,7 @@ operator==(const hash_multiset<_Value, _Hash, _Pred, _Alloc>& __x, |
| 635 | 633 | return false; |
| 636 | 634 | typedef typename hash_multiset<_Value, _Hash, _Pred, _Alloc>::const_iterator |
| 637 | 635 | const_iterator; |
| 638 | typedef pair<const_iterator, const_iterator> _EqRng; | |
| 636 | typedef std::pair<const_iterator, const_iterator> _EqRng; | |
| 639 | 637 | for (const_iterator __i = __x.begin(), __ex = __x.end(); __i != __ex;) |
| 640 | 638 | { |
| 641 | 639 | _EqRng __xeq = __x.equal_range(*__i); |
lib/libcxx/include/fenv.h created+116| ... | ... | @@ -0,0 +1,116 @@ |
| 1 | // -*- C++ -*- | |
| 2 | //===---------------------------- math.h ----------------------------------===// | |
| 3 | // | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 7 | // | |
| 8 | //===----------------------------------------------------------------------===// | |
| 9 | ||
| 10 | #ifndef _LIBCPP_FENV_H | |
| 11 | #define _LIBCPP_FENV_H | |
| 12 | ||
| 13 | ||
| 14 | /* | |
| 15 | fenv.h synopsis | |
| 16 | ||
| 17 | This entire header is C99 / C++0X | |
| 18 | ||
| 19 | Macros: | |
| 20 | ||
| 21 | FE_DIVBYZERO | |
| 22 | FE_INEXACT | |
| 23 | FE_INVALID | |
| 24 | FE_OVERFLOW | |
| 25 | FE_UNDERFLOW | |
| 26 | FE_ALL_EXCEPT | |
| 27 | FE_DOWNWARD | |
| 28 | FE_TONEAREST | |
| 29 | FE_TOWARDZERO | |
| 30 | FE_UPWARD | |
| 31 | FE_DFL_ENV | |
| 32 | ||
| 33 | Types: | |
| 34 | ||
| 35 | fenv_t | |
| 36 | fexcept_t | |
| 37 | ||
| 38 | int feclearexcept(int excepts); | |
| 39 | int fegetexceptflag(fexcept_t* flagp, int excepts); | |
| 40 | int feraiseexcept(int excepts); | |
| 41 | int fesetexceptflag(const fexcept_t* flagp, int excepts); | |
| 42 | int fetestexcept(int excepts); | |
| 43 | int fegetround(); | |
| 44 | int fesetround(int round); | |
| 45 | int fegetenv(fenv_t* envp); | |
| 46 | int feholdexcept(fenv_t* envp); | |
| 47 | int fesetenv(const fenv_t* envp); | |
| 48 | int feupdateenv(const fenv_t* envp); | |
| 49 | ||
| 50 | ||
| 51 | */ | |
| 52 | ||
| 53 | #include <__config> | |
| 54 | ||
| 55 | #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) | |
| 56 | #pragma GCC system_header | |
| 57 | #endif | |
| 58 | ||
| 59 | #include_next <fenv.h> | |
| 60 | ||
| 61 | #ifdef __cplusplus | |
| 62 | ||
| 63 | extern "C++" { | |
| 64 | ||
| 65 | #ifdef feclearexcept | |
| 66 | #undef feclearexcept | |
| 67 | #endif | |
| 68 | ||
| 69 | #ifdef fegetexceptflag | |
| 70 | #undef fegetexceptflag | |
| 71 | #endif | |
| 72 | ||
| 73 | ||
| 74 | #ifdef feraiseexcept | |
| 75 | #undef feraiseexcept | |
| 76 | #endif | |
| 77 | ||
| 78 | #ifdef fesetexceptflag | |
| 79 | #undef fesetexceptflag | |
| 80 | #endif | |
| 81 | ||
| 82 | ||
| 83 | #ifdef fetestexcept | |
| 84 | #undef fetestexcept | |
| 85 | #endif | |
| 86 | ||
| 87 | #ifdef fegetround | |
| 88 | #undef fegetround | |
| 89 | #endif | |
| 90 | ||
| 91 | #ifdef fesetround | |
| 92 | #undef fesetround | |
| 93 | #endif | |
| 94 | ||
| 95 | #ifdef fegetenv | |
| 96 | #undef fegetenv | |
| 97 | #endif | |
| 98 | ||
| 99 | #ifdef feholdexcept | |
| 100 | #undef feholdexcept | |
| 101 | #endif | |
| 102 | ||
| 103 | ||
| 104 | #ifdef fesetenv | |
| 105 | #undef fesetenv | |
| 106 | #endif | |
| 107 | ||
| 108 | #ifdef feupdateenv | |
| 109 | #undef feupdateenv | |
| 110 | #endif | |
| 111 | ||
| 112 | } // extern "C++" | |
| 113 | ||
| 114 | #endif // defined(__cplusplus) | |
| 115 | ||
| 116 | #endif // _LIBCPP_FENV_H |
lib/libcxx/include/filesystem+19-13| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===--------------------------- filesystem -------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 | #ifndef _LIBCPP_FILESYSTEM |
| ... | ... | @@ -259,6 +258,8 @@ _LIBCPP_PUSH_MACROS |
| 259 | 258 | |
| 260 | 259 | _LIBCPP_BEGIN_NAMESPACE_FILESYSTEM |
| 261 | 260 | |
| 261 | _LIBCPP_AVAILABILITY_FILESYSTEM_PUSH | |
| 262 | ||
| 262 | 263 | typedef chrono::time_point<_FilesystemClock> file_time_type; |
| 263 | 264 | |
| 264 | 265 | struct _LIBCPP_TYPE_VIS space_info { |
| ... | ... | @@ -1311,7 +1312,11 @@ inline _LIBCPP_INLINE_VISIBILITY bool operator!=(const path::iterator& __lhs, |
| 1311 | 1312 | return !(__lhs == __rhs); |
| 1312 | 1313 | } |
| 1313 | 1314 | |
| 1314 | class _LIBCPP_EXCEPTION_ABI filesystem_error : public system_error { | |
| 1315 | // TODO(ldionne): We need to pop the pragma and push it again after | |
| 1316 | // filesystem_error to work around PR41078. | |
| 1317 | _LIBCPP_AVAILABILITY_FILESYSTEM_POP | |
| 1318 | ||
| 1319 | class _LIBCPP_AVAILABILITY_FILESYSTEM _LIBCPP_EXCEPTION_ABI filesystem_error : public system_error { | |
| 1315 | 1320 | public: |
| 1316 | 1321 | _LIBCPP_INLINE_VISIBILITY |
| 1317 | 1322 | filesystem_error(const string& __what, error_code __ec) |
| ... | ... | @@ -1348,11 +1353,10 @@ public: |
| 1348 | 1353 | return __storage_->__what_.c_str(); |
| 1349 | 1354 | } |
| 1350 | 1355 | |
| 1351 | _LIBCPP_FUNC_VIS | |
| 1352 | 1356 | void __create_what(int __num_paths); |
| 1353 | 1357 | |
| 1354 | 1358 | private: |
| 1355 | struct _Storage { | |
| 1359 | struct _LIBCPP_HIDDEN _Storage { | |
| 1356 | 1360 | _LIBCPP_INLINE_VISIBILITY |
| 1357 | 1361 | _Storage(const path& __p1, const path& __p2) : __p1_(__p1), __p2_(__p2) {} |
| 1358 | 1362 | |
| ... | ... | @@ -1363,16 +1367,16 @@ private: |
| 1363 | 1367 | shared_ptr<_Storage> __storage_; |
| 1364 | 1368 | }; |
| 1365 | 1369 | |
| 1370 | _LIBCPP_AVAILABILITY_FILESYSTEM_PUSH | |
| 1371 | ||
| 1366 | 1372 | template <class... _Args> |
| 1367 | 1373 | _LIBCPP_NORETURN inline _LIBCPP_INLINE_VISIBILITY |
| 1368 | 1374 | #ifndef _LIBCPP_NO_EXCEPTIONS |
| 1369 | void | |
| 1370 | __throw_filesystem_error(_Args&&... __args) { | |
| 1375 | void __throw_filesystem_error(_Args&&... __args) { | |
| 1371 | 1376 | throw filesystem_error(std::forward<_Args>(__args)...); |
| 1372 | 1377 | } |
| 1373 | 1378 | #else |
| 1374 | void | |
| 1375 | __throw_filesystem_error(_Args&&...) { | |
| 1379 | void __throw_filesystem_error(_Args&&...) { | |
| 1376 | 1380 | _VSTD::abort(); |
| 1377 | 1381 | } |
| 1378 | 1382 | #endif |
| ... | ... | @@ -1938,7 +1942,7 @@ inline _LIBCPP_INLINE_VISIBILITY path weakly_canonical(path const& __p, |
| 1938 | 1942 | |
| 1939 | 1943 | class directory_iterator; |
| 1940 | 1944 | class recursive_directory_iterator; |
| 1941 | class __dir_stream; | |
| 1945 | class _LIBCPP_HIDDEN __dir_stream; | |
| 1942 | 1946 | |
| 1943 | 1947 | class directory_entry { |
| 1944 | 1948 | typedef _VSTD_FS::path _Path; |
| ... | ... | @@ -2601,7 +2605,7 @@ private: |
| 2601 | 2605 | operator==(const recursive_directory_iterator&, |
| 2602 | 2606 | const recursive_directory_iterator&) noexcept; |
| 2603 | 2607 | |
| 2604 | struct __shared_imp; | |
| 2608 | struct _LIBCPP_HIDDEN __shared_imp; | |
| 2605 | 2609 | shared_ptr<__shared_imp> __imp_; |
| 2606 | 2610 | bool __rec_; |
| 2607 | 2611 | }; // class recursive_directory_iterator |
| ... | ... | @@ -2628,6 +2632,8 @@ end(const recursive_directory_iterator&) noexcept { |
| 2628 | 2632 | return recursive_directory_iterator(); |
| 2629 | 2633 | } |
| 2630 | 2634 | |
| 2635 | _LIBCPP_AVAILABILITY_FILESYSTEM_POP | |
| 2636 | ||
| 2631 | 2637 | _LIBCPP_END_NAMESPACE_FILESYSTEM |
| 2632 | 2638 | |
| 2633 | 2639 | #endif // !_LIBCPP_CXX03_LANG |
lib/libcxx/include/float.h+3-4| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===--------------------------- float.h ----------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 |
lib/libcxx/include/forward_list+45-32| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===----------------------- forward_list ---------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 | |
| ... | ... | @@ -121,10 +120,12 @@ public: |
| 121 | 120 | const_iterator first, const_iterator last); |
| 122 | 121 | void splice_after(const_iterator p, forward_list&& x, |
| 123 | 122 | const_iterator first, const_iterator last); |
| 124 | void remove(const value_type& v); | |
| 125 | template <class Predicate> void remove_if(Predicate pred); | |
| 126 | void unique(); | |
| 127 | template <class BinaryPredicate> void unique(BinaryPredicate binary_pred); | |
| 123 | size_type remove(const value_type& v); // void before C++20 | |
| 124 | template <class Predicate> | |
| 125 | size_type remove_if(Predicate pred); // void before C++20 | |
| 126 | size_type unique(); // void before C++20 | |
| 127 | template <class BinaryPredicate> | |
| 128 | size_type unique(BinaryPredicate binary_pred); // void before C++20 | |
| 128 | 129 | void merge(forward_list& x); |
| 129 | 130 | void merge(forward_list&& x); |
| 130 | 131 | template <class Compare> void merge(forward_list& x, Compare comp); |
| ... | ... | @@ -531,7 +532,7 @@ public: |
| 531 | 532 | #if _LIBCPP_STD_VER >= 14 |
| 532 | 533 | _NOEXCEPT; |
| 533 | 534 | #else |
| 534 | _NOEXCEPT_(!__node_traits::propagate_on_container_move_assignment::value || | |
| 535 | _NOEXCEPT_(!__node_traits::propagate_on_container_move_assignment::value || | |
| 535 | 536 | __is_nothrow_swappable<__node_allocator>::value); |
| 536 | 537 | #endif |
| 537 | 538 | protected: |
| ... | ... | @@ -596,11 +597,11 @@ __forward_list_base<_Tp, _Alloc>::swap(__forward_list_base& __x) |
| 596 | 597 | #if _LIBCPP_STD_VER >= 14 |
| 597 | 598 | _NOEXCEPT |
| 598 | 599 | #else |
| 599 | _NOEXCEPT_(!__node_traits::propagate_on_container_move_assignment::value || | |
| 600 | _NOEXCEPT_(!__node_traits::propagate_on_container_move_assignment::value || | |
| 600 | 601 | __is_nothrow_swappable<__node_allocator>::value) |
| 601 | 602 | #endif |
| 602 | 603 | { |
| 603 | __swap_allocator(__alloc(), __x.__alloc(), | |
| 604 | __swap_allocator(__alloc(), __x.__alloc(), | |
| 604 | 605 | integral_constant<bool, __node_traits::propagate_on_container_swap::value>()); |
| 605 | 606 | using _VSTD::swap; |
| 606 | 607 | swap(__before_begin()->__next_, __x.__before_begin()->__next_); |
| ... | ... | @@ -648,6 +649,11 @@ public: |
| 648 | 649 | |
| 649 | 650 | typedef typename base::iterator iterator; |
| 650 | 651 | typedef typename base::const_iterator const_iterator; |
| 652 | #if _LIBCPP_STD_VER > 17 | |
| 653 | typedef size_type __remove_return_type; | |
| 654 | #else | |
| 655 | typedef void __remove_return_type; | |
| 656 | #endif | |
| 651 | 657 | |
| 652 | 658 | _LIBCPP_INLINE_VISIBILITY |
| 653 | 659 | forward_list() |
| ... | ... | @@ -809,7 +815,6 @@ public: |
| 809 | 815 | _LIBCPP_INLINE_VISIBILITY |
| 810 | 816 | void clear() _NOEXCEPT {base::clear();} |
| 811 | 817 | |
| 812 | #ifndef _LIBCPP_CXX03_LANG | |
| 813 | 818 | _LIBCPP_INLINE_VISIBILITY |
| 814 | 819 | void splice_after(const_iterator __p, forward_list&& __x); |
| 815 | 820 | _LIBCPP_INLINE_VISIBILITY |
| ... | ... | @@ -817,16 +822,15 @@ public: |
| 817 | 822 | _LIBCPP_INLINE_VISIBILITY |
| 818 | 823 | void splice_after(const_iterator __p, forward_list&& __x, |
| 819 | 824 | const_iterator __f, const_iterator __l); |
| 820 | #endif // _LIBCPP_CXX03_LANG | |
| 821 | 825 | void splice_after(const_iterator __p, forward_list& __x); |
| 822 | 826 | void splice_after(const_iterator __p, forward_list& __x, const_iterator __i); |
| 823 | 827 | void splice_after(const_iterator __p, forward_list& __x, |
| 824 | 828 | const_iterator __f, const_iterator __l); |
| 825 | void remove(const value_type& __v); | |
| 826 | template <class _Predicate> void remove_if(_Predicate __pred); | |
| 829 | __remove_return_type remove(const value_type& __v); | |
| 830 | template <class _Predicate> __remove_return_type remove_if(_Predicate __pred); | |
| 827 | 831 | _LIBCPP_INLINE_VISIBILITY |
| 828 | void unique() {unique(__equal_to<value_type>());} | |
| 829 | template <class _BinaryPredicate> void unique(_BinaryPredicate __binary_pred); | |
| 832 | __remove_return_type unique() {return unique(__equal_to<value_type>());} | |
| 833 | template <class _BinaryPredicate> __remove_return_type unique(_BinaryPredicate __binary_pred); | |
| 830 | 834 | #ifndef _LIBCPP_CXX03_LANG |
| 831 | 835 | _LIBCPP_INLINE_VISIBILITY |
| 832 | 836 | void merge(forward_list&& __x) {merge(__x, __less<value_type>());} |
| ... | ... | @@ -1469,8 +1473,6 @@ forward_list<_Tp, _Alloc>::splice_after(const_iterator __p, |
| 1469 | 1473 | } |
| 1470 | 1474 | } |
| 1471 | 1475 | |
| 1472 | #ifndef _LIBCPP_CXX03_LANG | |
| 1473 | ||
| 1474 | 1476 | template <class _Tp, class _Alloc> |
| 1475 | 1477 | inline _LIBCPP_INLINE_VISIBILITY |
| 1476 | 1478 | void |
| ... | ... | @@ -1500,21 +1502,21 @@ forward_list<_Tp, _Alloc>::splice_after(const_iterator __p, |
| 1500 | 1502 | splice_after(__p, __x, __f, __l); |
| 1501 | 1503 | } |
| 1502 | 1504 | |
| 1503 | #endif // _LIBCPP_CXX03_LANG | |
| 1504 | ||
| 1505 | 1505 | template <class _Tp, class _Alloc> |
| 1506 | void | |
| 1506 | typename forward_list<_Tp, _Alloc>::__remove_return_type | |
| 1507 | 1507 | forward_list<_Tp, _Alloc>::remove(const value_type& __v) |
| 1508 | 1508 | { |
| 1509 | forward_list<_Tp, _Alloc> __deleted_nodes; // collect the nodes we're removing | |
| 1510 | iterator __e = end(); | |
| 1509 | forward_list<_Tp, _Alloc> __deleted_nodes(get_allocator()); // collect the nodes we're removing | |
| 1510 | typename forward_list<_Tp, _Alloc>::size_type __count_removed = 0; | |
| 1511 | const iterator __e = end(); | |
| 1511 | 1512 | for (iterator __i = before_begin(); __i.__get_begin()->__next_ != nullptr;) |
| 1512 | 1513 | { |
| 1513 | 1514 | if (__i.__get_begin()->__next_->__value_ == __v) |
| 1514 | 1515 | { |
| 1516 | ++__count_removed; | |
| 1515 | 1517 | iterator __j = _VSTD::next(__i, 2); |
| 1516 | 1518 | for (; __j != __e && *__j == __v; ++__j) |
| 1517 | ; | |
| 1519 | ++__count_removed; | |
| 1518 | 1520 | __deleted_nodes.splice_after(__deleted_nodes.before_begin(), *this, __i, __j); |
| 1519 | 1521 | if (__j == __e) |
| 1520 | 1522 | break; |
| ... | ... | @@ -1523,22 +1525,27 @@ forward_list<_Tp, _Alloc>::remove(const value_type& __v) |
| 1523 | 1525 | else |
| 1524 | 1526 | ++__i; |
| 1525 | 1527 | } |
| 1528 | ||
| 1529 | return (__remove_return_type) __count_removed; | |
| 1526 | 1530 | } |
| 1527 | 1531 | |
| 1528 | 1532 | template <class _Tp, class _Alloc> |
| 1529 | 1533 | template <class _Predicate> |
| 1530 | void | |
| 1534 | typename forward_list<_Tp, _Alloc>::__remove_return_type | |
| 1531 | 1535 | forward_list<_Tp, _Alloc>::remove_if(_Predicate __pred) |
| 1532 | 1536 | { |
| 1533 | iterator __e = end(); | |
| 1537 | forward_list<_Tp, _Alloc> __deleted_nodes(get_allocator()); // collect the nodes we're removing | |
| 1538 | typename forward_list<_Tp, _Alloc>::size_type __count_removed = 0; | |
| 1539 | const iterator __e = end(); | |
| 1534 | 1540 | for (iterator __i = before_begin(); __i.__get_begin()->__next_ != nullptr;) |
| 1535 | 1541 | { |
| 1536 | 1542 | if (__pred(__i.__get_begin()->__next_->__value_)) |
| 1537 | 1543 | { |
| 1544 | ++__count_removed; | |
| 1538 | 1545 | iterator __j = _VSTD::next(__i, 2); |
| 1539 | 1546 | for (; __j != __e && __pred(*__j); ++__j) |
| 1540 | ; | |
| 1541 | erase_after(__i, __j); | |
| 1547 | ++__count_removed; | |
| 1548 | __deleted_nodes.splice_after(__deleted_nodes.before_begin(), *this, __i, __j); | |
| 1542 | 1549 | if (__j == __e) |
| 1543 | 1550 | break; |
| 1544 | 1551 | __i = __j; |
| ... | ... | @@ -1546,22 +1553,28 @@ forward_list<_Tp, _Alloc>::remove_if(_Predicate __pred) |
| 1546 | 1553 | else |
| 1547 | 1554 | ++__i; |
| 1548 | 1555 | } |
| 1556 | ||
| 1557 | return (__remove_return_type) __count_removed; | |
| 1549 | 1558 | } |
| 1550 | 1559 | |
| 1551 | 1560 | template <class _Tp, class _Alloc> |
| 1552 | 1561 | template <class _BinaryPredicate> |
| 1553 | void | |
| 1562 | typename forward_list<_Tp, _Alloc>::__remove_return_type | |
| 1554 | 1563 | forward_list<_Tp, _Alloc>::unique(_BinaryPredicate __binary_pred) |
| 1555 | 1564 | { |
| 1565 | forward_list<_Tp, _Alloc> __deleted_nodes(get_allocator()); // collect the nodes we're removing | |
| 1566 | typename forward_list<_Tp, _Alloc>::size_type __count_removed = 0; | |
| 1556 | 1567 | for (iterator __i = begin(), __e = end(); __i != __e;) |
| 1557 | 1568 | { |
| 1558 | 1569 | iterator __j = _VSTD::next(__i); |
| 1559 | 1570 | for (; __j != __e && __binary_pred(*__i, *__j); ++__j) |
| 1560 | ; | |
| 1571 | ++__count_removed; | |
| 1561 | 1572 | if (__i.__get_begin()->__next_ != __j.__get_unsafe_node_pointer()) |
| 1562 | erase_after(__i, __j); | |
| 1573 | __deleted_nodes.splice_after(__deleted_nodes.before_begin(), *this, __i, __j); | |
| 1563 | 1574 | __i = __j; |
| 1564 | 1575 | } |
| 1576 | ||
| 1577 | return (__remove_return_type) __count_removed; | |
| 1565 | 1578 | } |
| 1566 | 1579 | |
| 1567 | 1580 | template <class _Tp, class _Alloc> |
lib/libcxx/include/fstream+11-12| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===------------------------- fstream ------------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 | |
| ... | ... | @@ -236,7 +235,7 @@ public: |
| 236 | 235 | basic_filebuf* open(const string& __s, ios_base::openmode __mode); |
| 237 | 236 | |
| 238 | 237 | #if _LIBCPP_STD_VER >= 17 |
| 239 | _LIBCPP_INLINE_VISIBILITY | |
| 238 | _LIBCPP_AVAILABILITY_FILESYSTEM _LIBCPP_INLINE_VISIBILITY | |
| 240 | 239 | basic_filebuf* open(const _VSTD_FS::path& __p, ios_base::openmode __mode) { |
| 241 | 240 | return open(__p.c_str(), __mode); |
| 242 | 241 | } |
| ... | ... | @@ -758,7 +757,7 @@ basic_filebuf<_CharT, _Traits>::underflow() |
| 758 | 757 | this->eback() + __ibs_, __inext); |
| 759 | 758 | if (__r == codecvt_base::noconv) |
| 760 | 759 | { |
| 761 | this->setg((char_type*)__extbuf_, (char_type*)__extbuf_, | |
| 760 | this->setg((char_type*)__extbuf_, (char_type*)__extbuf_, | |
| 762 | 761 | (char_type*)const_cast<char *>(__extbufend_)); |
| 763 | 762 | __c = traits_type::to_int_type(*this->gptr()); |
| 764 | 763 | } |
| ... | ... | @@ -1152,7 +1151,7 @@ public: |
| 1152 | 1151 | _LIBCPP_INLINE_VISIBILITY |
| 1153 | 1152 | explicit basic_ifstream(const string& __s, ios_base::openmode __mode = ios_base::in); |
| 1154 | 1153 | #if _LIBCPP_STD_VER >= 17 |
| 1155 | _LIBCPP_INLINE_VISIBILITY | |
| 1154 | _LIBCPP_AVAILABILITY_FILESYSTEM _LIBCPP_INLINE_VISIBILITY | |
| 1156 | 1155 | explicit basic_ifstream(const filesystem::path& __p, ios_base::openmode __mode = ios_base::in) |
| 1157 | 1156 | : basic_ifstream(__p.c_str(), __mode) {} |
| 1158 | 1157 | #endif // _LIBCPP_STD_VER >= 17 |
| ... | ... | @@ -1178,7 +1177,7 @@ public: |
| 1178 | 1177 | #endif |
| 1179 | 1178 | void open(const string& __s, ios_base::openmode __mode = ios_base::in); |
| 1180 | 1179 | #if _LIBCPP_STD_VER >= 17 |
| 1181 | _LIBCPP_INLINE_VISIBILITY | |
| 1180 | _LIBCPP_AVAILABILITY_FILESYSTEM _LIBCPP_INLINE_VISIBILITY | |
| 1182 | 1181 | void open(const filesystem::path& __p, |
| 1183 | 1182 | ios_base::openmode __mode = ios_base::in) { |
| 1184 | 1183 | return open(__p.c_str(), __mode); |
| ... | ... | @@ -1366,7 +1365,7 @@ public: |
| 1366 | 1365 | explicit basic_ofstream(const string& __s, ios_base::openmode __mode = ios_base::out); |
| 1367 | 1366 | |
| 1368 | 1367 | #if _LIBCPP_STD_VER >= 17 |
| 1369 | _LIBCPP_INLINE_VISIBILITY | |
| 1368 | _LIBCPP_AVAILABILITY_FILESYSTEM _LIBCPP_INLINE_VISIBILITY | |
| 1370 | 1369 | explicit basic_ofstream(const filesystem::path& __p, ios_base::openmode __mode = ios_base::out) |
| 1371 | 1370 | : basic_ofstream(__p.c_str(), __mode) {} |
| 1372 | 1371 | #endif // _LIBCPP_STD_VER >= 17 |
| ... | ... | @@ -1393,7 +1392,7 @@ public: |
| 1393 | 1392 | void open(const string& __s, ios_base::openmode __mode = ios_base::out); |
| 1394 | 1393 | |
| 1395 | 1394 | #if _LIBCPP_STD_VER >= 17 |
| 1396 | _LIBCPP_INLINE_VISIBILITY | |
| 1395 | _LIBCPP_AVAILABILITY_FILESYSTEM _LIBCPP_INLINE_VISIBILITY | |
| 1397 | 1396 | void open(const filesystem::path& __p, ios_base::openmode __mode = ios_base::out) |
| 1398 | 1397 | { return open(__p.c_str(), __mode); } |
| 1399 | 1398 | #endif // _LIBCPP_STD_VER >= 17 |
| ... | ... | @@ -1580,7 +1579,7 @@ public: |
| 1580 | 1579 | explicit basic_fstream(const string& __s, ios_base::openmode __mode = ios_base::in | ios_base::out); |
| 1581 | 1580 | |
| 1582 | 1581 | #if _LIBCPP_STD_VER >= 17 |
| 1583 | _LIBCPP_INLINE_VISIBILITY | |
| 1582 | _LIBCPP_AVAILABILITY_FILESYSTEM _LIBCPP_INLINE_VISIBILITY | |
| 1584 | 1583 | explicit basic_fstream(const filesystem::path& __p, ios_base::openmode __mode = ios_base::in | ios_base::out) |
| 1585 | 1584 | : basic_fstream(__p.c_str(), __mode) {} |
| 1586 | 1585 | #endif // _LIBCPP_STD_VER >= 17 |
| ... | ... | @@ -1608,7 +1607,7 @@ public: |
| 1608 | 1607 | void open(const string& __s, ios_base::openmode __mode = ios_base::in | ios_base::out); |
| 1609 | 1608 | |
| 1610 | 1609 | #if _LIBCPP_STD_VER >= 17 |
| 1611 | _LIBCPP_INLINE_VISIBILITY | |
| 1610 | _LIBCPP_AVAILABILITY_FILESYSTEM _LIBCPP_INLINE_VISIBILITY | |
| 1612 | 1611 | void open(const filesystem::path& __p, ios_base::openmode __mode = ios_base::in|ios_base::out) |
| 1613 | 1612 | { return open(__p.c_str(), __mode); } |
| 1614 | 1613 | #endif // _LIBCPP_STD_VER >= 17 |
lib/libcxx/include/functional+106-34| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===------------------------ functional ----------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 | |
| ... | ... | @@ -231,6 +230,10 @@ template<class Fn, class... BoundArgs> |
| 231 | 230 | template<class R, class Fn, class... BoundArgs> |
| 232 | 231 | unspecified bind(Fn&&, BoundArgs&&...); |
| 233 | 232 | |
| 233 | template<class F, class... Args> | |
| 234 | invoke_result_t<F, Args...> invoke(F&& f, Args&&... args) // C++17 | |
| 235 | noexcept(is_nothrow_invocable_v<F, Args...>); | |
| 236 | ||
| 234 | 237 | namespace placeholders { |
| 235 | 238 | // M is the implementation-defined number of placeholders |
| 236 | 239 | extern unspecified _1; |
| ... | ... | @@ -1476,6 +1479,8 @@ namespace __function { |
| 1476 | 1479 | // __alloc_func holds a functor and an allocator. |
| 1477 | 1480 | |
| 1478 | 1481 | template <class _Fp, class _Ap, class _FB> class __alloc_func; |
| 1482 | template <class _Fp, class _FB> | |
| 1483 | class __default_alloc_func; | |
| 1479 | 1484 | |
| 1480 | 1485 | template <class _Fp, class _Ap, class _Rp, class... _ArgTypes> |
| 1481 | 1486 | class __alloc_func<_Fp, _Ap, _Rp(_ArgTypes...)> |
| ... | ... | @@ -1483,14 +1488,15 @@ class __alloc_func<_Fp, _Ap, _Rp(_ArgTypes...)> |
| 1483 | 1488 | __compressed_pair<_Fp, _Ap> __f_; |
| 1484 | 1489 | |
| 1485 | 1490 | public: |
| 1486 | typedef _Fp _Target; | |
| 1487 | typedef _Ap _Alloc; | |
| 1491 | typedef _LIBCPP_NODEBUG_TYPE _Fp _Target; | |
| 1492 | typedef _LIBCPP_NODEBUG_TYPE _Ap _Alloc; | |
| 1488 | 1493 | |
| 1489 | 1494 | _LIBCPP_INLINE_VISIBILITY |
| 1490 | 1495 | const _Target& __target() const { return __f_.first(); } |
| 1491 | 1496 | |
| 1497 | // WIN32 APIs may define __allocator, so use __get_allocator instead. | |
| 1492 | 1498 | _LIBCPP_INLINE_VISIBILITY |
| 1493 | const _Alloc& __allocator() const { return __f_.second(); } | |
| 1499 | const _Alloc& __get_allocator() const { return __f_.second(); } | |
| 1494 | 1500 | |
| 1495 | 1501 | _LIBCPP_INLINE_VISIBILITY |
| 1496 | 1502 | explicit __alloc_func(_Target&& __f) |
| ... | ... | @@ -1544,6 +1550,56 @@ class __alloc_func<_Fp, _Ap, _Rp(_ArgTypes...)> |
| 1544 | 1550 | |
| 1545 | 1551 | _LIBCPP_INLINE_VISIBILITY |
| 1546 | 1552 | void destroy() _NOEXCEPT { __f_.~__compressed_pair<_Target, _Alloc>(); } |
| 1553 | ||
| 1554 | static void __destroy_and_delete(__alloc_func* __f) { | |
| 1555 | typedef allocator_traits<_Alloc> __alloc_traits; | |
| 1556 | typedef typename __rebind_alloc_helper<__alloc_traits, __alloc_func>::type | |
| 1557 | _FunAlloc; | |
| 1558 | _FunAlloc __a(__f->__get_allocator()); | |
| 1559 | __f->destroy(); | |
| 1560 | __a.deallocate(__f, 1); | |
| 1561 | } | |
| 1562 | }; | |
| 1563 | ||
| 1564 | template <class _Fp, class _Rp, class... _ArgTypes> | |
| 1565 | class __default_alloc_func<_Fp, _Rp(_ArgTypes...)> { | |
| 1566 | _Fp __f_; | |
| 1567 | ||
| 1568 | public: | |
| 1569 | typedef _LIBCPP_NODEBUG_TYPE _Fp _Target; | |
| 1570 | ||
| 1571 | _LIBCPP_INLINE_VISIBILITY | |
| 1572 | const _Target& __target() const { return __f_; } | |
| 1573 | ||
| 1574 | _LIBCPP_INLINE_VISIBILITY | |
| 1575 | explicit __default_alloc_func(_Target&& __f) : __f_(std::move(__f)) {} | |
| 1576 | ||
| 1577 | _LIBCPP_INLINE_VISIBILITY | |
| 1578 | explicit __default_alloc_func(const _Target& __f) : __f_(__f) {} | |
| 1579 | ||
| 1580 | _LIBCPP_INLINE_VISIBILITY | |
| 1581 | _Rp operator()(_ArgTypes&&... __arg) { | |
| 1582 | typedef __invoke_void_return_wrapper<_Rp> _Invoker; | |
| 1583 | return _Invoker::__call(__f_, _VSTD::forward<_ArgTypes>(__arg)...); | |
| 1584 | } | |
| 1585 | ||
| 1586 | _LIBCPP_INLINE_VISIBILITY | |
| 1587 | __default_alloc_func* __clone() const { | |
| 1588 | __builtin_new_allocator::__holder_t __hold = | |
| 1589 | __builtin_new_allocator::__allocate_type<__default_alloc_func>(1); | |
| 1590 | __default_alloc_func* __res = | |
| 1591 | ::new (__hold.get()) __default_alloc_func(__f_); | |
| 1592 | (void)__hold.release(); | |
| 1593 | return __res; | |
| 1594 | } | |
| 1595 | ||
| 1596 | _LIBCPP_INLINE_VISIBILITY | |
| 1597 | void destroy() _NOEXCEPT { __f_.~_Target(); } | |
| 1598 | ||
| 1599 | static void __destroy_and_delete(__default_alloc_func* __f) { | |
| 1600 | __f->destroy(); | |
| 1601 | __builtin_new_allocator::__deallocate_type<__default_alloc_func>(__f, 1); | |
| 1602 | } | |
| 1547 | 1603 | }; |
| 1548 | 1604 | |
| 1549 | 1605 | // __base provides an abstract interface for copyable functors. |
| ... | ... | @@ -1612,7 +1668,7 @@ __func<_Fp, _Alloc, _Rp(_ArgTypes...)>::__clone() const |
| 1612 | 1668 | { |
| 1613 | 1669 | typedef allocator_traits<_Alloc> __alloc_traits; |
| 1614 | 1670 | typedef typename __rebind_alloc_helper<__alloc_traits, __func>::type _Ap; |
| 1615 | _Ap __a(__f_.__allocator()); | |
| 1671 | _Ap __a(__f_.__get_allocator()); | |
| 1616 | 1672 | typedef __allocator_destructor<_Ap> _Dp; |
| 1617 | 1673 | unique_ptr<__func, _Dp> __hold(__a.allocate(1), _Dp(__a, 1)); |
| 1618 | 1674 | ::new ((void*)__hold.get()) __func(__f_.__target(), _Alloc(__a)); |
| ... | ... | @@ -1623,7 +1679,7 @@ template<class _Fp, class _Alloc, class _Rp, class ..._ArgTypes> |
| 1623 | 1679 | void |
| 1624 | 1680 | __func<_Fp, _Alloc, _Rp(_ArgTypes...)>::__clone(__base<_Rp(_ArgTypes...)>* __p) const |
| 1625 | 1681 | { |
| 1626 | ::new (__p) __func(__f_.__target(), __f_.__allocator()); | |
| 1682 | ::new (__p) __func(__f_.__target(), __f_.__get_allocator()); | |
| 1627 | 1683 | } |
| 1628 | 1684 | |
| 1629 | 1685 | template<class _Fp, class _Alloc, class _Rp, class ..._ArgTypes> |
| ... | ... | @@ -1639,7 +1695,7 @@ __func<_Fp, _Alloc, _Rp(_ArgTypes...)>::destroy_deallocate() _NOEXCEPT |
| 1639 | 1695 | { |
| 1640 | 1696 | typedef allocator_traits<_Alloc> __alloc_traits; |
| 1641 | 1697 | typedef typename __rebind_alloc_helper<__alloc_traits, __func>::type _Ap; |
| 1642 | _Ap __a(__f_.__allocator()); | |
| 1698 | _Ap __a(__f_.__get_allocator()); | |
| 1643 | 1699 | __f_.destroy(); |
| 1644 | 1700 | __a.deallocate(this, 1); |
| 1645 | 1701 | } |
| ... | ... | @@ -1692,7 +1748,7 @@ template <class _Rp, class... _ArgTypes> class __value_func<_Rp(_ArgTypes...)> |
| 1692 | 1748 | __value_func() _NOEXCEPT : __f_(0) {} |
| 1693 | 1749 | |
| 1694 | 1750 | template <class _Fp, class _Alloc> |
| 1695 | _LIBCPP_INLINE_VISIBILITY __value_func(_Fp&& __f, const _Alloc __a) | |
| 1751 | _LIBCPP_INLINE_VISIBILITY __value_func(_Fp&& __f, const _Alloc& __a) | |
| 1696 | 1752 | : __f_(0) |
| 1697 | 1753 | { |
| 1698 | 1754 | typedef allocator_traits<_Alloc> __alloc_traits; |
| ... | ... | @@ -1720,6 +1776,11 @@ template <class _Rp, class... _ArgTypes> class __value_func<_Rp(_ArgTypes...)> |
| 1720 | 1776 | } |
| 1721 | 1777 | } |
| 1722 | 1778 | |
| 1779 | template <class _Fp, | |
| 1780 | class = typename enable_if<!is_same<typename decay<_Fp>::type, __value_func>::value>::type> | |
| 1781 | _LIBCPP_INLINE_VISIBILITY explicit __value_func(_Fp&& __f) | |
| 1782 | : __value_func(std::forward<_Fp>(__f), allocator<_Fp>()) {} | |
| 1783 | ||
| 1723 | 1784 | _LIBCPP_INLINE_VISIBILITY |
| 1724 | 1785 | __value_func(const __value_func& __f) |
| 1725 | 1786 | { |
| ... | ... | @@ -1919,29 +1980,22 @@ struct __policy |
| 1919 | 1980 | return __f->__clone(); |
| 1920 | 1981 | } |
| 1921 | 1982 | |
| 1922 | template <typename _Fun> static void __large_destroy(void* __s) | |
| 1923 | { | |
| 1924 | typedef allocator_traits<typename _Fun::_Alloc> __alloc_traits; | |
| 1925 | typedef typename __rebind_alloc_helper<__alloc_traits, _Fun>::type | |
| 1926 | _FunAlloc; | |
| 1927 | _Fun* __f = static_cast<_Fun*>(__s); | |
| 1928 | _FunAlloc __a(__f->__allocator()); | |
| 1929 | __f->destroy(); | |
| 1930 | __a.deallocate(__f, 1); | |
| 1983 | template <typename _Fun> | |
| 1984 | static void __large_destroy(void* __s) { | |
| 1985 | _Fun::__destroy_and_delete(static_cast<_Fun*>(__s)); | |
| 1931 | 1986 | } |
| 1932 | 1987 | |
| 1933 | 1988 | template <typename _Fun> |
| 1934 | 1989 | _LIBCPP_INLINE_VISIBILITY static const __policy* |
| 1935 | __choose_policy(/* is_small = */ false_type) | |
| 1936 | { | |
| 1937 | static const _LIBCPP_CONSTEXPR __policy __policy_ = { | |
| 1938 | &__large_clone<_Fun>, &__large_destroy<_Fun>, false, | |
| 1990 | __choose_policy(/* is_small = */ false_type) { | |
| 1991 | static const _LIBCPP_CONSTEXPR __policy __policy_ = { | |
| 1992 | &__large_clone<_Fun>, &__large_destroy<_Fun>, false, | |
| 1939 | 1993 | #ifndef _LIBCPP_NO_RTTI |
| 1940 | &typeid(typename _Fun::_Target) | |
| 1994 | &typeid(typename _Fun::_Target) | |
| 1941 | 1995 | #else |
| 1942 | nullptr | |
| 1996 | nullptr | |
| 1943 | 1997 | #endif |
| 1944 | }; | |
| 1998 | }; | |
| 1945 | 1999 | return &__policy_; |
| 1946 | 2000 | } |
| 1947 | 2001 | |
| ... | ... | @@ -2066,6 +2120,25 @@ template <class _Rp, class... _ArgTypes> class __policy_func<_Rp(_ArgTypes...)> |
| 2066 | 2120 | } |
| 2067 | 2121 | } |
| 2068 | 2122 | |
| 2123 | template <class _Fp, class = typename enable_if<!is_same<typename decay<_Fp>::type, __policy_func>::value>::type> | |
| 2124 | _LIBCPP_INLINE_VISIBILITY explicit __policy_func(_Fp&& __f) | |
| 2125 | : __policy_(__policy::__create_empty()) { | |
| 2126 | typedef __default_alloc_func<_Fp, _Rp(_ArgTypes...)> _Fun; | |
| 2127 | ||
| 2128 | if (__function::__not_null(__f)) { | |
| 2129 | __invoker_ = __invoker::template __create<_Fun>(); | |
| 2130 | __policy_ = __policy::__create<_Fun>(); | |
| 2131 | if (__use_small_storage<_Fun>()) { | |
| 2132 | ::new ((void*)&__buf_.__small) _Fun(_VSTD::move(__f)); | |
| 2133 | } else { | |
| 2134 | __builtin_new_allocator::__holder_t __hold = | |
| 2135 | __builtin_new_allocator::__allocate_type<_Fun>(1); | |
| 2136 | __buf_.__large = ::new (__hold.get()) _Fun(_VSTD::move(__f)); | |
| 2137 | (void)__hold.release(); | |
| 2138 | } | |
| 2139 | } | |
| 2140 | } | |
| 2141 | ||
| 2069 | 2142 | _LIBCPP_INLINE_VISIBILITY |
| 2070 | 2143 | __policy_func(const __policy_func& __f) |
| 2071 | 2144 | : __buf_(__f.__buf_), __invoker_(__f.__invoker_), |
| ... | ... | @@ -2173,8 +2246,8 @@ class _LIBCPP_TEMPLATE_VIS function<_Rp(_ArgTypes...)> |
| 2173 | 2246 | |
| 2174 | 2247 | __func __f_; |
| 2175 | 2248 | |
| 2176 | template <class _Fp, bool = __lazy_and< | |
| 2177 | integral_constant<bool, !is_same<__uncvref_t<_Fp>, function>::value>, | |
| 2249 | template <class _Fp, bool = _And< | |
| 2250 | _IsNotSame<__uncvref_t<_Fp>, function>, | |
| 2178 | 2251 | __invokable<_Fp&, _ArgTypes...> |
| 2179 | 2252 | >::value> |
| 2180 | 2253 | struct __callable; |
| ... | ... | @@ -2286,8 +2359,7 @@ function<_Rp(_ArgTypes...)>::function(allocator_arg_t, const _Alloc&, |
| 2286 | 2359 | |
| 2287 | 2360 | template <class _Rp, class... _ArgTypes> |
| 2288 | 2361 | template <class _Fp, class> |
| 2289 | function<_Rp(_ArgTypes...)>::function(_Fp __f) | |
| 2290 | : __f_(_VSTD::move(__f), allocator<_Fp>()) {} | |
| 2362 | function<_Rp(_ArgTypes...)>::function(_Fp __f) : __f_(_VSTD::move(__f)) {} | |
| 2291 | 2363 | |
| 2292 | 2364 | #if _LIBCPP_STD_VER <= 14 |
| 2293 | 2365 | template <class _Rp, class... _ArgTypes> |
| ... | ... | @@ -2484,7 +2556,7 @@ __mu_expand(_Ti& __ti, tuple<_Uj...>& __uj, __tuple_indices<_Indx...>) |
| 2484 | 2556 | |
| 2485 | 2557 | template <class _Ti, class ..._Uj> |
| 2486 | 2558 | inline _LIBCPP_INLINE_VISIBILITY |
| 2487 | typename __lazy_enable_if | |
| 2559 | typename _EnableIf | |
| 2488 | 2560 | < |
| 2489 | 2561 | is_bind_expression<_Ti>::value, |
| 2490 | 2562 | __invoke_of<_Ti&, _Uj...> |
| ... | ... | @@ -2769,9 +2841,9 @@ bind(_Fp&& __f, _BoundArgs&&... __bound_args) |
| 2769 | 2841 | #if _LIBCPP_STD_VER > 14 |
| 2770 | 2842 | |
| 2771 | 2843 | template <class _Fn, class ..._Args> |
| 2772 | result_of_t<_Fn&&(_Args&&...)> | |
| 2844 | invoke_result_t<_Fn, _Args...> | |
| 2773 | 2845 | invoke(_Fn&& __f, _Args&&... __args) |
| 2774 | noexcept(noexcept(_VSTD::__invoke(_VSTD::forward<_Fn>(__f), _VSTD::forward<_Args>(__args)...))) | |
| 2846 | noexcept(is_nothrow_invocable_v<_Fn, _Args...>) | |
| 2775 | 2847 | { |
| 2776 | 2848 | return _VSTD::__invoke(_VSTD::forward<_Fn>(__f), _VSTD::forward<_Args>(__args)...); |
| 2777 | 2849 | } |
lib/libcxx/include/future+8-13| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===--------------------------- future -----------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 | |
| ... | ... | @@ -409,11 +408,7 @@ _LIBCPP_DECLARE_STRONG_ENUM_EPILOG(launch) |
| 409 | 408 | |
| 410 | 409 | #ifndef _LIBCPP_HAS_NO_STRONG_ENUMS |
| 411 | 410 | |
| 412 | #ifdef _LIBCPP_UNDERLYING_TYPE | |
| 413 | 411 | typedef underlying_type<launch>::type __launch_underlying_type; |
| 414 | #else | |
| 415 | typedef int __launch_underlying_type; | |
| 416 | #endif | |
| 417 | 412 | |
| 418 | 413 | inline _LIBCPP_INLINE_VISIBILITY |
| 419 | 414 | _LIBCPP_CONSTEXPR |
| ... | ... | @@ -2016,7 +2011,7 @@ public: |
| 2016 | 2011 | class = typename enable_if |
| 2017 | 2012 | < |
| 2018 | 2013 | !is_same< |
| 2019 | typename __uncvref<_Fp>::type, | |
| 2014 | typename __uncvref<_Fp>::type, | |
| 2020 | 2015 | packaged_task |
| 2021 | 2016 | >::value |
| 2022 | 2017 | >::type |
| ... | ... | @@ -2027,7 +2022,7 @@ public: |
| 2027 | 2022 | class = typename enable_if |
| 2028 | 2023 | < |
| 2029 | 2024 | !is_same< |
| 2030 | typename __uncvref<_Fp>::type, | |
| 2025 | typename __uncvref<_Fp>::type, | |
| 2031 | 2026 | packaged_task |
| 2032 | 2027 | >::value |
| 2033 | 2028 | >::type |
| ... | ... | @@ -2145,7 +2140,7 @@ public: |
| 2145 | 2140 | class = typename enable_if |
| 2146 | 2141 | < |
| 2147 | 2142 | !is_same< |
| 2148 | typename __uncvref<_Fp>::type, | |
| 2143 | typename __uncvref<_Fp>::type, | |
| 2149 | 2144 | packaged_task |
| 2150 | 2145 | >::value |
| 2151 | 2146 | >::type |
| ... | ... | @@ -2156,11 +2151,11 @@ public: |
| 2156 | 2151 | class = typename enable_if |
| 2157 | 2152 | < |
| 2158 | 2153 | !is_same< |
| 2159 | typename __uncvref<_Fp>::type, | |
| 2154 | typename __uncvref<_Fp>::type, | |
| 2160 | 2155 | packaged_task |
| 2161 | 2156 | >::value |
| 2162 | 2157 | >::type |
| 2163 | > | |
| 2158 | > | |
| 2164 | 2159 | _LIBCPP_INLINE_VISIBILITY |
| 2165 | 2160 | packaged_task(allocator_arg_t, const _Allocator& __a, _Fp&& __f) |
| 2166 | 2161 | : __f_(allocator_arg, __a, _VSTD::forward<_Fp>(__f)), |
lib/libcxx/include/initializer_list+4-5| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===----------------------- initializer_list -----------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 | |
| ... | ... | @@ -83,7 +82,7 @@ public: |
| 83 | 82 | _LIBCPP_INLINE_VISIBILITY |
| 84 | 83 | _LIBCPP_CONSTEXPR_AFTER_CXX11 |
| 85 | 84 | size_t size() const _NOEXCEPT {return __size_;} |
| 86 | ||
| 85 | ||
| 87 | 86 | _LIBCPP_INLINE_VISIBILITY |
| 88 | 87 | _LIBCPP_CONSTEXPR_AFTER_CXX11 |
| 89 | 88 | const _Ep* begin() const _NOEXCEPT {return __begin_;} |
lib/libcxx/include/inttypes.h+8-4| ... | ... | @@ -1,15 +1,19 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===--------------------------- inttypes.h -------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is distributed under the University of Illinois Open Source | |
| 7 | // License. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 | |
| 11 | 10 | #ifndef _LIBCPP_INTTYPES_H |
| 11 | // AIX system headers need inttypes.h to be re-enterable while _STD_TYPES_T | |
| 12 | // is defined until an inclusion of it without _STD_TYPES_T occurs, in which | |
| 13 | // case the header guard macro is defined. | |
| 14 | #if !defined(_AIX) || !defined(_STD_TYPES_T) | |
| 12 | 15 | #define _LIBCPP_INTTYPES_H |
| 16 | #endif // _STD_TYPES_T | |
| 13 | 17 | |
| 14 | 18 | /* |
| 15 | 19 | inttypes.h synopsis |
lib/libcxx/include/iomanip+8-9| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===--------------------------- iomanip ----------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 | |
| ... | ... | @@ -516,7 +515,7 @@ put_time(const tm* __tm, const _CharT* __fmt) |
| 516 | 515 | |
| 517 | 516 | template <class _CharT, class _Traits, class _ForwardIterator> |
| 518 | 517 | std::basic_ostream<_CharT, _Traits> & |
| 519 | __quoted_output ( basic_ostream<_CharT, _Traits> &__os, | |
| 518 | __quoted_output ( basic_ostream<_CharT, _Traits> &__os, | |
| 520 | 519 | _ForwardIterator __first, _ForwardIterator __last, _CharT __delim, _CharT __escape ) |
| 521 | 520 | { |
| 522 | 521 | _VSTD::basic_string<_CharT, _Traits> __str; |
| ... | ... | @@ -571,7 +570,7 @@ __quoted_input ( basic_istream<_CharT, _Traits> &__is, _String & __string, _Char |
| 571 | 570 | |
| 572 | 571 | template <class _CharT, class _Traits, class _Iter> |
| 573 | 572 | basic_ostream<_CharT, _Traits>& operator<<( |
| 574 | basic_ostream<_CharT, _Traits>& __os, | |
| 573 | basic_ostream<_CharT, _Traits>& __os, | |
| 575 | 574 | const __quoted_output_proxy<_CharT, _Iter, _Traits> & __proxy) |
| 576 | 575 | { |
| 577 | 576 | return __quoted_output (__os, __proxy.__first, __proxy.__last, __proxy.__delim, __proxy.__escape); |
| ... | ... | @@ -591,7 +590,7 @@ struct __quoted_proxy |
| 591 | 590 | template <class _CharT, class _Traits, class _Allocator> |
| 592 | 591 | _LIBCPP_INLINE_VISIBILITY |
| 593 | 592 | basic_ostream<_CharT, _Traits>& operator<<( |
| 594 | basic_ostream<_CharT, _Traits>& __os, | |
| 593 | basic_ostream<_CharT, _Traits>& __os, | |
| 595 | 594 | const __quoted_proxy<_CharT, _Traits, _Allocator> & __proxy) |
| 596 | 595 | { |
| 597 | 596 | return __quoted_output (__os, __proxy.__string.cbegin (), __proxy.__string.cend (), __proxy.__delim, __proxy.__escape); |
| ... | ... | @@ -601,7 +600,7 @@ basic_ostream<_CharT, _Traits>& operator<<( |
| 601 | 600 | template <class _CharT, class _Traits, class _Allocator> |
| 602 | 601 | _LIBCPP_INLINE_VISIBILITY |
| 603 | 602 | basic_istream<_CharT, _Traits>& operator>>( |
| 604 | basic_istream<_CharT, _Traits>& __is, | |
| 603 | basic_istream<_CharT, _Traits>& __is, | |
| 605 | 604 | const __quoted_proxy<_CharT, _Traits, _Allocator> & __proxy) |
| 606 | 605 | { |
| 607 | 606 | return __quoted_input ( __is, __proxy.__string, __proxy.__delim, __proxy.__escape ); |
| ... | ... | @@ -661,7 +660,7 @@ __quoted_output_proxy<_CharT, const _CharT *, _Traits> |
| 661 | 660 | quoted (basic_string_view <_CharT, _Traits> __sv, |
| 662 | 661 | _CharT __delim = _CharT('"'), _CharT __escape=_CharT('\\')) |
| 663 | 662 | { |
| 664 | return __quoted_output_proxy<_CharT, const _CharT *, _Traits> | |
| 663 | return __quoted_output_proxy<_CharT, const _CharT *, _Traits> | |
| 665 | 664 | ( __sv.data(), __sv.data() + __sv.size(), __delim, __escape ); |
| 666 | 665 | } |
| 667 | 666 | #endif |
lib/libcxx/include/ios+37-19| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===---------------------------- ios -------------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 | |
| ... | ... | @@ -203,8 +202,8 @@ enum class io_errc |
| 203 | 202 | }; |
| 204 | 203 | |
| 205 | 204 | concept_map ErrorCodeEnum<io_errc> { }; |
| 206 | error_code make_error_code(io_errc e) noexcept; | |
| 207 | error_condition make_error_condition(io_errc e) noexcept; | |
| 205 | error_code make_error_code(io_errc e) noexcept; | |
| 206 | error_condition make_error_condition(io_errc e) noexcept; | |
| 208 | 207 | storage-class-specifier const error_category& iostream_category() noexcept; |
| 209 | 208 | |
| 210 | 209 | } // std |
| ... | ... | @@ -331,6 +330,15 @@ public: |
| 331 | 330 | void __set_badbit_and_consider_rethrow(); |
| 332 | 331 | void __set_failbit_and_consider_rethrow(); |
| 333 | 332 | |
| 333 | _LIBCPP_INLINE_VISIBILITY | |
| 334 | void __setstate_nothrow(iostate __state) | |
| 335 | { | |
| 336 | if (__rdbuf_) | |
| 337 | __rdstate_ |= __state; | |
| 338 | else | |
| 339 | __rdstate_ |= __state | ios_base::badbit; | |
| 340 | } | |
| 341 | ||
| 334 | 342 | protected: |
| 335 | 343 | _LIBCPP_INLINE_VISIBILITY |
| 336 | 344 | ios_base() {// purposefully does no initialization |
| ... | ... | @@ -426,6 +434,16 @@ public: |
| 426 | 434 | virtual ~failure() throw(); |
| 427 | 435 | }; |
| 428 | 436 | |
| 437 | _LIBCPP_NORETURN inline _LIBCPP_INLINE_VISIBILITY | |
| 438 | void __throw_failure(char const* __msg) { | |
| 439 | #ifndef _LIBCPP_NO_EXCEPTIONS | |
| 440 | throw ios_base::failure(__msg); | |
| 441 | #else | |
| 442 | ((void)__msg); | |
| 443 | _VSTD::abort(); | |
| 444 | #endif | |
| 445 | } | |
| 446 | ||
| 429 | 447 | class _LIBCPP_TYPE_VIS ios_base::Init |
| 430 | 448 | { |
| 431 | 449 | public: |
| ... | ... | @@ -626,47 +644,47 @@ public: |
| 626 | 644 | virtual ~basic_ios(); |
| 627 | 645 | |
| 628 | 646 | // 27.5.4.2 Members: |
| 629 | _LIBCPP_INLINE_VISIBILITY | |
| 647 | _LIBCPP_INLINE_VISIBILITY | |
| 630 | 648 | basic_ostream<char_type, traits_type>* tie() const; |
| 631 | _LIBCPP_INLINE_VISIBILITY | |
| 649 | _LIBCPP_INLINE_VISIBILITY | |
| 632 | 650 | basic_ostream<char_type, traits_type>* tie(basic_ostream<char_type, traits_type>* __tiestr); |
| 633 | 651 | |
| 634 | _LIBCPP_INLINE_VISIBILITY | |
| 652 | _LIBCPP_INLINE_VISIBILITY | |
| 635 | 653 | basic_streambuf<char_type, traits_type>* rdbuf() const; |
| 636 | _LIBCPP_INLINE_VISIBILITY | |
| 654 | _LIBCPP_INLINE_VISIBILITY | |
| 637 | 655 | basic_streambuf<char_type, traits_type>* rdbuf(basic_streambuf<char_type, traits_type>* __sb); |
| 638 | 656 | |
| 639 | 657 | basic_ios& copyfmt(const basic_ios& __rhs); |
| 640 | 658 | |
| 641 | _LIBCPP_INLINE_VISIBILITY | |
| 659 | _LIBCPP_INLINE_VISIBILITY | |
| 642 | 660 | char_type fill() const; |
| 643 | _LIBCPP_INLINE_VISIBILITY | |
| 661 | _LIBCPP_INLINE_VISIBILITY | |
| 644 | 662 | char_type fill(char_type __ch); |
| 645 | 663 | |
| 646 | _LIBCPP_INLINE_VISIBILITY | |
| 664 | _LIBCPP_INLINE_VISIBILITY | |
| 647 | 665 | locale imbue(const locale& __loc); |
| 648 | 666 | |
| 649 | _LIBCPP_INLINE_VISIBILITY | |
| 667 | _LIBCPP_INLINE_VISIBILITY | |
| 650 | 668 | char narrow(char_type __c, char __dfault) const; |
| 651 | _LIBCPP_INLINE_VISIBILITY | |
| 669 | _LIBCPP_INLINE_VISIBILITY | |
| 652 | 670 | char_type widen(char __c) const; |
| 653 | 671 | |
| 654 | 672 | protected: |
| 655 | 673 | _LIBCPP_INLINE_VISIBILITY |
| 656 | 674 | basic_ios() {// purposefully does no initialization |
| 657 | 675 | } |
| 658 | _LIBCPP_INLINE_VISIBILITY | |
| 676 | _LIBCPP_INLINE_VISIBILITY | |
| 659 | 677 | void init(basic_streambuf<char_type, traits_type>* __sb); |
| 660 | 678 | |
| 661 | _LIBCPP_INLINE_VISIBILITY | |
| 679 | _LIBCPP_INLINE_VISIBILITY | |
| 662 | 680 | void move(basic_ios& __rhs); |
| 663 | 681 | #ifndef _LIBCPP_CXX03_LANG |
| 664 | 682 | _LIBCPP_INLINE_VISIBILITY |
| 665 | 683 | void move(basic_ios&& __rhs) {move(__rhs);} |
| 666 | 684 | #endif |
| 667 | _LIBCPP_INLINE_VISIBILITY | |
| 685 | _LIBCPP_INLINE_VISIBILITY | |
| 668 | 686 | void swap(basic_ios& __rhs) _NOEXCEPT; |
| 669 | _LIBCPP_INLINE_VISIBILITY | |
| 687 | _LIBCPP_INLINE_VISIBILITY | |
| 670 | 688 | void set_rdbuf(basic_streambuf<char_type, traits_type>* __sb); |
| 671 | 689 | private: |
| 672 | 690 | basic_ostream<char_type, traits_type>* __tie_; |
lib/libcxx/include/iosfwd+3-4| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===--------------------------- iosfwd -----------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 |
lib/libcxx/include/iostream+3-4| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===--------------------------- iostream ---------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 |
lib/libcxx/include/istream+514-381| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===--------------------------- istream ----------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 | |
| ... | ... | @@ -363,26 +362,31 @@ template <class _Tp, class _CharT, class _Traits> |
| 363 | 362 | _LIBCPP_INLINE_VISIBILITY |
| 364 | 363 | basic_istream<_CharT, _Traits>& |
| 365 | 364 | __input_arithmetic(basic_istream<_CharT, _Traits>& __is, _Tp& __n) { |
| 366 | #ifndef _LIBCPP_NO_EXCEPTIONS | |
| 367 | try | |
| 365 | ios_base::iostate __state = ios_base::goodbit; | |
| 366 | typename basic_istream<_CharT, _Traits>::sentry __s(__is); | |
| 367 | if (__s) | |
| 368 | 368 | { |
| 369 | #endif // _LIBCPP_NO_EXCEPTIONS | |
| 370 | typename basic_istream<_CharT, _Traits>::sentry __s(__is); | |
| 371 | if (__s) | |
| 369 | #ifndef _LIBCPP_NO_EXCEPTIONS | |
| 370 | try | |
| 372 | 371 | { |
| 372 | #endif // _LIBCPP_NO_EXCEPTIONS | |
| 373 | 373 | typedef istreambuf_iterator<_CharT, _Traits> _Ip; |
| 374 | 374 | typedef num_get<_CharT, _Ip> _Fp; |
| 375 | ios_base::iostate __err = ios_base::goodbit; | |
| 376 | use_facet<_Fp>(__is.getloc()).get(_Ip(__is), _Ip(), __is, __err, __n); | |
| 377 | __is.setstate(__err); | |
| 378 | } | |
| 375 | use_facet<_Fp>(__is.getloc()).get(_Ip(__is), _Ip(), __is, __state, __n); | |
| 379 | 376 | #ifndef _LIBCPP_NO_EXCEPTIONS |
| 377 | } | |
| 378 | catch (...) | |
| 379 | { | |
| 380 | __state |= ios_base::badbit; | |
| 381 | __is.__setstate_nothrow(__state); | |
| 382 | if (__is.exceptions() & ios_base::badbit) | |
| 383 | { | |
| 384 | throw; | |
| 385 | } | |
| 386 | } | |
| 387 | #endif | |
| 388 | __is.setstate(__state); | |
| 380 | 389 | } |
| 381 | catch (...) | |
| 382 | { | |
| 383 | __is.__set_badbit_and_consider_rethrow(); | |
| 384 | } | |
| 385 | #endif // _LIBCPP_NO_EXCEPTIONS | |
| 386 | 390 | return __is; |
| 387 | 391 | } |
| 388 | 392 | |
| ... | ... | @@ -467,39 +471,46 @@ template <class _Tp, class _CharT, class _Traits> |
| 467 | 471 | _LIBCPP_INLINE_VISIBILITY |
| 468 | 472 | basic_istream<_CharT, _Traits>& |
| 469 | 473 | __input_arithmetic_with_numeric_limits(basic_istream<_CharT, _Traits>& __is, _Tp& __n) { |
| 470 | #ifndef _LIBCPP_NO_EXCEPTIONS | |
| 471 | try | |
| 474 | ios_base::iostate __state = ios_base::goodbit; | |
| 475 | typename basic_istream<_CharT, _Traits>::sentry __s(__is); | |
| 476 | if (__s) | |
| 472 | 477 | { |
| 473 | #endif // _LIBCPP_NO_EXCEPTIONS | |
| 474 | typename basic_istream<_CharT, _Traits>::sentry __s(__is); | |
| 475 | if (__s) | |
| 478 | #ifndef _LIBCPP_NO_EXCEPTIONS | |
| 479 | try | |
| 476 | 480 | { |
| 481 | #endif // _LIBCPP_NO_EXCEPTIONS | |
| 477 | 482 | typedef istreambuf_iterator<_CharT, _Traits> _Ip; |
| 478 | 483 | typedef num_get<_CharT, _Ip> _Fp; |
| 479 | ios_base::iostate __err = ios_base::goodbit; | |
| 480 | 484 | long __temp; |
| 481 | use_facet<_Fp>(__is.getloc()).get(_Ip(__is), _Ip(), __is, __err, __temp); | |
| 485 | use_facet<_Fp>(__is.getloc()).get(_Ip(__is), _Ip(), __is, __state, __temp); | |
| 482 | 486 | if (__temp < numeric_limits<_Tp>::min()) |
| 483 | 487 | { |
| 484 | __err |= ios_base::failbit; | |
| 488 | __state |= ios_base::failbit; | |
| 485 | 489 | __n = numeric_limits<_Tp>::min(); |
| 486 | 490 | } |
| 487 | 491 | else if (__temp > numeric_limits<_Tp>::max()) |
| 488 | 492 | { |
| 489 | __err |= ios_base::failbit; | |
| 493 | __state |= ios_base::failbit; | |
| 490 | 494 | __n = numeric_limits<_Tp>::max(); |
| 491 | 495 | } |
| 492 | 496 | else |
| 497 | { | |
| 493 | 498 | __n = static_cast<_Tp>(__temp); |
| 494 | __is.setstate(__err); | |
| 495 | } | |
| 499 | } | |
| 496 | 500 | #ifndef _LIBCPP_NO_EXCEPTIONS |
| 497 | } | |
| 498 | catch (...) | |
| 499 | { | |
| 500 | __is.__set_badbit_and_consider_rethrow(); | |
| 501 | } | |
| 501 | } | |
| 502 | catch (...) | |
| 503 | { | |
| 504 | __state |= ios_base::badbit; | |
| 505 | __is.__setstate_nothrow(__state); | |
| 506 | if (__is.exceptions() & ios_base::badbit) | |
| 507 | { | |
| 508 | throw; | |
| 509 | } | |
| 510 | } | |
| 502 | 511 | #endif // _LIBCPP_NO_EXCEPTIONS |
| 512 | __is.setstate(__state); | |
| 513 | } | |
| 503 | 514 | return __is; |
| 504 | 515 | } |
| 505 | 516 | |
| ... | ... | @@ -522,22 +533,22 @@ _LIBCPP_INLINE_VISIBILITY |
| 522 | 533 | basic_istream<_CharT, _Traits>& |
| 523 | 534 | __input_c_string(basic_istream<_CharT, _Traits>& __is, _CharT* __p, size_t __n) |
| 524 | 535 | { |
| 525 | #ifndef _LIBCPP_NO_EXCEPTIONS | |
| 526 | try | |
| 536 | ios_base::iostate __state = ios_base::goodbit; | |
| 537 | typename basic_istream<_CharT, _Traits>::sentry __sen(__is); | |
| 538 | if (__sen) | |
| 527 | 539 | { |
| 528 | #endif // _LIBCPP_NO_EXCEPTIONS | |
| 529 | typename basic_istream<_CharT, _Traits>::sentry __sen(__is); | |
| 530 | if (__sen) | |
| 540 | #ifndef _LIBCPP_NO_EXCEPTIONS | |
| 541 | try | |
| 531 | 542 | { |
| 532 | auto __s = __p; | |
| 543 | #endif | |
| 544 | _CharT* __s = __p; | |
| 533 | 545 | const ctype<_CharT>& __ct = use_facet<ctype<_CharT> >(__is.getloc()); |
| 534 | ios_base::iostate __err = ios_base::goodbit; | |
| 535 | 546 | while (__s != __p + (__n-1)) |
| 536 | 547 | { |
| 537 | 548 | typename _Traits::int_type __i = __is.rdbuf()->sgetc(); |
| 538 | 549 | if (_Traits::eq_int_type(__i, _Traits::eof())) |
| 539 | 550 | { |
| 540 | __err |= ios_base::eofbit; | |
| 551 | __state |= ios_base::eofbit; | |
| 541 | 552 | break; |
| 542 | 553 | } |
| 543 | 554 | _CharT __ch = _Traits::to_char_type(__i); |
| ... | ... | @@ -549,16 +560,21 @@ __input_c_string(basic_istream<_CharT, _Traits>& __is, _CharT* __p, size_t __n) |
| 549 | 560 | *__s = _CharT(); |
| 550 | 561 | __is.width(0); |
| 551 | 562 | if (__s == __p) |
| 552 | __err |= ios_base::failbit; | |
| 553 | __is.setstate(__err); | |
| 554 | } | |
| 563 | __state |= ios_base::failbit; | |
| 555 | 564 | #ifndef _LIBCPP_NO_EXCEPTIONS |
| 565 | } | |
| 566 | catch (...) | |
| 567 | { | |
| 568 | __state |= ios_base::badbit; | |
| 569 | __is.__setstate_nothrow(__state); | |
| 570 | if (__is.exceptions() & ios_base::badbit) | |
| 571 | { | |
| 572 | throw; | |
| 573 | } | |
| 574 | } | |
| 575 | #endif | |
| 576 | __is.setstate(__state); | |
| 556 | 577 | } |
| 557 | catch (...) | |
| 558 | { | |
| 559 | __is.__set_badbit_and_consider_rethrow(); | |
| 560 | } | |
| 561 | #endif // _LIBCPP_NO_EXCEPTIONS | |
| 562 | 578 | return __is; |
| 563 | 579 | } |
| 564 | 580 | |
| ... | ... | @@ -569,7 +585,7 @@ inline _LIBCPP_INLINE_VISIBILITY |
| 569 | 585 | basic_istream<_CharT, _Traits>& |
| 570 | 586 | operator>>(basic_istream<_CharT, _Traits>& __is, _CharT (&__buf)[_Np]) |
| 571 | 587 | { |
| 572 | auto __n = _Np; | |
| 588 | size_t __n = _Np; | |
| 573 | 589 | if (__is.width() > 0) |
| 574 | 590 | __n = _VSTD::min(size_t(__is.width()), _Np); |
| 575 | 591 | return _VSTD::__input_c_string(__is, __buf, __n); |
| ... | ... | @@ -626,26 +642,33 @@ template<class _CharT, class _Traits> |
| 626 | 642 | basic_istream<_CharT, _Traits>& |
| 627 | 643 | operator>>(basic_istream<_CharT, _Traits>& __is, _CharT& __c) |
| 628 | 644 | { |
| 629 | #ifndef _LIBCPP_NO_EXCEPTIONS | |
| 630 | try | |
| 645 | ios_base::iostate __state = ios_base::goodbit; | |
| 646 | typename basic_istream<_CharT, _Traits>::sentry __sen(__is); | |
| 647 | if (__sen) | |
| 631 | 648 | { |
| 632 | #endif // _LIBCPP_NO_EXCEPTIONS | |
| 633 | typename basic_istream<_CharT, _Traits>::sentry __sen(__is); | |
| 634 | if (__sen) | |
| 649 | #ifndef _LIBCPP_NO_EXCEPTIONS | |
| 650 | try | |
| 635 | 651 | { |
| 652 | #endif | |
| 636 | 653 | typename _Traits::int_type __i = __is.rdbuf()->sbumpc(); |
| 637 | 654 | if (_Traits::eq_int_type(__i, _Traits::eof())) |
| 638 | __is.setstate(ios_base::eofbit | ios_base::failbit); | |
| 655 | __state |= ios_base::eofbit | ios_base::failbit; | |
| 639 | 656 | else |
| 640 | 657 | __c = _Traits::to_char_type(__i); |
| 641 | } | |
| 642 | 658 | #ifndef _LIBCPP_NO_EXCEPTIONS |
| 659 | } | |
| 660 | catch (...) | |
| 661 | { | |
| 662 | __state |= ios_base::badbit; | |
| 663 | __is.__setstate_nothrow(__state); | |
| 664 | if (__is.exceptions() & ios_base::badbit) | |
| 665 | { | |
| 666 | throw; | |
| 667 | } | |
| 668 | } | |
| 669 | #endif | |
| 670 | __is.setstate(__state); | |
| 643 | 671 | } |
| 644 | catch (...) | |
| 645 | { | |
| 646 | __is.__set_badbit_and_consider_rethrow(); | |
| 647 | } | |
| 648 | #endif // _LIBCPP_NO_EXCEPTIONS | |
| 649 | 672 | return __is; |
| 650 | 673 | } |
| 651 | 674 | |
| ... | ... | @@ -669,58 +692,56 @@ template<class _CharT, class _Traits> |
| 669 | 692 | basic_istream<_CharT, _Traits>& |
| 670 | 693 | basic_istream<_CharT, _Traits>::operator>>(basic_streambuf<char_type, traits_type>* __sb) |
| 671 | 694 | { |
| 695 | ios_base::iostate __state = ios_base::goodbit; | |
| 672 | 696 | __gc_ = 0; |
| 673 | #ifndef _LIBCPP_NO_EXCEPTIONS | |
| 674 | try | |
| 697 | sentry __s(*this, true); | |
| 698 | if (__s) | |
| 675 | 699 | { |
| 676 | #endif // _LIBCPP_NO_EXCEPTIONS | |
| 677 | sentry __s(*this, true); | |
| 678 | if (__s) | |
| 700 | if (__sb) | |
| 679 | 701 | { |
| 680 | if (__sb) | |
| 681 | { | |
| 682 | 702 | #ifndef _LIBCPP_NO_EXCEPTIONS |
| 683 | try | |
| 703 | try | |
| 704 | { | |
| 705 | #endif // _LIBCPP_NO_EXCEPTIONS | |
| 706 | while (true) | |
| 684 | 707 | { |
| 685 | #endif // _LIBCPP_NO_EXCEPTIONS | |
| 686 | ios_base::iostate __err = ios_base::goodbit; | |
| 687 | while (true) | |
| 708 | typename traits_type::int_type __i = this->rdbuf()->sgetc(); | |
| 709 | if (traits_type::eq_int_type(__i, _Traits::eof())) | |
| 688 | 710 | { |
| 689 | typename traits_type::int_type __i = this->rdbuf()->sgetc(); | |
| 690 | if (traits_type::eq_int_type(__i, _Traits::eof())) | |
| 691 | { | |
| 692 | __err |= ios_base::eofbit; | |
| 693 | break; | |
| 694 | } | |
| 695 | if (traits_type::eq_int_type( | |
| 696 | __sb->sputc(traits_type::to_char_type(__i)), | |
| 697 | traits_type::eof())) | |
| 698 | break; | |
| 699 | ++__gc_; | |
| 700 | this->rdbuf()->sbumpc(); | |
| 711 | __state |= ios_base::eofbit; | |
| 712 | break; | |
| 701 | 713 | } |
| 702 | if (__gc_ == 0) | |
| 703 | __err |= ios_base::failbit; | |
| 704 | this->setstate(__err); | |
| 705 | #ifndef _LIBCPP_NO_EXCEPTIONS | |
| 714 | if (traits_type::eq_int_type( | |
| 715 | __sb->sputc(traits_type::to_char_type(__i)), | |
| 716 | traits_type::eof())) | |
| 717 | break; | |
| 718 | ++__gc_; | |
| 719 | this->rdbuf()->sbumpc(); | |
| 706 | 720 | } |
| 707 | catch (...) | |
| 721 | if (__gc_ == 0) | |
| 722 | __state |= ios_base::failbit; | |
| 723 | #ifndef _LIBCPP_NO_EXCEPTIONS | |
| 724 | } | |
| 725 | catch (...) | |
| 726 | { | |
| 727 | __state |= ios_base::badbit; | |
| 728 | if (__gc_ == 0) | |
| 729 | __state |= ios_base::failbit; | |
| 730 | ||
| 731 | this->__setstate_nothrow(__state); | |
| 732 | if (this->exceptions() & ios_base::failbit || this->exceptions() & ios_base::badbit) | |
| 708 | 733 | { |
| 709 | if (__gc_ == 0) | |
| 710 | this->__set_failbit_and_consider_rethrow(); | |
| 734 | throw; | |
| 711 | 735 | } |
| 712 | #endif // _LIBCPP_NO_EXCEPTIONS | |
| 713 | 736 | } |
| 714 | else | |
| 715 | this->setstate(ios_base::failbit); | |
| 737 | #endif // _LIBCPP_NO_EXCEPTIONS | |
| 716 | 738 | } |
| 717 | #ifndef _LIBCPP_NO_EXCEPTIONS | |
| 718 | } | |
| 719 | catch (...) | |
| 720 | { | |
| 721 | this->__set_badbit_and_consider_rethrow(); | |
| 739 | else | |
| 740 | { | |
| 741 | __state |= ios_base::failbit; | |
| 742 | } | |
| 743 | this->setstate(__state); | |
| 722 | 744 | } |
| 723 | #endif // _LIBCPP_NO_EXCEPTIONS | |
| 724 | 745 | return *this; |
| 725 | 746 | } |
| 726 | 747 | |
| ... | ... | @@ -728,28 +749,34 @@ template<class _CharT, class _Traits> |
| 728 | 749 | typename basic_istream<_CharT, _Traits>::int_type |
| 729 | 750 | basic_istream<_CharT, _Traits>::get() |
| 730 | 751 | { |
| 752 | ios_base::iostate __state = ios_base::goodbit; | |
| 731 | 753 | __gc_ = 0; |
| 732 | 754 | int_type __r = traits_type::eof(); |
| 733 | #ifndef _LIBCPP_NO_EXCEPTIONS | |
| 734 | try | |
| 755 | sentry __s(*this, true); | |
| 756 | if (__s) | |
| 735 | 757 | { |
| 736 | #endif // _LIBCPP_NO_EXCEPTIONS | |
| 737 | sentry __s(*this, true); | |
| 738 | if (__s) | |
| 758 | #ifndef _LIBCPP_NO_EXCEPTIONS | |
| 759 | try | |
| 739 | 760 | { |
| 761 | #endif | |
| 740 | 762 | __r = this->rdbuf()->sbumpc(); |
| 741 | 763 | if (traits_type::eq_int_type(__r, traits_type::eof())) |
| 742 | this->setstate(ios_base::failbit | ios_base::eofbit); | |
| 764 | __state |= ios_base::failbit | ios_base::eofbit; | |
| 743 | 765 | else |
| 744 | 766 | __gc_ = 1; |
| 745 | } | |
| 746 | 767 | #ifndef _LIBCPP_NO_EXCEPTIONS |
| 768 | } | |
| 769 | catch (...) | |
| 770 | { | |
| 771 | this->__setstate_nothrow(this->rdstate() | ios_base::badbit); | |
| 772 | if (this->exceptions() & ios_base::badbit) | |
| 773 | { | |
| 774 | throw; | |
| 775 | } | |
| 776 | } | |
| 777 | #endif | |
| 778 | this->setstate(__state); | |
| 747 | 779 | } |
| 748 | catch (...) | |
| 749 | { | |
| 750 | this->__set_badbit_and_consider_rethrow(); | |
| 751 | } | |
| 752 | #endif // _LIBCPP_NO_EXCEPTIONS | |
| 753 | 780 | return __r; |
| 754 | 781 | } |
| 755 | 782 | |
| ... | ... | @@ -757,23 +784,23 @@ template<class _CharT, class _Traits> |
| 757 | 784 | basic_istream<_CharT, _Traits>& |
| 758 | 785 | basic_istream<_CharT, _Traits>::get(char_type* __s, streamsize __n, char_type __dlm) |
| 759 | 786 | { |
| 787 | ios_base::iostate __state = ios_base::goodbit; | |
| 760 | 788 | __gc_ = 0; |
| 761 | #ifndef _LIBCPP_NO_EXCEPTIONS | |
| 762 | try | |
| 789 | sentry __sen(*this, true); | |
| 790 | if (__sen) | |
| 763 | 791 | { |
| 764 | #endif // _LIBCPP_NO_EXCEPTIONS | |
| 765 | sentry __sen(*this, true); | |
| 766 | if (__sen) | |
| 792 | if (__n > 0) | |
| 767 | 793 | { |
| 768 | if (__n > 0) | |
| 794 | #ifndef _LIBCPP_NO_EXCEPTIONS | |
| 795 | try | |
| 769 | 796 | { |
| 770 | ios_base::iostate __err = ios_base::goodbit; | |
| 797 | #endif | |
| 771 | 798 | while (__gc_ < __n-1) |
| 772 | 799 | { |
| 773 | 800 | int_type __i = this->rdbuf()->sgetc(); |
| 774 | 801 | if (traits_type::eq_int_type(__i, traits_type::eof())) |
| 775 | 802 | { |
| 776 | __err |= ios_base::eofbit; | |
| 803 | __state |= ios_base::eofbit; | |
| 777 | 804 | break; |
| 778 | 805 | } |
| 779 | 806 | char_type __ch = traits_type::to_char_type(__i); |
| ... | ... | @@ -784,23 +811,33 @@ basic_istream<_CharT, _Traits>::get(char_type* __s, streamsize __n, char_type __ |
| 784 | 811 | this->rdbuf()->sbumpc(); |
| 785 | 812 | } |
| 786 | 813 | if (__gc_ == 0) |
| 787 | __err |= ios_base::failbit; | |
| 788 | this->setstate(__err); | |
| 814 | __state |= ios_base::failbit; | |
| 815 | #ifndef _LIBCPP_NO_EXCEPTIONS | |
| 789 | 816 | } |
| 790 | else | |
| 791 | this->setstate(ios_base::failbit); | |
| 817 | catch (...) | |
| 818 | { | |
| 819 | __state |= ios_base::badbit; | |
| 820 | this->__setstate_nothrow(__state); | |
| 821 | if (this->exceptions() & ios_base::badbit) | |
| 822 | { | |
| 823 | if (__n > 0) | |
| 824 | *__s = char_type(); | |
| 825 | throw; | |
| 826 | } | |
| 827 | } | |
| 828 | #endif | |
| 792 | 829 | } |
| 830 | else | |
| 831 | { | |
| 832 | __state |= ios_base::failbit; | |
| 833 | } | |
| 834 | ||
| 793 | 835 | if (__n > 0) |
| 794 | 836 | *__s = char_type(); |
| 795 | #ifndef _LIBCPP_NO_EXCEPTIONS | |
| 796 | } | |
| 797 | catch (...) | |
| 798 | { | |
| 799 | if (__n > 0) | |
| 800 | *__s = char_type(); | |
| 801 | this->__set_badbit_and_consider_rethrow(); | |
| 837 | this->setstate(__state); | |
| 802 | 838 | } |
| 803 | #endif // _LIBCPP_NO_EXCEPTIONS | |
| 839 | if (__n > 0) | |
| 840 | *__s = char_type(); | |
| 804 | 841 | return *this; |
| 805 | 842 | } |
| 806 | 843 | |
| ... | ... | @@ -809,52 +846,43 @@ basic_istream<_CharT, _Traits>& |
| 809 | 846 | basic_istream<_CharT, _Traits>::get(basic_streambuf<char_type, traits_type>& __sb, |
| 810 | 847 | char_type __dlm) |
| 811 | 848 | { |
| 849 | ios_base::iostate __state = ios_base::goodbit; | |
| 812 | 850 | __gc_ = 0; |
| 813 | #ifndef _LIBCPP_NO_EXCEPTIONS | |
| 814 | try | |
| 851 | sentry __sen(*this, true); | |
| 852 | if (__sen) | |
| 815 | 853 | { |
| 816 | #endif // _LIBCPP_NO_EXCEPTIONS | |
| 817 | sentry __sen(*this, true); | |
| 818 | if (__sen) | |
| 819 | { | |
| 820 | ios_base::iostate __err = ios_base::goodbit; | |
| 821 | 854 | #ifndef _LIBCPP_NO_EXCEPTIONS |
| 822 | try | |
| 823 | { | |
| 855 | try | |
| 856 | { | |
| 824 | 857 | #endif // _LIBCPP_NO_EXCEPTIONS |
| 825 | while (true) | |
| 858 | while (true) | |
| 859 | { | |
| 860 | typename traits_type::int_type __i = this->rdbuf()->sgetc(); | |
| 861 | if (traits_type::eq_int_type(__i, traits_type::eof())) | |
| 826 | 862 | { |
| 827 | typename traits_type::int_type __i = this->rdbuf()->sgetc(); | |
| 828 | if (traits_type::eq_int_type(__i, traits_type::eof())) | |
| 829 | { | |
| 830 | __err |= ios_base::eofbit; | |
| 831 | break; | |
| 832 | } | |
| 833 | char_type __ch = traits_type::to_char_type(__i); | |
| 834 | if (traits_type::eq(__ch, __dlm)) | |
| 835 | break; | |
| 836 | if (traits_type::eq_int_type(__sb.sputc(__ch), traits_type::eof())) | |
| 837 | break; | |
| 838 | ++__gc_; | |
| 839 | this->rdbuf()->sbumpc(); | |
| 863 | __state |= ios_base::eofbit; | |
| 864 | break; | |
| 840 | 865 | } |
| 841 | #ifndef _LIBCPP_NO_EXCEPTIONS | |
| 842 | } | |
| 843 | catch (...) | |
| 844 | { | |
| 866 | char_type __ch = traits_type::to_char_type(__i); | |
| 867 | if (traits_type::eq(__ch, __dlm)) | |
| 868 | break; | |
| 869 | if (traits_type::eq_int_type(__sb.sputc(__ch), traits_type::eof())) | |
| 870 | break; | |
| 871 | ++__gc_; | |
| 872 | this->rdbuf()->sbumpc(); | |
| 845 | 873 | } |
| 846 | #endif // _LIBCPP_NO_EXCEPTIONS | |
| 847 | if (__gc_ == 0) | |
| 848 | __err |= ios_base::failbit; | |
| 849 | this->setstate(__err); | |
| 850 | } | |
| 851 | 874 | #ifndef _LIBCPP_NO_EXCEPTIONS |
| 852 | } | |
| 853 | catch (...) | |
| 854 | { | |
| 855 | this->__set_badbit_and_consider_rethrow(); | |
| 856 | } | |
| 875 | } | |
| 876 | catch (...) | |
| 877 | { | |
| 878 | __state |= ios_base::badbit; | |
| 879 | // according to the spec, exceptions here are caught but not rethrown | |
| 880 | } | |
| 857 | 881 | #endif // _LIBCPP_NO_EXCEPTIONS |
| 882 | if (__gc_ == 0) | |
| 883 | __state |= ios_base::failbit; | |
| 884 | this->setstate(__state); | |
| 885 | } | |
| 858 | 886 | return *this; |
| 859 | 887 | } |
| 860 | 888 | |
| ... | ... | @@ -862,21 +890,21 @@ template<class _CharT, class _Traits> |
| 862 | 890 | basic_istream<_CharT, _Traits>& |
| 863 | 891 | basic_istream<_CharT, _Traits>::getline(char_type* __s, streamsize __n, char_type __dlm) |
| 864 | 892 | { |
| 893 | ios_base::iostate __state = ios_base::goodbit; | |
| 865 | 894 | __gc_ = 0; |
| 866 | #ifndef _LIBCPP_NO_EXCEPTIONS | |
| 867 | try | |
| 895 | sentry __sen(*this, true); | |
| 896 | if (__sen) | |
| 868 | 897 | { |
| 869 | #endif // _LIBCPP_NO_EXCEPTIONS | |
| 870 | sentry __sen(*this, true); | |
| 871 | if (__sen) | |
| 898 | #ifndef _LIBCPP_NO_EXCEPTIONS | |
| 899 | try | |
| 872 | 900 | { |
| 873 | ios_base::iostate __err = ios_base::goodbit; | |
| 901 | #endif // _LIBCPP_NO_EXCEPTIONS | |
| 874 | 902 | while (true) |
| 875 | 903 | { |
| 876 | 904 | typename traits_type::int_type __i = this->rdbuf()->sgetc(); |
| 877 | 905 | if (traits_type::eq_int_type(__i, traits_type::eof())) |
| 878 | 906 | { |
| 879 | __err |= ios_base::eofbit; | |
| 907 | __state |= ios_base::eofbit; | |
| 880 | 908 | break; |
| 881 | 909 | } |
| 882 | 910 | char_type __ch = traits_type::to_char_type(__i); |
| ... | ... | @@ -888,28 +916,35 @@ basic_istream<_CharT, _Traits>::getline(char_type* __s, streamsize __n, char_typ |
| 888 | 916 | } |
| 889 | 917 | if (__gc_ >= __n-1) |
| 890 | 918 | { |
| 891 | __err |= ios_base::failbit; | |
| 919 | __state |= ios_base::failbit; | |
| 892 | 920 | break; |
| 893 | 921 | } |
| 894 | 922 | *__s++ = __ch; |
| 895 | 923 | this->rdbuf()->sbumpc(); |
| 896 | 924 | ++__gc_; |
| 897 | 925 | } |
| 898 | if (__gc_ == 0) | |
| 899 | __err |= ios_base::failbit; | |
| 900 | this->setstate(__err); | |
| 901 | } | |
| 902 | if (__n > 0) | |
| 903 | *__s = char_type(); | |
| 904 | 926 | #ifndef _LIBCPP_NO_EXCEPTIONS |
| 905 | } | |
| 906 | catch (...) | |
| 907 | { | |
| 908 | if (__n > 0) | |
| 909 | *__s = char_type(); | |
| 910 | this->__set_badbit_and_consider_rethrow(); | |
| 911 | } | |
| 927 | } | |
| 928 | catch (...) | |
| 929 | { | |
| 930 | __state |= ios_base::badbit; | |
| 931 | this->__setstate_nothrow(__state); | |
| 932 | if (this->exceptions() & ios_base::badbit) | |
| 933 | { | |
| 934 | if (__n > 0) | |
| 935 | *__s = char_type(); | |
| 936 | if (__gc_ == 0) | |
| 937 | __state |= ios_base::failbit; | |
| 938 | throw; | |
| 939 | } | |
| 940 | } | |
| 912 | 941 | #endif // _LIBCPP_NO_EXCEPTIONS |
| 942 | } | |
| 943 | if (__n > 0) | |
| 944 | *__s = char_type(); | |
| 945 | if (__gc_ == 0) | |
| 946 | __state |= ios_base::failbit; | |
| 947 | this->setstate(__state); | |
| 913 | 948 | return *this; |
| 914 | 949 | } |
| 915 | 950 | |
| ... | ... | @@ -917,15 +952,15 @@ template<class _CharT, class _Traits> |
| 917 | 952 | basic_istream<_CharT, _Traits>& |
| 918 | 953 | basic_istream<_CharT, _Traits>::ignore(streamsize __n, int_type __dlm) |
| 919 | 954 | { |
| 955 | ios_base::iostate __state = ios_base::goodbit; | |
| 920 | 956 | __gc_ = 0; |
| 921 | #ifndef _LIBCPP_NO_EXCEPTIONS | |
| 922 | try | |
| 957 | sentry __sen(*this, true); | |
| 958 | if (__sen) | |
| 923 | 959 | { |
| 924 | #endif // _LIBCPP_NO_EXCEPTIONS | |
| 925 | sentry __sen(*this, true); | |
| 926 | if (__sen) | |
| 960 | #ifndef _LIBCPP_NO_EXCEPTIONS | |
| 961 | try | |
| 927 | 962 | { |
| 928 | ios_base::iostate __err = ios_base::goodbit; | |
| 963 | #endif // _LIBCPP_NO_EXCEPTIONS | |
| 929 | 964 | if (__n == numeric_limits<streamsize>::max()) |
| 930 | 965 | { |
| 931 | 966 | while (true) |
| ... | ... | @@ -933,7 +968,7 @@ basic_istream<_CharT, _Traits>::ignore(streamsize __n, int_type __dlm) |
| 933 | 968 | typename traits_type::int_type __i = this->rdbuf()->sbumpc(); |
| 934 | 969 | if (traits_type::eq_int_type(__i, traits_type::eof())) |
| 935 | 970 | { |
| 936 | __err |= ios_base::eofbit; | |
| 971 | __state |= ios_base::eofbit; | |
| 937 | 972 | break; |
| 938 | 973 | } |
| 939 | 974 | ++__gc_; |
| ... | ... | @@ -948,7 +983,7 @@ basic_istream<_CharT, _Traits>::ignore(streamsize __n, int_type __dlm) |
| 948 | 983 | typename traits_type::int_type __i = this->rdbuf()->sbumpc(); |
| 949 | 984 | if (traits_type::eq_int_type(__i, traits_type::eof())) |
| 950 | 985 | { |
| 951 | __err |= ios_base::eofbit; | |
| 986 | __state |= ios_base::eofbit; | |
| 952 | 987 | break; |
| 953 | 988 | } |
| 954 | 989 | ++__gc_; |
| ... | ... | @@ -956,15 +991,20 @@ basic_istream<_CharT, _Traits>::ignore(streamsize __n, int_type __dlm) |
| 956 | 991 | break; |
| 957 | 992 | } |
| 958 | 993 | } |
| 959 | this->setstate(__err); | |
| 960 | } | |
| 961 | 994 | #ifndef _LIBCPP_NO_EXCEPTIONS |
| 962 | } | |
| 963 | catch (...) | |
| 964 | { | |
| 965 | this->__set_badbit_and_consider_rethrow(); | |
| 966 | } | |
| 995 | } | |
| 996 | catch (...) | |
| 997 | { | |
| 998 | __state |= ios_base::badbit; | |
| 999 | this->__setstate_nothrow(__state); | |
| 1000 | if (this->exceptions() & ios_base::badbit) | |
| 1001 | { | |
| 1002 | throw; | |
| 1003 | } | |
| 1004 | } | |
| 967 | 1005 | #endif // _LIBCPP_NO_EXCEPTIONS |
| 1006 | this->setstate(__state); | |
| 1007 | } | |
| 968 | 1008 | return *this; |
| 969 | 1009 | } |
| 970 | 1010 | |
| ... | ... | @@ -972,26 +1012,33 @@ template<class _CharT, class _Traits> |
| 972 | 1012 | typename basic_istream<_CharT, _Traits>::int_type |
| 973 | 1013 | basic_istream<_CharT, _Traits>::peek() |
| 974 | 1014 | { |
| 1015 | ios_base::iostate __state = ios_base::goodbit; | |
| 975 | 1016 | __gc_ = 0; |
| 976 | 1017 | int_type __r = traits_type::eof(); |
| 977 | #ifndef _LIBCPP_NO_EXCEPTIONS | |
| 978 | try | |
| 1018 | sentry __sen(*this, true); | |
| 1019 | if (__sen) | |
| 979 | 1020 | { |
| 980 | #endif // _LIBCPP_NO_EXCEPTIONS | |
| 981 | sentry __sen(*this, true); | |
| 982 | if (__sen) | |
| 1021 | #ifndef _LIBCPP_NO_EXCEPTIONS | |
| 1022 | try | |
| 983 | 1023 | { |
| 1024 | #endif // _LIBCPP_NO_EXCEPTIONS | |
| 984 | 1025 | __r = this->rdbuf()->sgetc(); |
| 985 | 1026 | if (traits_type::eq_int_type(__r, traits_type::eof())) |
| 986 | this->setstate(ios_base::eofbit); | |
| 987 | } | |
| 1027 | __state |= ios_base::eofbit; | |
| 988 | 1028 | #ifndef _LIBCPP_NO_EXCEPTIONS |
| 989 | } | |
| 990 | catch (...) | |
| 991 | { | |
| 992 | this->__set_badbit_and_consider_rethrow(); | |
| 993 | } | |
| 1029 | } | |
| 1030 | catch (...) | |
| 1031 | { | |
| 1032 | __state |= ios_base::badbit; | |
| 1033 | this->__setstate_nothrow(__state); | |
| 1034 | if (this->exceptions() & ios_base::badbit) | |
| 1035 | { | |
| 1036 | throw; | |
| 1037 | } | |
| 1038 | } | |
| 994 | 1039 | #endif // _LIBCPP_NO_EXCEPTIONS |
| 1040 | this->setstate(__state); | |
| 1041 | } | |
| 995 | 1042 | return __r; |
| 996 | 1043 | } |
| 997 | 1044 | |
| ... | ... | @@ -999,27 +1046,36 @@ template<class _CharT, class _Traits> |
| 999 | 1046 | basic_istream<_CharT, _Traits>& |
| 1000 | 1047 | basic_istream<_CharT, _Traits>::read(char_type* __s, streamsize __n) |
| 1001 | 1048 | { |
| 1049 | ios_base::iostate __state = ios_base::goodbit; | |
| 1002 | 1050 | __gc_ = 0; |
| 1003 | #ifndef _LIBCPP_NO_EXCEPTIONS | |
| 1004 | try | |
| 1051 | sentry __sen(*this, true); | |
| 1052 | if (__sen) | |
| 1005 | 1053 | { |
| 1006 | #endif // _LIBCPP_NO_EXCEPTIONS | |
| 1007 | sentry __sen(*this, true); | |
| 1008 | if (__sen) | |
| 1054 | #ifndef _LIBCPP_NO_EXCEPTIONS | |
| 1055 | try | |
| 1009 | 1056 | { |
| 1057 | #endif // _LIBCPP_NO_EXCEPTIONS | |
| 1010 | 1058 | __gc_ = this->rdbuf()->sgetn(__s, __n); |
| 1011 | 1059 | if (__gc_ != __n) |
| 1012 | this->setstate(ios_base::failbit | ios_base::eofbit); | |
| 1013 | } | |
| 1014 | else | |
| 1015 | this->setstate(ios_base::failbit); | |
| 1060 | __state |= ios_base::failbit | ios_base::eofbit; | |
| 1016 | 1061 | #ifndef _LIBCPP_NO_EXCEPTIONS |
| 1062 | } | |
| 1063 | catch (...) | |
| 1064 | { | |
| 1065 | __state |= ios_base::badbit; | |
| 1066 | this->__setstate_nothrow(__state); | |
| 1067 | if (this->exceptions() & ios_base::badbit) | |
| 1068 | { | |
| 1069 | throw; | |
| 1070 | } | |
| 1071 | } | |
| 1072 | #endif // _LIBCPP_NO_EXCEPTIONS | |
| 1017 | 1073 | } |
| 1018 | catch (...) | |
| 1074 | else | |
| 1019 | 1075 | { |
| 1020 | this->__set_badbit_and_consider_rethrow(); | |
| 1076 | __state |= ios_base::failbit; | |
| 1021 | 1077 | } |
| 1022 | #endif // _LIBCPP_NO_EXCEPTIONS | |
| 1078 | this->setstate(__state); | |
| 1023 | 1079 | return *this; |
| 1024 | 1080 | } |
| 1025 | 1081 | |
| ... | ... | @@ -1027,36 +1083,48 @@ template<class _CharT, class _Traits> |
| 1027 | 1083 | streamsize |
| 1028 | 1084 | basic_istream<_CharT, _Traits>::readsome(char_type* __s, streamsize __n) |
| 1029 | 1085 | { |
| 1086 | ios_base::iostate __state = ios_base::goodbit; | |
| 1030 | 1087 | __gc_ = 0; |
| 1031 | #ifndef _LIBCPP_NO_EXCEPTIONS | |
| 1032 | try | |
| 1088 | sentry __sen(*this, true); | |
| 1089 | if (__sen) | |
| 1033 | 1090 | { |
| 1034 | #endif // _LIBCPP_NO_EXCEPTIONS | |
| 1035 | sentry __sen(*this, true); | |
| 1036 | if (__sen) | |
| 1091 | #ifndef _LIBCPP_NO_EXCEPTIONS | |
| 1092 | try | |
| 1037 | 1093 | { |
| 1094 | #endif // _LIBCPP_NO_EXCEPTIONS | |
| 1038 | 1095 | streamsize __c = this->rdbuf()->in_avail(); |
| 1039 | 1096 | switch (__c) |
| 1040 | 1097 | { |
| 1041 | 1098 | case -1: |
| 1042 | this->setstate(ios_base::eofbit); | |
| 1099 | __state |= ios_base::eofbit; | |
| 1043 | 1100 | break; |
| 1044 | 1101 | case 0: |
| 1045 | 1102 | break; |
| 1046 | 1103 | default: |
| 1047 | read(__s, _VSTD::min(__c, __n)); | |
| 1104 | __n = _VSTD::min(__c, __n); | |
| 1105 | __gc_ = this->rdbuf()->sgetn(__s, __n); | |
| 1106 | if (__gc_ != __n) | |
| 1107 | __state |= ios_base::failbit | ios_base::eofbit; | |
| 1048 | 1108 | break; |
| 1049 | 1109 | } |
| 1050 | } | |
| 1051 | else | |
| 1052 | this->setstate(ios_base::failbit); | |
| 1053 | 1110 | #ifndef _LIBCPP_NO_EXCEPTIONS |
| 1111 | } | |
| 1112 | catch (...) | |
| 1113 | { | |
| 1114 | __state |= ios_base::badbit; | |
| 1115 | this->__setstate_nothrow(__state); | |
| 1116 | if (this->exceptions() & ios_base::badbit) | |
| 1117 | { | |
| 1118 | throw; | |
| 1119 | } | |
| 1120 | } | |
| 1121 | #endif // _LIBCPP_NO_EXCEPTIONS | |
| 1054 | 1122 | } |
| 1055 | catch (...) | |
| 1123 | else | |
| 1056 | 1124 | { |
| 1057 | this->__set_badbit_and_consider_rethrow(); | |
| 1125 | __state |= ios_base::failbit; | |
| 1058 | 1126 | } |
| 1059 | #endif // _LIBCPP_NO_EXCEPTIONS | |
| 1127 | this->setstate(__state); | |
| 1060 | 1128 | return __gc_; |
| 1061 | 1129 | } |
| 1062 | 1130 | |
| ... | ... | @@ -1064,27 +1132,36 @@ template<class _CharT, class _Traits> |
| 1064 | 1132 | basic_istream<_CharT, _Traits>& |
| 1065 | 1133 | basic_istream<_CharT, _Traits>::putback(char_type __c) |
| 1066 | 1134 | { |
| 1135 | ios_base::iostate __state = this->rdstate() & ~ios_base::eofbit; | |
| 1067 | 1136 | __gc_ = 0; |
| 1068 | #ifndef _LIBCPP_NO_EXCEPTIONS | |
| 1069 | try | |
| 1137 | this->clear(__state); | |
| 1138 | sentry __sen(*this, true); | |
| 1139 | if (__sen) | |
| 1070 | 1140 | { |
| 1071 | #endif // _LIBCPP_NO_EXCEPTIONS | |
| 1072 | this->clear(this->rdstate() & ~ios_base::eofbit); | |
| 1073 | sentry __sen(*this, true); | |
| 1074 | if (__sen) | |
| 1141 | #ifndef _LIBCPP_NO_EXCEPTIONS | |
| 1142 | try | |
| 1075 | 1143 | { |
| 1144 | #endif // _LIBCPP_NO_EXCEPTIONS | |
| 1076 | 1145 | if (this->rdbuf() == 0 || this->rdbuf()->sputbackc(__c) == traits_type::eof()) |
| 1077 | this->setstate(ios_base::badbit); | |
| 1078 | } | |
| 1079 | else | |
| 1080 | this->setstate(ios_base::failbit); | |
| 1146 | __state |= ios_base::badbit; | |
| 1081 | 1147 | #ifndef _LIBCPP_NO_EXCEPTIONS |
| 1148 | } | |
| 1149 | catch (...) | |
| 1150 | { | |
| 1151 | __state |= ios_base::badbit; | |
| 1152 | this->__setstate_nothrow(__state); | |
| 1153 | if (this->exceptions() & ios_base::badbit) | |
| 1154 | { | |
| 1155 | throw; | |
| 1156 | } | |
| 1157 | } | |
| 1158 | #endif // _LIBCPP_NO_EXCEPTIONS | |
| 1082 | 1159 | } |
| 1083 | catch (...) | |
| 1160 | else | |
| 1084 | 1161 | { |
| 1085 | this->__set_badbit_and_consider_rethrow(); | |
| 1162 | __state |= ios_base::failbit; | |
| 1086 | 1163 | } |
| 1087 | #endif // _LIBCPP_NO_EXCEPTIONS | |
| 1164 | this->setstate(__state); | |
| 1088 | 1165 | return *this; |
| 1089 | 1166 | } |
| 1090 | 1167 | |
| ... | ... | @@ -1092,27 +1169,36 @@ template<class _CharT, class _Traits> |
| 1092 | 1169 | basic_istream<_CharT, _Traits>& |
| 1093 | 1170 | basic_istream<_CharT, _Traits>::unget() |
| 1094 | 1171 | { |
| 1172 | ios_base::iostate __state = this->rdstate() & ~ios_base::eofbit; | |
| 1095 | 1173 | __gc_ = 0; |
| 1096 | #ifndef _LIBCPP_NO_EXCEPTIONS | |
| 1097 | try | |
| 1174 | this->clear(__state); | |
| 1175 | sentry __sen(*this, true); | |
| 1176 | if (__sen) | |
| 1098 | 1177 | { |
| 1099 | #endif // _LIBCPP_NO_EXCEPTIONS | |
| 1100 | this->clear(this->rdstate() & ~ios_base::eofbit); | |
| 1101 | sentry __sen(*this, true); | |
| 1102 | if (__sen) | |
| 1178 | #ifndef _LIBCPP_NO_EXCEPTIONS | |
| 1179 | try | |
| 1103 | 1180 | { |
| 1181 | #endif // _LIBCPP_NO_EXCEPTIONS | |
| 1104 | 1182 | if (this->rdbuf() == 0 || this->rdbuf()->sungetc() == traits_type::eof()) |
| 1105 | this->setstate(ios_base::badbit); | |
| 1106 | } | |
| 1107 | else | |
| 1108 | this->setstate(ios_base::failbit); | |
| 1183 | __state |= ios_base::badbit; | |
| 1109 | 1184 | #ifndef _LIBCPP_NO_EXCEPTIONS |
| 1185 | } | |
| 1186 | catch (...) | |
| 1187 | { | |
| 1188 | __state |= ios_base::badbit; | |
| 1189 | this->__setstate_nothrow(__state); | |
| 1190 | if (this->exceptions() & ios_base::badbit) | |
| 1191 | { | |
| 1192 | throw; | |
| 1193 | } | |
| 1194 | } | |
| 1195 | #endif // _LIBCPP_NO_EXCEPTIONS | |
| 1110 | 1196 | } |
| 1111 | catch (...) | |
| 1197 | else | |
| 1112 | 1198 | { |
| 1113 | this->__set_badbit_and_consider_rethrow(); | |
| 1199 | __state |= ios_base::failbit; | |
| 1114 | 1200 | } |
| 1115 | #endif // _LIBCPP_NO_EXCEPTIONS | |
| 1201 | this->setstate(__state); | |
| 1116 | 1202 | return *this; |
| 1117 | 1203 | } |
| 1118 | 1204 | |
| ... | ... | @@ -1120,29 +1206,36 @@ template<class _CharT, class _Traits> |
| 1120 | 1206 | int |
| 1121 | 1207 | basic_istream<_CharT, _Traits>::sync() |
| 1122 | 1208 | { |
| 1209 | ios_base::iostate __state = ios_base::goodbit; | |
| 1123 | 1210 | int __r = 0; |
| 1124 | #ifndef _LIBCPP_NO_EXCEPTIONS | |
| 1125 | try | |
| 1211 | sentry __sen(*this, true); | |
| 1212 | if (__sen) | |
| 1126 | 1213 | { |
| 1127 | #endif // _LIBCPP_NO_EXCEPTIONS | |
| 1128 | sentry __sen(*this, true); | |
| 1129 | if (__sen) | |
| 1214 | #ifndef _LIBCPP_NO_EXCEPTIONS | |
| 1215 | try | |
| 1130 | 1216 | { |
| 1217 | #endif // _LIBCPP_NO_EXCEPTIONS | |
| 1131 | 1218 | if (this->rdbuf() == 0) |
| 1132 | 1219 | return -1; |
| 1133 | 1220 | if (this->rdbuf()->pubsync() == -1) |
| 1134 | 1221 | { |
| 1135 | this->setstate(ios_base::badbit); | |
| 1222 | __state |= ios_base::badbit; | |
| 1136 | 1223 | return -1; |
| 1137 | 1224 | } |
| 1138 | } | |
| 1139 | 1225 | #ifndef _LIBCPP_NO_EXCEPTIONS |
| 1140 | } | |
| 1141 | catch (...) | |
| 1142 | { | |
| 1143 | this->__set_badbit_and_consider_rethrow(); | |
| 1144 | } | |
| 1226 | } | |
| 1227 | catch (...) | |
| 1228 | { | |
| 1229 | __state |= ios_base::badbit; | |
| 1230 | this->__setstate_nothrow(__state); | |
| 1231 | if (this->exceptions() & ios_base::badbit) | |
| 1232 | { | |
| 1233 | throw; | |
| 1234 | } | |
| 1235 | } | |
| 1145 | 1236 | #endif // _LIBCPP_NO_EXCEPTIONS |
| 1237 | this->setstate(__state); | |
| 1238 | } | |
| 1146 | 1239 | return __r; |
| 1147 | 1240 | } |
| 1148 | 1241 | |
| ... | ... | @@ -1150,21 +1243,30 @@ template<class _CharT, class _Traits> |
| 1150 | 1243 | typename basic_istream<_CharT, _Traits>::pos_type |
| 1151 | 1244 | basic_istream<_CharT, _Traits>::tellg() |
| 1152 | 1245 | { |
| 1246 | ios_base::iostate __state = ios_base::goodbit; | |
| 1153 | 1247 | pos_type __r(-1); |
| 1154 | #ifndef _LIBCPP_NO_EXCEPTIONS | |
| 1155 | try | |
| 1248 | sentry __sen(*this, true); | |
| 1249 | if (__sen) | |
| 1156 | 1250 | { |
| 1251 | #ifndef _LIBCPP_NO_EXCEPTIONS | |
| 1252 | try | |
| 1253 | { | |
| 1157 | 1254 | #endif // _LIBCPP_NO_EXCEPTIONS |
| 1158 | sentry __sen(*this, true); | |
| 1159 | if (__sen) | |
| 1160 | __r = this->rdbuf()->pubseekoff(0, ios_base::cur, ios_base::in); | |
| 1255 | __r = this->rdbuf()->pubseekoff(0, ios_base::cur, ios_base::in); | |
| 1161 | 1256 | #ifndef _LIBCPP_NO_EXCEPTIONS |
| 1162 | } | |
| 1163 | catch (...) | |
| 1164 | { | |
| 1165 | this->__set_badbit_and_consider_rethrow(); | |
| 1166 | } | |
| 1257 | } | |
| 1258 | catch (...) | |
| 1259 | { | |
| 1260 | __state |= ios_base::badbit; | |
| 1261 | this->__setstate_nothrow(__state); | |
| 1262 | if (this->exceptions() & ios_base::badbit) | |
| 1263 | { | |
| 1264 | throw; | |
| 1265 | } | |
| 1266 | } | |
| 1167 | 1267 | #endif // _LIBCPP_NO_EXCEPTIONS |
| 1268 | this->setstate(__state); | |
| 1269 | } | |
| 1168 | 1270 | return __r; |
| 1169 | 1271 | } |
| 1170 | 1272 | |
| ... | ... | @@ -1172,24 +1274,31 @@ template<class _CharT, class _Traits> |
| 1172 | 1274 | basic_istream<_CharT, _Traits>& |
| 1173 | 1275 | basic_istream<_CharT, _Traits>::seekg(pos_type __pos) |
| 1174 | 1276 | { |
| 1175 | #ifndef _LIBCPP_NO_EXCEPTIONS | |
| 1176 | try | |
| 1277 | ios_base::iostate __state = this->rdstate() & ~ios_base::eofbit; | |
| 1278 | this->clear(__state); | |
| 1279 | sentry __sen(*this, true); | |
| 1280 | if (__sen) | |
| 1177 | 1281 | { |
| 1178 | #endif // _LIBCPP_NO_EXCEPTIONS | |
| 1179 | this->clear(this->rdstate() & ~ios_base::eofbit); | |
| 1180 | sentry __sen(*this, true); | |
| 1181 | if (__sen) | |
| 1282 | #ifndef _LIBCPP_NO_EXCEPTIONS | |
| 1283 | try | |
| 1182 | 1284 | { |
| 1285 | #endif // _LIBCPP_NO_EXCEPTIONS | |
| 1183 | 1286 | if (this->rdbuf()->pubseekpos(__pos, ios_base::in) == pos_type(-1)) |
| 1184 | this->setstate(ios_base::failbit); | |
| 1185 | } | |
| 1287 | __state |= ios_base::failbit; | |
| 1186 | 1288 | #ifndef _LIBCPP_NO_EXCEPTIONS |
| 1187 | } | |
| 1188 | catch (...) | |
| 1189 | { | |
| 1190 | this->__set_badbit_and_consider_rethrow(); | |
| 1191 | } | |
| 1289 | } | |
| 1290 | catch (...) | |
| 1291 | { | |
| 1292 | __state |= ios_base::badbit; | |
| 1293 | this->__setstate_nothrow(__state); | |
| 1294 | if (this->exceptions() & ios_base::badbit) | |
| 1295 | { | |
| 1296 | throw; | |
| 1297 | } | |
| 1298 | } | |
| 1192 | 1299 | #endif // _LIBCPP_NO_EXCEPTIONS |
| 1300 | this->setstate(__state); | |
| 1301 | } | |
| 1193 | 1302 | return *this; |
| 1194 | 1303 | } |
| 1195 | 1304 | |
| ... | ... | @@ -1197,24 +1306,31 @@ template<class _CharT, class _Traits> |
| 1197 | 1306 | basic_istream<_CharT, _Traits>& |
| 1198 | 1307 | basic_istream<_CharT, _Traits>::seekg(off_type __off, ios_base::seekdir __dir) |
| 1199 | 1308 | { |
| 1200 | #ifndef _LIBCPP_NO_EXCEPTIONS | |
| 1201 | try | |
| 1309 | ios_base::iostate __state = this->rdstate() & ~ios_base::eofbit; | |
| 1310 | this->clear(__state); | |
| 1311 | sentry __sen(*this, true); | |
| 1312 | if (__sen) | |
| 1202 | 1313 | { |
| 1203 | #endif // _LIBCPP_NO_EXCEPTIONS | |
| 1204 | this->clear(this->rdstate() & ~ios_base::eofbit); | |
| 1205 | sentry __sen(*this, true); | |
| 1206 | if (__sen) | |
| 1314 | #ifndef _LIBCPP_NO_EXCEPTIONS | |
| 1315 | try | |
| 1207 | 1316 | { |
| 1317 | #endif // _LIBCPP_NO_EXCEPTIONS | |
| 1208 | 1318 | if (this->rdbuf()->pubseekoff(__off, __dir, ios_base::in) == pos_type(-1)) |
| 1209 | this->setstate(ios_base::failbit); | |
| 1210 | } | |
| 1319 | __state |= ios_base::failbit; | |
| 1211 | 1320 | #ifndef _LIBCPP_NO_EXCEPTIONS |
| 1212 | } | |
| 1213 | catch (...) | |
| 1214 | { | |
| 1215 | this->__set_badbit_and_consider_rethrow(); | |
| 1216 | } | |
| 1321 | } | |
| 1322 | catch (...) | |
| 1323 | { | |
| 1324 | __state |= ios_base::badbit; | |
| 1325 | this->__setstate_nothrow(__state); | |
| 1326 | if (this->exceptions() & ios_base::badbit) | |
| 1327 | { | |
| 1328 | throw; | |
| 1329 | } | |
| 1330 | } | |
| 1217 | 1331 | #endif // _LIBCPP_NO_EXCEPTIONS |
| 1332 | this->setstate(__state); | |
| 1333 | } | |
| 1218 | 1334 | return *this; |
| 1219 | 1335 | } |
| 1220 | 1336 | |
| ... | ... | @@ -1222,34 +1338,41 @@ template <class _CharT, class _Traits> |
| 1222 | 1338 | basic_istream<_CharT, _Traits>& |
| 1223 | 1339 | ws(basic_istream<_CharT, _Traits>& __is) |
| 1224 | 1340 | { |
| 1225 | #ifndef _LIBCPP_NO_EXCEPTIONS | |
| 1226 | try | |
| 1341 | ios_base::iostate __state = ios_base::goodbit; | |
| 1342 | typename basic_istream<_CharT, _Traits>::sentry __sen(__is, true); | |
| 1343 | if (__sen) | |
| 1227 | 1344 | { |
| 1228 | #endif // _LIBCPP_NO_EXCEPTIONS | |
| 1229 | typename basic_istream<_CharT, _Traits>::sentry __sen(__is, true); | |
| 1230 | if (__sen) | |
| 1345 | #ifndef _LIBCPP_NO_EXCEPTIONS | |
| 1346 | try | |
| 1231 | 1347 | { |
| 1348 | #endif // _LIBCPP_NO_EXCEPTIONS | |
| 1232 | 1349 | const ctype<_CharT>& __ct = use_facet<ctype<_CharT> >(__is.getloc()); |
| 1233 | 1350 | while (true) |
| 1234 | 1351 | { |
| 1235 | 1352 | typename _Traits::int_type __i = __is.rdbuf()->sgetc(); |
| 1236 | 1353 | if (_Traits::eq_int_type(__i, _Traits::eof())) |
| 1237 | 1354 | { |
| 1238 | __is.setstate(ios_base::eofbit); | |
| 1355 | __state |= ios_base::eofbit; | |
| 1239 | 1356 | break; |
| 1240 | 1357 | } |
| 1241 | 1358 | if (!__ct.is(__ct.space, _Traits::to_char_type(__i))) |
| 1242 | 1359 | break; |
| 1243 | 1360 | __is.rdbuf()->sbumpc(); |
| 1244 | 1361 | } |
| 1245 | } | |
| 1246 | 1362 | #ifndef _LIBCPP_NO_EXCEPTIONS |
| 1247 | } | |
| 1248 | catch (...) | |
| 1249 | { | |
| 1250 | __is.__set_badbit_and_consider_rethrow(); | |
| 1251 | } | |
| 1363 | } | |
| 1364 | catch (...) | |
| 1365 | { | |
| 1366 | __state |= ios_base::badbit; | |
| 1367 | __is.__setstate_nothrow(__state); | |
| 1368 | if (__is.exceptions() & ios_base::badbit) | |
| 1369 | { | |
| 1370 | throw; | |
| 1371 | } | |
| 1372 | } | |
| 1252 | 1373 | #endif // _LIBCPP_NO_EXCEPTIONS |
| 1374 | __is.setstate(__state); | |
| 1375 | } | |
| 1253 | 1376 | return __is; |
| 1254 | 1377 | } |
| 1255 | 1378 | |
| ... | ... | @@ -1298,7 +1421,6 @@ protected: |
| 1298 | 1421 | inline _LIBCPP_HIDE_FROM_ABI_AFTER_V1 |
| 1299 | 1422 | void swap(basic_iostream& __rhs) |
| 1300 | 1423 | { basic_istream<char_type, traits_type>::swap(__rhs); } |
| 1301 | public: | |
| 1302 | 1424 | }; |
| 1303 | 1425 | |
| 1304 | 1426 | #ifndef _LIBCPP_CXX03_LANG |
| ... | ... | @@ -1329,13 +1451,14 @@ basic_istream<_CharT, _Traits>& |
| 1329 | 1451 | operator>>(basic_istream<_CharT, _Traits>& __is, |
| 1330 | 1452 | basic_string<_CharT, _Traits, _Allocator>& __str) |
| 1331 | 1453 | { |
| 1332 | #ifndef _LIBCPP_NO_EXCEPTIONS | |
| 1333 | try | |
| 1454 | ios_base::iostate __state = ios_base::goodbit; | |
| 1455 | typename basic_istream<_CharT, _Traits>::sentry __sen(__is); | |
| 1456 | if (__sen) | |
| 1334 | 1457 | { |
| 1335 | #endif // _LIBCPP_NO_EXCEPTIONS | |
| 1336 | typename basic_istream<_CharT, _Traits>::sentry __sen(__is); | |
| 1337 | if (__sen) | |
| 1458 | #ifndef _LIBCPP_NO_EXCEPTIONS | |
| 1459 | try | |
| 1338 | 1460 | { |
| 1461 | #endif | |
| 1339 | 1462 | __str.clear(); |
| 1340 | 1463 | streamsize __n = __is.width(); |
| 1341 | 1464 | if (__n <= 0) |
| ... | ... | @@ -1344,13 +1467,12 @@ operator>>(basic_istream<_CharT, _Traits>& __is, |
| 1344 | 1467 | __n = numeric_limits<streamsize>::max(); |
| 1345 | 1468 | streamsize __c = 0; |
| 1346 | 1469 | const ctype<_CharT>& __ct = use_facet<ctype<_CharT> >(__is.getloc()); |
| 1347 | ios_base::iostate __err = ios_base::goodbit; | |
| 1348 | 1470 | while (__c < __n) |
| 1349 | 1471 | { |
| 1350 | 1472 | typename _Traits::int_type __i = __is.rdbuf()->sgetc(); |
| 1351 | 1473 | if (_Traits::eq_int_type(__i, _Traits::eof())) |
| 1352 | 1474 | { |
| 1353 | __err |= ios_base::eofbit; | |
| 1475 | __state |= ios_base::eofbit; | |
| 1354 | 1476 | break; |
| 1355 | 1477 | } |
| 1356 | 1478 | _CharT __ch = _Traits::to_char_type(__i); |
| ... | ... | @@ -1362,18 +1484,21 @@ operator>>(basic_istream<_CharT, _Traits>& __is, |
| 1362 | 1484 | } |
| 1363 | 1485 | __is.width(0); |
| 1364 | 1486 | if (__c == 0) |
| 1365 | __err |= ios_base::failbit; | |
| 1366 | __is.setstate(__err); | |
| 1367 | } | |
| 1368 | else | |
| 1369 | __is.setstate(ios_base::failbit); | |
| 1487 | __state |= ios_base::failbit; | |
| 1370 | 1488 | #ifndef _LIBCPP_NO_EXCEPTIONS |
| 1489 | } | |
| 1490 | catch (...) | |
| 1491 | { | |
| 1492 | __state |= ios_base::badbit; | |
| 1493 | __is.__setstate_nothrow(__state); | |
| 1494 | if (__is.exceptions() & ios_base::badbit) | |
| 1495 | { | |
| 1496 | throw; | |
| 1497 | } | |
| 1498 | } | |
| 1499 | #endif | |
| 1500 | __is.setstate(__state); | |
| 1371 | 1501 | } |
| 1372 | catch (...) | |
| 1373 | { | |
| 1374 | __is.__set_badbit_and_consider_rethrow(); | |
| 1375 | } | |
| 1376 | #endif // _LIBCPP_NO_EXCEPTIONS | |
| 1377 | 1502 | return __is; |
| 1378 | 1503 | } |
| 1379 | 1504 | |
| ... | ... | @@ -1382,22 +1507,22 @@ basic_istream<_CharT, _Traits>& |
| 1382 | 1507 | getline(basic_istream<_CharT, _Traits>& __is, |
| 1383 | 1508 | basic_string<_CharT, _Traits, _Allocator>& __str, _CharT __dlm) |
| 1384 | 1509 | { |
| 1385 | #ifndef _LIBCPP_NO_EXCEPTIONS | |
| 1386 | try | |
| 1510 | ios_base::iostate __state = ios_base::goodbit; | |
| 1511 | typename basic_istream<_CharT, _Traits>::sentry __sen(__is, true); | |
| 1512 | if (__sen) | |
| 1387 | 1513 | { |
| 1388 | #endif // _LIBCPP_NO_EXCEPTIONS | |
| 1389 | typename basic_istream<_CharT, _Traits>::sentry __sen(__is, true); | |
| 1390 | if (__sen) | |
| 1514 | #ifndef _LIBCPP_NO_EXCEPTIONS | |
| 1515 | try | |
| 1391 | 1516 | { |
| 1517 | #endif | |
| 1392 | 1518 | __str.clear(); |
| 1393 | ios_base::iostate __err = ios_base::goodbit; | |
| 1394 | 1519 | streamsize __extr = 0; |
| 1395 | 1520 | while (true) |
| 1396 | 1521 | { |
| 1397 | 1522 | typename _Traits::int_type __i = __is.rdbuf()->sbumpc(); |
| 1398 | 1523 | if (_Traits::eq_int_type(__i, _Traits::eof())) |
| 1399 | 1524 | { |
| 1400 | __err |= ios_base::eofbit; | |
| 1525 | __state |= ios_base::eofbit; | |
| 1401 | 1526 | break; |
| 1402 | 1527 | } |
| 1403 | 1528 | ++__extr; |
| ... | ... | @@ -1407,21 +1532,26 @@ getline(basic_istream<_CharT, _Traits>& __is, |
| 1407 | 1532 | __str.push_back(__ch); |
| 1408 | 1533 | if (__str.size() == __str.max_size()) |
| 1409 | 1534 | { |
| 1410 | __err |= ios_base::failbit; | |
| 1535 | __state |= ios_base::failbit; | |
| 1411 | 1536 | break; |
| 1412 | 1537 | } |
| 1413 | 1538 | } |
| 1414 | 1539 | if (__extr == 0) |
| 1415 | __err |= ios_base::failbit; | |
| 1416 | __is.setstate(__err); | |
| 1417 | } | |
| 1540 | __state |= ios_base::failbit; | |
| 1418 | 1541 | #ifndef _LIBCPP_NO_EXCEPTIONS |
| 1542 | } | |
| 1543 | catch (...) | |
| 1544 | { | |
| 1545 | __state |= ios_base::badbit; | |
| 1546 | __is.__setstate_nothrow(__state); | |
| 1547 | if (__is.exceptions() & ios_base::badbit) | |
| 1548 | { | |
| 1549 | throw; | |
| 1550 | } | |
| 1551 | } | |
| 1552 | #endif | |
| 1553 | __is.setstate(__state); | |
| 1419 | 1554 | } |
| 1420 | catch (...) | |
| 1421 | { | |
| 1422 | __is.__set_badbit_and_consider_rethrow(); | |
| 1423 | } | |
| 1424 | #endif // _LIBCPP_NO_EXCEPTIONS | |
| 1425 | 1555 | return __is; |
| 1426 | 1556 | } |
| 1427 | 1557 | |
| ... | ... | @@ -1460,17 +1590,17 @@ template <class _CharT, class _Traits, size_t _Size> |
| 1460 | 1590 | basic_istream<_CharT, _Traits>& |
| 1461 | 1591 | operator>>(basic_istream<_CharT, _Traits>& __is, bitset<_Size>& __x) |
| 1462 | 1592 | { |
| 1463 | #ifndef _LIBCPP_NO_EXCEPTIONS | |
| 1464 | try | |
| 1593 | ios_base::iostate __state = ios_base::goodbit; | |
| 1594 | typename basic_istream<_CharT, _Traits>::sentry __sen(__is); | |
| 1595 | if (__sen) | |
| 1465 | 1596 | { |
| 1466 | #endif // _LIBCPP_NO_EXCEPTIONS | |
| 1467 | typename basic_istream<_CharT, _Traits>::sentry __sen(__is); | |
| 1468 | if (__sen) | |
| 1597 | #ifndef _LIBCPP_NO_EXCEPTIONS | |
| 1598 | try | |
| 1469 | 1599 | { |
| 1600 | #endif | |
| 1470 | 1601 | basic_string<_CharT, _Traits> __str; |
| 1471 | 1602 | const ctype<_CharT>& __ct = use_facet<ctype<_CharT> >(__is.getloc()); |
| 1472 | 1603 | size_t __c = 0; |
| 1473 | ios_base::iostate __err = ios_base::goodbit; | |
| 1474 | 1604 | _CharT __zero = __ct.widen('0'); |
| 1475 | 1605 | _CharT __one = __ct.widen('1'); |
| 1476 | 1606 | while (__c < _Size) |
| ... | ... | @@ -1478,7 +1608,7 @@ operator>>(basic_istream<_CharT, _Traits>& __is, bitset<_Size>& __x) |
| 1478 | 1608 | typename _Traits::int_type __i = __is.rdbuf()->sgetc(); |
| 1479 | 1609 | if (_Traits::eq_int_type(__i, _Traits::eof())) |
| 1480 | 1610 | { |
| 1481 | __err |= ios_base::eofbit; | |
| 1611 | __state |= ios_base::eofbit; | |
| 1482 | 1612 | break; |
| 1483 | 1613 | } |
| 1484 | 1614 | _CharT __ch = _Traits::to_char_type(__i); |
| ... | ... | @@ -1490,18 +1620,21 @@ operator>>(basic_istream<_CharT, _Traits>& __is, bitset<_Size>& __x) |
| 1490 | 1620 | } |
| 1491 | 1621 | __x = bitset<_Size>(__str); |
| 1492 | 1622 | if (__c == 0) |
| 1493 | __err |= ios_base::failbit; | |
| 1494 | __is.setstate(__err); | |
| 1495 | } | |
| 1496 | else | |
| 1497 | __is.setstate(ios_base::failbit); | |
| 1623 | __state |= ios_base::failbit; | |
| 1498 | 1624 | #ifndef _LIBCPP_NO_EXCEPTIONS |
| 1625 | } | |
| 1626 | catch (...) | |
| 1627 | { | |
| 1628 | __state |= ios_base::badbit; | |
| 1629 | __is.__setstate_nothrow(__state); | |
| 1630 | if (__is.exceptions() & ios_base::badbit) | |
| 1631 | { | |
| 1632 | throw; | |
| 1633 | } | |
| 1634 | } | |
| 1635 | #endif | |
| 1636 | __is.setstate(__state); | |
| 1499 | 1637 | } |
| 1500 | catch (...) | |
| 1501 | { | |
| 1502 | __is.__set_badbit_and_consider_rethrow(); | |
| 1503 | } | |
| 1504 | #endif // _LIBCPP_NO_EXCEPTIONS | |
| 1505 | 1638 | return __is; |
| 1506 | 1639 | } |
| 1507 | 1640 |
lib/libcxx/include/iterator+141-106| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===-------------------------- iterator ----------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 | |
| ... | ... | @@ -70,7 +69,7 @@ typename iterator_traits<InputIterator>::difference_type n = 1); |
| 70 | 69 | |
| 71 | 70 | template <class BidirectionalIterator> // constexpr in C++17 |
| 72 | 71 | constexpr BidirectionalIterator prev(BidirectionalIterator x, |
| 73 | typename iterator_traits<BidirectionalIterator>::difference_type n = 1); | |
| 72 | typename iterator_traits<BidirectionalIterator>::difference_type n = 1); | |
| 74 | 73 | |
| 75 | 74 | template <class Iterator> |
| 76 | 75 | class reverse_iterator |
| ... | ... | @@ -137,7 +136,7 @@ operator-(const reverse_iterator<Iterator1>& x, const reverse_iterator<Iterator2 |
| 137 | 136 | |
| 138 | 137 | template <class Iterator> |
| 139 | 138 | constexpr reverse_iterator<Iterator> |
| 140 | operator+(typename reverse_iterator<Iterator>::difference_type n, | |
| 139 | operator+(typename reverse_iterator<Iterator>::difference_type n, | |
| 141 | 140 | const reverse_iterator<Iterator>& x); // constexpr in C++17 |
| 142 | 141 | |
| 143 | 142 | template <class Iterator> |
| ... | ... | @@ -217,7 +216,7 @@ public: |
| 217 | 216 | typedef typename iterator_traits<Iterator>::value_type value_type; |
| 218 | 217 | typedef typename iterator_traits<Iterator>::iterator_category iterator_category; |
| 219 | 218 | typedef value_type&& reference; |
| 220 | ||
| 219 | ||
| 221 | 220 | constexpr move_iterator(); // all the constexprs are in C++17 |
| 222 | 221 | constexpr explicit move_iterator(Iterator i); |
| 223 | 222 | template <class U> |
| ... | ... | @@ -231,10 +230,10 @@ public: |
| 231 | 230 | constexpr move_iterator operator++(int); |
| 232 | 231 | constexpr move_iterator& operator--(); |
| 233 | 232 | constexpr move_iterator operator--(int); |
| 234 | constexpr move_iterator operator+(difference_type n) const; | |
| 235 | constexpr move_iterator& operator+=(difference_type n); | |
| 236 | constexpr move_iterator operator-(difference_type n) const; | |
| 237 | constexpr move_iterator& operator-=(difference_type n); | |
| 233 | constexpr move_iterator operator+(difference_type n) const; | |
| 234 | constexpr move_iterator& operator+=(difference_type n); | |
| 235 | constexpr move_iterator operator-(difference_type n) const; | |
| 236 | constexpr move_iterator& operator-=(difference_type n); | |
| 238 | 237 | constexpr unspecified operator[](difference_type n) const; |
| 239 | 238 | private: |
| 240 | 239 | Iterator current; // exposition only |
| ... | ... | @@ -271,7 +270,7 @@ operator-(const move_iterator<Iterator1>& x, |
| 271 | 270 | |
| 272 | 271 | template <class Iterator> |
| 273 | 272 | constexpr move_iterator<Iterator> operator+( // constexpr in C++17 |
| 274 | typename move_iterator<Iterator>::difference_type n, | |
| 273 | typename move_iterator<Iterator>::difference_type n, | |
| 275 | 274 | const move_iterator<Iterator>& x); |
| 276 | 275 | |
| 277 | 276 | template <class Iterator> // constexpr in C++17 |
| ... | ... | @@ -400,6 +399,11 @@ template <class C> constexpr auto crend(const C& c) -> decltype(std::rend(c)); |
| 400 | 399 | // 24.8, container access: |
| 401 | 400 | template <class C> constexpr auto size(const C& c) -> decltype(c.size()); // C++17 |
| 402 | 401 | template <class T, size_t N> constexpr size_t size(const T (&array)[N]) noexcept; // C++17 |
| 402 | ||
| 403 | template <class C> constexpr auto ssize(const C& c) | |
| 404 | -> common_type_t<ptrdiff_t, make_signed_t<decltype(c.size())>>;				 // C++20 | |
| 405 | template <class T, ptrdiff_t> constexpr ptrdiff_t ssize(const T (&array)[N]) noexcept; // C++20 | |
| 406 | ||
| 403 | 407 | template <class C> constexpr auto empty(const C& c) -> decltype(c.empty()); // C++17 |
| 404 | 408 | template <class T, size_t N> constexpr bool empty(const T (&array)[N]) noexcept; // C++17 |
| 405 | 409 | template <class E> constexpr bool empty(initializer_list<E> il) noexcept; // C++17 |
| ... | ... | @@ -530,10 +534,26 @@ struct __is_random_access_iterator : public __has_iterator_category_convertible_ |
| 530 | 534 | |
| 531 | 535 | template <class _Tp> |
| 532 | 536 | struct __is_exactly_input_iterator |
| 533 | : public integral_constant<bool, | |
| 534 | __has_iterator_category_convertible_to<_Tp, input_iterator_tag>::value && | |
| 537 | : public integral_constant<bool, | |
| 538 | __has_iterator_category_convertible_to<_Tp, input_iterator_tag>::value && | |
| 535 | 539 | !__has_iterator_category_convertible_to<_Tp, forward_iterator_tag>::value> {}; |
| 536 | 540 | |
| 541 | #ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES | |
| 542 | template<class _InputIterator> | |
| 543 | using __iter_value_type = typename iterator_traits<_InputIterator>::value_type; | |
| 544 | ||
| 545 | template<class _InputIterator> | |
| 546 | using __iter_key_type = remove_const_t<typename iterator_traits<_InputIterator>::value_type::first_type>; | |
| 547 | ||
| 548 | template<class _InputIterator> | |
| 549 | using __iter_mapped_type = typename iterator_traits<_InputIterator>::value_type::second_type; | |
| 550 | ||
| 551 | template<class _InputIterator> | |
| 552 | using __iter_to_alloc_type = pair< | |
| 553 | add_const_t<typename iterator_traits<_InputIterator>::value_type::first_type>, | |
| 554 | typename iterator_traits<_InputIterator>::value_type::second_type>; | |
| 555 | #endif | |
| 556 | ||
| 537 | 557 | template<class _Category, class _Tp, class _Distance = ptrdiff_t, |
| 538 | 558 | class _Pointer = _Tp*, class _Reference = _Tp&> |
| 539 | 559 | struct _LIBCPP_TEMPLATE_VIS iterator |
| ... | ... | @@ -580,6 +600,8 @@ inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 |
| 580 | 600 | void advance(_InputIter& __i, |
| 581 | 601 | typename iterator_traits<_InputIter>::difference_type __n) |
| 582 | 602 | { |
| 603 | _LIBCPP_ASSERT(__n >= 0 || __is_bidirectional_iterator<_InputIter>::value, | |
| 604 | "Attempt to advance(it, -n) on a non-bidi iterator"); | |
| 583 | 605 | __advance(__i, __n, typename iterator_traits<_InputIter>::iterator_category()); |
| 584 | 606 | } |
| 585 | 607 | |
| ... | ... | @@ -614,26 +636,31 @@ template <class _InputIter> |
| 614 | 636 | inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 |
| 615 | 637 | typename enable_if |
| 616 | 638 | < |
| 617 | __is_input_iterator<_InputIter>::value, | |
| 639 | __is_input_iterator<_InputIter>::value, | |
| 618 | 640 | _InputIter |
| 619 | 641 | >::type |
| 620 | 642 | next(_InputIter __x, |
| 621 | 643 | typename iterator_traits<_InputIter>::difference_type __n = 1) |
| 622 | 644 | { |
| 645 | _LIBCPP_ASSERT(__n >= 0 || __is_bidirectional_iterator<_InputIter>::value, | |
| 646 | "Attempt to next(it, -n) on a non-bidi iterator"); | |
| 647 | ||
| 623 | 648 | _VSTD::advance(__x, __n); |
| 624 | 649 | return __x; |
| 625 | 650 | } |
| 626 | 651 | |
| 627 | template <class _BidirectionalIter> | |
| 652 | template <class _InputIter> | |
| 628 | 653 | inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 |
| 629 | 654 | typename enable_if |
| 630 | 655 | < |
| 631 | __is_bidirectional_iterator<_BidirectionalIter>::value, | |
| 632 | _BidirectionalIter | |
| 656 | __is_input_iterator<_InputIter>::value, | |
| 657 | _InputIter | |
| 633 | 658 | >::type |
| 634 | prev(_BidirectionalIter __x, | |
| 635 | typename iterator_traits<_BidirectionalIter>::difference_type __n = 1) | |
| 659 | prev(_InputIter __x, | |
| 660 | typename iterator_traits<_InputIter>::difference_type __n = 1) | |
| 636 | 661 | { |
| 662 | _LIBCPP_ASSERT(__n <= 0 || __is_bidirectional_iterator<_InputIter>::value, | |
| 663 | "Attempt to prev(it, +n) on a non-bidi iterator"); | |
| 637 | 664 | _VSTD::advance(__x, -__n); |
| 638 | 665 | return __x; |
| 639 | 666 | } |
| ... | ... | @@ -1079,10 +1106,6 @@ public: |
| 1079 | 1106 | _LIBCPP_INLINE_VISIBILITY ostreambuf_iterator& operator++(int) {return *this;} |
| 1080 | 1107 | _LIBCPP_INLINE_VISIBILITY bool failed() const _NOEXCEPT {return __sbuf_ == 0;} |
| 1081 | 1108 | |
| 1082 | #if !defined(__APPLE__) || \ | |
| 1083 | (defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED > __MAC_10_8) || \ | |
| 1084 | (defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && __IPHONE_OS_VERSION_MIN_REQUIRED > __IPHONE_6_0) | |
| 1085 | ||
| 1086 | 1109 | template <class _Ch, class _Tr> |
| 1087 | 1110 | friend |
| 1088 | 1111 | _LIBCPP_HIDDEN |
| ... | ... | @@ -1090,7 +1113,6 @@ public: |
| 1090 | 1113 | __pad_and_output(ostreambuf_iterator<_Ch, _Tr> __s, |
| 1091 | 1114 | const _Ch* __ob, const _Ch* __op, const _Ch* __oe, |
| 1092 | 1115 | ios_base& __iob, _Ch __fl); |
| 1093 | #endif | |
| 1094 | 1116 | }; |
| 1095 | 1117 | |
| 1096 | 1118 | template <class _Iter> |
| ... | ... | @@ -1123,7 +1145,7 @@ public: |
| 1123 | 1145 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 |
| 1124 | 1146 | move_iterator(const move_iterator<_Up>& __u) : __i(__u.base()) {} |
| 1125 | 1147 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 _Iter base() const {return __i;} |
| 1126 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 | |
| 1148 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 | |
| 1127 | 1149 | reference operator*() const { return static_cast<reference>(*__i); } |
| 1128 | 1150 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 |
| 1129 | 1151 | pointer operator->() const { return __i;} |
| ... | ... | @@ -1237,50 +1259,50 @@ template <class _Iter> class __wrap_iter; |
| 1237 | 1259 | template <class _Iter1, class _Iter2> |
| 1238 | 1260 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG |
| 1239 | 1261 | bool |
| 1240 | operator==(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT_DEBUG; | |
| 1262 | operator==(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT; | |
| 1241 | 1263 | |
| 1242 | 1264 | template <class _Iter1, class _Iter2> |
| 1243 | 1265 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG |
| 1244 | 1266 | bool |
| 1245 | operator<(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT_DEBUG; | |
| 1267 | operator<(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT; | |
| 1246 | 1268 | |
| 1247 | 1269 | template <class _Iter1, class _Iter2> |
| 1248 | 1270 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG |
| 1249 | 1271 | bool |
| 1250 | operator!=(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT_DEBUG; | |
| 1272 | operator!=(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT; | |
| 1251 | 1273 | |
| 1252 | 1274 | template <class _Iter1, class _Iter2> |
| 1253 | 1275 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG |
| 1254 | 1276 | bool |
| 1255 | operator>(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT_DEBUG; | |
| 1277 | operator>(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT; | |
| 1256 | 1278 | |
| 1257 | 1279 | template <class _Iter1, class _Iter2> |
| 1258 | 1280 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG |
| 1259 | 1281 | bool |
| 1260 | operator>=(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT_DEBUG; | |
| 1282 | operator>=(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT; | |
| 1261 | 1283 | |
| 1262 | 1284 | template <class _Iter1, class _Iter2> |
| 1263 | 1285 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG |
| 1264 | 1286 | bool |
| 1265 | operator<=(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT_DEBUG; | |
| 1287 | operator<=(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT; | |
| 1266 | 1288 | |
| 1267 | 1289 | #ifndef _LIBCPP_CXX03_LANG |
| 1268 | 1290 | template <class _Iter1, class _Iter2> |
| 1269 | 1291 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG |
| 1270 | 1292 | auto |
| 1271 | operator-(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT_DEBUG | |
| 1293 | operator-(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT | |
| 1272 | 1294 | -> decltype(__x.base() - __y.base()); |
| 1273 | 1295 | #else |
| 1274 | 1296 | template <class _Iter1, class _Iter2> |
| 1275 | 1297 | _LIBCPP_INLINE_VISIBILITY |
| 1276 | 1298 | typename __wrap_iter<_Iter1>::difference_type |
| 1277 | operator-(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT_DEBUG; | |
| 1299 | operator-(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT; | |
| 1278 | 1300 | #endif |
| 1279 | 1301 | |
| 1280 | 1302 | template <class _Iter> |
| 1281 | 1303 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG |
| 1282 | 1304 | __wrap_iter<_Iter> |
| 1283 | operator+(typename __wrap_iter<_Iter>::difference_type, __wrap_iter<_Iter>) _NOEXCEPT_DEBUG; | |
| 1305 | operator+(typename __wrap_iter<_Iter>::difference_type, __wrap_iter<_Iter>) _NOEXCEPT; | |
| 1284 | 1306 | |
| 1285 | 1307 | template <class _Ip, class _Op> _Op _LIBCPP_INLINE_VISIBILITY copy(_Ip, _Ip, _Op); |
| 1286 | 1308 | template <class _B1, class _B2> _B2 _LIBCPP_INLINE_VISIBILITY copy_backward(_B1, _B1, _B2); |
| ... | ... | @@ -1324,7 +1346,7 @@ public: |
| 1324 | 1346 | private: |
| 1325 | 1347 | iterator_type __i; |
| 1326 | 1348 | public: |
| 1327 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG __wrap_iter() _NOEXCEPT_DEBUG | |
| 1349 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG __wrap_iter() _NOEXCEPT | |
| 1328 | 1350 | #if _LIBCPP_STD_VER > 11 |
| 1329 | 1351 | : __i{} |
| 1330 | 1352 | #endif |
| ... | ... | @@ -1335,7 +1357,7 @@ public: |
| 1335 | 1357 | } |
| 1336 | 1358 | template <class _Up> _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG |
| 1337 | 1359 | __wrap_iter(const __wrap_iter<_Up>& __u, |
| 1338 | typename enable_if<is_convertible<_Up, iterator_type>::value>::type* = 0) _NOEXCEPT_DEBUG | |
| 1360 | typename enable_if<is_convertible<_Up, iterator_type>::value>::type* = 0) _NOEXCEPT | |
| 1339 | 1361 | : __i(__u.base()) |
| 1340 | 1362 | { |
| 1341 | 1363 | #if _LIBCPP_DEBUG_LEVEL >= 2 |
| ... | ... | @@ -1365,7 +1387,7 @@ public: |
| 1365 | 1387 | __get_db()->__erase_i(this); |
| 1366 | 1388 | } |
| 1367 | 1389 | #endif |
| 1368 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG reference operator*() const _NOEXCEPT_DEBUG | |
| 1390 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG reference operator*() const _NOEXCEPT | |
| 1369 | 1391 | { |
| 1370 | 1392 | #if _LIBCPP_DEBUG_LEVEL >= 2 |
| 1371 | 1393 | _LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this), |
| ... | ... | @@ -1373,7 +1395,7 @@ public: |
| 1373 | 1395 | #endif |
| 1374 | 1396 | return *__i; |
| 1375 | 1397 | } |
| 1376 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG pointer operator->() const _NOEXCEPT_DEBUG | |
| 1398 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG pointer operator->() const _NOEXCEPT | |
| 1377 | 1399 | { |
| 1378 | 1400 | #if _LIBCPP_DEBUG_LEVEL >= 2 |
| 1379 | 1401 | _LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this), |
| ... | ... | @@ -1381,7 +1403,7 @@ public: |
| 1381 | 1403 | #endif |
| 1382 | 1404 | return (pointer)_VSTD::addressof(*__i); |
| 1383 | 1405 | } |
| 1384 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG __wrap_iter& operator++() _NOEXCEPT_DEBUG | |
| 1406 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG __wrap_iter& operator++() _NOEXCEPT | |
| 1385 | 1407 | { |
| 1386 | 1408 | #if _LIBCPP_DEBUG_LEVEL >= 2 |
| 1387 | 1409 | _LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this), |
| ... | ... | @@ -1390,10 +1412,10 @@ public: |
| 1390 | 1412 | ++__i; |
| 1391 | 1413 | return *this; |
| 1392 | 1414 | } |
| 1393 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG __wrap_iter operator++(int) _NOEXCEPT_DEBUG | |
| 1415 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG __wrap_iter operator++(int) _NOEXCEPT | |
| 1394 | 1416 | {__wrap_iter __tmp(*this); ++(*this); return __tmp;} |
| 1395 | 1417 | |
| 1396 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG __wrap_iter& operator--() _NOEXCEPT_DEBUG | |
| 1418 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG __wrap_iter& operator--() _NOEXCEPT | |
| 1397 | 1419 | { |
| 1398 | 1420 | #if _LIBCPP_DEBUG_LEVEL >= 2 |
| 1399 | 1421 | _LIBCPP_ASSERT(__get_const_db()->__decrementable(this), |
| ... | ... | @@ -1402,11 +1424,11 @@ public: |
| 1402 | 1424 | --__i; |
| 1403 | 1425 | return *this; |
| 1404 | 1426 | } |
| 1405 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG __wrap_iter operator--(int) _NOEXCEPT_DEBUG | |
| 1427 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG __wrap_iter operator--(int) _NOEXCEPT | |
| 1406 | 1428 | {__wrap_iter __tmp(*this); --(*this); return __tmp;} |
| 1407 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG __wrap_iter operator+ (difference_type __n) const _NOEXCEPT_DEBUG | |
| 1429 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG __wrap_iter operator+ (difference_type __n) const _NOEXCEPT | |
| 1408 | 1430 | {__wrap_iter __w(*this); __w += __n; return __w;} |
| 1409 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG __wrap_iter& operator+=(difference_type __n) _NOEXCEPT_DEBUG | |
| 1431 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG __wrap_iter& operator+=(difference_type __n) _NOEXCEPT | |
| 1410 | 1432 | { |
| 1411 | 1433 | #if _LIBCPP_DEBUG_LEVEL >= 2 |
| 1412 | 1434 | _LIBCPP_ASSERT(__get_const_db()->__addable(this, __n), |
| ... | ... | @@ -1415,11 +1437,11 @@ public: |
| 1415 | 1437 | __i += __n; |
| 1416 | 1438 | return *this; |
| 1417 | 1439 | } |
| 1418 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG __wrap_iter operator- (difference_type __n) const _NOEXCEPT_DEBUG | |
| 1440 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG __wrap_iter operator- (difference_type __n) const _NOEXCEPT | |
| 1419 | 1441 | {return *this + (-__n);} |
| 1420 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG __wrap_iter& operator-=(difference_type __n) _NOEXCEPT_DEBUG | |
| 1442 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG __wrap_iter& operator-=(difference_type __n) _NOEXCEPT | |
| 1421 | 1443 | {*this += -__n; return *this;} |
| 1422 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG reference operator[](difference_type __n) const _NOEXCEPT_DEBUG | |
| 1444 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG reference operator[](difference_type __n) const _NOEXCEPT | |
| 1423 | 1445 | { |
| 1424 | 1446 | #if _LIBCPP_DEBUG_LEVEL >= 2 |
| 1425 | 1447 | _LIBCPP_ASSERT(__get_const_db()->__subscriptable(this, __n), |
| ... | ... | @@ -1428,7 +1450,7 @@ public: |
| 1428 | 1450 | return __i[__n]; |
| 1429 | 1451 | } |
| 1430 | 1452 | |
| 1431 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG iterator_type base() const _NOEXCEPT_DEBUG {return __i;} | |
| 1453 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG iterator_type base() const _NOEXCEPT {return __i;} | |
| 1432 | 1454 | |
| 1433 | 1455 | private: |
| 1434 | 1456 | #if _LIBCPP_DEBUG_LEVEL >= 2 |
| ... | ... | @@ -1437,61 +1459,61 @@ private: |
| 1437 | 1459 | __get_db()->__insert_ic(this, __p); |
| 1438 | 1460 | } |
| 1439 | 1461 | #else |
| 1440 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG __wrap_iter(iterator_type __x) _NOEXCEPT_DEBUG : __i(__x) {} | |
| 1462 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG __wrap_iter(iterator_type __x) _NOEXCEPT : __i(__x) {} | |
| 1441 | 1463 | #endif |
| 1442 | 1464 | |
| 1443 | 1465 | template <class _Up> friend class __wrap_iter; |
| 1444 | 1466 | template <class _CharT, class _Traits, class _Alloc> friend class basic_string; |
| 1445 | 1467 | template <class _Tp, class _Alloc> friend class _LIBCPP_TEMPLATE_VIS vector; |
| 1446 | template <class _Tp, ptrdiff_t> friend class _LIBCPP_TEMPLATE_VIS span; | |
| 1468 | template <class _Tp, size_t> friend class _LIBCPP_TEMPLATE_VIS span; | |
| 1447 | 1469 | |
| 1448 | 1470 | template <class _Iter1, class _Iter2> |
| 1449 | 1471 | _LIBCPP_CONSTEXPR_IF_NODEBUG friend |
| 1450 | 1472 | bool |
| 1451 | operator==(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT_DEBUG; | |
| 1473 | operator==(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT; | |
| 1452 | 1474 | |
| 1453 | 1475 | template <class _Iter1, class _Iter2> |
| 1454 | 1476 | _LIBCPP_CONSTEXPR_IF_NODEBUG friend |
| 1455 | 1477 | bool |
| 1456 | operator<(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT_DEBUG; | |
| 1478 | operator<(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT; | |
| 1457 | 1479 | |
| 1458 | 1480 | template <class _Iter1, class _Iter2> |
| 1459 | 1481 | _LIBCPP_CONSTEXPR_IF_NODEBUG friend |
| 1460 | 1482 | bool |
| 1461 | operator!=(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT_DEBUG; | |
| 1483 | operator!=(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT; | |
| 1462 | 1484 | |
| 1463 | 1485 | template <class _Iter1, class _Iter2> |
| 1464 | 1486 | _LIBCPP_CONSTEXPR_IF_NODEBUG friend |
| 1465 | 1487 | bool |
| 1466 | operator>(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT_DEBUG; | |
| 1488 | operator>(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT; | |
| 1467 | 1489 | |
| 1468 | 1490 | template <class _Iter1, class _Iter2> |
| 1469 | 1491 | _LIBCPP_CONSTEXPR_IF_NODEBUG friend |
| 1470 | 1492 | bool |
| 1471 | operator>=(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT_DEBUG; | |
| 1493 | operator>=(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT; | |
| 1472 | 1494 | |
| 1473 | 1495 | template <class _Iter1, class _Iter2> |
| 1474 | 1496 | _LIBCPP_CONSTEXPR_IF_NODEBUG friend |
| 1475 | 1497 | bool |
| 1476 | operator<=(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT_DEBUG; | |
| 1498 | operator<=(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT; | |
| 1477 | 1499 | |
| 1478 | 1500 | #ifndef _LIBCPP_CXX03_LANG |
| 1479 | 1501 | template <class _Iter1, class _Iter2> |
| 1480 | 1502 | _LIBCPP_CONSTEXPR_IF_NODEBUG friend |
| 1481 | 1503 | auto |
| 1482 | operator-(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT_DEBUG | |
| 1504 | operator-(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT | |
| 1483 | 1505 | -> decltype(__x.base() - __y.base()); |
| 1484 | 1506 | #else |
| 1485 | 1507 | template <class _Iter1, class _Iter2> |
| 1486 | 1508 | _LIBCPP_CONSTEXPR_IF_NODEBUG friend |
| 1487 | 1509 | typename __wrap_iter<_Iter1>::difference_type |
| 1488 | operator-(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT_DEBUG; | |
| 1510 | operator-(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT; | |
| 1489 | 1511 | #endif |
| 1490 | 1512 | |
| 1491 | 1513 | template <class _Iter1> |
| 1492 | 1514 | _LIBCPP_CONSTEXPR_IF_NODEBUG friend |
| 1493 | 1515 | __wrap_iter<_Iter1> |
| 1494 | operator+(typename __wrap_iter<_Iter1>::difference_type, __wrap_iter<_Iter1>) _NOEXCEPT_DEBUG; | |
| 1516 | operator+(typename __wrap_iter<_Iter1>::difference_type, __wrap_iter<_Iter1>) _NOEXCEPT; | |
| 1495 | 1517 | |
| 1496 | 1518 | template <class _Ip, class _Op> friend _Op copy(_Ip, _Ip, _Op); |
| 1497 | 1519 | template <class _B1, class _B2> friend _B2 copy_backward(_B1, _B1, _B2); |
| ... | ... | @@ -1522,7 +1544,7 @@ private: |
| 1522 | 1544 | template <class _Iter1, class _Iter2> |
| 1523 | 1545 | inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG |
| 1524 | 1546 | bool |
| 1525 | operator==(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT_DEBUG | |
| 1547 | operator==(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT | |
| 1526 | 1548 | { |
| 1527 | 1549 | return __x.base() == __y.base(); |
| 1528 | 1550 | } |
| ... | ... | @@ -1530,7 +1552,7 @@ operator==(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEX |
| 1530 | 1552 | template <class _Iter1, class _Iter2> |
| 1531 | 1553 | inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG |
| 1532 | 1554 | bool |
| 1533 | operator<(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT_DEBUG | |
| 1555 | operator<(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT | |
| 1534 | 1556 | { |
| 1535 | 1557 | #if _LIBCPP_DEBUG_LEVEL >= 2 |
| 1536 | 1558 | _LIBCPP_ASSERT(__get_const_db()->__less_than_comparable(&__x, &__y), |
| ... | ... | @@ -1542,7 +1564,7 @@ operator<(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXC |
| 1542 | 1564 | template <class _Iter1, class _Iter2> |
| 1543 | 1565 | inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG |
| 1544 | 1566 | bool |
| 1545 | operator!=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT_DEBUG | |
| 1567 | operator!=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT | |
| 1546 | 1568 | { |
| 1547 | 1569 | return !(__x == __y); |
| 1548 | 1570 | } |
| ... | ... | @@ -1550,7 +1572,7 @@ operator!=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEX |
| 1550 | 1572 | template <class _Iter1, class _Iter2> |
| 1551 | 1573 | inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG |
| 1552 | 1574 | bool |
| 1553 | operator>(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT_DEBUG | |
| 1575 | operator>(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT | |
| 1554 | 1576 | { |
| 1555 | 1577 | return __y < __x; |
| 1556 | 1578 | } |
| ... | ... | @@ -1558,7 +1580,7 @@ operator>(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXC |
| 1558 | 1580 | template <class _Iter1, class _Iter2> |
| 1559 | 1581 | inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG |
| 1560 | 1582 | bool |
| 1561 | operator>=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT_DEBUG | |
| 1583 | operator>=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT | |
| 1562 | 1584 | { |
| 1563 | 1585 | return !(__x < __y); |
| 1564 | 1586 | } |
| ... | ... | @@ -1566,7 +1588,7 @@ operator>=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEX |
| 1566 | 1588 | template <class _Iter1, class _Iter2> |
| 1567 | 1589 | inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG |
| 1568 | 1590 | bool |
| 1569 | operator<=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT_DEBUG | |
| 1591 | operator<=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT | |
| 1570 | 1592 | { |
| 1571 | 1593 | return !(__y < __x); |
| 1572 | 1594 | } |
| ... | ... | @@ -1574,7 +1596,7 @@ operator<=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEX |
| 1574 | 1596 | template <class _Iter1> |
| 1575 | 1597 | inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG |
| 1576 | 1598 | bool |
| 1577 | operator!=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter1>& __y) _NOEXCEPT_DEBUG | |
| 1599 | operator!=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter1>& __y) _NOEXCEPT | |
| 1578 | 1600 | { |
| 1579 | 1601 | return !(__x == __y); |
| 1580 | 1602 | } |
| ... | ... | @@ -1582,7 +1604,7 @@ operator!=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter1>& __y) _NOEX |
| 1582 | 1604 | template <class _Iter1> |
| 1583 | 1605 | inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG |
| 1584 | 1606 | bool |
| 1585 | operator>(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter1>& __y) _NOEXCEPT_DEBUG | |
| 1607 | operator>(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter1>& __y) _NOEXCEPT | |
| 1586 | 1608 | { |
| 1587 | 1609 | return __y < __x; |
| 1588 | 1610 | } |
| ... | ... | @@ -1590,7 +1612,7 @@ operator>(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter1>& __y) _NOEXC |
| 1590 | 1612 | template <class _Iter1> |
| 1591 | 1613 | inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG |
| 1592 | 1614 | bool |
| 1593 | operator>=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter1>& __y) _NOEXCEPT_DEBUG | |
| 1615 | operator>=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter1>& __y) _NOEXCEPT | |
| 1594 | 1616 | { |
| 1595 | 1617 | return !(__x < __y); |
| 1596 | 1618 | } |
| ... | ... | @@ -1598,7 +1620,7 @@ operator>=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter1>& __y) _NOEX |
| 1598 | 1620 | template <class _Iter1> |
| 1599 | 1621 | inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG |
| 1600 | 1622 | bool |
| 1601 | operator<=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter1>& __y) _NOEXCEPT_DEBUG | |
| 1623 | operator<=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter1>& __y) _NOEXCEPT | |
| 1602 | 1624 | { |
| 1603 | 1625 | return !(__y < __x); |
| 1604 | 1626 | } |
| ... | ... | @@ -1607,7 +1629,7 @@ operator<=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter1>& __y) _NOEX |
| 1607 | 1629 | template <class _Iter1, class _Iter2> |
| 1608 | 1630 | inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG |
| 1609 | 1631 | auto |
| 1610 | operator-(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT_DEBUG | |
| 1632 | operator-(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT | |
| 1611 | 1633 | -> decltype(__x.base() - __y.base()) |
| 1612 | 1634 | { |
| 1613 | 1635 | #if _LIBCPP_DEBUG_LEVEL >= 2 |
| ... | ... | @@ -1620,7 +1642,7 @@ operator-(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXC |
| 1620 | 1642 | template <class _Iter1, class _Iter2> |
| 1621 | 1643 | inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG |
| 1622 | 1644 | typename __wrap_iter<_Iter1>::difference_type |
| 1623 | operator-(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT_DEBUG | |
| 1645 | operator-(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT | |
| 1624 | 1646 | { |
| 1625 | 1647 | #if _LIBCPP_DEBUG_LEVEL >= 2 |
| 1626 | 1648 | _LIBCPP_ASSERT(__get_const_db()->__less_than_comparable(&__x, &__y), |
| ... | ... | @@ -1634,7 +1656,7 @@ template <class _Iter> |
| 1634 | 1656 | inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG |
| 1635 | 1657 | __wrap_iter<_Iter> |
| 1636 | 1658 | operator+(typename __wrap_iter<_Iter>::difference_type __n, |
| 1637 | __wrap_iter<_Iter> __x) _NOEXCEPT_DEBUG | |
| 1659 | __wrap_iter<_Iter> __x) _NOEXCEPT | |
| 1638 | 1660 | { |
| 1639 | 1661 | __x += __n; |
| 1640 | 1662 | return __x; |
| ... | ... | @@ -1643,7 +1665,7 @@ operator+(typename __wrap_iter<_Iter>::difference_type __n, |
| 1643 | 1665 | template <class _Iter> |
| 1644 | 1666 | struct __libcpp_is_trivial_iterator |
| 1645 | 1667 | : public _LIBCPP_BOOL_CONSTANT(is_pointer<_Iter>::value) {}; |
| 1646 | ||
| 1668 | ||
| 1647 | 1669 | template <class _Iter> |
| 1648 | 1670 | struct __libcpp_is_trivial_iterator<move_iterator<_Iter> > |
| 1649 | 1671 | : public _LIBCPP_BOOL_CONSTANT(__libcpp_is_trivial_iterator<_Iter>::value) {}; |
| ... | ... | @@ -1658,7 +1680,7 @@ struct __libcpp_is_trivial_iterator<__wrap_iter<_Iter> > |
| 1658 | 1680 | |
| 1659 | 1681 | |
| 1660 | 1682 | template <class _Tp, size_t _Np> |
| 1661 | inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 | |
| 1683 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 | |
| 1662 | 1684 | _Tp* |
| 1663 | 1685 | begin(_Tp (&__array)[_Np]) |
| 1664 | 1686 | { |
| ... | ... | @@ -1666,7 +1688,7 @@ begin(_Tp (&__array)[_Np]) |
| 1666 | 1688 | } |
| 1667 | 1689 | |
| 1668 | 1690 | template <class _Tp, size_t _Np> |
| 1669 | inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 | |
| 1691 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 | |
| 1670 | 1692 | _Tp* |
| 1671 | 1693 | end(_Tp (&__array)[_Np]) |
| 1672 | 1694 | { |
| ... | ... | @@ -1676,7 +1698,7 @@ end(_Tp (&__array)[_Np]) |
| 1676 | 1698 | #if !defined(_LIBCPP_CXX03_LANG) |
| 1677 | 1699 | |
| 1678 | 1700 | template <class _Cp> |
| 1679 | inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 | |
| 1701 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 | |
| 1680 | 1702 | auto |
| 1681 | 1703 | begin(_Cp& __c) -> decltype(__c.begin()) |
| 1682 | 1704 | { |
| ... | ... | @@ -1684,7 +1706,7 @@ begin(_Cp& __c) -> decltype(__c.begin()) |
| 1684 | 1706 | } |
| 1685 | 1707 | |
| 1686 | 1708 | template <class _Cp> |
| 1687 | inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 | |
| 1709 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 | |
| 1688 | 1710 | auto |
| 1689 | 1711 | begin(const _Cp& __c) -> decltype(__c.begin()) |
| 1690 | 1712 | { |
| ... | ... | @@ -1692,7 +1714,7 @@ begin(const _Cp& __c) -> decltype(__c.begin()) |
| 1692 | 1714 | } |
| 1693 | 1715 | |
| 1694 | 1716 | template <class _Cp> |
| 1695 | inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 | |
| 1717 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 | |
| 1696 | 1718 | auto |
| 1697 | 1719 | end(_Cp& __c) -> decltype(__c.end()) |
| 1698 | 1720 | { |
| ... | ... | @@ -1700,7 +1722,7 @@ end(_Cp& __c) -> decltype(__c.end()) |
| 1700 | 1722 | } |
| 1701 | 1723 | |
| 1702 | 1724 | template <class _Cp> |
| 1703 | inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 | |
| 1725 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 | |
| 1704 | 1726 | auto |
| 1705 | 1727 | end(const _Cp& __c) -> decltype(__c.end()) |
| 1706 | 1728 | { |
| ... | ... | @@ -1710,84 +1732,84 @@ end(const _Cp& __c) -> decltype(__c.end()) |
| 1710 | 1732 | #if _LIBCPP_STD_VER > 11 |
| 1711 | 1733 | |
| 1712 | 1734 | template <class _Tp, size_t _Np> |
| 1713 | inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 | |
| 1735 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 | |
| 1714 | 1736 | reverse_iterator<_Tp*> rbegin(_Tp (&__array)[_Np]) |
| 1715 | 1737 | { |
| 1716 | 1738 | return reverse_iterator<_Tp*>(__array + _Np); |
| 1717 | 1739 | } |
| 1718 | 1740 | |
| 1719 | 1741 | template <class _Tp, size_t _Np> |
| 1720 | inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 | |
| 1742 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 | |
| 1721 | 1743 | reverse_iterator<_Tp*> rend(_Tp (&__array)[_Np]) |
| 1722 | 1744 | { |
| 1723 | 1745 | return reverse_iterator<_Tp*>(__array); |
| 1724 | 1746 | } |
| 1725 | 1747 | |
| 1726 | 1748 | template <class _Ep> |
| 1727 | inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 | |
| 1749 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 | |
| 1728 | 1750 | reverse_iterator<const _Ep*> rbegin(initializer_list<_Ep> __il) |
| 1729 | 1751 | { |
| 1730 | 1752 | return reverse_iterator<const _Ep*>(__il.end()); |
| 1731 | 1753 | } |
| 1732 | 1754 | |
| 1733 | 1755 | template <class _Ep> |
| 1734 | inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 | |
| 1756 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 | |
| 1735 | 1757 | reverse_iterator<const _Ep*> rend(initializer_list<_Ep> __il) |
| 1736 | 1758 | { |
| 1737 | 1759 | return reverse_iterator<const _Ep*>(__il.begin()); |
| 1738 | 1760 | } |
| 1739 | 1761 | |
| 1740 | 1762 | template <class _Cp> |
| 1741 | inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 | |
| 1763 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 | |
| 1742 | 1764 | auto cbegin(const _Cp& __c) -> decltype(_VSTD::begin(__c)) |
| 1743 | 1765 | { |
| 1744 | 1766 | return _VSTD::begin(__c); |
| 1745 | 1767 | } |
| 1746 | 1768 | |
| 1747 | 1769 | template <class _Cp> |
| 1748 | inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 | |
| 1770 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 | |
| 1749 | 1771 | auto cend(const _Cp& __c) -> decltype(_VSTD::end(__c)) |
| 1750 | 1772 | { |
| 1751 | 1773 | return _VSTD::end(__c); |
| 1752 | 1774 | } |
| 1753 | 1775 | |
| 1754 | 1776 | template <class _Cp> |
| 1755 | inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 | |
| 1777 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 | |
| 1756 | 1778 | auto rbegin(_Cp& __c) -> decltype(__c.rbegin()) |
| 1757 | 1779 | { |
| 1758 | 1780 | return __c.rbegin(); |
| 1759 | 1781 | } |
| 1760 | 1782 | |
| 1761 | 1783 | template <class _Cp> |
| 1762 | inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 | |
| 1784 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 | |
| 1763 | 1785 | auto rbegin(const _Cp& __c) -> decltype(__c.rbegin()) |
| 1764 | 1786 | { |
| 1765 | 1787 | return __c.rbegin(); |
| 1766 | 1788 | } |
| 1767 | 1789 | |
| 1768 | 1790 | template <class _Cp> |
| 1769 | inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 | |
| 1791 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 | |
| 1770 | 1792 | auto rend(_Cp& __c) -> decltype(__c.rend()) |
| 1771 | 1793 | { |
| 1772 | 1794 | return __c.rend(); |
| 1773 | 1795 | } |
| 1774 | 1796 | |
| 1775 | 1797 | template <class _Cp> |
| 1776 | inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 | |
| 1798 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 | |
| 1777 | 1799 | auto rend(const _Cp& __c) -> decltype(__c.rend()) |
| 1778 | 1800 | { |
| 1779 | 1801 | return __c.rend(); |
| 1780 | 1802 | } |
| 1781 | 1803 | |
| 1782 | 1804 | template <class _Cp> |
| 1783 | inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 | |
| 1805 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 | |
| 1784 | 1806 | auto crbegin(const _Cp& __c) -> decltype(_VSTD::rbegin(__c)) |
| 1785 | 1807 | { |
| 1786 | 1808 | return _VSTD::rbegin(__c); |
| 1787 | 1809 | } |
| 1788 | 1810 | |
| 1789 | 1811 | template <class _Cp> |
| 1790 | inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 | |
| 1812 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 | |
| 1791 | 1813 | auto crend(const _Cp& __c) -> decltype(_VSTD::rend(__c)) |
| 1792 | 1814 | { |
| 1793 | 1815 | return _VSTD::rend(__c); |
| ... | ... | @@ -1799,7 +1821,7 @@ auto crend(const _Cp& __c) -> decltype(_VSTD::rend(__c)) |
| 1799 | 1821 | #else // defined(_LIBCPP_CXX03_LANG) |
| 1800 | 1822 | |
| 1801 | 1823 | template <class _Cp> |
| 1802 | inline _LIBCPP_INLINE_VISIBILITY | |
| 1824 | _LIBCPP_INLINE_VISIBILITY | |
| 1803 | 1825 | typename _Cp::iterator |
| 1804 | 1826 | begin(_Cp& __c) |
| 1805 | 1827 | { |
| ... | ... | @@ -1807,7 +1829,7 @@ begin(_Cp& __c) |
| 1807 | 1829 | } |
| 1808 | 1830 | |
| 1809 | 1831 | template <class _Cp> |
| 1810 | inline _LIBCPP_INLINE_VISIBILITY | |
| 1832 | _LIBCPP_INLINE_VISIBILITY | |
| 1811 | 1833 | typename _Cp::const_iterator |
| 1812 | 1834 | begin(const _Cp& __c) |
| 1813 | 1835 | { |
| ... | ... | @@ -1815,7 +1837,7 @@ begin(const _Cp& __c) |
| 1815 | 1837 | } |
| 1816 | 1838 | |
| 1817 | 1839 | template <class _Cp> |
| 1818 | inline _LIBCPP_INLINE_VISIBILITY | |
| 1840 | _LIBCPP_INLINE_VISIBILITY | |
| 1819 | 1841 | typename _Cp::iterator |
| 1820 | 1842 | end(_Cp& __c) |
| 1821 | 1843 | { |
| ... | ... | @@ -1823,7 +1845,7 @@ end(_Cp& __c) |
| 1823 | 1845 | } |
| 1824 | 1846 | |
| 1825 | 1847 | template <class _Cp> |
| 1826 | inline _LIBCPP_INLINE_VISIBILITY | |
| 1848 | _LIBCPP_INLINE_VISIBILITY | |
| 1827 | 1849 | typename _Cp::const_iterator |
| 1828 | 1850 | end(const _Cp& __c) |
| 1829 | 1851 | { |
| ... | ... | @@ -1849,51 +1871,64 @@ end(const _Cp& __c) |
| 1849 | 1871 | // #endif |
| 1850 | 1872 | |
| 1851 | 1873 | template <class _Cont> |
| 1852 | inline _LIBCPP_INLINE_VISIBILITY | |
| 1874 | _LIBCPP_INLINE_VISIBILITY | |
| 1853 | 1875 | constexpr auto size(const _Cont& __c) |
| 1854 | 1876 | _NOEXCEPT_(noexcept(__c.size())) |
| 1855 | 1877 | -> decltype (__c.size()) |
| 1856 | 1878 | { return __c.size(); } |
| 1857 | 1879 | |
| 1858 | 1880 | template <class _Tp, size_t _Sz> |
| 1859 | inline _LIBCPP_INLINE_VISIBILITY | |
| 1881 | _LIBCPP_INLINE_VISIBILITY | |
| 1860 | 1882 | constexpr size_t size(const _Tp (&)[_Sz]) noexcept { return _Sz; } |
| 1861 | 1883 | |
| 1884 | #if _LIBCPP_STD_VER > 17 | |
| 1862 | 1885 | template <class _Cont> |
| 1863 | _LIBCPP_NODISCARD_AFTER_CXX17 inline _LIBCPP_INLINE_VISIBILITY | |
| 1886 | _LIBCPP_INLINE_VISIBILITY | |
| 1887 | constexpr auto ssize(const _Cont& __c) | |
| 1888 | _NOEXCEPT_(noexcept(static_cast<common_type_t<ptrdiff_t, make_signed_t<decltype(__c.size())>>>(__c.size()))) | |
| 1889 | -> common_type_t<ptrdiff_t, make_signed_t<decltype(__c.size())>> | |
| 1890 | { return static_cast<common_type_t<ptrdiff_t, make_signed_t<decltype(__c.size())>>>(__c.size()); } | |
| 1891 | ||
| 1892 | template <class _Tp, ptrdiff_t _Sz> | |
| 1893 | _LIBCPP_INLINE_VISIBILITY | |
| 1894 | constexpr ptrdiff_t ssize(const _Tp (&)[_Sz]) noexcept { return _Sz; } | |
| 1895 | #endif | |
| 1896 | ||
| 1897 | template <class _Cont> | |
| 1898 | _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY | |
| 1864 | 1899 | constexpr auto empty(const _Cont& __c) |
| 1865 | 1900 | _NOEXCEPT_(noexcept(__c.empty())) |
| 1866 | 1901 | -> decltype (__c.empty()) |
| 1867 | 1902 | { return __c.empty(); } |
| 1868 | 1903 | |
| 1869 | 1904 | template <class _Tp, size_t _Sz> |
| 1870 | _LIBCPP_NODISCARD_AFTER_CXX17 inline _LIBCPP_INLINE_VISIBILITY | |
| 1905 | _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY | |
| 1871 | 1906 | constexpr bool empty(const _Tp (&)[_Sz]) noexcept { return false; } |
| 1872 | 1907 | |
| 1873 | 1908 | template <class _Ep> |
| 1874 | _LIBCPP_NODISCARD_AFTER_CXX17 inline _LIBCPP_INLINE_VISIBILITY | |
| 1909 | _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY | |
| 1875 | 1910 | constexpr bool empty(initializer_list<_Ep> __il) noexcept { return __il.size() == 0; } |
| 1876 | 1911 | |
| 1877 | 1912 | template <class _Cont> constexpr |
| 1878 | inline _LIBCPP_INLINE_VISIBILITY | |
| 1913 | _LIBCPP_INLINE_VISIBILITY | |
| 1879 | 1914 | auto data(_Cont& __c) |
| 1880 | 1915 | _NOEXCEPT_(noexcept(__c.data())) |
| 1881 | 1916 | -> decltype (__c.data()) |
| 1882 | 1917 | { return __c.data(); } |
| 1883 | 1918 | |
| 1884 | 1919 | template <class _Cont> constexpr |
| 1885 | inline _LIBCPP_INLINE_VISIBILITY | |
| 1920 | _LIBCPP_INLINE_VISIBILITY | |
| 1886 | 1921 | auto data(const _Cont& __c) |
| 1887 | 1922 | _NOEXCEPT_(noexcept(__c.data())) |
| 1888 | -> decltype (__c.data()) | |
| 1923 | -> decltype (__c.data()) | |
| 1889 | 1924 | { return __c.data(); } |
| 1890 | 1925 | |
| 1891 | 1926 | template <class _Tp, size_t _Sz> |
| 1892 | inline _LIBCPP_INLINE_VISIBILITY | |
| 1927 | _LIBCPP_INLINE_VISIBILITY | |
| 1893 | 1928 | constexpr _Tp* data(_Tp (&__array)[_Sz]) noexcept { return __array; } |
| 1894 | 1929 | |
| 1895 | 1930 | template <class _Ep> |
| 1896 | inline _LIBCPP_INLINE_VISIBILITY | |
| 1931 | _LIBCPP_INLINE_VISIBILITY | |
| 1897 | 1932 | constexpr const _Ep* data(initializer_list<_Ep> __il) noexcept { return __il.begin(); } |
| 1898 | 1933 | #endif |
| 1899 | 1934 |
lib/libcxx/include/limits+4-5| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===---------------------------- limits ----------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 | |
| ... | ... | @@ -410,7 +409,7 @@ protected: |
| 410 | 409 | static _LIBCPP_CONSTEXPR const bool is_exact = false; |
| 411 | 410 | static _LIBCPP_CONSTEXPR const int radix = __FLT_RADIX__; |
| 412 | 411 | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type epsilon() _NOEXCEPT {return __LDBL_EPSILON__;} |
| 413 | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type round_error() _NOEXCEPT {return 0.5;} | |
| 412 | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type round_error() _NOEXCEPT {return 0.5L;} | |
| 414 | 413 | |
| 415 | 414 | static _LIBCPP_CONSTEXPR const int min_exponent = __LDBL_MIN_EXP__; |
| 416 | 415 | static _LIBCPP_CONSTEXPR const int min_exponent10 = __LDBL_MIN_10_EXP__; |
lib/libcxx/include/limits.h+3-4| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===--------------------------- limits.h ---------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 |
lib/libcxx/include/list+86-72| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===---------------------------- list ------------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 | |
| ... | ... | @@ -130,11 +129,12 @@ public: |
| 130 | 129 | void splice(const_iterator position, list&& x, const_iterator first, |
| 131 | 130 | const_iterator last); |
| 132 | 131 | |
| 133 | void remove(const value_type& value); | |
| 134 | template <class Pred> void remove_if(Pred pred); | |
| 135 | void unique(); | |
| 132 | size_type remove(const value_type& value); // void before C++20 | |
| 133 | template <class Pred> | |
| 134 | size_type remove_if(Pred pred); // void before C++20 | |
| 135 | size_type unique(); // void before C++20 | |
| 136 | 136 | template <class BinaryPredicate> |
| 137 | void unique(BinaryPredicate binary_pred); | |
| 137 | size_type unique(BinaryPredicate binary_pred); // void before C++20 | |
| 138 | 138 | void merge(list& x); |
| 139 | 139 | void merge(list&& x); |
| 140 | 140 | template <class Compare> |
| ... | ... | @@ -648,9 +648,9 @@ protected: |
| 648 | 648 | |
| 649 | 649 | void swap(__list_imp& __c) |
| 650 | 650 | #if _LIBCPP_STD_VER >= 14 |
| 651 | _NOEXCEPT_DEBUG; | |
| 651 | _NOEXCEPT; | |
| 652 | 652 | #else |
| 653 | _NOEXCEPT_DEBUG_(!__alloc_traits::propagate_on_container_swap::value || | |
| 653 | _NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value || | |
| 654 | 654 | __is_nothrow_swappable<allocator_type>::value); |
| 655 | 655 | #endif |
| 656 | 656 | |
| ... | ... | @@ -770,9 +770,9 @@ template <class _Tp, class _Alloc> |
| 770 | 770 | void |
| 771 | 771 | __list_imp<_Tp, _Alloc>::swap(__list_imp& __c) |
| 772 | 772 | #if _LIBCPP_STD_VER >= 14 |
| 773 | _NOEXCEPT_DEBUG | |
| 773 | _NOEXCEPT | |
| 774 | 774 | #else |
| 775 | _NOEXCEPT_DEBUG_(!__alloc_traits::propagate_on_container_swap::value || | |
| 775 | _NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value || | |
| 776 | 776 | __is_nothrow_swappable<allocator_type>::value) |
| 777 | 777 | #endif |
| 778 | 778 | { |
| ... | ... | @@ -858,6 +858,11 @@ public: |
| 858 | 858 | typedef typename base::const_iterator const_iterator; |
| 859 | 859 | typedef _VSTD::reverse_iterator<iterator> reverse_iterator; |
| 860 | 860 | typedef _VSTD::reverse_iterator<const_iterator> const_reverse_iterator; |
| 861 | #if _LIBCPP_STD_VER > 17 | |
| 862 | typedef size_type __remove_return_type; | |
| 863 | #else | |
| 864 | typedef void __remove_return_type; | |
| 865 | #endif | |
| 861 | 866 | |
| 862 | 867 | _LIBCPP_INLINE_VISIBILITY |
| 863 | 868 | list() |
| ... | ... | @@ -1039,9 +1044,9 @@ public: |
| 1039 | 1044 | _LIBCPP_INLINE_VISIBILITY |
| 1040 | 1045 | void swap(list& __c) |
| 1041 | 1046 | #if _LIBCPP_STD_VER >= 14 |
| 1042 | _NOEXCEPT_DEBUG | |
| 1047 | _NOEXCEPT | |
| 1043 | 1048 | #else |
| 1044 | _NOEXCEPT_DEBUG_(!__node_alloc_traits::propagate_on_container_swap::value || | |
| 1049 | _NOEXCEPT_(!__node_alloc_traits::propagate_on_container_swap::value || | |
| 1045 | 1050 | __is_nothrow_swappable<__node_allocator>::value) |
| 1046 | 1051 | #endif |
| 1047 | 1052 | {base::swap(__c);} |
| ... | ... | @@ -1071,12 +1076,12 @@ public: |
| 1071 | 1076 | void splice(const_iterator __p, list& __c, const_iterator __i); |
| 1072 | 1077 | void splice(const_iterator __p, list& __c, const_iterator __f, const_iterator __l); |
| 1073 | 1078 | |
| 1074 | void remove(const value_type& __x); | |
| 1075 | template <class _Pred> void remove_if(_Pred __pred); | |
| 1079 | __remove_return_type remove(const value_type& __x); | |
| 1080 | template <class _Pred> __remove_return_type remove_if(_Pred __pred); | |
| 1076 | 1081 | _LIBCPP_INLINE_VISIBILITY |
| 1077 | void unique(); | |
| 1082 | __remove_return_type unique() { return unique(__equal_to<value_type>()); } | |
| 1078 | 1083 | template <class _BinaryPred> |
| 1079 | void unique(_BinaryPred __binary_pred); | |
| 1084 | __remove_return_type unique(_BinaryPred __binary_pred); | |
| 1080 | 1085 | _LIBCPP_INLINE_VISIBILITY |
| 1081 | 1086 | void merge(list& __c); |
| 1082 | 1087 | #ifndef _LIBCPP_CXX03_LANG |
| ... | ... | @@ -2014,22 +2019,24 @@ list<_Tp, _Alloc>::splice(const_iterator __p, list& __c) |
| 2014 | 2019 | base::__sz() += __c.__sz(); |
| 2015 | 2020 | __c.__sz() = 0; |
| 2016 | 2021 | #if _LIBCPP_DEBUG_LEVEL >= 2 |
| 2017 | __libcpp_db* __db = __get_db(); | |
| 2018 | __c_node* __cn1 = __db->__find_c_and_lock(this); | |
| 2019 | __c_node* __cn2 = __db->__find_c(&__c); | |
| 2020 | for (__i_node** __ip = __cn2->end_; __ip != __cn2->beg_;) | |
| 2021 | { | |
| 2022 | --__ip; | |
| 2023 | iterator* __i = static_cast<iterator*>((*__ip)->__i_); | |
| 2024 | if (__i->__ptr_ != __c.__end_as_link()) | |
| 2022 | if (&__c != this) { | |
| 2023 | __libcpp_db* __db = __get_db(); | |
| 2024 | __c_node* __cn1 = __db->__find_c_and_lock(this); | |
| 2025 | __c_node* __cn2 = __db->__find_c(&__c); | |
| 2026 | for (__i_node** __ip = __cn2->end_; __ip != __cn2->beg_;) | |
| 2025 | 2027 | { |
| 2026 | __cn1->__add(*__ip); | |
| 2027 | (*__ip)->__c_ = __cn1; | |
| 2028 | if (--__cn2->end_ != __ip) | |
| 2029 | memmove(__ip, __ip+1, (__cn2->end_ - __ip)*sizeof(__i_node*)); | |
| 2028 | --__ip; | |
| 2029 | iterator* __i = static_cast<iterator*>((*__ip)->__i_); | |
| 2030 | if (__i->__ptr_ != __c.__end_as_link()) | |
| 2031 | { | |
| 2032 | __cn1->__add(*__ip); | |
| 2033 | (*__ip)->__c_ = __cn1; | |
| 2034 | if (--__cn2->end_ != __ip) | |
| 2035 | memmove(__ip, __ip+1, (__cn2->end_ - __ip)*sizeof(__i_node*)); | |
| 2036 | } | |
| 2030 | 2037 | } |
| 2038 | __db->unlock(); | |
| 2031 | 2039 | } |
| 2032 | __db->unlock(); | |
| 2033 | 2040 | #endif |
| 2034 | 2041 | } |
| 2035 | 2042 | } |
| ... | ... | @@ -2057,22 +2064,24 @@ list<_Tp, _Alloc>::splice(const_iterator __p, list& __c, const_iterator __i) |
| 2057 | 2064 | --__c.__sz(); |
| 2058 | 2065 | ++base::__sz(); |
| 2059 | 2066 | #if _LIBCPP_DEBUG_LEVEL >= 2 |
| 2060 | __libcpp_db* __db = __get_db(); | |
| 2061 | __c_node* __cn1 = __db->__find_c_and_lock(this); | |
| 2062 | __c_node* __cn2 = __db->__find_c(&__c); | |
| 2063 | for (__i_node** __ip = __cn2->end_; __ip != __cn2->beg_;) | |
| 2064 | { | |
| 2065 | --__ip; | |
| 2066 | iterator* __j = static_cast<iterator*>((*__ip)->__i_); | |
| 2067 | if (__j->__ptr_ == __f) | |
| 2067 | if (&__c != this) { | |
| 2068 | __libcpp_db* __db = __get_db(); | |
| 2069 | __c_node* __cn1 = __db->__find_c_and_lock(this); | |
| 2070 | __c_node* __cn2 = __db->__find_c(&__c); | |
| 2071 | for (__i_node** __ip = __cn2->end_; __ip != __cn2->beg_;) | |
| 2068 | 2072 | { |
| 2069 | __cn1->__add(*__ip); | |
| 2070 | (*__ip)->__c_ = __cn1; | |
| 2071 | if (--__cn2->end_ != __ip) | |
| 2072 | memmove(__ip, __ip+1, (__cn2->end_ - __ip)*sizeof(__i_node*)); | |
| 2073 | --__ip; | |
| 2074 | iterator* __j = static_cast<iterator*>((*__ip)->__i_); | |
| 2075 | if (__j->__ptr_ == __f) | |
| 2076 | { | |
| 2077 | __cn1->__add(*__ip); | |
| 2078 | (*__ip)->__c_ = __cn1; | |
| 2079 | if (--__cn2->end_ != __ip) | |
| 2080 | memmove(__ip, __ip+1, (__cn2->end_ - __ip)*sizeof(__i_node*)); | |
| 2081 | } | |
| 2073 | 2082 | } |
| 2083 | __db->unlock(); | |
| 2074 | 2084 | } |
| 2075 | __db->unlock(); | |
| 2076 | 2085 | #endif |
| 2077 | 2086 | } |
| 2078 | 2087 | } |
| ... | ... | @@ -2111,32 +2120,34 @@ list<_Tp, _Alloc>::splice(const_iterator __p, list& __c, const_iterator __f, con |
| 2111 | 2120 | base::__unlink_nodes(__first, __last); |
| 2112 | 2121 | __link_nodes(__p.__ptr_, __first, __last); |
| 2113 | 2122 | #if _LIBCPP_DEBUG_LEVEL >= 2 |
| 2114 | __libcpp_db* __db = __get_db(); | |
| 2115 | __c_node* __cn1 = __db->__find_c_and_lock(this); | |
| 2116 | __c_node* __cn2 = __db->__find_c(&__c); | |
| 2117 | for (__i_node** __ip = __cn2->end_; __ip != __cn2->beg_;) | |
| 2118 | { | |
| 2119 | --__ip; | |
| 2120 | iterator* __j = static_cast<iterator*>((*__ip)->__i_); | |
| 2121 | for (__link_pointer __k = __f.__ptr_; | |
| 2122 | __k != __l.__ptr_; __k = __k->__next_) | |
| 2123 | if (&__c != this) { | |
| 2124 | __libcpp_db* __db = __get_db(); | |
| 2125 | __c_node* __cn1 = __db->__find_c_and_lock(this); | |
| 2126 | __c_node* __cn2 = __db->__find_c(&__c); | |
| 2127 | for (__i_node** __ip = __cn2->end_; __ip != __cn2->beg_;) | |
| 2123 | 2128 | { |
| 2124 | if (__j->__ptr_ == __k) | |
| 2129 | --__ip; | |
| 2130 | iterator* __j = static_cast<iterator*>((*__ip)->__i_); | |
| 2131 | for (__link_pointer __k = __f.__ptr_; | |
| 2132 | __k != __l.__ptr_; __k = __k->__next_) | |
| 2125 | 2133 | { |
| 2126 | __cn1->__add(*__ip); | |
| 2127 | (*__ip)->__c_ = __cn1; | |
| 2128 | if (--__cn2->end_ != __ip) | |
| 2129 | memmove(__ip, __ip+1, (__cn2->end_ - __ip)*sizeof(__i_node*)); | |
| 2134 | if (__j->__ptr_ == __k) | |
| 2135 | { | |
| 2136 | __cn1->__add(*__ip); | |
| 2137 | (*__ip)->__c_ = __cn1; | |
| 2138 | if (--__cn2->end_ != __ip) | |
| 2139 | memmove(__ip, __ip+1, (__cn2->end_ - __ip)*sizeof(__i_node*)); | |
| 2140 | } | |
| 2130 | 2141 | } |
| 2131 | 2142 | } |
| 2143 | __db->unlock(); | |
| 2132 | 2144 | } |
| 2133 | __db->unlock(); | |
| 2134 | 2145 | #endif |
| 2135 | 2146 | } |
| 2136 | 2147 | } |
| 2137 | 2148 | |
| 2138 | 2149 | template <class _Tp, class _Alloc> |
| 2139 | void | |
| 2150 | typename list<_Tp, _Alloc>::__remove_return_type | |
| 2140 | 2151 | list<_Tp, _Alloc>::remove(const value_type& __x) |
| 2141 | 2152 | { |
| 2142 | 2153 | list<_Tp, _Alloc> __deleted_nodes(get_allocator()); // collect the nodes we're removing |
| ... | ... | @@ -2155,13 +2166,16 @@ list<_Tp, _Alloc>::remove(const value_type& __x) |
| 2155 | 2166 | else |
| 2156 | 2167 | ++__i; |
| 2157 | 2168 | } |
| 2169 | ||
| 2170 | return (__remove_return_type) __deleted_nodes.size(); | |
| 2158 | 2171 | } |
| 2159 | 2172 | |
| 2160 | 2173 | template <class _Tp, class _Alloc> |
| 2161 | 2174 | template <class _Pred> |
| 2162 | void | |
| 2175 | typename list<_Tp, _Alloc>::__remove_return_type | |
| 2163 | 2176 | list<_Tp, _Alloc>::remove_if(_Pred __pred) |
| 2164 | 2177 | { |
| 2178 | list<_Tp, _Alloc> __deleted_nodes(get_allocator()); // collect the nodes we're removing | |
| 2165 | 2179 | for (iterator __i = begin(), __e = end(); __i != __e;) |
| 2166 | 2180 | { |
| 2167 | 2181 | if (__pred(*__i)) |
| ... | ... | @@ -2169,36 +2183,36 @@ list<_Tp, _Alloc>::remove_if(_Pred __pred) |
| 2169 | 2183 | iterator __j = _VSTD::next(__i); |
| 2170 | 2184 | for (; __j != __e && __pred(*__j); ++__j) |
| 2171 | 2185 | ; |
| 2172 | __i = erase(__i, __j); | |
| 2186 | __deleted_nodes.splice(__deleted_nodes.end(), *this, __i, __j); | |
| 2187 | __i = __j; | |
| 2173 | 2188 | if (__i != __e) |
| 2174 | 2189 | ++__i; |
| 2175 | 2190 | } |
| 2176 | 2191 | else |
| 2177 | 2192 | ++__i; |
| 2178 | 2193 | } |
| 2179 | } | |
| 2180 | 2194 | |
| 2181 | template <class _Tp, class _Alloc> | |
| 2182 | inline | |
| 2183 | void | |
| 2184 | list<_Tp, _Alloc>::unique() | |
| 2185 | { | |
| 2186 | unique(__equal_to<value_type>()); | |
| 2195 | return (__remove_return_type) __deleted_nodes.size(); | |
| 2187 | 2196 | } |
| 2188 | 2197 | |
| 2189 | 2198 | template <class _Tp, class _Alloc> |
| 2190 | 2199 | template <class _BinaryPred> |
| 2191 | void | |
| 2200 | typename list<_Tp, _Alloc>::__remove_return_type | |
| 2192 | 2201 | list<_Tp, _Alloc>::unique(_BinaryPred __binary_pred) |
| 2193 | 2202 | { |
| 2203 | list<_Tp, _Alloc> __deleted_nodes(get_allocator()); // collect the nodes we're removing | |
| 2194 | 2204 | for (iterator __i = begin(), __e = end(); __i != __e;) |
| 2195 | 2205 | { |
| 2196 | 2206 | iterator __j = _VSTD::next(__i); |
| 2197 | 2207 | for (; __j != __e && __binary_pred(*__i, *__j); ++__j) |
| 2198 | 2208 | ; |
| 2199 | if (++__i != __j) | |
| 2200 | __i = erase(__i, __j); | |
| 2209 | if (++__i != __j) { | |
| 2210 | __deleted_nodes.splice(__deleted_nodes.end(), *this, __i, __j); | |
| 2211 | __i = __j; | |
| 2212 | } | |
| 2201 | 2213 | } |
| 2214 | ||
| 2215 | return (__remove_return_type) __deleted_nodes.size(); | |
| 2202 | 2216 | } |
| 2203 | 2217 | |
| 2204 | 2218 | template <class _Tp, class _Alloc> |
lib/libcxx/include/locale+7-14| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===-------------------------- locale ------------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 | |
| ... | ... | @@ -127,7 +126,7 @@ public: |
| 127 | 126 | wbuffer_convert(const wbuffer_convert&) = delete; // C++14 |
| 128 | 127 | wbuffer_convert & operator=(const wbuffer_convert &) = delete; // C++14 |
| 129 | 128 | ~wbuffer_convert(); // C++14 |
| 130 | ||
| 129 | ||
| 131 | 130 | streambuf* rdbuf() const; |
| 132 | 131 | streambuf* rdbuf(streambuf* bytebuf); |
| 133 | 132 | |
| ... | ... | @@ -547,7 +546,7 @@ __num_get<_CharT>::__stage2_float_loop(_CharT __ct, bool& __in_units, char& __ex |
| 547 | 546 | __exp = 'P'; |
| 548 | 547 | else if ((__x & 0x5F) == __exp) |
| 549 | 548 | { |
| 550 | __exp |= 0x80; | |
| 549 | __exp |= (char) 0x80; | |
| 551 | 550 | if (__in_units) |
| 552 | 551 | { |
| 553 | 552 | __in_units = false; |
| ... | ... | @@ -1373,10 +1372,6 @@ __pad_and_output(_OutputIterator __s, |
| 1373 | 1372 | return __s; |
| 1374 | 1373 | } |
| 1375 | 1374 | |
| 1376 | #if !defined(__APPLE__) || \ | |
| 1377 | (defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED > __MAC_10_8) || \ | |
| 1378 | (defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && __IPHONE_OS_VERSION_MIN_REQUIRED > __IPHONE_6_0) | |
| 1379 | ||
| 1380 | 1375 | template <class _CharT, class _Traits> |
| 1381 | 1376 | _LIBCPP_HIDDEN |
| 1382 | 1377 | ostreambuf_iterator<_CharT, _Traits> |
| ... | ... | @@ -1423,8 +1418,6 @@ __pad_and_output(ostreambuf_iterator<_CharT, _Traits> __s, |
| 1423 | 1418 | return __s; |
| 1424 | 1419 | } |
| 1425 | 1420 | |
| 1426 | #endif | |
| 1427 | ||
| 1428 | 1421 | template <class _CharT, class _OutputIterator> |
| 1429 | 1422 | _OutputIterator |
| 1430 | 1423 | num_put<_CharT, _OutputIterator>::do_put(iter_type __s, ios_base& __iob, |
| ... | ... | @@ -3930,7 +3923,7 @@ private: |
| 3930 | 3923 | wbuffer_convert(const wbuffer_convert&); |
| 3931 | 3924 | wbuffer_convert& operator=(const wbuffer_convert&); |
| 3932 | 3925 | public: |
| 3933 | _LIBCPP_EXPLICIT_AFTER_CXX11 wbuffer_convert(streambuf* __bytebuf = 0, | |
| 3926 | _LIBCPP_EXPLICIT_AFTER_CXX11 wbuffer_convert(streambuf* __bytebuf = 0, | |
| 3934 | 3927 | _Codecvt* __pcvt = new _Codecvt, state_type __state = state_type()); |
| 3935 | 3928 | ~wbuffer_convert(); |
| 3936 | 3929 | |
| ... | ... | @@ -4045,7 +4038,7 @@ wbuffer_convert<_Codecvt, _Elem, _Tr>::underflow() |
| 4045 | 4038 | this->egptr(), __inext); |
| 4046 | 4039 | if (__r == codecvt_base::noconv) |
| 4047 | 4040 | { |
| 4048 | this->setg((char_type*)__extbuf_, (char_type*)__extbuf_, | |
| 4041 | this->setg((char_type*)__extbuf_, (char_type*)__extbuf_, | |
| 4049 | 4042 | (char_type*) const_cast<char *>(__extbufend_)); |
| 4050 | 4043 | __c = *this->gptr(); |
| 4051 | 4044 | } |
lib/libcxx/include/locale.h+3-4| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===---------------------------- locale.h --------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 |
lib/libcxx/include/map+86-18| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===----------------------------- map ------------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 | |
| ... | ... | @@ -194,8 +193,8 @@ public: |
| 194 | 193 | const_iterator find(const K& x) const; // C++14 |
| 195 | 194 | template<typename K> |
| 196 | 195 | size_type count(const K& x) const; // C++14 |
| 197 | ||
| 198 | 196 | size_type count(const key_type& k) const; |
| 197 | bool contains(const key_type& x) const; // C++20 | |
| 199 | 198 | iterator lower_bound(const key_type& k); |
| 200 | 199 | const_iterator lower_bound(const key_type& k) const; |
| 201 | 200 | template<typename K> |
| ... | ... | @@ -408,8 +407,8 @@ public: |
| 408 | 407 | const_iterator find(const K& x) const; // C++14 |
| 409 | 408 | template<typename K> |
| 410 | 409 | size_type count(const K& x) const; // C++14 |
| 411 | ||
| 412 | 410 | size_type count(const key_type& k) const; |
| 411 | bool contains(const key_type& x) const; // C++20 | |
| 413 | 412 | iterator lower_bound(const key_type& k); |
| 414 | 413 | const_iterator lower_bound(const key_type& k) const; |
| 415 | 414 | template<typename K> |
| ... | ... | @@ -903,12 +902,11 @@ public: |
| 903 | 902 | typedef _Key key_type; |
| 904 | 903 | typedef _Tp mapped_type; |
| 905 | 904 | typedef pair<const key_type, mapped_type> value_type; |
| 906 | typedef _Compare key_compare; | |
| 907 | typedef _Allocator allocator_type; | |
| 905 | typedef typename __identity<_Compare>::type key_compare; | |
| 906 | typedef typename __identity<_Allocator>::type allocator_type; | |
| 908 | 907 | typedef value_type& reference; |
| 909 | 908 | typedef const value_type& const_reference; |
| 910 | 909 | |
| 911 | static_assert(sizeof(__diagnose_non_const_comparator<_Key, _Compare>()), ""); | |
| 912 | 910 | static_assert((is_same<typename allocator_type::value_type, value_type>::value), |
| 913 | 911 | "Allocator::value_type must be same type as value_type"); |
| 914 | 912 | |
| ... | ... | @@ -1086,6 +1084,11 @@ public: |
| 1086 | 1084 | insert(__m.begin(), __m.end()); |
| 1087 | 1085 | } |
| 1088 | 1086 | |
| 1087 | _LIBCPP_INLINE_VISIBILITY | |
| 1088 | ~map() { | |
| 1089 | static_assert(sizeof(__diagnose_non_const_comparator<_Key, _Compare>()), ""); | |
| 1090 | } | |
| 1091 | ||
| 1089 | 1092 | _LIBCPP_INLINE_VISIBILITY |
| 1090 | 1093 | iterator begin() _NOEXCEPT {return __tree_.begin();} |
| 1091 | 1094 | _LIBCPP_INLINE_VISIBILITY |
| ... | ... | @@ -1395,6 +1398,12 @@ public: |
| 1395 | 1398 | typename enable_if<__is_transparent<_Compare, _K2>::value,size_type>::type |
| 1396 | 1399 | count(const _K2& __k) const {return __tree_.__count_multi(__k);} |
| 1397 | 1400 | #endif |
| 1401 | ||
| 1402 | #if _LIBCPP_STD_VER > 17 | |
| 1403 | _LIBCPP_INLINE_VISIBILITY | |
| 1404 | bool contains(const key_type& __k) const {return find(__k) != end();} | |
| 1405 | #endif // _LIBCPP_STD_VER > 17 | |
| 1406 | ||
| 1398 | 1407 | _LIBCPP_INLINE_VISIBILITY |
| 1399 | 1408 | iterator lower_bound(const key_type& __k) |
| 1400 | 1409 | {return __tree_.lower_bound(__k);} |
| ... | ... | @@ -1462,6 +1471,32 @@ private: |
| 1462 | 1471 | #endif |
| 1463 | 1472 | }; |
| 1464 | 1473 | |
| 1474 | #ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES | |
| 1475 | template<class _InputIterator, class _Compare = less<__iter_key_type<_InputIterator>>, | |
| 1476 | class _Allocator = allocator<__iter_to_alloc_type<_InputIterator>>, | |
| 1477 | class = enable_if_t<!__is_allocator<_Compare>::value, void>, | |
| 1478 | class = enable_if_t<__is_allocator<_Allocator>::value, void>> | |
| 1479 | map(_InputIterator, _InputIterator, _Compare = _Compare(), _Allocator = _Allocator()) | |
| 1480 | -> map<__iter_key_type<_InputIterator>, __iter_mapped_type<_InputIterator>, _Compare, _Allocator>; | |
| 1481 | ||
| 1482 | template<class _Key, class _Tp, class _Compare = less<remove_const_t<_Key>>, | |
| 1483 | class _Allocator = allocator<pair<const _Key, _Tp>>, | |
| 1484 | class = enable_if_t<!__is_allocator<_Compare>::value, void>, | |
| 1485 | class = enable_if_t<__is_allocator<_Allocator>::value, void>> | |
| 1486 | map(initializer_list<pair<_Key, _Tp>>, _Compare = _Compare(), _Allocator = _Allocator()) | |
| 1487 | -> map<remove_const_t<_Key>, _Tp, _Compare, _Allocator>; | |
| 1488 | ||
| 1489 | template<class _InputIterator, class _Allocator, | |
| 1490 | class = enable_if_t<__is_allocator<_Allocator>::value, void>> | |
| 1491 | map(_InputIterator, _InputIterator, _Allocator) | |
| 1492 | -> map<__iter_key_type<_InputIterator>, __iter_mapped_type<_InputIterator>, | |
| 1493 | less<__iter_key_type<_InputIterator>>, _Allocator>; | |
| 1494 | ||
| 1495 | template<class _Key, class _Tp, class _Allocator, | |
| 1496 | class = enable_if_t<__is_allocator<_Allocator>::value, void>> | |
| 1497 | map(initializer_list<pair<_Key, _Tp>>, _Allocator) | |
| 1498 | -> map<remove_const_t<_Key>, _Tp, less<remove_const_t<_Key>>, _Allocator>; | |
| 1499 | #endif | |
| 1465 | 1500 | |
| 1466 | 1501 | #ifndef _LIBCPP_CXX03_LANG |
| 1467 | 1502 | template <class _Key, class _Tp, class _Compare, class _Allocator> |
| ... | ... | @@ -1536,10 +1571,8 @@ map<_Key, _Tp, _Compare, _Allocator>::at(const key_type& __k) |
| 1536 | 1571 | { |
| 1537 | 1572 | __parent_pointer __parent; |
| 1538 | 1573 | __node_base_pointer& __child = __tree_.__find_equal(__parent, __k); |
| 1539 | #ifndef _LIBCPP_NO_EXCEPTIONS | |
| 1540 | 1574 | if (__child == nullptr) |
| 1541 | throw out_of_range("map::at: key not found"); | |
| 1542 | #endif // _LIBCPP_NO_EXCEPTIONS | |
| 1575 | __throw_out_of_range("map::at: key not found"); | |
| 1543 | 1576 | return static_cast<__node_pointer>(__child)->__value_.__get_value().second; |
| 1544 | 1577 | } |
| 1545 | 1578 | |
| ... | ... | @@ -1549,10 +1582,8 @@ map<_Key, _Tp, _Compare, _Allocator>::at(const key_type& __k) const |
| 1549 | 1582 | { |
| 1550 | 1583 | __parent_pointer __parent; |
| 1551 | 1584 | __node_base_pointer __child = __tree_.__find_equal(__parent, __k); |
| 1552 | #ifndef _LIBCPP_NO_EXCEPTIONS | |
| 1553 | 1585 | if (__child == nullptr) |
| 1554 | throw out_of_range("map::at: key not found"); | |
| 1555 | #endif // _LIBCPP_NO_EXCEPTIONS | |
| 1586 | __throw_out_of_range("map::at: key not found"); | |
| 1556 | 1587 | return static_cast<__node_pointer>(__child)->__value_.__get_value().second; |
| 1557 | 1588 | } |
| 1558 | 1589 | |
| ... | ... | @@ -1638,12 +1669,11 @@ public: |
| 1638 | 1669 | typedef _Key key_type; |
| 1639 | 1670 | typedef _Tp mapped_type; |
| 1640 | 1671 | typedef pair<const key_type, mapped_type> value_type; |
| 1641 | typedef _Compare key_compare; | |
| 1642 | typedef _Allocator allocator_type; | |
| 1672 | typedef typename __identity<_Compare>::type key_compare; | |
| 1673 | typedef typename __identity<_Allocator>::type allocator_type; | |
| 1643 | 1674 | typedef value_type& reference; |
| 1644 | 1675 | typedef const value_type& const_reference; |
| 1645 | 1676 | |
| 1646 | static_assert(sizeof(__diagnose_non_const_comparator<_Key, _Compare>()), ""); | |
| 1647 | 1677 | static_assert((is_same<typename allocator_type::value_type, value_type>::value), |
| 1648 | 1678 | "Allocator::value_type must be same type as value_type"); |
| 1649 | 1679 | |
| ... | ... | @@ -1822,6 +1852,11 @@ public: |
| 1822 | 1852 | insert(__m.begin(), __m.end()); |
| 1823 | 1853 | } |
| 1824 | 1854 | |
| 1855 | _LIBCPP_INLINE_VISIBILITY | |
| 1856 | ~multimap() { | |
| 1857 | static_assert(sizeof(__diagnose_non_const_comparator<_Key, _Compare>()), ""); | |
| 1858 | } | |
| 1859 | ||
| 1825 | 1860 | _LIBCPP_INLINE_VISIBILITY |
| 1826 | 1861 | iterator begin() _NOEXCEPT {return __tree_.begin();} |
| 1827 | 1862 | _LIBCPP_INLINE_VISIBILITY |
| ... | ... | @@ -2026,6 +2061,12 @@ public: |
| 2026 | 2061 | typename enable_if<__is_transparent<_Compare, _K2>::value,size_type>::type |
| 2027 | 2062 | count(const _K2& __k) const {return __tree_.__count_multi(__k);} |
| 2028 | 2063 | #endif |
| 2064 | ||
| 2065 | #if _LIBCPP_STD_VER > 17 | |
| 2066 | _LIBCPP_INLINE_VISIBILITY | |
| 2067 | bool contains(const key_type& __k) const {return find(__k) != end();} | |
| 2068 | #endif // _LIBCPP_STD_VER > 17 | |
| 2069 | ||
| 2029 | 2070 | _LIBCPP_INLINE_VISIBILITY |
| 2030 | 2071 | iterator lower_bound(const key_type& __k) |
| 2031 | 2072 | {return __tree_.lower_bound(__k);} |
| ... | ... | @@ -2087,6 +2128,33 @@ private: |
| 2087 | 2128 | typedef unique_ptr<__node, _Dp> __node_holder; |
| 2088 | 2129 | }; |
| 2089 | 2130 | |
| 2131 | #ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES | |
| 2132 | template<class _InputIterator, class _Compare = less<__iter_key_type<_InputIterator>>, | |
| 2133 | class _Allocator = allocator<__iter_to_alloc_type<_InputIterator>>, | |
| 2134 | class = enable_if_t<!__is_allocator<_Compare>::value, void>, | |
| 2135 | class = enable_if_t<__is_allocator<_Allocator>::value, void>> | |
| 2136 | multimap(_InputIterator, _InputIterator, _Compare = _Compare(), _Allocator = _Allocator()) | |
| 2137 | -> multimap<__iter_key_type<_InputIterator>, __iter_mapped_type<_InputIterator>, _Compare, _Allocator>; | |
| 2138 | ||
| 2139 | template<class _Key, class _Tp, class _Compare = less<remove_const_t<_Key>>, | |
| 2140 | class _Allocator = allocator<pair<const _Key, _Tp>>, | |
| 2141 | class = enable_if_t<!__is_allocator<_Compare>::value, void>, | |
| 2142 | class = enable_if_t<__is_allocator<_Allocator>::value, void>> | |
| 2143 | multimap(initializer_list<pair<_Key, _Tp>>, _Compare = _Compare(), _Allocator = _Allocator()) | |
| 2144 | -> multimap<remove_const_t<_Key>, _Tp, _Compare, _Allocator>; | |
| 2145 | ||
| 2146 | template<class _InputIterator, class _Allocator, | |
| 2147 | class = enable_if_t<__is_allocator<_Allocator>::value, void>> | |
| 2148 | multimap(_InputIterator, _InputIterator, _Allocator) | |
| 2149 | -> multimap<__iter_key_type<_InputIterator>, __iter_mapped_type<_InputIterator>, | |
| 2150 | less<__iter_key_type<_InputIterator>>, _Allocator>; | |
| 2151 | ||
| 2152 | template<class _Key, class _Tp, class _Allocator, | |
| 2153 | class = enable_if_t<__is_allocator<_Allocator>::value, void>> | |
| 2154 | multimap(initializer_list<pair<_Key, _Tp>>, _Allocator) | |
| 2155 | -> multimap<remove_const_t<_Key>, _Tp, less<remove_const_t<_Key>>, _Allocator>; | |
| 2156 | #endif | |
| 2157 | ||
| 2090 | 2158 | #ifndef _LIBCPP_CXX03_LANG |
| 2091 | 2159 | template <class _Key, class _Tp, class _Compare, class _Allocator> |
| 2092 | 2160 | multimap<_Key, _Tp, _Compare, _Allocator>::multimap(multimap&& __m, const allocator_type& __a) |
lib/libcxx/include/math.h+93-50| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===---------------------------- math.h ----------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 | |
| ... | ... | @@ -298,6 +297,9 @@ long double truncl(long double x); |
| 298 | 297 | #pragma GCC system_header |
| 299 | 298 | #endif |
| 300 | 299 | |
| 300 | #define _LIBCPP_STDLIB_INCLUDE_NEXT | |
| 301 | #include <stdlib.h> | |
| 302 | ||
| 301 | 303 | #include_next <math.h> |
| 302 | 304 | |
| 303 | 305 | #ifdef __cplusplus |
| ... | ... | @@ -755,20 +757,61 @@ isunordered(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT |
| 755 | 757 | |
| 756 | 758 | // abs |
| 757 | 759 | |
| 760 | #undef abs | |
| 761 | #undef labs | |
| 762 | #ifndef _LIBCPP_HAS_NO_LONG_LONG | |
| 763 | #undef llabs | |
| 764 | #endif | |
| 765 | ||
| 766 | // MSVCRT already has the correct prototype in <stdlib.h> if __cplusplus is defined | |
| 767 | #if !defined(_LIBCPP_MSVCRT) && !defined(__sun__) && !defined(_AIX) | |
| 768 | inline _LIBCPP_INLINE_VISIBILITY long abs(long __x) _NOEXCEPT { | |
| 769 | return ::labs(__x); | |
| 770 | } | |
| 771 | #ifndef _LIBCPP_HAS_NO_LONG_LONG | |
| 772 | inline _LIBCPP_INLINE_VISIBILITY long long abs(long long __x) _NOEXCEPT { | |
| 773 | return ::llabs(__x); | |
| 774 | } | |
| 775 | #endif // _LIBCPP_HAS_NO_LONG_LONG | |
| 776 | #endif // !defined(_LIBCPP_MSVCRT) && !defined(__sun__) && !defined(_AIX) | |
| 777 | ||
| 778 | ||
| 758 | 779 | #if !(defined(_AIX) || defined(__sun__)) |
| 759 | inline _LIBCPP_INLINE_VISIBILITY | |
| 760 | float | |
| 761 | abs(float __lcpp_x) _NOEXCEPT {return ::fabsf(__lcpp_x);} | |
| 780 | inline _LIBCPP_INLINE_VISIBILITY float abs(float __lcpp_x) _NOEXCEPT { | |
| 781 | return ::fabsf(__lcpp_x); | |
| 782 | } | |
| 762 | 783 | |
| 763 | inline _LIBCPP_INLINE_VISIBILITY | |
| 764 | double | |
| 765 | abs(double __lcpp_x) _NOEXCEPT {return ::fabs(__lcpp_x);} | |
| 784 | inline _LIBCPP_INLINE_VISIBILITY double abs(double __lcpp_x) _NOEXCEPT { | |
| 785 | return ::fabs(__lcpp_x); | |
| 786 | } | |
| 766 | 787 | |
| 767 | inline _LIBCPP_INLINE_VISIBILITY | |
| 768 | long double | |
| 769 | abs(long double __lcpp_x) _NOEXCEPT {return ::fabsl(__lcpp_x);} | |
| 788 | inline _LIBCPP_INLINE_VISIBILITY long double | |
| 789 | abs(long double __lcpp_x) _NOEXCEPT { | |
| 790 | return ::fabsl(__lcpp_x); | |
| 791 | } | |
| 770 | 792 | #endif // !(defined(_AIX) || defined(__sun__)) |
| 771 | 793 | |
| 794 | // div | |
| 795 | ||
| 796 | #undef div | |
| 797 | #undef ldiv | |
| 798 | #ifndef _LIBCPP_HAS_NO_LONG_LONG | |
| 799 | #undef lldiv | |
| 800 | #endif | |
| 801 | ||
| 802 | // MSVCRT already has the correct prototype in <stdlib.h> if __cplusplus is defined | |
| 803 | #if !defined(_LIBCPP_MSVCRT) && !defined(__sun__) && !defined(_AIX) | |
| 804 | inline _LIBCPP_INLINE_VISIBILITY ldiv_t div(long __x, long __y) _NOEXCEPT { | |
| 805 | return ::ldiv(__x, __y); | |
| 806 | } | |
| 807 | #ifndef _LIBCPP_HAS_NO_LONG_LONG | |
| 808 | inline _LIBCPP_INLINE_VISIBILITY lldiv_t div(long long __x, | |
| 809 | long long __y) _NOEXCEPT { | |
| 810 | return ::lldiv(__x, __y); | |
| 811 | } | |
| 812 | #endif // _LIBCPP_HAS_NO_LONG_LONG | |
| 813 | #endif // _LIBCPP_MSVCRT / __sun__ / _AIX | |
| 814 | ||
| 772 | 815 | // acos |
| 773 | 816 | |
| 774 | 817 | #if !(defined(_AIX) || defined(__sun__)) |
| ... | ... | @@ -814,7 +857,7 @@ inline _LIBCPP_INLINE_VISIBILITY long double atan2(long double __lcpp_y, long do |
| 814 | 857 | |
| 815 | 858 | template <class _A1, class _A2> |
| 816 | 859 | inline _LIBCPP_INLINE_VISIBILITY |
| 817 | typename std::__lazy_enable_if | |
| 860 | typename std::_EnableIf | |
| 818 | 861 | < |
| 819 | 862 | std::is_arithmetic<_A1>::value && |
| 820 | 863 | std::is_arithmetic<_A2>::value, |
| ... | ... | @@ -823,8 +866,8 @@ typename std::__lazy_enable_if |
| 823 | 866 | atan2(_A1 __lcpp_y, _A2 __lcpp_x) _NOEXCEPT |
| 824 | 867 | { |
| 825 | 868 | typedef typename std::__promote<_A1, _A2>::type __result_type; |
| 826 | static_assert((!(std::is_same<_A1, __result_type>::value && | |
| 827 | std::is_same<_A2, __result_type>::value)), ""); | |
| 869 | static_assert((!(std::_IsSame<_A1, __result_type>::value && | |
| 870 | std::_IsSame<_A2, __result_type>::value)), ""); | |
| 828 | 871 | return ::atan2((__result_type)__lcpp_y, (__result_type)__lcpp_x); |
| 829 | 872 | } |
| 830 | 873 | |
| ... | ... | @@ -909,7 +952,7 @@ inline _LIBCPP_INLINE_VISIBILITY long double fmod(long double __lcpp_x, long dou |
| 909 | 952 | |
| 910 | 953 | template <class _A1, class _A2> |
| 911 | 954 | inline _LIBCPP_INLINE_VISIBILITY |
| 912 | typename std::__lazy_enable_if | |
| 955 | typename std::_EnableIf | |
| 913 | 956 | < |
| 914 | 957 | std::is_arithmetic<_A1>::value && |
| 915 | 958 | std::is_arithmetic<_A2>::value, |
| ... | ... | @@ -918,8 +961,8 @@ typename std::__lazy_enable_if |
| 918 | 961 | fmod(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT |
| 919 | 962 | { |
| 920 | 963 | typedef typename std::__promote<_A1, _A2>::type __result_type; |
| 921 | static_assert((!(std::is_same<_A1, __result_type>::value && | |
| 922 | std::is_same<_A2, __result_type>::value)), ""); | |
| 964 | static_assert((!(std::_IsSame<_A1, __result_type>::value && | |
| 965 | std::_IsSame<_A2, __result_type>::value)), ""); | |
| 923 | 966 | return ::fmod((__result_type)__lcpp_x, (__result_type)__lcpp_y); |
| 924 | 967 | } |
| 925 | 968 | |
| ... | ... | @@ -987,7 +1030,7 @@ inline _LIBCPP_INLINE_VISIBILITY long double pow(long double __lcpp_x, long doub |
| 987 | 1030 | |
| 988 | 1031 | template <class _A1, class _A2> |
| 989 | 1032 | inline _LIBCPP_INLINE_VISIBILITY |
| 990 | typename std::__lazy_enable_if | |
| 1033 | typename std::_EnableIf | |
| 991 | 1034 | < |
| 992 | 1035 | std::is_arithmetic<_A1>::value && |
| 993 | 1036 | std::is_arithmetic<_A2>::value, |
| ... | ... | @@ -996,8 +1039,8 @@ typename std::__lazy_enable_if |
| 996 | 1039 | pow(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT |
| 997 | 1040 | { |
| 998 | 1041 | typedef typename std::__promote<_A1, _A2>::type __result_type; |
| 999 | static_assert((!(std::is_same<_A1, __result_type>::value && | |
| 1000 | std::is_same<_A2, __result_type>::value)), ""); | |
| 1042 | static_assert((!(std::_IsSame<_A1, __result_type>::value && | |
| 1043 | std::_IsSame<_A2, __result_type>::value)), ""); | |
| 1001 | 1044 | return ::pow((__result_type)__lcpp_x, (__result_type)__lcpp_y); |
| 1002 | 1045 | } |
| 1003 | 1046 | |
| ... | ... | @@ -1114,7 +1157,7 @@ copysign(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT { |
| 1114 | 1157 | |
| 1115 | 1158 | template <class _A1, class _A2> |
| 1116 | 1159 | inline _LIBCPP_INLINE_VISIBILITY |
| 1117 | typename std::__lazy_enable_if | |
| 1160 | typename std::_EnableIf | |
| 1118 | 1161 | < |
| 1119 | 1162 | std::is_arithmetic<_A1>::value && |
| 1120 | 1163 | std::is_arithmetic<_A2>::value, |
| ... | ... | @@ -1123,8 +1166,8 @@ typename std::__lazy_enable_if |
| 1123 | 1166 | copysign(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT |
| 1124 | 1167 | { |
| 1125 | 1168 | typedef typename std::__promote<_A1, _A2>::type __result_type; |
| 1126 | static_assert((!(std::is_same<_A1, __result_type>::value && | |
| 1127 | std::is_same<_A2, __result_type>::value)), ""); | |
| 1169 | static_assert((!(std::_IsSame<_A1, __result_type>::value && | |
| 1170 | std::_IsSame<_A2, __result_type>::value)), ""); | |
| 1128 | 1171 | return ::copysign((__result_type)__lcpp_x, (__result_type)__lcpp_y); |
| 1129 | 1172 | } |
| 1130 | 1173 | |
| ... | ... | @@ -1175,7 +1218,7 @@ inline _LIBCPP_INLINE_VISIBILITY long double fdim(long double __lcpp_x, long dou |
| 1175 | 1218 | |
| 1176 | 1219 | template <class _A1, class _A2> |
| 1177 | 1220 | inline _LIBCPP_INLINE_VISIBILITY |
| 1178 | typename std::__lazy_enable_if | |
| 1221 | typename std::_EnableIf | |
| 1179 | 1222 | < |
| 1180 | 1223 | std::is_arithmetic<_A1>::value && |
| 1181 | 1224 | std::is_arithmetic<_A2>::value, |
| ... | ... | @@ -1184,8 +1227,8 @@ typename std::__lazy_enable_if |
| 1184 | 1227 | fdim(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT |
| 1185 | 1228 | { |
| 1186 | 1229 | typedef typename std::__promote<_A1, _A2>::type __result_type; |
| 1187 | static_assert((!(std::is_same<_A1, __result_type>::value && | |
| 1188 | std::is_same<_A2, __result_type>::value)), ""); | |
| 1230 | static_assert((!(std::_IsSame<_A1, __result_type>::value && | |
| 1231 | std::_IsSame<_A2, __result_type>::value)), ""); | |
| 1189 | 1232 | return ::fdim((__result_type)__lcpp_x, (__result_type)__lcpp_y); |
| 1190 | 1233 | } |
| 1191 | 1234 | |
| ... | ... | @@ -1196,7 +1239,7 @@ inline _LIBCPP_INLINE_VISIBILITY long double fma(long double __lcpp_x, long doub |
| 1196 | 1239 | |
| 1197 | 1240 | template <class _A1, class _A2, class _A3> |
| 1198 | 1241 | inline _LIBCPP_INLINE_VISIBILITY |
| 1199 | typename std::__lazy_enable_if | |
| 1242 | typename std::_EnableIf | |
| 1200 | 1243 | < |
| 1201 | 1244 | std::is_arithmetic<_A1>::value && |
| 1202 | 1245 | std::is_arithmetic<_A2>::value && |
| ... | ... | @@ -1206,9 +1249,9 @@ typename std::__lazy_enable_if |
| 1206 | 1249 | fma(_A1 __lcpp_x, _A2 __lcpp_y, _A3 __lcpp_z) _NOEXCEPT |
| 1207 | 1250 | { |
| 1208 | 1251 | typedef typename std::__promote<_A1, _A2, _A3>::type __result_type; |
| 1209 | static_assert((!(std::is_same<_A1, __result_type>::value && | |
| 1210 | std::is_same<_A2, __result_type>::value && | |
| 1211 | std::is_same<_A3, __result_type>::value)), ""); | |
| 1252 | static_assert((!(std::_IsSame<_A1, __result_type>::value && | |
| 1253 | std::_IsSame<_A2, __result_type>::value && | |
| 1254 | std::_IsSame<_A3, __result_type>::value)), ""); | |
| 1212 | 1255 | return ::fma((__result_type)__lcpp_x, (__result_type)__lcpp_y, (__result_type)__lcpp_z); |
| 1213 | 1256 | } |
| 1214 | 1257 | |
| ... | ... | @@ -1219,7 +1262,7 @@ inline _LIBCPP_INLINE_VISIBILITY long double fmax(long double __lcpp_x, long dou |
| 1219 | 1262 | |
| 1220 | 1263 | template <class _A1, class _A2> |
| 1221 | 1264 | inline _LIBCPP_INLINE_VISIBILITY |
| 1222 | typename std::__lazy_enable_if | |
| 1265 | typename std::_EnableIf | |
| 1223 | 1266 | < |
| 1224 | 1267 | std::is_arithmetic<_A1>::value && |
| 1225 | 1268 | std::is_arithmetic<_A2>::value, |
| ... | ... | @@ -1228,8 +1271,8 @@ typename std::__lazy_enable_if |
| 1228 | 1271 | fmax(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT |
| 1229 | 1272 | { |
| 1230 | 1273 | typedef typename std::__promote<_A1, _A2>::type __result_type; |
| 1231 | static_assert((!(std::is_same<_A1, __result_type>::value && | |
| 1232 | std::is_same<_A2, __result_type>::value)), ""); | |
| 1274 | static_assert((!(std::_IsSame<_A1, __result_type>::value && | |
| 1275 | std::_IsSame<_A2, __result_type>::value)), ""); | |
| 1233 | 1276 | return ::fmax((__result_type)__lcpp_x, (__result_type)__lcpp_y); |
| 1234 | 1277 | } |
| 1235 | 1278 | |
| ... | ... | @@ -1240,7 +1283,7 @@ inline _LIBCPP_INLINE_VISIBILITY long double fmin(long double __lcpp_x, long dou |
| 1240 | 1283 | |
| 1241 | 1284 | template <class _A1, class _A2> |
| 1242 | 1285 | inline _LIBCPP_INLINE_VISIBILITY |
| 1243 | typename std::__lazy_enable_if | |
| 1286 | typename std::_EnableIf | |
| 1244 | 1287 | < |
| 1245 | 1288 | std::is_arithmetic<_A1>::value && |
| 1246 | 1289 | std::is_arithmetic<_A2>::value, |
| ... | ... | @@ -1249,8 +1292,8 @@ typename std::__lazy_enable_if |
| 1249 | 1292 | fmin(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT |
| 1250 | 1293 | { |
| 1251 | 1294 | typedef typename std::__promote<_A1, _A2>::type __result_type; |
| 1252 | static_assert((!(std::is_same<_A1, __result_type>::value && | |
| 1253 | std::is_same<_A2, __result_type>::value)), ""); | |
| 1295 | static_assert((!(std::_IsSame<_A1, __result_type>::value && | |
| 1296 | std::_IsSame<_A2, __result_type>::value)), ""); | |
| 1254 | 1297 | return ::fmin((__result_type)__lcpp_x, (__result_type)__lcpp_y); |
| 1255 | 1298 | } |
| 1256 | 1299 | |
| ... | ... | @@ -1261,7 +1304,7 @@ inline _LIBCPP_INLINE_VISIBILITY long double hypot(long double __lcpp_x, long do |
| 1261 | 1304 | |
| 1262 | 1305 | template <class _A1, class _A2> |
| 1263 | 1306 | inline _LIBCPP_INLINE_VISIBILITY |
| 1264 | typename std::__lazy_enable_if | |
| 1307 | typename std::_EnableIf | |
| 1265 | 1308 | < |
| 1266 | 1309 | std::is_arithmetic<_A1>::value && |
| 1267 | 1310 | std::is_arithmetic<_A2>::value, |
| ... | ... | @@ -1270,8 +1313,8 @@ typename std::__lazy_enable_if |
| 1270 | 1313 | hypot(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT |
| 1271 | 1314 | { |
| 1272 | 1315 | typedef typename std::__promote<_A1, _A2>::type __result_type; |
| 1273 | static_assert((!(std::is_same<_A1, __result_type>::value && | |
| 1274 | std::is_same<_A2, __result_type>::value)), ""); | |
| 1316 | static_assert((!(std::_IsSame<_A1, __result_type>::value && | |
| 1317 | std::_IsSame<_A2, __result_type>::value)), ""); | |
| 1275 | 1318 | return ::hypot((__result_type)__lcpp_x, (__result_type)__lcpp_y); |
| 1276 | 1319 | } |
| 1277 | 1320 | |
| ... | ... | @@ -1384,7 +1427,7 @@ inline _LIBCPP_INLINE_VISIBILITY long double nextafter(long double __lcpp_x, lon |
| 1384 | 1427 | |
| 1385 | 1428 | template <class _A1, class _A2> |
| 1386 | 1429 | inline _LIBCPP_INLINE_VISIBILITY |
| 1387 | typename std::__lazy_enable_if | |
| 1430 | typename std::_EnableIf | |
| 1388 | 1431 | < |
| 1389 | 1432 | std::is_arithmetic<_A1>::value && |
| 1390 | 1433 | std::is_arithmetic<_A2>::value, |
| ... | ... | @@ -1393,8 +1436,8 @@ typename std::__lazy_enable_if |
| 1393 | 1436 | nextafter(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT |
| 1394 | 1437 | { |
| 1395 | 1438 | typedef typename std::__promote<_A1, _A2>::type __result_type; |
| 1396 | static_assert((!(std::is_same<_A1, __result_type>::value && | |
| 1397 | std::is_same<_A2, __result_type>::value)), ""); | |
| 1439 | static_assert((!(std::_IsSame<_A1, __result_type>::value && | |
| 1440 | std::_IsSame<_A2, __result_type>::value)), ""); | |
| 1398 | 1441 | return ::nextafter((__result_type)__lcpp_x, (__result_type)__lcpp_y); |
| 1399 | 1442 | } |
| 1400 | 1443 | |
| ... | ... | @@ -1415,7 +1458,7 @@ inline _LIBCPP_INLINE_VISIBILITY long double remainder(long double __lcpp_x, lon |
| 1415 | 1458 | |
| 1416 | 1459 | template <class _A1, class _A2> |
| 1417 | 1460 | inline _LIBCPP_INLINE_VISIBILITY |
| 1418 | typename std::__lazy_enable_if | |
| 1461 | typename std::_EnableIf | |
| 1419 | 1462 | < |
| 1420 | 1463 | std::is_arithmetic<_A1>::value && |
| 1421 | 1464 | std::is_arithmetic<_A2>::value, |
| ... | ... | @@ -1424,8 +1467,8 @@ typename std::__lazy_enable_if |
| 1424 | 1467 | remainder(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT |
| 1425 | 1468 | { |
| 1426 | 1469 | typedef typename std::__promote<_A1, _A2>::type __result_type; |
| 1427 | static_assert((!(std::is_same<_A1, __result_type>::value && | |
| 1428 | std::is_same<_A2, __result_type>::value)), ""); | |
| 1470 | static_assert((!(std::_IsSame<_A1, __result_type>::value && | |
| 1471 | std::_IsSame<_A2, __result_type>::value)), ""); | |
| 1429 | 1472 | return ::remainder((__result_type)__lcpp_x, (__result_type)__lcpp_y); |
| 1430 | 1473 | } |
| 1431 | 1474 | |
| ... | ... | @@ -1436,7 +1479,7 @@ inline _LIBCPP_INLINE_VISIBILITY long double remquo(long double __lcpp_x, long d |
| 1436 | 1479 | |
| 1437 | 1480 | template <class _A1, class _A2> |
| 1438 | 1481 | inline _LIBCPP_INLINE_VISIBILITY |
| 1439 | typename std::__lazy_enable_if | |
| 1482 | typename std::_EnableIf | |
| 1440 | 1483 | < |
| 1441 | 1484 | std::is_arithmetic<_A1>::value && |
| 1442 | 1485 | std::is_arithmetic<_A2>::value, |
| ... | ... | @@ -1445,8 +1488,8 @@ typename std::__lazy_enable_if |
| 1445 | 1488 | remquo(_A1 __lcpp_x, _A2 __lcpp_y, int* __lcpp_z) _NOEXCEPT |
| 1446 | 1489 | { |
| 1447 | 1490 | typedef typename std::__promote<_A1, _A2>::type __result_type; |
| 1448 | static_assert((!(std::is_same<_A1, __result_type>::value && | |
| 1449 | std::is_same<_A2, __result_type>::value)), ""); | |
| 1491 | static_assert((!(std::_IsSame<_A1, __result_type>::value && | |
| 1492 | std::_IsSame<_A2, __result_type>::value)), ""); | |
| 1450 | 1493 | return ::remquo((__result_type)__lcpp_x, (__result_type)__lcpp_y, __lcpp_z); |
| 1451 | 1494 | } |
| 1452 | 1495 |
lib/libcxx/include/memory+160-243| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===-------------------------- memory ------------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 | |
| ... | ... | @@ -549,7 +548,7 @@ template<class T> void swap(weak_ptr<T>& a, weak_ptr<T>& b) noexcept; |
| 549 | 548 | template<class T> struct owner_less; |
| 550 | 549 | |
| 551 | 550 | template<class T> |
| 552 | struct owner_less<shared_ptr<T>> | |
| 551 | struct owner_less<shared_ptr<T> > | |
| 553 | 552 | : binary_function<shared_ptr<T>, shared_ptr<T>, bool> |
| 554 | 553 | { |
| 555 | 554 | typedef bool result_type; |
| ... | ... | @@ -559,7 +558,7 @@ struct owner_less<shared_ptr<T>> |
| 559 | 558 | }; |
| 560 | 559 | |
| 561 | 560 | template<class T> |
| 562 | struct owner_less<weak_ptr<T>> | |
| 561 | struct owner_less<weak_ptr<T> > | |
| 563 | 562 | : binary_function<weak_ptr<T>, weak_ptr<T>, bool> |
| 564 | 563 | { |
| 565 | 564 | typedef bool result_type; |
| ... | ... | @@ -684,7 +683,7 @@ inline _LIBCPP_INLINE_VISIBILITY |
| 684 | 683 | _ValueType __libcpp_relaxed_load(_ValueType const* __value) { |
| 685 | 684 | #if !defined(_LIBCPP_HAS_NO_THREADS) && \ |
| 686 | 685 | defined(__ATOMIC_RELAXED) && \ |
| 687 | (__has_builtin(__atomic_load_n) || _GNUC_VER >= 407) | |
| 686 | (__has_builtin(__atomic_load_n) || defined(_LIBCPP_COMPILER_GCC)) | |
| 688 | 687 | return __atomic_load_n(__value, __ATOMIC_RELAXED); |
| 689 | 688 | #else |
| 690 | 689 | return *__value; |
| ... | ... | @@ -696,7 +695,7 @@ inline _LIBCPP_INLINE_VISIBILITY |
| 696 | 695 | _ValueType __libcpp_acquire_load(_ValueType const* __value) { |
| 697 | 696 | #if !defined(_LIBCPP_HAS_NO_THREADS) && \ |
| 698 | 697 | defined(__ATOMIC_ACQUIRE) && \ |
| 699 | (__has_builtin(__atomic_load_n) || _GNUC_VER >= 407) | |
| 698 | (__has_builtin(__atomic_load_n) || defined(_LIBCPP_COMPILER_GCC)) | |
| 700 | 699 | return __atomic_load_n(__value, __ATOMIC_ACQUIRE); |
| 701 | 700 | #else |
| 702 | 701 | return *__value; |
| ... | ... | @@ -744,7 +743,7 @@ struct __pointer_traits_element_type; |
| 744 | 743 | template <class _Ptr> |
| 745 | 744 | struct __pointer_traits_element_type<_Ptr, true> |
| 746 | 745 | { |
| 747 | typedef typename _Ptr::element_type type; | |
| 746 | typedef _LIBCPP_NODEBUG_TYPE typename _Ptr::element_type type; | |
| 748 | 747 | }; |
| 749 | 748 | |
| 750 | 749 | #ifndef _LIBCPP_HAS_NO_VARIADICS |
| ... | ... | @@ -752,13 +751,13 @@ struct __pointer_traits_element_type<_Ptr, true> |
| 752 | 751 | template <template <class, class...> class _Sp, class _Tp, class ..._Args> |
| 753 | 752 | struct __pointer_traits_element_type<_Sp<_Tp, _Args...>, true> |
| 754 | 753 | { |
| 755 | typedef typename _Sp<_Tp, _Args...>::element_type type; | |
| 754 | typedef _LIBCPP_NODEBUG_TYPE typename _Sp<_Tp, _Args...>::element_type type; | |
| 756 | 755 | }; |
| 757 | 756 | |
| 758 | 757 | template <template <class, class...> class _Sp, class _Tp, class ..._Args> |
| 759 | 758 | struct __pointer_traits_element_type<_Sp<_Tp, _Args...>, false> |
| 760 | 759 | { |
| 761 | typedef _Tp type; | |
| 760 | typedef _LIBCPP_NODEBUG_TYPE _Tp type; | |
| 762 | 761 | }; |
| 763 | 762 | |
| 764 | 763 | #else // _LIBCPP_HAS_NO_VARIADICS |
| ... | ... | @@ -825,13 +824,13 @@ struct __has_difference_type<_Tp, |
| 825 | 824 | template <class _Ptr, bool = __has_difference_type<_Ptr>::value> |
| 826 | 825 | struct __pointer_traits_difference_type |
| 827 | 826 | { |
| 828 | typedef ptrdiff_t type; | |
| 827 | typedef _LIBCPP_NODEBUG_TYPE ptrdiff_t type; | |
| 829 | 828 | }; |
| 830 | 829 | |
| 831 | 830 | template <class _Ptr> |
| 832 | 831 | struct __pointer_traits_difference_type<_Ptr, true> |
| 833 | 832 | { |
| 834 | typedef typename _Ptr::difference_type type; | |
| 833 | typedef _LIBCPP_NODEBUG_TYPE typename _Ptr::difference_type type; | |
| 835 | 834 | }; |
| 836 | 835 | |
| 837 | 836 | template <class _Tp, class _Up> |
| ... | ... | @@ -849,9 +848,9 @@ template <class _Tp, class _Up, bool = __has_rebind<_Tp, _Up>::value> |
| 849 | 848 | struct __pointer_traits_rebind |
| 850 | 849 | { |
| 851 | 850 | #ifndef _LIBCPP_CXX03_LANG |
| 852 | typedef typename _Tp::template rebind<_Up> type; | |
| 851 | typedef _LIBCPP_NODEBUG_TYPE typename _Tp::template rebind<_Up> type; | |
| 853 | 852 | #else |
| 854 | typedef typename _Tp::template rebind<_Up>::other type; | |
| 853 | typedef _LIBCPP_NODEBUG_TYPE typename _Tp::template rebind<_Up>::other type; | |
| 855 | 854 | #endif |
| 856 | 855 | }; |
| 857 | 856 | |
| ... | ... | @@ -861,9 +860,9 @@ template <template <class, class...> class _Sp, class _Tp, class ..._Args, class |
| 861 | 860 | struct __pointer_traits_rebind<_Sp<_Tp, _Args...>, _Up, true> |
| 862 | 861 | { |
| 863 | 862 | #ifndef _LIBCPP_CXX03_LANG |
| 864 | typedef typename _Sp<_Tp, _Args...>::template rebind<_Up> type; | |
| 863 | typedef _LIBCPP_NODEBUG_TYPE typename _Sp<_Tp, _Args...>::template rebind<_Up> type; | |
| 865 | 864 | #else |
| 866 | typedef typename _Sp<_Tp, _Args...>::template rebind<_Up>::other type; | |
| 865 | typedef _LIBCPP_NODEBUG_TYPE typename _Sp<_Tp, _Args...>::template rebind<_Up>::other type; | |
| 867 | 866 | #endif |
| 868 | 867 | }; |
| 869 | 868 | |
| ... | ... | @@ -1014,13 +1013,13 @@ namespace __pointer_type_imp |
| 1014 | 1013 | template <class _Tp, class _Dp, bool = __has_pointer_type<_Dp>::value> |
| 1015 | 1014 | struct __pointer_type |
| 1016 | 1015 | { |
| 1017 | typedef typename _Dp::pointer type; | |
| 1016 | typedef _LIBCPP_NODEBUG_TYPE typename _Dp::pointer type; | |
| 1018 | 1017 | }; |
| 1019 | 1018 | |
| 1020 | 1019 | template <class _Tp, class _Dp> |
| 1021 | 1020 | struct __pointer_type<_Tp, _Dp, false> |
| 1022 | 1021 | { |
| 1023 | typedef _Tp* type; | |
| 1022 | typedef _LIBCPP_NODEBUG_TYPE _Tp* type; | |
| 1024 | 1023 | }; |
| 1025 | 1024 | |
| 1026 | 1025 | } // __pointer_type_imp |
| ... | ... | @@ -1028,7 +1027,7 @@ struct __pointer_type<_Tp, _Dp, false> |
| 1028 | 1027 | template <class _Tp, class _Dp> |
| 1029 | 1028 | struct __pointer_type |
| 1030 | 1029 | { |
| 1031 | typedef typename __pointer_type_imp::__pointer_type<_Tp, typename remove_reference<_Dp>::type>::type type; | |
| 1030 | typedef _LIBCPP_NODEBUG_TYPE typename __pointer_type_imp::__pointer_type<_Tp, typename remove_reference<_Dp>::type>::type type; | |
| 1032 | 1031 | }; |
| 1033 | 1032 | |
| 1034 | 1033 | template <class _Tp, class = void> |
| ... | ... | @@ -1041,14 +1040,14 @@ struct __has_const_pointer<_Tp, |
| 1041 | 1040 | template <class _Tp, class _Ptr, class _Alloc, bool = __has_const_pointer<_Alloc>::value> |
| 1042 | 1041 | struct __const_pointer |
| 1043 | 1042 | { |
| 1044 | typedef typename _Alloc::const_pointer type; | |
| 1043 | typedef _LIBCPP_NODEBUG_TYPE typename _Alloc::const_pointer type; | |
| 1045 | 1044 | }; |
| 1046 | 1045 | |
| 1047 | 1046 | template <class _Tp, class _Ptr, class _Alloc> |
| 1048 | 1047 | struct __const_pointer<_Tp, _Ptr, _Alloc, false> |
| 1049 | 1048 | { |
| 1050 | 1049 | #ifndef _LIBCPP_CXX03_LANG |
| 1051 | typedef typename pointer_traits<_Ptr>::template rebind<const _Tp> type; | |
| 1050 | typedef _LIBCPP_NODEBUG_TYPE typename pointer_traits<_Ptr>::template rebind<const _Tp> type; | |
| 1052 | 1051 | #else |
| 1053 | 1052 | typedef typename pointer_traits<_Ptr>::template rebind<const _Tp>::other type; |
| 1054 | 1053 | #endif |
| ... | ... | @@ -1064,16 +1063,16 @@ struct __has_void_pointer<_Tp, |
| 1064 | 1063 | template <class _Ptr, class _Alloc, bool = __has_void_pointer<_Alloc>::value> |
| 1065 | 1064 | struct __void_pointer |
| 1066 | 1065 | { |
| 1067 | typedef typename _Alloc::void_pointer type; | |
| 1066 | typedef _LIBCPP_NODEBUG_TYPE typename _Alloc::void_pointer type; | |
| 1068 | 1067 | }; |
| 1069 | 1068 | |
| 1070 | 1069 | template <class _Ptr, class _Alloc> |
| 1071 | 1070 | struct __void_pointer<_Ptr, _Alloc, false> |
| 1072 | 1071 | { |
| 1073 | 1072 | #ifndef _LIBCPP_CXX03_LANG |
| 1074 | typedef typename pointer_traits<_Ptr>::template rebind<void> type; | |
| 1073 | typedef _LIBCPP_NODEBUG_TYPE typename pointer_traits<_Ptr>::template rebind<void> type; | |
| 1075 | 1074 | #else |
| 1076 | typedef typename pointer_traits<_Ptr>::template rebind<void>::other type; | |
| 1075 | typedef _LIBCPP_NODEBUG_TYPE typename pointer_traits<_Ptr>::template rebind<void>::other type; | |
| 1077 | 1076 | #endif |
| 1078 | 1077 | }; |
| 1079 | 1078 | |
| ... | ... | @@ -1087,16 +1086,16 @@ struct __has_const_void_pointer<_Tp, |
| 1087 | 1086 | template <class _Ptr, class _Alloc, bool = __has_const_void_pointer<_Alloc>::value> |
| 1088 | 1087 | struct __const_void_pointer |
| 1089 | 1088 | { |
| 1090 | typedef typename _Alloc::const_void_pointer type; | |
| 1089 | typedef _LIBCPP_NODEBUG_TYPE typename _Alloc::const_void_pointer type; | |
| 1091 | 1090 | }; |
| 1092 | 1091 | |
| 1093 | 1092 | template <class _Ptr, class _Alloc> |
| 1094 | 1093 | struct __const_void_pointer<_Ptr, _Alloc, false> |
| 1095 | 1094 | { |
| 1096 | 1095 | #ifndef _LIBCPP_CXX03_LANG |
| 1097 | typedef typename pointer_traits<_Ptr>::template rebind<const void> type; | |
| 1096 | typedef _LIBCPP_NODEBUG_TYPE typename pointer_traits<_Ptr>::template rebind<const void> type; | |
| 1098 | 1097 | #else |
| 1099 | typedef typename pointer_traits<_Ptr>::template rebind<const void>::other type; | |
| 1098 | typedef _LIBCPP_NODEBUG_TYPE typename pointer_traits<_Ptr>::template rebind<const void>::other type; | |
| 1100 | 1099 | #endif |
| 1101 | 1100 | }; |
| 1102 | 1101 | |
| ... | ... | @@ -1162,13 +1161,13 @@ struct __has_size_type<_Tp, |
| 1162 | 1161 | template <class _Alloc, class _DiffType, bool = __has_size_type<_Alloc>::value> |
| 1163 | 1162 | struct __size_type |
| 1164 | 1163 | { |
| 1165 | typedef typename make_unsigned<_DiffType>::type type; | |
| 1164 | typedef _LIBCPP_NODEBUG_TYPE typename make_unsigned<_DiffType>::type type; | |
| 1166 | 1165 | }; |
| 1167 | 1166 | |
| 1168 | 1167 | template <class _Alloc, class _DiffType> |
| 1169 | 1168 | struct __size_type<_Alloc, _DiffType, true> |
| 1170 | 1169 | { |
| 1171 | typedef typename _Alloc::size_type type; | |
| 1170 | typedef _LIBCPP_NODEBUG_TYPE typename _Alloc::size_type type; | |
| 1172 | 1171 | }; |
| 1173 | 1172 | |
| 1174 | 1173 | template <class _Tp, class = void> |
| ... | ... | @@ -1182,13 +1181,13 @@ struct __has_propagate_on_container_copy_assignment<_Tp, |
| 1182 | 1181 | template <class _Alloc, bool = __has_propagate_on_container_copy_assignment<_Alloc>::value> |
| 1183 | 1182 | struct __propagate_on_container_copy_assignment |
| 1184 | 1183 | { |
| 1185 | typedef false_type type; | |
| 1184 | typedef _LIBCPP_NODEBUG_TYPE false_type type; | |
| 1186 | 1185 | }; |
| 1187 | 1186 | |
| 1188 | 1187 | template <class _Alloc> |
| 1189 | 1188 | struct __propagate_on_container_copy_assignment<_Alloc, true> |
| 1190 | 1189 | { |
| 1191 | typedef typename _Alloc::propagate_on_container_copy_assignment type; | |
| 1190 | typedef _LIBCPP_NODEBUG_TYPE typename _Alloc::propagate_on_container_copy_assignment type; | |
| 1192 | 1191 | }; |
| 1193 | 1192 | |
| 1194 | 1193 | template <class _Tp, class = void> |
| ... | ... | @@ -1208,7 +1207,7 @@ struct __propagate_on_container_move_assignment |
| 1208 | 1207 | template <class _Alloc> |
| 1209 | 1208 | struct __propagate_on_container_move_assignment<_Alloc, true> |
| 1210 | 1209 | { |
| 1211 | typedef typename _Alloc::propagate_on_container_move_assignment type; | |
| 1210 | typedef _LIBCPP_NODEBUG_TYPE typename _Alloc::propagate_on_container_move_assignment type; | |
| 1212 | 1211 | }; |
| 1213 | 1212 | |
| 1214 | 1213 | template <class _Tp, class = void> |
| ... | ... | @@ -1228,7 +1227,7 @@ struct __propagate_on_container_swap |
| 1228 | 1227 | template <class _Alloc> |
| 1229 | 1228 | struct __propagate_on_container_swap<_Alloc, true> |
| 1230 | 1229 | { |
| 1231 | typedef typename _Alloc::propagate_on_container_swap type; | |
| 1230 | typedef _LIBCPP_NODEBUG_TYPE typename _Alloc::propagate_on_container_swap type; | |
| 1232 | 1231 | }; |
| 1233 | 1232 | |
| 1234 | 1233 | template <class _Tp, class = void> |
| ... | ... | @@ -1242,13 +1241,13 @@ struct __has_is_always_equal<_Tp, |
| 1242 | 1241 | template <class _Alloc, bool = __has_is_always_equal<_Alloc>::value> |
| 1243 | 1242 | struct __is_always_equal |
| 1244 | 1243 | { |
| 1245 | typedef typename _VSTD::is_empty<_Alloc>::type type; | |
| 1244 | typedef _LIBCPP_NODEBUG_TYPE typename _VSTD::is_empty<_Alloc>::type type; | |
| 1246 | 1245 | }; |
| 1247 | 1246 | |
| 1248 | 1247 | template <class _Alloc> |
| 1249 | 1248 | struct __is_always_equal<_Alloc, true> |
| 1250 | 1249 | { |
| 1251 | typedef typename _Alloc::is_always_equal type; | |
| 1250 | typedef _LIBCPP_NODEBUG_TYPE typename _Alloc::is_always_equal type; | |
| 1252 | 1251 | }; |
| 1253 | 1252 | |
| 1254 | 1253 | template <class _Tp, class _Up, bool = __has_rebind<_Tp, _Up>::value> |
| ... | ... | @@ -1271,7 +1270,7 @@ struct __has_rebind_other<_Tp, _Up, false> |
| 1271 | 1270 | template <class _Tp, class _Up, bool = __has_rebind_other<_Tp, _Up>::value> |
| 1272 | 1271 | struct __allocator_traits_rebind |
| 1273 | 1272 | { |
| 1274 | typedef typename _Tp::template rebind<_Up>::other type; | |
| 1273 | typedef _LIBCPP_NODEBUG_TYPE typename _Tp::template rebind<_Up>::other type; | |
| 1275 | 1274 | }; |
| 1276 | 1275 | |
| 1277 | 1276 | #ifndef _LIBCPP_HAS_NO_VARIADICS |
| ... | ... | @@ -1279,13 +1278,13 @@ struct __allocator_traits_rebind |
| 1279 | 1278 | template <template <class, class...> class _Alloc, class _Tp, class ..._Args, class _Up> |
| 1280 | 1279 | struct __allocator_traits_rebind<_Alloc<_Tp, _Args...>, _Up, true> |
| 1281 | 1280 | { |
| 1282 | typedef typename _Alloc<_Tp, _Args...>::template rebind<_Up>::other type; | |
| 1281 | typedef _LIBCPP_NODEBUG_TYPE typename _Alloc<_Tp, _Args...>::template rebind<_Up>::other type; | |
| 1283 | 1282 | }; |
| 1284 | 1283 | |
| 1285 | 1284 | template <template <class, class...> class _Alloc, class _Tp, class ..._Args, class _Up> |
| 1286 | 1285 | struct __allocator_traits_rebind<_Alloc<_Tp, _Args...>, _Up, false> |
| 1287 | 1286 | { |
| 1288 | typedef _Alloc<_Up, _Args...> type; | |
| 1287 | typedef _LIBCPP_NODEBUG_TYPE _Alloc<_Up, _Args...> type; | |
| 1289 | 1288 | }; |
| 1290 | 1289 | |
| 1291 | 1290 | #else // _LIBCPP_HAS_NO_VARIADICS |
| ... | ... | @@ -1493,13 +1492,13 @@ struct __has_select_on_container_copy_construction |
| 1493 | 1492 | template <class _Alloc, class _Ptr, bool = __has_difference_type<_Alloc>::value> |
| 1494 | 1493 | struct __alloc_traits_difference_type |
| 1495 | 1494 | { |
| 1496 | typedef typename pointer_traits<_Ptr>::difference_type type; | |
| 1495 | typedef _LIBCPP_NODEBUG_TYPE typename pointer_traits<_Ptr>::difference_type type; | |
| 1497 | 1496 | }; |
| 1498 | 1497 | |
| 1499 | 1498 | template <class _Alloc, class _Ptr> |
| 1500 | 1499 | struct __alloc_traits_difference_type<_Alloc, _Ptr, true> |
| 1501 | 1500 | { |
| 1502 | typedef typename _Alloc::difference_type type; | |
| 1501 | typedef _LIBCPP_NODEBUG_TYPE typename _Alloc::difference_type type; | |
| 1503 | 1502 | }; |
| 1504 | 1503 | |
| 1505 | 1504 | template <class _Tp> |
| ... | ... | @@ -1534,7 +1533,7 @@ struct _LIBCPP_TEMPLATE_VIS allocator_traits |
| 1534 | 1533 | #ifndef _LIBCPP_CXX03_LANG |
| 1535 | 1534 | template <class _Tp> using rebind_alloc = |
| 1536 | 1535 | typename __allocator_traits_rebind<allocator_type, _Tp>::type; |
| 1537 | template <class _Tp> using rebind_traits = allocator_traits<rebind_alloc<_Tp>>; | |
| 1536 | template <class _Tp> using rebind_traits = allocator_traits<rebind_alloc<_Tp> >; | |
| 1538 | 1537 | #else // _LIBCPP_CXX03_LANG |
| 1539 | 1538 | template <class _Tp> struct rebind_alloc |
| 1540 | 1539 | {typedef typename __allocator_traits_rebind<allocator_type, _Tp>::type other;}; |
| ... | ... | @@ -1769,7 +1768,7 @@ template <class _Traits, class _Tp> |
| 1769 | 1768 | struct __rebind_alloc_helper |
| 1770 | 1769 | { |
| 1771 | 1770 | #ifndef _LIBCPP_CXX03_LANG |
| 1772 | typedef typename _Traits::template rebind_alloc<_Tp> type; | |
| 1771 | typedef _LIBCPP_NODEBUG_TYPE typename _Traits::template rebind_alloc<_Tp> type; | |
| 1773 | 1772 | #else |
| 1774 | 1773 | typedef typename _Traits::template rebind_alloc<_Tp>::other type; |
| 1775 | 1774 | #endif |
| ... | ... | @@ -2210,8 +2209,8 @@ struct __second_tag {}; |
| 2210 | 2209 | template <class _T1, class _T2> |
| 2211 | 2210 | class __compressed_pair : private __compressed_pair_elem<_T1, 0>, |
| 2212 | 2211 | private __compressed_pair_elem<_T2, 1> { |
| 2213 | typedef __compressed_pair_elem<_T1, 0> _Base1; | |
| 2214 | typedef __compressed_pair_elem<_T2, 1> _Base2; | |
| 2212 | typedef _LIBCPP_NODEBUG_TYPE __compressed_pair_elem<_T1, 0> _Base1; | |
| 2213 | typedef _LIBCPP_NODEBUG_TYPE __compressed_pair_elem<_T2, 1> _Base2; | |
| 2215 | 2214 | |
| 2216 | 2215 | // NOTE: This static assert should never fire because __compressed_pair |
| 2217 | 2216 | // is *almost never* used in a scenario where it's possible for T1 == T2. |
| ... | ... | @@ -2321,7 +2320,7 @@ struct _LIBCPP_TEMPLATE_VIS default_delete { |
| 2321 | 2320 | static_assert(!is_function<_Tp>::value, |
| 2322 | 2321 | "default_delete cannot be instantiated for function types"); |
| 2323 | 2322 | #ifndef _LIBCPP_CXX03_LANG |
| 2324 | _LIBCPP_INLINE_VISIBILITY constexpr default_delete() noexcept = default; | |
| 2323 | _LIBCPP_INLINE_VISIBILITY constexpr default_delete() _NOEXCEPT = default; | |
| 2325 | 2324 | #else |
| 2326 | 2325 | _LIBCPP_INLINE_VISIBILITY default_delete() {} |
| 2327 | 2326 | #endif |
| ... | ... | @@ -2349,7 +2348,7 @@ private: |
| 2349 | 2348 | |
| 2350 | 2349 | public: |
| 2351 | 2350 | #ifndef _LIBCPP_CXX03_LANG |
| 2352 | _LIBCPP_INLINE_VISIBILITY constexpr default_delete() noexcept = default; | |
| 2351 | _LIBCPP_INLINE_VISIBILITY constexpr default_delete() _NOEXCEPT = default; | |
| 2353 | 2352 | #else |
| 2354 | 2353 | _LIBCPP_INLINE_VISIBILITY default_delete() {} |
| 2355 | 2354 | #endif |
| ... | ... | @@ -2371,9 +2370,6 @@ public: |
| 2371 | 2370 | } |
| 2372 | 2371 | }; |
| 2373 | 2372 | |
| 2374 | ||
| 2375 | ||
| 2376 | #ifndef _LIBCPP_CXX03_LANG | |
| 2377 | 2373 | template <class _Deleter> |
| 2378 | 2374 | struct __unique_ptr_deleter_sfinae { |
| 2379 | 2375 | static_assert(!is_reference<_Deleter>::value, "incorrect specialization"); |
| ... | ... | @@ -2395,14 +2391,13 @@ struct __unique_ptr_deleter_sfinae<_Deleter&> { |
| 2395 | 2391 | typedef _Deleter&& __bad_rval_ref_type; |
| 2396 | 2392 | typedef false_type __enable_rval_overload; |
| 2397 | 2393 | }; |
| 2398 | #endif // !defined(_LIBCPP_CXX03_LANG) | |
| 2399 | 2394 | |
| 2400 | 2395 | template <class _Tp, class _Dp = default_delete<_Tp> > |
| 2401 | 2396 | class _LIBCPP_TEMPLATE_VIS unique_ptr { |
| 2402 | 2397 | public: |
| 2403 | 2398 | typedef _Tp element_type; |
| 2404 | 2399 | typedef _Dp deleter_type; |
| 2405 | typedef typename __pointer_type<_Tp, deleter_type>::type pointer; | |
| 2400 | typedef _LIBCPP_NODEBUG_TYPE typename __pointer_type<_Tp, deleter_type>::type pointer; | |
| 2406 | 2401 | |
| 2407 | 2402 | static_assert(!is_rvalue_reference<deleter_type>::value, |
| 2408 | 2403 | "the specified deleter type cannot be an rvalue reference"); |
| ... | ... | @@ -2412,39 +2407,38 @@ private: |
| 2412 | 2407 | |
| 2413 | 2408 | struct __nat { int __for_bool_; }; |
| 2414 | 2409 | |
| 2415 | #ifndef _LIBCPP_CXX03_LANG | |
| 2416 | typedef __unique_ptr_deleter_sfinae<_Dp> _DeleterSFINAE; | |
| 2410 | typedef _LIBCPP_NODEBUG_TYPE __unique_ptr_deleter_sfinae<_Dp> _DeleterSFINAE; | |
| 2417 | 2411 | |
| 2418 | 2412 | template <bool _Dummy> |
| 2419 | using _LValRefType = | |
| 2413 | using _LValRefType _LIBCPP_NODEBUG_TYPE = | |
| 2420 | 2414 | typename __dependent_type<_DeleterSFINAE, _Dummy>::__lval_ref_type; |
| 2421 | 2415 | |
| 2422 | 2416 | template <bool _Dummy> |
| 2423 | using _GoodRValRefType = | |
| 2417 | using _GoodRValRefType _LIBCPP_NODEBUG_TYPE = | |
| 2424 | 2418 | typename __dependent_type<_DeleterSFINAE, _Dummy>::__good_rval_ref_type; |
| 2425 | 2419 | |
| 2426 | 2420 | template <bool _Dummy> |
| 2427 | using _BadRValRefType = | |
| 2421 | using _BadRValRefType _LIBCPP_NODEBUG_TYPE = | |
| 2428 | 2422 | typename __dependent_type<_DeleterSFINAE, _Dummy>::__bad_rval_ref_type; |
| 2429 | 2423 | |
| 2430 | 2424 | template <bool _Dummy, class _Deleter = typename __dependent_type< |
| 2431 | 2425 | __identity<deleter_type>, _Dummy>::type> |
| 2432 | using _EnableIfDeleterDefaultConstructible = | |
| 2426 | using _EnableIfDeleterDefaultConstructible _LIBCPP_NODEBUG_TYPE = | |
| 2433 | 2427 | typename enable_if<is_default_constructible<_Deleter>::value && |
| 2434 | 2428 | !is_pointer<_Deleter>::value>::type; |
| 2435 | 2429 | |
| 2436 | 2430 | template <class _ArgType> |
| 2437 | using _EnableIfDeleterConstructible = | |
| 2431 | using _EnableIfDeleterConstructible _LIBCPP_NODEBUG_TYPE = | |
| 2438 | 2432 | typename enable_if<is_constructible<deleter_type, _ArgType>::value>::type; |
| 2439 | 2433 | |
| 2440 | 2434 | template <class _UPtr, class _Up> |
| 2441 | using _EnableIfMoveConvertible = typename enable_if< | |
| 2435 | using _EnableIfMoveConvertible _LIBCPP_NODEBUG_TYPE = typename enable_if< | |
| 2442 | 2436 | is_convertible<typename _UPtr::pointer, pointer>::value && |
| 2443 | 2437 | !is_array<_Up>::value |
| 2444 | 2438 | >::type; |
| 2445 | 2439 | |
| 2446 | 2440 | template <class _UDel> |
| 2447 | using _EnableIfDeleterConvertible = typename enable_if< | |
| 2441 | using _EnableIfDeleterConvertible _LIBCPP_NODEBUG_TYPE = typename enable_if< | |
| 2448 | 2442 | (is_reference<_Dp>::value && is_same<_Dp, _UDel>::value) || |
| 2449 | 2443 | (!is_reference<_Dp>::value && is_convertible<_UDel, _Dp>::value) |
| 2450 | 2444 | >::type; |
| ... | ... | @@ -2456,42 +2450,42 @@ private: |
| 2456 | 2450 | |
| 2457 | 2451 | public: |
| 2458 | 2452 | template <bool _Dummy = true, |
| 2459 | class = _EnableIfDeleterDefaultConstructible<_Dummy>> | |
| 2453 | class = _EnableIfDeleterDefaultConstructible<_Dummy> > | |
| 2460 | 2454 | _LIBCPP_INLINE_VISIBILITY |
| 2461 | constexpr unique_ptr() noexcept : __ptr_(pointer()) {} | |
| 2455 | _LIBCPP_CONSTEXPR unique_ptr() _NOEXCEPT : __ptr_(pointer()) {} | |
| 2462 | 2456 | |
| 2463 | 2457 | template <bool _Dummy = true, |
| 2464 | class = _EnableIfDeleterDefaultConstructible<_Dummy>> | |
| 2458 | class = _EnableIfDeleterDefaultConstructible<_Dummy> > | |
| 2465 | 2459 | _LIBCPP_INLINE_VISIBILITY |
| 2466 | constexpr unique_ptr(nullptr_t) noexcept : __ptr_(pointer()) {} | |
| 2460 | _LIBCPP_CONSTEXPR unique_ptr(nullptr_t) _NOEXCEPT : __ptr_(pointer()) {} | |
| 2467 | 2461 | |
| 2468 | 2462 | template <bool _Dummy = true, |
| 2469 | class = _EnableIfDeleterDefaultConstructible<_Dummy>> | |
| 2463 | class = _EnableIfDeleterDefaultConstructible<_Dummy> > | |
| 2470 | 2464 | _LIBCPP_INLINE_VISIBILITY |
| 2471 | explicit unique_ptr(pointer __p) noexcept : __ptr_(__p) {} | |
| 2465 | explicit unique_ptr(pointer __p) _NOEXCEPT : __ptr_(__p) {} | |
| 2472 | 2466 | |
| 2473 | 2467 | template <bool _Dummy = true, |
| 2474 | class = _EnableIfDeleterConstructible<_LValRefType<_Dummy>>> | |
| 2468 | class = _EnableIfDeleterConstructible<_LValRefType<_Dummy> > > | |
| 2475 | 2469 | _LIBCPP_INLINE_VISIBILITY |
| 2476 | unique_ptr(pointer __p, _LValRefType<_Dummy> __d) noexcept | |
| 2470 | unique_ptr(pointer __p, _LValRefType<_Dummy> __d) _NOEXCEPT | |
| 2477 | 2471 | : __ptr_(__p, __d) {} |
| 2478 | 2472 | |
| 2479 | 2473 | template <bool _Dummy = true, |
| 2480 | class = _EnableIfDeleterConstructible<_GoodRValRefType<_Dummy>>> | |
| 2474 | class = _EnableIfDeleterConstructible<_GoodRValRefType<_Dummy> > > | |
| 2481 | 2475 | _LIBCPP_INLINE_VISIBILITY |
| 2482 | unique_ptr(pointer __p, _GoodRValRefType<_Dummy> __d) noexcept | |
| 2476 | unique_ptr(pointer __p, _GoodRValRefType<_Dummy> __d) _NOEXCEPT | |
| 2483 | 2477 | : __ptr_(__p, _VSTD::move(__d)) { |
| 2484 | 2478 | static_assert(!is_reference<deleter_type>::value, |
| 2485 | 2479 | "rvalue deleter bound to reference"); |
| 2486 | 2480 | } |
| 2487 | 2481 | |
| 2488 | 2482 | template <bool _Dummy = true, |
| 2489 | class = _EnableIfDeleterConstructible<_BadRValRefType<_Dummy>>> | |
| 2483 | class = _EnableIfDeleterConstructible<_BadRValRefType<_Dummy> > > | |
| 2490 | 2484 | _LIBCPP_INLINE_VISIBILITY |
| 2491 | 2485 | unique_ptr(pointer __p, _BadRValRefType<_Dummy> __d) = delete; |
| 2492 | 2486 | |
| 2493 | 2487 | _LIBCPP_INLINE_VISIBILITY |
| 2494 | unique_ptr(unique_ptr&& __u) noexcept | |
| 2488 | unique_ptr(unique_ptr&& __u) _NOEXCEPT | |
| 2495 | 2489 | : __ptr_(__u.release(), _VSTD::forward<deleter_type>(__u.get_deleter())) { |
| 2496 | 2490 | } |
| 2497 | 2491 | |
| ... | ... | @@ -2508,7 +2502,7 @@ public: |
| 2508 | 2502 | _LIBCPP_INLINE_VISIBILITY |
| 2509 | 2503 | unique_ptr(auto_ptr<_Up>&& __p, |
| 2510 | 2504 | typename enable_if<is_convertible<_Up*, _Tp*>::value && |
| 2511 | is_same<_Dp, default_delete<_Tp>>::value, | |
| 2505 | is_same<_Dp, default_delete<_Tp> >::value, | |
| 2512 | 2506 | __nat>::type = __nat()) _NOEXCEPT |
| 2513 | 2507 | : __ptr_(__p.release()) {} |
| 2514 | 2508 | #endif |
| ... | ... | @@ -2531,65 +2525,6 @@ public: |
| 2531 | 2525 | return *this; |
| 2532 | 2526 | } |
| 2533 | 2527 | |
| 2534 | #else // _LIBCPP_CXX03_LANG | |
| 2535 | private: | |
| 2536 | unique_ptr(unique_ptr&); | |
| 2537 | template <class _Up, class _Ep> unique_ptr(unique_ptr<_Up, _Ep>&); | |
| 2538 | ||
| 2539 | unique_ptr& operator=(unique_ptr&); | |
| 2540 | template <class _Up, class _Ep> unique_ptr& operator=(unique_ptr<_Up, _Ep>&); | |
| 2541 | ||
| 2542 | public: | |
| 2543 | _LIBCPP_INLINE_VISIBILITY | |
| 2544 | unique_ptr() : __ptr_(pointer()) | |
| 2545 | { | |
| 2546 | static_assert(!is_pointer<deleter_type>::value, | |
| 2547 | "unique_ptr constructed with null function pointer deleter"); | |
| 2548 | static_assert(is_default_constructible<deleter_type>::value, | |
| 2549 | "unique_ptr::deleter_type is not default constructible"); | |
| 2550 | } | |
| 2551 | _LIBCPP_INLINE_VISIBILITY | |
| 2552 | unique_ptr(nullptr_t) : __ptr_(pointer()) | |
| 2553 | { | |
| 2554 | static_assert(!is_pointer<deleter_type>::value, | |
| 2555 | "unique_ptr constructed with null function pointer deleter"); | |
| 2556 | } | |
| 2557 | _LIBCPP_INLINE_VISIBILITY | |
| 2558 | explicit unique_ptr(pointer __p) | |
| 2559 | : __ptr_(_VSTD::move(__p)) { | |
| 2560 | static_assert(!is_pointer<deleter_type>::value, | |
| 2561 | "unique_ptr constructed with null function pointer deleter"); | |
| 2562 | } | |
| 2563 | ||
| 2564 | _LIBCPP_INLINE_VISIBILITY | |
| 2565 | operator __rv<unique_ptr>() { | |
| 2566 | return __rv<unique_ptr>(*this); | |
| 2567 | } | |
| 2568 | ||
| 2569 | _LIBCPP_INLINE_VISIBILITY | |
| 2570 | unique_ptr(__rv<unique_ptr> __u) | |
| 2571 | : __ptr_(__u->release(), | |
| 2572 | _VSTD::forward<deleter_type>(__u->get_deleter())) {} | |
| 2573 | ||
| 2574 | template <class _Up, class _Ep> | |
| 2575 | _LIBCPP_INLINE_VISIBILITY | |
| 2576 | typename enable_if< | |
| 2577 | !is_array<_Up>::value && | |
| 2578 | is_convertible<typename unique_ptr<_Up, _Ep>::pointer, | |
| 2579 | pointer>::value && | |
| 2580 | is_assignable<deleter_type&, _Ep&>::value, | |
| 2581 | unique_ptr&>::type | |
| 2582 | operator=(unique_ptr<_Up, _Ep> __u) { | |
| 2583 | reset(__u.release()); | |
| 2584 | __ptr_.second() = _VSTD::forward<_Ep>(__u.get_deleter()); | |
| 2585 | return *this; | |
| 2586 | } | |
| 2587 | ||
| 2588 | _LIBCPP_INLINE_VISIBILITY | |
| 2589 | unique_ptr(pointer __p, deleter_type __d) | |
| 2590 | : __ptr_(_VSTD::move(__p), _VSTD::move(__d)) {} | |
| 2591 | #endif // _LIBCPP_CXX03_LANG | |
| 2592 | ||
| 2593 | 2528 | #if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR) |
| 2594 | 2529 | template <class _Up> |
| 2595 | 2530 | _LIBCPP_INLINE_VISIBILITY |
| ... | ... | @@ -2602,6 +2537,12 @@ public: |
| 2602 | 2537 | } |
| 2603 | 2538 | #endif |
| 2604 | 2539 | |
| 2540 | #ifdef _LIBCPP_CXX03_LANG | |
| 2541 | unique_ptr(unique_ptr const&) = delete; | |
| 2542 | unique_ptr& operator=(unique_ptr const&) = delete; | |
| 2543 | #endif | |
| 2544 | ||
| 2545 | ||
| 2605 | 2546 | _LIBCPP_INLINE_VISIBILITY |
| 2606 | 2547 | ~unique_ptr() { reset(); } |
| 2607 | 2548 | |
| ... | ... | @@ -2681,39 +2622,38 @@ private: |
| 2681 | 2622 | > |
| 2682 | 2623 | {}; |
| 2683 | 2624 | |
| 2684 | #ifndef _LIBCPP_CXX03_LANG | |
| 2685 | 2625 | typedef __unique_ptr_deleter_sfinae<_Dp> _DeleterSFINAE; |
| 2686 | 2626 | |
| 2687 | 2627 | template <bool _Dummy> |
| 2688 | using _LValRefType = | |
| 2628 | using _LValRefType _LIBCPP_NODEBUG_TYPE = | |
| 2689 | 2629 | typename __dependent_type<_DeleterSFINAE, _Dummy>::__lval_ref_type; |
| 2690 | 2630 | |
| 2691 | 2631 | template <bool _Dummy> |
| 2692 | using _GoodRValRefType = | |
| 2632 | using _GoodRValRefType _LIBCPP_NODEBUG_TYPE = | |
| 2693 | 2633 | typename __dependent_type<_DeleterSFINAE, _Dummy>::__good_rval_ref_type; |
| 2694 | 2634 | |
| 2695 | 2635 | template <bool _Dummy> |
| 2696 | using _BadRValRefType = | |
| 2636 | using _BadRValRefType _LIBCPP_NODEBUG_TYPE = | |
| 2697 | 2637 | typename __dependent_type<_DeleterSFINAE, _Dummy>::__bad_rval_ref_type; |
| 2698 | 2638 | |
| 2699 | 2639 | template <bool _Dummy, class _Deleter = typename __dependent_type< |
| 2700 | 2640 | __identity<deleter_type>, _Dummy>::type> |
| 2701 | using _EnableIfDeleterDefaultConstructible = | |
| 2641 | using _EnableIfDeleterDefaultConstructible _LIBCPP_NODEBUG_TYPE = | |
| 2702 | 2642 | typename enable_if<is_default_constructible<_Deleter>::value && |
| 2703 | 2643 | !is_pointer<_Deleter>::value>::type; |
| 2704 | 2644 | |
| 2705 | 2645 | template <class _ArgType> |
| 2706 | using _EnableIfDeleterConstructible = | |
| 2646 | using _EnableIfDeleterConstructible _LIBCPP_NODEBUG_TYPE = | |
| 2707 | 2647 | typename enable_if<is_constructible<deleter_type, _ArgType>::value>::type; |
| 2708 | 2648 | |
| 2709 | 2649 | template <class _Pp> |
| 2710 | using _EnableIfPointerConvertible = typename enable_if< | |
| 2650 | using _EnableIfPointerConvertible _LIBCPP_NODEBUG_TYPE = typename enable_if< | |
| 2711 | 2651 | _CheckArrayPointerConversion<_Pp>::value |
| 2712 | 2652 | >::type; |
| 2713 | 2653 | |
| 2714 | 2654 | template <class _UPtr, class _Up, |
| 2715 | 2655 | class _ElemT = typename _UPtr::element_type> |
| 2716 | using _EnableIfMoveConvertible = typename enable_if< | |
| 2656 | using _EnableIfMoveConvertible _LIBCPP_NODEBUG_TYPE = typename enable_if< | |
| 2717 | 2657 | is_array<_Up>::value && |
| 2718 | 2658 | is_same<pointer, element_type*>::value && |
| 2719 | 2659 | is_same<typename _UPtr::pointer, _ElemT*>::value && |
| ... | ... | @@ -2721,79 +2661,79 @@ private: |
| 2721 | 2661 | >::type; |
| 2722 | 2662 | |
| 2723 | 2663 | template <class _UDel> |
| 2724 | using _EnableIfDeleterConvertible = typename enable_if< | |
| 2664 | using _EnableIfDeleterConvertible _LIBCPP_NODEBUG_TYPE = typename enable_if< | |
| 2725 | 2665 | (is_reference<_Dp>::value && is_same<_Dp, _UDel>::value) || |
| 2726 | 2666 | (!is_reference<_Dp>::value && is_convertible<_UDel, _Dp>::value) |
| 2727 | 2667 | >::type; |
| 2728 | 2668 | |
| 2729 | 2669 | template <class _UDel> |
| 2730 | using _EnableIfDeleterAssignable = typename enable_if< | |
| 2670 | using _EnableIfDeleterAssignable _LIBCPP_NODEBUG_TYPE = typename enable_if< | |
| 2731 | 2671 | is_assignable<_Dp&, _UDel&&>::value |
| 2732 | 2672 | >::type; |
| 2733 | 2673 | |
| 2734 | 2674 | public: |
| 2735 | 2675 | template <bool _Dummy = true, |
| 2736 | class = _EnableIfDeleterDefaultConstructible<_Dummy>> | |
| 2676 | class = _EnableIfDeleterDefaultConstructible<_Dummy> > | |
| 2737 | 2677 | _LIBCPP_INLINE_VISIBILITY |
| 2738 | constexpr unique_ptr() noexcept : __ptr_(pointer()) {} | |
| 2678 | _LIBCPP_CONSTEXPR unique_ptr() _NOEXCEPT : __ptr_(pointer()) {} | |
| 2739 | 2679 | |
| 2740 | 2680 | template <bool _Dummy = true, |
| 2741 | class = _EnableIfDeleterDefaultConstructible<_Dummy>> | |
| 2681 | class = _EnableIfDeleterDefaultConstructible<_Dummy> > | |
| 2742 | 2682 | _LIBCPP_INLINE_VISIBILITY |
| 2743 | constexpr unique_ptr(nullptr_t) noexcept : __ptr_(pointer()) {} | |
| 2683 | _LIBCPP_CONSTEXPR unique_ptr(nullptr_t) _NOEXCEPT : __ptr_(pointer()) {} | |
| 2744 | 2684 | |
| 2745 | 2685 | template <class _Pp, bool _Dummy = true, |
| 2746 | 2686 | class = _EnableIfDeleterDefaultConstructible<_Dummy>, |
| 2747 | class = _EnableIfPointerConvertible<_Pp>> | |
| 2687 | class = _EnableIfPointerConvertible<_Pp> > | |
| 2748 | 2688 | _LIBCPP_INLINE_VISIBILITY |
| 2749 | explicit unique_ptr(_Pp __p) noexcept | |
| 2689 | explicit unique_ptr(_Pp __p) _NOEXCEPT | |
| 2750 | 2690 | : __ptr_(__p) {} |
| 2751 | 2691 | |
| 2752 | 2692 | template <class _Pp, bool _Dummy = true, |
| 2753 | class = _EnableIfDeleterConstructible<_LValRefType<_Dummy>>, | |
| 2754 | class = _EnableIfPointerConvertible<_Pp>> | |
| 2693 | class = _EnableIfDeleterConstructible<_LValRefType<_Dummy> >, | |
| 2694 | class = _EnableIfPointerConvertible<_Pp> > | |
| 2755 | 2695 | _LIBCPP_INLINE_VISIBILITY |
| 2756 | unique_ptr(_Pp __p, _LValRefType<_Dummy> __d) noexcept | |
| 2696 | unique_ptr(_Pp __p, _LValRefType<_Dummy> __d) _NOEXCEPT | |
| 2757 | 2697 | : __ptr_(__p, __d) {} |
| 2758 | 2698 | |
| 2759 | 2699 | template <bool _Dummy = true, |
| 2760 | class = _EnableIfDeleterConstructible<_LValRefType<_Dummy>>> | |
| 2700 | class = _EnableIfDeleterConstructible<_LValRefType<_Dummy> > > | |
| 2761 | 2701 | _LIBCPP_INLINE_VISIBILITY |
| 2762 | unique_ptr(nullptr_t, _LValRefType<_Dummy> __d) noexcept | |
| 2702 | unique_ptr(nullptr_t, _LValRefType<_Dummy> __d) _NOEXCEPT | |
| 2763 | 2703 | : __ptr_(nullptr, __d) {} |
| 2764 | 2704 | |
| 2765 | 2705 | template <class _Pp, bool _Dummy = true, |
| 2766 | class = _EnableIfDeleterConstructible<_GoodRValRefType<_Dummy>>, | |
| 2767 | class = _EnableIfPointerConvertible<_Pp>> | |
| 2706 | class = _EnableIfDeleterConstructible<_GoodRValRefType<_Dummy> >, | |
| 2707 | class = _EnableIfPointerConvertible<_Pp> > | |
| 2768 | 2708 | _LIBCPP_INLINE_VISIBILITY |
| 2769 | unique_ptr(_Pp __p, _GoodRValRefType<_Dummy> __d) noexcept | |
| 2709 | unique_ptr(_Pp __p, _GoodRValRefType<_Dummy> __d) _NOEXCEPT | |
| 2770 | 2710 | : __ptr_(__p, _VSTD::move(__d)) { |
| 2771 | 2711 | static_assert(!is_reference<deleter_type>::value, |
| 2772 | 2712 | "rvalue deleter bound to reference"); |
| 2773 | 2713 | } |
| 2774 | 2714 | |
| 2775 | 2715 | template <bool _Dummy = true, |
| 2776 | class = _EnableIfDeleterConstructible<_GoodRValRefType<_Dummy>>> | |
| 2716 | class = _EnableIfDeleterConstructible<_GoodRValRefType<_Dummy> > > | |
| 2777 | 2717 | _LIBCPP_INLINE_VISIBILITY |
| 2778 | unique_ptr(nullptr_t, _GoodRValRefType<_Dummy> __d) noexcept | |
| 2718 | unique_ptr(nullptr_t, _GoodRValRefType<_Dummy> __d) _NOEXCEPT | |
| 2779 | 2719 | : __ptr_(nullptr, _VSTD::move(__d)) { |
| 2780 | 2720 | static_assert(!is_reference<deleter_type>::value, |
| 2781 | 2721 | "rvalue deleter bound to reference"); |
| 2782 | 2722 | } |
| 2783 | 2723 | |
| 2784 | 2724 | template <class _Pp, bool _Dummy = true, |
| 2785 | class = _EnableIfDeleterConstructible<_BadRValRefType<_Dummy>>, | |
| 2786 | class = _EnableIfPointerConvertible<_Pp>> | |
| 2725 | class = _EnableIfDeleterConstructible<_BadRValRefType<_Dummy> >, | |
| 2726 | class = _EnableIfPointerConvertible<_Pp> > | |
| 2787 | 2727 | _LIBCPP_INLINE_VISIBILITY |
| 2788 | 2728 | unique_ptr(_Pp __p, _BadRValRefType<_Dummy> __d) = delete; |
| 2789 | 2729 | |
| 2790 | 2730 | _LIBCPP_INLINE_VISIBILITY |
| 2791 | unique_ptr(unique_ptr&& __u) noexcept | |
| 2731 | unique_ptr(unique_ptr&& __u) _NOEXCEPT | |
| 2792 | 2732 | : __ptr_(__u.release(), _VSTD::forward<deleter_type>(__u.get_deleter())) { |
| 2793 | 2733 | } |
| 2794 | 2734 | |
| 2795 | 2735 | _LIBCPP_INLINE_VISIBILITY |
| 2796 | unique_ptr& operator=(unique_ptr&& __u) noexcept { | |
| 2736 | unique_ptr& operator=(unique_ptr&& __u) _NOEXCEPT { | |
| 2797 | 2737 | reset(__u.release()); |
| 2798 | 2738 | __ptr_.second() = _VSTD::forward<deleter_type>(__u.get_deleter()); |
| 2799 | 2739 | return *this; |
| ... | ... | @@ -2804,7 +2744,7 @@ public: |
| 2804 | 2744 | class = _EnableIfDeleterConvertible<_Ep> |
| 2805 | 2745 | > |
| 2806 | 2746 | _LIBCPP_INLINE_VISIBILITY |
| 2807 | unique_ptr(unique_ptr<_Up, _Ep>&& __u) noexcept | |
| 2747 | unique_ptr(unique_ptr<_Up, _Ep>&& __u) _NOEXCEPT | |
| 2808 | 2748 | : __ptr_(__u.release(), _VSTD::forward<_Ep>(__u.get_deleter())) { |
| 2809 | 2749 | } |
| 2810 | 2750 | |
| ... | ... | @@ -2814,73 +2754,16 @@ public: |
| 2814 | 2754 | > |
| 2815 | 2755 | _LIBCPP_INLINE_VISIBILITY |
| 2816 | 2756 | unique_ptr& |
| 2817 | operator=(unique_ptr<_Up, _Ep>&& __u) noexcept { | |
| 2757 | operator=(unique_ptr<_Up, _Ep>&& __u) _NOEXCEPT { | |
| 2818 | 2758 | reset(__u.release()); |
| 2819 | 2759 | __ptr_.second() = _VSTD::forward<_Ep>(__u.get_deleter()); |
| 2820 | 2760 | return *this; |
| 2821 | 2761 | } |
| 2822 | 2762 | |
| 2823 | #else // _LIBCPP_CXX03_LANG | |
| 2824 | private: | |
| 2825 | template <class _Up> explicit unique_ptr(_Up); | |
| 2826 | ||
| 2827 | unique_ptr(unique_ptr&); | |
| 2828 | template <class _Up> unique_ptr(unique_ptr<_Up>&); | |
| 2829 | ||
| 2830 | unique_ptr& operator=(unique_ptr&); | |
| 2831 | template <class _Up> unique_ptr& operator=(unique_ptr<_Up>&); | |
| 2832 | ||
| 2833 | template <class _Up> | |
| 2834 | unique_ptr(_Up __u, | |
| 2835 | typename conditional< | |
| 2836 | is_reference<deleter_type>::value, deleter_type, | |
| 2837 | typename add_lvalue_reference<const deleter_type>::type>::type, | |
| 2838 | typename enable_if<is_convertible<_Up, pointer>::value, | |
| 2839 | __nat>::type = __nat()); | |
| 2840 | public: | |
| 2841 | _LIBCPP_INLINE_VISIBILITY | |
| 2842 | unique_ptr() : __ptr_(pointer()) { | |
| 2843 | static_assert(!is_pointer<deleter_type>::value, | |
| 2844 | "unique_ptr constructed with null function pointer deleter"); | |
| 2845 | } | |
| 2846 | _LIBCPP_INLINE_VISIBILITY | |
| 2847 | unique_ptr(nullptr_t) : __ptr_(pointer()) { | |
| 2848 | static_assert(!is_pointer<deleter_type>::value, | |
| 2849 | "unique_ptr constructed with null function pointer deleter"); | |
| 2850 | } | |
| 2851 | ||
| 2852 | _LIBCPP_INLINE_VISIBILITY | |
| 2853 | explicit unique_ptr(pointer __p) : __ptr_(__p) { | |
| 2854 | static_assert(!is_pointer<deleter_type>::value, | |
| 2855 | "unique_ptr constructed with null function pointer deleter"); | |
| 2856 | } | |
| 2857 | ||
| 2858 | _LIBCPP_INLINE_VISIBILITY | |
| 2859 | unique_ptr(pointer __p, deleter_type __d) | |
| 2860 | : __ptr_(__p, _VSTD::forward<deleter_type>(__d)) {} | |
| 2861 | ||
| 2862 | _LIBCPP_INLINE_VISIBILITY | |
| 2863 | unique_ptr(nullptr_t, deleter_type __d) | |
| 2864 | : __ptr_(pointer(), _VSTD::forward<deleter_type>(__d)) {} | |
| 2865 | ||
| 2866 | _LIBCPP_INLINE_VISIBILITY | |
| 2867 | operator __rv<unique_ptr>() { | |
| 2868 | return __rv<unique_ptr>(*this); | |
| 2869 | } | |
| 2870 | ||
| 2871 | _LIBCPP_INLINE_VISIBILITY | |
| 2872 | unique_ptr(__rv<unique_ptr> __u) | |
| 2873 | : __ptr_(__u->release(), | |
| 2874 | _VSTD::forward<deleter_type>(__u->get_deleter())) {} | |
| 2875 | ||
| 2876 | _LIBCPP_INLINE_VISIBILITY | |
| 2877 | unique_ptr& operator=(__rv<unique_ptr> __u) { | |
| 2878 | reset(__u->release()); | |
| 2879 | __ptr_.second() = _VSTD::forward<deleter_type>(__u->get_deleter()); | |
| 2880 | return *this; | |
| 2881 | } | |
| 2882 | ||
| 2883 | #endif // _LIBCPP_CXX03_LANG | |
| 2763 | #ifdef _LIBCPP_CXX03_LANG | |
| 2764 | unique_ptr(unique_ptr const&) = delete; | |
| 2765 | unique_ptr& operator=(unique_ptr const&) = delete; | |
| 2766 | #endif | |
| 2884 | 2767 | |
| 2885 | 2768 | public: |
| 2886 | 2769 | _LIBCPP_INLINE_VISIBILITY |
| ... | ... | @@ -3092,18 +2975,6 @@ operator>=(nullptr_t, const unique_ptr<_T1, _D1>& __x) |
| 3092 | 2975 | return !(nullptr < __x); |
| 3093 | 2976 | } |
| 3094 | 2977 | |
| 3095 | #ifdef _LIBCPP_HAS_NO_RVALUE_REFERENCES | |
| 3096 | ||
| 3097 | template <class _Tp, class _Dp> | |
| 3098 | inline _LIBCPP_INLINE_VISIBILITY | |
| 3099 | unique_ptr<_Tp, _Dp> | |
| 3100 | move(unique_ptr<_Tp, _Dp>& __t) | |
| 3101 | { | |
| 3102 | return unique_ptr<_Tp, _Dp>(__rv<unique_ptr<_Tp, _Dp> >(__t)); | |
| 3103 | } | |
| 3104 | ||
| 3105 | #endif | |
| 3106 | ||
| 3107 | 2978 | #if _LIBCPP_STD_VER > 11 |
| 3108 | 2979 | |
| 3109 | 2980 | template<class _Tp> |
| ... | ... | @@ -3152,7 +3023,7 @@ template <class _Tp, class _Dp> |
| 3152 | 3023 | struct _LIBCPP_TEMPLATE_VIS hash<unique_ptr<_Tp, _Dp> > |
| 3153 | 3024 | #else |
| 3154 | 3025 | struct _LIBCPP_TEMPLATE_VIS hash<__enable_hash_helper< |
| 3155 | unique_ptr<_Tp, _Dp>, typename unique_ptr<_Tp, _Dp>::pointer>> | |
| 3026 | unique_ptr<_Tp, _Dp>, typename unique_ptr<_Tp, _Dp>::pointer> > | |
| 3156 | 3027 | #endif |
| 3157 | 3028 | { |
| 3158 | 3029 | typedef unique_ptr<_Tp, _Dp> argument_type; |
| ... | ... | @@ -3207,10 +3078,10 @@ public: |
| 3207 | 3078 | template <class _Alloc> |
| 3208 | 3079 | class __allocator_destructor |
| 3209 | 3080 | { |
| 3210 | typedef allocator_traits<_Alloc> __alloc_traits; | |
| 3081 | typedef _LIBCPP_NODEBUG_TYPE allocator_traits<_Alloc> __alloc_traits; | |
| 3211 | 3082 | public: |
| 3212 | typedef typename __alloc_traits::pointer pointer; | |
| 3213 | typedef typename __alloc_traits::size_type size_type; | |
| 3083 | typedef _LIBCPP_NODEBUG_TYPE typename __alloc_traits::pointer pointer; | |
| 3084 | typedef _LIBCPP_NODEBUG_TYPE typename __alloc_traits::size_type size_type; | |
| 3214 | 3085 | private: |
| 3215 | 3086 | _Alloc& __alloc_; |
| 3216 | 3087 | size_type __s_; |
| ... | ... | @@ -3467,7 +3338,7 @@ uninitialized_move_n(_InputIt __first, _Size __n, _ForwardIt __first_res) { |
| 3467 | 3338 | && defined(__ATOMIC_RELAXED) \ |
| 3468 | 3339 | && defined(__ATOMIC_ACQ_REL) |
| 3469 | 3340 | # define _LIBCPP_HAS_BUILTIN_ATOMIC_SUPPORT |
| 3470 | #elif !defined(__clang__) && defined(_GNUC_VER) && _GNUC_VER >= 407 | |
| 3341 | #elif defined(_LIBCPP_COMPILER_GCC) | |
| 3471 | 3342 | # define _LIBCPP_HAS_BUILTIN_ATOMIC_SUPPORT |
| 3472 | 3343 | #endif |
| 3473 | 3344 | |
| ... | ... | @@ -5669,6 +5540,52 @@ struct __is_allocator<_Alloc, |
| 5669 | 5540 | > |
| 5670 | 5541 | : true_type {}; |
| 5671 | 5542 | |
| 5543 | // __builtin_new_allocator -- A non-templated helper for allocating and | |
| 5544 | // deallocating memory using __builtin_operator_new and | |
| 5545 | // __builtin_operator_delete. It should be used in preference to | |
| 5546 | // `std::allocator<T>` to avoid additional instantiations. | |
| 5547 | struct __builtin_new_allocator { | |
| 5548 | struct __builtin_new_deleter { | |
| 5549 | typedef void* pointer_type; | |
| 5550 | ||
| 5551 | _LIBCPP_CONSTEXPR explicit __builtin_new_deleter(size_t __size, size_t __align) | |
| 5552 | : __size_(__size), __align_(__align) {} | |
| 5553 | ||
| 5554 | void operator()(void* p) const _NOEXCEPT { | |
| 5555 | std::__libcpp_deallocate(p, __size_, __align_); | |
| 5556 | } | |
| 5557 | ||
| 5558 | private: | |
| 5559 | size_t __size_; | |
| 5560 | size_t __align_; | |
| 5561 | }; | |
| 5562 | ||
| 5563 | typedef unique_ptr<void, __builtin_new_deleter> __holder_t; | |
| 5564 | ||
| 5565 | static __holder_t __allocate_bytes(size_t __s, size_t __align) { | |
| 5566 | return __holder_t(std::__libcpp_allocate(__s, __align), | |
| 5567 | __builtin_new_deleter(__s, __align)); | |
| 5568 | } | |
| 5569 | ||
| 5570 | static void __deallocate_bytes(void* __p, size_t __s, | |
| 5571 | size_t __align) _NOEXCEPT { | |
| 5572 | std::__libcpp_deallocate(__p, __s, __align); | |
| 5573 | } | |
| 5574 | ||
| 5575 | template <class _Tp> | |
| 5576 | _LIBCPP_NODEBUG _LIBCPP_ALWAYS_INLINE | |
| 5577 | static __holder_t __allocate_type(size_t __n) { | |
| 5578 | return __allocate_bytes(__n * sizeof(_Tp), _LIBCPP_ALIGNOF(_Tp)); | |
| 5579 | } | |
| 5580 | ||
| 5581 | template <class _Tp> | |
| 5582 | _LIBCPP_NODEBUG _LIBCPP_ALWAYS_INLINE | |
| 5583 | static void __deallocate_type(void* __p, size_t __n) _NOEXCEPT { | |
| 5584 | __deallocate_bytes(__p, __n * sizeof(_Tp), _LIBCPP_ALIGNOF(_Tp)); | |
| 5585 | } | |
| 5586 | }; | |
| 5587 | ||
| 5588 | ||
| 5672 | 5589 | _LIBCPP_END_NAMESPACE_STD |
| 5673 | 5590 | |
| 5674 | 5591 | _LIBCPP_POP_MACROS |
lib/libcxx/include/module.modulemap+4-1| ... | ... | @@ -24,7 +24,10 @@ module std [system] { |
| 24 | 24 | header "errno.h" |
| 25 | 25 | export * |
| 26 | 26 | } |
| 27 | // <fenv.h> provided by C library. | |
| 27 | module fenv_h { | |
| 28 | header "fenv.h" | |
| 29 | export * | |
| 30 | } | |
| 28 | 31 | // <float.h> provided by compiler or C library. |
| 29 | 32 | module inttypes_h { |
| 30 | 33 | header "inttypes.h" |
lib/libcxx/include/mutex+17-9| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===--------------------------- mutex ------------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 | |
| ... | ... | @@ -189,6 +188,7 @@ template<class Callable, class ...Args> |
| 189 | 188 | |
| 190 | 189 | #include <__config> |
| 191 | 190 | #include <__mutex_base> |
| 191 | #include <cstdint> | |
| 192 | 192 | #include <functional> |
| 193 | 193 | #include <memory> |
| 194 | 194 | #ifndef _LIBCPP_CXX03_LANG |
| ... | ... | @@ -576,11 +576,18 @@ struct _LIBCPP_TEMPLATE_VIS once_flag |
| 576 | 576 | _LIBCPP_CONSTEXPR |
| 577 | 577 | once_flag() _NOEXCEPT : __state_(0) {} |
| 578 | 578 | |
| 579 | #if defined(_LIBCPP_ABI_MICROSOFT) | |
| 580 | typedef uintptr_t _State_type; | |
| 581 | #else | |
| 582 | typedef unsigned long _State_type; | |
| 583 | #endif | |
| 584 | ||
| 585 | ||
| 579 | 586 | private: |
| 580 | 587 | once_flag(const once_flag&); // = delete; |
| 581 | 588 | once_flag& operator=(const once_flag&); // = delete; |
| 582 | 589 | |
| 583 | unsigned long __state_; | |
| 590 | _State_type __state_; | |
| 584 | 591 | |
| 585 | 592 | #ifndef _LIBCPP_CXX03_LANG |
| 586 | 593 | template<class _Callable, class... _Args> |
| ... | ... | @@ -650,7 +657,8 @@ __call_once_proxy(void* __vp) |
| 650 | 657 | (*__p)(); |
| 651 | 658 | } |
| 652 | 659 | |
| 653 | _LIBCPP_FUNC_VIS void __call_once(volatile unsigned long&, void*, void(*)(void*)); | |
| 660 | _LIBCPP_FUNC_VIS void __call_once(volatile once_flag::_State_type&, void*, | |
| 661 | void (*)(void*)); | |
| 654 | 662 | |
| 655 | 663 | #ifndef _LIBCPP_CXX03_LANG |
| 656 | 664 | |
| ... | ... | @@ -659,7 +667,7 @@ inline _LIBCPP_INLINE_VISIBILITY |
| 659 | 667 | void |
| 660 | 668 | call_once(once_flag& __flag, _Callable&& __func, _Args&&... __args) |
| 661 | 669 | { |
| 662 | if (__libcpp_acquire_load(&__flag.__state_) != ~0ul) | |
| 670 | if (__libcpp_acquire_load(&__flag.__state_) != ~once_flag::_State_type(0)) | |
| 663 | 671 | { |
| 664 | 672 | typedef tuple<_Callable&&, _Args&&...> _Gp; |
| 665 | 673 | _Gp __f(_VSTD::forward<_Callable>(__func), _VSTD::forward<_Args>(__args)...); |
| ... | ... | @@ -675,7 +683,7 @@ inline _LIBCPP_INLINE_VISIBILITY |
| 675 | 683 | void |
| 676 | 684 | call_once(once_flag& __flag, _Callable& __func) |
| 677 | 685 | { |
| 678 | if (__libcpp_acquire_load(&__flag.__state_) != ~0ul) | |
| 686 | if (__libcpp_acquire_load(&__flag.__state_) != ~once_flag::_State_type(0)) | |
| 679 | 687 | { |
| 680 | 688 | __call_once_param<_Callable> __p(__func); |
| 681 | 689 | __call_once(__flag.__state_, &__p, &__call_once_proxy<_Callable>); |
| ... | ... | @@ -687,7 +695,7 @@ inline _LIBCPP_INLINE_VISIBILITY |
| 687 | 695 | void |
| 688 | 696 | call_once(once_flag& __flag, const _Callable& __func) |
| 689 | 697 | { |
| 690 | if (__libcpp_acquire_load(&__flag.__state_) != ~0ul) | |
| 698 | if (__libcpp_acquire_load(&__flag.__state_) != ~once_flag::_State_type(0)) | |
| 691 | 699 | { |
| 692 | 700 | __call_once_param<const _Callable> __p(__func); |
| 693 | 701 | __call_once(__flag.__state_, &__p, &__call_once_proxy<const _Callable>); |
lib/libcxx/include/new+28-14| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===----------------------------- new ------------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 | |
| ... | ... | @@ -34,6 +33,12 @@ public: |
| 34 | 33 | }; |
| 35 | 34 | |
| 36 | 35 | enum class align_val_t : size_t {}; // C++17 |
| 36 | ||
| 37 | struct destroying_delete_t { // C++20 | |
| 38 | explicit destroying_delete_t() = default; | |
| 39 | }; | |
| 40 | inline constexpr destroying_delete_t destroying_delete{}; // C++20 | |
| 41 | ||
| 37 | 42 | struct nothrow_t {}; |
| 38 | 43 | extern const nothrow_t nothrow; |
| 39 | 44 | typedef void (*new_handler)(); |
| ... | ... | @@ -90,7 +95,7 @@ void operator delete[](void* ptr, void*) noexcept; |
| 90 | 95 | #include <cstdlib> |
| 91 | 96 | #endif |
| 92 | 97 | |
| 93 | #if defined(_LIBCPP_ABI_MICROSOFT) && !defined(_LIBCPP_NO_VCRUNTIME) | |
| 98 | #if defined(_LIBCPP_ABI_VCRUNTIME) | |
| 94 | 99 | #include <new.h> |
| 95 | 100 | #endif |
| 96 | 101 | |
| ... | ... | @@ -120,7 +125,7 @@ void operator delete[](void* ptr, void*) noexcept; |
| 120 | 125 | namespace std // purposefully not using versioning namespace |
| 121 | 126 | { |
| 122 | 127 | |
| 123 | #if !defined(_LIBCPP_ABI_MICROSOFT) || defined(_LIBCPP_NO_VCRUNTIME) | |
| 128 | #if !defined(_LIBCPP_ABI_VCRUNTIME) | |
| 124 | 129 | struct _LIBCPP_TYPE_VIS nothrow_t {}; |
| 125 | 130 | extern _LIBCPP_FUNC_VIS const nothrow_t nothrow; |
| 126 | 131 | |
| ... | ... | @@ -146,12 +151,12 @@ typedef void (*new_handler)(); |
| 146 | 151 | _LIBCPP_FUNC_VIS new_handler set_new_handler(new_handler) _NOEXCEPT; |
| 147 | 152 | _LIBCPP_FUNC_VIS new_handler get_new_handler() _NOEXCEPT; |
| 148 | 153 | |
| 149 | #endif // !_LIBCPP_ABI_MICROSOFT || _LIBCPP_NO_VCRUNTIME | |
| 154 | #endif // !_LIBCPP_ABI_VCRUNTIME | |
| 150 | 155 | |
| 151 | 156 | _LIBCPP_NORETURN _LIBCPP_FUNC_VIS void __throw_bad_alloc(); // not in C++ spec |
| 152 | 157 | |
| 153 | 158 | #if !defined(_LIBCPP_HAS_NO_LIBRARY_ALIGNED_ALLOCATION) && \ |
| 154 | !defined(_LIBCPP_DEFER_NEW_TO_VCRUNTIME) | |
| 159 | !defined(_LIBCPP_ABI_VCRUNTIME) | |
| 155 | 160 | #ifndef _LIBCPP_CXX03_LANG |
| 156 | 161 | enum class _LIBCPP_ENUM_VIS align_val_t : size_t { }; |
| 157 | 162 | #else |
| ... | ... | @@ -159,6 +164,15 @@ enum align_val_t { __zero = 0, __max = (size_t)-1 }; |
| 159 | 164 | #endif |
| 160 | 165 | #endif |
| 161 | 166 | |
| 167 | #if _LIBCPP_STD_VER > 17 | |
| 168 | // Enable the declaration even if the compiler doesn't support the language | |
| 169 | // feature. | |
| 170 | struct destroying_delete_t { | |
| 171 | explicit destroying_delete_t() = default; | |
| 172 | }; | |
| 173 | _LIBCPP_INLINE_VAR constexpr destroying_delete_t destroying_delete{}; | |
| 174 | #endif // _LIBCPP_STD_VER > 17 | |
| 175 | ||
| 162 | 176 | } // std |
| 163 | 177 | |
| 164 | 178 | #if defined(_LIBCPP_CXX03_LANG) |
| ... | ... | @@ -167,10 +181,10 @@ enum align_val_t { __zero = 0, __max = (size_t)-1 }; |
| 167 | 181 | #define _THROW_BAD_ALLOC |
| 168 | 182 | #endif |
| 169 | 183 | |
| 170 | #if !defined(_LIBCPP_DEFER_NEW_TO_VCRUNTIME) | |
| 184 | #if !defined(_LIBCPP_ABI_VCRUNTIME) | |
| 171 | 185 | |
| 172 | 186 | _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new(std::size_t __sz) _THROW_BAD_ALLOC; |
| 173 | _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new(std::size_t __sz, const std::nothrow_t&) _NOEXCEPT _NOALIAS; | |
| 187 | _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new(std::size_t __sz, const std::nothrow_t&) _NOEXCEPT _LIBCPP_NOALIAS; | |
| 174 | 188 | _LIBCPP_OVERRIDABLE_FUNC_VIS void operator delete(void* __p) _NOEXCEPT; |
| 175 | 189 | _LIBCPP_OVERRIDABLE_FUNC_VIS void operator delete(void* __p, const std::nothrow_t&) _NOEXCEPT; |
| 176 | 190 | #ifndef _LIBCPP_HAS_NO_LIBRARY_SIZED_DEALLOCATION |
| ... | ... | @@ -178,7 +192,7 @@ _LIBCPP_OVERRIDABLE_FUNC_VIS _LIBCPP_AVAILABILITY_SIZED_NEW_DELETE void operato |
| 178 | 192 | #endif |
| 179 | 193 | |
| 180 | 194 | _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new[](std::size_t __sz) _THROW_BAD_ALLOC; |
| 181 | _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new[](std::size_t __sz, const std::nothrow_t&) _NOEXCEPT _NOALIAS; | |
| 195 | _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new[](std::size_t __sz, const std::nothrow_t&) _NOEXCEPT _LIBCPP_NOALIAS; | |
| 182 | 196 | _LIBCPP_OVERRIDABLE_FUNC_VIS void operator delete[](void* __p) _NOEXCEPT; |
| 183 | 197 | _LIBCPP_OVERRIDABLE_FUNC_VIS void operator delete[](void* __p, const std::nothrow_t&) _NOEXCEPT; |
| 184 | 198 | #ifndef _LIBCPP_HAS_NO_LIBRARY_SIZED_DEALLOCATION |
| ... | ... | @@ -187,7 +201,7 @@ _LIBCPP_OVERRIDABLE_FUNC_VIS _LIBCPP_AVAILABILITY_SIZED_NEW_DELETE void operato |
| 187 | 201 | |
| 188 | 202 | #ifndef _LIBCPP_HAS_NO_LIBRARY_ALIGNED_ALLOCATION |
| 189 | 203 | _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new(std::size_t __sz, std::align_val_t) _THROW_BAD_ALLOC; |
| 190 | _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new(std::size_t __sz, std::align_val_t, const std::nothrow_t&) _NOEXCEPT _NOALIAS; | |
| 204 | _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new(std::size_t __sz, std::align_val_t, const std::nothrow_t&) _NOEXCEPT _LIBCPP_NOALIAS; | |
| 191 | 205 | _LIBCPP_OVERRIDABLE_FUNC_VIS void operator delete(void* __p, std::align_val_t) _NOEXCEPT; |
| 192 | 206 | _LIBCPP_OVERRIDABLE_FUNC_VIS void operator delete(void* __p, std::align_val_t, const std::nothrow_t&) _NOEXCEPT; |
| 193 | 207 | #ifndef _LIBCPP_HAS_NO_LIBRARY_SIZED_DEALLOCATION |
| ... | ... | @@ -195,7 +209,7 @@ _LIBCPP_OVERRIDABLE_FUNC_VIS _LIBCPP_AVAILABILITY_SIZED_NEW_DELETE void operato |
| 195 | 209 | #endif |
| 196 | 210 | |
| 197 | 211 | _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new[](std::size_t __sz, std::align_val_t) _THROW_BAD_ALLOC; |
| 198 | _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new[](std::size_t __sz, std::align_val_t, const std::nothrow_t&) _NOEXCEPT _NOALIAS; | |
| 212 | _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new[](std::size_t __sz, std::align_val_t, const std::nothrow_t&) _NOEXCEPT _LIBCPP_NOALIAS; | |
| 199 | 213 | _LIBCPP_OVERRIDABLE_FUNC_VIS void operator delete[](void* __p, std::align_val_t) _NOEXCEPT; |
| 200 | 214 | _LIBCPP_OVERRIDABLE_FUNC_VIS void operator delete[](void* __p, std::align_val_t, const std::nothrow_t&) _NOEXCEPT; |
| 201 | 215 | #ifndef _LIBCPP_HAS_NO_LIBRARY_SIZED_DEALLOCATION |
| ... | ... | @@ -208,7 +222,7 @@ _LIBCPP_NODISCARD_AFTER_CXX17 inline _LIBCPP_INLINE_VISIBILITY void* operator ne |
| 208 | 222 | inline _LIBCPP_INLINE_VISIBILITY void operator delete (void*, void*) _NOEXCEPT {} |
| 209 | 223 | inline _LIBCPP_INLINE_VISIBILITY void operator delete[](void*, void*) _NOEXCEPT {} |
| 210 | 224 | |
| 211 | #endif // !_LIBCPP_DEFER_NEW_TO_VCRUNTIME | |
| 225 | #endif // !_LIBCPP_ABI_VCRUNTIME | |
| 212 | 226 | |
| 213 | 227 | _LIBCPP_BEGIN_NAMESPACE_STD |
| 214 | 228 |
lib/libcxx/include/numeric+73-11| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===---------------------------- numeric ---------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 | |
| ... | ... | @@ -134,6 +133,10 @@ template <class M, class N> |
| 134 | 133 | template <class M, class N> |
| 135 | 134 | constexpr common_type_t<M,N> lcm(M m, N n); // C++17 |
| 136 | 135 | |
| 136 | integer midpoint(integer a, integer b); // C++20 | |
| 137 | pointer midpoint(pointer a, pointer b); // C++20 | |
| 138 | floating_point midpoint(floating_point a, floating_point b); // C++20 | |
| 139 | ||
| 137 | 140 | } // std |
| 138 | 141 | |
| 139 | 142 | */ |
| ... | ... | @@ -142,6 +145,7 @@ template <class M, class N> |
| 142 | 145 | #include <iterator> |
| 143 | 146 | #include <limits> // for numeric_limits |
| 144 | 147 | #include <functional> |
| 148 | #include <cmath> // for isnormal | |
| 145 | 149 | #include <version> |
| 146 | 150 | |
| 147 | 151 | #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) |
| ... | ... | @@ -456,10 +460,10 @@ iota(_ForwardIterator __first, _ForwardIterator __last, _Tp __value_) |
| 456 | 460 | |
| 457 | 461 | |
| 458 | 462 | #if _LIBCPP_STD_VER > 14 |
| 459 | template <typename _Result, typename _Source, bool _IsSigned = is_signed<_Source>::value> struct __abs; | |
| 463 | template <typename _Result, typename _Source, bool _IsSigned = is_signed<_Source>::value> struct __ct_abs; | |
| 460 | 464 | |
| 461 | 465 | template <typename _Result, typename _Source> |
| 462 | struct __abs<_Result, _Source, true> { | |
| 466 | struct __ct_abs<_Result, _Source, true> { | |
| 463 | 467 | _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY |
| 464 | 468 | _Result operator()(_Source __t) const noexcept |
| 465 | 469 | { |
| ... | ... | @@ -470,7 +474,7 @@ struct __abs<_Result, _Source, true> { |
| 470 | 474 | }; |
| 471 | 475 | |
| 472 | 476 | template <typename _Result, typename _Source> |
| 473 | struct __abs<_Result, _Source, false> { | |
| 477 | struct __ct_abs<_Result, _Source, false> { | |
| 474 | 478 | _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY |
| 475 | 479 | _Result operator()(_Source __t) const noexcept { return __t; } |
| 476 | 480 | }; |
| ... | ... | @@ -496,8 +500,8 @@ gcd(_Tp __m, _Up __n) |
| 496 | 500 | using _Rp = common_type_t<_Tp,_Up>; |
| 497 | 501 | using _Wp = make_unsigned_t<_Rp>; |
| 498 | 502 | return static_cast<_Rp>(_VSTD::__gcd( |
| 499 | static_cast<_Wp>(__abs<_Rp, _Tp>()(__m)), | |
| 500 | static_cast<_Wp>(__abs<_Rp, _Up>()(__n)))); | |
| 503 | static_cast<_Wp>(__ct_abs<_Rp, _Tp>()(__m)), | |
| 504 | static_cast<_Wp>(__ct_abs<_Rp, _Up>()(__n)))); | |
| 501 | 505 | } |
| 502 | 506 | |
| 503 | 507 | template<class _Tp, class _Up> |
| ... | ... | @@ -512,14 +516,72 @@ lcm(_Tp __m, _Up __n) |
| 512 | 516 | return 0; |
| 513 | 517 | |
| 514 | 518 | using _Rp = common_type_t<_Tp,_Up>; |
| 515 | _Rp __val1 = __abs<_Rp, _Tp>()(__m) / _VSTD::gcd(__m, __n); | |
| 516 | _Rp __val2 = __abs<_Rp, _Up>()(__n); | |
| 519 | _Rp __val1 = __ct_abs<_Rp, _Tp>()(__m) / _VSTD::gcd(__m, __n); | |
| 520 | _Rp __val2 = __ct_abs<_Rp, _Up>()(__n); | |
| 517 | 521 | _LIBCPP_ASSERT((numeric_limits<_Rp>::max() / __val1 > __val2), "Overflow in lcm"); |
| 518 | 522 | return __val1 * __val2; |
| 519 | 523 | } |
| 520 | 524 | |
| 521 | 525 | #endif /* _LIBCPP_STD_VER > 14 */ |
| 522 | 526 | |
| 527 | #if _LIBCPP_STD_VER > 17 | |
| 528 | template <class _Tp> | |
| 529 | _LIBCPP_INLINE_VISIBILITY constexpr | |
| 530 | enable_if_t<is_integral_v<_Tp> && !is_same_v<bool, _Tp> && !is_null_pointer_v<_Tp>, _Tp> | |
| 531 | midpoint(_Tp __a, _Tp __b) noexcept | |
| 532 | _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK | |
| 533 | { | |
| 534 | using _Up = std::make_unsigned_t<_Tp>; | |
| 535 | ||
| 536 | int __sign = 1; | |
| 537 | _Up __m = __a; | |
| 538 | _Up __M = __b; | |
| 539 | if (__a > __b) | |
| 540 | { | |
| 541 | __sign = -1; | |
| 542 | __m = __b; | |
| 543 | __M = __a; | |
| 544 | } | |
| 545 | return __a + __sign * _Tp(_Up(__M-__m) >> 1); | |
| 546 | } | |
| 547 | ||
| 548 | ||
| 549 | template <class _TPtr> | |
| 550 | _LIBCPP_INLINE_VISIBILITY constexpr | |
| 551 | enable_if_t<is_pointer_v<_TPtr> | |
| 552 | && is_object_v<remove_pointer_t<_TPtr>> | |
| 553 | && ! is_void_v<remove_pointer_t<_TPtr>> | |
| 554 | && (sizeof(remove_pointer_t<_TPtr>) > 0), _TPtr> | |
| 555 | midpoint(_TPtr __a, _TPtr __b) noexcept | |
| 556 | { | |
| 557 | return __a + _VSTD::midpoint(ptrdiff_t(0), __b - __a); | |
| 558 | } | |
| 559 | ||
| 560 | ||
| 561 | template <typename _Tp> | |
| 562 | constexpr int __sign(_Tp __val) { | |
| 563 | return (_Tp(0) < __val) - (__val < _Tp(0)); | |
| 564 | } | |
| 565 | ||
| 566 | template <typename _Fp> | |
| 567 | constexpr _Fp __fp_abs(_Fp __f) { return __f >= 0 ? __f : -__f; } | |
| 568 | ||
| 569 | template <class _Fp> | |
| 570 | _LIBCPP_INLINE_VISIBILITY constexpr | |
| 571 | enable_if_t<is_floating_point_v<_Fp>, _Fp> | |
| 572 | midpoint(_Fp __a, _Fp __b) noexcept | |
| 573 | { | |
| 574 | 	constexpr _Fp __lo = numeric_limits<_Fp>::min()*2; | |
| 575 | 	constexpr _Fp __hi = numeric_limits<_Fp>::max()/2; | |
| 576 | return __fp_abs(__a) <= __hi && __fp_abs(__b) <= __hi ? // typical case: overflow is impossible | |
| 577 | (__a + __b)/2 : // always correctly rounded | |
| 578 | __fp_abs(__a) < __lo ? __a + __b/2 : // not safe to halve a | |
| 579 | __fp_abs(__a) < __lo ? __a/2 + __b : // not safe to halve b | |
| 580 | __a/2 + __b/2; // otherwise correctly rounded | |
| 581 | } | |
| 582 | ||
| 583 | #endif // _LIBCPP_STD_VER > 17 | |
| 584 | ||
| 523 | 585 | _LIBCPP_END_NAMESPACE_STD |
| 524 | 586 | |
| 525 | 587 | _LIBCPP_POP_MACROS |
lib/libcxx/include/optional+60-54| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===-------------------------- optional ----------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 | |
| ... | ... | @@ -593,7 +592,7 @@ public: |
| 593 | 592 | |
| 594 | 593 | private: |
| 595 | 594 | // Disable the reference extension using this static assert. |
| 596 | static_assert(!is_same_v<value_type, in_place_t>, | |
| 595 | static_assert(!is_same_v<__uncvref_t<value_type>, in_place_t>, | |
| 597 | 596 | "instantiation of optional with in_place_t is ill-formed"); |
| 598 | 597 | static_assert(!is_same_v<__uncvref_t<value_type>, nullopt_t>, |
| 599 | 598 | "instantiation of optional with nullopt_t is ill-formed"); |
| ... | ... | @@ -601,6 +600,8 @@ private: |
| 601 | 600 | "instantiation of optional with a reference type is ill-formed"); |
| 602 | 601 | static_assert(is_destructible_v<value_type>, |
| 603 | 602 | "instantiation of optional with a non-destructible type is ill-formed"); |
| 603 | static_assert(!is_array_v<value_type>, | |
| 604 | "instantiation of optional with an array type is ill-formed"); | |
| 604 | 605 | |
| 605 | 606 | // LWG2756: conditionally explicit conversion from _Up |
| 606 | 607 | struct _CheckOptionalArgsConstructor { |
| ... | ... | @@ -617,16 +618,16 @@ private: |
| 617 | 618 | } |
| 618 | 619 | }; |
| 619 | 620 | template <class _Up> |
| 620 | using _CheckOptionalArgsCtor = conditional_t< | |
| 621 | !is_same_v<__uncvref_t<_Up>, in_place_t> && | |
| 622 | !is_same_v<__uncvref_t<_Up>, optional>, | |
| 621 | using _CheckOptionalArgsCtor = _If< | |
| 622 | _IsNotSame<__uncvref_t<_Up>, in_place_t>::value && | |
| 623 | _IsNotSame<__uncvref_t<_Up>, optional>::value, | |
| 623 | 624 | _CheckOptionalArgsConstructor, |
| 624 | 625 | __check_tuple_constructor_fail |
| 625 | 626 | >; |
| 626 | 627 | template <class _QualUp> |
| 627 | 628 | struct _CheckOptionalLikeConstructor { |
| 628 | 629 | template <class _Up, class _Opt = optional<_Up>> |
| 629 | using __check_constructible_from_opt = __lazy_or< | |
| 630 | using __check_constructible_from_opt = _Or< | |
| 630 | 631 | is_constructible<_Tp, _Opt&>, |
| 631 | 632 | is_constructible<_Tp, _Opt const&>, |
| 632 | 633 | is_constructible<_Tp, _Opt&&>, |
| ... | ... | @@ -637,7 +638,7 @@ private: |
| 637 | 638 | is_convertible<_Opt const&&, _Tp> |
| 638 | 639 | >; |
| 639 | 640 | template <class _Up, class _Opt = optional<_Up>> |
| 640 | using __check_assignable_from_opt = __lazy_or< | |
| 641 | using __check_assignable_from_opt = _Or< | |
| 641 | 642 | is_assignable<_Tp&, _Opt&>, |
| 642 | 643 | is_assignable<_Tp&, _Opt const&>, |
| 643 | 644 | is_assignable<_Tp&, _Opt&&>, |
| ... | ... | @@ -663,18 +664,18 @@ private: |
| 663 | 664 | }; |
| 664 | 665 | |
| 665 | 666 | template <class _Up, class _QualUp> |
| 666 | using _CheckOptionalLikeCtor = conditional_t< | |
| 667 | __lazy_and< | |
| 668 | __lazy_not<is_same<_Up, _Tp>>, | |
| 667 | using _CheckOptionalLikeCtor = _If< | |
| 668 | _And< | |
| 669 | _IsNotSame<_Up, _Tp>, | |
| 669 | 670 | is_constructible<_Tp, _QualUp> |
| 670 | 671 | >::value, |
| 671 | 672 | _CheckOptionalLikeConstructor<_QualUp>, |
| 672 | 673 | __check_tuple_constructor_fail |
| 673 | 674 | >; |
| 674 | 675 | template <class _Up, class _QualUp> |
| 675 | using _CheckOptionalLikeAssign = conditional_t< | |
| 676 | __lazy_and< | |
| 677 | __lazy_not<is_same<_Up, _Tp>>, | |
| 676 | using _CheckOptionalLikeAssign = _If< | |
| 677 | _And< | |
| 678 | _IsNotSame<_Up, _Tp>, | |
| 678 | 679 | is_constructible<_Tp, _QualUp>, |
| 679 | 680 | is_assignable<_Tp&, _QualUp> |
| 680 | 681 | >::value, |
| ... | ... | @@ -688,28 +689,32 @@ public: |
| 688 | 689 | _LIBCPP_INLINE_VISIBILITY constexpr optional(optional&&) = default; |
| 689 | 690 | _LIBCPP_INLINE_VISIBILITY constexpr optional(nullopt_t) noexcept {} |
| 690 | 691 | |
| 691 | template <class... _Args, class = enable_if_t< | |
| 692 | is_constructible_v<value_type, _Args...>> | |
| 692 | template <class _InPlaceT, class... _Args, class = _EnableIf< | |
| 693 | _And< | |
| 694 | _IsSame<_InPlaceT, in_place_t>, | |
| 695 | is_constructible<value_type, _Args...> | |
| 696 | >::value | |
| 697 | > | |
| 693 | 698 | > |
| 694 | 699 | _LIBCPP_INLINE_VISIBILITY |
| 695 | constexpr explicit optional(in_place_t, _Args&&... __args) | |
| 700 | constexpr explicit optional(_InPlaceT, _Args&&... __args) | |
| 696 | 701 | : __base(in_place, _VSTD::forward<_Args>(__args)...) {} |
| 697 | 702 | |
| 698 | template <class _Up, class... _Args, class = enable_if_t< | |
| 703 | template <class _Up, class... _Args, class = _EnableIf< | |
| 699 | 704 | is_constructible_v<value_type, initializer_list<_Up>&, _Args...>> |
| 700 | 705 | > |
| 701 | 706 | _LIBCPP_INLINE_VISIBILITY |
| 702 | 707 | constexpr explicit optional(in_place_t, initializer_list<_Up> __il, _Args&&... __args) |
| 703 | 708 | : __base(in_place, __il, _VSTD::forward<_Args>(__args)...) {} |
| 704 | 709 | |
| 705 | template <class _Up = value_type, enable_if_t< | |
| 710 | template <class _Up = value_type, _EnableIf< | |
| 706 | 711 | _CheckOptionalArgsCtor<_Up>::template __enable_implicit<_Up>() |
| 707 | 712 | , int> = 0> |
| 708 | 713 | _LIBCPP_INLINE_VISIBILITY |
| 709 | 714 | constexpr optional(_Up&& __v) |
| 710 | 715 | : __base(in_place, _VSTD::forward<_Up>(__v)) {} |
| 711 | 716 | |
| 712 | template <class _Up, enable_if_t< | |
| 717 | template <class _Up, _EnableIf< | |
| 713 | 718 | _CheckOptionalArgsCtor<_Up>::template __enable_explicit<_Up>() |
| 714 | 719 | , int> = 0> |
| 715 | 720 | _LIBCPP_INLINE_VISIBILITY |
| ... | ... | @@ -717,7 +722,7 @@ public: |
| 717 | 722 | : __base(in_place, _VSTD::forward<_Up>(__v)) {} |
| 718 | 723 | |
| 719 | 724 | // LWG2756: conditionally explicit conversion from const optional<_Up>& |
| 720 | template <class _Up, enable_if_t< | |
| 725 | template <class _Up, _EnableIf< | |
| 721 | 726 | _CheckOptionalLikeCtor<_Up, _Up const&>::template __enable_implicit<_Up>() |
| 722 | 727 | , int> = 0> |
| 723 | 728 | _LIBCPP_INLINE_VISIBILITY |
| ... | ... | @@ -725,7 +730,7 @@ public: |
| 725 | 730 | { |
| 726 | 731 | this->__construct_from(__v); |
| 727 | 732 | } |
| 728 | template <class _Up, enable_if_t< | |
| 733 | template <class _Up, _EnableIf< | |
| 729 | 734 | _CheckOptionalLikeCtor<_Up, _Up const&>::template __enable_explicit<_Up>() |
| 730 | 735 | , int> = 0> |
| 731 | 736 | _LIBCPP_INLINE_VISIBILITY |
| ... | ... | @@ -735,7 +740,7 @@ public: |
| 735 | 740 | } |
| 736 | 741 | |
| 737 | 742 | // LWG2756: conditionally explicit conversion from optional<_Up>&& |
| 738 | template <class _Up, enable_if_t< | |
| 743 | template <class _Up, _EnableIf< | |
| 739 | 744 | _CheckOptionalLikeCtor<_Up, _Up &&>::template __enable_implicit<_Up>() |
| 740 | 745 | , int> = 0> |
| 741 | 746 | _LIBCPP_INLINE_VISIBILITY |
| ... | ... | @@ -743,7 +748,7 @@ public: |
| 743 | 748 | { |
| 744 | 749 | this->__construct_from(_VSTD::move(__v)); |
| 745 | 750 | } |
| 746 | template <class _Up, enable_if_t< | |
| 751 | template <class _Up, _EnableIf< | |
| 747 | 752 | _CheckOptionalLikeCtor<_Up, _Up &&>::template __enable_explicit<_Up>() |
| 748 | 753 | , int> = 0> |
| 749 | 754 | _LIBCPP_INLINE_VISIBILITY |
| ... | ... | @@ -764,11 +769,12 @@ public: |
| 764 | 769 | |
| 765 | 770 | // LWG2756 |
| 766 | 771 | template <class _Up = value_type, |
| 767 | class = enable_if_t | |
| 768 | <__lazy_and< | |
| 769 | integral_constant<bool, | |
| 770 | !is_same_v<__uncvref_t<_Up>, optional> && | |
| 771 | !(is_same_v<_Up, value_type> && is_scalar_v<value_type>) | |
| 772 | class = _EnableIf< | |
| 773 | _And< | |
| 774 | _IsNotSame<__uncvref_t<_Up>, optional>, | |
| 775 | _Or< | |
| 776 | _IsNotSame<__uncvref_t<_Up>, value_type>, | |
| 777 | _Not<is_scalar<value_type>> | |
| 772 | 778 | >, |
| 773 | 779 | is_constructible<value_type, _Up>, |
| 774 | 780 | is_assignable<value_type&, _Up> |
| ... | ... | @@ -786,7 +792,7 @@ public: |
| 786 | 792 | } |
| 787 | 793 | |
| 788 | 794 | // LWG2756 |
| 789 | template <class _Up, enable_if_t< | |
| 795 | template <class _Up, _EnableIf< | |
| 790 | 796 | _CheckOptionalLikeAssign<_Up, _Up const&>::template __enable_assign<_Up>() |
| 791 | 797 | , int> = 0> |
| 792 | 798 | _LIBCPP_INLINE_VISIBILITY |
| ... | ... | @@ -798,7 +804,7 @@ public: |
| 798 | 804 | } |
| 799 | 805 | |
| 800 | 806 | // LWG2756 |
| 801 | template <class _Up, enable_if_t< | |
| 807 | template <class _Up, _EnableIf< | |
| 802 | 808 | _CheckOptionalLikeCtor<_Up, _Up &&>::template __enable_assign<_Up>() |
| 803 | 809 | , int> = 0> |
| 804 | 810 | _LIBCPP_INLINE_VISIBILITY |
| ... | ... | @@ -810,7 +816,7 @@ public: |
| 810 | 816 | } |
| 811 | 817 | |
| 812 | 818 | template <class... _Args, |
| 813 | class = enable_if_t | |
| 819 | class = _EnableIf | |
| 814 | 820 | < |
| 815 | 821 | is_constructible_v<value_type, _Args...> |
| 816 | 822 | > |
| ... | ... | @@ -825,7 +831,7 @@ public: |
| 825 | 831 | } |
| 826 | 832 | |
| 827 | 833 | template <class _Up, class... _Args, |
| 828 | class = enable_if_t | |
| 834 | class = _EnableIf | |
| 829 | 835 | < |
| 830 | 836 | is_constructible_v<value_type, initializer_list<_Up>&, _Args...> |
| 831 | 837 | > |
| ... | ... | @@ -1021,7 +1027,7 @@ template<class T> |
| 1021 | 1027 | // Comparisons between optionals |
| 1022 | 1028 | template <class _Tp, class _Up> |
| 1023 | 1029 | _LIBCPP_INLINE_VISIBILITY constexpr |
| 1024 | enable_if_t< | |
| 1030 | _EnableIf< | |
| 1025 | 1031 | is_convertible_v<decltype(_VSTD::declval<const _Tp&>() == |
| 1026 | 1032 | _VSTD::declval<const _Up&>()), bool>, |
| 1027 | 1033 | bool |
| ... | ... | @@ -1037,7 +1043,7 @@ operator==(const optional<_Tp>& __x, const optional<_Up>& __y) |
| 1037 | 1043 | |
| 1038 | 1044 | template <class _Tp, class _Up> |
| 1039 | 1045 | _LIBCPP_INLINE_VISIBILITY constexpr |
| 1040 | enable_if_t< | |
| 1046 | _EnableIf< | |
| 1041 | 1047 | is_convertible_v<decltype(_VSTD::declval<const _Tp&>() != |
| 1042 | 1048 | _VSTD::declval<const _Up&>()), bool>, |
| 1043 | 1049 | bool |
| ... | ... | @@ -1053,7 +1059,7 @@ operator!=(const optional<_Tp>& __x, const optional<_Up>& __y) |
| 1053 | 1059 | |
| 1054 | 1060 | template <class _Tp, class _Up> |
| 1055 | 1061 | _LIBCPP_INLINE_VISIBILITY constexpr |
| 1056 | enable_if_t< | |
| 1062 | _EnableIf< | |
| 1057 | 1063 | is_convertible_v<decltype(_VSTD::declval<const _Tp&>() < |
| 1058 | 1064 | _VSTD::declval<const _Up&>()), bool>, |
| 1059 | 1065 | bool |
| ... | ... | @@ -1069,7 +1075,7 @@ operator<(const optional<_Tp>& __x, const optional<_Up>& __y) |
| 1069 | 1075 | |
| 1070 | 1076 | template <class _Tp, class _Up> |
| 1071 | 1077 | _LIBCPP_INLINE_VISIBILITY constexpr |
| 1072 | enable_if_t< | |
| 1078 | _EnableIf< | |
| 1073 | 1079 | is_convertible_v<decltype(_VSTD::declval<const _Tp&>() > |
| 1074 | 1080 | _VSTD::declval<const _Up&>()), bool>, |
| 1075 | 1081 | bool |
| ... | ... | @@ -1085,7 +1091,7 @@ operator>(const optional<_Tp>& __x, const optional<_Up>& __y) |
| 1085 | 1091 | |
| 1086 | 1092 | template <class _Tp, class _Up> |
| 1087 | 1093 | _LIBCPP_INLINE_VISIBILITY constexpr |
| 1088 | enable_if_t< | |
| 1094 | _EnableIf< | |
| 1089 | 1095 | is_convertible_v<decltype(_VSTD::declval<const _Tp&>() <= |
| 1090 | 1096 | _VSTD::declval<const _Up&>()), bool>, |
| 1091 | 1097 | bool |
| ... | ... | @@ -1101,7 +1107,7 @@ operator<=(const optional<_Tp>& __x, const optional<_Up>& __y) |
| 1101 | 1107 | |
| 1102 | 1108 | template <class _Tp, class _Up> |
| 1103 | 1109 | _LIBCPP_INLINE_VISIBILITY constexpr |
| 1104 | enable_if_t< | |
| 1110 | _EnableIf< | |
| 1105 | 1111 | is_convertible_v<decltype(_VSTD::declval<const _Tp&>() >= |
| 1106 | 1112 | _VSTD::declval<const _Up&>()), bool>, |
| 1107 | 1113 | bool |
| ... | ... | @@ -1215,7 +1221,7 @@ operator>=(nullopt_t, const optional<_Tp>& __x) noexcept |
| 1215 | 1221 | // Comparisons with T |
| 1216 | 1222 | template <class _Tp, class _Up> |
| 1217 | 1223 | _LIBCPP_INLINE_VISIBILITY constexpr |
| 1218 | enable_if_t< | |
| 1224 | _EnableIf< | |
| 1219 | 1225 | is_convertible_v<decltype(_VSTD::declval<const _Tp&>() == |
| 1220 | 1226 | _VSTD::declval<const _Up&>()), bool>, |
| 1221 | 1227 | bool |
| ... | ... | @@ -1227,7 +1233,7 @@ operator==(const optional<_Tp>& __x, const _Up& __v) |
| 1227 | 1233 | |
| 1228 | 1234 | template <class _Tp, class _Up> |
| 1229 | 1235 | _LIBCPP_INLINE_VISIBILITY constexpr |
| 1230 | enable_if_t< | |
| 1236 | _EnableIf< | |
| 1231 | 1237 | is_convertible_v<decltype(_VSTD::declval<const _Tp&>() == |
| 1232 | 1238 | _VSTD::declval<const _Up&>()), bool>, |
| 1233 | 1239 | bool |
| ... | ... | @@ -1239,7 +1245,7 @@ operator==(const _Tp& __v, const optional<_Up>& __x) |
| 1239 | 1245 | |
| 1240 | 1246 | template <class _Tp, class _Up> |
| 1241 | 1247 | _LIBCPP_INLINE_VISIBILITY constexpr |
| 1242 | enable_if_t< | |
| 1248 | _EnableIf< | |
| 1243 | 1249 | is_convertible_v<decltype(_VSTD::declval<const _Tp&>() != |
| 1244 | 1250 | _VSTD::declval<const _Up&>()), bool>, |
| 1245 | 1251 | bool |
| ... | ... | @@ -1251,7 +1257,7 @@ operator!=(const optional<_Tp>& __x, const _Up& __v) |
| 1251 | 1257 | |
| 1252 | 1258 | template <class _Tp, class _Up> |
| 1253 | 1259 | _LIBCPP_INLINE_VISIBILITY constexpr |
| 1254 | enable_if_t< | |
| 1260 | _EnableIf< | |
| 1255 | 1261 | is_convertible_v<decltype(_VSTD::declval<const _Tp&>() != |
| 1256 | 1262 | _VSTD::declval<const _Up&>()), bool>, |
| 1257 | 1263 | bool |
| ... | ... | @@ -1263,7 +1269,7 @@ operator!=(const _Tp& __v, const optional<_Up>& __x) |
| 1263 | 1269 | |
| 1264 | 1270 | template <class _Tp, class _Up> |
| 1265 | 1271 | _LIBCPP_INLINE_VISIBILITY constexpr |
| 1266 | enable_if_t< | |
| 1272 | _EnableIf< | |
| 1267 | 1273 | is_convertible_v<decltype(_VSTD::declval<const _Tp&>() < |
| 1268 | 1274 | _VSTD::declval<const _Up&>()), bool>, |
| 1269 | 1275 | bool |
| ... | ... | @@ -1275,7 +1281,7 @@ operator<(const optional<_Tp>& __x, const _Up& __v) |
| 1275 | 1281 | |
| 1276 | 1282 | template <class _Tp, class _Up> |
| 1277 | 1283 | _LIBCPP_INLINE_VISIBILITY constexpr |
| 1278 | enable_if_t< | |
| 1284 | _EnableIf< | |
| 1279 | 1285 | is_convertible_v<decltype(_VSTD::declval<const _Tp&>() < |
| 1280 | 1286 | _VSTD::declval<const _Up&>()), bool>, |
| 1281 | 1287 | bool |
| ... | ... | @@ -1287,7 +1293,7 @@ operator<(const _Tp& __v, const optional<_Up>& __x) |
| 1287 | 1293 | |
| 1288 | 1294 | template <class _Tp, class _Up> |
| 1289 | 1295 | _LIBCPP_INLINE_VISIBILITY constexpr |
| 1290 | enable_if_t< | |
| 1296 | _EnableIf< | |
| 1291 | 1297 | is_convertible_v<decltype(_VSTD::declval<const _Tp&>() <= |
| 1292 | 1298 | _VSTD::declval<const _Up&>()), bool>, |
| 1293 | 1299 | bool |
| ... | ... | @@ -1299,7 +1305,7 @@ operator<=(const optional<_Tp>& __x, const _Up& __v) |
| 1299 | 1305 | |
| 1300 | 1306 | template <class _Tp, class _Up> |
| 1301 | 1307 | _LIBCPP_INLINE_VISIBILITY constexpr |
| 1302 | enable_if_t< | |
| 1308 | _EnableIf< | |
| 1303 | 1309 | is_convertible_v<decltype(_VSTD::declval<const _Tp&>() <= |
| 1304 | 1310 | _VSTD::declval<const _Up&>()), bool>, |
| 1305 | 1311 | bool |
| ... | ... | @@ -1311,7 +1317,7 @@ operator<=(const _Tp& __v, const optional<_Up>& __x) |
| 1311 | 1317 | |
| 1312 | 1318 | template <class _Tp, class _Up> |
| 1313 | 1319 | _LIBCPP_INLINE_VISIBILITY constexpr |
| 1314 | enable_if_t< | |
| 1320 | _EnableIf< | |
| 1315 | 1321 | is_convertible_v<decltype(_VSTD::declval<const _Tp&>() > |
| 1316 | 1322 | _VSTD::declval<const _Up&>()), bool>, |
| 1317 | 1323 | bool |
| ... | ... | @@ -1323,7 +1329,7 @@ operator>(const optional<_Tp>& __x, const _Up& __v) |
| 1323 | 1329 | |
| 1324 | 1330 | template <class _Tp, class _Up> |
| 1325 | 1331 | _LIBCPP_INLINE_VISIBILITY constexpr |
| 1326 | enable_if_t< | |
| 1332 | _EnableIf< | |
| 1327 | 1333 | is_convertible_v<decltype(_VSTD::declval<const _Tp&>() > |
| 1328 | 1334 | _VSTD::declval<const _Up&>()), bool>, |
| 1329 | 1335 | bool |
| ... | ... | @@ -1335,7 +1341,7 @@ operator>(const _Tp& __v, const optional<_Up>& __x) |
| 1335 | 1341 | |
| 1336 | 1342 | template <class _Tp, class _Up> |
| 1337 | 1343 | _LIBCPP_INLINE_VISIBILITY constexpr |
| 1338 | enable_if_t< | |
| 1344 | _EnableIf< | |
| 1339 | 1345 | is_convertible_v<decltype(_VSTD::declval<const _Tp&>() >= |
| 1340 | 1346 | _VSTD::declval<const _Up&>()), bool>, |
| 1341 | 1347 | bool |
| ... | ... | @@ -1347,7 +1353,7 @@ operator>=(const optional<_Tp>& __x, const _Up& __v) |
| 1347 | 1353 | |
| 1348 | 1354 | template <class _Tp, class _Up> |
| 1349 | 1355 | _LIBCPP_INLINE_VISIBILITY constexpr |
| 1350 | enable_if_t< | |
| 1356 | _EnableIf< | |
| 1351 | 1357 | is_convertible_v<decltype(_VSTD::declval<const _Tp&>() >= |
| 1352 | 1358 | _VSTD::declval<const _Up&>()), bool>, |
| 1353 | 1359 | bool |
| ... | ... | @@ -1360,7 +1366,7 @@ operator>=(const _Tp& __v, const optional<_Up>& __x) |
| 1360 | 1366 | |
| 1361 | 1367 | template <class _Tp> |
| 1362 | 1368 | inline _LIBCPP_INLINE_VISIBILITY |
| 1363 | enable_if_t< | |
| 1369 | _EnableIf< | |
| 1364 | 1370 | is_move_constructible_v<_Tp> && is_swappable_v<_Tp>, |
| 1365 | 1371 | void |
| 1366 | 1372 | > |
lib/libcxx/include/ostream+8-4| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===-------------------------- ostream -----------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 | |
| ... | ... | @@ -57,6 +56,7 @@ public: |
| 57 | 56 | basic_ostream& operator<<(long double f); |
| 58 | 57 | basic_ostream& operator<<(const void* p); |
| 59 | 58 | basic_ostream& operator<<(basic_streambuf<char_type,traits>* sb); |
| 59 | basic_ostream& operator<<(nullptr_t); | |
| 60 | 60 | |
| 61 | 61 | // 27.7.2.7 Unformatted output: |
| 62 | 62 | basic_ostream& put(char_type c); |
| ... | ... | @@ -219,6 +219,10 @@ public: |
| 219 | 219 | basic_ostream& operator<<(const void* __p); |
| 220 | 220 | basic_ostream& operator<<(basic_streambuf<char_type, traits_type>* __sb); |
| 221 | 221 | |
| 222 | _LIBCPP_INLINE_VISIBILITY | |
| 223 | basic_ostream& operator<<(nullptr_t) | |
| 224 | { return *this << "nullptr"; } | |
| 225 | ||
| 222 | 226 | // 27.7.2.7 Unformatted output: |
| 223 | 227 | basic_ostream& put(char_type __c); |
| 224 | 228 | basic_ostream& write(const char_type* __s, streamsize __n); |
lib/libcxx/include/queue+13-14| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===--------------------------- queue ------------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 | |
| ... | ... | @@ -71,8 +70,8 @@ public: |
| 71 | 70 | |
| 72 | 71 | template<class Container> |
| 73 | 72 | queue(Container) -> queue<typename Container::value_type, Container>; // C++17 |
| 74 | ||
| 75 | template<class Container, class Allocator> | |
| 73 | ||
| 74 | template<class Container, class Allocator> | |
| 76 | 75 | queue(Container, Allocator) -> queue<typename Container::value_type, Container>; // C++17 |
| 77 | 76 | |
| 78 | 77 | template <class T, class Container> |
| ... | ... | @@ -166,13 +165,13 @@ public: |
| 166 | 165 | template <class Compare, class Container> |
| 167 | 166 | priority_queue(Compare, Container) |
| 168 | 167 | -> priority_queue<typename Container::value_type, Container, Compare>; // C++17 |
| 169 | ||
| 170 | template<class InputIterator, | |
| 168 | ||
| 169 | template<class InputIterator, | |
| 171 | 170 | class Compare = less<typename iterator_traits<InputIterator>::value_type>, |
| 172 | 171 | class Container = vector<typename iterator_traits<InputIterator>::value_type>> |
| 173 | 172 | priority_queue(InputIterator, InputIterator, Compare = Compare(), Container = Container()) |
| 174 | 173 | -> priority_queue<typename iterator_traits<InputIterator>::value_type, Container, Compare>; // C++17 |
| 175 | ||
| 174 | ||
| 176 | 175 | template<class Compare, class Container, class Allocator> |
| 177 | 176 | priority_queue(Compare, Container, Allocator) |
| 178 | 177 | -> priority_queue<typename Container::value_type, Container, Compare>; // C++17 |
| ... | ... | @@ -347,7 +346,7 @@ template<class _Container, |
| 347 | 346 | > |
| 348 | 347 | queue(_Container) |
| 349 | 348 | -> queue<typename _Container::value_type, _Container>; |
| 350 | ||
| 349 | ||
| 351 | 350 | template<class _Container, |
| 352 | 351 | class _Alloc, |
| 353 | 352 | class = typename enable_if<!__is_allocator<_Container>::value, nullptr_t>::type, |
| ... | ... | @@ -559,8 +558,8 @@ template <class _Compare, |
| 559 | 558 | > |
| 560 | 559 | priority_queue(_Compare, _Container) |
| 561 | 560 | -> priority_queue<typename _Container::value_type, _Container, _Compare>; |
| 562 | ||
| 563 | template<class _InputIterator, | |
| 561 | ||
| 562 | template<class _InputIterator, | |
| 564 | 563 | class _Compare = less<typename iterator_traits<_InputIterator>::value_type>, |
| 565 | 564 | class _Container = vector<typename iterator_traits<_InputIterator>::value_type>, |
| 566 | 565 | class = typename enable_if< __is_input_iterator<_InputIterator>::value, nullptr_t>::type, |
| ... | ... | @@ -569,8 +568,8 @@ template<class _InputIterator, |
| 569 | 568 | > |
| 570 | 569 | priority_queue(_InputIterator, _InputIterator, _Compare = _Compare(), _Container = _Container()) |
| 571 | 570 | -> priority_queue<typename iterator_traits<_InputIterator>::value_type, _Container, _Compare>; |
| 572 | ||
| 573 | template<class _Compare, | |
| 571 | ||
| 572 | template<class _Compare, | |
| 574 | 573 | class _Container, |
| 575 | 574 | class _Alloc, |
| 576 | 575 | class = typename enable_if<!__is_allocator<_Compare>::value, nullptr_t>::type, |
lib/libcxx/include/random+11-12| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===--------------------------- random -----------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 | |
| ... | ... | @@ -2227,19 +2226,19 @@ template <class _UIntType, size_t __w, size_t __n, size_t __m, size_t __r, |
| 2227 | 2226 | template <class _UIntType, size_t __w, size_t __n, size_t __m, size_t __r, |
| 2228 | 2227 | _UIntType __a, size_t __u, _UIntType __d, size_t __s, |
| 2229 | 2228 | _UIntType __b, size_t __t, _UIntType __c, size_t __l, _UIntType __f> |
| 2230 | _LIBCPP_CONSTEXPR const size_t | |
| 2229 | _LIBCPP_CONSTEXPR const size_t | |
| 2231 | 2230 | mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::state_size; |
| 2232 | 2231 | |
| 2233 | 2232 | template <class _UIntType, size_t __w, size_t __n, size_t __m, size_t __r, |
| 2234 | 2233 | _UIntType __a, size_t __u, _UIntType __d, size_t __s, |
| 2235 | 2234 | _UIntType __b, size_t __t, _UIntType __c, size_t __l, _UIntType __f> |
| 2236 | _LIBCPP_CONSTEXPR const size_t | |
| 2235 | _LIBCPP_CONSTEXPR const size_t | |
| 2237 | 2236 | mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::shift_size; |
| 2238 | 2237 | |
| 2239 | 2238 | template <class _UIntType, size_t __w, size_t __n, size_t __m, size_t __r, |
| 2240 | 2239 | _UIntType __a, size_t __u, _UIntType __d, size_t __s, |
| 2241 | 2240 | _UIntType __b, size_t __t, _UIntType __c, size_t __l, _UIntType __f> |
| 2242 | _LIBCPP_CONSTEXPR const size_t | |
| 2241 | _LIBCPP_CONSTEXPR const size_t | |
| 2243 | 2242 | mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::mask_bits; |
| 2244 | 2243 | |
| 2245 | 2244 | template <class _UIntType, size_t __w, size_t __n, size_t __m, size_t __r, |
| ... | ... | @@ -2251,7 +2250,7 @@ template <class _UIntType, size_t __w, size_t __n, size_t __m, size_t __r, |
| 2251 | 2250 | template <class _UIntType, size_t __w, size_t __n, size_t __m, size_t __r, |
| 2252 | 2251 | _UIntType __a, size_t __u, _UIntType __d, size_t __s, |
| 2253 | 2252 | _UIntType __b, size_t __t, _UIntType __c, size_t __l, _UIntType __f> |
| 2254 | _LIBCPP_CONSTEXPR const size_t | |
| 2253 | _LIBCPP_CONSTEXPR const size_t | |
| 2255 | 2254 | mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::tempering_u; |
| 2256 | 2255 | |
| 2257 | 2256 | template <class _UIntType, size_t __w, size_t __n, size_t __m, size_t __r, |
| ... | ... | @@ -2263,7 +2262,7 @@ template <class _UIntType, size_t __w, size_t __n, size_t __m, size_t __r, |
| 2263 | 2262 | template <class _UIntType, size_t __w, size_t __n, size_t __m, size_t __r, |
| 2264 | 2263 | _UIntType __a, size_t __u, _UIntType __d, size_t __s, |
| 2265 | 2264 | _UIntType __b, size_t __t, _UIntType __c, size_t __l, _UIntType __f> |
| 2266 | _LIBCPP_CONSTEXPR const size_t | |
| 2265 | _LIBCPP_CONSTEXPR const size_t | |
| 2267 | 2266 | mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::tempering_s; |
| 2268 | 2267 | |
| 2269 | 2268 | template <class _UIntType, size_t __w, size_t __n, size_t __m, size_t __r, |
| ... | ... | @@ -2275,7 +2274,7 @@ template <class _UIntType, size_t __w, size_t __n, size_t __m, size_t __r, |
| 2275 | 2274 | template <class _UIntType, size_t __w, size_t __n, size_t __m, size_t __r, |
| 2276 | 2275 | _UIntType __a, size_t __u, _UIntType __d, size_t __s, |
| 2277 | 2276 | _UIntType __b, size_t __t, _UIntType __c, size_t __l, _UIntType __f> |
| 2278 | _LIBCPP_CONSTEXPR const size_t | |
| 2277 | _LIBCPP_CONSTEXPR const size_t | |
| 2279 | 2278 | mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::tempering_t; |
| 2280 | 2279 | |
| 2281 | 2280 | template <class _UIntType, size_t __w, size_t __n, size_t __m, size_t __r, |
| ... | ... | @@ -2287,7 +2286,7 @@ template <class _UIntType, size_t __w, size_t __n, size_t __m, size_t __r, |
| 2287 | 2286 | template <class _UIntType, size_t __w, size_t __n, size_t __m, size_t __r, |
| 2288 | 2287 | _UIntType __a, size_t __u, _UIntType __d, size_t __s, |
| 2289 | 2288 | _UIntType __b, size_t __t, _UIntType __c, size_t __l, _UIntType __f> |
| 2290 | _LIBCPP_CONSTEXPR const size_t | |
| 2289 | _LIBCPP_CONSTEXPR const size_t | |
| 2291 | 2290 | mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::tempering_l; |
| 2292 | 2291 | |
| 2293 | 2292 | template <class _UIntType, size_t __w, size_t __n, size_t __m, size_t __r, |
| ... | ... | @@ -6427,7 +6426,7 @@ public: |
| 6427 | 6426 | param_type(size_t __nw, result_type __xmin, result_type __xmax, |
| 6428 | 6427 | _UnaryOperation __fw); |
| 6429 | 6428 | param_type & operator=(const param_type& __rhs); |
| 6430 | ||
| 6429 | ||
| 6431 | 6430 | _LIBCPP_INLINE_VISIBILITY |
| 6432 | 6431 | vector<result_type> intervals() const {return __b_;} |
| 6433 | 6432 | _LIBCPP_INLINE_VISIBILITY |
lib/libcxx/include/ratio+3-4| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===---------------------------- ratio -----------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 |
lib/libcxx/include/regex+89-46| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===--------------------------- regex ------------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 | |
| ... | ... | @@ -678,7 +677,7 @@ public: |
| 678 | 677 | regex_constants::match_flag_type m = regex_constants::match_default); |
| 679 | 678 | regex_iterator(_BidirectionalIterator __a, _BidirectionalIterator __b, |
| 680 | 679 | const regex_type&& __re, |
| 681 | regex_constants::match_flag_type __m | |
| 680 | regex_constants::match_flag_type __m | |
| 682 | 681 | = regex_constants::match_default) = delete; // C++14 |
| 683 | 682 | regex_iterator(const regex_iterator&); |
| 684 | 683 | regex_iterator& operator=(const regex_iterator&); |
| ... | ... | @@ -794,7 +793,11 @@ enum syntax_option_type |
| 794 | 793 | nosubs = 1 << 1, |
| 795 | 794 | optimize = 1 << 2, |
| 796 | 795 | collate = 1 << 3, |
| 796 | #ifdef _LIBCPP_ABI_REGEX_CONSTANTS_NONZERO | |
| 797 | ECMAScript = 1 << 9, | |
| 798 | #else | |
| 797 | 799 | ECMAScript = 0, |
| 800 | #endif | |
| 798 | 801 | basic = 1 << 4, |
| 799 | 802 | extended = 1 << 5, |
| 800 | 803 | awk = 1 << 6, |
| ... | ... | @@ -802,6 +805,16 @@ enum syntax_option_type |
| 802 | 805 | egrep = 1 << 8 |
| 803 | 806 | }; |
| 804 | 807 | |
| 808 | inline _LIBCPP_CONSTEXPR | |
| 809 | syntax_option_type __get_grammar(syntax_option_type __g) | |
| 810 | { | |
| 811 | #ifdef _LIBCPP_ABI_REGEX_CONSTANTS_NONZERO | |
| 812 | return static_cast<syntax_option_type>(__g & 0x3F0); | |
| 813 | #else | |
| 814 | return static_cast<syntax_option_type>(__g & 0x1F0); | |
| 815 | #endif | |
| 816 | } | |
| 817 | ||
| 805 | 818 | inline _LIBCPP_INLINE_VISIBILITY |
| 806 | 819 | _LIBCPP_CONSTEXPR |
| 807 | 820 | syntax_option_type |
| ... | ... | @@ -988,16 +1001,7 @@ public: |
| 988 | 1001 | typedef locale locale_type; |
| 989 | 1002 | typedef ctype_base::mask char_class_type; |
| 990 | 1003 | |
| 991 | #if defined(__mips__) && defined(__GLIBC__) | |
| 992 | static const char_class_type __regex_word = static_cast<char_class_type>(_ISbit(15)); | |
| 993 | #elif defined(__NetBSD__) | |
| 994 | // NetBSD defines classes up to 0x2000 | |
| 995 | // see sys/ctype_bits.h, _CTYPE_Q | |
| 996 | static const char_class_type __regex_word = 0x8000; | |
| 997 | #else | |
| 998 | static const char_class_type __regex_word = 0x80; | |
| 999 | #endif | |
| 1000 | ||
| 1004 | static const char_class_type __regex_word = ctype_base::__regex_word; | |
| 1001 | 1005 | private: |
| 1002 | 1006 | locale __loc_; |
| 1003 | 1007 | const ctype<char_type>* __ct_; |
| ... | ... | @@ -2293,7 +2297,7 @@ public: |
| 2293 | 2297 | else |
| 2294 | 2298 | { |
| 2295 | 2299 | if (__b.size() != 1 || __e.size() != 1) |
| 2296 | __throw_regex_error<regex_constants::error_collate>(); | |
| 2300 | __throw_regex_error<regex_constants::error_range>(); | |
| 2297 | 2301 | if (__icase_) |
| 2298 | 2302 | { |
| 2299 | 2303 | __b[0] = __traits_.translate_nocase(__b[0]); |
| ... | ... | @@ -2527,19 +2531,27 @@ public: |
| 2527 | 2531 | // construct/copy/destroy: |
| 2528 | 2532 | _LIBCPP_INLINE_VISIBILITY |
| 2529 | 2533 | basic_regex() |
| 2530 | : __flags_(), __marked_count_(0), __loop_count_(0), __open_count_(0), | |
| 2534 | : __flags_(regex_constants::ECMAScript), __marked_count_(0), __loop_count_(0), __open_count_(0), | |
| 2531 | 2535 | __end_(0) |
| 2532 | 2536 | {} |
| 2533 | 2537 | _LIBCPP_INLINE_VISIBILITY |
| 2534 | 2538 | explicit basic_regex(const value_type* __p, flag_type __f = regex_constants::ECMAScript) |
| 2535 | 2539 | : __flags_(__f), __marked_count_(0), __loop_count_(0), __open_count_(0), |
| 2536 | 2540 | __end_(0) |
| 2537 | {__parse(__p, __p + __traits_.length(__p));} | |
| 2541 | { | |
| 2542 | if (__get_grammar(__flags_) == 0) __flags_ |= regex_constants::ECMAScript; | |
| 2543 | __parse(__p, __p + __traits_.length(__p)); | |
| 2544 | } | |
| 2545 | ||
| 2538 | 2546 | _LIBCPP_INLINE_VISIBILITY |
| 2539 | 2547 | basic_regex(const value_type* __p, size_t __len, flag_type __f = regex_constants::ECMAScript) |
| 2540 | 2548 | : __flags_(__f), __marked_count_(0), __loop_count_(0), __open_count_(0), |
| 2541 | 2549 | __end_(0) |
| 2542 | {__parse(__p, __p + __len);} | |
| 2550 | { | |
| 2551 | if (__get_grammar(__flags_) == 0) __flags_ |= regex_constants::ECMAScript; | |
| 2552 | __parse(__p, __p + __len); | |
| 2553 | } | |
| 2554 | ||
| 2543 | 2555 | // basic_regex(const basic_regex&) = default; |
| 2544 | 2556 | // basic_regex(basic_regex&&) = default; |
| 2545 | 2557 | template <class _ST, class _SA> |
| ... | ... | @@ -2548,21 +2560,31 @@ public: |
| 2548 | 2560 | flag_type __f = regex_constants::ECMAScript) |
| 2549 | 2561 | : __flags_(__f), __marked_count_(0), __loop_count_(0), __open_count_(0), |
| 2550 | 2562 | __end_(0) |
| 2551 | {__parse(__p.begin(), __p.end());} | |
| 2563 | { | |
| 2564 | if (__get_grammar(__flags_) == 0) __flags_ |= regex_constants::ECMAScript; | |
| 2565 | __parse(__p.begin(), __p.end()); | |
| 2566 | } | |
| 2567 | ||
| 2552 | 2568 | template <class _ForwardIterator> |
| 2553 | 2569 | _LIBCPP_INLINE_VISIBILITY |
| 2554 | 2570 | basic_regex(_ForwardIterator __first, _ForwardIterator __last, |
| 2555 | 2571 | flag_type __f = regex_constants::ECMAScript) |
| 2556 | 2572 | : __flags_(__f), __marked_count_(0), __loop_count_(0), __open_count_(0), |
| 2557 | 2573 | __end_(0) |
| 2558 | {__parse(__first, __last);} | |
| 2574 | { | |
| 2575 | if (__get_grammar(__flags_) == 0) __flags_ |= regex_constants::ECMAScript; | |
| 2576 | __parse(__first, __last); | |
| 2577 | } | |
| 2559 | 2578 | #ifndef _LIBCPP_CXX03_LANG |
| 2560 | 2579 | _LIBCPP_INLINE_VISIBILITY |
| 2561 | 2580 | basic_regex(initializer_list<value_type> __il, |
| 2562 | 2581 | flag_type __f = regex_constants::ECMAScript) |
| 2563 | 2582 | : __flags_(__f), __marked_count_(0), __loop_count_(0), __open_count_(0), |
| 2564 | 2583 | __end_(0) |
| 2565 | {__parse(__il.begin(), __il.end());} | |
| 2584 | { | |
| 2585 | if (__get_grammar(__flags_) == 0) __flags_ |= regex_constants::ECMAScript; | |
| 2586 | __parse(__il.begin(), __il.end()); | |
| 2587 | } | |
| 2566 | 2588 | #endif // _LIBCPP_CXX03_LANG |
| 2567 | 2589 | |
| 2568 | 2590 | // ~basic_regex() = default; |
| ... | ... | @@ -3044,7 +3066,7 @@ basic_regex<_CharT, _Traits>::__parse(_ForwardIterator __first, |
| 3044 | 3066 | __h.release(); |
| 3045 | 3067 | __end_ = __start_.get(); |
| 3046 | 3068 | } |
| 3047 | switch (__flags_ & 0x1F0) | |
| 3069 | switch (__get_grammar(__flags_)) | |
| 3048 | 3070 | { |
| 3049 | 3071 | case ECMAScript: |
| 3050 | 3072 | __first = __parse_ecma_exp(__first, __last); |
| ... | ... | @@ -3379,7 +3401,7 @@ basic_regex<_CharT, _Traits>::__parse_BACKREF(_ForwardIterator __first, |
| 3379 | 3401 | if (__temp != __last) |
| 3380 | 3402 | { |
| 3381 | 3403 | if (*__first == '\\') |
| 3382 | { | |
| 3404 | { | |
| 3383 | 3405 | int __val = __traits_.value(*__temp, 10); |
| 3384 | 3406 | if (__val >= 1 && __val <= 9) |
| 3385 | 3407 | { |
| ... | ... | @@ -3513,7 +3535,7 @@ basic_regex<_CharT, _Traits>::__parse_QUOTED_CHAR_ERE(_ForwardIterator __first, |
| 3513 | 3535 | __first = ++__temp; |
| 3514 | 3536 | break; |
| 3515 | 3537 | default: |
| 3516 | if ((__flags_ & 0x1F0) == awk) | |
| 3538 | if (__get_grammar(__flags_) == awk) | |
| 3517 | 3539 | __first = __parse_awk_escape(++__first, __last); |
| 3518 | 3540 | break; |
| 3519 | 3541 | } |
| ... | ... | @@ -3597,7 +3619,7 @@ basic_regex<_CharT, _Traits>::__parse_ERE_dupl_symbol(_ForwardIterator __first, |
| 3597 | 3619 | { |
| 3598 | 3620 | if (__first != __last) |
| 3599 | 3621 | { |
| 3600 | unsigned __grammar = __flags_ & 0x1F0; | |
| 3622 | unsigned __grammar = __get_grammar(__flags_); | |
| 3601 | 3623 | switch (*__first) |
| 3602 | 3624 | { |
| 3603 | 3625 | case '*': |
| ... | ... | @@ -3718,7 +3740,7 @@ basic_regex<_CharT, _Traits>::__parse_bracket_expression(_ForwardIterator __firs |
| 3718 | 3740 | // __ml owned by *this |
| 3719 | 3741 | if (__first == __last) |
| 3720 | 3742 | __throw_regex_error<regex_constants::error_brack>(); |
| 3721 | if ((__flags_ & 0x1F0) != ECMAScript && *__first == ']') | |
| 3743 | if (__get_grammar(__flags_) != ECMAScript && *__first == ']') | |
| 3722 | 3744 | { |
| 3723 | 3745 | __ml->__add_char(']'); |
| 3724 | 3746 | ++__first; |
| ... | ... | @@ -3779,7 +3801,7 @@ basic_regex<_CharT, _Traits>::__parse_expression_term(_ForwardIterator __first, |
| 3779 | 3801 | else if (*__temp == '.') |
| 3780 | 3802 | __first = __parse_collating_symbol(++__temp, __last, __start_range); |
| 3781 | 3803 | } |
| 3782 | unsigned __grammar = __flags_ & 0x1F0; | |
| 3804 | unsigned __grammar = __get_grammar(__flags_); | |
| 3783 | 3805 | if (__start_range.empty()) |
| 3784 | 3806 | { |
| 3785 | 3807 | if ((__grammar == ECMAScript || __grammar == awk) && *__first == '\\') |
| ... | ... | @@ -4076,7 +4098,7 @@ basic_regex<_CharT, _Traits>::__parse_DUP_COUNT(_ForwardIterator __first, |
| 4076 | 4098 | if ( __val != -1 ) |
| 4077 | 4099 | { |
| 4078 | 4100 | __c = __val; |
| 4079 | for (++__first; | |
| 4101 | for (++__first; | |
| 4080 | 4102 | __first != __last && ( __val = __traits_.value(*__first, 10)) != -1; |
| 4081 | 4103 | ++__first) |
| 4082 | 4104 | { |
| ... | ... | @@ -4456,7 +4478,7 @@ basic_regex<_CharT, _Traits>::__parse_character_escape(_ForwardIterator __first, |
| 4456 | 4478 | case 'c': |
| 4457 | 4479 | if ((__t = _VSTD::next(__first)) != __last) |
| 4458 | 4480 | { |
| 4459 | if (('A' <= *__t && *__t <= 'Z') || | |
| 4481 | if (('A' <= *__t && *__t <= 'Z') || | |
| 4460 | 4482 | ('a' <= *__t && *__t <= 'z')) |
| 4461 | 4483 | { |
| 4462 | 4484 | if (__str) |
| ... | ... | @@ -4465,7 +4487,7 @@ basic_regex<_CharT, _Traits>::__parse_character_escape(_ForwardIterator __first, |
| 4465 | 4487 | __push_char(_CharT(*__t % 32)); |
| 4466 | 4488 | __first = ++__t; |
| 4467 | 4489 | } |
| 4468 | else | |
| 4490 | else | |
| 4469 | 4491 | __throw_regex_error<regex_constants::error_escape>(); |
| 4470 | 4492 | } |
| 4471 | 4493 | else |
| ... | ... | @@ -5265,21 +5287,41 @@ public: |
| 5265 | 5287 | // element access: |
| 5266 | 5288 | _LIBCPP_INLINE_VISIBILITY |
| 5267 | 5289 | difference_type length(size_type __sub = 0) const |
| 5268 | {return (*this)[__sub].length();} | |
| 5290 | { | |
| 5291 | _LIBCPP_ASSERT(ready(), "match_results::length() called when not ready"); | |
| 5292 | return (*this)[__sub].length(); | |
| 5293 | } | |
| 5269 | 5294 | _LIBCPP_INLINE_VISIBILITY |
| 5270 | 5295 | difference_type position(size_type __sub = 0) const |
| 5271 | {return _VSTD::distance(__position_start_, (*this)[__sub].first);} | |
| 5296 | { | |
| 5297 | _LIBCPP_ASSERT(ready(), "match_results::position() called when not ready"); | |
| 5298 | return _VSTD::distance(__position_start_, (*this)[__sub].first); | |
| 5299 | } | |
| 5272 | 5300 | _LIBCPP_INLINE_VISIBILITY |
| 5273 | 5301 | string_type str(size_type __sub = 0) const |
| 5274 | {return (*this)[__sub].str();} | |
| 5302 | { | |
| 5303 | _LIBCPP_ASSERT(ready(), "match_results::str() called when not ready"); | |
| 5304 | return (*this)[__sub].str(); | |
| 5305 | } | |
| 5275 | 5306 | _LIBCPP_INLINE_VISIBILITY |
| 5276 | 5307 | const_reference operator[](size_type __n) const |
| 5277 | {return __n < __matches_.size() ? __matches_[__n] : __unmatched_;} | |
| 5308 | { | |
| 5309 | _LIBCPP_ASSERT(ready(), "match_results::operator[]() called when not ready"); | |
| 5310 | return __n < __matches_.size() ? __matches_[__n] : __unmatched_; | |
| 5311 | } | |
| 5278 | 5312 | |
| 5279 | 5313 | _LIBCPP_INLINE_VISIBILITY |
| 5280 | const_reference prefix() const {return __prefix_;} | |
| 5314 | const_reference prefix() const | |
| 5315 | { | |
| 5316 | _LIBCPP_ASSERT(ready(), "match_results::prefix() called when not ready"); | |
| 5317 | return __prefix_; | |
| 5318 | } | |
| 5281 | 5319 | _LIBCPP_INLINE_VISIBILITY |
| 5282 | const_reference suffix() const {return __suffix_;} | |
| 5320 | const_reference suffix() const | |
| 5321 | { | |
| 5322 | _LIBCPP_ASSERT(ready(), "match_results::suffix() called when not ready"); | |
| 5323 | return __suffix_; | |
| 5324 | } | |
| 5283 | 5325 | |
| 5284 | 5326 | _LIBCPP_INLINE_VISIBILITY |
| 5285 | 5327 | const_iterator begin() const {return empty() ? __matches_.end() : __matches_.begin();} |
| ... | ... | @@ -5417,6 +5459,7 @@ match_results<_BidirectionalIterator, _Allocator>::format(_OutputIter __output_i |
| 5417 | 5459 | const char_type* __fmt_first, const char_type* __fmt_last, |
| 5418 | 5460 | regex_constants::match_flag_type __flags) const |
| 5419 | 5461 | { |
| 5462 | _LIBCPP_ASSERT(ready(), "match_results::format() called when not ready"); | |
| 5420 | 5463 | if (__flags & regex_constants::format_sed) |
| 5421 | 5464 | { |
| 5422 | 5465 | for (; __fmt_first != __fmt_last; ++__fmt_first) |
| ... | ... | @@ -5849,7 +5892,7 @@ basic_regex<_CharT, _Traits>::__match_at_start( |
| 5849 | 5892 | match_results<const _CharT*, _Allocator>& __m, |
| 5850 | 5893 | regex_constants::match_flag_type __flags, bool __at_first) const |
| 5851 | 5894 | { |
| 5852 | if ((__flags_ & 0x1F0) == ECMAScript) | |
| 5895 | if (__get_grammar(__flags_) == ECMAScript) | |
| 5853 | 5896 | return __match_at_start_ecma(__first, __last, __m, __flags, __at_first); |
| 5854 | 5897 | if (mark_count() == 0) |
| 5855 | 5898 | return __match_at_start_posix_nosubs(__first, __last, __m, __flags, __at_first); |
| ... | ... | @@ -5866,7 +5909,7 @@ basic_regex<_CharT, _Traits>::__search( |
| 5866 | 5909 | { |
| 5867 | 5910 | __m.__init(1 + mark_count(), __first, __last, |
| 5868 | 5911 | __flags & regex_constants::__no_update_pos); |
| 5869 | if (__match_at_start(__first, __last, __m, __flags, | |
| 5912 | if (__match_at_start(__first, __last, __m, __flags, | |
| 5870 | 5913 | !(__flags & regex_constants::__no_update_pos))) |
| 5871 | 5914 | { |
| 5872 | 5915 | __m.__prefix_.second = __m[0].first; |
| ... | ... | @@ -6012,7 +6055,7 @@ bool |
| 6012 | 6055 | regex_search(const basic_string<_Cp, _ST, _SA>&& __s, |
| 6013 | 6056 | match_results<typename basic_string<_Cp, _ST, _SA>::const_iterator, _Ap>&, |
| 6014 | 6057 | const basic_regex<_Cp, _Tp>& __e, |
| 6015 | regex_constants::match_flag_type __flags = regex_constants::match_default) = delete; | |
| 6058 | regex_constants::match_flag_type __flags = regex_constants::match_default) = delete; | |
| 6016 | 6059 | #endif |
| 6017 | 6060 | |
| 6018 | 6061 | // regex_match |
| ... | ... | @@ -6076,7 +6119,7 @@ bool |
| 6076 | 6119 | regex_match(const basic_string<_CharT, _ST, _SA>&& __s, |
| 6077 | 6120 | match_results<typename basic_string<_CharT, _ST, _SA>::const_iterator, _Allocator>& __m, |
| 6078 | 6121 | const basic_regex<_CharT, _Traits>& __e, |
| 6079 | regex_constants::match_flag_type __flags = regex_constants::match_default) = delete; | |
| 6122 | regex_constants::match_flag_type __flags = regex_constants::match_default) = delete; | |
| 6080 | 6123 | #endif |
| 6081 | 6124 | |
| 6082 | 6125 | template <class _CharT, class _Traits> |
| ... | ... | @@ -6129,7 +6172,7 @@ public: |
| 6129 | 6172 | #if _LIBCPP_STD_VER > 11 |
| 6130 | 6173 | regex_iterator(_BidirectionalIterator __a, _BidirectionalIterator __b, |
| 6131 | 6174 | const regex_type&& __re, |
| 6132 | regex_constants::match_flag_type __m | |
| 6175 | regex_constants::match_flag_type __m | |
| 6133 | 6176 | = regex_constants::match_default) = delete; |
| 6134 | 6177 | #endif |
| 6135 | 6178 | |
| ... | ... | @@ -6140,7 +6183,7 @@ public: |
| 6140 | 6183 | _LIBCPP_INLINE_VISIBILITY |
| 6141 | 6184 | reference operator*() const {return __match_;} |
| 6142 | 6185 | _LIBCPP_INLINE_VISIBILITY |
| 6143 | pointer operator->() const {return &__match_;} | |
| 6186 | pointer operator->() const {return _VSTD::addressof(__match_);} | |
| 6144 | 6187 | |
| 6145 | 6188 | regex_iterator& operator++(); |
| 6146 | 6189 | _LIBCPP_INLINE_VISIBILITY |
| ... | ... | @@ -6164,7 +6207,7 @@ regex_iterator<_BidirectionalIterator, _CharT, _Traits>:: |
| 6164 | 6207 | const regex_type& __re, regex_constants::match_flag_type __m) |
| 6165 | 6208 | : __begin_(__a), |
| 6166 | 6209 | __end_(__b), |
| 6167 | __pregex_(&__re), | |
| 6210 | __pregex_(_VSTD::addressof(__re)), | |
| 6168 | 6211 | __flags_(__m) |
| 6169 | 6212 | { |
| 6170 | 6213 | _VSTD::regex_search(__begin_, __end_, __match_, *__pregex_, __flags_); |
| ... | ... | @@ -6325,7 +6368,7 @@ private: |
| 6325 | 6368 | __result_ = &__position_->prefix(); |
| 6326 | 6369 | else |
| 6327 | 6370 | __result_ = &(*__position_)[__subs_[__n_]]; |
| 6328 | } | |
| 6371 | } | |
| 6329 | 6372 | }; |
| 6330 | 6373 | |
| 6331 | 6374 | template <class _BidirectionalIterator, class _CharT, class _Traits> |
| ... | ... | @@ -6405,7 +6448,7 @@ regex_token_iterator<_BidirectionalIterator, _CharT, _Traits>:: |
| 6405 | 6448 | regex_constants::match_flag_type __m) |
| 6406 | 6449 | : __position_(__a, __b, __re, __m), |
| 6407 | 6450 | __n_(0), |
| 6408 | __subs_(__submatches, __submatches + _Np) | |
| 6451 | __subs_(begin(__submatches), end(__submatches)) | |
| 6409 | 6452 | { |
| 6410 | 6453 | __init(__a, __b); |
| 6411 | 6454 | } |
lib/libcxx/include/scoped_allocator+3-4| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===-------------------------- scoped_allocator --------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 |
lib/libcxx/include/set+87-11| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===---------------------------- set -------------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 | |
| ... | ... | @@ -156,9 +155,9 @@ public: |
| 156 | 155 | template<typename K> |
| 157 | 156 | const_iterator find(const K& x) const; // C++14 |
| 158 | 157 | template<typename K> |
| 159 | size_type count(const K& x) const; // C++14 | |
| 160 | ||
| 158 | size_type count(const K& x) const; // C++14 | |
| 161 | 159 | size_type count(const key_type& k) const; |
| 160 | bool contains(const key_type& x) const; // C++20 | |
| 162 | 161 | iterator lower_bound(const key_type& k); |
| 163 | 162 | const_iterator lower_bound(const key_type& k) const; |
| 164 | 163 | template<typename K> |
| ... | ... | @@ -355,8 +354,10 @@ public: |
| 355 | 354 | iterator find(const K& x); |
| 356 | 355 | template<typename K> |
| 357 | 356 | const_iterator find(const K& x) const; // C++14 |
| 358 | ||
| 357 | template<typename K> | |
| 358 | size_type count(const K& x) const; // C++14 | |
| 359 | 359 | size_type count(const key_type& k) const; |
| 360 | bool contains(const key_type& x) const; // C++20 | |
| 360 | 361 | iterator lower_bound(const key_type& k); |
| 361 | 362 | const_iterator lower_bound(const key_type& k) const; |
| 362 | 363 | template<typename K> |
| ... | ... | @@ -447,11 +448,10 @@ public: |
| 447 | 448 | typedef key_type value_type; |
| 448 | 449 | typedef _Compare key_compare; |
| 449 | 450 | typedef key_compare value_compare; |
| 450 | typedef _Allocator allocator_type; | |
| 451 | typedef typename __identity<_Allocator>::type allocator_type; | |
| 451 | 452 | typedef value_type& reference; |
| 452 | 453 | typedef const value_type& const_reference; |
| 453 | 454 | |
| 454 | static_assert(sizeof(__diagnose_non_const_comparator<_Key, _Compare>()), ""); | |
| 455 | 455 | static_assert((is_same<typename allocator_type::value_type, value_type>::value), |
| 456 | 456 | "Allocator::value_type must be same type as value_type"); |
| 457 | 457 | |
| ... | ... | @@ -597,6 +597,11 @@ public: |
| 597 | 597 | } |
| 598 | 598 | #endif // _LIBCPP_CXX03_LANG |
| 599 | 599 | |
| 600 | _LIBCPP_INLINE_VISIBILITY | |
| 601 | ~set() { | |
| 602 | static_assert(sizeof(__diagnose_non_const_comparator<_Key, _Compare>()), ""); | |
| 603 | } | |
| 604 | ||
| 600 | 605 | _LIBCPP_INLINE_VISIBILITY |
| 601 | 606 | iterator begin() _NOEXCEPT {return __tree_.begin();} |
| 602 | 607 | _LIBCPP_INLINE_VISIBILITY |
| ... | ... | @@ -784,6 +789,12 @@ public: |
| 784 | 789 | typename enable_if<__is_transparent<_Compare, _K2>::value,size_type>::type |
| 785 | 790 | count(const _K2& __k) const {return __tree_.__count_multi(__k);} |
| 786 | 791 | #endif |
| 792 | ||
| 793 | #if _LIBCPP_STD_VER > 17 | |
| 794 | _LIBCPP_INLINE_VISIBILITY | |
| 795 | bool contains(const key_type& __k) const {return find(__k) != end();} | |
| 796 | #endif // _LIBCPP_STD_VER > 17 | |
| 797 | ||
| 787 | 798 | _LIBCPP_INLINE_VISIBILITY |
| 788 | 799 | iterator lower_bound(const key_type& __k) |
| 789 | 800 | {return __tree_.lower_bound(__k);} |
| ... | ... | @@ -837,6 +848,34 @@ public: |
| 837 | 848 | #endif |
| 838 | 849 | }; |
| 839 | 850 | |
| 851 | #ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES | |
| 852 | template<class _InputIterator, | |
| 853 | class _Compare = less<typename iterator_traits<_InputIterator>::value_type>, | |
| 854 | class _Allocator = allocator<typename iterator_traits<_InputIterator>::value_type>, | |
| 855 | class = typename enable_if<__is_allocator<_Allocator>::value, void>::type, | |
| 856 | class = typename enable_if<!__is_allocator<_Compare>::value, void>::type> | |
| 857 | set(_InputIterator, _InputIterator, _Compare = _Compare(), _Allocator = _Allocator()) | |
| 858 | -> set<typename iterator_traits<_InputIterator>::value_type, _Compare, _Allocator>; | |
| 859 | ||
| 860 | template<class _Key, class _Compare = less<_Key>, | |
| 861 | class _Allocator = allocator<_Key>, | |
| 862 | class = typename enable_if<__is_allocator<_Allocator>::value, void>::type, | |
| 863 | class = typename enable_if<!__is_allocator<_Compare>::value, void>::type> | |
| 864 | set(initializer_list<_Key>, _Compare = _Compare(), _Allocator = _Allocator()) | |
| 865 | -> set<_Key, _Compare, _Allocator>; | |
| 866 | ||
| 867 | template<class _InputIterator, class _Allocator, | |
| 868 | class = typename enable_if<__is_allocator<_Allocator>::value, void>::type> | |
| 869 | set(_InputIterator, _InputIterator, _Allocator) | |
| 870 | -> set<typename iterator_traits<_InputIterator>::value_type, | |
| 871 | less<typename iterator_traits<_InputIterator>::value_type>, _Allocator>; | |
| 872 | ||
| 873 | template<class _Key, class _Allocator, | |
| 874 | class = typename enable_if<__is_allocator<_Allocator>::value, void>::type> | |
| 875 | set(initializer_list<_Key>, _Allocator) | |
| 876 | -> set<_Key, less<_Key>, _Allocator>; | |
| 877 | #endif | |
| 878 | ||
| 840 | 879 | #ifndef _LIBCPP_CXX03_LANG |
| 841 | 880 | |
| 842 | 881 | template <class _Key, class _Compare, class _Allocator> |
| ... | ... | @@ -935,11 +974,10 @@ public: |
| 935 | 974 | typedef key_type value_type; |
| 936 | 975 | typedef _Compare key_compare; |
| 937 | 976 | typedef key_compare value_compare; |
| 938 | typedef _Allocator allocator_type; | |
| 977 | typedef typename __identity<_Allocator>::type allocator_type; | |
| 939 | 978 | typedef value_type& reference; |
| 940 | 979 | typedef const value_type& const_reference; |
| 941 | 980 | |
| 942 | static_assert(sizeof(__diagnose_non_const_comparator<_Key, _Compare>()), ""); | |
| 943 | 981 | static_assert((is_same<typename allocator_type::value_type, value_type>::value), |
| 944 | 982 | "Allocator::value_type must be same type as value_type"); |
| 945 | 983 | |
| ... | ... | @@ -1084,6 +1122,11 @@ public: |
| 1084 | 1122 | } |
| 1085 | 1123 | #endif // _LIBCPP_CXX03_LANG |
| 1086 | 1124 | |
| 1125 | _LIBCPP_INLINE_VISIBILITY | |
| 1126 | ~multiset() { | |
| 1127 | static_assert(sizeof(__diagnose_non_const_comparator<_Key, _Compare>()), ""); | |
| 1128 | } | |
| 1129 | ||
| 1087 | 1130 | _LIBCPP_INLINE_VISIBILITY |
| 1088 | 1131 | iterator begin() _NOEXCEPT {return __tree_.begin();} |
| 1089 | 1132 | _LIBCPP_INLINE_VISIBILITY |
| ... | ... | @@ -1272,6 +1315,11 @@ public: |
| 1272 | 1315 | count(const _K2& __k) const {return __tree_.__count_multi(__k);} |
| 1273 | 1316 | #endif |
| 1274 | 1317 | |
| 1318 | #if _LIBCPP_STD_VER > 17 | |
| 1319 | _LIBCPP_INLINE_VISIBILITY | |
| 1320 | bool contains(const key_type& __k) const {return find(__k) != end();} | |
| 1321 | #endif // _LIBCPP_STD_VER > 17 | |
| 1322 | ||
| 1275 | 1323 | _LIBCPP_INLINE_VISIBILITY |
| 1276 | 1324 | iterator lower_bound(const key_type& __k) |
| 1277 | 1325 | {return __tree_.lower_bound(__k);} |
| ... | ... | @@ -1325,6 +1373,34 @@ public: |
| 1325 | 1373 | #endif |
| 1326 | 1374 | }; |
| 1327 | 1375 | |
| 1376 | #ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES | |
| 1377 | template<class _InputIterator, | |
| 1378 | class _Compare = less<typename iterator_traits<_InputIterator>::value_type>, | |
| 1379 | class _Allocator = allocator<typename iterator_traits<_InputIterator>::value_type>, | |
| 1380 | class = typename enable_if<__is_allocator<_Allocator>::value, void>::type, | |
| 1381 | class = typename enable_if<!__is_allocator<_Compare>::value, void>::type> | |
| 1382 | multiset(_InputIterator, _InputIterator, _Compare = _Compare(), _Allocator = _Allocator()) | |
| 1383 | -> multiset<typename iterator_traits<_InputIterator>::value_type, _Compare, _Allocator>; | |
| 1384 | ||
| 1385 | template<class _Key, class _Compare = less<_Key>, | |
| 1386 | class _Allocator = allocator<_Key>, | |
| 1387 | class = typename enable_if<__is_allocator<_Allocator>::value, void>::type, | |
| 1388 | class = typename enable_if<!__is_allocator<_Compare>::value, void>::type> | |
| 1389 | multiset(initializer_list<_Key>, _Compare = _Compare(), _Allocator = _Allocator()) | |
| 1390 | -> multiset<_Key, _Compare, _Allocator>; | |
| 1391 | ||
| 1392 | template<class _InputIterator, class _Allocator, | |
| 1393 | class = typename enable_if<__is_allocator<_Allocator>::value, void>::type> | |
| 1394 | multiset(_InputIterator, _InputIterator, _Allocator) | |
| 1395 | -> multiset<typename iterator_traits<_InputIterator>::value_type, | |
| 1396 | less<typename iterator_traits<_InputIterator>::value_type>, _Allocator>; | |
| 1397 | ||
| 1398 | template<class _Key, class _Allocator, | |
| 1399 | class = typename enable_if<__is_allocator<_Allocator>::value, void>::type> | |
| 1400 | multiset(initializer_list<_Key>, _Allocator) | |
| 1401 | -> multiset<_Key, less<_Key>, _Allocator>; | |
| 1402 | #endif | |
| 1403 | ||
| 1328 | 1404 | #ifndef _LIBCPP_CXX03_LANG |
| 1329 | 1405 | |
| 1330 | 1406 | template <class _Key, class _Compare, class _Allocator> |
lib/libcxx/include/setjmp.h+3-4| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===--------------------------- setjmp.h ---------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 |
lib/libcxx/include/shared_mutex+3-4| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===------------------------ shared_mutex --------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 |
lib/libcxx/include/span+139-112| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===------------------------------ span ---------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===---------------------------------------------------------------------===// |
| 10 | 9 | |
| ... | ... | @@ -17,33 +16,35 @@ |
| 17 | 16 | namespace std { |
| 18 | 17 | |
| 19 | 18 | // constants |
| 20 | inline constexpr ptrdiff_t dynamic_extent = -1; | |
| 19 | inline constexpr size_t dynamic_extent = numeric_limits<size_t>::max(); | |
| 21 | 20 | |
| 22 | 21 | // [views.span], class template span |
| 23 | template <class ElementType, ptrdiff_t Extent = dynamic_extent> | |
| 22 | template <class ElementType, size_t Extent = dynamic_extent> | |
| 24 | 23 | class span; |
| 25 | 24 | |
| 26 | 25 | // [span.objectrep], views of object representation |
| 27 | template <class ElementType, ptrdiff_t Extent> | |
| 26 | template <class ElementType, size_t Extent> | |
| 28 | 27 | span<const byte, ((Extent == dynamic_extent) ? dynamic_extent : |
| 29 | (static_cast<ptrdiff_t>(sizeof(ElementType)) * Extent))> as_bytes(span<ElementType, Extent> s) noexcept; | |
| 28 | (sizeof(ElementType) * Extent))> as_bytes(span<ElementType, Extent> s) noexcept; | |
| 30 | 29 | |
| 31 | template <class ElementType, ptrdiff_t Extent> | |
| 30 | template <class ElementType, size_t Extent> | |
| 32 | 31 | span< byte, ((Extent == dynamic_extent) ? dynamic_extent : |
| 33 | (static_cast<ptrdiff_t>(sizeof(ElementType)) * Extent))> as_writable_bytes(span<ElementType, Extent> s) noexcept; | |
| 32 | (sizeof(ElementType) * Extent))> as_writable_bytes(span<ElementType, Extent> s) noexcept; | |
| 34 | 33 | |
| 35 | 34 | |
| 36 | 35 | namespace std { |
| 37 | template <class ElementType, ptrdiff_t Extent = dynamic_extent> | |
| 36 | template <class ElementType, size_t Extent = dynamic_extent> | |
| 38 | 37 | class span { |
| 39 | 38 | public: |
| 40 | 39 | // constants and types |
| 41 | 40 | using element_type = ElementType; |
| 42 | 41 | using value_type = remove_cv_t<ElementType>; |
| 43 | using index_type = ptrdiff_t; | |
| 42 | using index_type = size_t; | |
| 44 | 43 | using difference_type = ptrdiff_t; |
| 45 | 44 | using pointer = element_type*; |
| 45 | using const_pointer = const element_type*; | |
| 46 | 46 | using reference = element_type&; |
| 47 | using const_reference = const element_type&; | |
| 47 | 48 | using iterator = implementation-defined; |
| 48 | 49 | using const_iterator = implementation-defined; |
| 49 | 50 | using reverse_iterator = std::reverse_iterator<iterator>; |
| ... | ... | @@ -65,17 +66,17 @@ public: |
| 65 | 66 | template <class Container> |
| 66 | 67 | constexpr span(const Container& cont); |
| 67 | 68 | constexpr span(const span& other) noexcept = default; |
| 68 | template <class OtherElementType, ptrdiff_t OtherExtent> | |
| 69 | template <class OtherElementType, size_t OtherExtent> | |
| 69 | 70 | constexpr span(const span<OtherElementType, OtherExtent>& s) noexcept; |
| 70 | 71 | ~span() noexcept = default; |
| 71 | 72 | constexpr span& operator=(const span& other) noexcept = default; |
| 72 | 73 | |
| 73 | 74 | // [span.sub], span subviews |
| 74 | template <ptrdiff_t Count> | |
| 75 | template <size_t Count> | |
| 75 | 76 | constexpr span<element_type, Count> first() const; |
| 76 | template <ptrdiff_t Count> | |
| 77 | template <size_t Count> | |
| 77 | 78 | constexpr span<element_type, Count> last() const; |
| 78 | template <ptrdiff_t Offset, ptrdiff_t Count = dynamic_extent> | |
| 79 | template <size_t Offset, size_t Count = dynamic_extent> | |
| 79 | 80 | constexpr span<element_type, see below> subspan() const; |
| 80 | 81 | |
| 81 | 82 | constexpr span<element_type, dynamic_extent> first(index_type count) const; |
| ... | ... | @@ -89,7 +90,8 @@ public: |
| 89 | 90 | |
| 90 | 91 | // [span.elem], span element access |
| 91 | 92 | constexpr reference operator[](index_type idx) const; |
| 92 | constexpr reference operator()(index_type idx) const; | |
| 93 | constexpr reference front() const; | |
| 94 | constexpr reference back() const; | |
| 93 | 95 | constexpr pointer data() const noexcept; |
| 94 | 96 | |
| 95 | 97 | // [span.iterators], span iterator support |
| ... | ... | @@ -141,14 +143,14 @@ _LIBCPP_BEGIN_NAMESPACE_STD |
| 141 | 143 | |
| 142 | 144 | #if _LIBCPP_STD_VER > 17 |
| 143 | 145 | |
| 144 | inline constexpr ptrdiff_t dynamic_extent = -1; | |
| 145 | template <typename _Tp, ptrdiff_t _Extent = dynamic_extent> class span; | |
| 146 | inline constexpr size_t dynamic_extent = numeric_limits<size_t>::max(); | |
| 147 | template <typename _Tp, size_t _Extent = dynamic_extent> class span; | |
| 146 | 148 | |
| 147 | 149 | |
| 148 | 150 | template <class _Tp> |
| 149 | 151 | struct __is_span_impl : public false_type {}; |
| 150 | 152 | |
| 151 | template <class _Tp, ptrdiff_t _Extent> | |
| 153 | template <class _Tp, size_t _Extent> | |
| 152 | 154 | struct __is_span_impl<span<_Tp, _Extent>> : public true_type {}; |
| 153 | 155 | |
| 154 | 156 | template <class _Tp> |
| ... | ... | @@ -187,25 +189,24 @@ struct __is_span_compatible_container<_Tp, _ElementType, |
| 187 | 189 | : public true_type {}; |
| 188 | 190 | |
| 189 | 191 | |
| 190 | template <typename _Tp, ptrdiff_t _Extent> | |
| 192 | template <typename _Tp, size_t _Extent> | |
| 191 | 193 | class _LIBCPP_TEMPLATE_VIS span { |
| 192 | 194 | public: |
| 193 | 195 | // constants and types |
| 194 | 196 | using element_type = _Tp; |
| 195 | 197 | using value_type = remove_cv_t<_Tp>; |
| 196 | using index_type = ptrdiff_t; | |
| 198 | using index_type = size_t; | |
| 197 | 199 | using difference_type = ptrdiff_t; |
| 198 | 200 | using pointer = _Tp *; |
| 199 | using const_pointer = const _Tp *; // not in standard | |
| 201 | using const_pointer = const _Tp *; | |
| 200 | 202 | using reference = _Tp &; |
| 201 | using const_reference = const _Tp &; // not in standard | |
| 203 | using const_reference = const _Tp &; | |
| 202 | 204 | using iterator = __wrap_iter<pointer>; |
| 203 | 205 | using const_iterator = __wrap_iter<const_pointer>; |
| 204 | 206 | using reverse_iterator = _VSTD::reverse_iterator<iterator>; |
| 205 | 207 | using const_reverse_iterator = _VSTD::reverse_iterator<const_iterator>; |
| 206 | 208 | |
| 207 | 209 | static constexpr index_type extent = _Extent; |
| 208 | static_assert (_Extent >= 0, "Can't have a span with an extent < 0"); | |
| 209 | 210 | |
| 210 | 211 | // [span.cons], span constructors, copy, assignment, and destructor |
| 211 | 212 | _LIBCPP_INLINE_VISIBILITY constexpr span() noexcept : __data{nullptr} |
| ... | ... | @@ -223,22 +224,8 @@ public: |
| 223 | 224 | _LIBCPP_INLINE_VISIBILITY constexpr span( array<value_type, _Extent>& __arr) noexcept : __data{__arr.data()} {} |
| 224 | 225 | _LIBCPP_INLINE_VISIBILITY constexpr span(const array<value_type, _Extent>& __arr) noexcept : __data{__arr.data()} {} |
| 225 | 226 | |
| 226 | template <class _Container> | |
| 227 | inline _LIBCPP_INLINE_VISIBILITY | |
| 228 | constexpr span( _Container& __c, | |
| 229 | enable_if_t<__is_span_compatible_container<_Container, _Tp>::value, nullptr_t> = nullptr) | |
| 230 | : __data{_VSTD::data(__c)} | |
| 231 | { _LIBCPP_ASSERT(_Extent == _VSTD::size(__c), "size mismatch in span's constructor (container)"); } | |
| 232 | ||
| 233 | template <class _Container> | |
| 234 | inline _LIBCPP_INLINE_VISIBILITY | |
| 235 | constexpr span(const _Container& __c, | |
| 236 | enable_if_t<__is_span_compatible_container<const _Container, _Tp>::value, nullptr_t> = nullptr) | |
| 237 | : __data{_VSTD::data(__c)} | |
| 238 | { _LIBCPP_ASSERT(_Extent == _VSTD::size(__c), "size mismatch in span's constructor (const container)"); } | |
| 239 | ||
| 240 | 227 | template <class _OtherElementType> |
| 241 | inline _LIBCPP_INLINE_VISIBILITY | |
| 228 | _LIBCPP_INLINE_VISIBILITY | |
| 242 | 229 | constexpr span(const span<_OtherElementType, _Extent>& __other, |
| 243 | 230 | enable_if_t< |
| 244 | 231 | is_convertible_v<_OtherElementType(*)[], element_type (*)[]>, |
| ... | ... | @@ -246,7 +233,7 @@ public: |
| 246 | 233 | : __data{__other.data()} {} |
| 247 | 234 | |
| 248 | 235 | template <class _OtherElementType> |
| 249 | inline _LIBCPP_INLINE_VISIBILITY | |
| 236 | _LIBCPP_INLINE_VISIBILITY | |
| 250 | 237 | constexpr span(const span<_OtherElementType, dynamic_extent>& __other, |
| 251 | 238 | enable_if_t< |
| 252 | 239 | is_convertible_v<_OtherElementType(*)[], element_type (*)[]>, |
| ... | ... | @@ -256,20 +243,18 @@ public: |
| 256 | 243 | |
| 257 | 244 | // ~span() noexcept = default; |
| 258 | 245 | |
| 259 | template <ptrdiff_t _Count> | |
| 260 | inline _LIBCPP_INLINE_VISIBILITY | |
| 261 | constexpr span<element_type, _Count> first() const noexcept | |
| 246 | template <size_t _Count> | |
| 247 | _LIBCPP_INLINE_VISIBILITY | |
| 248 | constexpr span<element_type, _Count> first() const noexcept | |
| 262 | 249 | { |
| 263 | static_assert(_Count >= 0, "Count must be >= 0 in span::first()"); | |
| 264 | 250 | static_assert(_Count <= _Extent, "Count out of range in span::first()"); |
| 265 | 251 | return {data(), _Count}; |
| 266 | 252 | } |
| 267 | 253 | |
| 268 | template <ptrdiff_t _Count> | |
| 269 | inline _LIBCPP_INLINE_VISIBILITY | |
| 270 | constexpr span<element_type, _Count> last() const noexcept | |
| 254 | template <size_t _Count> | |
| 255 | _LIBCPP_INLINE_VISIBILITY | |
| 256 | constexpr span<element_type, _Count> last() const noexcept | |
| 271 | 257 | { |
| 272 | static_assert(_Count >= 0, "Count must be >= 0 in span::last()"); | |
| 273 | 258 | static_assert(_Count <= _Extent, "Count out of range in span::last()"); |
| 274 | 259 | return {data() + size() - _Count, _Count}; |
| 275 | 260 | } |
| ... | ... | @@ -277,36 +262,36 @@ public: |
| 277 | 262 | _LIBCPP_INLINE_VISIBILITY |
| 278 | 263 | constexpr span<element_type, dynamic_extent> first(index_type __count) const noexcept |
| 279 | 264 | { |
| 280 | _LIBCPP_ASSERT(__count >= 0 && __count <= size(), "Count out of range in span::first(count)"); | |
| 265 | _LIBCPP_ASSERT(__count <= size(), "Count out of range in span::first(count)"); | |
| 281 | 266 | return {data(), __count}; |
| 282 | 267 | } |
| 283 | 268 | |
| 284 | 269 | _LIBCPP_INLINE_VISIBILITY |
| 285 | 270 | constexpr span<element_type, dynamic_extent> last(index_type __count) const noexcept |
| 286 | 271 | { |
| 287 | _LIBCPP_ASSERT(__count >= 0 && __count <= size(), "Count out of range in span::last(count)"); | |
| 272 | _LIBCPP_ASSERT(__count <= size(), "Count out of range in span::last(count)"); | |
| 288 | 273 | return {data() + size() - __count, __count}; |
| 289 | 274 | } |
| 290 | 275 | |
| 291 | template <ptrdiff_t _Offset, ptrdiff_t _Count = dynamic_extent> | |
| 292 | inline _LIBCPP_INLINE_VISIBILITY | |
| 293 | constexpr auto subspan() const noexcept | |
| 276 | template <size_t _Offset, size_t _Count = dynamic_extent> | |
| 277 | _LIBCPP_INLINE_VISIBILITY | |
| 278 | constexpr auto subspan() const noexcept | |
| 294 | 279 | -> span<element_type, _Count != dynamic_extent ? _Count : _Extent - _Offset> |
| 295 | 280 | { |
| 296 | _LIBCPP_ASSERT(_Offset >= 0 && _Offset <= size(), "Offset out of range in span::subspan()"); | |
| 281 | static_assert(_Offset <= _Extent, "Offset out of range in span::subspan()"); | |
| 297 | 282 | return {data() + _Offset, _Count == dynamic_extent ? size() - _Offset : _Count}; |
| 298 | 283 | } |
| 299 | 284 | |
| 300 | 285 | |
| 301 | inline _LIBCPP_INLINE_VISIBILITY | |
| 286 | _LIBCPP_INLINE_VISIBILITY | |
| 302 | 287 | constexpr span<element_type, dynamic_extent> |
| 303 | 288 | subspan(index_type __offset, index_type __count = dynamic_extent) const noexcept |
| 304 | 289 | { |
| 305 | _LIBCPP_ASSERT( __offset >= 0 && __offset <= size(), "Offset out of range in span::subspan(offset, count)"); | |
| 306 | _LIBCPP_ASSERT((__count >= 0 && __count <= size()) || __count == dynamic_extent, "Count out of range in span::subspan(offset, count)"); | |
| 290 | _LIBCPP_ASSERT(__offset <= size(), "Offset out of range in span::subspan(offset, count)"); | |
| 291 | _LIBCPP_ASSERT(__count <= size() || __count == dynamic_extent, "Count out of range in span::subspan(offset, count)"); | |
| 307 | 292 | if (__count == dynamic_extent) |
| 308 | 293 | return {data() + __offset, size() - __offset}; |
| 309 | _LIBCPP_ASSERT(__offset + __count <= size(), "count + offset out of range in span::subspan(offset, count)"); | |
| 294 | _LIBCPP_ASSERT(__offset <= size() - __count, "count + offset out of range in span::subspan(offset, count)"); | |
| 310 | 295 | return {data() + __offset, __count}; |
| 311 | 296 | } |
| 312 | 297 | |
| ... | ... | @@ -320,10 +305,16 @@ public: |
| 320 | 305 | return __data[__idx]; |
| 321 | 306 | } |
| 322 | 307 | |
| 323 | _LIBCPP_INLINE_VISIBILITY constexpr reference operator()(index_type __idx) const noexcept | |
| 308 | _LIBCPP_INLINE_VISIBILITY constexpr reference front() const noexcept | |
| 324 | 309 | { |
| 325 | _LIBCPP_ASSERT(__idx >= 0 && __idx < size(), "span<T,N>() index out of bounds"); | |
| 326 | return __data[__idx]; | |
| 310 | static_assert(_Extent > 0, "span<T,N>[].front() on empty span"); | |
| 311 | return __data[0]; | |
| 312 | } | |
| 313 | ||
| 314 | _LIBCPP_INLINE_VISIBILITY constexpr reference back() const noexcept | |
| 315 | { | |
| 316 | static_assert(_Extent > 0, "span<T,N>[].back() on empty span"); | |
| 317 | return __data[size()-1]; | |
| 327 | 318 | } |
| 328 | 319 | |
| 329 | 320 | _LIBCPP_INLINE_VISIBILITY constexpr pointer data() const noexcept { return __data; } |
| ... | ... | @@ -348,7 +339,7 @@ public: |
| 348 | 339 | _LIBCPP_INLINE_VISIBILITY span<const byte, _Extent * sizeof(element_type)> __as_bytes() const noexcept |
| 349 | 340 | { return {reinterpret_cast<const byte *>(data()), size_bytes()}; } |
| 350 | 341 | |
| 351 | _LIBCPP_INLINE_VISIBILITY span<byte, _Extent * sizeof(element_type)> __as_writeable_bytes() const noexcept | |
| 342 | _LIBCPP_INLINE_VISIBILITY span<byte, _Extent * sizeof(element_type)> __as_writable_bytes() const noexcept | |
| 352 | 343 | { return {reinterpret_cast<byte *>(data()), size_bytes()}; } |
| 353 | 344 | |
| 354 | 345 | private: |
| ... | ... | @@ -365,12 +356,12 @@ public: |
| 365 | 356 | // constants and types |
| 366 | 357 | using element_type = _Tp; |
| 367 | 358 | using value_type = remove_cv_t<_Tp>; |
| 368 | using index_type = ptrdiff_t; | |
| 359 | using index_type = size_t; | |
| 369 | 360 | using difference_type = ptrdiff_t; |
| 370 | 361 | using pointer = _Tp *; |
| 371 | using const_pointer = const _Tp *; // not in standard | |
| 362 | using const_pointer = const _Tp *; | |
| 372 | 363 | using reference = _Tp &; |
| 373 | using const_reference = const _Tp &; // not in standard | |
| 364 | using const_reference = const _Tp &; | |
| 374 | 365 | using iterator = __wrap_iter<pointer>; |
| 375 | 366 | using const_iterator = __wrap_iter<const_pointer>; |
| 376 | 367 | using reverse_iterator = _VSTD::reverse_iterator<iterator>; |
| ... | ... | @@ -385,35 +376,35 @@ public: |
| 385 | 376 | constexpr span& operator=(const span&) noexcept = default; |
| 386 | 377 | |
| 387 | 378 | _LIBCPP_INLINE_VISIBILITY constexpr span(pointer __ptr, index_type __count) : __data{__ptr}, __size{__count} {} |
| 388 | _LIBCPP_INLINE_VISIBILITY constexpr span(pointer __f, pointer __l) : __data{__f}, __size{distance(__f, __l)} {} | |
| 379 | _LIBCPP_INLINE_VISIBILITY constexpr span(pointer __f, pointer __l) : __data{__f}, __size{static_cast<size_t>(distance(__f, __l))} {} | |
| 389 | 380 | |
| 390 | 381 | template <size_t _Sz> |
| 391 | inline _LIBCPP_INLINE_VISIBILITY | |
| 392 | constexpr span(element_type (&__arr)[_Sz]) noexcept : __data{__arr}, __size{_Sz} {} | |
| 382 | _LIBCPP_INLINE_VISIBILITY | |
| 383 | constexpr span(element_type (&__arr)[_Sz]) noexcept : __data{__arr}, __size{_Sz} {} | |
| 393 | 384 | |
| 394 | 385 | template <size_t _Sz> |
| 395 | inline _LIBCPP_INLINE_VISIBILITY | |
| 396 | constexpr span(array<value_type, _Sz>& __arr) noexcept : __data{__arr.data()}, __size{_Sz} {} | |
| 386 | _LIBCPP_INLINE_VISIBILITY | |
| 387 | constexpr span(array<value_type, _Sz>& __arr) noexcept : __data{__arr.data()}, __size{_Sz} {} | |
| 397 | 388 | |
| 398 | 389 | template <size_t _Sz> |
| 399 | inline _LIBCPP_INLINE_VISIBILITY | |
| 400 | constexpr span(const array<value_type, _Sz>& __arr) noexcept : __data{__arr.data()}, __size{_Sz} {} | |
| 390 | _LIBCPP_INLINE_VISIBILITY | |
| 391 | constexpr span(const array<value_type, _Sz>& __arr) noexcept : __data{__arr.data()}, __size{_Sz} {} | |
| 401 | 392 | |
| 402 | 393 | template <class _Container> |
| 403 | inline _LIBCPP_INLINE_VISIBILITY | |
| 394 | _LIBCPP_INLINE_VISIBILITY | |
| 404 | 395 | constexpr span( _Container& __c, |
| 405 | 396 | enable_if_t<__is_span_compatible_container<_Container, _Tp>::value, nullptr_t> = nullptr) |
| 406 | 397 | : __data{_VSTD::data(__c)}, __size{(index_type) _VSTD::size(__c)} {} |
| 407 | 398 | |
| 408 | 399 | template <class _Container> |
| 409 | inline _LIBCPP_INLINE_VISIBILITY | |
| 400 | _LIBCPP_INLINE_VISIBILITY | |
| 410 | 401 | constexpr span(const _Container& __c, |
| 411 | 402 | enable_if_t<__is_span_compatible_container<const _Container, _Tp>::value, nullptr_t> = nullptr) |
| 412 | 403 | : __data{_VSTD::data(__c)}, __size{(index_type) _VSTD::size(__c)} {} |
| 413 | 404 | |
| 414 | 405 | |
| 415 | template <class _OtherElementType, ptrdiff_t _OtherExtent> | |
| 416 | inline _LIBCPP_INLINE_VISIBILITY | |
| 406 | template <class _OtherElementType, size_t _OtherExtent> | |
| 407 | _LIBCPP_INLINE_VISIBILITY | |
| 417 | 408 | constexpr span(const span<_OtherElementType, _OtherExtent>& __other, |
| 418 | 409 | enable_if_t< |
| 419 | 410 | is_convertible_v<_OtherElementType(*)[], element_type (*)[]>, |
| ... | ... | @@ -422,20 +413,18 @@ public: |
| 422 | 413 | |
| 423 | 414 | // ~span() noexcept = default; |
| 424 | 415 | |
| 425 | template <ptrdiff_t _Count> | |
| 426 | inline _LIBCPP_INLINE_VISIBILITY | |
| 427 | constexpr span<element_type, _Count> first() const noexcept | |
| 416 | template <size_t _Count> | |
| 417 | _LIBCPP_INLINE_VISIBILITY | |
| 418 | constexpr span<element_type, _Count> first() const noexcept | |
| 428 | 419 | { |
| 429 | static_assert(_Count >= 0, "Count must be >= 0 in span::first()"); | |
| 430 | 420 | _LIBCPP_ASSERT(_Count <= size(), "Count out of range in span::first()"); |
| 431 | 421 | return {data(), _Count}; |
| 432 | 422 | } |
| 433 | 423 | |
| 434 | template <ptrdiff_t _Count> | |
| 435 | inline _LIBCPP_INLINE_VISIBILITY | |
| 436 | constexpr span<element_type, _Count> last() const noexcept | |
| 424 | template <size_t _Count> | |
| 425 | _LIBCPP_INLINE_VISIBILITY | |
| 426 | constexpr span<element_type, _Count> last() const noexcept | |
| 437 | 427 | { |
| 438 | static_assert(_Count >= 0, "Count must be >= 0 in span::last()"); | |
| 439 | 428 | _LIBCPP_ASSERT(_Count <= size(), "Count out of range in span::last()"); |
| 440 | 429 | return {data() + size() - _Count, _Count}; |
| 441 | 430 | } |
| ... | ... | @@ -443,35 +432,35 @@ public: |
| 443 | 432 | _LIBCPP_INLINE_VISIBILITY |
| 444 | 433 | constexpr span<element_type, dynamic_extent> first(index_type __count) const noexcept |
| 445 | 434 | { |
| 446 | _LIBCPP_ASSERT(__count >= 0 && __count <= size(), "Count out of range in span::first(count)"); | |
| 435 | _LIBCPP_ASSERT(__count <= size(), "Count out of range in span::first(count)"); | |
| 447 | 436 | return {data(), __count}; |
| 448 | 437 | } |
| 449 | 438 | |
| 450 | 439 | _LIBCPP_INLINE_VISIBILITY |
| 451 | 440 | constexpr span<element_type, dynamic_extent> last (index_type __count) const noexcept |
| 452 | 441 | { |
| 453 | _LIBCPP_ASSERT(__count >= 0 && __count <= size(), "Count out of range in span::last(count)"); | |
| 442 | _LIBCPP_ASSERT(__count <= size(), "Count out of range in span::last(count)"); | |
| 454 | 443 | return {data() + size() - __count, __count}; |
| 455 | 444 | } |
| 456 | 445 | |
| 457 | template <ptrdiff_t _Offset, ptrdiff_t _Count = dynamic_extent> | |
| 458 | inline _LIBCPP_INLINE_VISIBILITY | |
| 459 | constexpr span<_Tp, dynamic_extent> subspan() const noexcept | |
| 446 | template <size_t _Offset, size_t _Count = dynamic_extent> | |
| 447 | _LIBCPP_INLINE_VISIBILITY | |
| 448 | constexpr span<_Tp, dynamic_extent> subspan() const noexcept | |
| 460 | 449 | { |
| 461 | _LIBCPP_ASSERT(_Offset >= 0 && _Offset <= size(), "Offset out of range in span::subspan()"); | |
| 450 | _LIBCPP_ASSERT(_Offset <= size(), "Offset out of range in span::subspan()"); | |
| 462 | 451 | _LIBCPP_ASSERT(_Count == dynamic_extent || _Offset + _Count <= size(), "Count out of range in span::subspan()"); |
| 463 | 452 | return {data() + _Offset, _Count == dynamic_extent ? size() - _Offset : _Count}; |
| 464 | 453 | } |
| 465 | 454 | |
| 466 | 455 | constexpr span<element_type, dynamic_extent> |
| 467 | inline _LIBCPP_INLINE_VISIBILITY | |
| 468 | subspan(index_type __offset, index_type __count = dynamic_extent) const noexcept | |
| 456 | _LIBCPP_INLINE_VISIBILITY | |
| 457 | subspan(index_type __offset, index_type __count = dynamic_extent) const noexcept | |
| 469 | 458 | { |
| 470 | _LIBCPP_ASSERT( __offset >= 0 && __offset <= size(), "Offset out of range in span::subspan(offset, count)"); | |
| 471 | _LIBCPP_ASSERT((__count >= 0 && __count <= size()) || __count == dynamic_extent, "count out of range in span::subspan(offset, count)"); | |
| 459 | _LIBCPP_ASSERT(__offset <= size(), "Offset out of range in span::subspan(offset, count)"); | |
| 460 | _LIBCPP_ASSERT(__count <= size() || __count == dynamic_extent, "count out of range in span::subspan(offset, count)"); | |
| 472 | 461 | if (__count == dynamic_extent) |
| 473 | 462 | return {data() + __offset, size() - __offset}; |
| 474 | _LIBCPP_ASSERT(__offset + __count <= size(), "Offset + count out of range in span::subspan(offset, count)"); | |
| 463 | _LIBCPP_ASSERT(__offset <= size() - __count, "Offset + count out of range in span::subspan(offset, count)"); | |
| 475 | 464 | return {data() + __offset, __count}; |
| 476 | 465 | } |
| 477 | 466 | |
| ... | ... | @@ -485,12 +474,19 @@ public: |
| 485 | 474 | return __data[__idx]; |
| 486 | 475 | } |
| 487 | 476 | |
| 488 | _LIBCPP_INLINE_VISIBILITY constexpr reference operator()(index_type __idx) const noexcept | |
| 477 | _LIBCPP_INLINE_VISIBILITY constexpr reference front() const noexcept | |
| 489 | 478 | { |
| 490 | _LIBCPP_ASSERT(__idx >= 0 && __idx < size(), "span<T>() index out of bounds"); | |
| 491 | return __data[__idx]; | |
| 479 | _LIBCPP_ASSERT(!empty(), "span<T>[].front() on empty span"); | |
| 480 | return __data[0]; | |
| 492 | 481 | } |
| 493 | 482 | |
| 483 | _LIBCPP_INLINE_VISIBILITY constexpr reference back() const noexcept | |
| 484 | { | |
| 485 | _LIBCPP_ASSERT(!empty(), "span<T>[].back() on empty span"); | |
| 486 | return __data[size()-1]; | |
| 487 | } | |
| 488 | ||
| 489 | ||
| 494 | 490 | _LIBCPP_INLINE_VISIBILITY constexpr pointer data() const noexcept { return __data; } |
| 495 | 491 | |
| 496 | 492 | // [span.iter], span iterator support |
| ... | ... | @@ -517,7 +513,7 @@ public: |
| 517 | 513 | _LIBCPP_INLINE_VISIBILITY span<const byte, dynamic_extent> __as_bytes() const noexcept |
| 518 | 514 | { return {reinterpret_cast<const byte *>(data()), size_bytes()}; } |
| 519 | 515 | |
| 520 | _LIBCPP_INLINE_VISIBILITY span<byte, dynamic_extent> __as_writeable_bytes() const noexcept | |
| 516 | _LIBCPP_INLINE_VISIBILITY span<byte, dynamic_extent> __as_writable_bytes() const noexcept | |
| 521 | 517 | { return {reinterpret_cast<byte *>(data()), size_bytes()}; } |
| 522 | 518 | |
| 523 | 519 | private: |
| ... | ... | @@ -525,20 +521,51 @@ private: |
| 525 | 521 | index_type __size; |
| 526 | 522 | }; |
| 527 | 523 | |
| 528 | // as_bytes & as_writeable_bytes | |
| 529 | template <class _Tp, ptrdiff_t _Extent> | |
| 530 | auto as_bytes(span<_Tp, _Extent> __s) noexcept | |
| 531 | -> decltype(__s.__as_bytes()) | |
| 532 | { return __s.__as_bytes(); } | |
| 524 | // tuple interface | |
| 525 | template <class _Tp, size_t _Size> | |
| 526 | struct _LIBCPP_TEMPLATE_VIS tuple_size<span<_Tp, _Size>> | |
| 527 | : public integral_constant<size_t, _Size> {}; | |
| 533 | 528 | |
| 534 | template <class _Tp, ptrdiff_t _Extent> | |
| 535 | auto as_writeable_bytes(span<_Tp, _Extent> __s) noexcept | |
| 536 | -> typename enable_if<!is_const_v<_Tp>, decltype(__s.__as_writeable_bytes())>::type | |
| 537 | { return __s.__as_writeable_bytes(); } | |
| 529 | template <class _Tp> | |
| 530 | struct _LIBCPP_TEMPLATE_VIS tuple_size<span<_Tp, dynamic_extent>>; // declared but not defined | |
| 531 | ||
| 532 | ||
| 533 | template <size_t _Ip, class _Tp, size_t _Size> | |
| 534 | struct _LIBCPP_TEMPLATE_VIS tuple_element<_Ip, span<_Tp, _Size>> | |
| 535 | { | |
| 536 | static_assert( dynamic_extent != _Size, "std::tuple_element<> not supported for std::span<T, dynamic_extent>"); | |
| 537 | static_assert(_Ip < _Size, "Index out of bounds in std::tuple_element<> (std::span)"); | |
| 538 | typedef _Tp type; | |
| 539 | }; | |
| 538 | 540 | |
| 539 | template <class _Tp, ptrdiff_t _Extent> | |
| 540 | constexpr void swap(span<_Tp, _Extent> &__lhs, span<_Tp, _Extent> &__rhs) noexcept | |
| 541 | { __lhs.swap(__rhs); } | |
| 541 | template <size_t _Ip, class _Tp, size_t _Size> | |
| 542 | _LIBCPP_INLINE_VISIBILITY constexpr | |
| 543 | _Tp& | |
| 544 | get(span<_Tp, _Size> __s) noexcept | |
| 545 | { | |
| 546 | static_assert( dynamic_extent != _Size, "std::get<> not supported for std::span<T, dynamic_extent>"); | |
| 547 | static_assert(_Ip < _Size, "Index out of bounds in std::get<> (std::span)"); | |
| 548 | return __s[_Ip]; | |
| 549 | } | |
| 550 | ||
| 551 | ||
| 552 | // as_bytes & as_writable_bytes | |
| 553 | template <class _Tp, size_t _Extent> | |
| 554 | _LIBCPP_INLINE_VISIBILITY | |
| 555 | auto as_bytes(span<_Tp, _Extent> __s) noexcept | |
| 556 | -> decltype(__s.__as_bytes()) | |
| 557 | { return __s.__as_bytes(); } | |
| 558 | ||
| 559 | template <class _Tp, size_t _Extent> | |
| 560 | _LIBCPP_INLINE_VISIBILITY | |
| 561 | auto as_writable_bytes(span<_Tp, _Extent> __s) noexcept | |
| 562 | -> enable_if_t<!is_const_v<_Tp>, decltype(__s.__as_writable_bytes())> | |
| 563 | { return __s.__as_writable_bytes(); } | |
| 564 | ||
| 565 | template <class _Tp, size_t _Extent> | |
| 566 | _LIBCPP_INLINE_VISIBILITY | |
| 567 | constexpr void swap(span<_Tp, _Extent> &__lhs, span<_Tp, _Extent> &__rhs) noexcept | |
| 568 | { __lhs.swap(__rhs); } | |
| 542 | 569 | |
| 543 | 570 | |
| 544 | 571 | // Deduction guides |
lib/libcxx/include/sstream+4-5| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===--------------------------- sstream ----------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 | |
| ... | ... | @@ -559,7 +558,7 @@ basic_stringbuf<_CharT, _Traits, _Allocator>::overflow(int_type __c) |
| 559 | 558 | char_type* __p = const_cast<char_type*>(__str_.data()); |
| 560 | 559 | this->setg(__p, __p + __ninp, __hm_); |
| 561 | 560 | } |
| 562 | return this->sputc(__c); | |
| 561 | return this->sputc(traits_type::to_char_type(__c)); | |
| 563 | 562 | } |
| 564 | 563 | return traits_type::not_eof(__c); |
| 565 | 564 | } |
lib/libcxx/include/stack+8-9| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===---------------------------- stack -----------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 | |
| ... | ... | @@ -63,8 +62,8 @@ public: |
| 63 | 62 | |
| 64 | 63 | template<class Container> |
| 65 | 64 | stack(Container) -> stack<typename Container::value_type, Container>; // C++17 |
| 66 | ||
| 67 | template<class Container, class Allocator> | |
| 65 | ||
| 66 | template<class Container, class Allocator> | |
| 68 | 67 | stack(Container, Allocator) -> stack<typename Container::value_type, Container>; // C++17 |
| 69 | 68 | |
| 70 | 69 | template <class T, class Container> |
| ... | ... | @@ -119,7 +118,7 @@ public: |
| 119 | 118 | typedef typename container_type::const_reference const_reference; |
| 120 | 119 | typedef typename container_type::size_type size_type; |
| 121 | 120 | static_assert((is_same<_Tp, value_type>::value), "" ); |
| 122 | ||
| 121 | ||
| 123 | 122 | protected: |
| 124 | 123 | container_type c; |
| 125 | 124 | |
| ... | ... | @@ -241,12 +240,12 @@ template<class _Container, |
| 241 | 240 | > |
| 242 | 241 | stack(_Container) |
| 243 | 242 | -> stack<typename _Container::value_type, _Container>; |
| 244 | ||
| 243 | ||
| 245 | 244 | template<class _Container, |
| 246 | 245 | class _Alloc, |
| 247 | 246 | class = typename enable_if<!__is_allocator<_Container>::value, nullptr_t>::type, |
| 248 | 247 | class = typename enable_if< __is_allocator<_Alloc>::value, nullptr_t>::type |
| 249 | > | |
| 248 | > | |
| 250 | 249 | stack(_Container, _Alloc) |
| 251 | 250 | -> stack<typename _Container::value_type, _Container>; |
| 252 | 251 | #endif |
lib/libcxx/include/stdbool.h+3-4| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===--------------------------- stdbool.h --------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 | #ifndef _LIBCPP_STDBOOL_H |
lib/libcxx/include/stddef.h+3-4| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===--------------------------- stddef.h ---------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 |
lib/libcxx/include/stdexcept+31-5| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===--------------------------- stdexcept --------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 | |
| ... | ... | @@ -55,6 +54,7 @@ public: |
| 55 | 54 | |
| 56 | 55 | _LIBCPP_BEGIN_NAMESPACE_STD |
| 57 | 56 | |
| 57 | #ifndef _LIBCPP_ABI_VCRUNTIME | |
| 58 | 58 | class _LIBCPP_HIDDEN __libcpp_refstring |
| 59 | 59 | { |
| 60 | 60 | const char* __imp_; |
| ... | ... | @@ -68,6 +68,7 @@ public: |
| 68 | 68 | |
| 69 | 69 | const char* c_str() const _NOEXCEPT {return __imp_;} |
| 70 | 70 | }; |
| 71 | #endif // !_LIBCPP_ABI_VCRUNTIME | |
| 71 | 72 | |
| 72 | 73 | _LIBCPP_END_NAMESPACE_STD |
| 73 | 74 | |
| ... | ... | @@ -77,6 +78,7 @@ namespace std // purposefully not using versioning namespace |
| 77 | 78 | class _LIBCPP_EXCEPTION_ABI logic_error |
| 78 | 79 | : public exception |
| 79 | 80 | { |
| 81 | #ifndef _LIBCPP_ABI_VCRUNTIME | |
| 80 | 82 | private: |
| 81 | 83 | _VSTD::__libcpp_refstring __imp_; |
| 82 | 84 | public: |
| ... | ... | @@ -89,11 +91,17 @@ public: |
| 89 | 91 | virtual ~logic_error() _NOEXCEPT; |
| 90 | 92 | |
| 91 | 93 | virtual const char* what() const _NOEXCEPT; |
| 94 | #else | |
| 95 | public: | |
| 96 | explicit logic_error(const _VSTD::string&); // Symbol uses versioned std::string | |
| 97 | _LIBCPP_INLINE_VISIBILITY explicit logic_error(const char* __s) : exception(__s) {} | |
| 98 | #endif | |
| 92 | 99 | }; |
| 93 | 100 | |
| 94 | 101 | class _LIBCPP_EXCEPTION_ABI runtime_error |
| 95 | 102 | : public exception |
| 96 | 103 | { |
| 104 | #ifndef _LIBCPP_ABI_VCRUNTIME | |
| 97 | 105 | private: |
| 98 | 106 | _VSTD::__libcpp_refstring __imp_; |
| 99 | 107 | public: |
| ... | ... | @@ -106,6 +114,11 @@ public: |
| 106 | 114 | virtual ~runtime_error() _NOEXCEPT; |
| 107 | 115 | |
| 108 | 116 | virtual const char* what() const _NOEXCEPT; |
| 117 | #else | |
| 118 | public: | |
| 119 | explicit runtime_error(const _VSTD::string&); // Symbol uses versioned std::string | |
| 120 | _LIBCPP_INLINE_VISIBILITY explicit runtime_error(const char* __s) : exception(__s) {} | |
| 121 | #endif // _LIBCPP_ABI_VCRUNTIME | |
| 109 | 122 | }; |
| 110 | 123 | |
| 111 | 124 | class _LIBCPP_EXCEPTION_ABI domain_error |
| ... | ... | @@ -115,7 +128,9 @@ public: |
| 115 | 128 | _LIBCPP_INLINE_VISIBILITY explicit domain_error(const string& __s) : logic_error(__s) {} |
| 116 | 129 | _LIBCPP_INLINE_VISIBILITY explicit domain_error(const char* __s) : logic_error(__s) {} |
| 117 | 130 | |
| 131 | #ifndef _LIBCPP_ABI_VCRUNTIME | |
| 118 | 132 | virtual ~domain_error() _NOEXCEPT; |
| 133 | #endif | |
| 119 | 134 | }; |
| 120 | 135 | |
| 121 | 136 | class _LIBCPP_EXCEPTION_ABI invalid_argument |
| ... | ... | @@ -125,7 +140,9 @@ public: |
| 125 | 140 | _LIBCPP_INLINE_VISIBILITY explicit invalid_argument(const string& __s) : logic_error(__s) {} |
| 126 | 141 | _LIBCPP_INLINE_VISIBILITY explicit invalid_argument(const char* __s) : logic_error(__s) {} |
| 127 | 142 | |
| 143 | #ifndef _LIBCPP_ABI_VCRUNTIME | |
| 128 | 144 | virtual ~invalid_argument() _NOEXCEPT; |
| 145 | #endif | |
| 129 | 146 | }; |
| 130 | 147 | |
| 131 | 148 | class _LIBCPP_EXCEPTION_ABI length_error |
| ... | ... | @@ -134,8 +151,9 @@ class _LIBCPP_EXCEPTION_ABI length_error |
| 134 | 151 | public: |
| 135 | 152 | _LIBCPP_INLINE_VISIBILITY explicit length_error(const string& __s) : logic_error(__s) {} |
| 136 | 153 | _LIBCPP_INLINE_VISIBILITY explicit length_error(const char* __s) : logic_error(__s) {} |
| 137 | ||
| 154 | #ifndef _LIBCPP_ABI_VCRUNTIME | |
| 138 | 155 | virtual ~length_error() _NOEXCEPT; |
| 156 | #endif | |
| 139 | 157 | }; |
| 140 | 158 | |
| 141 | 159 | class _LIBCPP_EXCEPTION_ABI out_of_range |
| ... | ... | @@ -145,7 +163,9 @@ public: |
| 145 | 163 | _LIBCPP_INLINE_VISIBILITY explicit out_of_range(const string& __s) : logic_error(__s) {} |
| 146 | 164 | _LIBCPP_INLINE_VISIBILITY explicit out_of_range(const char* __s) : logic_error(__s) {} |
| 147 | 165 | |
| 166 | #ifndef _LIBCPP_ABI_VCRUNTIME | |
| 148 | 167 | virtual ~out_of_range() _NOEXCEPT; |
| 168 | #endif | |
| 149 | 169 | }; |
| 150 | 170 | |
| 151 | 171 | class _LIBCPP_EXCEPTION_ABI range_error |
| ... | ... | @@ -155,7 +175,9 @@ public: |
| 155 | 175 | _LIBCPP_INLINE_VISIBILITY explicit range_error(const string& __s) : runtime_error(__s) {} |
| 156 | 176 | _LIBCPP_INLINE_VISIBILITY explicit range_error(const char* __s) : runtime_error(__s) {} |
| 157 | 177 | |
| 178 | #ifndef _LIBCPP_ABI_VCRUNTIME | |
| 158 | 179 | virtual ~range_error() _NOEXCEPT; |
| 180 | #endif | |
| 159 | 181 | }; |
| 160 | 182 | |
| 161 | 183 | class _LIBCPP_EXCEPTION_ABI overflow_error |
| ... | ... | @@ -165,7 +187,9 @@ public: |
| 165 | 187 | _LIBCPP_INLINE_VISIBILITY explicit overflow_error(const string& __s) : runtime_error(__s) {} |
| 166 | 188 | _LIBCPP_INLINE_VISIBILITY explicit overflow_error(const char* __s) : runtime_error(__s) {} |
| 167 | 189 | |
| 190 | #ifndef _LIBCPP_ABI_VCRUNTIME | |
| 168 | 191 | virtual ~overflow_error() _NOEXCEPT; |
| 192 | #endif | |
| 169 | 193 | }; |
| 170 | 194 | |
| 171 | 195 | class _LIBCPP_EXCEPTION_ABI underflow_error |
| ... | ... | @@ -175,7 +199,9 @@ public: |
| 175 | 199 | _LIBCPP_INLINE_VISIBILITY explicit underflow_error(const string& __s) : runtime_error(__s) {} |
| 176 | 200 | _LIBCPP_INLINE_VISIBILITY explicit underflow_error(const char* __s) : runtime_error(__s) {} |
| 177 | 201 | |
| 202 | #ifndef _LIBCPP_ABI_VCRUNTIME | |
| 178 | 203 | virtual ~underflow_error() _NOEXCEPT; |
| 204 | #endif | |
| 179 | 205 | }; |
| 180 | 206 | |
| 181 | 207 | } // std |
lib/libcxx/include/stdint.h+8-4| ... | ... | @@ -1,15 +1,19 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===---------------------------- stdint.h --------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is distributed under the University of Illinois Open Source | |
| 7 | // License. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 | |
| 11 | 10 | #ifndef _LIBCPP_STDINT_H |
| 11 | // AIX system headers need stdint.h to be re-enterable while _STD_TYPES_T | |
| 12 | // is defined until an inclusion of it without _STD_TYPES_T occurs, in which | |
| 13 | // case the header guard macro is defined. | |
| 14 | #if !defined(_AIX) || !defined(_STD_TYPES_T) | |
| 12 | 15 | #define _LIBCPP_STDINT_H |
| 16 | #endif // _STD_TYPES_T | |
| 13 | 17 | |
| 14 | 18 | /* |
| 15 | 19 | stdint.h synopsis |
lib/libcxx/include/stdio.h+3-4| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===---------------------------- stdio.h ---------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 |
lib/libcxx/include/stdlib.h+9-32| ... | ... | @@ -1,19 +1,22 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===--------------------------- stdlib.h ---------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 | |
| 11 | #if defined(__need_malloc_and_calloc) | |
| 10 | #if defined(__need_malloc_and_calloc) || defined(_LIBCPP_STDLIB_INCLUDE_NEXT) | |
| 12 | 11 | |
| 13 | 12 | #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) |
| 14 | 13 | #pragma GCC system_header |
| 15 | 14 | #endif |
| 16 | 15 | |
| 16 | #if defined(_LIBCPP_STDLIB_INCLUDE_NEXT) | |
| 17 | #undef _LIBCPP_STDLIB_INCLUDE_NEXT | |
| 18 | #endif | |
| 19 | ||
| 17 | 20 | #include_next <stdlib.h> |
| 18 | 21 | |
| 19 | 22 | #elif !defined(_LIBCPP_STDLIB_H) |
| ... | ... | @@ -94,33 +97,7 @@ void *aligned_alloc(size_t alignment, size_t size); // C11 |
| 94 | 97 | #include_next <stdlib.h> |
| 95 | 98 | |
| 96 | 99 | #ifdef __cplusplus |
| 97 | ||
| 98 | extern "C++" { | |
| 99 | ||
| 100 | #undef abs | |
| 101 | #undef div | |
| 102 | #undef labs | |
| 103 | #undef ldiv | |
| 104 | #ifndef _LIBCPP_HAS_NO_LONG_LONG | |
| 105 | #undef llabs | |
| 106 | #undef lldiv | |
| 107 | #endif | |
| 108 | ||
| 109 | // MSVCRT already has the correct prototype in <stdlib.h> if __cplusplus is defined | |
| 110 | #if !defined(_LIBCPP_MSVCRT) && !defined(__sun__) && !defined(_AIX) | |
| 111 | inline _LIBCPP_INLINE_VISIBILITY long abs( long __x) _NOEXCEPT {return labs(__x);} | |
| 112 | #ifndef _LIBCPP_HAS_NO_LONG_LONG | |
| 113 | inline _LIBCPP_INLINE_VISIBILITY long long abs(long long __x) _NOEXCEPT {return llabs(__x);} | |
| 114 | #endif // _LIBCPP_HAS_NO_LONG_LONG | |
| 115 | ||
| 116 | inline _LIBCPP_INLINE_VISIBILITY ldiv_t div( long __x, long __y) _NOEXCEPT {return ldiv(__x, __y);} | |
| 117 | #ifndef _LIBCPP_HAS_NO_LONG_LONG | |
| 118 | inline _LIBCPP_INLINE_VISIBILITY lldiv_t div(long long __x, long long __y) _NOEXCEPT {return lldiv(__x, __y);} | |
| 119 | #endif // _LIBCPP_HAS_NO_LONG_LONG | |
| 120 | #endif // _LIBCPP_MSVCRT / __sun__ / _AIX | |
| 121 | ||
| 122 | } // extern "C++" | |
| 123 | ||
| 100 | #include <math.h> | |
| 124 | 101 | #endif // __cplusplus |
| 125 | 102 | |
| 126 | 103 | #endif // _LIBCPP_STDLIB_H |
lib/libcxx/include/streambuf+3-4| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===------------------------- streambuf ----------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 |
lib/libcxx/include/string+36-41| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===--------------------------- string -----------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is distributed under the University of Illinois Open Source | |
| 7 | // License. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 | |
| ... | ... | @@ -628,13 +627,13 @@ struct __libcpp_string_gets_noexcept_iterator_impl : public false_type {}; |
| 628 | 627 | #else |
| 629 | 628 | template <class _Iter, bool = __is_forward_iterator<_Iter>::value> |
| 630 | 629 | struct __libcpp_string_gets_noexcept_iterator_impl : public _LIBCPP_BOOL_CONSTANT(( |
| 631 | noexcept(++(declval<_Iter&>())) && | |
| 632 | is_nothrow_assignable<_Iter&, _Iter>::value && | |
| 633 | noexcept(declval<_Iter>() == declval<_Iter>()) && | |
| 630 | noexcept(++(declval<_Iter&>())) && | |
| 631 | is_nothrow_assignable<_Iter&, _Iter>::value && | |
| 632 | noexcept(declval<_Iter>() == declval<_Iter>()) && | |
| 634 | 633 | noexcept(*declval<_Iter>()) |
| 635 | 634 | )) {}; |
| 636 | 635 | |
| 637 | template <class _Iter> | |
| 636 | template <class _Iter> | |
| 638 | 637 | struct __libcpp_string_gets_noexcept_iterator_impl<_Iter, false> : public false_type {}; |
| 639 | 638 | #endif |
| 640 | 639 | |
| ... | ... | @@ -863,10 +862,10 @@ public: |
| 863 | 862 | _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS |
| 864 | 863 | explicit basic_string(const _Tp& __t, const allocator_type& __a); |
| 865 | 864 | |
| 866 | template<class _InputIterator> | |
| 865 | template<class _InputIterator, class = typename enable_if<__is_input_iterator<_InputIterator>::value>::type> | |
| 867 | 866 | _LIBCPP_INLINE_VISIBILITY |
| 868 | 867 | basic_string(_InputIterator __first, _InputIterator __last); |
| 869 | template<class _InputIterator> | |
| 868 | template<class _InputIterator, class = typename enable_if<__is_input_iterator<_InputIterator>::value>::type> | |
| 870 | 869 | _LIBCPP_INLINE_VISIBILITY |
| 871 | 870 | basic_string(_InputIterator __first, _InputIterator __last, const allocator_type& __a); |
| 872 | 871 | #ifndef _LIBCPP_CXX03_LANG |
| ... | ... | @@ -1061,10 +1060,10 @@ public: |
| 1061 | 1060 | void push_back(value_type __c); |
| 1062 | 1061 | _LIBCPP_INLINE_VISIBILITY |
| 1063 | 1062 | void pop_back(); |
| 1064 | _LIBCPP_INLINE_VISIBILITY reference front(); | |
| 1065 | _LIBCPP_INLINE_VISIBILITY const_reference front() const; | |
| 1066 | _LIBCPP_INLINE_VISIBILITY reference back(); | |
| 1067 | _LIBCPP_INLINE_VISIBILITY const_reference back() const; | |
| 1063 | _LIBCPP_INLINE_VISIBILITY reference front() _NOEXCEPT; | |
| 1064 | _LIBCPP_INLINE_VISIBILITY const_reference front() const _NOEXCEPT; | |
| 1065 | _LIBCPP_INLINE_VISIBILITY reference back() _NOEXCEPT; | |
| 1066 | _LIBCPP_INLINE_VISIBILITY const_reference back() const _NOEXCEPT; | |
| 1068 | 1067 | |
| 1069 | 1068 | template <class _Tp> |
| 1070 | 1069 | _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS |
| ... | ... | @@ -1237,9 +1236,9 @@ public: |
| 1237 | 1236 | _LIBCPP_INLINE_VISIBILITY |
| 1238 | 1237 | void swap(basic_string& __str) |
| 1239 | 1238 | #if _LIBCPP_STD_VER >= 14 |
| 1240 | _NOEXCEPT_DEBUG; | |
| 1239 | _NOEXCEPT; | |
| 1241 | 1240 | #else |
| 1242 | _NOEXCEPT_DEBUG_(!__alloc_traits::propagate_on_container_swap::value || | |
| 1241 | _NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value || | |
| 1243 | 1242 | __is_nothrow_swappable<allocator_type>::value); |
| 1244 | 1243 | #endif |
| 1245 | 1244 | |
| ... | ... | @@ -1421,7 +1420,7 @@ public: |
| 1421 | 1420 | _LIBCPP_INLINE_VISIBILITY bool __invariants() const; |
| 1422 | 1421 | |
| 1423 | 1422 | _LIBCPP_INLINE_VISIBILITY void __clear_and_shrink() _NOEXCEPT; |
| 1424 | ||
| 1423 | ||
| 1425 | 1424 | _LIBCPP_INLINE_VISIBILITY |
| 1426 | 1425 | bool __is_long() const _NOEXCEPT |
| 1427 | 1426 | {return bool(__r_.first().__s.__size_ & __short_mask);} |
| ... | ... | @@ -1683,7 +1682,7 @@ basic_string(basic_string_view<_CharT, _Traits>, _Sz, _Sz, const _Allocator& = _ |
| 1683 | 1682 | -> basic_string<_CharT, _Traits, _Allocator>; |
| 1684 | 1683 | #endif |
| 1685 | 1684 | |
| 1686 | ||
| 1685 | ||
| 1687 | 1686 | template <class _CharT, class _Traits, class _Allocator> |
| 1688 | 1687 | inline |
| 1689 | 1688 | void |
| ... | ... | @@ -2078,7 +2077,7 @@ basic_string<_CharT, _Traits, _Allocator>::__init(_ForwardIterator __first, _For |
| 2078 | 2077 | } |
| 2079 | 2078 | |
| 2080 | 2079 | template <class _CharT, class _Traits, class _Allocator> |
| 2081 | template<class _InputIterator> | |
| 2080 | template<class _InputIterator, class> | |
| 2082 | 2081 | inline |
| 2083 | 2082 | basic_string<_CharT, _Traits, _Allocator>::basic_string(_InputIterator __first, _InputIterator __last) |
| 2084 | 2083 | { |
| ... | ... | @@ -2089,7 +2088,7 @@ basic_string<_CharT, _Traits, _Allocator>::basic_string(_InputIterator __first, |
| 2089 | 2088 | } |
| 2090 | 2089 | |
| 2091 | 2090 | template <class _CharT, class _Traits, class _Allocator> |
| 2092 | template<class _InputIterator> | |
| 2091 | template<class _InputIterator, class> | |
| 2093 | 2092 | inline |
| 2094 | 2093 | basic_string<_CharT, _Traits, _Allocator>::basic_string(_InputIterator __first, _InputIterator __last, |
| 2095 | 2094 | const allocator_type& __a) |
| ... | ... | @@ -2526,7 +2525,7 @@ basic_string<_CharT, _Traits, _Allocator>::__append_forward_unsafe( |
| 2526 | 2525 | const basic_string __temp (__first, __last, __alloc()); |
| 2527 | 2526 | append(__temp.data(), __temp.size()); |
| 2528 | 2527 | } |
| 2529 | else | |
| 2528 | else | |
| 2530 | 2529 | { |
| 2531 | 2530 | if (__cap - __sz < __n) |
| 2532 | 2531 | __grow_by(__cap, __sz + __n - __cap, __sz, __sz, 0); |
| ... | ... | @@ -3238,7 +3237,7 @@ basic_string<_CharT, _Traits, _Allocator>::at(size_type __n) |
| 3238 | 3237 | template <class _CharT, class _Traits, class _Allocator> |
| 3239 | 3238 | inline |
| 3240 | 3239 | typename basic_string<_CharT, _Traits, _Allocator>::reference |
| 3241 | basic_string<_CharT, _Traits, _Allocator>::front() | |
| 3240 | basic_string<_CharT, _Traits, _Allocator>::front() _NOEXCEPT | |
| 3242 | 3241 | { |
| 3243 | 3242 | _LIBCPP_ASSERT(!empty(), "string::front(): string is empty"); |
| 3244 | 3243 | return *__get_pointer(); |
| ... | ... | @@ -3247,7 +3246,7 @@ basic_string<_CharT, _Traits, _Allocator>::front() |
| 3247 | 3246 | template <class _CharT, class _Traits, class _Allocator> |
| 3248 | 3247 | inline |
| 3249 | 3248 | typename basic_string<_CharT, _Traits, _Allocator>::const_reference |
| 3250 | basic_string<_CharT, _Traits, _Allocator>::front() const | |
| 3249 | basic_string<_CharT, _Traits, _Allocator>::front() const _NOEXCEPT | |
| 3251 | 3250 | { |
| 3252 | 3251 | _LIBCPP_ASSERT(!empty(), "string::front(): string is empty"); |
| 3253 | 3252 | return *data(); |
| ... | ... | @@ -3256,7 +3255,7 @@ basic_string<_CharT, _Traits, _Allocator>::front() const |
| 3256 | 3255 | template <class _CharT, class _Traits, class _Allocator> |
| 3257 | 3256 | inline |
| 3258 | 3257 | typename basic_string<_CharT, _Traits, _Allocator>::reference |
| 3259 | basic_string<_CharT, _Traits, _Allocator>::back() | |
| 3258 | basic_string<_CharT, _Traits, _Allocator>::back() _NOEXCEPT | |
| 3260 | 3259 | { |
| 3261 | 3260 | _LIBCPP_ASSERT(!empty(), "string::back(): string is empty"); |
| 3262 | 3261 | return *(__get_pointer() + size() - 1); |
| ... | ... | @@ -3265,7 +3264,7 @@ basic_string<_CharT, _Traits, _Allocator>::back() |
| 3265 | 3264 | template <class _CharT, class _Traits, class _Allocator> |
| 3266 | 3265 | inline |
| 3267 | 3266 | typename basic_string<_CharT, _Traits, _Allocator>::const_reference |
| 3268 | basic_string<_CharT, _Traits, _Allocator>::back() const | |
| 3267 | basic_string<_CharT, _Traits, _Allocator>::back() const _NOEXCEPT | |
| 3269 | 3268 | { |
| 3270 | 3269 | _LIBCPP_ASSERT(!empty(), "string::back(): string is empty"); |
| 3271 | 3270 | return *(data() + size() - 1); |
| ... | ... | @@ -3296,9 +3295,9 @@ inline |
| 3296 | 3295 | void |
| 3297 | 3296 | basic_string<_CharT, _Traits, _Allocator>::swap(basic_string& __str) |
| 3298 | 3297 | #if _LIBCPP_STD_VER >= 14 |
| 3299 | _NOEXCEPT_DEBUG | |
| 3298 | _NOEXCEPT | |
| 3300 | 3299 | #else |
| 3301 | _NOEXCEPT_DEBUG_(!__alloc_traits::propagate_on_container_swap::value || | |
| 3300 | _NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value || | |
| 3302 | 3301 | __is_nothrow_swappable<allocator_type>::value) |
| 3303 | 3302 | #endif |
| 3304 | 3303 | { |
| ... | ... | @@ -3825,7 +3824,7 @@ basic_string<_CharT, _Traits, _Allocator>::__invariants() const |
| 3825 | 3824 | |
| 3826 | 3825 | template<class _CharT, class _Traits, class _Allocator> |
| 3827 | 3826 | inline |
| 3828 | void | |
| 3827 | void | |
| 3829 | 3828 | basic_string<_CharT, _Traits, _Allocator>::__clear_and_shrink() _NOEXCEPT |
| 3830 | 3829 | { |
| 3831 | 3830 | clear(); |
| ... | ... | @@ -3835,7 +3834,7 @@ basic_string<_CharT, _Traits, _Allocator>::__clear_and_shrink() _NOEXCEPT |
| 3835 | 3834 | __set_long_cap(0); |
| 3836 | 3835 | __set_short_size(0); |
| 3837 | 3836 | } |
| 3838 | } | |
| 3837 | } | |
| 3839 | 3838 | |
| 3840 | 3839 | // operator== |
| 3841 | 3840 | |
| ... | ... | @@ -4228,21 +4227,17 @@ template<class _CharT, class _Traits, class _Allocator> |
| 4228 | 4227 | const typename basic_string<_CharT, _Traits, _Allocator>::size_type |
| 4229 | 4228 | basic_string<_CharT, _Traits, _Allocator>::npos; |
| 4230 | 4229 | |
| 4231 | template<class _CharT, class _Traits, class _Allocator> | |
| 4232 | struct _LIBCPP_TEMPLATE_VIS hash<basic_string<_CharT, _Traits, _Allocator> > | |
| 4233 | : public unary_function<basic_string<_CharT, _Traits, _Allocator>, size_t> | |
| 4230 | template <class _CharT, class _Allocator> | |
| 4231 | struct _LIBCPP_TEMPLATE_VIS | |
| 4232 | hash<basic_string<_CharT, char_traits<_CharT>, _Allocator> > | |
| 4233 | : public unary_function< | |
| 4234 | basic_string<_CharT, char_traits<_CharT>, _Allocator>, size_t> | |
| 4234 | 4235 | { |
| 4235 | 4236 | size_t |
| 4236 | operator()(const basic_string<_CharT, _Traits, _Allocator>& __val) const _NOEXCEPT; | |
| 4237 | operator()(const basic_string<_CharT, char_traits<_CharT>, _Allocator>& __val) const _NOEXCEPT | |
| 4238 | { return __do_string_hash(__val.data(), __val.data() + __val.size()); } | |
| 4237 | 4239 | }; |
| 4238 | 4240 | |
| 4239 | template<class _CharT, class _Traits, class _Allocator> | |
| 4240 | size_t | |
| 4241 | hash<basic_string<_CharT, _Traits, _Allocator> >::operator()( | |
| 4242 | const basic_string<_CharT, _Traits, _Allocator>& __val) const _NOEXCEPT | |
| 4243 | { | |
| 4244 | return __do_string_hash(__val.data(), __val.data() + __val.size()); | |
| 4245 | } | |
| 4246 | 4241 | |
| 4247 | 4242 | template<class _CharT, class _Traits, class _Allocator> |
| 4248 | 4243 | basic_ostream<_CharT, _Traits>& |
| ... | ... | @@ -4332,7 +4327,7 @@ basic_string<_CharT, _Traits, _Allocator>::__subscriptable(const const_iterator* |
| 4332 | 4327 | _LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_string<char>) |
| 4333 | 4328 | _LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_string<wchar_t>) |
| 4334 | 4329 | |
| 4335 | #if _LIBCPP_STD_VER > 11 | |
| 4330 | #if _LIBCPP_STD_VER > 11 | |
| 4336 | 4331 | // Literal suffixes for basic_string [basic.string.literals] |
| 4337 | 4332 | inline namespace literals |
| 4338 | 4333 | { |
lib/libcxx/include/string.h+3-4| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===--------------------------- string.h ---------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is distributed under the University of Illinois Open Source | |
| 7 | // License. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 |
lib/libcxx/include/string_view+20-21| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===------------------------ string_view ---------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is distributed under the University of Illinois Open Source | |
| 7 | // License. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 | |
| ... | ... | @@ -229,9 +228,9 @@ public: |
| 229 | 228 | basic_string_view(const _CharT* __s, size_type __len) _NOEXCEPT |
| 230 | 229 | : __data(__s), __size(__len) |
| 231 | 230 | { |
| 232 | // #if _LIBCPP_STD_VER > 11 | |
| 233 | // _LIBCPP_ASSERT(__len == 0 || __s != nullptr, "string_view::string_view(_CharT *, size_t): received nullptr"); | |
| 234 | // #endif | |
| 231 | #if _LIBCPP_STD_VER > 11 | |
| 232 | _LIBCPP_ASSERT(__len == 0 || __s != nullptr, "string_view::string_view(_CharT *, size_t): received nullptr"); | |
| 233 | #endif | |
| 235 | 234 | } |
| 236 | 235 | |
| 237 | 236 | _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY |
| ... | ... | @@ -289,13 +288,13 @@ public: |
| 289 | 288 | } |
| 290 | 289 | |
| 291 | 290 | _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY |
| 292 | const_reference front() const | |
| 291 | const_reference front() const _NOEXCEPT | |
| 293 | 292 | { |
| 294 | 293 | return _LIBCPP_ASSERT(!empty(), "string_view::front(): string is empty"), __data[0]; |
| 295 | 294 | } |
| 296 | 295 | |
| 297 | 296 | _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY |
| 298 | const_reference back() const | |
| 297 | const_reference back() const _NOEXCEPT | |
| 299 | 298 | { |
| 300 | 299 | return _LIBCPP_ASSERT(!empty(), "string_view::back(): string is empty"), __data[__size-1]; |
| 301 | 300 | } |
| ... | ... | @@ -365,7 +364,7 @@ public: |
| 365 | 364 | } |
| 366 | 365 | |
| 367 | 366 | _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY |
| 368 | int compare( size_type __pos1, size_type __n1, | |
| 367 | int compare( size_type __pos1, size_type __n1, | |
| 369 | 368 | basic_string_view __sv, size_type __pos2, size_type __n2) const |
| 370 | 369 | { |
| 371 | 370 | return substr(__pos1, __n1).compare(__sv.substr(__pos2, __n2)); |
| ... | ... | @@ -629,7 +628,7 @@ bool operator==(basic_string_view<_CharT, _Traits> __lhs, |
| 629 | 628 | |
| 630 | 629 | template<class _CharT, class _Traits> |
| 631 | 630 | _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY |
| 632 | bool operator==(typename common_type<basic_string_view<_CharT, _Traits> >::type __lhs, | |
| 631 | bool operator==(typename common_type<basic_string_view<_CharT, _Traits> >::type __lhs, | |
| 633 | 632 | basic_string_view<_CharT, _Traits> __rhs) _NOEXCEPT |
| 634 | 633 | { |
| 635 | 634 | if ( __lhs.size() != __rhs.size()) return false; |
| ... | ... | @@ -659,7 +658,7 @@ bool operator!=(basic_string_view<_CharT, _Traits> __lhs, |
| 659 | 658 | |
| 660 | 659 | template<class _CharT, class _Traits> |
| 661 | 660 | _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY |
| 662 | bool operator!=(typename common_type<basic_string_view<_CharT, _Traits> >::type __lhs, | |
| 661 | bool operator!=(typename common_type<basic_string_view<_CharT, _Traits> >::type __lhs, | |
| 663 | 662 | basic_string_view<_CharT, _Traits> __rhs) _NOEXCEPT |
| 664 | 663 | { |
| 665 | 664 | if ( __lhs.size() != __rhs.size()) |
| ... | ... | @@ -686,7 +685,7 @@ bool operator<(basic_string_view<_CharT, _Traits> __lhs, |
| 686 | 685 | |
| 687 | 686 | template<class _CharT, class _Traits> |
| 688 | 687 | _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY |
| 689 | bool operator<(typename common_type<basic_string_view<_CharT, _Traits> >::type __lhs, | |
| 688 | bool operator<(typename common_type<basic_string_view<_CharT, _Traits> >::type __lhs, | |
| 690 | 689 | basic_string_view<_CharT, _Traits> __rhs) _NOEXCEPT |
| 691 | 690 | { |
| 692 | 691 | return __lhs.compare(__rhs) < 0; |
| ... | ... | @@ -711,7 +710,7 @@ bool operator>(basic_string_view<_CharT, _Traits> __lhs, |
| 711 | 710 | |
| 712 | 711 | template<class _CharT, class _Traits> |
| 713 | 712 | _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY |
| 714 | bool operator>(typename common_type<basic_string_view<_CharT, _Traits> >::type __lhs, | |
| 713 | bool operator>(typename common_type<basic_string_view<_CharT, _Traits> >::type __lhs, | |
| 715 | 714 | basic_string_view<_CharT, _Traits> __rhs) _NOEXCEPT |
| 716 | 715 | { |
| 717 | 716 | return __lhs.compare(__rhs) > 0; |
| ... | ... | @@ -736,7 +735,7 @@ bool operator<=(basic_string_view<_CharT, _Traits> __lhs, |
| 736 | 735 | |
| 737 | 736 | template<class _CharT, class _Traits> |
| 738 | 737 | _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY |
| 739 | bool operator<=(typename common_type<basic_string_view<_CharT, _Traits> >::type __lhs, | |
| 738 | bool operator<=(typename common_type<basic_string_view<_CharT, _Traits> >::type __lhs, | |
| 740 | 739 | basic_string_view<_CharT, _Traits> __rhs) _NOEXCEPT |
| 741 | 740 | { |
| 742 | 741 | return __lhs.compare(__rhs) <= 0; |
| ... | ... | @@ -762,7 +761,7 @@ bool operator>=(basic_string_view<_CharT, _Traits> __lhs, |
| 762 | 761 | |
| 763 | 762 | template<class _CharT, class _Traits> |
| 764 | 763 | _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY |
| 765 | bool operator>=(typename common_type<basic_string_view<_CharT, _Traits> >::type __lhs, | |
| 764 | bool operator>=(typename common_type<basic_string_view<_CharT, _Traits> >::type __lhs, | |
| 766 | 765 | basic_string_view<_CharT, _Traits> __rhs) _NOEXCEPT |
| 767 | 766 | { |
| 768 | 767 | return __lhs.compare(__rhs) >= 0; |
| ... | ... | @@ -777,18 +776,18 @@ typedef basic_string_view<char32_t> u32string_view; |
| 777 | 776 | typedef basic_string_view<wchar_t> wstring_view; |
| 778 | 777 | |
| 779 | 778 | // [string.view.hash] |
| 780 | template<class _CharT, class _Traits> | |
| 781 | struct _LIBCPP_TEMPLATE_VIS hash<basic_string_view<_CharT, _Traits> > | |
| 782 | : public unary_function<basic_string_view<_CharT, _Traits>, size_t> | |
| 779 | template<class _CharT> | |
| 780 | struct _LIBCPP_TEMPLATE_VIS hash<basic_string_view<_CharT, char_traits<_CharT> > > | |
| 781 | : public unary_function<basic_string_view<_CharT, char_traits<_CharT> >, size_t> | |
| 783 | 782 | { |
| 784 | 783 | _LIBCPP_INLINE_VISIBILITY |
| 785 | size_t operator()(const basic_string_view<_CharT, _Traits> __val) const _NOEXCEPT { | |
| 784 | size_t operator()(const basic_string_view<_CharT, char_traits<_CharT> > __val) const _NOEXCEPT { | |
| 786 | 785 | return __do_string_hash(__val.data(), __val.data() + __val.size()); |
| 787 | 786 | } |
| 788 | 787 | }; |
| 789 | 788 | |
| 790 | 789 | |
| 791 | #if _LIBCPP_STD_VER > 11 | |
| 790 | #if _LIBCPP_STD_VER > 11 | |
| 792 | 791 | inline namespace literals |
| 793 | 792 | { |
| 794 | 793 | inline namespace string_view_literals |
lib/libcxx/include/strstream+3-4| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===--------------------------- strstream --------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 |
lib/libcxx/include/support/android/locale_bionic.h+3-4| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===------------------- support/android/locale_bionic.h ------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 |
lib/libcxx/include/support/fuchsia/xlocale.h+3-4| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===------------------- support/fuchsia/xlocale.h ------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 |
lib/libcxx/include/support/ibm/limits.h+3-4| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===--------------------- support/ibm/limits.h ---------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 |
lib/libcxx/include/support/ibm/locale_mgmt_aix.h+3-4| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===------------------- support/ibm/locale_mgmt_aix.h --------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 |
lib/libcxx/include/support/ibm/support.h+3-4| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===----------------------- support/ibm/support.h ----------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 |
lib/libcxx/include/support/ibm/xlocale.h+3-4| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===--------------------- support/ibm/xlocale.h -------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 |
lib/libcxx/include/support/musl/xlocale.h+3-4| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===------------------- support/musl/xlocale.h ------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 | // This adds support for the extended locale functions that are currently |
lib/libcxx/include/support/newlib/xlocale.h+3-4| ... | ... | @@ -1,9 +1,8 @@ |
| 1 | 1 | //===----------------------------------------------------------------------===// |
| 2 | 2 | // |
| 3 | // The LLVM Compiler Infrastructure | |
| 4 | // | |
| 5 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 6 | // Source Licenses. See LICENSE.TXT for details. | |
| 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 4 | // See https://llvm.org/LICENSE.txt for license information. | |
| 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 7 | 6 | // |
| 8 | 7 | //===----------------------------------------------------------------------===// |
| 9 | 8 |
lib/libcxx/include/support/solaris/floatingpoint.h+3-4| ... | ... | @@ -1,9 +1,8 @@ |
| 1 | 1 | //===----------------------------------------------------------------------===// |
| 2 | 2 | // |
| 3 | // The LLVM Compiler Infrastructure | |
| 4 | // | |
| 5 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 6 | // Source Licenses. See LICENSE.TXT for details. | |
| 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 4 | // See https://llvm.org/LICENSE.txt for license information. | |
| 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 7 | 6 | // |
| 8 | 7 | //===----------------------------------------------------------------------===// |
| 9 | 8 |
lib/libcxx/include/support/solaris/wchar.h+3-4| ... | ... | @@ -1,9 +1,8 @@ |
| 1 | 1 | //===----------------------------------------------------------------------===// |
| 2 | 2 | // |
| 3 | // The LLVM Compiler Infrastructure | |
| 4 | // | |
| 5 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 6 | // Source Licenses. See LICENSE.TXT for details. | |
| 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 4 | // See https://llvm.org/LICENSE.txt for license information. | |
| 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 7 | 6 | // |
| 8 | 7 | //===----------------------------------------------------------------------===// |
| 9 | 8 |
lib/libcxx/include/support/solaris/xlocale.h+3-4| ... | ... | @@ -1,9 +1,8 @@ |
| 1 | 1 | //===----------------------------------------------------------------------===// |
| 2 | 2 | // |
| 3 | // The LLVM Compiler Infrastructure | |
| 4 | // | |
| 5 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 6 | // Source Licenses. See LICENSE.TXT for details. | |
| 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 4 | // See https://llvm.org/LICENSE.txt for license information. | |
| 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 7 | 6 | // |
| 8 | 7 | //===----------------------------------------------------------------------===// |
| 9 | 8 |
lib/libcxx/include/support/win32/limits_msvc_win32.h+3-4| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===------------------ support/win32/limits_msvc_win32.h -----------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 |
lib/libcxx/include/support/win32/locale_win32.h+3-4| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===--------------------- support/win32/locale_win32.h -------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 |
lib/libcxx/include/support/xlocale/__nop_locale_mgmt.h+3-4| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===------------ support/xlocale/__nop_locale_mgmt.h -----------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 |
lib/libcxx/include/support/xlocale/__posix_l_fallback.h+3-4| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===--------------- support/xlocale/__posix_l_fallback.h -----------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 | // These are reimplementations of some extended locale functions ( *_l ) that |
lib/libcxx/include/support/xlocale/__strtonum_fallback.h+3-4| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===-------------- support/xlocale/__strtonum_fallback.h -----------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 | // These are reimplementations of some extended locale functions ( *_l ) that |
lib/libcxx/include/support/xlocale/xlocale.h deletedlib/libcxx/include/system_error+3-4| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===---------------------------- system_error ----------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 |
lib/libcxx/include/tgmath.h+3-4| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===-------------------------- tgmath.h ----------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 |
lib/libcxx/include/thread+8-4| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===--------------------------- thread -----------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 | |
| ... | ... | @@ -435,7 +434,12 @@ sleep_for(const chrono::duration<_Rep, _Period>& __d) |
| 435 | 434 | using namespace chrono; |
| 436 | 435 | if (__d > duration<_Rep, _Period>::zero()) |
| 437 | 436 | { |
| 437 | #if defined(_LIBCPP_COMPILER_GCC) && (__powerpc__ || __POWERPC__) | |
| 438 | // GCC's long double const folding is incomplete for IBM128 long doubles. | |
| 438 | 439 | _LIBCPP_CONSTEXPR duration<long double> _Max = nanoseconds::max(); |
| 440 | #else | |
| 441 | _LIBCPP_CONSTEXPR duration<long double> _Max = duration<long double>(ULLONG_MAX/1000000000ULL) ; | |
| 442 | #endif | |
| 439 | 443 | nanoseconds __ns; |
| 440 | 444 | if (__d < _Max) |
| 441 | 445 | { |
lib/libcxx/include/tuple+87-68| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===--------------------------- tuple ------------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is distributed under the University of Illinois Open Source | |
| 7 | // License. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 | |
| ... | ... | @@ -88,8 +87,8 @@ template <class T> struct tuple_size; // undefined |
| 88 | 87 | template <class... T> struct tuple_size<tuple<T...>>; |
| 89 | 88 | template <class T> |
| 90 | 89 | inline constexpr size_t tuple_size_v = tuple_size<T>::value; // C++17 |
| 91 | template <size_t I, class T> class tuple_element; // undefined | |
| 92 | template <size_t I, class... T> class tuple_element<I, tuple<T...>>; | |
| 90 | template <size_t I, class T> struct tuple_element; // undefined | |
| 91 | template <size_t I, class... T> struct tuple_element<I, tuple<T...>>; | |
| 93 | 92 | template <size_t I, class T> |
| 94 | 93 | using tuple_element_t = typename tuple_element <I, T>::type; // C++14 |
| 95 | 94 | |
| ... | ... | @@ -210,12 +209,12 @@ public: |
| 210 | 209 | "Attempted to default construct a reference element in a tuple");} |
| 211 | 210 | |
| 212 | 211 | template <class _Tp, |
| 213 | class = typename enable_if< | |
| 214 | __lazy_and< | |
| 215 | __lazy_not<is_same<typename __uncvref<_Tp>::type, __tuple_leaf>> | |
| 216 | , is_constructible<_Hp, _Tp> | |
| 212 | class = _EnableIf< | |
| 213 | _And< | |
| 214 | _IsNotSame<__uncvref_t<_Tp>, __tuple_leaf>, | |
| 215 | is_constructible<_Hp, _Tp> | |
| 217 | 216 | >::value |
| 218 | >::type | |
| 217 | > | |
| 219 | 218 | > |
| 220 | 219 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 |
| 221 | 220 | explicit __tuple_leaf(_Tp&& __t) _NOEXCEPT_((is_nothrow_constructible<_Hp, _Tp>::value)) |
| ... | ... | @@ -292,12 +291,12 @@ public: |
| 292 | 291 | : _Hp(__a) {} |
| 293 | 292 | |
| 294 | 293 | template <class _Tp, |
| 295 | class = typename enable_if< | |
| 296 | __lazy_and< | |
| 297 | __lazy_not<is_same<typename __uncvref<_Tp>::type, __tuple_leaf>> | |
| 298 | , is_constructible<_Hp, _Tp> | |
| 299 | >::value | |
| 300 | >::type | |
| 294 | class = _EnableIf< | |
| 295 | _And< | |
| 296 | _IsNotSame<__uncvref_t<_Tp>, __tuple_leaf>, | |
| 297 | is_constructible<_Hp, _Tp> | |
| 298 | >::value | |
| 299 | > | |
| 301 | 300 | > |
| 302 | 301 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 |
| 303 | 302 | explicit __tuple_leaf(_Tp&& __t) _NOEXCEPT_((is_nothrow_constructible<_Hp, _Tp>::value)) |
| ... | ... | @@ -346,9 +345,6 @@ template <class ..._Tp> |
| 346 | 345 | _LIBCPP_INLINE_VISIBILITY |
| 347 | 346 | void __swallow(_Tp&&...) _NOEXCEPT {} |
| 348 | 347 | |
| 349 | template <class ..._Tp> | |
| 350 | struct __lazy_all : __all<_Tp::value...> {}; | |
| 351 | ||
| 352 | 348 | template <class _Tp> |
| 353 | 349 | struct __all_default_constructible; |
| 354 | 350 | |
| ... | ... | @@ -525,6 +521,13 @@ class _LIBCPP_TEMPLATE_VIS tuple |
| 525 | 521 | template <class ..._Args> |
| 526 | 522 | static constexpr bool __enable_implicit() { |
| 527 | 523 | return |
| 524 | __tuple_constructible< | |
| 525 | tuple<_Args...>, | |
| 526 | typename __make_tuple_types<tuple, | |
| 527 | sizeof...(_Args) < sizeof...(_Tp) ? | |
| 528 | sizeof...(_Args) : | |
| 529 | sizeof...(_Tp)>::type | |
| 530 | >::value && | |
| 528 | 531 | __tuple_convertible< |
| 529 | 532 | tuple<_Args...>, |
| 530 | 533 | typename __make_tuple_types<tuple, |
| ... | ... | @@ -551,7 +554,8 @@ class _LIBCPP_TEMPLATE_VIS tuple |
| 551 | 554 | { |
| 552 | 555 | template <class _Tuple> |
| 553 | 556 | static constexpr bool __enable_implicit() { |
| 554 | return __tuple_convertible<_Tuple, tuple>::value; | |
| 557 | return __tuple_constructible<_Tuple, tuple>::value | |
| 558 | && __tuple_convertible<_Tuple, tuple>::value; | |
| 555 | 559 | } |
| 556 | 560 | |
| 557 | 561 | template <class _Tuple> |
| ... | ... | @@ -568,19 +572,20 @@ class _LIBCPP_TEMPLATE_VIS tuple |
| 568 | 572 | // the UTypes... constructor should be selected instead. |
| 569 | 573 | // See LWG issue #2549. |
| 570 | 574 | template <class _Tuple> |
| 571 | using _PreferTupleLikeConstructor = __lazy_or< | |
| 575 | using _PreferTupleLikeConstructor = _Or< | |
| 572 | 576 | // Don't attempt the two checks below if the tuple we are given |
| 573 | 577 | // has the same type as this tuple. |
| 574 | is_same<typename __uncvref<_Tuple>::type, tuple>, | |
| 575 | __lazy_and< | |
| 576 | __lazy_not<is_constructible<_Tp..., _Tuple>>, | |
| 577 | __lazy_not<is_convertible<_Tuple, _Tp...>> | |
| 578 | _IsSame<__uncvref_t<_Tuple>, tuple>, | |
| 579 | _Lazy<_And, | |
| 580 | _Not<is_constructible<_Tp..., _Tuple>>, | |
| 581 | _Not<is_convertible<_Tuple, _Tp...>> | |
| 578 | 582 | > |
| 579 | 583 | >; |
| 580 | 584 | |
| 581 | 585 | template <class _Tuple> |
| 582 | 586 | static constexpr bool __enable_implicit() { |
| 583 | return __lazy_and< | |
| 587 | return _And< | |
| 588 | __tuple_constructible<_Tuple, tuple>, | |
| 584 | 589 | __tuple_convertible<_Tuple, tuple>, |
| 585 | 590 | _PreferTupleLikeConstructor<_Tuple> |
| 586 | 591 | >::value; |
| ... | ... | @@ -588,14 +593,33 @@ class _LIBCPP_TEMPLATE_VIS tuple |
| 588 | 593 | |
| 589 | 594 | template <class _Tuple> |
| 590 | 595 | static constexpr bool __enable_explicit() { |
| 591 | return __lazy_and< | |
| 596 | return _And< | |
| 592 | 597 | __tuple_constructible<_Tuple, tuple>, |
| 593 | 598 | _PreferTupleLikeConstructor<_Tuple>, |
| 594 | __lazy_not<__tuple_convertible<_Tuple, tuple>> | |
| 599 | _Not<__tuple_convertible<_Tuple, tuple>> | |
| 595 | 600 | >::value; |
| 596 | 601 | } |
| 597 | 602 | }; |
| 598 | 603 | |
| 604 | template <class _Tuple, bool _DisableIfLValue> | |
| 605 | using _EnableImplicitTupleLikeConstructor = _EnableIf< | |
| 606 | _CheckTupleLikeConstructor< | |
| 607 | __tuple_like_with_size<_Tuple, sizeof...(_Tp)>::value | |
| 608 | && !_PackExpandsToThisTuple<_Tuple>::value | |
| 609 | && (!is_lvalue_reference<_Tuple>::value || !_DisableIfLValue) | |
| 610 | >::template __enable_implicit<_Tuple>(), | |
| 611 | bool | |
| 612 | >; | |
| 613 | ||
| 614 | template <class _Tuple, bool _DisableIfLValue> | |
| 615 | using _EnableExplicitTupleLikeConstructor = _EnableIf< | |
| 616 | _CheckTupleLikeConstructor< | |
| 617 | __tuple_like_with_size<_Tuple, sizeof...(_Tp)>::value | |
| 618 | && !_PackExpandsToThisTuple<_Tuple>::value | |
| 619 | && (!is_lvalue_reference<_Tuple>::value || !_DisableIfLValue) | |
| 620 | >::template __enable_explicit<_Tuple>(), | |
| 621 | bool | |
| 622 | >; | |
| 599 | 623 | template <size_t _Jp, class ..._Up> friend _LIBCPP_CONSTEXPR_AFTER_CXX11 |
| 600 | 624 | typename tuple_element<_Jp, tuple<_Up...> >::type& get(tuple<_Up...>&) _NOEXCEPT; |
| 601 | 625 | template <size_t _Jp, class ..._Up> friend _LIBCPP_CONSTEXPR_AFTER_CXX11 |
| ... | ... | @@ -616,12 +640,13 @@ public: |
| 616 | 640 | tuple(tuple const&) = default; |
| 617 | 641 | tuple(tuple&&) = default; |
| 618 | 642 | |
| 619 | template <class _AllocArgT, class _Alloc, bool _Dummy = true, class = typename enable_if< | |
| 620 | __lazy_and< | |
| 621 | is_same<allocator_arg_t, _AllocArgT>, | |
| 622 | __lazy_all<__dependent_type<is_default_constructible<_Tp>, _Dummy>...> | |
| 643 | template <class _AllocArgT, class _Alloc, bool _Dummy = true, class = _EnableIf< | |
| 644 | _And< | |
| 645 | _IsSame<allocator_arg_t, _AllocArgT>, | |
| 646 | __dependent_type<is_default_constructible<_Tp>, _Dummy>... | |
| 623 | 647 | >::value |
| 624 | >::type> | |
| 648 | > | |
| 649 | > | |
| 625 | 650 | _LIBCPP_INLINE_VISIBILITY |
| 626 | 651 | tuple(_AllocArgT, _Alloc const& __a) |
| 627 | 652 | : __base_(allocator_arg_t(), __a, |
| ... | ... | @@ -809,35 +834,27 @@ public: |
| 809 | 834 | typename __make_tuple_types<tuple, sizeof...(_Tp), sizeof...(_Up)>::type(), |
| 810 | 835 | _VSTD::forward<_Up>(__u)...) {} |
| 811 | 836 | |
| 812 | template <class _Tuple, | |
| 813 | typename enable_if | |
| 814 | < | |
| 815 | _CheckTupleLikeConstructor< | |
| 816 | __tuple_like_with_size<_Tuple, sizeof...(_Tp)>::value | |
| 817 | && !_PackExpandsToThisTuple<_Tuple>::value | |
| 818 | >::template __enable_implicit<_Tuple>(), | |
| 819 | bool | |
| 820 | >::type = false | |
| 821 | > | |
| 837 | template <class _Tuple, _EnableImplicitTupleLikeConstructor<_Tuple, true> = false> | |
| 822 | 838 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 |
| 823 | 839 | tuple(_Tuple&& __t) _NOEXCEPT_((is_nothrow_constructible<_BaseT, _Tuple>::value)) |
| 824 | 840 | : __base_(_VSTD::forward<_Tuple>(__t)) {} |
| 825 | 841 | |
| 826 | template <class _Tuple, | |
| 827 | typename enable_if | |
| 828 | < | |
| 829 | _CheckTupleLikeConstructor< | |
| 830 | __tuple_like_with_size<_Tuple, sizeof...(_Tp)>::value | |
| 831 | && !_PackExpandsToThisTuple<_Tuple>::value | |
| 832 | >::template __enable_explicit<_Tuple>(), | |
| 833 | bool | |
| 834 | >::type = false | |
| 835 | > | |
| 842 | template <class _Tuple, _EnableImplicitTupleLikeConstructor<const _Tuple&, false> = false> | |
| 843 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 | |
| 844 | tuple(const _Tuple& __t) _NOEXCEPT_((is_nothrow_constructible<_BaseT, const _Tuple&>::value)) | |
| 845 | : __base_(__t) {} | |
| 846 | template <class _Tuple, _EnableExplicitTupleLikeConstructor<_Tuple, true> = false> | |
| 836 | 847 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 |
| 837 | 848 | explicit |
| 838 | 849 | tuple(_Tuple&& __t) _NOEXCEPT_((is_nothrow_constructible<_BaseT, _Tuple>::value)) |
| 839 | 850 | : __base_(_VSTD::forward<_Tuple>(__t)) {} |
| 840 | 851 | |
| 852 | template <class _Tuple, _EnableExplicitTupleLikeConstructor<const _Tuple&, false> = false> | |
| 853 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 | |
| 854 | explicit | |
| 855 | tuple(const _Tuple& __t) _NOEXCEPT_((is_nothrow_constructible<_BaseT, const _Tuple&>::value)) | |
| 856 | : __base_(__t) {} | |
| 857 | ||
| 841 | 858 | template <class _Alloc, class _Tuple, |
| 842 | 859 | typename enable_if |
| 843 | 860 | < |
| ... | ... | @@ -908,7 +925,7 @@ class _LIBCPP_TEMPLATE_VIS tuple<> |
| 908 | 925 | { |
| 909 | 926 | public: |
| 910 | 927 | _LIBCPP_INLINE_VISIBILITY |
| 911 | _LIBCPP_CONSTEXPR tuple() _NOEXCEPT {} | |
| 928 | _LIBCPP_CONSTEXPR tuple() _NOEXCEPT = default; | |
| 912 | 929 | template <class _Alloc> |
| 913 | 930 | _LIBCPP_INLINE_VISIBILITY |
| 914 | 931 | tuple(allocator_arg_t, const _Alloc&) _NOEXCEPT {} |
| ... | ... | @@ -953,7 +970,7 @@ inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 |
| 953 | 970 | typename tuple_element<_Ip, tuple<_Tp...> >::type& |
| 954 | 971 | get(tuple<_Tp...>& __t) _NOEXCEPT |
| 955 | 972 | { |
| 956 | typedef typename tuple_element<_Ip, tuple<_Tp...> >::type type; | |
| 973 | typedef _LIBCPP_NODEBUG_TYPE typename tuple_element<_Ip, tuple<_Tp...> >::type type; | |
| 957 | 974 | return static_cast<__tuple_leaf<_Ip, type>&>(__t.__base_).get(); |
| 958 | 975 | } |
| 959 | 976 | |
| ... | ... | @@ -962,7 +979,7 @@ inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 |
| 962 | 979 | const typename tuple_element<_Ip, tuple<_Tp...> >::type& |
| 963 | 980 | get(const tuple<_Tp...>& __t) _NOEXCEPT |
| 964 | 981 | { |
| 965 | typedef typename tuple_element<_Ip, tuple<_Tp...> >::type type; | |
| 982 | typedef _LIBCPP_NODEBUG_TYPE typename tuple_element<_Ip, tuple<_Tp...> >::type type; | |
| 966 | 983 | return static_cast<const __tuple_leaf<_Ip, type>&>(__t.__base_).get(); |
| 967 | 984 | } |
| 968 | 985 | |
| ... | ... | @@ -971,7 +988,7 @@ inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 |
| 971 | 988 | typename tuple_element<_Ip, tuple<_Tp...> >::type&& |
| 972 | 989 | get(tuple<_Tp...>&& __t) _NOEXCEPT |
| 973 | 990 | { |
| 974 | typedef typename tuple_element<_Ip, tuple<_Tp...> >::type type; | |
| 991 | typedef _LIBCPP_NODEBUG_TYPE typename tuple_element<_Ip, tuple<_Tp...> >::type type; | |
| 975 | 992 | return static_cast<type&&>( |
| 976 | 993 | static_cast<__tuple_leaf<_Ip, type>&&>(__t.__base_).get()); |
| 977 | 994 | } |
| ... | ... | @@ -981,7 +998,7 @@ inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 |
| 981 | 998 | const typename tuple_element<_Ip, tuple<_Tp...> >::type&& |
| 982 | 999 | get(const tuple<_Tp...>&& __t) _NOEXCEPT |
| 983 | 1000 | { |
| 984 | typedef typename tuple_element<_Ip, tuple<_Tp...> >::type type; | |
| 1001 | typedef _LIBCPP_NODEBUG_TYPE typename tuple_element<_Ip, tuple<_Tp...> >::type type; | |
| 985 | 1002 | return static_cast<const type&&>( |
| 986 | 1003 | static_cast<const __tuple_leaf<_Ip, type>&&>(__t.__base_).get()); |
| 987 | 1004 | } |
| ... | ... | @@ -1121,6 +1138,7 @@ inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 |
| 1121 | 1138 | bool |
| 1122 | 1139 | operator==(const tuple<_Tp...>& __x, const tuple<_Up...>& __y) |
| 1123 | 1140 | { |
| 1141 | static_assert (sizeof...(_Tp) == sizeof...(_Up), "Can't compare tuples of different sizes"); | |
| 1124 | 1142 | return __tuple_equal<sizeof...(_Tp)>()(__x, __y); |
| 1125 | 1143 | } |
| 1126 | 1144 | |
| ... | ... | @@ -1164,6 +1182,7 @@ inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 |
| 1164 | 1182 | bool |
| 1165 | 1183 | operator<(const tuple<_Tp...>& __x, const tuple<_Up...>& __y) |
| 1166 | 1184 | { |
| 1185 | static_assert (sizeof...(_Tp) == sizeof...(_Up), "Can't compare tuples of different sizes"); | |
| 1167 | 1186 | return __tuple_less<sizeof...(_Tp)>()(__x, __y); |
| 1168 | 1187 | } |
| 1169 | 1188 | |
| ... | ... | @@ -1198,7 +1217,7 @@ template <class _Tp, class _Up> struct __tuple_cat_type; |
| 1198 | 1217 | template <class ..._Ttypes, class ..._Utypes> |
| 1199 | 1218 | struct __tuple_cat_type<tuple<_Ttypes...>, __tuple_types<_Utypes...> > |
| 1200 | 1219 | { |
| 1201 | typedef tuple<_Ttypes..., _Utypes...> type; | |
| 1220 | typedef _LIBCPP_NODEBUG_TYPE tuple<_Ttypes..., _Utypes...> type; | |
| 1202 | 1221 | }; |
| 1203 | 1222 | |
| 1204 | 1223 | template <class _ResultTuple, bool _Is_Tuple0TupleLike, class ..._Tuples> |
| ... | ... | @@ -1209,8 +1228,8 @@ struct __tuple_cat_return_1 |
| 1209 | 1228 | template <class ..._Types, class _Tuple0> |
| 1210 | 1229 | struct __tuple_cat_return_1<tuple<_Types...>, true, _Tuple0> |
| 1211 | 1230 | { |
| 1212 | typedef typename __tuple_cat_type<tuple<_Types...>, | |
| 1213 | typename __make_tuple_types<typename remove_reference<_Tuple0>::type>::type>::type | |
| 1231 | typedef _LIBCPP_NODEBUG_TYPE typename __tuple_cat_type<tuple<_Types...>, | |
| 1232 | typename __make_tuple_types<typename __uncvref<_Tuple0>::type>::type>::type | |
| 1214 | 1233 | type; |
| 1215 | 1234 | }; |
| 1216 | 1235 | |
| ... | ... | @@ -1219,7 +1238,7 @@ struct __tuple_cat_return_1<tuple<_Types...>, true, _Tuple0, _Tuple1, _Tuples... |
| 1219 | 1238 | : public __tuple_cat_return_1< |
| 1220 | 1239 | typename __tuple_cat_type< |
| 1221 | 1240 | tuple<_Types...>, |
| 1222 | typename __make_tuple_types<typename remove_reference<_Tuple0>::type>::type | |
| 1241 | typename __make_tuple_types<typename __uncvref<_Tuple0>::type>::type | |
| 1223 | 1242 | >::type, |
| 1224 | 1243 | __tuple_like<typename remove_reference<_Tuple1>::type>::value, |
| 1225 | 1244 | _Tuple1, _Tuples...> |
| ... | ... | @@ -1239,7 +1258,7 @@ struct __tuple_cat_return<_Tuple0, _Tuples...> |
| 1239 | 1258 | template <> |
| 1240 | 1259 | struct __tuple_cat_return<> |
| 1241 | 1260 | { |
| 1242 | typedef tuple<> type; | |
| 1261 | typedef _LIBCPP_NODEBUG_TYPE tuple<> type; | |
| 1243 | 1262 | }; |
| 1244 | 1263 | |
| 1245 | 1264 | inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 |
| ... | ... | @@ -1255,7 +1274,7 @@ struct __tuple_cat_return_ref_imp; |
| 1255 | 1274 | template <class ..._Types, size_t ..._I0, class _Tuple0> |
| 1256 | 1275 | struct __tuple_cat_return_ref_imp<tuple<_Types...>, __tuple_indices<_I0...>, _Tuple0> |
| 1257 | 1276 | { |
| 1258 | typedef typename remove_reference<_Tuple0>::type _T0; | |
| 1277 | typedef _LIBCPP_NODEBUG_TYPE typename remove_reference<_Tuple0>::type _T0; | |
| 1259 | 1278 | typedef tuple<_Types..., typename __apply_cv<_Tuple0, |
| 1260 | 1279 | typename tuple_element<_I0, _T0>::type>::type&&...> type; |
| 1261 | 1280 | }; |
| ... | ... | @@ -1302,8 +1321,8 @@ struct __tuple_cat<tuple<_Types...>, __tuple_indices<_I0...>, __tuple_indices<_J |
| 1302 | 1321 | typename __tuple_cat_return_ref<tuple<_Types...>&&, _Tuple0&&, _Tuple1&&, _Tuples&&...>::type |
| 1303 | 1322 | operator()(tuple<_Types...> __t, _Tuple0&& __t0, _Tuple1&& __t1, _Tuples&& ...__tpls) |
| 1304 | 1323 | { |
| 1305 | typedef typename remove_reference<_Tuple0>::type _T0; | |
| 1306 | typedef typename remove_reference<_Tuple1>::type _T1; | |
| 1324 | typedef _LIBCPP_NODEBUG_TYPE typename remove_reference<_Tuple0>::type _T0; | |
| 1325 | typedef _LIBCPP_NODEBUG_TYPE typename remove_reference<_Tuple1>::type _T1; | |
| 1307 | 1326 | return __tuple_cat< |
| 1308 | 1327 | tuple<_Types..., typename __apply_cv<_Tuple0, typename tuple_element<_J0, _T0>::type>::type&&...>, |
| 1309 | 1328 | typename __make_tuple_indices<sizeof ...(_Types) + tuple_size<_T0>::value>::type, |
| ... | ... | @@ -1322,7 +1341,7 @@ inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 |
| 1322 | 1341 | typename __tuple_cat_return<_Tuple0, _Tuples...>::type |
| 1323 | 1342 | tuple_cat(_Tuple0&& __t0, _Tuples&&... __tpls) |
| 1324 | 1343 | { |
| 1325 | typedef typename remove_reference<_Tuple0>::type _T0; | |
| 1344 | typedef _LIBCPP_NODEBUG_TYPE typename remove_reference<_Tuple0>::type _T0; | |
| 1326 | 1345 | return __tuple_cat<tuple<>, __tuple_indices<>, |
| 1327 | 1346 | typename __make_tuple_indices<tuple_size<_T0>::value>::type>() |
| 1328 | 1347 | (tuple<>(), _VSTD::forward<_Tuple0>(__t0), |
lib/libcxx/include/type_traits+431-1240| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===------------------------ type_traits ---------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 | |
| ... | ... | @@ -91,6 +90,9 @@ namespace std |
| 91 | 90 | template <class T> struct remove_extent; |
| 92 | 91 | template <class T> struct remove_all_extents; |
| 93 | 92 | |
| 93 | template <class T> struct is_bounded_array; // C++20 | |
| 94 | template <class T> struct is_unbounded_array; // C++20 | |
| 95 | ||
| 94 | 96 | // Member introspection: |
| 95 | 97 | template <class T> struct is_pod; |
| 96 | 98 | template <class T> struct is_trivial; |
| ... | ... | @@ -141,7 +143,10 @@ namespace std |
| 141 | 143 | // Relationships between types: |
| 142 | 144 | template <class T, class U> struct is_same; |
| 143 | 145 | template <class Base, class Derived> struct is_base_of; |
| 146 | ||
| 144 | 147 | template <class From, class To> struct is_convertible; |
| 148 | template <typename From, typename To> struct is_nothrow_convertible; // C++20 | |
| 149 | template <typename From, typename To> inline constexpr bool is_nothrow_convertible_v; // C++20 | |
| 145 | 150 | |
| 146 | 151 | template <class Fn, class... ArgTypes> struct is_invocable; |
| 147 | 152 | template <class R, class Fn, class... ArgTypes> struct is_invocable_r; |
| ... | ... | @@ -197,6 +202,12 @@ namespace std |
| 197 | 202 | template <class T> |
| 198 | 203 | using remove_all_extents_t = typename remove_all_extents<T>::type; // C++14 |
| 199 | 204 | |
| 205 | template <class T> | |
| 206 | inline constexpr bool is_bounded_array_v | |
| 207 | = is_bounded_array<T>::value; // C++20 | |
| 208 | inline constexpr bool is_unbounded_array_v | |
| 209 | = is_unbounded_array<T>::value; // C++20 | |
| 210 | ||
| 200 | 211 | // pointer modifications: |
| 201 | 212 | template <class T> |
| 202 | 213 | using remove_pointer_t = typename remove_pointer<T>::type; // C++14 |
| ... | ... | @@ -416,6 +427,96 @@ template <class _T1, class _T2> struct _LIBCPP_TEMPLATE_VIS pair; |
| 416 | 427 | template <class _Tp> class _LIBCPP_TEMPLATE_VIS reference_wrapper; |
| 417 | 428 | template <class _Tp> struct _LIBCPP_TEMPLATE_VIS hash; |
| 418 | 429 | |
| 430 | ||
| 431 | template <class _Tp, _Tp __v> | |
| 432 | struct _LIBCPP_TEMPLATE_VIS integral_constant | |
| 433 | { | |
| 434 | static _LIBCPP_CONSTEXPR const _Tp value = __v; | |
| 435 | typedef _Tp value_type; | |
| 436 | typedef integral_constant type; | |
| 437 | _LIBCPP_INLINE_VISIBILITY | |
| 438 | _LIBCPP_CONSTEXPR operator value_type() const _NOEXCEPT {return value;} | |
| 439 | #if _LIBCPP_STD_VER > 11 | |
| 440 | _LIBCPP_INLINE_VISIBILITY | |
| 441 | constexpr value_type operator ()() const _NOEXCEPT {return value;} | |
| 442 | #endif | |
| 443 | }; | |
| 444 | ||
| 445 | template <class _Tp, _Tp __v> | |
| 446 | _LIBCPP_CONSTEXPR const _Tp integral_constant<_Tp, __v>::value; | |
| 447 | ||
| 448 | #if _LIBCPP_STD_VER > 14 | |
| 449 | template <bool __b> | |
| 450 | using bool_constant = integral_constant<bool, __b>; | |
| 451 | #define _LIBCPP_BOOL_CONSTANT(__b) bool_constant<(__b)> | |
| 452 | #else | |
| 453 | #define _LIBCPP_BOOL_CONSTANT(__b) integral_constant<bool,(__b)> | |
| 454 | #endif | |
| 455 | ||
| 456 | typedef _LIBCPP_BOOL_CONSTANT(true) true_type; | |
| 457 | typedef _LIBCPP_BOOL_CONSTANT(false) false_type; | |
| 458 | ||
| 459 | template <bool _Val> | |
| 460 | using _BoolConstant _LIBCPP_NODEBUG_TYPE = integral_constant<bool, _Val>; | |
| 461 | ||
| 462 | template <bool> struct _MetaBase; | |
| 463 | template <> | |
| 464 | struct _MetaBase<true> { | |
| 465 | template <class _Tp, class _Up> | |
| 466 | using _SelectImpl _LIBCPP_NODEBUG_TYPE = _Tp; | |
| 467 | template <template <class...> class _FirstFn, template <class...> class, class ..._Args> | |
| 468 | using _SelectApplyImpl _LIBCPP_NODEBUG_TYPE = _FirstFn<_Args...>; | |
| 469 | template <class _First, class...> | |
| 470 | using _FirstImpl _LIBCPP_NODEBUG_TYPE = _First; | |
| 471 | template <class, class _Second, class...> | |
| 472 | using _SecondImpl _LIBCPP_NODEBUG_TYPE = _Second; | |
| 473 | template <class _Tp = void> | |
| 474 | using _EnableIfImpl _LIBCPP_NODEBUG_TYPE = _Tp; | |
| 475 | template <class _Result, class _First, class ..._Rest> | |
| 476 | using _OrImpl _LIBCPP_NODEBUG_TYPE = typename _MetaBase<_First::value != true && sizeof...(_Rest) != 0>::template _OrImpl<_First, _Rest...>; | |
| 477 | template <class _Result, class _First, class ..._Rest> | |
| 478 | using _AndImpl _LIBCPP_NODEBUG_TYPE = typename _MetaBase<_First::value == true && sizeof...(_Rest) != 0>::template _AndImpl<_First, _Rest...>; | |
| 479 | }; | |
| 480 | ||
| 481 | template <> | |
| 482 | struct _MetaBase<false> { | |
| 483 | template <class _Tp, class _Up> | |
| 484 | using _SelectImpl _LIBCPP_NODEBUG_TYPE = _Up; | |
| 485 | template <template <class...> class, template <class...> class _SecondFn, class ..._Args> | |
| 486 | using _SelectApplyImpl _LIBCPP_NODEBUG_TYPE = _SecondFn<_Args...>; | |
| 487 | template <class _Result, class ...> | |
| 488 | using _OrImpl _LIBCPP_NODEBUG_TYPE = _Result; | |
| 489 | template <class _Result, class ...> | |
| 490 | using _AndImpl _LIBCPP_NODEBUG_TYPE = _Result; | |
| 491 | }; | |
| 492 | template <bool _Cond, class _Ret = void> | |
| 493 | using _EnableIf _LIBCPP_NODEBUG_TYPE = typename _MetaBase<_Cond>::template _EnableIfImpl<_Ret>; | |
| 494 | template <bool _Cond, class _IfRes, class _ElseRes> | |
| 495 | using _If _LIBCPP_NODEBUG_TYPE = typename _MetaBase<_Cond>::template _SelectImpl<_IfRes, _ElseRes>; | |
| 496 | template <class ..._Rest> | |
| 497 | using _Or _LIBCPP_NODEBUG_TYPE = typename _MetaBase< sizeof...(_Rest) != 0 >::template _OrImpl<false_type, _Rest...>; | |
| 498 | template <class ..._Rest> | |
| 499 | using _And _LIBCPP_NODEBUG_TYPE = typename _MetaBase< sizeof...(_Rest) != 0 >::template _AndImpl<true_type, _Rest...>; | |
| 500 | template <class _Pred> | |
| 501 | struct _Not : _BoolConstant<!_Pred::value> {}; | |
| 502 | template <class ..._Args> | |
| 503 | using _FirstType _LIBCPP_NODEBUG_TYPE = typename _MetaBase<(sizeof...(_Args) >= 1)>::template _FirstImpl<_Args...>; | |
| 504 | template <class ..._Args> | |
| 505 | using _SecondType _LIBCPP_NODEBUG_TYPE = typename _MetaBase<(sizeof...(_Args) >= 2)>::template _SecondImpl<_Args...>; | |
| 506 | ||
| 507 | template <template <class...> class _Func, class ..._Args> | |
| 508 | struct _Lazy : _Func<_Args...> {}; | |
| 509 | ||
| 510 | // Member detector base | |
| 511 | ||
| 512 | template <template <class...> class _Templ, class ..._Args> | |
| 513 | true_type __sfinae_test_impl(_FirstType<int, _Templ<_Args...> >); | |
| 514 | template <template <class...> class, class ...> | |
| 515 | false_type __sfinae_test_impl(...); | |
| 516 | ||
| 517 | template <template <class ...> class _Templ, class ..._Args> | |
| 518 | using _IsValidExpansion _LIBCPP_NODEBUG_TYPE = decltype(std::__sfinae_test_impl<_Templ, _Args...>(0)); | |
| 519 | ||
| 419 | 520 | template <class> |
| 420 | 521 | struct __void_t { typedef void type; }; |
| 421 | 522 | |
| ... | ... | @@ -434,9 +535,6 @@ template <class _If, class _Then> |
| 434 | 535 | template <bool _Bp, class _If, class _Then> using conditional_t = typename conditional<_Bp, _If, _Then>::type; |
| 435 | 536 | #endif |
| 436 | 537 | |
| 437 | template <bool, class _Tp> struct _LIBCPP_TEMPLATE_VIS __lazy_enable_if {}; | |
| 438 | template <class _Tp> struct _LIBCPP_TEMPLATE_VIS __lazy_enable_if<true, _Tp> {typedef typename _Tp::type type;}; | |
| 439 | ||
| 440 | 538 | template <bool, class _Tp = void> struct _LIBCPP_TEMPLATE_VIS enable_if {}; |
| 441 | 539 | template <class _Tp> struct _LIBCPP_TEMPLATE_VIS enable_if<true, _Tp> {typedef _Tp type;}; |
| 442 | 540 | |
| ... | ... | @@ -444,6 +542,34 @@ template <class _Tp> struct _LIBCPP_TEMPLATE_VIS enable_if<true, _Tp> {typedef _ |
| 444 | 542 | template <bool _Bp, class _Tp = void> using enable_if_t = typename enable_if<_Bp, _Tp>::type; |
| 445 | 543 | #endif |
| 446 | 544 | |
| 545 | // is_same | |
| 546 | ||
| 547 | template <class _Tp, class _Up> struct _LIBCPP_TEMPLATE_VIS is_same : public false_type {}; | |
| 548 | template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_same<_Tp, _Tp> : public true_type {}; | |
| 549 | ||
| 550 | #if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) | |
| 551 | template <class _Tp, class _Up> | |
| 552 | _LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_same_v | |
| 553 | = is_same<_Tp, _Up>::value; | |
| 554 | #endif | |
| 555 | ||
| 556 | template <class _Tp, class _Up> | |
| 557 | using _IsSame = _BoolConstant< | |
| 558 | #ifdef __clang__ | |
| 559 | __is_same(_Tp, _Up) | |
| 560 | #else | |
| 561 | _VSTD::is_same<_Tp, _Up>::value | |
| 562 | #endif | |
| 563 | >; | |
| 564 | ||
| 565 | template <class _Tp, class _Up> | |
| 566 | using _IsNotSame = _BoolConstant< | |
| 567 | #ifdef __clang__ | |
| 568 | !__is_same(_Tp, _Up) | |
| 569 | #else | |
| 570 | !_VSTD::is_same<_Tp, _Up>::value | |
| 571 | #endif | |
| 572 | >; | |
| 447 | 573 | // addressof |
| 448 | 574 | #ifndef _LIBCPP_HAS_NO_BUILTIN_ADDRESSOF |
| 449 | 575 | |
| ... | ... | @@ -517,111 +643,6 @@ struct __two {char __lx[2];}; |
| 517 | 643 | |
| 518 | 644 | // helper class: |
| 519 | 645 | |
| 520 | template <class _Tp, _Tp __v> | |
| 521 | struct _LIBCPP_TEMPLATE_VIS integral_constant | |
| 522 | { | |
| 523 | static _LIBCPP_CONSTEXPR const _Tp value = __v; | |
| 524 | typedef _Tp value_type; | |
| 525 | typedef integral_constant type; | |
| 526 | _LIBCPP_INLINE_VISIBILITY | |
| 527 | _LIBCPP_CONSTEXPR operator value_type() const _NOEXCEPT {return value;} | |
| 528 | #if _LIBCPP_STD_VER > 11 | |
| 529 | _LIBCPP_INLINE_VISIBILITY | |
| 530 | constexpr value_type operator ()() const _NOEXCEPT {return value;} | |
| 531 | #endif | |
| 532 | }; | |
| 533 | ||
| 534 | template <class _Tp, _Tp __v> | |
| 535 | _LIBCPP_CONSTEXPR const _Tp integral_constant<_Tp, __v>::value; | |
| 536 | ||
| 537 | #if _LIBCPP_STD_VER > 14 | |
| 538 | template <bool __b> | |
| 539 | using bool_constant = integral_constant<bool, __b>; | |
| 540 | #define _LIBCPP_BOOL_CONSTANT(__b) bool_constant<(__b)> | |
| 541 | #else | |
| 542 | #define _LIBCPP_BOOL_CONSTANT(__b) integral_constant<bool,(__b)> | |
| 543 | #endif | |
| 544 | ||
| 545 | typedef _LIBCPP_BOOL_CONSTANT(true) true_type; | |
| 546 | typedef _LIBCPP_BOOL_CONSTANT(false) false_type; | |
| 547 | ||
| 548 | #if !defined(_LIBCPP_CXX03_LANG) | |
| 549 | ||
| 550 | // __lazy_and | |
| 551 | ||
| 552 | template <bool _Last, class ..._Preds> | |
| 553 | struct __lazy_and_impl; | |
| 554 | ||
| 555 | template <class ..._Preds> | |
| 556 | struct __lazy_and_impl<false, _Preds...> : false_type {}; | |
| 557 | ||
| 558 | template <> | |
| 559 | struct __lazy_and_impl<true> : true_type {}; | |
| 560 | ||
| 561 | template <class _Pred> | |
| 562 | struct __lazy_and_impl<true, _Pred> : integral_constant<bool, _Pred::type::value> {}; | |
| 563 | ||
| 564 | template <class _Hp, class ..._Tp> | |
| 565 | struct __lazy_and_impl<true, _Hp, _Tp...> : __lazy_and_impl<_Hp::type::value, _Tp...> {}; | |
| 566 | ||
| 567 | template <class _P1, class ..._Pr> | |
| 568 | struct __lazy_and : __lazy_and_impl<_P1::type::value, _Pr...> {}; | |
| 569 | ||
| 570 | // __lazy_or | |
| 571 | ||
| 572 | template <bool _List, class ..._Preds> | |
| 573 | struct __lazy_or_impl; | |
| 574 | ||
| 575 | template <class ..._Preds> | |
| 576 | struct __lazy_or_impl<true, _Preds...> : true_type {}; | |
| 577 | ||
| 578 | template <> | |
| 579 | struct __lazy_or_impl<false> : false_type {}; | |
| 580 | ||
| 581 | template <class _Hp, class ..._Tp> | |
| 582 | struct __lazy_or_impl<false, _Hp, _Tp...> | |
| 583 | : __lazy_or_impl<_Hp::type::value, _Tp...> {}; | |
| 584 | ||
| 585 | template <class _P1, class ..._Pr> | |
| 586 | struct __lazy_or : __lazy_or_impl<_P1::type::value, _Pr...> {}; | |
| 587 | ||
| 588 | // __lazy_not | |
| 589 | ||
| 590 | template <class _Pred> | |
| 591 | struct __lazy_not : integral_constant<bool, !_Pred::type::value> {}; | |
| 592 | ||
| 593 | // __and_ | |
| 594 | template<class...> struct __and_; | |
| 595 | template<> struct __and_<> : true_type {}; | |
| 596 | ||
| 597 | template<class _B0> struct __and_<_B0> : _B0 {}; | |
| 598 | ||
| 599 | template<class _B0, class _B1> | |
| 600 | struct __and_<_B0, _B1> : conditional<_B0::value, _B1, _B0>::type {}; | |
| 601 | ||
| 602 | template<class _B0, class _B1, class _B2, class... _Bn> | |
| 603 | struct __and_<_B0, _B1, _B2, _Bn...> | |
| 604 | : conditional<_B0::value, __and_<_B1, _B2, _Bn...>, _B0>::type {}; | |
| 605 | ||
| 606 | // __or_ | |
| 607 | template<class...> struct __or_; | |
| 608 | template<> struct __or_<> : false_type {}; | |
| 609 | ||
| 610 | template<class _B0> struct __or_<_B0> : _B0 {}; | |
| 611 | ||
| 612 | template<class _B0, class _B1> | |
| 613 | struct __or_<_B0, _B1> : conditional<_B0::value, _B0, _B1>::type {}; | |
| 614 | ||
| 615 | template<class _B0, class _B1, class _B2, class... _Bn> | |
| 616 | struct __or_<_B0, _B1, _B2, _Bn...> | |
| 617 | : conditional<_B0::value, _B0, __or_<_B1, _B2, _Bn...> >::type {}; | |
| 618 | ||
| 619 | // __not_ | |
| 620 | template<class _Tp> | |
| 621 | struct __not_ : conditional<_Tp::value, false_type, true_type>::type {}; | |
| 622 | ||
| 623 | #endif // !defined(_LIBCPP_CXX03_LANG) | |
| 624 | ||
| 625 | 646 | // is_const |
| 626 | 647 | |
| 627 | 648 | template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_const : public false_type {}; |
| ... | ... | @@ -774,8 +795,16 @@ _LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_array_v |
| 774 | 795 | template <class _Tp> struct __libcpp_is_pointer : public false_type {}; |
| 775 | 796 | template <class _Tp> struct __libcpp_is_pointer<_Tp*> : public true_type {}; |
| 776 | 797 | |
| 798 | template <class _Tp> struct __libcpp_remove_objc_qualifiers { typedef _Tp type; }; | |
| 799 | #if defined(_LIBCPP_HAS_OBJC_ARC) | |
| 800 | template <class _Tp> struct __libcpp_remove_objc_qualifiers<_Tp __strong> { typedef _Tp type; }; | |
| 801 | template <class _Tp> struct __libcpp_remove_objc_qualifiers<_Tp __weak> { typedef _Tp type; }; | |
| 802 | template <class _Tp> struct __libcpp_remove_objc_qualifiers<_Tp __autoreleasing> { typedef _Tp type; }; | |
| 803 | template <class _Tp> struct __libcpp_remove_objc_qualifiers<_Tp __unsafe_unretained> { typedef _Tp type; }; | |
| 804 | #endif | |
| 805 | ||
| 777 | 806 | template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_pointer |
| 778 | : public __libcpp_is_pointer<typename remove_cv<_Tp>::type> {}; | |
| 807 | : public __libcpp_is_pointer<typename __libcpp_remove_objc_qualifiers<typename remove_cv<_Tp>::type>::type> {}; | |
| 779 | 808 | |
| 780 | 809 | #if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) |
| 781 | 810 | template <class _Tp> |
| ... | ... | @@ -789,15 +818,11 @@ template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_lvalue_reference : pub |
| 789 | 818 | template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_lvalue_reference<_Tp&> : public true_type {}; |
| 790 | 819 | |
| 791 | 820 | template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_rvalue_reference : public false_type {}; |
| 792 | #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES | |
| 793 | 821 | template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_rvalue_reference<_Tp&&> : public true_type {}; |
| 794 | #endif | |
| 795 | 822 | |
| 796 | 823 | template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_reference : public false_type {}; |
| 797 | 824 | template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_reference<_Tp&> : public true_type {}; |
| 798 | #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES | |
| 799 | 825 | template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_reference<_Tp&&> : public true_type {}; |
| 800 | #endif | |
| 801 | 826 | |
| 802 | 827 | #if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) |
| 803 | 828 | template <class _Tp> |
| ... | ... | @@ -814,7 +839,7 @@ _LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_rvalue_reference_v |
| 814 | 839 | #endif |
| 815 | 840 | // is_union |
| 816 | 841 | |
| 817 | #if __has_feature(is_union) || (_GNUC_VER >= 403) | |
| 842 | #if __has_feature(is_union) || defined(_LIBCPP_COMPILER_GCC) | |
| 818 | 843 | |
| 819 | 844 | template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_union |
| 820 | 845 | : public integral_constant<bool, __is_union(_Tp)> {}; |
| ... | ... | @@ -835,7 +860,7 @@ _LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_union_v |
| 835 | 860 | |
| 836 | 861 | // is_class |
| 837 | 862 | |
| 838 | #if __has_feature(is_class) || (_GNUC_VER >= 403) | |
| 863 | #if __has_feature(is_class) || defined(_LIBCPP_COMPILER_GCC) | |
| 839 | 864 | |
| 840 | 865 | template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_class |
| 841 | 866 | : public integral_constant<bool, __is_class(_Tp)> {}; |
| ... | ... | @@ -859,17 +884,6 @@ _LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_class_v |
| 859 | 884 | = is_class<_Tp>::value; |
| 860 | 885 | #endif |
| 861 | 886 | |
| 862 | // is_same | |
| 863 | ||
| 864 | template <class _Tp, class _Up> struct _LIBCPP_TEMPLATE_VIS is_same : public false_type {}; | |
| 865 | template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_same<_Tp, _Tp> : public true_type {}; | |
| 866 | ||
| 867 | #if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) | |
| 868 | template <class _Tp, class _Up> | |
| 869 | _LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_same_v | |
| 870 | = is_same<_Tp, _Up>::value; | |
| 871 | #endif | |
| 872 | ||
| 873 | 887 | // is_function |
| 874 | 888 | |
| 875 | 889 | namespace __libcpp_is_function_imp |
| ... | ... | @@ -957,7 +971,7 @@ _LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_member_object_pointer_v |
| 957 | 971 | |
| 958 | 972 | // is_enum |
| 959 | 973 | |
| 960 | #if __has_feature(is_enum) || (_GNUC_VER >= 403) | |
| 974 | #if __has_feature(is_enum) || defined(_LIBCPP_COMPILER_GCC) | |
| 961 | 975 | |
| 962 | 976 | template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_enum |
| 963 | 977 | : public integral_constant<bool, __is_enum(_Tp)> {}; |
| ... | ... | @@ -1061,7 +1075,7 @@ struct __is_referenceable_impl { |
| 1061 | 1075 | |
| 1062 | 1076 | template <class _Tp> |
| 1063 | 1077 | struct __is_referenceable : integral_constant<bool, |
| 1064 | !is_same<decltype(__is_referenceable_impl::__test<_Tp>(0)), __two>::value> {}; | |
| 1078 | _IsNotSame<decltype(__is_referenceable_impl::__test<_Tp>(0)), __two>::value> {}; | |
| 1065 | 1079 | |
| 1066 | 1080 | |
| 1067 | 1081 | // add_const |
| ... | ... | @@ -1069,13 +1083,13 @@ struct __is_referenceable : integral_constant<bool, |
| 1069 | 1083 | template <class _Tp, bool = is_reference<_Tp>::value || |
| 1070 | 1084 | is_function<_Tp>::value || |
| 1071 | 1085 | is_const<_Tp>::value > |
| 1072 | struct __add_const {typedef _Tp type;}; | |
| 1086 | struct __add_const {typedef _LIBCPP_NODEBUG_TYPE _Tp type;}; | |
| 1073 | 1087 | |
| 1074 | 1088 | template <class _Tp> |
| 1075 | struct __add_const<_Tp, false> {typedef const _Tp type;}; | |
| 1089 | struct __add_const<_Tp, false> {typedef _LIBCPP_NODEBUG_TYPE const _Tp type;}; | |
| 1076 | 1090 | |
| 1077 | 1091 | template <class _Tp> struct _LIBCPP_TEMPLATE_VIS add_const |
| 1078 | {typedef typename __add_const<_Tp>::type type;}; | |
| 1092 | {typedef _LIBCPP_NODEBUG_TYPE typename __add_const<_Tp>::type type;}; | |
| 1079 | 1093 | |
| 1080 | 1094 | #if _LIBCPP_STD_VER > 11 |
| 1081 | 1095 | template <class _Tp> using add_const_t = typename add_const<_Tp>::type; |
| ... | ... | @@ -1092,7 +1106,7 @@ template <class _Tp> |
| 1092 | 1106 | struct __add_volatile<_Tp, false> {typedef volatile _Tp type;}; |
| 1093 | 1107 | |
| 1094 | 1108 | template <class _Tp> struct _LIBCPP_TEMPLATE_VIS add_volatile |
| 1095 | {typedef typename __add_volatile<_Tp>::type type;}; | |
| 1109 | {typedef _LIBCPP_NODEBUG_TYPE typename __add_volatile<_Tp>::type type;}; | |
| 1096 | 1110 | |
| 1097 | 1111 | #if _LIBCPP_STD_VER > 11 |
| 1098 | 1112 | template <class _Tp> using add_volatile_t = typename add_volatile<_Tp>::type; |
| ... | ... | @@ -1101,7 +1115,7 @@ template <class _Tp> using add_volatile_t = typename add_volatile<_Tp>::type; |
| 1101 | 1115 | // add_cv |
| 1102 | 1116 | |
| 1103 | 1117 | template <class _Tp> struct _LIBCPP_TEMPLATE_VIS add_cv |
| 1104 | {typedef typename add_const<typename add_volatile<_Tp>::type>::type type;}; | |
| 1118 | {typedef _LIBCPP_NODEBUG_TYPE typename add_const<typename add_volatile<_Tp>::type>::type type;}; | |
| 1105 | 1119 | |
| 1106 | 1120 | #if _LIBCPP_STD_VER > 11 |
| 1107 | 1121 | template <class _Tp> using add_cv_t = typename add_cv<_Tp>::type; |
| ... | ... | @@ -1109,11 +1123,9 @@ template <class _Tp> using add_cv_t = typename add_cv<_Tp>::type; |
| 1109 | 1123 | |
| 1110 | 1124 | // remove_reference |
| 1111 | 1125 | |
| 1112 | template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_reference {typedef _Tp type;}; | |
| 1113 | template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_reference<_Tp&> {typedef _Tp type;}; | |
| 1114 | #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES | |
| 1115 | template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_reference<_Tp&&> {typedef _Tp type;}; | |
| 1116 | #endif | |
| 1126 | template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_reference {typedef _LIBCPP_NODEBUG_TYPE _Tp type;}; | |
| 1127 | template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_reference<_Tp&> {typedef _LIBCPP_NODEBUG_TYPE _Tp type;}; | |
| 1128 | template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_reference<_Tp&&> {typedef _LIBCPP_NODEBUG_TYPE _Tp type;}; | |
| 1117 | 1129 | |
| 1118 | 1130 | #if _LIBCPP_STD_VER > 11 |
| 1119 | 1131 | template <class _Tp> using remove_reference_t = typename remove_reference<_Tp>::type; |
| ... | ... | @@ -1121,32 +1133,26 @@ template <class _Tp> using remove_reference_t = typename remove_reference<_Tp>:: |
| 1121 | 1133 | |
| 1122 | 1134 | // add_lvalue_reference |
| 1123 | 1135 | |
| 1124 | template <class _Tp, bool = __is_referenceable<_Tp>::value> struct __add_lvalue_reference_impl { typedef _Tp type; }; | |
| 1125 | template <class _Tp > struct __add_lvalue_reference_impl<_Tp, true> { typedef _Tp& type; }; | |
| 1136 | template <class _Tp, bool = __is_referenceable<_Tp>::value> struct __add_lvalue_reference_impl { typedef _LIBCPP_NODEBUG_TYPE _Tp type; }; | |
| 1137 | template <class _Tp > struct __add_lvalue_reference_impl<_Tp, true> { typedef _LIBCPP_NODEBUG_TYPE _Tp& type; }; | |
| 1126 | 1138 | |
| 1127 | 1139 | template <class _Tp> struct _LIBCPP_TEMPLATE_VIS add_lvalue_reference |
| 1128 | {typedef typename __add_lvalue_reference_impl<_Tp>::type type;}; | |
| 1140 | {typedef _LIBCPP_NODEBUG_TYPE typename __add_lvalue_reference_impl<_Tp>::type type;}; | |
| 1129 | 1141 | |
| 1130 | 1142 | #if _LIBCPP_STD_VER > 11 |
| 1131 | 1143 | template <class _Tp> using add_lvalue_reference_t = typename add_lvalue_reference<_Tp>::type; |
| 1132 | 1144 | #endif |
| 1133 | 1145 | |
| 1134 | #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES | |
| 1135 | ||
| 1136 | template <class _Tp, bool = __is_referenceable<_Tp>::value> struct __add_rvalue_reference_impl { typedef _Tp type; }; | |
| 1137 | template <class _Tp > struct __add_rvalue_reference_impl<_Tp, true> { typedef _Tp&& type; }; | |
| 1146 | template <class _Tp, bool = __is_referenceable<_Tp>::value> struct __add_rvalue_reference_impl { typedef _LIBCPP_NODEBUG_TYPE _Tp type; }; | |
| 1147 | template <class _Tp > struct __add_rvalue_reference_impl<_Tp, true> { typedef _LIBCPP_NODEBUG_TYPE _Tp&& type; }; | |
| 1138 | 1148 | |
| 1139 | 1149 | template <class _Tp> struct _LIBCPP_TEMPLATE_VIS add_rvalue_reference |
| 1140 | {typedef typename __add_rvalue_reference_impl<_Tp>::type type;}; | |
| 1150 | {typedef _LIBCPP_NODEBUG_TYPE typename __add_rvalue_reference_impl<_Tp>::type type;}; | |
| 1141 | 1151 | |
| 1142 | 1152 | #if _LIBCPP_STD_VER > 11 |
| 1143 | 1153 | template <class _Tp> using add_rvalue_reference_t = typename add_rvalue_reference<_Tp>::type; |
| 1144 | 1154 | #endif |
| 1145 | 1155 | |
| 1146 | #endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES | |
| 1147 | ||
| 1148 | #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES | |
| 1149 | ||
| 1150 | 1156 | template <class _Tp> _Tp&& __declval(int); |
| 1151 | 1157 | template <class _Tp> _Tp __declval(long); |
| 1152 | 1158 | |
| ... | ... | @@ -1154,35 +1160,27 @@ template <class _Tp> |
| 1154 | 1160 | decltype(_VSTD::__declval<_Tp>(0)) |
| 1155 | 1161 | declval() _NOEXCEPT; |
| 1156 | 1162 | |
| 1157 | #else // _LIBCPP_HAS_NO_RVALUE_REFERENCES | |
| 1158 | ||
| 1159 | template <class _Tp> | |
| 1160 | typename add_lvalue_reference<_Tp>::type | |
| 1161 | declval(); | |
| 1162 | ||
| 1163 | #endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES | |
| 1164 | ||
| 1165 | 1163 | // __uncvref |
| 1166 | 1164 | |
| 1167 | 1165 | template <class _Tp> |
| 1168 | 1166 | struct __uncvref { |
| 1169 | typedef typename remove_cv<typename remove_reference<_Tp>::type>::type type; | |
| 1167 | typedef _LIBCPP_NODEBUG_TYPE typename remove_cv<typename remove_reference<_Tp>::type>::type type; | |
| 1170 | 1168 | }; |
| 1171 | 1169 | |
| 1172 | 1170 | template <class _Tp> |
| 1173 | 1171 | struct __unconstref { |
| 1174 | typedef typename remove_const<typename remove_reference<_Tp>::type>::type type; | |
| 1172 | typedef _LIBCPP_NODEBUG_TYPE typename remove_const<typename remove_reference<_Tp>::type>::type type; | |
| 1175 | 1173 | }; |
| 1176 | 1174 | |
| 1177 | 1175 | #ifndef _LIBCPP_CXX03_LANG |
| 1178 | 1176 | template <class _Tp> |
| 1179 | using __uncvref_t = typename __uncvref<_Tp>::type; | |
| 1177 | using __uncvref_t _LIBCPP_NODEBUG_TYPE = typename __uncvref<_Tp>::type; | |
| 1180 | 1178 | #endif |
| 1181 | 1179 | |
| 1182 | 1180 | // __is_same_uncvref |
| 1183 | 1181 | |
| 1184 | 1182 | template <class _Tp, class _Up> |
| 1185 | struct __is_same_uncvref : is_same<typename __uncvref<_Tp>::type, | |
| 1183 | struct __is_same_uncvref : _IsSame<typename __uncvref<_Tp>::type, | |
| 1186 | 1184 | typename __uncvref<_Up>::type> {}; |
| 1187 | 1185 | |
| 1188 | 1186 | #if _LIBCPP_STD_VER > 17 |
| ... | ... | @@ -1201,11 +1199,11 @@ struct __any |
| 1201 | 1199 | |
| 1202 | 1200 | // remove_pointer |
| 1203 | 1201 | |
| 1204 | template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_pointer {typedef _Tp type;}; | |
| 1205 | template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_pointer<_Tp*> {typedef _Tp type;}; | |
| 1206 | template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_pointer<_Tp* const> {typedef _Tp type;}; | |
| 1207 | template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_pointer<_Tp* volatile> {typedef _Tp type;}; | |
| 1208 | template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_pointer<_Tp* const volatile> {typedef _Tp type;}; | |
| 1202 | template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_pointer {typedef _LIBCPP_NODEBUG_TYPE _Tp type;}; | |
| 1203 | template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_pointer<_Tp*> {typedef _LIBCPP_NODEBUG_TYPE _Tp type;}; | |
| 1204 | template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_pointer<_Tp* const> {typedef _LIBCPP_NODEBUG_TYPE _Tp type;}; | |
| 1205 | template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_pointer<_Tp* volatile> {typedef _LIBCPP_NODEBUG_TYPE _Tp type;}; | |
| 1206 | template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_pointer<_Tp* const volatile> {typedef _LIBCPP_NODEBUG_TYPE _Tp type;}; | |
| 1209 | 1207 | |
| 1210 | 1208 | #if _LIBCPP_STD_VER > 11 |
| 1211 | 1209 | template <class _Tp> using remove_pointer_t = typename remove_pointer<_Tp>::type; |
| ... | ... | @@ -1215,14 +1213,14 @@ template <class _Tp> using remove_pointer_t = typename remove_pointer<_Tp>::type |
| 1215 | 1213 | |
| 1216 | 1214 | template <class _Tp, |
| 1217 | 1215 | bool = __is_referenceable<_Tp>::value || |
| 1218 | is_same<typename remove_cv<_Tp>::type, void>::value> | |
| 1216 | _IsSame<typename remove_cv<_Tp>::type, void>::value> | |
| 1219 | 1217 | struct __add_pointer_impl |
| 1220 | {typedef typename remove_reference<_Tp>::type* type;}; | |
| 1218 | {typedef _LIBCPP_NODEBUG_TYPE typename remove_reference<_Tp>::type* type;}; | |
| 1221 | 1219 | template <class _Tp> struct __add_pointer_impl<_Tp, false> |
| 1222 | {typedef _Tp type;}; | |
| 1220 | {typedef _LIBCPP_NODEBUG_TYPE _Tp type;}; | |
| 1223 | 1221 | |
| 1224 | 1222 | template <class _Tp> struct _LIBCPP_TEMPLATE_VIS add_pointer |
| 1225 | {typedef typename __add_pointer_impl<_Tp>::type type;}; | |
| 1223 | {typedef _LIBCPP_NODEBUG_TYPE typename __add_pointer_impl<_Tp>::type type;}; | |
| 1226 | 1224 | |
| 1227 | 1225 | #if _LIBCPP_STD_VER > 11 |
| 1228 | 1226 | template <class _Tp> using add_pointer_t = typename add_pointer<_Tp>::type; |
| ... | ... | @@ -1336,17 +1334,37 @@ template <class _Tp, size_t _Np> struct _LIBCPP_TEMPLATE_VIS remove_all_extents< |
| 1336 | 1334 | template <class _Tp> using remove_all_extents_t = typename remove_all_extents<_Tp>::type; |
| 1337 | 1335 | #endif |
| 1338 | 1336 | |
| 1337 | #if _LIBCPP_STD_VER > 17 | |
| 1338 | // is_bounded_array | |
| 1339 | ||
| 1340 | template <class> struct _LIBCPP_TEMPLATE_VIS is_bounded_array : false_type {}; | |
| 1341 | template <class _Tp, size_t _Np> struct _LIBCPP_TEMPLATE_VIS is_bounded_array<_Tp[_Np]> : true_type {}; | |
| 1342 | ||
| 1343 | template <class _Tp> | |
| 1344 | _LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR | |
| 1345 | bool is_bounded_array_v = is_bounded_array<_Tp>::value; | |
| 1346 | ||
| 1347 | // is_unbounded_array | |
| 1348 | ||
| 1349 | template <class> struct _LIBCPP_TEMPLATE_VIS is_unbounded_array : false_type {}; | |
| 1350 | template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_unbounded_array<_Tp[]> : true_type {}; | |
| 1351 | ||
| 1352 | template <class _Tp> | |
| 1353 | _LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR | |
| 1354 | bool is_unbounded_array_v = is_unbounded_array<_Tp>::value; | |
| 1355 | #endif | |
| 1356 | ||
| 1339 | 1357 | // decay |
| 1340 | 1358 | |
| 1341 | 1359 | template <class _Up, bool> |
| 1342 | 1360 | struct __decay { |
| 1343 | typedef typename remove_cv<_Up>::type type; | |
| 1361 | typedef _LIBCPP_NODEBUG_TYPE typename remove_cv<_Up>::type type; | |
| 1344 | 1362 | }; |
| 1345 | 1363 | |
| 1346 | 1364 | template <class _Up> |
| 1347 | 1365 | struct __decay<_Up, true> { |
| 1348 | 1366 | public: |
| 1349 | typedef typename conditional | |
| 1367 | typedef _LIBCPP_NODEBUG_TYPE typename conditional | |
| 1350 | 1368 | < |
| 1351 | 1369 | is_array<_Up>::value, |
| 1352 | 1370 | typename remove_extent<_Up>::type*, |
| ... | ... | @@ -1363,9 +1381,9 @@ template <class _Tp> |
| 1363 | 1381 | struct _LIBCPP_TEMPLATE_VIS decay |
| 1364 | 1382 | { |
| 1365 | 1383 | private: |
| 1366 | typedef typename remove_reference<_Tp>::type _Up; | |
| 1384 | typedef _LIBCPP_NODEBUG_TYPE typename remove_reference<_Tp>::type _Up; | |
| 1367 | 1385 | public: |
| 1368 | typedef typename __decay<_Up, __is_referenceable<_Up>::value>::type type; | |
| 1386 | typedef _LIBCPP_NODEBUG_TYPE typename __decay<_Up, __is_referenceable<_Up>::value>::type type; | |
| 1369 | 1387 | }; |
| 1370 | 1388 | |
| 1371 | 1389 | #if _LIBCPP_STD_VER > 11 |
| ... | ... | @@ -1385,15 +1403,10 @@ _LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_abstract_v |
| 1385 | 1403 | |
| 1386 | 1404 | // is_final |
| 1387 | 1405 | |
| 1388 | #if defined(_LIBCPP_HAS_IS_FINAL) | |
| 1389 | 1406 | template <class _Tp> struct _LIBCPP_TEMPLATE_VIS |
| 1390 | 1407 | __libcpp_is_final : public integral_constant<bool, __is_final(_Tp)> {}; |
| 1391 | #else | |
| 1392 | template <class _Tp> struct _LIBCPP_TEMPLATE_VIS | |
| 1393 | __libcpp_is_final : public false_type {}; | |
| 1394 | #endif | |
| 1395 | 1408 | |
| 1396 | #if defined(_LIBCPP_HAS_IS_FINAL) && _LIBCPP_STD_VER > 11 | |
| 1409 | #if _LIBCPP_STD_VER > 11 | |
| 1397 | 1410 | template <class _Tp> struct _LIBCPP_TEMPLATE_VIS |
| 1398 | 1411 | is_final : public integral_constant<bool, __is_final(_Tp)> {}; |
| 1399 | 1412 | #endif |
| ... | ... | @@ -1420,39 +1433,10 @@ _LIBCPP_INLINE_VAR constexpr bool is_aggregate_v |
| 1420 | 1433 | |
| 1421 | 1434 | // is_base_of |
| 1422 | 1435 | |
| 1423 | #ifdef _LIBCPP_HAS_IS_BASE_OF | |
| 1424 | ||
| 1425 | 1436 | template <class _Bp, class _Dp> |
| 1426 | 1437 | struct _LIBCPP_TEMPLATE_VIS is_base_of |
| 1427 | 1438 | : public integral_constant<bool, __is_base_of(_Bp, _Dp)> {}; |
| 1428 | 1439 | |
| 1429 | #else // _LIBCPP_HAS_IS_BASE_OF | |
| 1430 | ||
| 1431 | namespace __is_base_of_imp | |
| 1432 | { | |
| 1433 | template <class _Tp> | |
| 1434 | struct _Dst | |
| 1435 | { | |
| 1436 | _Dst(const volatile _Tp &); | |
| 1437 | }; | |
| 1438 | template <class _Tp> | |
| 1439 | struct _Src | |
| 1440 | { | |
| 1441 | operator const volatile _Tp &(); | |
| 1442 | template <class _Up> operator const _Dst<_Up> &(); | |
| 1443 | }; | |
| 1444 | template <size_t> struct __one { typedef char type; }; | |
| 1445 | template <class _Bp, class _Dp> typename __one<sizeof(_Dst<_Bp>(declval<_Src<_Dp> >()))>::type __test(int); | |
| 1446 | template <class _Bp, class _Dp> __two __test(...); | |
| 1447 | } | |
| 1448 | ||
| 1449 | template <class _Bp, class _Dp> | |
| 1450 | struct _LIBCPP_TEMPLATE_VIS is_base_of | |
| 1451 | : public integral_constant<bool, is_class<_Bp>::value && | |
| 1452 | sizeof(__is_base_of_imp::__test<_Bp, _Dp>(0)) == 2> {}; | |
| 1453 | ||
| 1454 | #endif // _LIBCPP_HAS_IS_BASE_OF | |
| 1455 | ||
| 1456 | 1440 | #if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) |
| 1457 | 1441 | template <class _Bp, class _Dp> |
| 1458 | 1442 | _LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_base_of_v |
| ... | ... | @@ -1509,14 +1493,6 @@ template <class _T1, class _T2, |
| 1509 | 1493 | struct __is_convertible |
| 1510 | 1494 | : public integral_constant<bool, |
| 1511 | 1495 | __is_convertible_imp::__is_convertible_test<_T1, _T2>::value |
| 1512 | #if defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) | |
| 1513 | && !(!is_function<_T1>::value && !is_reference<_T1>::value && is_reference<_T2>::value | |
| 1514 | && (!is_const<typename remove_reference<_T2>::type>::value | |
| 1515 | || is_volatile<typename remove_reference<_T2>::type>::value) | |
| 1516 | && (is_same<typename remove_cv<_T1>::type, | |
| 1517 | typename remove_cv<typename remove_reference<_T2>::type>::type>::value | |
| 1518 | || is_base_of<typename remove_reference<_T2>::type, _T1>::value)) | |
| 1519 | #endif | |
| 1520 | 1496 | > |
| 1521 | 1497 | {}; |
| 1522 | 1498 | |
| ... | ... | @@ -1550,9 +1526,35 @@ _LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_convertible_v |
| 1550 | 1526 | = is_convertible<_From, _To>::value; |
| 1551 | 1527 | #endif |
| 1552 | 1528 | |
| 1529 | // is_nothrow_convertible | |
| 1530 | ||
| 1531 | #if _LIBCPP_STD_VER > 17 | |
| 1532 | ||
| 1533 | template <typename _Tp> | |
| 1534 | static void __test_noexcept(_Tp) noexcept; | |
| 1535 | ||
| 1536 | template<typename _Fm, typename _To> | |
| 1537 | static bool_constant<noexcept(__test_noexcept<_To>(declval<_Fm>()))> | |
| 1538 | __is_nothrow_convertible_test(); | |
| 1539 | ||
| 1540 | template <typename _Fm, typename _To> | |
| 1541 | struct __is_nothrow_convertible_helper: decltype(__is_nothrow_convertible_test<_Fm, _To>()) | |
| 1542 | { }; | |
| 1543 | ||
| 1544 | template <typename _Fm, typename _To> | |
| 1545 | struct is_nothrow_convertible : _Or< | |
| 1546 | _And<is_void<_To>, is_void<_Fm>>, | |
| 1547 | _Lazy<_And, is_convertible<_Fm, _To>, __is_nothrow_convertible_helper<_Fm, _To>> | |
| 1548 | >::type { }; | |
| 1549 | ||
| 1550 | template <typename _Fm, typename _To> | |
| 1551 | inline constexpr bool is_nothrow_convertible_v = is_nothrow_convertible<_Fm, _To>::value; | |
| 1552 | ||
| 1553 | #endif // _LIBCPP_STD_VER > 17 | |
| 1554 | ||
| 1553 | 1555 | // is_empty |
| 1554 | 1556 | |
| 1555 | #if __has_feature(is_empty) || (_GNUC_VER >= 407) | |
| 1557 | #if __has_feature(is_empty) || defined(_LIBCPP_COMPILER_GCC) | |
| 1556 | 1558 | |
| 1557 | 1559 | template <class _Tp> |
| 1558 | 1560 | struct _LIBCPP_TEMPLATE_VIS is_empty |
| ... | ... | @@ -1615,7 +1617,7 @@ _LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_polymorphic_v |
| 1615 | 1617 | |
| 1616 | 1618 | // has_virtual_destructor |
| 1617 | 1619 | |
| 1618 | #if __has_feature(has_virtual_destructor) || (_GNUC_VER >= 403) | |
| 1620 | #if __has_feature(has_virtual_destructor) || defined(_LIBCPP_COMPILER_GCC) | |
| 1619 | 1621 | |
| 1620 | 1622 | template <class _Tp> struct _LIBCPP_TEMPLATE_VIS has_virtual_destructor |
| 1621 | 1623 | : public integral_constant<bool, __has_virtual_destructor(_Tp)> {}; |
| ... | ... | @@ -1703,6 +1705,9 @@ typedef |
| 1703 | 1705 | __nat |
| 1704 | 1706 | > > > > > > > > > > __all_types; |
| 1705 | 1707 | |
| 1708 | template <size_t _Align> | |
| 1709 | struct _ALIGNAS(_Align) __fallback_overaligned {}; | |
| 1710 | ||
| 1706 | 1711 | template <class _TL, size_t _Align> struct __find_pod; |
| 1707 | 1712 | |
| 1708 | 1713 | template <class _Hp, size_t _Align> |
| ... | ... | @@ -1711,7 +1716,7 @@ struct __find_pod<__type_list<_Hp, __nat>, _Align> |
| 1711 | 1716 | typedef typename conditional< |
| 1712 | 1717 | _Align == _Hp::value, |
| 1713 | 1718 | typename _Hp::type, |
| 1714 | void | |
| 1719 | __fallback_overaligned<_Align> | |
| 1715 | 1720 | >::type type; |
| 1716 | 1721 | }; |
| 1717 | 1722 | |
| ... | ... | @@ -1748,7 +1753,6 @@ template <size_t _Len, size_t _Align = __find_max_align<__all_types, _Len>::valu |
| 1748 | 1753 | struct _LIBCPP_TEMPLATE_VIS aligned_storage |
| 1749 | 1754 | { |
| 1750 | 1755 | typedef typename __find_pod<__all_types, _Align>::type _Aligner; |
| 1751 | static_assert(!is_void<_Aligner>::value, ""); | |
| 1752 | 1756 | union type |
| 1753 | 1757 | { |
| 1754 | 1758 | _Aligner __align; |
| ... | ... | @@ -1792,7 +1796,6 @@ _CREATE_ALIGNED_STORAGE_SPECIALIZATION(0x4000); |
| 1792 | 1796 | |
| 1793 | 1797 | #undef _CREATE_ALIGNED_STORAGE_SPECIALIZATION |
| 1794 | 1798 | |
| 1795 | #ifndef _LIBCPP_HAS_NO_VARIADICS | |
| 1796 | 1799 | |
| 1797 | 1800 | // aligned_union |
| 1798 | 1801 | |
| ... | ... | @@ -1826,8 +1829,6 @@ struct aligned_union |
| 1826 | 1829 | template <size_t _Len, class ..._Types> using aligned_union_t = typename aligned_union<_Len, _Types...>::type; |
| 1827 | 1830 | #endif |
| 1828 | 1831 | |
| 1829 | #endif // _LIBCPP_HAS_NO_VARIADICS | |
| 1830 | ||
| 1831 | 1832 | template <class _Tp> |
| 1832 | 1833 | struct __numeric_type |
| 1833 | 1834 | { |
| ... | ... | @@ -1844,7 +1845,7 @@ struct __numeric_type |
| 1844 | 1845 | static long double __test(long double); |
| 1845 | 1846 | |
| 1846 | 1847 | typedef decltype(__test(declval<_Tp>())) type; |
| 1847 | static const bool value = !is_same<type, void>::value; | |
| 1848 | static const bool value = _IsNotSame<type, void>::value; | |
| 1848 | 1849 | }; |
| 1849 | 1850 | |
| 1850 | 1851 | template <> |
| ... | ... | @@ -1936,26 +1937,26 @@ template <class _TypeList, size_t _Size, bool = _Size <= sizeof(typename _TypeLi |
| 1936 | 1937 | template <class _Hp, class _Tp, size_t _Size> |
| 1937 | 1938 | struct __find_first<__type_list<_Hp, _Tp>, _Size, true> |
| 1938 | 1939 | { |
| 1939 | typedef _Hp type; | |
| 1940 | typedef _LIBCPP_NODEBUG_TYPE _Hp type; | |
| 1940 | 1941 | }; |
| 1941 | 1942 | |
| 1942 | 1943 | template <class _Hp, class _Tp, size_t _Size> |
| 1943 | 1944 | struct __find_first<__type_list<_Hp, _Tp>, _Size, false> |
| 1944 | 1945 | { |
| 1945 | typedef typename __find_first<_Tp, _Size>::type type; | |
| 1946 | typedef _LIBCPP_NODEBUG_TYPE typename __find_first<_Tp, _Size>::type type; | |
| 1946 | 1947 | }; |
| 1947 | 1948 | |
| 1948 | 1949 | template <class _Tp, class _Up, bool = is_const<typename remove_reference<_Tp>::type>::value, |
| 1949 | 1950 | bool = is_volatile<typename remove_reference<_Tp>::type>::value> |
| 1950 | 1951 | struct __apply_cv |
| 1951 | 1952 | { |
| 1952 | typedef _Up type; | |
| 1953 | typedef _LIBCPP_NODEBUG_TYPE _Up type; | |
| 1953 | 1954 | }; |
| 1954 | 1955 | |
| 1955 | 1956 | template <class _Tp, class _Up> |
| 1956 | 1957 | struct __apply_cv<_Tp, _Up, true, false> |
| 1957 | 1958 | { |
| 1958 | typedef const _Up type; | |
| 1959 | typedef _LIBCPP_NODEBUG_TYPE const _Up type; | |
| 1959 | 1960 | }; |
| 1960 | 1961 | |
| 1961 | 1962 | template <class _Tp, class _Up> |
| ... | ... | @@ -2060,43 +2061,63 @@ struct _LIBCPP_TEMPLATE_VIS make_unsigned |
| 2060 | 2061 | template <class _Tp> using make_unsigned_t = typename make_unsigned<_Tp>::type; |
| 2061 | 2062 | #endif |
| 2062 | 2063 | |
| 2063 | #ifdef _LIBCPP_HAS_NO_VARIADICS | |
| 2064 | template <class _Tp, class _Up, class = void> | |
| 2065 | struct __common_type2_imp {}; | |
| 2064 | 2066 | |
| 2065 | template <class _Tp, class _Up = void, class _Vp = void> | |
| 2066 | struct _LIBCPP_TEMPLATE_VIS common_type | |
| 2067 | template <class _Tp, class _Up> | |
| 2068 | struct __common_type2_imp<_Tp, _Up, | |
| 2069 | typename __void_t<decltype( | |
| 2070 | true ? _VSTD::declval<_Tp>() : _VSTD::declval<_Up>() | |
| 2071 | )>::type> | |
| 2067 | 2072 | { |
| 2068 | public: | |
| 2069 | typedef typename common_type<typename common_type<_Tp, _Up>::type, _Vp>::type type; | |
| 2073 | typedef _LIBCPP_NODEBUG_TYPE typename decay<decltype( | |
| 2074 | true ? _VSTD::declval<_Tp>() : _VSTD::declval<_Up>() | |
| 2075 | )>::type type; | |
| 2070 | 2076 | }; |
| 2071 | 2077 | |
| 2072 | template <> | |
| 2073 | struct _LIBCPP_TEMPLATE_VIS common_type<void, void, void> | |
| 2074 | { | |
| 2075 | public: | |
| 2076 | typedef void type; | |
| 2077 | }; | |
| 2078 | template <class, class = void> | |
| 2079 | struct __common_type_impl {}; | |
| 2078 | 2080 | |
| 2079 | template <class _Tp> | |
| 2080 | struct _LIBCPP_TEMPLATE_VIS common_type<_Tp, void, void> | |
| 2081 | { | |
| 2082 | public: | |
| 2083 | typedef typename common_type<_Tp, _Tp>::type type; | |
| 2084 | }; | |
| 2081 | // Clang provides variadic templates in C++03 as an extension. | |
| 2082 | #if !defined(_LIBCPP_CXX03_LANG) || defined(__clang__) | |
| 2083 | # define _LIBCPP_OPTIONAL_PACK(...) , __VA_ARGS__ | |
| 2084 | template <class... Tp> | |
| 2085 | struct __common_types; | |
| 2086 | template <class... _Tp> | |
| 2087 | struct _LIBCPP_TEMPLATE_VIS common_type; | |
| 2088 | #else | |
| 2089 | # define _LIBCPP_OPTIONAL_PACK(...) | |
| 2090 | struct __no_arg; | |
| 2091 | template <class _Tp, class _Up, class = __no_arg> | |
| 2092 | struct __common_types; | |
| 2093 | template <class _Tp = __no_arg, class _Up = __no_arg, class _Vp = __no_arg, | |
| 2094 | class _Unused = __no_arg> | |
| 2095 | struct common_type { | |
| 2096 | static_assert(sizeof(_Unused) == 0, | |
| 2097 | "common_type accepts at most 3 arguments in C++03"); | |
| 2098 | }; | |
| 2099 | #endif // _LIBCPP_CXX03_LANG | |
| 2085 | 2100 | |
| 2086 | 2101 | template <class _Tp, class _Up> |
| 2087 | struct _LIBCPP_TEMPLATE_VIS common_type<_Tp, _Up, void> | |
| 2102 | struct __common_type_impl< | |
| 2103 | __common_types<_Tp, _Up>, | |
| 2104 | typename __void_t<typename common_type<_Tp, _Up>::type>::type> | |
| 2088 | 2105 | { |
| 2089 | typedef typename decay<decltype( | |
| 2090 | true ? _VSTD::declval<_Tp>() : _VSTD::declval<_Up>() | |
| 2091 | )>::type type; | |
| 2106 | typedef typename common_type<_Tp, _Up>::type type; | |
| 2092 | 2107 | }; |
| 2093 | 2108 | |
| 2094 | #else // _LIBCPP_HAS_NO_VARIADICS | |
| 2109 | template <class _Tp, class _Up, class _Vp _LIBCPP_OPTIONAL_PACK(class... _Rest)> | |
| 2110 | struct __common_type_impl< | |
| 2111 | __common_types<_Tp, _Up, _Vp _LIBCPP_OPTIONAL_PACK(_Rest...)>, | |
| 2112 | typename __void_t<typename common_type<_Tp, _Up>::type>::type> | |
| 2113 | : __common_type_impl<__common_types<typename common_type<_Tp, _Up>::type, | |
| 2114 | _Vp _LIBCPP_OPTIONAL_PACK(_Rest...)> > { | |
| 2115 | }; | |
| 2095 | 2116 | |
| 2096 | 2117 | // bullet 1 - sizeof...(Tp) == 0 |
| 2097 | 2118 | |
| 2098 | template <class ..._Tp> | |
| 2099 | struct _LIBCPP_TEMPLATE_VIS common_type {}; | |
| 2119 | template <> | |
| 2120 | struct _LIBCPP_TEMPLATE_VIS common_type<> {}; | |
| 2100 | 2121 | |
| 2101 | 2122 | // bullet 2 - sizeof...(Tp) == 1 |
| 2102 | 2123 | |
| ... | ... | @@ -2106,71 +2127,32 @@ struct _LIBCPP_TEMPLATE_VIS common_type<_Tp> |
| 2106 | 2127 | |
| 2107 | 2128 | // bullet 3 - sizeof...(Tp) == 2 |
| 2108 | 2129 | |
| 2109 | template <class _Tp, class _Up, class = void> | |
| 2110 | struct __common_type2_imp {}; | |
| 2111 | ||
| 2112 | template <class _Tp, class _Up> | |
| 2113 | struct __common_type2_imp<_Tp, _Up, | |
| 2114 | typename __void_t<decltype( | |
| 2115 | true ? _VSTD::declval<_Tp>() : _VSTD::declval<_Up>() | |
| 2116 | )>::type> | |
| 2117 | { | |
| 2118 | typedef typename decay<decltype( | |
| 2119 | true ? _VSTD::declval<_Tp>() : _VSTD::declval<_Up>() | |
| 2120 | )>::type type; | |
| 2121 | }; | |
| 2122 | ||
| 2123 | template <class _Tp, class _Up, | |
| 2124 | class _DTp = typename decay<_Tp>::type, | |
| 2125 | class _DUp = typename decay<_Up>::type> | |
| 2126 | using __common_type2 = | |
| 2127 | typename conditional< | |
| 2128 | is_same<_Tp, _DTp>::value && is_same<_Up, _DUp>::value, | |
| 2129 | __common_type2_imp<_Tp, _Up>, | |
| 2130 | common_type<_DTp, _DUp> | |
| 2131 | >::type; | |
| 2132 | ||
| 2133 | 2130 | template <class _Tp, class _Up> |
| 2134 | 2131 | struct _LIBCPP_TEMPLATE_VIS common_type<_Tp, _Up> |
| 2135 | : __common_type2<_Tp, _Up> {}; | |
| 2132 | : conditional< | |
| 2133 | _IsSame<_Tp, typename decay<_Tp>::type>::value && _IsSame<_Up, typename decay<_Up>::type>::value, | |
| 2134 | __common_type2_imp<_Tp, _Up>, | |
| 2135 | common_type<typename decay<_Tp>::type, typename decay<_Up>::type> | |
| 2136 | >::type | |
| 2137 | {}; | |
| 2136 | 2138 | |
| 2137 | 2139 | // bullet 4 - sizeof...(Tp) > 2 |
| 2138 | 2140 | |
| 2139 | template <class ...Tp> struct __common_types; | |
| 2140 | ||
| 2141 | template <class, class = void> | |
| 2142 | struct __common_type_impl {}; | |
| 2143 | ||
| 2144 | template <class _Tp, class _Up> | |
| 2145 | struct __common_type_impl< | |
| 2146 | __common_types<_Tp, _Up>, | |
| 2147 | typename __void_t<typename common_type<_Tp, _Up>::type>::type> | |
| 2148 | { | |
| 2149 | typedef typename common_type<_Tp, _Up>::type type; | |
| 2150 | }; | |
| 2151 | ||
| 2152 | template <class _Tp, class _Up, class ..._Vp> | |
| 2153 | struct __common_type_impl<__common_types<_Tp, _Up, _Vp...>, | |
| 2154 | typename __void_t<typename common_type<_Tp, _Up>::type>::type> | |
| 2155 | : __common_type_impl< | |
| 2156 | __common_types<typename common_type<_Tp, _Up>::type, _Vp...> > | |
| 2157 | { | |
| 2158 | ||
| 2159 | }; | |
| 2141 | template <class _Tp, class _Up, class _Vp _LIBCPP_OPTIONAL_PACK(class... _Rest)> | |
| 2142 | struct _LIBCPP_TEMPLATE_VIS | |
| 2143 | common_type<_Tp, _Up, _Vp _LIBCPP_OPTIONAL_PACK(_Rest...)> | |
| 2144 | : __common_type_impl< | |
| 2145 | __common_types<_Tp, _Up, _Vp _LIBCPP_OPTIONAL_PACK(_Rest...)> > {}; | |
| 2160 | 2146 | |
| 2161 | template <class _Tp, class _Up, class ..._Vp> | |
| 2162 | struct _LIBCPP_TEMPLATE_VIS common_type<_Tp, _Up, _Vp...> | |
| 2163 | : __common_type_impl<__common_types<_Tp, _Up, _Vp...> > {}; | |
| 2147 | #undef _LIBCPP_OPTIONAL_PACK | |
| 2164 | 2148 | |
| 2165 | 2149 | #if _LIBCPP_STD_VER > 11 |
| 2166 | 2150 | template <class ..._Tp> using common_type_t = typename common_type<_Tp...>::type; |
| 2167 | 2151 | #endif |
| 2168 | 2152 | |
| 2169 | #endif // _LIBCPP_HAS_NO_VARIADICS | |
| 2170 | ||
| 2171 | 2153 | // is_assignable |
| 2172 | 2154 | |
| 2173 | template<typename, typename _Tp> struct __select_2nd { typedef _Tp type; }; | |
| 2155 | template<typename, typename _Tp> struct __select_2nd { typedef _LIBCPP_NODEBUG_TYPE _Tp type; }; | |
| 2174 | 2156 | |
| 2175 | 2157 | template <class _Tp, class _Arg> |
| 2176 | 2158 | typename __select_2nd<decltype((_VSTD::declval<_Tp>() = _VSTD::declval<_Arg>())), true_type>::type |
| ... | ... | @@ -2215,12 +2197,8 @@ _LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_copy_assignable_v |
| 2215 | 2197 | // is_move_assignable |
| 2216 | 2198 | |
| 2217 | 2199 | template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_move_assignable |
| 2218 | #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES | |
| 2219 | 2200 | : public is_assignable<typename add_lvalue_reference<_Tp>::type, |
| 2220 | 2201 | typename add_rvalue_reference<_Tp>::type> {}; |
| 2221 | #else | |
| 2222 | : public is_copy_assignable<_Tp> {}; | |
| 2223 | #endif | |
| 2224 | 2202 | |
| 2225 | 2203 | #if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) |
| 2226 | 2204 | template <class _Tp> |
| ... | ... | @@ -2294,14 +2272,12 @@ _LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_destructible_v |
| 2294 | 2272 | |
| 2295 | 2273 | // move |
| 2296 | 2274 | |
| 2297 | #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES | |
| 2298 | ||
| 2299 | 2275 | template <class _Tp> |
| 2300 | 2276 | inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR |
| 2301 | 2277 | typename remove_reference<_Tp>::type&& |
| 2302 | 2278 | move(_Tp&& __t) _NOEXCEPT |
| 2303 | 2279 | { |
| 2304 | typedef typename remove_reference<_Tp>::type _Up; | |
| 2280 | typedef _LIBCPP_NODEBUG_TYPE typename remove_reference<_Tp>::type _Up; | |
| 2305 | 2281 | return static_cast<_Up&&>(__t); |
| 2306 | 2282 | } |
| 2307 | 2283 | |
| ... | ... | @@ -2323,81 +2299,24 @@ forward(typename remove_reference<_Tp>::type&& __t) _NOEXCEPT |
| 2323 | 2299 | return static_cast<_Tp&&>(__t); |
| 2324 | 2300 | } |
| 2325 | 2301 | |
| 2326 | #else // _LIBCPP_HAS_NO_RVALUE_REFERENCES | |
| 2327 | ||
| 2328 | 2302 | template <class _Tp> |
| 2329 | 2303 | inline _LIBCPP_INLINE_VISIBILITY |
| 2330 | _Tp& | |
| 2331 | move(_Tp& __t) | |
| 2304 | typename decay<_Tp>::type | |
| 2305 | __decay_copy(_Tp&& __t) | |
| 2332 | 2306 | { |
| 2333 | return __t; | |
| 2307 | return _VSTD::forward<_Tp>(__t); | |
| 2334 | 2308 | } |
| 2335 | 2309 | |
| 2336 | template <class _Tp> | |
| 2337 | inline _LIBCPP_INLINE_VISIBILITY | |
| 2338 | const _Tp& | |
| 2339 | move(const _Tp& __t) | |
| 2310 | template <class _Rp, class _Class, class ..._Param> | |
| 2311 | struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...), true, false> | |
| 2340 | 2312 | { |
| 2341 | return __t; | |
| 2342 | } | |
| 2313 | typedef _Class _ClassType; | |
| 2314 | typedef _Rp _ReturnType; | |
| 2315 | typedef _Rp (_FnType) (_Param...); | |
| 2316 | }; | |
| 2343 | 2317 | |
| 2344 | template <class _Tp> | |
| 2345 | inline _LIBCPP_INLINE_VISIBILITY | |
| 2346 | _Tp& | |
| 2347 | forward(typename remove_reference<_Tp>::type& __t) _NOEXCEPT | |
| 2348 | { | |
| 2349 | return __t; | |
| 2350 | } | |
| 2351 | ||
| 2352 | ||
| 2353 | template <class _Tp> | |
| 2354 | class __rv | |
| 2355 | { | |
| 2356 | typedef typename remove_reference<_Tp>::type _Trr; | |
| 2357 | _Trr& t_; | |
| 2358 | public: | |
| 2359 | _LIBCPP_INLINE_VISIBILITY | |
| 2360 | _Trr* operator->() {return &t_;} | |
| 2361 | _LIBCPP_INLINE_VISIBILITY | |
| 2362 | explicit __rv(_Trr& __t) : t_(__t) {} | |
| 2363 | }; | |
| 2364 | ||
| 2365 | #endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES | |
| 2366 | ||
| 2367 | #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES | |
| 2368 | ||
| 2369 | template <class _Tp> | |
| 2370 | inline _LIBCPP_INLINE_VISIBILITY | |
| 2371 | typename decay<_Tp>::type | |
| 2372 | __decay_copy(_Tp&& __t) | |
| 2373 | { | |
| 2374 | return _VSTD::forward<_Tp>(__t); | |
| 2375 | } | |
| 2376 | ||
| 2377 | #else | |
| 2378 | ||
| 2379 | template <class _Tp> | |
| 2380 | inline _LIBCPP_INLINE_VISIBILITY | |
| 2381 | typename decay<_Tp>::type | |
| 2382 | __decay_copy(const _Tp& __t) | |
| 2383 | { | |
| 2384 | return _VSTD::forward<_Tp>(__t); | |
| 2385 | } | |
| 2386 | ||
| 2387 | #endif | |
| 2388 | ||
| 2389 | #ifndef _LIBCPP_HAS_NO_VARIADICS | |
| 2390 | ||
| 2391 | template <class _Rp, class _Class, class ..._Param> | |
| 2392 | struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...), true, false> | |
| 2393 | { | |
| 2394 | typedef _Class _ClassType; | |
| 2395 | typedef _Rp _ReturnType; | |
| 2396 | typedef _Rp (_FnType) (_Param...); | |
| 2397 | }; | |
| 2398 | ||
| 2399 | template <class _Rp, class _Class, class ..._Param> | |
| 2400 | struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param..., ...), true, false> | |
| 2318 | template <class _Rp, class _Class, class ..._Param> | |
| 2319 | struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param..., ...), true, false> | |
| 2401 | 2320 | { |
| 2402 | 2321 | typedef _Class _ClassType; |
| 2403 | 2322 | typedef _Rp _ReturnType; |
| ... | ... | @@ -2452,8 +2371,7 @@ struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param..., ...) const volatil |
| 2452 | 2371 | typedef _Rp (_FnType) (_Param..., ...); |
| 2453 | 2372 | }; |
| 2454 | 2373 | |
| 2455 | #if __has_feature(cxx_reference_qualified_functions) || \ | |
| 2456 | (defined(_GNUC_VER) && _GNUC_VER >= 409) | |
| 2374 | #if __has_feature(cxx_reference_qualified_functions) || defined(_LIBCPP_COMPILER_GCC) | |
| 2457 | 2375 | |
| 2458 | 2376 | template <class _Rp, class _Class, class ..._Param> |
| 2459 | 2377 | struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...) &, true, false> |
| ... | ... | @@ -2583,267 +2501,8 @@ struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param..., ...) const volatil |
| 2583 | 2501 | typedef _Rp (_FnType) (_Param..., ...); |
| 2584 | 2502 | }; |
| 2585 | 2503 | |
| 2586 | #endif // __has_feature(cxx_reference_qualified_functions) || _GNUC_VER >= 409 | |
| 2587 | ||
| 2588 | #else // _LIBCPP_HAS_NO_VARIADICS | |
| 2589 | ||
| 2590 | template <class _Rp, class _Class> | |
| 2591 | struct __member_pointer_traits_imp<_Rp (_Class::*)(), true, false> | |
| 2592 | { | |
| 2593 | typedef _Class _ClassType; | |
| 2594 | typedef _Rp _ReturnType; | |
| 2595 | typedef _Rp (_FnType) (); | |
| 2596 | }; | |
| 2597 | ||
| 2598 | template <class _Rp, class _Class> | |
| 2599 | struct __member_pointer_traits_imp<_Rp (_Class::*)(...), true, false> | |
| 2600 | { | |
| 2601 | typedef _Class _ClassType; | |
| 2602 | typedef _Rp _ReturnType; | |
| 2603 | typedef _Rp (_FnType) (...); | |
| 2604 | }; | |
| 2605 | ||
| 2606 | template <class _Rp, class _Class, class _P0> | |
| 2607 | struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0), true, false> | |
| 2608 | { | |
| 2609 | typedef _Class _ClassType; | |
| 2610 | typedef _Rp _ReturnType; | |
| 2611 | typedef _Rp (_FnType) (_P0); | |
| 2612 | }; | |
| 2613 | ||
| 2614 | template <class _Rp, class _Class, class _P0> | |
| 2615 | struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0, ...), true, false> | |
| 2616 | { | |
| 2617 | typedef _Class _ClassType; | |
| 2618 | typedef _Rp _ReturnType; | |
| 2619 | typedef _Rp (_FnType) (_P0, ...); | |
| 2620 | }; | |
| 2621 | ||
| 2622 | template <class _Rp, class _Class, class _P0, class _P1> | |
| 2623 | struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0, _P1), true, false> | |
| 2624 | { | |
| 2625 | typedef _Class _ClassType; | |
| 2626 | typedef _Rp _ReturnType; | |
| 2627 | typedef _Rp (_FnType) (_P0, _P1); | |
| 2628 | }; | |
| 2629 | ||
| 2630 | template <class _Rp, class _Class, class _P0, class _P1> | |
| 2631 | struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0, _P1, ...), true, false> | |
| 2632 | { | |
| 2633 | typedef _Class _ClassType; | |
| 2634 | typedef _Rp _ReturnType; | |
| 2635 | typedef _Rp (_FnType) (_P0, _P1, ...); | |
| 2636 | }; | |
| 2637 | ||
| 2638 | template <class _Rp, class _Class, class _P0, class _P1, class _P2> | |
| 2639 | struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0, _P1, _P2), true, false> | |
| 2640 | { | |
| 2641 | typedef _Class _ClassType; | |
| 2642 | typedef _Rp _ReturnType; | |
| 2643 | typedef _Rp (_FnType) (_P0, _P1, _P2); | |
| 2644 | }; | |
| 2645 | ||
| 2646 | template <class _Rp, class _Class, class _P0, class _P1, class _P2> | |
| 2647 | struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0, _P1, _P2, ...), true, false> | |
| 2648 | { | |
| 2649 | typedef _Class _ClassType; | |
| 2650 | typedef _Rp _ReturnType; | |
| 2651 | typedef _Rp (_FnType) (_P0, _P1, _P2, ...); | |
| 2652 | }; | |
| 2653 | ||
| 2654 | template <class _Rp, class _Class> | |
| 2655 | struct __member_pointer_traits_imp<_Rp (_Class::*)() const, true, false> | |
| 2656 | { | |
| 2657 | typedef _Class const _ClassType; | |
| 2658 | typedef _Rp _ReturnType; | |
| 2659 | typedef _Rp (_FnType) (); | |
| 2660 | }; | |
| 2661 | ||
| 2662 | template <class _Rp, class _Class> | |
| 2663 | struct __member_pointer_traits_imp<_Rp (_Class::*)(...) const, true, false> | |
| 2664 | { | |
| 2665 | typedef _Class const _ClassType; | |
| 2666 | typedef _Rp _ReturnType; | |
| 2667 | typedef _Rp (_FnType) (...); | |
| 2668 | }; | |
| 2669 | ||
| 2670 | template <class _Rp, class _Class, class _P0> | |
| 2671 | struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0) const, true, false> | |
| 2672 | { | |
| 2673 | typedef _Class const _ClassType; | |
| 2674 | typedef _Rp _ReturnType; | |
| 2675 | typedef _Rp (_FnType) (_P0); | |
| 2676 | }; | |
| 2677 | ||
| 2678 | template <class _Rp, class _Class, class _P0> | |
| 2679 | struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0, ...) const, true, false> | |
| 2680 | { | |
| 2681 | typedef _Class const _ClassType; | |
| 2682 | typedef _Rp _ReturnType; | |
| 2683 | typedef _Rp (_FnType) (_P0, ...); | |
| 2684 | }; | |
| 2685 | ||
| 2686 | template <class _Rp, class _Class, class _P0, class _P1> | |
| 2687 | struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0, _P1) const, true, false> | |
| 2688 | { | |
| 2689 | typedef _Class const _ClassType; | |
| 2690 | typedef _Rp _ReturnType; | |
| 2691 | typedef _Rp (_FnType) (_P0, _P1); | |
| 2692 | }; | |
| 2693 | ||
| 2694 | template <class _Rp, class _Class, class _P0, class _P1> | |
| 2695 | struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0, _P1, ...) const, true, false> | |
| 2696 | { | |
| 2697 | typedef _Class const _ClassType; | |
| 2698 | typedef _Rp _ReturnType; | |
| 2699 | typedef _Rp (_FnType) (_P0, _P1, ...); | |
| 2700 | }; | |
| 2701 | ||
| 2702 | template <class _Rp, class _Class, class _P0, class _P1, class _P2> | |
| 2703 | struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0, _P1, _P2) const, true, false> | |
| 2704 | { | |
| 2705 | typedef _Class const _ClassType; | |
| 2706 | typedef _Rp _ReturnType; | |
| 2707 | typedef _Rp (_FnType) (_P0, _P1, _P2); | |
| 2708 | }; | |
| 2709 | ||
| 2710 | template <class _Rp, class _Class, class _P0, class _P1, class _P2> | |
| 2711 | struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0, _P1, _P2, ...) const, true, false> | |
| 2712 | { | |
| 2713 | typedef _Class const _ClassType; | |
| 2714 | typedef _Rp _ReturnType; | |
| 2715 | typedef _Rp (_FnType) (_P0, _P1, _P2, ...); | |
| 2716 | }; | |
| 2717 | ||
| 2718 | template <class _Rp, class _Class> | |
| 2719 | struct __member_pointer_traits_imp<_Rp (_Class::*)() volatile, true, false> | |
| 2720 | { | |
| 2721 | typedef _Class volatile _ClassType; | |
| 2722 | typedef _Rp _ReturnType; | |
| 2723 | typedef _Rp (_FnType) (); | |
| 2724 | }; | |
| 2725 | ||
| 2726 | template <class _Rp, class _Class> | |
| 2727 | struct __member_pointer_traits_imp<_Rp (_Class::*)(...) volatile, true, false> | |
| 2728 | { | |
| 2729 | typedef _Class volatile _ClassType; | |
| 2730 | typedef _Rp _ReturnType; | |
| 2731 | typedef _Rp (_FnType) (...); | |
| 2732 | }; | |
| 2733 | ||
| 2734 | template <class _Rp, class _Class, class _P0> | |
| 2735 | struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0) volatile, true, false> | |
| 2736 | { | |
| 2737 | typedef _Class volatile _ClassType; | |
| 2738 | typedef _Rp _ReturnType; | |
| 2739 | typedef _Rp (_FnType) (_P0); | |
| 2740 | }; | |
| 2741 | ||
| 2742 | template <class _Rp, class _Class, class _P0> | |
| 2743 | struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0, ...) volatile, true, false> | |
| 2744 | { | |
| 2745 | typedef _Class volatile _ClassType; | |
| 2746 | typedef _Rp _ReturnType; | |
| 2747 | typedef _Rp (_FnType) (_P0, ...); | |
| 2748 | }; | |
| 2749 | ||
| 2750 | template <class _Rp, class _Class, class _P0, class _P1> | |
| 2751 | struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0, _P1) volatile, true, false> | |
| 2752 | { | |
| 2753 | typedef _Class volatile _ClassType; | |
| 2754 | typedef _Rp _ReturnType; | |
| 2755 | typedef _Rp (_FnType) (_P0, _P1); | |
| 2756 | }; | |
| 2757 | ||
| 2758 | template <class _Rp, class _Class, class _P0, class _P1> | |
| 2759 | struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0, _P1, ...) volatile, true, false> | |
| 2760 | { | |
| 2761 | typedef _Class volatile _ClassType; | |
| 2762 | typedef _Rp _ReturnType; | |
| 2763 | typedef _Rp (_FnType) (_P0, _P1, ...); | |
| 2764 | }; | |
| 2765 | ||
| 2766 | template <class _Rp, class _Class, class _P0, class _P1, class _P2> | |
| 2767 | struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0, _P1, _P2) volatile, true, false> | |
| 2768 | { | |
| 2769 | typedef _Class volatile _ClassType; | |
| 2770 | typedef _Rp _ReturnType; | |
| 2771 | typedef _Rp (_FnType) (_P0, _P1, _P2); | |
| 2772 | }; | |
| 2773 | ||
| 2774 | template <class _Rp, class _Class, class _P0, class _P1, class _P2> | |
| 2775 | struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0, _P1, _P2, ...) volatile, true, false> | |
| 2776 | { | |
| 2777 | typedef _Class volatile _ClassType; | |
| 2778 | typedef _Rp _ReturnType; | |
| 2779 | typedef _Rp (_FnType) (_P0, _P1, _P2, ...); | |
| 2780 | }; | |
| 2781 | ||
| 2782 | template <class _Rp, class _Class> | |
| 2783 | struct __member_pointer_traits_imp<_Rp (_Class::*)() const volatile, true, false> | |
| 2784 | { | |
| 2785 | typedef _Class const volatile _ClassType; | |
| 2786 | typedef _Rp _ReturnType; | |
| 2787 | typedef _Rp (_FnType) (); | |
| 2788 | }; | |
| 2789 | ||
| 2790 | template <class _Rp, class _Class> | |
| 2791 | struct __member_pointer_traits_imp<_Rp (_Class::*)(...) const volatile, true, false> | |
| 2792 | { | |
| 2793 | typedef _Class const volatile _ClassType; | |
| 2794 | typedef _Rp _ReturnType; | |
| 2795 | typedef _Rp (_FnType) (...); | |
| 2796 | }; | |
| 2797 | ||
| 2798 | template <class _Rp, class _Class, class _P0> | |
| 2799 | struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0) const volatile, true, false> | |
| 2800 | { | |
| 2801 | typedef _Class const volatile _ClassType; | |
| 2802 | typedef _Rp _ReturnType; | |
| 2803 | typedef _Rp (_FnType) (_P0); | |
| 2804 | }; | |
| 2805 | ||
| 2806 | template <class _Rp, class _Class, class _P0> | |
| 2807 | struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0, ...) const volatile, true, false> | |
| 2808 | { | |
| 2809 | typedef _Class const volatile _ClassType; | |
| 2810 | typedef _Rp _ReturnType; | |
| 2811 | typedef _Rp (_FnType) (_P0, ...); | |
| 2812 | }; | |
| 2813 | ||
| 2814 | template <class _Rp, class _Class, class _P0, class _P1> | |
| 2815 | struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0, _P1) const volatile, true, false> | |
| 2816 | { | |
| 2817 | typedef _Class const volatile _ClassType; | |
| 2818 | typedef _Rp _ReturnType; | |
| 2819 | typedef _Rp (_FnType) (_P0, _P1); | |
| 2820 | }; | |
| 2821 | ||
| 2822 | template <class _Rp, class _Class, class _P0, class _P1> | |
| 2823 | struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0, _P1, ...) const volatile, true, false> | |
| 2824 | { | |
| 2825 | typedef _Class const volatile _ClassType; | |
| 2826 | typedef _Rp _ReturnType; | |
| 2827 | typedef _Rp (_FnType) (_P0, _P1, ...); | |
| 2828 | }; | |
| 2829 | ||
| 2830 | template <class _Rp, class _Class, class _P0, class _P1, class _P2> | |
| 2831 | struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0, _P1, _P2) const volatile, true, false> | |
| 2832 | { | |
| 2833 | typedef _Class const volatile _ClassType; | |
| 2834 | typedef _Rp _ReturnType; | |
| 2835 | typedef _Rp (_FnType) (_P0, _P1, _P2); | |
| 2836 | }; | |
| 2837 | ||
| 2838 | template <class _Rp, class _Class, class _P0, class _P1, class _P2> | |
| 2839 | struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0, _P1, _P2, ...) const volatile, true, false> | |
| 2840 | { | |
| 2841 | typedef _Class const volatile _ClassType; | |
| 2842 | typedef _Rp _ReturnType; | |
| 2843 | typedef _Rp (_FnType) (_P0, _P1, _P2, ...); | |
| 2844 | }; | |
| 2504 | #endif // __has_feature(cxx_reference_qualified_functions) || defined(_LIBCPP_COMPILER_GCC) | |
| 2845 | 2505 | |
| 2846 | #endif // _LIBCPP_HAS_NO_VARIADICS | |
| 2847 | 2506 | |
| 2848 | 2507 | template <class _Rp, class _Class> |
| 2849 | 2508 | struct __member_pointer_traits_imp<_Rp _Class::*, false, true> |
| ... | ... | @@ -3042,10 +2701,10 @@ struct __is_invalid_base_to_derived_cast { |
| 3042 | 2701 | static_assert(is_reference<_To>::value, "Wrong specialization"); |
| 3043 | 2702 | using _RawFrom = __uncvref_t<_From>; |
| 3044 | 2703 | using _RawTo = __uncvref_t<_To>; |
| 3045 | static const bool value = __lazy_and< | |
| 3046 | __lazy_not<is_same<_RawFrom, _RawTo>>, | |
| 2704 | static const bool value = _And< | |
| 2705 | _IsNotSame<_RawFrom, _RawTo>, | |
| 3047 | 2706 | is_base_of<_RawFrom, _RawTo>, |
| 3048 | __lazy_not<__libcpp_is_constructible<_RawTo, _From>> | |
| 2707 | _Not<__libcpp_is_constructible<_RawTo, _From>> | |
| 3049 | 2708 | >::value; |
| 3050 | 2709 | }; |
| 3051 | 2710 | |
| ... | ... | @@ -3058,10 +2717,10 @@ template <class _ToRef, class _FromRef> |
| 3058 | 2717 | struct __is_invalid_lvalue_to_rvalue_cast<_ToRef&&, _FromRef&> { |
| 3059 | 2718 | using _RawFrom = __uncvref_t<_FromRef>; |
| 3060 | 2719 | using _RawTo = __uncvref_t<_ToRef>; |
| 3061 | static const bool value = __lazy_and< | |
| 3062 | __lazy_not<is_function<_RawTo>>, | |
| 3063 | __lazy_or< | |
| 3064 | is_same<_RawFrom, _RawTo>, | |
| 2720 | static const bool value = _And< | |
| 2721 | _Not<is_function<_RawTo>>, | |
| 2722 | _Or< | |
| 2723 | _IsSame<_RawFrom, _RawTo>, | |
| 3065 | 2724 | is_base_of<_RawTo, _RawFrom>> |
| 3066 | 2725 | >::value; |
| 3067 | 2726 | }; |
| ... | ... | @@ -3117,276 +2776,48 @@ template <class _Tp, size_t _Nx> |
| 3117 | 2776 | struct __is_default_constructible<_Tp[_Nx], false> |
| 3118 | 2777 | : __is_default_constructible<typename remove_all_extents<_Tp>::type> {}; |
| 3119 | 2778 | |
| 3120 | template <class _Tp, class... _Args> | |
| 3121 | struct __libcpp_is_constructible | |
| 3122 | { | |
| 3123 | static_assert(sizeof...(_Args) > 1, "Wrong specialization"); | |
| 3124 | typedef decltype(__is_constructible_helper::__test_nary<_Tp, _Args...>(0)) | |
| 3125 | type; | |
| 3126 | }; | |
| 3127 | ||
| 3128 | template <class _Tp> | |
| 3129 | struct __libcpp_is_constructible<_Tp> : __is_default_constructible<_Tp> {}; | |
| 3130 | ||
| 3131 | template <class _Tp, class _A0> | |
| 3132 | struct __libcpp_is_constructible<_Tp, _A0> | |
| 3133 | : public decltype(__is_constructible_helper::__test_unary<_Tp, _A0>(0)) | |
| 3134 | {}; | |
| 3135 | ||
| 3136 | template <class _Tp, class _A0> | |
| 3137 | struct __libcpp_is_constructible<_Tp&, _A0> | |
| 3138 | : public decltype(__is_constructible_helper:: | |
| 3139 | __test_cast<_Tp&, _A0>(0)) | |
| 3140 | {}; | |
| 3141 | ||
| 3142 | template <class _Tp, class _A0> | |
| 3143 | struct __libcpp_is_constructible<_Tp&&, _A0> | |
| 3144 | : public decltype(__is_constructible_helper:: | |
| 3145 | __test_cast<_Tp&&, _A0>(0)) | |
| 3146 | {}; | |
| 3147 | ||
| 3148 | #endif | |
| 3149 | ||
| 3150 | #if __has_feature(is_constructible) | |
| 3151 | template <class _Tp, class ..._Args> | |
| 3152 | struct _LIBCPP_TEMPLATE_VIS is_constructible | |
| 3153 | : public integral_constant<bool, __is_constructible(_Tp, _Args...)> | |
| 3154 | {}; | |
| 3155 | #elif !defined(_LIBCPP_CXX03_LANG) | |
| 3156 | template <class _Tp, class... _Args> | |
| 3157 | struct _LIBCPP_TEMPLATE_VIS is_constructible | |
| 3158 | : public __libcpp_is_constructible<_Tp, _Args...>::type {}; | |
| 3159 | #else | |
| 3160 | // template <class T> struct is_constructible0; | |
| 3161 | ||
| 3162 | // main is_constructible0 test | |
| 3163 | ||
| 3164 | template <class _Tp> | |
| 3165 | decltype((_Tp(), true_type())) | |
| 3166 | __is_constructible0_test(_Tp&); | |
| 3167 | ||
| 3168 | false_type | |
| 3169 | __is_constructible0_test(__any); | |
| 3170 | ||
| 3171 | template <class _Tp, class _A0> | |
| 3172 | decltype((_Tp(_VSTD::declval<_A0>()), true_type())) | |
| 3173 | __is_constructible1_test(_Tp&, _A0&); | |
| 3174 | ||
| 3175 | template <class _A0> | |
| 3176 | false_type | |
| 3177 | __is_constructible1_test(__any, _A0&); | |
| 3178 | ||
| 3179 | template <class _Tp, class _A0, class _A1> | |
| 3180 | decltype((_Tp(_VSTD::declval<_A0>(), _VSTD::declval<_A1>()), true_type())) | |
| 3181 | __is_constructible2_test(_Tp&, _A0&, _A1&); | |
| 3182 | ||
| 3183 | template <class _A0, class _A1> | |
| 3184 | false_type | |
| 3185 | __is_constructible2_test(__any, _A0&, _A1&); | |
| 3186 | ||
| 3187 | template <class _Tp, class _A0, class _A1, class _A2> | |
| 3188 | decltype((_Tp(_VSTD::declval<_A0>(), _VSTD::declval<_A1>(), _VSTD::declval<_A2>()), true_type())) | |
| 3189 | __is_constructible3_test(_Tp&, _A0&, _A1&, _A2&); | |
| 3190 | ||
| 3191 | template <class _A0, class _A1, class _A2> | |
| 3192 | false_type | |
| 3193 | __is_constructible3_test(__any, _A0&, _A1&, _A2&); | |
| 3194 | ||
| 3195 | template <bool, class _Tp> | |
| 3196 | struct __is_constructible0_imp // false, _Tp is not a scalar | |
| 3197 | : public common_type | |
| 3198 | < | |
| 3199 | decltype(__is_constructible0_test(declval<_Tp&>())) | |
| 3200 | >::type | |
| 3201 | {}; | |
| 3202 | ||
| 3203 | template <bool, class _Tp, class _A0> | |
| 3204 | struct __is_constructible1_imp // false, _Tp is not a scalar | |
| 3205 | : public common_type | |
| 3206 | < | |
| 3207 | decltype(__is_constructible1_test(declval<_Tp&>(), declval<_A0&>())) | |
| 3208 | >::type | |
| 3209 | {}; | |
| 3210 | ||
| 3211 | template <bool, class _Tp, class _A0, class _A1> | |
| 3212 | struct __is_constructible2_imp // false, _Tp is not a scalar | |
| 3213 | : public common_type | |
| 3214 | < | |
| 3215 | decltype(__is_constructible2_test(declval<_Tp&>(), declval<_A0>(), declval<_A1>())) | |
| 3216 | >::type | |
| 3217 | {}; | |
| 3218 | ||
| 3219 | template <bool, class _Tp, class _A0, class _A1, class _A2> | |
| 3220 | struct __is_constructible3_imp // false, _Tp is not a scalar | |
| 3221 | : public common_type | |
| 3222 | < | |
| 3223 | decltype(__is_constructible3_test(declval<_Tp&>(), declval<_A0>(), declval<_A1>(), declval<_A2>())) | |
| 3224 | >::type | |
| 3225 | {}; | |
| 3226 | ||
| 3227 | // handle scalars and reference types | |
| 3228 | ||
| 3229 | // Scalars are default constructible, references are not | |
| 3230 | ||
| 3231 | template <class _Tp> | |
| 3232 | struct __is_constructible0_imp<true, _Tp> | |
| 3233 | : public is_scalar<_Tp> | |
| 3234 | {}; | |
| 3235 | ||
| 3236 | template <class _Tp, class _A0> | |
| 3237 | struct __is_constructible1_imp<true, _Tp, _A0> | |
| 3238 | : public is_convertible<_A0, _Tp> | |
| 3239 | {}; | |
| 3240 | ||
| 3241 | template <class _Tp, class _A0, class _A1> | |
| 3242 | struct __is_constructible2_imp<true, _Tp, _A0, _A1> | |
| 3243 | : public false_type | |
| 3244 | {}; | |
| 3245 | ||
| 3246 | template <class _Tp, class _A0, class _A1, class _A2> | |
| 3247 | struct __is_constructible3_imp<true, _Tp, _A0, _A1, _A2> | |
| 3248 | : public false_type | |
| 3249 | {}; | |
| 3250 | ||
| 3251 | // Treat scalars and reference types separately | |
| 3252 | ||
| 3253 | template <bool, class _Tp> | |
| 3254 | struct __is_constructible0_void_check | |
| 3255 | : public __is_constructible0_imp<is_scalar<_Tp>::value || is_reference<_Tp>::value, | |
| 3256 | _Tp> | |
| 3257 | {}; | |
| 3258 | ||
| 3259 | template <bool, class _Tp, class _A0> | |
| 3260 | struct __is_constructible1_void_check | |
| 3261 | : public __is_constructible1_imp<is_scalar<_Tp>::value || is_reference<_Tp>::value, | |
| 3262 | _Tp, _A0> | |
| 3263 | {}; | |
| 3264 | ||
| 3265 | template <bool, class _Tp, class _A0, class _A1> | |
| 3266 | struct __is_constructible2_void_check | |
| 3267 | : public __is_constructible2_imp<is_scalar<_Tp>::value || is_reference<_Tp>::value, | |
| 3268 | _Tp, _A0, _A1> | |
| 3269 | {}; | |
| 3270 | ||
| 3271 | template <bool, class _Tp, class _A0, class _A1, class _A2> | |
| 3272 | struct __is_constructible3_void_check | |
| 3273 | : public __is_constructible3_imp<is_scalar<_Tp>::value || is_reference<_Tp>::value, | |
| 3274 | _Tp, _A0, _A1, _A2> | |
| 3275 | {}; | |
| 3276 | ||
| 3277 | // If any of T or Args is void, is_constructible should be false | |
| 3278 | ||
| 3279 | template <class _Tp> | |
| 3280 | struct __is_constructible0_void_check<true, _Tp> | |
| 3281 | : public false_type | |
| 3282 | {}; | |
| 3283 | ||
| 3284 | template <class _Tp, class _A0> | |
| 3285 | struct __is_constructible1_void_check<true, _Tp, _A0> | |
| 3286 | : public false_type | |
| 3287 | {}; | |
| 3288 | ||
| 3289 | template <class _Tp, class _A0, class _A1> | |
| 3290 | struct __is_constructible2_void_check<true, _Tp, _A0, _A1> | |
| 3291 | : public false_type | |
| 3292 | {}; | |
| 3293 | ||
| 3294 | template <class _Tp, class _A0, class _A1, class _A2> | |
| 3295 | struct __is_constructible3_void_check<true, _Tp, _A0, _A1, _A2> | |
| 3296 | : public false_type | |
| 3297 | {}; | |
| 3298 | ||
| 3299 | // is_constructible entry point | |
| 3300 | ||
| 3301 | template <class _Tp, class _A0 = __is_construct::__nat, | |
| 3302 | class _A1 = __is_construct::__nat, | |
| 3303 | class _A2 = __is_construct::__nat> | |
| 3304 | struct _LIBCPP_TEMPLATE_VIS is_constructible | |
| 3305 | : public __is_constructible3_void_check<is_void<_Tp>::value | |
| 3306 | || is_abstract<_Tp>::value | |
| 3307 | || is_function<_Tp>::value | |
| 3308 | || is_void<_A0>::value | |
| 3309 | || is_void<_A1>::value | |
| 3310 | || is_void<_A2>::value, | |
| 3311 | _Tp, _A0, _A1, _A2> | |
| 3312 | {}; | |
| 3313 | ||
| 3314 | template <class _Tp> | |
| 3315 | struct _LIBCPP_TEMPLATE_VIS is_constructible<_Tp, __is_construct::__nat, __is_construct::__nat> | |
| 3316 | : public __is_constructible0_void_check<is_void<_Tp>::value | |
| 3317 | || is_abstract<_Tp>::value | |
| 3318 | || is_function<_Tp>::value, | |
| 3319 | _Tp> | |
| 3320 | {}; | |
| 3321 | ||
| 3322 | template <class _Tp, class _A0> | |
| 3323 | struct _LIBCPP_TEMPLATE_VIS is_constructible<_Tp, _A0, __is_construct::__nat> | |
| 3324 | : public __is_constructible1_void_check<is_void<_Tp>::value | |
| 3325 | || is_abstract<_Tp>::value | |
| 3326 | || is_function<_Tp>::value | |
| 3327 | || is_void<_A0>::value, | |
| 3328 | _Tp, _A0> | |
| 3329 | {}; | |
| 3330 | ||
| 3331 | template <class _Tp, class _A0, class _A1> | |
| 3332 | struct _LIBCPP_TEMPLATE_VIS is_constructible<_Tp, _A0, _A1, __is_construct::__nat> | |
| 3333 | : public __is_constructible2_void_check<is_void<_Tp>::value | |
| 3334 | || is_abstract<_Tp>::value | |
| 3335 | || is_function<_Tp>::value | |
| 3336 | || is_void<_A0>::value | |
| 3337 | || is_void<_A1>::value, | |
| 3338 | _Tp, _A0, _A1> | |
| 3339 | {}; | |
| 3340 | ||
| 3341 | // Array types are default constructible if their element type | |
| 3342 | // is default constructible | |
| 3343 | ||
| 3344 | template <class _Ap, size_t _Np> | |
| 3345 | struct __is_constructible0_imp<false, _Ap[_Np]> | |
| 3346 | : public is_constructible<typename remove_all_extents<_Ap>::type> | |
| 3347 | {}; | |
| 3348 | ||
| 3349 | template <class _Ap, size_t _Np, class _A0> | |
| 3350 | struct __is_constructible1_imp<false, _Ap[_Np], _A0> | |
| 3351 | : public false_type | |
| 3352 | {}; | |
| 3353 | ||
| 3354 | template <class _Ap, size_t _Np, class _A0, class _A1> | |
| 3355 | struct __is_constructible2_imp<false, _Ap[_Np], _A0, _A1> | |
| 3356 | : public false_type | |
| 3357 | {}; | |
| 2779 | template <class _Tp, class... _Args> | |
| 2780 | struct __libcpp_is_constructible | |
| 2781 | { | |
| 2782 | static_assert(sizeof...(_Args) > 1, "Wrong specialization"); | |
| 2783 | typedef decltype(__is_constructible_helper::__test_nary<_Tp, _Args...>(0)) | |
| 2784 | type; | |
| 2785 | }; | |
| 3358 | 2786 | |
| 3359 | template <class _Ap, size_t _Np, class _A0, class _A1, class _A2> | |
| 3360 | struct __is_constructible3_imp<false, _Ap[_Np], _A0, _A1, _A2> | |
| 3361 | : public false_type | |
| 3362 | {}; | |
| 2787 | template <class _Tp> | |
| 2788 | struct __libcpp_is_constructible<_Tp> : __is_default_constructible<_Tp> {}; | |
| 3363 | 2789 | |
| 3364 | // Incomplete array types are not constructible | |
| 2790 | template <class _Tp, class _A0> | |
| 2791 | struct __libcpp_is_constructible<_Tp, _A0> | |
| 2792 | : public decltype(__is_constructible_helper::__test_unary<_Tp, _A0>(0)) | |
| 2793 | {}; | |
| 3365 | 2794 | |
| 3366 | template <class _Ap> | |
| 3367 | struct __is_constructible0_imp<false, _Ap[]> | |
| 3368 | : public false_type | |
| 3369 | {}; | |
| 2795 | template <class _Tp, class _A0> | |
| 2796 | struct __libcpp_is_constructible<_Tp&, _A0> | |
| 2797 | : public decltype(__is_constructible_helper:: | |
| 2798 | __test_cast<_Tp&, _A0>(0)) | |
| 2799 | {}; | |
| 3370 | 2800 | |
| 3371 | template <class _Ap, class _A0> | |
| 3372 | struct __is_constructible1_imp<false, _Ap[], _A0> | |
| 3373 | : public false_type | |
| 3374 | {}; | |
| 2801 | template <class _Tp, class _A0> | |
| 2802 | struct __libcpp_is_constructible<_Tp&&, _A0> | |
| 2803 | : public decltype(__is_constructible_helper:: | |
| 2804 | __test_cast<_Tp&&, _A0>(0)) | |
| 2805 | {}; | |
| 3375 | 2806 | |
| 3376 | template <class _Ap, class _A0, class _A1> | |
| 3377 | struct __is_constructible2_imp<false, _Ap[], _A0, _A1> | |
| 3378 | : public false_type | |
| 3379 | {}; | |
| 2807 | #endif | |
| 3380 | 2808 | |
| 3381 | template <class _Ap, class _A0, class _A1, class _A2> | |
| 3382 | struct __is_constructible3_imp<false, _Ap[], _A0, _A1, _A2> | |
| 3383 | : public false_type | |
| 2809 | #if __has_feature(is_constructible) | |
| 2810 | template <class _Tp, class ..._Args> | |
| 2811 | struct _LIBCPP_TEMPLATE_VIS is_constructible | |
| 2812 | : public integral_constant<bool, __is_constructible(_Tp, _Args...)> | |
| 3384 | 2813 | {}; |
| 2814 | #else | |
| 2815 | template <class _Tp, class... _Args> | |
| 2816 | struct _LIBCPP_TEMPLATE_VIS is_constructible | |
| 2817 | : public __libcpp_is_constructible<_Tp, _Args...>::type {}; | |
| 2818 | #endif | |
| 3385 | 2819 | |
| 3386 | #endif // __has_feature(is_constructible) | |
| 3387 | ||
| 3388 | ||
| 3389 | #if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) && !defined(_LIBCPP_HAS_NO_VARIADICS) | |
| 2820 | #if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) | |
| 3390 | 2821 | template <class _Tp, class ..._Args> |
| 3391 | 2822 | _LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_constructible_v |
| 3392 | 2823 | = is_constructible<_Tp, _Args...>::value; |
| ... | ... | @@ -3422,11 +2853,7 @@ _LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_copy_constructible_v |
| 3422 | 2853 | |
| 3423 | 2854 | template <class _Tp> |
| 3424 | 2855 | struct _LIBCPP_TEMPLATE_VIS is_move_constructible |
| 3425 | #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES | |
| 3426 | 2856 | : public is_constructible<_Tp, typename add_rvalue_reference<_Tp>::type> |
| 3427 | #else | |
| 3428 | : public is_copy_constructible<_Tp> | |
| 3429 | #endif | |
| 3430 | 2857 | {}; |
| 3431 | 2858 | |
| 3432 | 2859 | #if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) |
| ... | ... | @@ -3437,8 +2864,6 @@ _LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_move_constructible_v |
| 3437 | 2864 | |
| 3438 | 2865 | // is_trivially_constructible |
| 3439 | 2866 | |
| 3440 | #ifndef _LIBCPP_HAS_NO_VARIADICS | |
| 3441 | ||
| 3442 | 2867 | #if __has_feature(is_trivially_constructible) || _GNUC_VER >= 501 |
| 3443 | 2868 | |
| 3444 | 2869 | template <class _Tp, class... _Args> |
| ... | ... | @@ -3457,7 +2882,7 @@ struct _LIBCPP_TEMPLATE_VIS is_trivially_constructible |
| 3457 | 2882 | |
| 3458 | 2883 | template <class _Tp> |
| 3459 | 2884 | struct _LIBCPP_TEMPLATE_VIS is_trivially_constructible<_Tp> |
| 3460 | #if __has_feature(has_trivial_constructor) || (_GNUC_VER >= 403) | |
| 2885 | #if __has_feature(has_trivial_constructor) || defined(_LIBCPP_COMPILER_GCC) | |
| 3461 | 2886 | : integral_constant<bool, __has_trivial_constructor(_Tp)> |
| 3462 | 2887 | #else |
| 3463 | 2888 | : integral_constant<bool, is_scalar<_Tp>::value> |
| ... | ... | @@ -3466,11 +2891,7 @@ struct _LIBCPP_TEMPLATE_VIS is_trivially_constructible<_Tp> |
| 3466 | 2891 | }; |
| 3467 | 2892 | |
| 3468 | 2893 | template <class _Tp> |
| 3469 | #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES | |
| 3470 | 2894 | struct _LIBCPP_TEMPLATE_VIS is_trivially_constructible<_Tp, _Tp&&> |
| 3471 | #else | |
| 3472 | struct _LIBCPP_TEMPLATE_VIS is_trivially_constructible<_Tp, _Tp> | |
| 3473 | #endif | |
| 3474 | 2895 | : integral_constant<bool, is_scalar<_Tp>::value> |
| 3475 | 2896 | { |
| 3476 | 2897 | }; |
| ... | ... | @@ -3489,80 +2910,8 @@ struct _LIBCPP_TEMPLATE_VIS is_trivially_constructible<_Tp, _Tp&> |
| 3489 | 2910 | |
| 3490 | 2911 | #endif // !__has_feature(is_trivially_constructible) |
| 3491 | 2912 | |
| 3492 | #else // _LIBCPP_HAS_NO_VARIADICS | |
| 3493 | ||
| 3494 | template <class _Tp, class _A0 = __is_construct::__nat, | |
| 3495 | class _A1 = __is_construct::__nat> | |
| 3496 | struct _LIBCPP_TEMPLATE_VIS is_trivially_constructible | |
| 3497 | : false_type | |
| 3498 | { | |
| 3499 | }; | |
| 3500 | ||
| 3501 | #if __has_feature(is_trivially_constructible) || _GNUC_VER >= 501 | |
| 3502 | ||
| 3503 | template <class _Tp> | |
| 3504 | struct _LIBCPP_TEMPLATE_VIS is_trivially_constructible<_Tp, __is_construct::__nat, | |
| 3505 | __is_construct::__nat> | |
| 3506 | : integral_constant<bool, __is_trivially_constructible(_Tp)> | |
| 3507 | { | |
| 3508 | }; | |
| 3509 | ||
| 3510 | template <class _Tp> | |
| 3511 | struct _LIBCPP_TEMPLATE_VIS is_trivially_constructible<_Tp, _Tp, | |
| 3512 | __is_construct::__nat> | |
| 3513 | : integral_constant<bool, __is_trivially_constructible(_Tp, _Tp)> | |
| 3514 | { | |
| 3515 | }; | |
| 3516 | ||
| 3517 | template <class _Tp> | |
| 3518 | struct _LIBCPP_TEMPLATE_VIS is_trivially_constructible<_Tp, const _Tp&, | |
| 3519 | __is_construct::__nat> | |
| 3520 | : integral_constant<bool, __is_trivially_constructible(_Tp, const _Tp&)> | |
| 3521 | { | |
| 3522 | }; | |
| 3523 | ||
| 3524 | template <class _Tp> | |
| 3525 | struct _LIBCPP_TEMPLATE_VIS is_trivially_constructible<_Tp, _Tp&, | |
| 3526 | __is_construct::__nat> | |
| 3527 | : integral_constant<bool, __is_trivially_constructible(_Tp, _Tp&)> | |
| 3528 | { | |
| 3529 | }; | |
| 3530 | ||
| 3531 | #else // !__has_feature(is_trivially_constructible) | |
| 3532 | ||
| 3533 | template <class _Tp> | |
| 3534 | struct _LIBCPP_TEMPLATE_VIS is_trivially_constructible<_Tp, __is_construct::__nat, | |
| 3535 | __is_construct::__nat> | |
| 3536 | : integral_constant<bool, is_scalar<_Tp>::value> | |
| 3537 | { | |
| 3538 | }; | |
| 3539 | ||
| 3540 | template <class _Tp> | |
| 3541 | struct _LIBCPP_TEMPLATE_VIS is_trivially_constructible<_Tp, _Tp, | |
| 3542 | __is_construct::__nat> | |
| 3543 | : integral_constant<bool, is_scalar<_Tp>::value> | |
| 3544 | { | |
| 3545 | }; | |
| 3546 | ||
| 3547 | template <class _Tp> | |
| 3548 | struct _LIBCPP_TEMPLATE_VIS is_trivially_constructible<_Tp, const _Tp&, | |
| 3549 | __is_construct::__nat> | |
| 3550 | : integral_constant<bool, is_scalar<_Tp>::value> | |
| 3551 | { | |
| 3552 | }; | |
| 3553 | ||
| 3554 | template <class _Tp> | |
| 3555 | struct _LIBCPP_TEMPLATE_VIS is_trivially_constructible<_Tp, _Tp&, | |
| 3556 | __is_construct::__nat> | |
| 3557 | : integral_constant<bool, is_scalar<_Tp>::value> | |
| 3558 | { | |
| 3559 | }; | |
| 3560 | ||
| 3561 | #endif // !__has_feature(is_trivially_constructible) | |
| 3562 | ||
| 3563 | #endif // _LIBCPP_HAS_NO_VARIADICS | |
| 3564 | 2913 | |
| 3565 | #if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) && !defined(_LIBCPP_HAS_NO_VARIADICS) | |
| 2914 | #if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) | |
| 3566 | 2915 | template <class _Tp, class... _Args> |
| 3567 | 2916 | _LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_trivially_constructible_v |
| 3568 | 2917 | = is_trivially_constructible<_Tp, _Args...>::value; |
| ... | ... | @@ -3595,11 +2944,7 @@ _LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_trivially_copy_constructible_v |
| 3595 | 2944 | // is_trivially_move_constructible |
| 3596 | 2945 | |
| 3597 | 2946 | template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_trivially_move_constructible |
| 3598 | #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES | |
| 3599 | 2947 | : public is_trivially_constructible<_Tp, typename add_rvalue_reference<_Tp>::type> |
| 3600 | #else | |
| 3601 | : public is_trivially_copy_constructible<_Tp> | |
| 3602 | #endif | |
| 3603 | 2948 | {}; |
| 3604 | 2949 | |
| 3605 | 2950 | #if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) |
| ... | ... | @@ -3636,14 +2981,10 @@ template <class _Tp> |
| 3636 | 2981 | struct is_trivially_assignable<_Tp&, const _Tp&> |
| 3637 | 2982 | : integral_constant<bool, is_scalar<_Tp>::value> {}; |
| 3638 | 2983 | |
| 3639 | #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES | |
| 3640 | ||
| 3641 | 2984 | template <class _Tp> |
| 3642 | 2985 | struct is_trivially_assignable<_Tp&, _Tp&&> |
| 3643 | 2986 | : integral_constant<bool, is_scalar<_Tp>::value> {}; |
| 3644 | 2987 | |
| 3645 | #endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES | |
| 3646 | ||
| 3647 | 2988 | #endif // !__has_feature(is_trivially_assignable) |
| 3648 | 2989 | |
| 3649 | 2990 | #if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) |
| ... | ... | @@ -3668,11 +3009,7 @@ _LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_trivially_copy_assignable_v |
| 3668 | 3009 | |
| 3669 | 3010 | template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_trivially_move_assignable |
| 3670 | 3011 | : public is_trivially_assignable<typename add_lvalue_reference<_Tp>::type, |
| 3671 | #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES | |
| 3672 | 3012 | typename add_rvalue_reference<_Tp>::type> |
| 3673 | #else | |
| 3674 | typename add_lvalue_reference<_Tp>::type> | |
| 3675 | #endif | |
| 3676 | 3013 | {}; |
| 3677 | 3014 | |
| 3678 | 3015 | #if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) |
| ... | ... | @@ -3683,7 +3020,12 @@ _LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_trivially_move_assignable_v |
| 3683 | 3020 | |
| 3684 | 3021 | // is_trivially_destructible |
| 3685 | 3022 | |
| 3686 | #if __has_feature(has_trivial_destructor) || (_GNUC_VER >= 403) | |
| 3023 | #if __has_keyword(__is_trivially_destructible) | |
| 3024 | ||
| 3025 | template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_trivially_destructible | |
| 3026 | : public integral_constant<bool, __is_trivially_destructible(_Tp)> {}; | |
| 3027 | ||
| 3028 | #elif __has_feature(has_trivial_destructor) || defined(_LIBCPP_COMPILER_GCC) | |
| 3687 | 3029 | |
| 3688 | 3030 | template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_trivially_destructible |
| 3689 | 3031 | : public integral_constant<bool, is_destructible<_Tp>::value && __has_trivial_destructor(_Tp)> {}; |
| ... | ... | @@ -3710,19 +3052,14 @@ _LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_trivially_destructible_v |
| 3710 | 3052 | |
| 3711 | 3053 | // is_nothrow_constructible |
| 3712 | 3054 | |
| 3713 | #if 0 | |
| 3055 | #if __has_keyword(__is_nothrow_constructible) | |
| 3056 | ||
| 3714 | 3057 | template <class _Tp, class... _Args> |
| 3715 | 3058 | struct _LIBCPP_TEMPLATE_VIS is_nothrow_constructible |
| 3716 | : public integral_constant<bool, __is_nothrow_constructible(_Tp(_Args...))> | |
| 3717 | { | |
| 3718 | }; | |
| 3059 | : public integral_constant<bool, __is_nothrow_constructible(_Tp, _Args...)> {}; | |
| 3719 | 3060 | |
| 3720 | 3061 | #else |
| 3721 | 3062 | |
| 3722 | #ifndef _LIBCPP_HAS_NO_VARIADICS | |
| 3723 | ||
| 3724 | #if __has_feature(cxx_noexcept) || (_GNUC_VER >= 407 && __cplusplus >= 201103L) | |
| 3725 | ||
| 3726 | 3063 | template <bool, bool, class _Tp, class... _Args> struct __libcpp_is_nothrow_constructible; |
| 3727 | 3064 | |
| 3728 | 3065 | template <class _Tp, class... _Args> |
| ... | ... | @@ -3758,117 +3095,10 @@ struct _LIBCPP_TEMPLATE_VIS is_nothrow_constructible<_Tp[_Ns]> |
| 3758 | 3095 | { |
| 3759 | 3096 | }; |
| 3760 | 3097 | |
| 3761 | #else // __has_feature(cxx_noexcept) | |
| 3762 | ||
| 3763 | template <class _Tp, class... _Args> | |
| 3764 | struct _LIBCPP_TEMPLATE_VIS is_nothrow_constructible | |
| 3765 | : false_type | |
| 3766 | { | |
| 3767 | }; | |
| 3768 | ||
| 3769 | template <class _Tp> | |
| 3770 | struct _LIBCPP_TEMPLATE_VIS is_nothrow_constructible<_Tp> | |
| 3771 | #if __has_feature(has_nothrow_constructor) || (_GNUC_VER >= 403) | |
| 3772 | : integral_constant<bool, __has_nothrow_constructor(_Tp)> | |
| 3773 | #else | |
| 3774 | : integral_constant<bool, is_scalar<_Tp>::value> | |
| 3775 | #endif | |
| 3776 | { | |
| 3777 | }; | |
| 3778 | ||
| 3779 | template <class _Tp> | |
| 3780 | #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES | |
| 3781 | struct _LIBCPP_TEMPLATE_VIS is_nothrow_constructible<_Tp, _Tp&&> | |
| 3782 | #else | |
| 3783 | struct _LIBCPP_TEMPLATE_VIS is_nothrow_constructible<_Tp, _Tp> | |
| 3784 | #endif | |
| 3785 | #if __has_feature(has_nothrow_copy) || (_GNUC_VER >= 403) | |
| 3786 | : integral_constant<bool, __has_nothrow_copy(_Tp)> | |
| 3787 | #else | |
| 3788 | : integral_constant<bool, is_scalar<_Tp>::value> | |
| 3789 | #endif | |
| 3790 | { | |
| 3791 | }; | |
| 3792 | ||
| 3793 | template <class _Tp> | |
| 3794 | struct _LIBCPP_TEMPLATE_VIS is_nothrow_constructible<_Tp, const _Tp&> | |
| 3795 | #if __has_feature(has_nothrow_copy) || (_GNUC_VER >= 403) | |
| 3796 | : integral_constant<bool, __has_nothrow_copy(_Tp)> | |
| 3797 | #else | |
| 3798 | : integral_constant<bool, is_scalar<_Tp>::value> | |
| 3799 | #endif | |
| 3800 | { | |
| 3801 | }; | |
| 3802 | ||
| 3803 | template <class _Tp> | |
| 3804 | struct _LIBCPP_TEMPLATE_VIS is_nothrow_constructible<_Tp, _Tp&> | |
| 3805 | #if __has_feature(has_nothrow_copy) || (_GNUC_VER >= 403) | |
| 3806 | : integral_constant<bool, __has_nothrow_copy(_Tp)> | |
| 3807 | #else | |
| 3808 | : integral_constant<bool, is_scalar<_Tp>::value> | |
| 3809 | #endif | |
| 3810 | { | |
| 3811 | }; | |
| 3812 | ||
| 3813 | #endif // __has_feature(cxx_noexcept) | |
| 3814 | ||
| 3815 | #else // _LIBCPP_HAS_NO_VARIADICS | |
| 3816 | ||
| 3817 | template <class _Tp, class _A0 = __is_construct::__nat, | |
| 3818 | class _A1 = __is_construct::__nat> | |
| 3819 | struct _LIBCPP_TEMPLATE_VIS is_nothrow_constructible | |
| 3820 | : false_type | |
| 3821 | { | |
| 3822 | }; | |
| 3823 | ||
| 3824 | template <class _Tp> | |
| 3825 | struct _LIBCPP_TEMPLATE_VIS is_nothrow_constructible<_Tp, __is_construct::__nat, | |
| 3826 | __is_construct::__nat> | |
| 3827 | #if __has_feature(has_nothrow_constructor) || (_GNUC_VER >= 403) | |
| 3828 | : integral_constant<bool, __has_nothrow_constructor(_Tp)> | |
| 3829 | #else | |
| 3830 | : integral_constant<bool, is_scalar<_Tp>::value> | |
| 3831 | #endif | |
| 3832 | { | |
| 3833 | }; | |
| 3834 | ||
| 3835 | template <class _Tp> | |
| 3836 | struct _LIBCPP_TEMPLATE_VIS is_nothrow_constructible<_Tp, _Tp, | |
| 3837 | __is_construct::__nat> | |
| 3838 | #if __has_feature(has_nothrow_copy) || (_GNUC_VER >= 403) | |
| 3839 | : integral_constant<bool, __has_nothrow_copy(_Tp)> | |
| 3840 | #else | |
| 3841 | : integral_constant<bool, is_scalar<_Tp>::value> | |
| 3842 | #endif | |
| 3843 | { | |
| 3844 | }; | |
| 3845 | ||
| 3846 | template <class _Tp> | |
| 3847 | struct _LIBCPP_TEMPLATE_VIS is_nothrow_constructible<_Tp, const _Tp&, | |
| 3848 | __is_construct::__nat> | |
| 3849 | #if __has_feature(has_nothrow_copy) || (_GNUC_VER >= 403) | |
| 3850 | : integral_constant<bool, __has_nothrow_copy(_Tp)> | |
| 3851 | #else | |
| 3852 | : integral_constant<bool, is_scalar<_Tp>::value> | |
| 3853 | #endif | |
| 3854 | { | |
| 3855 | }; | |
| 3856 | ||
| 3857 | template <class _Tp> | |
| 3858 | struct _LIBCPP_TEMPLATE_VIS is_nothrow_constructible<_Tp, _Tp&, | |
| 3859 | __is_construct::__nat> | |
| 3860 | #if __has_feature(has_nothrow_copy) || (_GNUC_VER >= 403) | |
| 3861 | : integral_constant<bool, __has_nothrow_copy(_Tp)> | |
| 3862 | #else | |
| 3863 | : integral_constant<bool, is_scalar<_Tp>::value> | |
| 3864 | #endif | |
| 3865 | { | |
| 3866 | }; | |
| 3098 | #endif // _LIBCPP_HAS_NO_NOEXCEPT | |
| 3867 | 3099 | |
| 3868 | #endif // _LIBCPP_HAS_NO_VARIADICS | |
| 3869 | #endif // __has_feature(is_nothrow_constructible) | |
| 3870 | 3100 | |
| 3871 | #if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) && !defined(_LIBCPP_HAS_NO_VARIADICS) | |
| 3101 | #if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) | |
| 3872 | 3102 | template <class _Tp, class ..._Args> |
| 3873 | 3103 | _LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_nothrow_constructible_v |
| 3874 | 3104 | = is_nothrow_constructible<_Tp, _Args...>::value; |
| ... | ... | @@ -3901,11 +3131,7 @@ _LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_nothrow_copy_constructible_v |
| 3901 | 3131 | // is_nothrow_move_constructible |
| 3902 | 3132 | |
| 3903 | 3133 | template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_nothrow_move_constructible |
| 3904 | #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES | |
| 3905 | 3134 | : public is_nothrow_constructible<_Tp, typename add_rvalue_reference<_Tp>::type> |
| 3906 | #else | |
| 3907 | : public is_nothrow_copy_constructible<_Tp> | |
| 3908 | #endif | |
| 3909 | 3135 | {}; |
| 3910 | 3136 | |
| 3911 | 3137 | #if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) |
| ... | ... | @@ -3916,7 +3142,13 @@ _LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_nothrow_move_constructible_v |
| 3916 | 3142 | |
| 3917 | 3143 | // is_nothrow_assignable |
| 3918 | 3144 | |
| 3919 | #if __has_feature(cxx_noexcept) || (_GNUC_VER >= 407 && __cplusplus >= 201103L) | |
| 3145 | #if __has_keyword(__is_nothrow_assignable) | |
| 3146 | ||
| 3147 | template <class _Tp, class _Arg> | |
| 3148 | struct _LIBCPP_TEMPLATE_VIS is_nothrow_assignable | |
| 3149 | : public integral_constant<bool, __is_nothrow_assignable(_Tp, _Arg)> {}; | |
| 3150 | ||
| 3151 | #else | |
| 3920 | 3152 | |
| 3921 | 3153 | template <bool, class _Tp, class _Arg> struct __libcpp_is_nothrow_assignable; |
| 3922 | 3154 | |
| ... | ... | @@ -3938,49 +3170,7 @@ struct _LIBCPP_TEMPLATE_VIS is_nothrow_assignable |
| 3938 | 3170 | { |
| 3939 | 3171 | }; |
| 3940 | 3172 | |
| 3941 | #else // __has_feature(cxx_noexcept) | |
| 3942 | ||
| 3943 | template <class _Tp, class _Arg> | |
| 3944 | struct _LIBCPP_TEMPLATE_VIS is_nothrow_assignable | |
| 3945 | : public false_type {}; | |
| 3946 | ||
| 3947 | template <class _Tp> | |
| 3948 | struct _LIBCPP_TEMPLATE_VIS is_nothrow_assignable<_Tp&, _Tp> | |
| 3949 | #if __has_feature(has_nothrow_assign) || (_GNUC_VER >= 403) | |
| 3950 | : integral_constant<bool, __has_nothrow_assign(_Tp)> {}; | |
| 3951 | #else | |
| 3952 | : integral_constant<bool, is_scalar<_Tp>::value> {}; | |
| 3953 | #endif | |
| 3954 | ||
| 3955 | template <class _Tp> | |
| 3956 | struct _LIBCPP_TEMPLATE_VIS is_nothrow_assignable<_Tp&, _Tp&> | |
| 3957 | #if __has_feature(has_nothrow_assign) || (_GNUC_VER >= 403) | |
| 3958 | : integral_constant<bool, __has_nothrow_assign(_Tp)> {}; | |
| 3959 | #else | |
| 3960 | : integral_constant<bool, is_scalar<_Tp>::value> {}; | |
| 3961 | #endif | |
| 3962 | ||
| 3963 | template <class _Tp> | |
| 3964 | struct _LIBCPP_TEMPLATE_VIS is_nothrow_assignable<_Tp&, const _Tp&> | |
| 3965 | #if __has_feature(has_nothrow_assign) || (_GNUC_VER >= 403) | |
| 3966 | : integral_constant<bool, __has_nothrow_assign(_Tp)> {}; | |
| 3967 | #else | |
| 3968 | : integral_constant<bool, is_scalar<_Tp>::value> {}; | |
| 3969 | #endif | |
| 3970 | ||
| 3971 | #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES | |
| 3972 | ||
| 3973 | template <class _Tp> | |
| 3974 | struct is_nothrow_assignable<_Tp&, _Tp&&> | |
| 3975 | #if __has_feature(has_nothrow_assign) || (_GNUC_VER >= 403) | |
| 3976 | : integral_constant<bool, __has_nothrow_assign(_Tp)> {}; | |
| 3977 | #else | |
| 3978 | : integral_constant<bool, is_scalar<_Tp>::value> {}; | |
| 3979 | #endif | |
| 3980 | ||
| 3981 | #endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES | |
| 3982 | ||
| 3983 | #endif // __has_feature(cxx_noexcept) | |
| 3173 | #endif // _LIBCPP_HAS_NO_NOEXCEPT | |
| 3984 | 3174 | |
| 3985 | 3175 | #if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) |
| 3986 | 3176 | template <class _Tp, class _Arg> |
| ... | ... | @@ -4004,11 +3194,7 @@ _LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_nothrow_copy_assignable_v |
| 4004 | 3194 | |
| 4005 | 3195 | template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_nothrow_move_assignable |
| 4006 | 3196 | : public is_nothrow_assignable<typename add_lvalue_reference<_Tp>::type, |
| 4007 | #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES | |
| 4008 | 3197 | typename add_rvalue_reference<_Tp>::type> |
| 4009 | #else | |
| 4010 | typename add_lvalue_reference<_Tp>::type> | |
| 4011 | #endif | |
| 4012 | 3198 | {}; |
| 4013 | 3199 | |
| 4014 | 3200 | #if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) |
| ... | ... | @@ -4019,7 +3205,7 @@ _LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_nothrow_move_assignable_v |
| 4019 | 3205 | |
| 4020 | 3206 | // is_nothrow_destructible |
| 4021 | 3207 | |
| 4022 | #if __has_feature(cxx_noexcept) || (_GNUC_VER >= 407 && __cplusplus >= 201103L) | |
| 3208 | #if !defined(_LIBCPP_CXX03_LANG) | |
| 4023 | 3209 | |
| 4024 | 3210 | template <bool, class _Tp> struct __libcpp_is_nothrow_destructible; |
| 4025 | 3211 | |
| ... | ... | @@ -4053,16 +3239,12 @@ struct _LIBCPP_TEMPLATE_VIS is_nothrow_destructible<_Tp&> |
| 4053 | 3239 | { |
| 4054 | 3240 | }; |
| 4055 | 3241 | |
| 4056 | #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES | |
| 4057 | ||
| 4058 | 3242 | template <class _Tp> |
| 4059 | 3243 | struct _LIBCPP_TEMPLATE_VIS is_nothrow_destructible<_Tp&&> |
| 4060 | 3244 | : public true_type |
| 4061 | 3245 | { |
| 4062 | 3246 | }; |
| 4063 | 3247 | |
| 4064 | #endif | |
| 4065 | ||
| 4066 | 3248 | #else |
| 4067 | 3249 | |
| 4068 | 3250 | template <class _Tp> struct __libcpp_nothrow_destructor |
| ... | ... | @@ -4086,7 +3268,7 @@ _LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_nothrow_destructible_v |
| 4086 | 3268 | |
| 4087 | 3269 | // is_pod |
| 4088 | 3270 | |
| 4089 | #if __has_feature(is_pod) || (_GNUC_VER >= 403) | |
| 3271 | #if __has_feature(is_pod) || defined(_LIBCPP_COMPILER_GCC) | |
| 4090 | 3272 | |
| 4091 | 3273 | template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_pod |
| 4092 | 3274 | : public integral_constant<bool, __is_pod(_Tp)> {}; |
| ... | ... | @@ -4110,12 +3292,7 @@ _LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_pod_v |
| 4110 | 3292 | // is_literal_type; |
| 4111 | 3293 | |
| 4112 | 3294 | template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_literal_type |
| 4113 | #ifdef _LIBCPP_IS_LITERAL | |
| 4114 | : public integral_constant<bool, _LIBCPP_IS_LITERAL(_Tp)> | |
| 4115 | #else | |
| 4116 | : integral_constant<bool, is_scalar<typename remove_all_extents<_Tp>::type>::value || | |
| 4117 | is_reference<typename remove_all_extents<_Tp>::type>::value> | |
| 4118 | #endif | |
| 3295 | : public integral_constant<bool, __is_literal_type(_Tp)> | |
| 4119 | 3296 | {}; |
| 4120 | 3297 | |
| 4121 | 3298 | #if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) |
| ... | ... | @@ -4127,7 +3304,7 @@ _LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_literal_type_v |
| 4127 | 3304 | // is_standard_layout; |
| 4128 | 3305 | |
| 4129 | 3306 | template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_standard_layout |
| 4130 | #if __has_feature(is_standard_layout) || (_GNUC_VER >= 407) | |
| 3307 | #if __has_feature(is_standard_layout) || defined(_LIBCPP_COMPILER_GCC) | |
| 4131 | 3308 | : public integral_constant<bool, __is_standard_layout(_Tp)> |
| 4132 | 3309 | #else |
| 4133 | 3310 | : integral_constant<bool, is_scalar<typename remove_all_extents<_Tp>::type>::value> |
| ... | ... | @@ -4161,7 +3338,7 @@ _LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_trivially_copyable_v |
| 4161 | 3338 | // is_trivial; |
| 4162 | 3339 | |
| 4163 | 3340 | template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_trivial |
| 4164 | #if __has_feature(is_trivial) || _GNUC_VER >= 407 | |
| 3341 | #if __has_feature(is_trivial) || defined(_LIBCPP_COMPILER_GCC) | |
| 4165 | 3342 | : public integral_constant<bool, __is_trivial(_Tp)> |
| 4166 | 3343 | #else |
| 4167 | 3344 | : integral_constant<bool, is_trivially_copyable<_Tp>::value && |
| ... | ... | @@ -4361,28 +3538,31 @@ _LIBCPP_INVOKE_RETURN(_VSTD::forward<_Fp>(__f)(_VSTD::forward<_Args>(__args)...) |
| 4361 | 3538 | #undef _LIBCPP_INVOKE_RETURN |
| 4362 | 3539 | |
| 4363 | 3540 | // __invokable |
| 4364 | ||
| 4365 | 3541 | template <class _Ret, class _Fp, class ..._Args> |
| 4366 | 3542 | struct __invokable_r |
| 4367 | 3543 | { |
| 4368 | // FIXME: Check that _Ret, _Fp, and _Args... are all complete types, cv void, | |
| 4369 | // or incomplete array types as required by the standard. | |
| 4370 | using _Result = decltype( | |
| 4371 | _VSTD::__invoke(_VSTD::declval<_Fp>(), _VSTD::declval<_Args>()...)); | |
| 3544 | template <class _XFp, class ..._XArgs> | |
| 3545 | static auto __try_call(int) -> decltype( | |
| 3546 | _VSTD::__invoke(_VSTD::declval<_XFp>(), _VSTD::declval<_XArgs>()...)); | |
| 3547 | template <class _XFp, class ..._XArgs> | |
| 3548 | static __nat __try_call(...); | |
| 4372 | 3549 | |
| 4373 | using type = | |
| 4374 | typename conditional< | |
| 4375 | !is_same<_Result, __nat>::value, | |
| 4376 | typename conditional< | |
| 4377 | is_void<_Ret>::value, | |
| 4378 | true_type, | |
| 4379 | is_convertible<_Result, _Ret> | |
| 4380 | >::type, | |
| 4381 | false_type | |
| 4382 | >::type; | |
| 4383 | static const bool value = type::value; | |
| 4384 | }; | |
| 3550 | // FIXME: Check that _Ret, _Fp, and _Args... are all complete types, cv void, | |
| 3551 | // or incomplete array types as required by the standard. | |
| 3552 | using _Result = decltype(__try_call<_Fp, _Args...>(0)); | |
| 4385 | 3553 | |
| 3554 | using type = | |
| 3555 | typename conditional< | |
| 3556 | _IsNotSame<_Result, __nat>::value, | |
| 3557 | typename conditional< | |
| 3558 | is_void<_Ret>::value, | |
| 3559 | true_type, | |
| 3560 | is_convertible<_Result, _Ret> | |
| 3561 | >::type, | |
| 3562 | false_type | |
| 3563 | >::type; | |
| 3564 | static const bool value = type::value; | |
| 3565 | }; | |
| 4386 | 3566 | template <class _Fp, class ..._Args> |
| 4387 | 3567 | using __invokable = __invokable_r<void, _Fp, _Args...>; |
| 4388 | 3568 | |
| ... | ... | @@ -4512,6 +3692,7 @@ typename enable_if |
| 4512 | 3692 | #else |
| 4513 | 3693 | void |
| 4514 | 3694 | #endif |
| 3695 | _LIBCPP_CONSTEXPR_AFTER_CXX17 | |
| 4515 | 3696 | swap(_Tp& __x, _Tp& __y) _NOEXCEPT_(is_nothrow_move_constructible<_Tp>::value && |
| 4516 | 3697 | is_nothrow_move_assignable<_Tp>::value) |
| 4517 | 3698 | { |
| ... | ... | @@ -4521,14 +3702,14 @@ swap(_Tp& __x, _Tp& __y) _NOEXCEPT_(is_nothrow_move_constructible<_Tp>::value && |
| 4521 | 3702 | } |
| 4522 | 3703 | |
| 4523 | 3704 | template<class _Tp, size_t _Np> |
| 4524 | inline _LIBCPP_INLINE_VISIBILITY | |
| 3705 | inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 | |
| 4525 | 3706 | typename enable_if< |
| 4526 | 3707 | __is_swappable<_Tp>::value |
| 4527 | 3708 | >::type |
| 4528 | 3709 | swap(_Tp (&__a)[_Np], _Tp (&__b)[_Np]) _NOEXCEPT_(__is_nothrow_swappable<_Tp>::value); |
| 4529 | 3710 | |
| 4530 | 3711 | template <class _ForwardIterator1, class _ForwardIterator2> |
| 4531 | inline _LIBCPP_INLINE_VISIBILITY | |
| 3712 | inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 | |
| 4532 | 3713 | void |
| 4533 | 3714 | iter_swap(_ForwardIterator1 __a, _ForwardIterator2 __b) |
| 4534 | 3715 | // _NOEXCEPT_(_NOEXCEPT_(swap(*__a, *__b))) |
| ... | ... | @@ -4558,8 +3739,8 @@ struct __swappable_with |
| 4558 | 3739 | typedef decltype((__test_swap<_Tp, _Up>(0))) __swap1; |
| 4559 | 3740 | typedef decltype((__test_swap<_Up, _Tp>(0))) __swap2; |
| 4560 | 3741 | |
| 4561 | static const bool value = !is_same<__swap1, __nat>::value | |
| 4562 | && !is_same<__swap2, __nat>::value; | |
| 3742 | static const bool value = _IsNotSame<__swap1, __nat>::value | |
| 3743 | && _IsNotSame<__swap2, __nat>::value; | |
| 4563 | 3744 | }; |
| 4564 | 3745 | |
| 4565 | 3746 | template <class _Tp, class _Up> |
| ... | ... | @@ -4649,30 +3830,24 @@ _LIBCPP_INLINE_VAR constexpr bool is_nothrow_swappable_v |
| 4649 | 3830 | |
| 4650 | 3831 | #endif // _LIBCPP_STD_VER > 14 |
| 4651 | 3832 | |
| 4652 | #ifdef _LIBCPP_UNDERLYING_TYPE | |
| 3833 | template <class _Tp, bool = is_enum<_Tp>::value> struct __underlying_type_impl; | |
| 3834 | ||
| 3835 | template <class _Tp> | |
| 3836 | struct __underlying_type_impl<_Tp, false> {}; | |
| 4653 | 3837 | |
| 4654 | 3838 | template <class _Tp> |
| 4655 | struct underlying_type | |
| 3839 | struct __underlying_type_impl<_Tp, true> | |
| 4656 | 3840 | { |
| 4657 | typedef _LIBCPP_UNDERLYING_TYPE(_Tp) type; | |
| 3841 | typedef __underlying_type(_Tp) type; | |
| 4658 | 3842 | }; |
| 4659 | 3843 | |
| 3844 | template <class _Tp> | |
| 3845 | struct underlying_type : __underlying_type_impl<_Tp, is_enum<_Tp>::value> {}; | |
| 3846 | ||
| 4660 | 3847 | #if _LIBCPP_STD_VER > 11 |
| 4661 | 3848 | template <class _Tp> using underlying_type_t = typename underlying_type<_Tp>::type; |
| 4662 | 3849 | #endif |
| 4663 | 3850 | |
| 4664 | #else // _LIBCPP_UNDERLYING_TYPE | |
| 4665 | ||
| 4666 | template <class _Tp, bool _Support = false> | |
| 4667 | struct underlying_type | |
| 4668 | { | |
| 4669 | static_assert(_Support, "The underyling_type trait requires compiler " | |
| 4670 | "support. Either no such support exists or " | |
| 4671 | "libc++ does not know how to use it."); | |
| 4672 | }; | |
| 4673 | ||
| 4674 | #endif // _LIBCPP_UNDERLYING_TYPE | |
| 4675 | ||
| 4676 | 3851 | |
| 4677 | 3852 | template <class _Tp, bool = is_enum<_Tp>::value> |
| 4678 | 3853 | struct __sfinae_underlying_type |
| ... | ... | @@ -4758,25 +3933,23 @@ struct __has_operator_addressof |
| 4758 | 3933 | |
| 4759 | 3934 | template <class...> using void_t = void; |
| 4760 | 3935 | |
| 4761 | # ifndef _LIBCPP_HAS_NO_VARIADICS | |
| 4762 | 3936 | template <class... _Args> |
| 4763 | struct conjunction : __and_<_Args...> {}; | |
| 3937 | struct conjunction : _And<_Args...> {}; | |
| 4764 | 3938 | template<class... _Args> |
| 4765 | 3939 | _LIBCPP_INLINE_VAR constexpr bool conjunction_v |
| 4766 | 3940 | = conjunction<_Args...>::value; |
| 4767 | 3941 | |
| 4768 | 3942 | template <class... _Args> |
| 4769 | struct disjunction : __or_<_Args...> {}; | |
| 3943 | struct disjunction : _Or<_Args...> {}; | |
| 4770 | 3944 | template<class... _Args> |
| 4771 | 3945 | _LIBCPP_INLINE_VAR constexpr bool disjunction_v |
| 4772 | 3946 | = disjunction<_Args...>::value; |
| 4773 | 3947 | |
| 4774 | 3948 | template <class _Tp> |
| 4775 | struct negation : __not_<_Tp> {}; | |
| 3949 | struct negation : _Not<_Tp> {}; | |
| 4776 | 3950 | template<class _Tp> |
| 4777 | 3951 | _LIBCPP_INLINE_VAR constexpr bool negation_v |
| 4778 | 3952 | = negation<_Tp>::value; |
| 4779 | # endif // _LIBCPP_HAS_NO_VARIADICS | |
| 4780 | 3953 | #endif // _LIBCPP_STD_VER > 14 |
| 4781 | 3954 | |
| 4782 | 3955 | // These traits are used in __tree and __hash_table |
| ... | ... | @@ -4788,12 +3961,12 @@ struct __extract_key_first_tag {}; |
| 4788 | 3961 | template <class _ValTy, class _Key, |
| 4789 | 3962 | class _RawValTy = typename __unconstref<_ValTy>::type> |
| 4790 | 3963 | struct __can_extract_key |
| 4791 | : conditional<is_same<_RawValTy, _Key>::value, __extract_key_self_tag, | |
| 3964 | : conditional<_IsSame<_RawValTy, _Key>::value, __extract_key_self_tag, | |
| 4792 | 3965 | __extract_key_fail_tag>::type {}; |
| 4793 | 3966 | |
| 4794 | 3967 | template <class _Pair, class _Key, class _First, class _Second> |
| 4795 | 3968 | struct __can_extract_key<_Pair, _Key, pair<_First, _Second>> |
| 4796 | : conditional<is_same<typename remove_const<_First>::type, _Key>::value, | |
| 3969 | : conditional<_IsSame<typename remove_const<_First>::type, _Key>::value, | |
| 4797 | 3970 | __extract_key_first_tag, __extract_key_fail_tag>::type {}; |
| 4798 | 3971 | |
| 4799 | 3972 | // __can_extract_map_key uses true_type/false_type instead of the tags. |
| ... | ... | @@ -4802,7 +3975,7 @@ struct __can_extract_key<_Pair, _Key, pair<_First, _Second>> |
| 4802 | 3975 | template <class _ValTy, class _Key, class _ContainerValueTy, |
| 4803 | 3976 | class _RawValTy = typename __unconstref<_ValTy>::type> |
| 4804 | 3977 | struct __can_extract_map_key |
| 4805 | : integral_constant<bool, is_same<_RawValTy, _Key>::value> {}; | |
| 3978 | : integral_constant<bool, _IsSame<_RawValTy, _Key>::value> {}; | |
| 4806 | 3979 | |
| 4807 | 3980 | // This specialization returns __extract_key_fail_tag for non-map containers |
| 4808 | 3981 | // because _Key == _ContainerValueTy |
| ... | ... | @@ -4827,6 +4000,24 @@ enum class endian |
| 4827 | 4000 | }; |
| 4828 | 4001 | #endif |
| 4829 | 4002 | |
| 4003 | #ifndef _LIBCPP_HAS_NO_BUILTIN_IS_CONSTANT_EVALUATED | |
| 4004 | #if _LIBCPP_STD_VER > 17 | |
| 4005 | _LIBCPP_INLINE_VISIBILITY | |
| 4006 | inline constexpr bool is_constant_evaluated() noexcept { | |
| 4007 | return __builtin_is_constant_evaluated(); | |
| 4008 | } | |
| 4009 | #endif | |
| 4010 | ||
| 4011 | inline _LIBCPP_CONSTEXPR | |
| 4012 | bool __libcpp_is_constant_evaluated() _NOEXCEPT { return __builtin_is_constant_evaluated(); } | |
| 4013 | #else | |
| 4014 | inline _LIBCPP_CONSTEXPR | |
| 4015 | bool __libcpp_is_constant_evaluated() _NOEXCEPT { return false; } | |
| 4016 | #endif | |
| 4017 | ||
| 4018 | template <class _CharT> | |
| 4019 | using _IsCharLikeType = _And<is_standard_layout<_CharT>, is_trivial<_CharT> >; | |
| 4020 | ||
| 4830 | 4021 | _LIBCPP_END_NAMESPACE_STD |
| 4831 | 4022 | |
| 4832 | 4023 | #if _LIBCPP_STD_VER > 14 |
lib/libcxx/include/typeindex+3-4| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===-------------------------- typeindex ---------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 |
lib/libcxx/include/typeinfo+190-76| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===-------------------------- typeinfo ----------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 | |
| ... | ... | @@ -69,59 +68,32 @@ public: |
| 69 | 68 | #pragma GCC system_header |
| 70 | 69 | #endif |
| 71 | 70 | |
| 72 | #if defined(_LIBCPP_ABI_MICROSOFT) && !defined(_LIBCPP_NO_VCRUNTIME) | |
| 71 | #if defined(_LIBCPP_ABI_VCRUNTIME) | |
| 73 | 72 | #include <vcruntime_typeinfo.h> |
| 74 | 73 | #else |
| 75 | 74 | |
| 76 | #if defined(_LIBCPP_NONUNIQUE_RTTI_BIT) && !defined(_LIBCPP_ABI_MICROSOFT) | |
| 77 | # define _LIBCPP_HAS_NONUNIQUE_TYPEINFO | |
| 78 | #endif | |
| 79 | ||
| 80 | 75 | namespace std // purposefully not using versioning namespace |
| 81 | 76 | { |
| 82 | 77 | |
| 78 | ||
| 79 | #if defined(_LIBCPP_ABI_MICROSOFT) | |
| 80 | ||
| 83 | 81 | class _LIBCPP_EXCEPTION_ABI type_info |
| 84 | 82 | { |
| 85 | 83 | type_info& operator=(const type_info&); |
| 86 | 84 | type_info(const type_info&); |
| 87 | 85 | |
| 88 | #if defined(_LIBCPP_HAS_NONUNIQUE_TYPEINFO) | |
| 89 | _LIBCPP_INLINE_VISIBILITY | |
| 90 | int __compare_nonunique_names(const type_info &__arg) const _NOEXCEPT | |
| 91 | { return __builtin_strcmp(name(), __arg.name()); } | |
| 92 | #endif | |
| 93 | ||
| 94 | #if defined(_LIBCPP_ABI_MICROSOFT) | |
| 95 | 86 | mutable struct { |
| 96 | 87 | const char *__undecorated_name; |
| 97 | 88 | const char __decorated_name[1]; |
| 98 | 89 | } __data; |
| 99 | 90 | |
| 100 | 91 | int __compare(const type_info &__rhs) const _NOEXCEPT; |
| 101 | #endif // _LIBCPP_ABI_MICROSOFT | |
| 102 | ||
| 103 | protected: | |
| 104 | #if !defined(_LIBCPP_ABI_MICROSOFT) | |
| 105 | #if defined(_LIBCPP_HAS_NONUNIQUE_TYPEINFO) | |
| 106 | // A const char* with the non-unique RTTI bit possibly set. | |
| 107 | uintptr_t __type_name; | |
| 108 | ||
| 109 | _LIBCPP_INLINE_VISIBILITY | |
| 110 | explicit type_info(const char* __n) | |
| 111 | : __type_name(reinterpret_cast<uintptr_t>(__n)) {} | |
| 112 | #else | |
| 113 | const char *__type_name; | |
| 114 | ||
| 115 | _LIBCPP_INLINE_VISIBILITY | |
| 116 | explicit type_info(const char* __n) : __type_name(__n) {} | |
| 117 | #endif | |
| 118 | #endif // ! _LIBCPP_ABI_MICROSOFT | |
| 119 | 92 | |
| 120 | 93 | public: |
| 121 | 94 | _LIBCPP_AVAILABILITY_TYPEINFO_VTABLE |
| 122 | 95 | virtual ~type_info(); |
| 123 | 96 | |
| 124 | #if defined(_LIBCPP_ABI_MICROSOFT) | |
| 125 | 97 | const char *name() const _NOEXCEPT; |
| 126 | 98 | |
| 127 | 99 | _LIBCPP_INLINE_VISIBILITY |
| ... | ... | @@ -135,91 +107,233 @@ public: |
| 135 | 107 | bool operator==(const type_info& __arg) const _NOEXCEPT { |
| 136 | 108 | return __compare(__arg) == 0; |
| 137 | 109 | } |
| 138 | #else | |
| 139 | #if defined(_LIBCPP_HAS_NONUNIQUE_TYPEINFO) | |
| 140 | _LIBCPP_INLINE_VISIBILITY | |
| 141 | const char* name() const _NOEXCEPT | |
| 142 | { | |
| 143 | return reinterpret_cast<const char*>(__type_name & | |
| 144 | ~_LIBCPP_NONUNIQUE_RTTI_BIT); | |
| 145 | } | |
| 146 | 110 | |
| 147 | 111 | _LIBCPP_INLINE_VISIBILITY |
| 148 | bool before(const type_info& __arg) const _NOEXCEPT | |
| 149 | { | |
| 150 | if (!((__type_name & __arg.__type_name) & _LIBCPP_NONUNIQUE_RTTI_BIT)) | |
| 151 | return __type_name < __arg.__type_name; | |
| 152 | return __compare_nonunique_names(__arg) < 0; | |
| 112 | bool operator!=(const type_info& __arg) const _NOEXCEPT | |
| 113 | { return !operator==(__arg); } | |
| 114 | }; | |
| 115 | ||
| 116 | #else // !defined(_LIBCPP_ABI_MICROSOFT) | |
| 117 | ||
| 118 | // ========================================================================== // | |
| 119 | // Implementations | |
| 120 | // ========================================================================== // | |
| 121 | // ------------------------------------------------------------------------- // | |
| 122 | // Unique | |
| 123 | // ------------------------------------------------------------------------- // | |
| 124 | // This implementation of type_info assumes a unique copy of the RTTI for a | |
| 125 | // given type inside a program. This is a valid assumption when abiding to | |
| 126 | // Itanium ABI (http://itanium-cxx-abi.github.io/cxx-abi/abi.html#vtable-components). | |
| 127 | // Under this assumption, we can always compare the addresses of the type names | |
| 128 | // to implement equality-comparison of type_infos instead of having to perform | |
| 129 | // a deep string comparison. | |
| 130 | // -------------------------------------------------------------------------- // | |
| 131 | // NonUnique | |
| 132 | // -------------------------------------------------------------------------- // | |
| 133 | // This implementation of type_info does not assume there is always a unique | |
| 134 | // copy of the RTTI for a given type inside a program. For various reasons | |
| 135 | // the linker may have failed to merge every copy of a types RTTI | |
| 136 | // (For example: -Bsymbolic or llvm.org/PR37398). Under this assumption, two | |
| 137 | // type_infos are equal if their addresses are equal or if a deep string | |
| 138 | // comparison is equal. | |
| 139 | // -------------------------------------------------------------------------- // | |
| 140 | // NonUniqueARMRTTIBit | |
| 141 | // -------------------------------------------------------------------------- // | |
| 142 | // This implementation of type_info does not assume always a unique copy of | |
| 143 | // the RTTI for a given type inside a program. It packs the pointer to the | |
| 144 | // type name into a uintptr_t and reserves the high bit of that pointer (which | |
| 145 | // is assumed to be free for use under the ABI in use) to represent whether | |
| 146 | // that specific copy of the RTTI can be assumed unique inside the program. | |
| 147 | // To implement equality-comparison of type_infos, we check whether BOTH | |
| 148 | // type_infos are guaranteed unique, and if so, we simply compare the addresses | |
| 149 | // of their type names instead of doing a deep string comparison, which is | |
| 150 | // faster. If at least one of the type_infos can't guarantee uniqueness, we | |
| 151 | // have no choice but to fall back to a deep string comparison. | |
| 152 | // | |
| 153 | // This implementation is specific to ARM64 on Apple platforms. | |
| 154 | // | |
| 155 | // Note that the compiler is the one setting (or unsetting) the high bit of | |
| 156 | // the pointer when it constructs the type_info, depending on whether it can | |
| 157 | // guarantee uniqueness for that specific type_info. | |
| 158 | ||
| 159 | struct __type_info_implementations { | |
| 160 | struct __string_impl_base { | |
| 161 | typedef const char* __type_name_t; | |
| 162 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_ALWAYS_INLINE | |
| 163 | _LIBCPP_CONSTEXPR static const char* __type_name_to_string(__type_name_t __v) _NOEXCEPT { | |
| 164 | return __v; | |
| 153 | 165 | } |
| 166 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_ALWAYS_INLINE | |
| 167 | _LIBCPP_CONSTEXPR static __type_name_t __string_to_type_name(const char* __v) _NOEXCEPT { | |
| 168 | return __v; | |
| 169 | } | |
| 170 | }; | |
| 154 | 171 | |
| 155 | _LIBCPP_INLINE_VISIBILITY | |
| 156 | size_t hash_code() const _NOEXCEPT | |
| 157 | { | |
| 158 | if (!(__type_name & _LIBCPP_NONUNIQUE_RTTI_BIT)) | |
| 159 | return __type_name; | |
| 172 | struct __unique_impl : __string_impl_base { | |
| 173 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_ALWAYS_INLINE | |
| 174 | static size_t __hash(__type_name_t __v) _NOEXCEPT { | |
| 175 | return reinterpret_cast<size_t>(__v); | |
| 176 | } | |
| 177 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_ALWAYS_INLINE | |
| 178 | static bool __eq(__type_name_t __lhs, __type_name_t __rhs) _NOEXCEPT { | |
| 179 | return __lhs == __rhs; | |
| 180 | } | |
| 181 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_ALWAYS_INLINE | |
| 182 | static bool __lt(__type_name_t __lhs, __type_name_t __rhs) _NOEXCEPT { | |
| 183 | return __lhs < __rhs; | |
| 184 | } | |
| 185 | }; | |
| 160 | 186 | |
| 161 | const char* __ptr = name(); | |
| 187 | struct __non_unique_impl : __string_impl_base { | |
| 188 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_ALWAYS_INLINE | |
| 189 | static size_t __hash(__type_name_t __ptr) _NOEXCEPT { | |
| 162 | 190 | size_t __hash = 5381; |
| 163 | 191 | while (unsigned char __c = static_cast<unsigned char>(*__ptr++)) |
| 164 | 192 | __hash = (__hash * 33) ^ __c; |
| 165 | 193 | return __hash; |
| 166 | 194 | } |
| 195 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_ALWAYS_INLINE | |
| 196 | static bool __eq(__type_name_t __lhs, __type_name_t __rhs) _NOEXCEPT { | |
| 197 | return __lhs == __rhs || __builtin_strcmp(__lhs, __rhs) == 0; | |
| 198 | } | |
| 199 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_ALWAYS_INLINE | |
| 200 | static bool __lt(__type_name_t __lhs, __type_name_t __rhs) _NOEXCEPT { | |
| 201 | return __builtin_strcmp(__lhs, __rhs) < 0; | |
| 202 | } | |
| 203 | }; | |
| 167 | 204 | |
| 168 | _LIBCPP_INLINE_VISIBILITY | |
| 169 | bool operator==(const type_info& __arg) const _NOEXCEPT | |
| 170 | { | |
| 171 | if (__type_name == __arg.__type_name) | |
| 172 | return true; | |
| 205 | struct __non_unique_arm_rtti_bit_impl { | |
| 206 | typedef uintptr_t __type_name_t; | |
| 207 | ||
| 208 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_ALWAYS_INLINE | |
| 209 | static const char* __type_name_to_string(__type_name_t __v) _NOEXCEPT { | |
| 210 | return reinterpret_cast<const char*>(__v & | |
| 211 | ~__non_unique_rtti_bit::value); | |
| 212 | } | |
| 213 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_ALWAYS_INLINE | |
| 214 | static __type_name_t __string_to_type_name(const char* __v) _NOEXCEPT { | |
| 215 | return reinterpret_cast<__type_name_t>(__v); | |
| 216 | } | |
| 173 | 217 | |
| 174 | if (!((__type_name & __arg.__type_name) & _LIBCPP_NONUNIQUE_RTTI_BIT)) | |
| 218 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_ALWAYS_INLINE | |
| 219 | static size_t __hash(__type_name_t __v) _NOEXCEPT { | |
| 220 | if (__is_type_name_unique(__v)) | |
| 221 | return reinterpret_cast<size_t>(__v); | |
| 222 | return __non_unique_impl::__hash(__type_name_to_string(__v)); | |
| 223 | } | |
| 224 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_ALWAYS_INLINE | |
| 225 | static bool __eq(__type_name_t __lhs, __type_name_t __rhs) _NOEXCEPT { | |
| 226 | if (__lhs == __rhs) | |
| 227 | return true; | |
| 228 | if (__is_type_name_unique(__lhs, __rhs)) | |
| 175 | 229 | return false; |
| 176 | return __compare_nonunique_names(__arg) == 0; | |
| 230 | return __builtin_strcmp(__type_name_to_string(__lhs), __type_name_to_string(__rhs)) == 0; | |
| 231 | } | |
| 232 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_ALWAYS_INLINE | |
| 233 | static bool __lt(__type_name_t __lhs, __type_name_t __rhs) _NOEXCEPT { | |
| 234 | if (__is_type_name_unique(__lhs, __rhs)) | |
| 235 | return __lhs < __rhs; | |
| 236 | return __builtin_strcmp(__type_name_to_string(__lhs), __type_name_to_string(__rhs)) < 0; | |
| 177 | 237 | } |
| 238 | ||
| 239 | private: | |
| 240 | // The unique bit is the top bit. It is expected that __type_name_t is 64 bits when | |
| 241 | // this implementation is actually used. | |
| 242 | typedef std::integral_constant<__type_name_t, | |
| 243 | (1ULL << ((__CHAR_BIT__ * sizeof(__type_name_t)) - 1))> __non_unique_rtti_bit; | |
| 244 | ||
| 245 | _LIBCPP_INLINE_VISIBILITY | |
| 246 | static bool __is_type_name_unique(__type_name_t __lhs) _NOEXCEPT { | |
| 247 | return !(__lhs & __non_unique_rtti_bit::value); | |
| 248 | } | |
| 249 | _LIBCPP_INLINE_VISIBILITY | |
| 250 | static bool __is_type_name_unique(__type_name_t __lhs, __type_name_t __rhs) _NOEXCEPT { | |
| 251 | return !((__lhs & __rhs) & __non_unique_rtti_bit::value); | |
| 252 | } | |
| 253 | }; | |
| 254 | ||
| 255 | typedef | |
| 256 | #if defined(__APPLE__) && defined(__LP64__) && !defined(__x86_64__) | |
| 257 | __non_unique_arm_rtti_bit_impl | |
| 258 | #elif _LIBCPP_HAS_MERGED_TYPEINFO_NAMES_DEFAULT == 0 | |
| 259 | __non_unique_impl | |
| 260 | #elif _LIBCPP_HAS_MERGED_TYPEINFO_NAMES_DEFAULT == 1 | |
| 261 | __unique_impl | |
| 178 | 262 | #else |
| 263 | # error invalid configuration for _LIBCPP_HAS_MERGED_TYPEINFO_NAMES_DEFAULT | |
| 264 | #endif | |
| 265 | __impl; | |
| 266 | }; | |
| 267 | ||
| 268 | class _LIBCPP_EXCEPTION_ABI type_info | |
| 269 | { | |
| 270 | type_info& operator=(const type_info&); | |
| 271 | type_info(const type_info&); | |
| 272 | ||
| 273 | protected: | |
| 274 | typedef __type_info_implementations::__impl __impl; | |
| 275 | ||
| 276 | __impl::__type_name_t __type_name; | |
| 277 | ||
| 278 | _LIBCPP_INLINE_VISIBILITY | |
| 279 | explicit type_info(const char* __n) | |
| 280 | : __type_name(__impl::__string_to_type_name(__n)) {} | |
| 281 | ||
| 282 | public: | |
| 283 | _LIBCPP_AVAILABILITY_TYPEINFO_VTABLE | |
| 284 | virtual ~type_info(); | |
| 285 | ||
| 179 | 286 | _LIBCPP_INLINE_VISIBILITY |
| 180 | 287 | const char* name() const _NOEXCEPT |
| 181 | { return __type_name; } | |
| 288 | { | |
| 289 | return __impl::__type_name_to_string(__type_name); | |
| 290 | } | |
| 182 | 291 | |
| 183 | 292 | _LIBCPP_INLINE_VISIBILITY |
| 184 | 293 | bool before(const type_info& __arg) const _NOEXCEPT |
| 185 | { return __type_name < __arg.__type_name; } | |
| 294 | { | |
| 295 | return __impl::__lt(__type_name, __arg.__type_name); | |
| 296 | } | |
| 186 | 297 | |
| 187 | 298 | _LIBCPP_INLINE_VISIBILITY |
| 188 | 299 | size_t hash_code() const _NOEXCEPT |
| 189 | { return reinterpret_cast<size_t>(__type_name); } | |
| 300 | { | |
| 301 | return __impl::__hash(__type_name); | |
| 302 | } | |
| 190 | 303 | |
| 191 | 304 | _LIBCPP_INLINE_VISIBILITY |
| 192 | 305 | bool operator==(const type_info& __arg) const _NOEXCEPT |
| 193 | { return __type_name == __arg.__type_name; } | |
| 194 | #endif | |
| 195 | #endif // _LIBCPP_ABI_MICROSOFT | |
| 306 | { | |
| 307 | return __impl::__eq(__type_name, __arg.__type_name); | |
| 308 | } | |
| 196 | 309 | |
| 197 | 310 | _LIBCPP_INLINE_VISIBILITY |
| 198 | 311 | bool operator!=(const type_info& __arg) const _NOEXCEPT |
| 199 | 312 | { return !operator==(__arg); } |
| 200 | 313 | }; |
| 314 | #endif // defined(_LIBCPP_ABI_MICROSOFT) | |
| 201 | 315 | |
| 202 | 316 | class _LIBCPP_EXCEPTION_ABI bad_cast |
| 203 | 317 | : public exception |
| 204 | 318 | { |
| 205 | public: | |
| 206 | bad_cast() _NOEXCEPT; | |
| 207 | virtual ~bad_cast() _NOEXCEPT; | |
| 208 | virtual const char* what() const _NOEXCEPT; | |
| 319 | public: | |
| 320 | bad_cast() _NOEXCEPT; | |
| 321 | virtual ~bad_cast() _NOEXCEPT; | |
| 322 | virtual const char* what() const _NOEXCEPT; | |
| 209 | 323 | }; |
| 210 | 324 | |
| 211 | 325 | class _LIBCPP_EXCEPTION_ABI bad_typeid |
| 212 | 326 | : public exception |
| 213 | 327 | { |
| 214 | public: | |
| 215 | bad_typeid() _NOEXCEPT; | |
| 216 | virtual ~bad_typeid() _NOEXCEPT; | |
| 217 | virtual const char* what() const _NOEXCEPT; | |
| 328 | public: | |
| 329 | bad_typeid() _NOEXCEPT; | |
| 330 | virtual ~bad_typeid() _NOEXCEPT; | |
| 331 | virtual const char* what() const _NOEXCEPT; | |
| 218 | 332 | }; |
| 219 | 333 | |
| 220 | 334 | } // std |
| 221 | 335 | |
| 222 | #endif // defined(_LIBCPP_ABI_MICROSOFT) && !defined(_LIBCPP_NO_VCRUNTIME) | |
| 336 | #endif // defined(_LIBCPP_ABI_VCRUNTIME) | |
| 223 | 337 | |
| 224 | 338 | _LIBCPP_BEGIN_NAMESPACE_STD |
| 225 | 339 | _LIBCPP_NORETURN inline _LIBCPP_INLINE_VISIBILITY |
lib/libcxx/include/unordered_map+173-28| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===-------------------------- unordered_map -----------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 | |
| ... | ... | @@ -80,12 +79,12 @@ public: |
| 80 | 79 | unordered_map(InputIterator f, InputIterator l, size_type n, const allocator_type& a) |
| 81 | 80 | : unordered_map(f, l, n, hasher(), key_equal(), a) {} // C++14 |
| 82 | 81 | template <class InputIterator> |
| 83 | unordered_map(InputIterator f, InputIterator l, size_type n, const hasher& hf, | |
| 82 | unordered_map(InputIterator f, InputIterator l, size_type n, const hasher& hf, | |
| 84 | 83 | const allocator_type& a) |
| 85 | 84 | : unordered_map(f, l, n, hf, key_equal(), a) {} // C++14 |
| 86 | 85 | unordered_map(initializer_list<value_type> il, size_type n, const allocator_type& a) |
| 87 | 86 | : unordered_map(il, n, hasher(), key_equal(), a) {} // C++14 |
| 88 | unordered_map(initializer_list<value_type> il, size_type n, const hasher& hf, | |
| 87 | unordered_map(initializer_list<value_type> il, size_type n, const hasher& hf, | |
| 89 | 88 | const allocator_type& a) |
| 90 | 89 | : unordered_map(il, n, hf, key_equal(), a) {} // C++14 |
| 91 | 90 | ~unordered_map(); |
| ... | ... | @@ -175,6 +174,7 @@ public: |
| 175 | 174 | iterator find(const key_type& k); |
| 176 | 175 | const_iterator find(const key_type& k) const; |
| 177 | 176 | size_type count(const key_type& k) const; |
| 177 | bool contains(const key_type& k) const; // C++20 | |
| 178 | 178 | pair<iterator, iterator> equal_range(const key_type& k); |
| 179 | 179 | pair<const_iterator, const_iterator> equal_range(const key_type& k) const; |
| 180 | 180 | |
| ... | ... | @@ -278,12 +278,12 @@ public: |
| 278 | 278 | unordered_multimap(InputIterator f, InputIterator l, size_type n, const allocator_type& a) |
| 279 | 279 | : unordered_multimap(f, l, n, hasher(), key_equal(), a) {} // C++14 |
| 280 | 280 | template <class InputIterator> |
| 281 | unordered_multimap(InputIterator f, InputIterator l, size_type n, const hasher& hf, | |
| 281 | unordered_multimap(InputIterator f, InputIterator l, size_type n, const hasher& hf, | |
| 282 | 282 | const allocator_type& a) |
| 283 | 283 | : unordered_multimap(f, l, n, hf, key_equal(), a) {} // C++14 |
| 284 | 284 | unordered_multimap(initializer_list<value_type> il, size_type n, const allocator_type& a) |
| 285 | 285 | : unordered_multimap(il, n, hasher(), key_equal(), a) {} // C++14 |
| 286 | unordered_multimap(initializer_list<value_type> il, size_type n, const hasher& hf, | |
| 286 | unordered_multimap(initializer_list<value_type> il, size_type n, const hasher& hf, | |
| 287 | 287 | const allocator_type& a) |
| 288 | 288 | : unordered_multimap(il, n, hf, key_equal(), a) {} // C++14 |
| 289 | 289 | ~unordered_multimap(); |
| ... | ... | @@ -356,6 +356,7 @@ public: |
| 356 | 356 | iterator find(const key_type& k); |
| 357 | 357 | const_iterator find(const key_type& k) const; |
| 358 | 358 | size_type count(const key_type& k) const; |
| 359 | bool contains(const key_type& k) const; // C++20 | |
| 359 | 360 | pair<iterator, iterator> equal_range(const key_type& k); |
| 360 | 361 | pair<const_iterator, const_iterator> equal_range(const key_type& k) const; |
| 361 | 362 | |
| ... | ... | @@ -845,15 +846,14 @@ public: |
| 845 | 846 | // types |
| 846 | 847 | typedef _Key key_type; |
| 847 | 848 | typedef _Tp mapped_type; |
| 848 | typedef _Hash hasher; | |
| 849 | typedef _Pred key_equal; | |
| 850 | typedef _Alloc allocator_type; | |
| 849 | typedef typename __identity<_Hash>::type hasher; | |
| 850 | typedef typename __identity<_Pred>::type key_equal; | |
| 851 | typedef typename __identity<_Alloc>::type allocator_type; | |
| 851 | 852 | typedef pair<const key_type, mapped_type> value_type; |
| 852 | 853 | typedef value_type& reference; |
| 853 | 854 | typedef const value_type& const_reference; |
| 854 | 855 | static_assert((is_same<value_type, typename allocator_type::value_type>::value), |
| 855 | 856 | "Invalid allocator::value_type"); |
| 856 | static_assert(sizeof(__diagnose_unordered_container_requirements<_Key, _Hash, _Pred>(0)), ""); | |
| 857 | 857 | |
| 858 | 858 | private: |
| 859 | 859 | typedef __hash_value_type<key_type, mapped_type> __value_type; |
| ... | ... | @@ -953,18 +953,22 @@ public: |
| 953 | 953 | : unordered_map(__first, __last, __n, hasher(), key_equal(), __a) {} |
| 954 | 954 | template <class _InputIterator> |
| 955 | 955 | _LIBCPP_INLINE_VISIBILITY |
| 956 | unordered_map(_InputIterator __first, _InputIterator __last, size_type __n, const hasher& __hf, | |
| 956 | unordered_map(_InputIterator __first, _InputIterator __last, size_type __n, const hasher& __hf, | |
| 957 | 957 | const allocator_type& __a) |
| 958 | 958 | : unordered_map(__first, __last, __n, __hf, key_equal(), __a) {} |
| 959 | 959 | _LIBCPP_INLINE_VISIBILITY |
| 960 | 960 | unordered_map(initializer_list<value_type> __il, size_type __n, const allocator_type& __a) |
| 961 | 961 | : unordered_map(__il, __n, hasher(), key_equal(), __a) {} |
| 962 | 962 | _LIBCPP_INLINE_VISIBILITY |
| 963 | unordered_map(initializer_list<value_type> __il, size_type __n, const hasher& __hf, | |
| 963 | unordered_map(initializer_list<value_type> __il, size_type __n, const hasher& __hf, | |
| 964 | 964 | const allocator_type& __a) |
| 965 | 965 | : unordered_map(__il, __n, __hf, key_equal(), __a) {} |
| 966 | 966 | #endif |
| 967 | // ~unordered_map() = default; | |
| 967 | _LIBCPP_INLINE_VISIBILITY | |
| 968 | ~unordered_map() { | |
| 969 | static_assert(sizeof(__diagnose_unordered_container_requirements<_Key, _Hash, _Pred>(0)), ""); | |
| 970 | } | |
| 971 | ||
| 968 | 972 | _LIBCPP_INLINE_VISIBILITY |
| 969 | 973 | unordered_map& operator=(const unordered_map& __u) |
| 970 | 974 | { |
| ... | ... | @@ -1276,6 +1280,10 @@ public: |
| 1276 | 1280 | const_iterator find(const key_type& __k) const {return __table_.find(__k);} |
| 1277 | 1281 | _LIBCPP_INLINE_VISIBILITY |
| 1278 | 1282 | size_type count(const key_type& __k) const {return __table_.__count_unique(__k);} |
| 1283 | #if _LIBCPP_STD_VER > 17 | |
| 1284 | _LIBCPP_INLINE_VISIBILITY | |
| 1285 | bool contains(const key_type& __k) const {return find(__k) != end();} | |
| 1286 | #endif // _LIBCPP_STD_VER > 17 | |
| 1279 | 1287 | _LIBCPP_INLINE_VISIBILITY |
| 1280 | 1288 | pair<iterator, iterator> equal_range(const key_type& __k) |
| 1281 | 1289 | {return __table_.__equal_range_unique(__k);} |
| ... | ... | @@ -1346,6 +1354,73 @@ private: |
| 1346 | 1354 | #endif |
| 1347 | 1355 | }; |
| 1348 | 1356 | |
| 1357 | #ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES | |
| 1358 | template<class _InputIterator, | |
| 1359 | class _Hash = hash<__iter_key_type<_InputIterator>>, | |
| 1360 | class _Pred = equal_to<__iter_key_type<_InputIterator>>, | |
| 1361 | class _Allocator = allocator<__iter_to_alloc_type<_InputIterator>>, | |
| 1362 | class = _EnableIf<!__is_allocator<_Hash>::value>, | |
| 1363 | class = _EnableIf<!is_integral<_Hash>::value>, | |
| 1364 | class = _EnableIf<!__is_allocator<_Pred>::value>, | |
| 1365 | class = _EnableIf<__is_allocator<_Allocator>::value>> | |
| 1366 | unordered_map(_InputIterator, _InputIterator, typename allocator_traits<_Allocator>::size_type = 0, | |
| 1367 | _Hash = _Hash(), _Pred = _Pred(), _Allocator = _Allocator()) | |
| 1368 | -> unordered_map<__iter_key_type<_InputIterator>, __iter_mapped_type<_InputIterator>, _Hash, _Pred, _Allocator>; | |
| 1369 | ||
| 1370 | template<class _Key, class _Tp, class _Hash = hash<remove_const_t<_Key>>, | |
| 1371 | class _Pred = equal_to<remove_const_t<_Key>>, | |
| 1372 | class _Allocator = allocator<pair<const _Key, _Tp>>, | |
| 1373 | class = _EnableIf<!__is_allocator<_Hash>::value>, | |
| 1374 | class = _EnableIf<!is_integral<_Hash>::value>, | |
| 1375 | class = _EnableIf<!__is_allocator<_Pred>::value>, | |
| 1376 | class = _EnableIf<__is_allocator<_Allocator>::value>> | |
| 1377 | unordered_map(initializer_list<pair<_Key, _Tp>>, typename allocator_traits<_Allocator>::size_type = 0, | |
| 1378 | _Hash = _Hash(), _Pred = _Pred(), _Allocator = _Allocator()) | |
| 1379 | -> unordered_map<remove_const_t<_Key>, _Tp, _Hash, _Pred, _Allocator>; | |
| 1380 | ||
| 1381 | template<class _InputIterator, class _Allocator, | |
| 1382 | class = _EnableIf<__is_allocator<_Allocator>::value>> | |
| 1383 | unordered_map(_InputIterator, _InputIterator, typename allocator_traits<_Allocator>::size_type, _Allocator) | |
| 1384 | -> unordered_map<__iter_key_type<_InputIterator>, __iter_mapped_type<_InputIterator>, | |
| 1385 | hash<__iter_key_type<_InputIterator>>, equal_to<__iter_key_type<_InputIterator>>, _Allocator>; | |
| 1386 | ||
| 1387 | template<class _InputIterator, class _Allocator, | |
| 1388 | class = _EnableIf<__is_allocator<_Allocator>::value>> | |
| 1389 | unordered_map(_InputIterator, _InputIterator, _Allocator) | |
| 1390 | -> unordered_map<__iter_key_type<_InputIterator>, __iter_mapped_type<_InputIterator>, | |
| 1391 | hash<__iter_key_type<_InputIterator>>, equal_to<__iter_key_type<_InputIterator>>, _Allocator>; | |
| 1392 | ||
| 1393 | template<class _InputIterator, class _Hash, class _Allocator, | |
| 1394 | class = _EnableIf<!__is_allocator<_Hash>::value>, | |
| 1395 | class = _EnableIf<!is_integral<_Hash>::value>, | |
| 1396 | class = _EnableIf<__is_allocator<_Allocator>::value>> | |
| 1397 | unordered_map(_InputIterator, _InputIterator, typename allocator_traits<_Allocator>::size_type, _Hash, _Allocator) | |
| 1398 | -> unordered_map<__iter_key_type<_InputIterator>, __iter_mapped_type<_InputIterator>, | |
| 1399 | _Hash, equal_to<__iter_key_type<_InputIterator>>, _Allocator>; | |
| 1400 | ||
| 1401 | template<class _Key, class _Tp, class _Allocator, | |
| 1402 | class = _EnableIf<__is_allocator<_Allocator>::value>> | |
| 1403 | unordered_map(initializer_list<pair<_Key, _Tp>>, typename allocator_traits<_Allocator>::size_type, _Allocator) | |
| 1404 | -> unordered_map<remove_const_t<_Key>, _Tp, | |
| 1405 | hash<remove_const_t<_Key>>, | |
| 1406 | equal_to<remove_const_t<_Key>>, _Allocator>; | |
| 1407 | ||
| 1408 | template<class _Key, class _Tp, class _Allocator, | |
| 1409 | class = _EnableIf<__is_allocator<_Allocator>::value>> | |
| 1410 | unordered_map(initializer_list<pair<_Key, _Tp>>, _Allocator) | |
| 1411 | -> unordered_map<remove_const_t<_Key>, _Tp, | |
| 1412 | hash<remove_const_t<_Key>>, | |
| 1413 | equal_to<remove_const_t<_Key>>, _Allocator>; | |
| 1414 | ||
| 1415 | template<class _Key, class _Tp, class _Hash, class _Allocator, | |
| 1416 | class = _EnableIf<!__is_allocator<_Hash>::value>, | |
| 1417 | class = _EnableIf<!is_integral<_Hash>::value>, | |
| 1418 | class = _EnableIf<__is_allocator<_Allocator>::value>> | |
| 1419 | unordered_map(initializer_list<pair<_Key, _Tp>>, typename allocator_traits<_Allocator>::size_type, _Hash, _Allocator) | |
| 1420 | -> unordered_map<remove_const_t<_Key>, _Tp, _Hash, | |
| 1421 | equal_to<remove_const_t<_Key>>, _Allocator>; | |
| 1422 | #endif | |
| 1423 | ||
| 1349 | 1424 | template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc> |
| 1350 | 1425 | unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map( |
| 1351 | 1426 | size_type __n, const hasher& __hf, const key_equal& __eql) |
| ... | ... | @@ -1603,10 +1678,8 @@ _Tp& |
| 1603 | 1678 | unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::at(const key_type& __k) |
| 1604 | 1679 | { |
| 1605 | 1680 | iterator __i = find(__k); |
| 1606 | #ifndef _LIBCPP_NO_EXCEPTIONS | |
| 1607 | 1681 | if (__i == end()) |
| 1608 | throw out_of_range("unordered_map::at: key not found"); | |
| 1609 | #endif // _LIBCPP_NO_EXCEPTIONS | |
| 1682 | __throw_out_of_range("unordered_map::at: key not found"); | |
| 1610 | 1683 | return __i->second; |
| 1611 | 1684 | } |
| 1612 | 1685 | |
| ... | ... | @@ -1615,10 +1688,8 @@ const _Tp& |
| 1615 | 1688 | unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::at(const key_type& __k) const |
| 1616 | 1689 | { |
| 1617 | 1690 | const_iterator __i = find(__k); |
| 1618 | #ifndef _LIBCPP_NO_EXCEPTIONS | |
| 1619 | 1691 | if (__i == end()) |
| 1620 | throw out_of_range("unordered_map::at: key not found"); | |
| 1621 | #endif // _LIBCPP_NO_EXCEPTIONS | |
| 1692 | __throw_out_of_range("unordered_map::at: key not found"); | |
| 1622 | 1693 | return __i->second; |
| 1623 | 1694 | } |
| 1624 | 1695 | |
| ... | ... | @@ -1675,15 +1746,14 @@ public: |
| 1675 | 1746 | // types |
| 1676 | 1747 | typedef _Key key_type; |
| 1677 | 1748 | typedef _Tp mapped_type; |
| 1678 | typedef _Hash hasher; | |
| 1679 | typedef _Pred key_equal; | |
| 1680 | typedef _Alloc allocator_type; | |
| 1749 | typedef typename __identity<_Hash>::type hasher; | |
| 1750 | typedef typename __identity<_Pred>::type key_equal; | |
| 1751 | typedef typename __identity<_Alloc>::type allocator_type; | |
| 1681 | 1752 | typedef pair<const key_type, mapped_type> value_type; |
| 1682 | 1753 | typedef value_type& reference; |
| 1683 | 1754 | typedef const value_type& const_reference; |
| 1684 | 1755 | static_assert((is_same<value_type, typename allocator_type::value_type>::value), |
| 1685 | 1756 | "Invalid allocator::value_type"); |
| 1686 | static_assert(sizeof(__diagnose_unordered_container_requirements<_Key, _Hash, _Pred>(0)), ""); | |
| 1687 | 1757 | |
| 1688 | 1758 | private: |
| 1689 | 1759 | typedef __hash_value_type<key_type, mapped_type> __value_type; |
| ... | ... | @@ -1781,18 +1851,22 @@ public: |
| 1781 | 1851 | : unordered_multimap(__first, __last, __n, hasher(), key_equal(), __a) {} |
| 1782 | 1852 | template <class _InputIterator> |
| 1783 | 1853 | _LIBCPP_INLINE_VISIBILITY |
| 1784 | unordered_multimap(_InputIterator __first, _InputIterator __last, size_type __n, const hasher& __hf, | |
| 1854 | unordered_multimap(_InputIterator __first, _InputIterator __last, size_type __n, const hasher& __hf, | |
| 1785 | 1855 | const allocator_type& __a) |
| 1786 | 1856 | : unordered_multimap(__first, __last, __n, __hf, key_equal(), __a) {} |
| 1787 | 1857 | _LIBCPP_INLINE_VISIBILITY |
| 1788 | 1858 | unordered_multimap(initializer_list<value_type> __il, size_type __n, const allocator_type& __a) |
| 1789 | 1859 | : unordered_multimap(__il, __n, hasher(), key_equal(), __a) {} |
| 1790 | 1860 | _LIBCPP_INLINE_VISIBILITY |
| 1791 | unordered_multimap(initializer_list<value_type> __il, size_type __n, const hasher& __hf, | |
| 1861 | unordered_multimap(initializer_list<value_type> __il, size_type __n, const hasher& __hf, | |
| 1792 | 1862 | const allocator_type& __a) |
| 1793 | 1863 | : unordered_multimap(__il, __n, __hf, key_equal(), __a) {} |
| 1794 | 1864 | #endif |
| 1795 | // ~unordered_multimap() = default; | |
| 1865 | _LIBCPP_INLINE_VISIBILITY | |
| 1866 | ~unordered_multimap() { | |
| 1867 | static_assert(sizeof(__diagnose_unordered_container_requirements<_Key, _Hash, _Pred>(0)), ""); | |
| 1868 | } | |
| 1869 | ||
| 1796 | 1870 | _LIBCPP_INLINE_VISIBILITY |
| 1797 | 1871 | unordered_multimap& operator=(const unordered_multimap& __u) |
| 1798 | 1872 | { |
| ... | ... | @@ -1981,6 +2055,10 @@ public: |
| 1981 | 2055 | const_iterator find(const key_type& __k) const {return __table_.find(__k);} |
| 1982 | 2056 | _LIBCPP_INLINE_VISIBILITY |
| 1983 | 2057 | size_type count(const key_type& __k) const {return __table_.__count_multi(__k);} |
| 2058 | #if _LIBCPP_STD_VER > 17 | |
| 2059 | _LIBCPP_INLINE_VISIBILITY | |
| 2060 | bool contains(const key_type& __k) const {return find(__k) != end();} | |
| 2061 | #endif // _LIBCPP_STD_VER > 17 | |
| 1984 | 2062 | _LIBCPP_INLINE_VISIBILITY |
| 1985 | 2063 | pair<iterator, iterator> equal_range(const key_type& __k) |
| 1986 | 2064 | {return __table_.__equal_range_multi(__k);} |
| ... | ... | @@ -2040,6 +2118,73 @@ public: |
| 2040 | 2118 | |
| 2041 | 2119 | }; |
| 2042 | 2120 | |
| 2121 | #ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES | |
| 2122 | template<class _InputIterator, | |
| 2123 | class _Hash = hash<__iter_key_type<_InputIterator>>, | |
| 2124 | class _Pred = equal_to<__iter_key_type<_InputIterator>>, | |
| 2125 | class _Allocator = allocator<__iter_to_alloc_type<_InputIterator>>, | |
| 2126 | class = _EnableIf<!__is_allocator<_Hash>::value>, | |
| 2127 | class = _EnableIf<!is_integral<_Hash>::value>, | |
| 2128 | class = _EnableIf<!__is_allocator<_Pred>::value>, | |
| 2129 | class = _EnableIf<__is_allocator<_Allocator>::value>> | |
| 2130 | unordered_multimap(_InputIterator, _InputIterator, typename allocator_traits<_Allocator>::size_type = 0, | |
| 2131 | _Hash = _Hash(), _Pred = _Pred(), _Allocator = _Allocator()) | |
| 2132 | -> unordered_multimap<__iter_key_type<_InputIterator>, __iter_mapped_type<_InputIterator>, _Hash, _Pred, _Allocator>; | |
| 2133 | ||
| 2134 | template<class _Key, class _Tp, class _Hash = hash<remove_const_t<_Key>>, | |
| 2135 | class _Pred = equal_to<remove_const_t<_Key>>, | |
| 2136 | class _Allocator = allocator<pair<const _Key, _Tp>>, | |
| 2137 | class = _EnableIf<!__is_allocator<_Hash>::value>, | |
| 2138 | class = _EnableIf<!is_integral<_Hash>::value>, | |
| 2139 | class = _EnableIf<!__is_allocator<_Pred>::value>, | |
| 2140 | class = _EnableIf<__is_allocator<_Allocator>::value>> | |
| 2141 | unordered_multimap(initializer_list<pair<_Key, _Tp>>, typename allocator_traits<_Allocator>::size_type = 0, | |
| 2142 | _Hash = _Hash(), _Pred = _Pred(), _Allocator = _Allocator()) | |
| 2143 | -> unordered_multimap<remove_const_t<_Key>, _Tp, _Hash, _Pred, _Allocator>; | |
| 2144 | ||
| 2145 | template<class _InputIterator, class _Allocator, | |
| 2146 | class = _EnableIf<__is_allocator<_Allocator>::value>> | |
| 2147 | unordered_multimap(_InputIterator, _InputIterator, typename allocator_traits<_Allocator>::size_type, _Allocator) | |
| 2148 | -> unordered_multimap<__iter_key_type<_InputIterator>, __iter_mapped_type<_InputIterator>, | |
| 2149 | hash<__iter_key_type<_InputIterator>>, equal_to<__iter_key_type<_InputIterator>>, _Allocator>; | |
| 2150 | ||
| 2151 | template<class _InputIterator, class _Allocator, | |
| 2152 | class = _EnableIf<__is_allocator<_Allocator>::value>> | |
| 2153 | unordered_multimap(_InputIterator, _InputIterator, _Allocator) | |
| 2154 | -> unordered_multimap<__iter_key_type<_InputIterator>, __iter_mapped_type<_InputIterator>, | |
| 2155 | hash<__iter_key_type<_InputIterator>>, equal_to<__iter_key_type<_InputIterator>>, _Allocator>; | |
| 2156 | ||
| 2157 | template<class _InputIterator, class _Hash, class _Allocator, | |
| 2158 | class = _EnableIf<!__is_allocator<_Hash>::value>, | |
| 2159 | class = _EnableIf<!is_integral<_Hash>::value>, | |
| 2160 | class = _EnableIf<__is_allocator<_Allocator>::value>> | |
| 2161 | unordered_multimap(_InputIterator, _InputIterator, typename allocator_traits<_Allocator>::size_type, _Hash, _Allocator) | |
| 2162 | -> unordered_multimap<__iter_key_type<_InputIterator>, __iter_mapped_type<_InputIterator>, | |
| 2163 | _Hash, equal_to<__iter_key_type<_InputIterator>>, _Allocator>; | |
| 2164 | ||
| 2165 | template<class _Key, class _Tp, class _Allocator, | |
| 2166 | class = _EnableIf<__is_allocator<_Allocator>::value>> | |
| 2167 | unordered_multimap(initializer_list<pair<_Key, _Tp>>, typename allocator_traits<_Allocator>::size_type, _Allocator) | |
| 2168 | -> unordered_multimap<remove_const_t<_Key>, _Tp, | |
| 2169 | hash<remove_const_t<_Key>>, | |
| 2170 | equal_to<remove_const_t<_Key>>, _Allocator>; | |
| 2171 | ||
| 2172 | template<class _Key, class _Tp, class _Allocator, | |
| 2173 | class = _EnableIf<__is_allocator<_Allocator>::value>> | |
| 2174 | unordered_multimap(initializer_list<pair<_Key, _Tp>>, _Allocator) | |
| 2175 | -> unordered_multimap<remove_const_t<_Key>, _Tp, | |
| 2176 | hash<remove_const_t<_Key>>, | |
| 2177 | equal_to<remove_const_t<_Key>>, _Allocator>; | |
| 2178 | ||
| 2179 | template<class _Key, class _Tp, class _Hash, class _Allocator, | |
| 2180 | class = _EnableIf<!__is_allocator<_Hash>::value>, | |
| 2181 | class = _EnableIf<!is_integral<_Hash>::value>, | |
| 2182 | class = _EnableIf<__is_allocator<_Allocator>::value>> | |
| 2183 | unordered_multimap(initializer_list<pair<_Key, _Tp>>, typename allocator_traits<_Allocator>::size_type, _Hash, _Allocator) | |
| 2184 | -> unordered_multimap<remove_const_t<_Key>, _Tp, _Hash, | |
| 2185 | equal_to<remove_const_t<_Key>>, _Allocator>; | |
| 2186 | #endif | |
| 2187 | ||
| 2043 | 2188 | template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc> |
| 2044 | 2189 | unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_multimap( |
| 2045 | 2190 | size_type __n, const hasher& __hf, const key_equal& __eql) |
lib/libcxx/include/unordered_set+145-20| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===-------------------------- unordered_set -----------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 | |
| ... | ... | @@ -76,7 +75,7 @@ public: |
| 76 | 75 | template <class InputIterator> |
| 77 | 76 | unordered_set(InputIterator f, InputIterator l, size_type n, const allocator_type& a); // C++14 |
| 78 | 77 | template <class InputIterator> |
| 79 | unordered_set(InputIterator f, InputIterator l, size_type n, | |
| 78 | unordered_set(InputIterator f, InputIterator l, size_type n, | |
| 80 | 79 | const hasher& hf, const allocator_type& a); // C++14 |
| 81 | 80 | unordered_set(initializer_list<value_type> il, size_type n, const allocator_type& a); // C++14 |
| 82 | 81 | unordered_set(initializer_list<value_type> il, size_type n, |
| ... | ... | @@ -147,6 +146,7 @@ public: |
| 147 | 146 | iterator find(const key_type& k); |
| 148 | 147 | const_iterator find(const key_type& k) const; |
| 149 | 148 | size_type count(const key_type& k) const; |
| 149 | bool contains(const key_type& k) const; // C++20 | |
| 150 | 150 | pair<iterator, iterator> equal_range(const key_type& k); |
| 151 | 151 | pair<const_iterator, const_iterator> equal_range(const key_type& k) const; |
| 152 | 152 | |
| ... | ... | @@ -243,7 +243,7 @@ public: |
| 243 | 243 | unordered_multiset(InputIterator f, InputIterator l, size_type n, |
| 244 | 244 | const hasher& hf, const allocator_type& a); // C++14 |
| 245 | 245 | unordered_multiset(initializer_list<value_type> il, size_type n, const allocator_type& a); // C++14 |
| 246 | unordered_multiset(initializer_list<value_type> il, size_type n, | |
| 246 | unordered_multiset(initializer_list<value_type> il, size_type n, | |
| 247 | 247 | const hasher& hf, const allocator_type& a); // C++14 |
| 248 | 248 | ~unordered_multiset(); |
| 249 | 249 | unordered_multiset& operator=(const unordered_multiset&); |
| ... | ... | @@ -311,6 +311,7 @@ public: |
| 311 | 311 | iterator find(const key_type& k); |
| 312 | 312 | const_iterator find(const key_type& k) const; |
| 313 | 313 | size_type count(const key_type& k) const; |
| 314 | bool contains(const key_type& k) const; // C++20 | |
| 314 | 315 | pair<iterator, iterator> equal_range(const key_type& k); |
| 315 | 316 | pair<const_iterator, const_iterator> equal_range(const key_type& k) const; |
| 316 | 317 | |
| ... | ... | @@ -384,14 +385,13 @@ public: |
| 384 | 385 | // types |
| 385 | 386 | typedef _Value key_type; |
| 386 | 387 | typedef key_type value_type; |
| 387 | typedef _Hash hasher; | |
| 388 | typedef _Pred key_equal; | |
| 389 | typedef _Alloc allocator_type; | |
| 388 | typedef typename __identity<_Hash>::type hasher; | |
| 389 | typedef typename __identity<_Pred>::type key_equal; | |
| 390 | typedef typename __identity<_Alloc>::type allocator_type; | |
| 390 | 391 | typedef value_type& reference; |
| 391 | 392 | typedef const value_type& const_reference; |
| 392 | 393 | static_assert((is_same<value_type, typename allocator_type::value_type>::value), |
| 393 | 394 | "Invalid allocator::value_type"); |
| 394 | static_assert(sizeof(__diagnose_unordered_container_requirements<_Value, _Hash, _Pred>(0)), ""); | |
| 395 | 395 | |
| 396 | 396 | private: |
| 397 | 397 | typedef __hash_table<value_type, hasher, key_equal, allocator_type> __table; |
| ... | ... | @@ -452,11 +452,11 @@ public: |
| 452 | 452 | #if _LIBCPP_STD_VER > 11 |
| 453 | 453 | template <class _InputIterator> |
| 454 | 454 | inline _LIBCPP_INLINE_VISIBILITY |
| 455 | unordered_set(_InputIterator __first, _InputIterator __last, | |
| 455 | unordered_set(_InputIterator __first, _InputIterator __last, | |
| 456 | 456 | size_type __n, const allocator_type& __a) |
| 457 | 457 | : unordered_set(__first, __last, __n, hasher(), key_equal(), __a) {} |
| 458 | 458 | template <class _InputIterator> |
| 459 | unordered_set(_InputIterator __first, _InputIterator __last, | |
| 459 | unordered_set(_InputIterator __first, _InputIterator __last, | |
| 460 | 460 | size_type __n, const hasher& __hf, const allocator_type& __a) |
| 461 | 461 | : unordered_set(__first, __last, __n, __hf, key_equal(), __a) {} |
| 462 | 462 | #endif |
| ... | ... | @@ -482,12 +482,16 @@ public: |
| 482 | 482 | const allocator_type& __a) |
| 483 | 483 | : unordered_set(__il, __n, hasher(), key_equal(), __a) {} |
| 484 | 484 | inline _LIBCPP_INLINE_VISIBILITY |
| 485 | unordered_set(initializer_list<value_type> __il, size_type __n, | |
| 485 | unordered_set(initializer_list<value_type> __il, size_type __n, | |
| 486 | 486 | const hasher& __hf, const allocator_type& __a) |
| 487 | 487 | : unordered_set(__il, __n, __hf, key_equal(), __a) {} |
| 488 | 488 | #endif |
| 489 | 489 | #endif // _LIBCPP_CXX03_LANG |
| 490 | // ~unordered_set() = default; | |
| 490 | _LIBCPP_INLINE_VISIBILITY | |
| 491 | ~unordered_set() { | |
| 492 | static_assert(sizeof(__diagnose_unordered_container_requirements<_Value, _Hash, _Pred>(0)), ""); | |
| 493 | } | |
| 494 | ||
| 491 | 495 | _LIBCPP_INLINE_VISIBILITY |
| 492 | 496 | unordered_set& operator=(const unordered_set& __u) |
| 493 | 497 | { |
| ... | ... | @@ -675,6 +679,10 @@ public: |
| 675 | 679 | const_iterator find(const key_type& __k) const {return __table_.find(__k);} |
| 676 | 680 | _LIBCPP_INLINE_VISIBILITY |
| 677 | 681 | size_type count(const key_type& __k) const {return __table_.__count_unique(__k);} |
| 682 | #if _LIBCPP_STD_VER > 17 | |
| 683 | _LIBCPP_INLINE_VISIBILITY | |
| 684 | bool contains(const key_type& __k) const {return find(__k) != end();} | |
| 685 | #endif // _LIBCPP_STD_VER > 17 | |
| 678 | 686 | _LIBCPP_INLINE_VISIBILITY |
| 679 | 687 | pair<iterator, iterator> equal_range(const key_type& __k) |
| 680 | 688 | {return __table_.__equal_range_unique(__k);} |
| ... | ... | @@ -731,6 +739,62 @@ public: |
| 731 | 739 | |
| 732 | 740 | }; |
| 733 | 741 | |
| 742 | #ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES | |
| 743 | template<class _InputIterator, | |
| 744 | class _Hash = hash<__iter_value_type<_InputIterator>>, | |
| 745 | class _Pred = equal_to<__iter_value_type<_InputIterator>>, | |
| 746 | class _Allocator = allocator<__iter_value_type<_InputIterator>>, | |
| 747 | class = _EnableIf<!__is_allocator<_Hash>::value>, | |
| 748 | class = _EnableIf<!is_integral<_Hash>::value>, | |
| 749 | class = _EnableIf<!__is_allocator<_Pred>::value>, | |
| 750 | class = _EnableIf<__is_allocator<_Allocator>::value>> | |
| 751 | unordered_set(_InputIterator, _InputIterator, typename allocator_traits<_Allocator>::size_type = 0, | |
| 752 | _Hash = _Hash(), _Pred = _Pred(), _Allocator = _Allocator()) | |
| 753 | -> unordered_set<__iter_value_type<_InputIterator>, _Hash, _Pred, _Allocator>; | |
| 754 | ||
| 755 | template<class _Tp, class _Hash = hash<_Tp>, | |
| 756 | class _Pred = equal_to<_Tp>, | |
| 757 | class _Allocator = allocator<_Tp>, | |
| 758 | class = _EnableIf<!__is_allocator<_Hash>::value>, | |
| 759 | class = _EnableIf<!is_integral<_Hash>::value>, | |
| 760 | class = _EnableIf<!__is_allocator<_Pred>::value>, | |
| 761 | class = _EnableIf<__is_allocator<_Allocator>::value>> | |
| 762 | unordered_set(initializer_list<_Tp>, typename allocator_traits<_Allocator>::size_type = 0, | |
| 763 | _Hash = _Hash(), _Pred = _Pred(), _Allocator = _Allocator()) | |
| 764 | -> unordered_set<_Tp, _Hash, _Pred, _Allocator>; | |
| 765 | ||
| 766 | template<class _InputIterator, class _Allocator, | |
| 767 | class = _EnableIf<__is_allocator<_Allocator>::value>> | |
| 768 | unordered_set(_InputIterator, _InputIterator, | |
| 769 | typename allocator_traits<_Allocator>::size_type, _Allocator) | |
| 770 | -> unordered_set<__iter_value_type<_InputIterator>, | |
| 771 | hash<__iter_value_type<_InputIterator>>, | |
| 772 | equal_to<__iter_value_type<_InputIterator>>, | |
| 773 | _Allocator>; | |
| 774 | ||
| 775 | template<class _InputIterator, class _Hash, class _Allocator, | |
| 776 | class = _EnableIf<!__is_allocator<_Hash>::value>, | |
| 777 | class = _EnableIf<!is_integral<_Hash>::value>, | |
| 778 | class = _EnableIf<__is_allocator<_Allocator>::value>> | |
| 779 | unordered_set(_InputIterator, _InputIterator, | |
| 780 | typename allocator_traits<_Allocator>::size_type, _Hash, _Allocator) | |
| 781 | -> unordered_set<__iter_value_type<_InputIterator>, _Hash, | |
| 782 | equal_to<__iter_value_type<_InputIterator>>, | |
| 783 | _Allocator>; | |
| 784 | ||
| 785 | template<class _Tp, class _Allocator, | |
| 786 | class = _EnableIf<__is_allocator<_Allocator>::value>> | |
| 787 | unordered_set(initializer_list<_Tp>, typename allocator_traits<_Allocator>::size_type, _Allocator) | |
| 788 | -> unordered_set<_Tp, hash<_Tp>, equal_to<_Tp>, _Allocator>; | |
| 789 | ||
| 790 | template<class _Tp, class _Hash, class _Allocator, | |
| 791 | class = _EnableIf<!__is_allocator<_Hash>::value>, | |
| 792 | class = _EnableIf<!is_integral<_Hash>::value>, | |
| 793 | class = _EnableIf<__is_allocator<_Allocator>::value>> | |
| 794 | unordered_set(initializer_list<_Tp>, typename allocator_traits<_Allocator>::size_type, _Hash, _Allocator) | |
| 795 | -> unordered_set<_Tp, _Hash, equal_to<_Tp>, _Allocator>; | |
| 796 | #endif | |
| 797 | ||
| 734 | 798 | template <class _Value, class _Hash, class _Pred, class _Alloc> |
| 735 | 799 | unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set(size_type __n, |
| 736 | 800 | const hasher& __hf, const key_equal& __eql) |
| ... | ... | @@ -984,14 +1048,13 @@ public: |
| 984 | 1048 | // types |
| 985 | 1049 | typedef _Value key_type; |
| 986 | 1050 | typedef key_type value_type; |
| 987 | typedef _Hash hasher; | |
| 988 | typedef _Pred key_equal; | |
| 989 | typedef _Alloc allocator_type; | |
| 1051 | typedef typename __identity<_Hash>::type hasher; | |
| 1052 | typedef typename __identity<_Pred>::type key_equal; | |
| 1053 | typedef typename __identity<_Alloc>::type allocator_type; | |
| 990 | 1054 | typedef value_type& reference; |
| 991 | 1055 | typedef const value_type& const_reference; |
| 992 | 1056 | static_assert((is_same<value_type, typename allocator_type::value_type>::value), |
| 993 | 1057 | "Invalid allocator::value_type"); |
| 994 | static_assert(sizeof(__diagnose_unordered_container_requirements<_Value, _Hash, _Pred>(0)), ""); | |
| 995 | 1058 | |
| 996 | 1059 | private: |
| 997 | 1060 | typedef __hash_table<value_type, hasher, key_equal, allocator_type> __table; |
| ... | ... | @@ -1051,7 +1114,7 @@ public: |
| 1051 | 1114 | #if _LIBCPP_STD_VER > 11 |
| 1052 | 1115 | template <class _InputIterator> |
| 1053 | 1116 | inline _LIBCPP_INLINE_VISIBILITY |
| 1054 | unordered_multiset(_InputIterator __first, _InputIterator __last, | |
| 1117 | unordered_multiset(_InputIterator __first, _InputIterator __last, | |
| 1055 | 1118 | size_type __n, const allocator_type& __a) |
| 1056 | 1119 | : unordered_multiset(__first, __last, __n, hasher(), key_equal(), __a) {} |
| 1057 | 1120 | template <class _InputIterator> |
| ... | ... | @@ -1085,7 +1148,11 @@ public: |
| 1085 | 1148 | : unordered_multiset(__il, __n, __hf, key_equal(), __a) {} |
| 1086 | 1149 | #endif |
| 1087 | 1150 | #endif // _LIBCPP_CXX03_LANG |
| 1088 | // ~unordered_multiset() = default; | |
| 1151 | _LIBCPP_INLINE_VISIBILITY | |
| 1152 | ~unordered_multiset() { | |
| 1153 | static_assert(sizeof(__diagnose_unordered_container_requirements<_Value, _Hash, _Pred>(0)), ""); | |
| 1154 | } | |
| 1155 | ||
| 1089 | 1156 | _LIBCPP_INLINE_VISIBILITY |
| 1090 | 1157 | unordered_multiset& operator=(const unordered_multiset& __u) |
| 1091 | 1158 | { |
| ... | ... | @@ -1243,6 +1310,10 @@ public: |
| 1243 | 1310 | const_iterator find(const key_type& __k) const {return __table_.find(__k);} |
| 1244 | 1311 | _LIBCPP_INLINE_VISIBILITY |
| 1245 | 1312 | size_type count(const key_type& __k) const {return __table_.__count_multi(__k);} |
| 1313 | #if _LIBCPP_STD_VER > 17 | |
| 1314 | _LIBCPP_INLINE_VISIBILITY | |
| 1315 | bool contains(const key_type& __k) const {return find(__k) != end();} | |
| 1316 | #endif // _LIBCPP_STD_VER > 17 | |
| 1246 | 1317 | _LIBCPP_INLINE_VISIBILITY |
| 1247 | 1318 | pair<iterator, iterator> equal_range(const key_type& __k) |
| 1248 | 1319 | {return __table_.__equal_range_multi(__k);} |
| ... | ... | @@ -1299,6 +1370,60 @@ public: |
| 1299 | 1370 | |
| 1300 | 1371 | }; |
| 1301 | 1372 | |
| 1373 | #ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES | |
| 1374 | template<class _InputIterator, | |
| 1375 | class _Hash = hash<__iter_value_type<_InputIterator>>, | |
| 1376 | class _Pred = equal_to<__iter_value_type<_InputIterator>>, | |
| 1377 | class _Allocator = allocator<__iter_value_type<_InputIterator>>, | |
| 1378 | class = _EnableIf<!__is_allocator<_Hash>::value>, | |
| 1379 | class = _EnableIf<!is_integral<_Hash>::value>, | |
| 1380 | class = _EnableIf<!__is_allocator<_Pred>::value>, | |
| 1381 | class = _EnableIf<__is_allocator<_Allocator>::value>> | |
| 1382 | unordered_multiset(_InputIterator, _InputIterator, typename allocator_traits<_Allocator>::size_type = 0, | |
| 1383 | _Hash = _Hash(), _Pred = _Pred(), _Allocator = _Allocator()) | |
| 1384 | -> unordered_multiset<__iter_value_type<_InputIterator>, _Hash, _Pred, _Allocator>; | |
| 1385 | ||
| 1386 | template<class _Tp, class _Hash = hash<_Tp>, | |
| 1387 | class _Pred = equal_to<_Tp>, class _Allocator = allocator<_Tp>, | |
| 1388 | class = _EnableIf<!__is_allocator<_Hash>::value>, | |
| 1389 | class = _EnableIf<!is_integral<_Hash>::value>, | |
| 1390 | class = _EnableIf<!__is_allocator<_Pred>::value>, | |
| 1391 | class = _EnableIf<__is_allocator<_Allocator>::value>> | |
| 1392 | unordered_multiset(initializer_list<_Tp>, typename allocator_traits<_Allocator>::size_type = 0, | |
| 1393 | _Hash = _Hash(), _Pred = _Pred(), _Allocator = _Allocator()) | |
| 1394 | -> unordered_multiset<_Tp, _Hash, _Pred, _Allocator>; | |
| 1395 | ||
| 1396 | template<class _InputIterator, class _Allocator, | |
| 1397 | class = _EnableIf<__is_allocator<_Allocator>::value>> | |
| 1398 | unordered_multiset(_InputIterator, _InputIterator, typename allocator_traits<_Allocator>::size_type, _Allocator) | |
| 1399 | -> unordered_multiset<__iter_value_type<_InputIterator>, | |
| 1400 | hash<__iter_value_type<_InputIterator>>, | |
| 1401 | equal_to<__iter_value_type<_InputIterator>>, | |
| 1402 | _Allocator>; | |
| 1403 | ||
| 1404 | template<class _InputIterator, class _Hash, class _Allocator, | |
| 1405 | class = _EnableIf<!__is_allocator<_Hash>::value>, | |
| 1406 | class = _EnableIf<!is_integral<_Hash>::value>, | |
| 1407 | class = _EnableIf<__is_allocator<_Allocator>::value>> | |
| 1408 | unordered_multiset(_InputIterator, _InputIterator, typename allocator_traits<_Allocator>::size_type, | |
| 1409 | _Hash, _Allocator) | |
| 1410 | -> unordered_multiset<__iter_value_type<_InputIterator>, _Hash, | |
| 1411 | equal_to<__iter_value_type<_InputIterator>>, | |
| 1412 | _Allocator>; | |
| 1413 | ||
| 1414 | template<class _Tp, class _Allocator, | |
| 1415 | class = _EnableIf<__is_allocator<_Allocator>::value>> | |
| 1416 | unordered_multiset(initializer_list<_Tp>, typename allocator_traits<_Allocator>::size_type, _Allocator) | |
| 1417 | -> unordered_multiset<_Tp, hash<_Tp>, equal_to<_Tp>, _Allocator>; | |
| 1418 | ||
| 1419 | template<class _Tp, class _Hash, class _Allocator, | |
| 1420 | class = _EnableIf<!__is_allocator<_Hash>::value>, | |
| 1421 | class = _EnableIf<!is_integral<_Hash>::value>, | |
| 1422 | class = _EnableIf<__is_allocator<_Allocator>::value>> | |
| 1423 | unordered_multiset(initializer_list<_Tp>, typename allocator_traits<_Allocator>::size_type, _Hash, _Allocator) | |
| 1424 | -> unordered_multiset<_Tp, _Hash, equal_to<_Tp>, _Allocator>; | |
| 1425 | #endif | |
| 1426 | ||
| 1302 | 1427 | template <class _Value, class _Hash, class _Pred, class _Alloc> |
| 1303 | 1428 | unordered_multiset<_Value, _Hash, _Pred, _Alloc>::unordered_multiset( |
| 1304 | 1429 | size_type __n, const hasher& __hf, const key_equal& __eql) |
lib/libcxx/include/utility+27-30| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===-------------------------- utility -----------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 | |
| ... | ... | @@ -104,7 +103,7 @@ struct piecewise_construct_t { }; |
| 104 | 103 | inline constexpr piecewise_construct_t piecewise_construct = piecewise_construct_t(); |
| 105 | 104 | |
| 106 | 105 | template <class T> struct tuple_size; |
| 107 | template <size_t I, class T> class tuple_element; | |
| 106 | template <size_t I, class T> struct tuple_element; | |
| 108 | 107 | |
| 109 | 108 | template <class T1, class T2> struct tuple_size<pair<T1, T2> >; |
| 110 | 109 | template <class T1, class T2> struct tuple_element<0, pair<T1, T2> >; |
| ... | ... | @@ -253,7 +252,7 @@ operator>=(const _Tp& __x, const _Tp& __y) |
| 253 | 252 | |
| 254 | 253 | |
| 255 | 254 | template <class _ForwardIterator1, class _ForwardIterator2> |
| 256 | inline _LIBCPP_INLINE_VISIBILITY | |
| 255 | inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 | |
| 257 | 256 | _ForwardIterator2 |
| 258 | 257 | swap_ranges(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2) |
| 259 | 258 | { |
| ... | ... | @@ -264,7 +263,7 @@ swap_ranges(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardItera |
| 264 | 263 | |
| 265 | 264 | // forward declared in <type_traits> |
| 266 | 265 | template<class _Tp, size_t _Np> |
| 267 | inline _LIBCPP_INLINE_VISIBILITY | |
| 266 | inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 | |
| 268 | 267 | typename enable_if< |
| 269 | 268 | __is_swappable<_Tp>::value |
| 270 | 269 | >::type |
| ... | ... | @@ -350,7 +349,7 @@ struct _LIBCPP_TEMPLATE_VIS pair |
| 350 | 349 | } |
| 351 | 350 | #else |
| 352 | 351 | template <bool _Val> |
| 353 | using _EnableB = typename enable_if<_Val, bool>::type; | |
| 352 | using _EnableB _LIBCPP_NODEBUG_TYPE = typename enable_if<_Val, bool>::type; | |
| 354 | 353 | |
| 355 | 354 | struct _CheckArgs { |
| 356 | 355 | template <class _U1, class _U2> |
| ... | ... | @@ -377,7 +376,7 @@ struct _LIBCPP_TEMPLATE_VIS pair |
| 377 | 376 | }; |
| 378 | 377 | |
| 379 | 378 | template <bool _MaybeEnable> |
| 380 | using _CheckArgsDep = typename conditional< | |
| 379 | using _CheckArgsDep _LIBCPP_NODEBUG_TYPE = typename conditional< | |
| 381 | 380 | _MaybeEnable, _CheckArgs, __check_tuple_constructor_fail>::type; |
| 382 | 381 | |
| 383 | 382 | struct _CheckTupleLikeConstructor { |
| ... | ... | @@ -399,7 +398,7 @@ struct _LIBCPP_TEMPLATE_VIS pair |
| 399 | 398 | }; |
| 400 | 399 | |
| 401 | 400 | template <class _Tuple> |
| 402 | using _CheckTLC = typename conditional< | |
| 401 | using _CheckTLC _LIBCPP_NODEBUG_TYPE = typename conditional< | |
| 403 | 402 | __tuple_like_with_size<_Tuple, 2>::value |
| 404 | 403 | && !is_same<typename decay<_Tuple>::type, pair>::value, |
| 405 | 404 | _CheckTupleLikeConstructor, |
| ... | ... | @@ -638,10 +637,10 @@ swap(pair<_T1, _T2>& __x, pair<_T1, _T2>& __y) |
| 638 | 637 | } |
| 639 | 638 | |
| 640 | 639 | template <class _Tp> |
| 641 | struct __unwrap_reference { typedef _Tp type; }; | |
| 640 | struct __unwrap_reference { typedef _LIBCPP_NODEBUG_TYPE _Tp type; }; | |
| 642 | 641 | |
| 643 | 642 | template <class _Tp> |
| 644 | struct __unwrap_reference<reference_wrapper<_Tp> > { typedef _Tp& type; }; | |
| 643 | struct __unwrap_reference<reference_wrapper<_Tp> > { typedef _LIBCPP_NODEBUG_TYPE _Tp& type; }; | |
| 645 | 644 | |
| 646 | 645 | #if _LIBCPP_STD_VER > 17 |
| 647 | 646 | template <class _Tp> |
| ... | ... | @@ -688,23 +687,21 @@ template <class _T1, class _T2> |
| 688 | 687 | : public integral_constant<size_t, 2> {}; |
| 689 | 688 | |
| 690 | 689 | template <size_t _Ip, class _T1, class _T2> |
| 691 | class _LIBCPP_TEMPLATE_VIS tuple_element<_Ip, pair<_T1, _T2> > | |
| 690 | struct _LIBCPP_TEMPLATE_VIS tuple_element<_Ip, pair<_T1, _T2> > | |
| 692 | 691 | { |
| 693 | 692 | static_assert(_Ip < 2, "Index out of bounds in std::tuple_element<std::pair<T1, T2>>"); |
| 694 | 693 | }; |
| 695 | 694 | |
| 696 | 695 | template <class _T1, class _T2> |
| 697 | class _LIBCPP_TEMPLATE_VIS tuple_element<0, pair<_T1, _T2> > | |
| 696 | struct _LIBCPP_TEMPLATE_VIS tuple_element<0, pair<_T1, _T2> > | |
| 698 | 697 | { |
| 699 | public: | |
| 700 | typedef _T1 type; | |
| 698 | typedef _LIBCPP_NODEBUG_TYPE _T1 type; | |
| 701 | 699 | }; |
| 702 | 700 | |
| 703 | 701 | template <class _T1, class _T2> |
| 704 | class _LIBCPP_TEMPLATE_VIS tuple_element<1, pair<_T1, _T2> > | |
| 702 | struct _LIBCPP_TEMPLATE_VIS tuple_element<1, pair<_T1, _T2> > | |
| 705 | 703 | { |
| 706 | public: | |
| 707 | typedef _T2 type; | |
| 704 | typedef _LIBCPP_NODEBUG_TYPE _T2 type; | |
| 708 | 705 | }; |
| 709 | 706 | |
| 710 | 707 | template <size_t _Ip> struct __get_pair; |
| ... | ... | @@ -883,11 +880,11 @@ template<size_t... _Ip> |
| 883 | 880 | #if __has_builtin(__make_integer_seq) && !defined(_LIBCPP_TESTING_FALLBACK_MAKE_INTEGER_SEQUENCE) |
| 884 | 881 | |
| 885 | 882 | template <class _Tp, _Tp _Ep> |
| 886 | using __make_integer_sequence = __make_integer_seq<integer_sequence, _Tp, _Ep>; | |
| 883 | using __make_integer_sequence _LIBCPP_NODEBUG_TYPE = __make_integer_seq<integer_sequence, _Tp, _Ep>; | |
| 887 | 884 | |
| 888 | 885 | #else |
| 889 | 886 | |
| 890 | template<typename _Tp, _Tp _Np> using __make_integer_sequence_unchecked = | |
| 887 | template<typename _Tp, _Tp _Np> using __make_integer_sequence_unchecked _LIBCPP_NODEBUG_TYPE = | |
| 891 | 888 | typename __detail::__make<_Np>::type::template __convert<integer_sequence, _Tp>; |
| 892 | 889 | |
| 893 | 890 | template <class _Tp, _Tp _Ep> |
| ... | ... | @@ -898,11 +895,11 @@ struct __make_integer_sequence_checked |
| 898 | 895 | static_assert(0 <= _Ep, "std::make_integer_sequence must have a non-negative sequence length"); |
| 899 | 896 | // Workaround GCC bug by preventing bad installations when 0 <= _Ep |
| 900 | 897 | // https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68929 |
| 901 | typedef __make_integer_sequence_unchecked<_Tp, 0 <= _Ep ? _Ep : 0> type; | |
| 898 | typedef _LIBCPP_NODEBUG_TYPE __make_integer_sequence_unchecked<_Tp, 0 <= _Ep ? _Ep : 0> type; | |
| 902 | 899 | }; |
| 903 | 900 | |
| 904 | 901 | template <class _Tp, _Tp _Ep> |
| 905 | using __make_integer_sequence = typename __make_integer_sequence_checked<_Tp, _Ep>::type; | |
| 902 | using __make_integer_sequence _LIBCPP_NODEBUG_TYPE = typename __make_integer_sequence_checked<_Tp, _Ep>::type; | |
| 906 | 903 | |
| 907 | 904 | #endif |
| 908 | 905 | |
| ... | ... | @@ -1482,7 +1479,7 @@ struct _LIBCPP_TEMPLATE_VIS hash<float> |
| 1482 | 1479 | size_t operator()(float __v) const _NOEXCEPT |
| 1483 | 1480 | { |
| 1484 | 1481 | // -0.0 and 0.0 should return same hash |
| 1485 | if (__v == 0.0) | |
| 1482 | if (__v == 0.0f) | |
| 1486 | 1483 | return 0; |
| 1487 | 1484 | return __scalar_hash<float>::operator()(__v); |
| 1488 | 1485 | } |
| ... | ... | @@ -1510,7 +1507,7 @@ struct _LIBCPP_TEMPLATE_VIS hash<long double> |
| 1510 | 1507 | size_t operator()(long double __v) const _NOEXCEPT |
| 1511 | 1508 | { |
| 1512 | 1509 | // -0.0 and 0.0 should return same hash |
| 1513 | if (__v == 0.0) | |
| 1510 | if (__v == 0.0L) | |
| 1514 | 1511 | return 0; |
| 1515 | 1512 | #if defined(__i386__) |
| 1516 | 1513 | // Zero out padding bits |
| ... | ... | @@ -1593,29 +1590,29 @@ struct _LIBCPP_TEMPLATE_VIS hash<nullptr_t> |
| 1593 | 1590 | |
| 1594 | 1591 | #ifndef _LIBCPP_CXX03_LANG |
| 1595 | 1592 | template <class _Key, class _Hash> |
| 1596 | using __check_hash_requirements = integral_constant<bool, | |
| 1593 | using __check_hash_requirements _LIBCPP_NODEBUG_TYPE = integral_constant<bool, | |
| 1597 | 1594 | is_copy_constructible<_Hash>::value && |
| 1598 | 1595 | is_move_constructible<_Hash>::value && |
| 1599 | 1596 | __invokable_r<size_t, _Hash, _Key const&>::value |
| 1600 | 1597 | >; |
| 1601 | 1598 | |
| 1602 | 1599 | template <class _Key, class _Hash = std::hash<_Key> > |
| 1603 | using __has_enabled_hash = integral_constant<bool, | |
| 1600 | using __has_enabled_hash _LIBCPP_NODEBUG_TYPE = integral_constant<bool, | |
| 1604 | 1601 | __check_hash_requirements<_Key, _Hash>::value && |
| 1605 | 1602 | is_default_constructible<_Hash>::value |
| 1606 | 1603 | >; |
| 1607 | 1604 | |
| 1608 | 1605 | #if _LIBCPP_STD_VER > 14 |
| 1609 | 1606 | template <class _Type, class> |
| 1610 | using __enable_hash_helper_imp = _Type; | |
| 1607 | using __enable_hash_helper_imp _LIBCPP_NODEBUG_TYPE = _Type; | |
| 1611 | 1608 | |
| 1612 | 1609 | template <class _Type, class ..._Keys> |
| 1613 | using __enable_hash_helper = __enable_hash_helper_imp<_Type, | |
| 1610 | using __enable_hash_helper _LIBCPP_NODEBUG_TYPE = __enable_hash_helper_imp<_Type, | |
| 1614 | 1611 | typename enable_if<__all<__has_enabled_hash<_Keys>::value...>::value>::type |
| 1615 | 1612 | >; |
| 1616 | 1613 | #else |
| 1617 | 1614 | template <class _Type, class ...> |
| 1618 | using __enable_hash_helper = _Type; | |
| 1615 | using __enable_hash_helper _LIBCPP_NODEBUG_TYPE = _Type; | |
| 1619 | 1616 | #endif |
| 1620 | 1617 | |
| 1621 | 1618 | #endif // !_LIBCPP_CXX03_LANG |
lib/libcxx/include/valarray+22-10| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===-------------------------- valarray ----------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 | |
| ... | ... | @@ -674,6 +673,7 @@ public: |
| 674 | 673 | _LIBCPP_INLINE_VISIBILITY |
| 675 | 674 | size_t size() const {return __size_;} |
| 676 | 675 | |
| 676 | template <class> friend class __val_expr; | |
| 677 | 677 | template <class> friend class _LIBCPP_TEMPLATE_VIS valarray; |
| 678 | 678 | }; |
| 679 | 679 | |
| ... | ... | @@ -1059,8 +1059,6 @@ private: |
| 1059 | 1059 | valarray& __assign_range(const value_type* __f, const value_type* __l); |
| 1060 | 1060 | }; |
| 1061 | 1061 | |
| 1062 | _LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS valarray<size_t>::valarray(size_t)) | |
| 1063 | _LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS valarray<size_t>::~valarray()) | |
| 1064 | 1062 | _LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS void valarray<size_t>::resize(size_t, size_t)) |
| 1065 | 1063 | |
| 1066 | 1064 | template <class _Op, class _Tp> |
| ... | ... | @@ -2222,6 +2220,7 @@ public: |
| 2222 | 2220 | _LIBCPP_INLINE_VISIBILITY |
| 2223 | 2221 | size_t size() const {return __1d_.size();} |
| 2224 | 2222 | |
| 2223 | template <class> friend class __val_expr; | |
| 2225 | 2224 | template <class> friend class valarray; |
| 2226 | 2225 | }; |
| 2227 | 2226 | |
| ... | ... | @@ -2592,6 +2591,7 @@ public: |
| 2592 | 2591 | _LIBCPP_INLINE_VISIBILITY |
| 2593 | 2592 | size_t size() const {return __1d_.size();} |
| 2594 | 2593 | |
| 2594 | template <class> friend class __val_expr; | |
| 2595 | 2595 | template <class> friend class _LIBCPP_TEMPLATE_VIS valarray; |
| 2596 | 2596 | }; |
| 2597 | 2597 | |
| ... | ... | @@ -2614,19 +2614,31 @@ public: |
| 2614 | 2614 | |
| 2615 | 2615 | _LIBCPP_INLINE_VISIBILITY |
| 2616 | 2616 | __val_expr<__slice_expr<_ValExpr> > operator[](slice __s) const |
| 2617 | {return __val_expr<__slice_expr<_ValExpr> >(__expr_, __s);} | |
| 2617 | { | |
| 2618 | typedef __slice_expr<_ValExpr> _NewExpr; | |
| 2619 | return __val_expr< _NewExpr >(_NewExpr(__s, __expr_)); | |
| 2620 | } | |
| 2618 | 2621 | |
| 2619 | 2622 | _LIBCPP_INLINE_VISIBILITY |
| 2620 | 2623 | __val_expr<__indirect_expr<_ValExpr> > operator[](const gslice& __gs) const |
| 2621 | {return __val_expr<__indirect_expr<_ValExpr> >(__expr_, __gs.__1d_);} | |
| 2624 | { | |
| 2625 | typedef __indirect_expr<_ValExpr> _NewExpr; | |
| 2626 | return __val_expr<_NewExpr >(_NewExpr(__gs.__1d_, __expr_)); | |
| 2627 | } | |
| 2622 | 2628 | |
| 2623 | 2629 | _LIBCPP_INLINE_VISIBILITY |
| 2624 | 2630 | __val_expr<__mask_expr<_ValExpr> > operator[](const valarray<bool>& __vb) const |
| 2625 | {return __val_expr<__mask_expr<_ValExpr> >(__expr_, __vb);} | |
| 2631 | { | |
| 2632 | typedef __mask_expr<_ValExpr> _NewExpr; | |
| 2633 | return __val_expr< _NewExpr >( _NewExpr(__vb, __expr_)); | |
| 2634 | } | |
| 2626 | 2635 | |
| 2627 | 2636 | _LIBCPP_INLINE_VISIBILITY |
| 2628 | 2637 | __val_expr<__indirect_expr<_ValExpr> > operator[](const valarray<size_t>& __vs) const |
| 2629 | {return __val_expr<__indirect_expr<_ValExpr> >(__expr_, __vs);} | |
| 2638 | { | |
| 2639 | typedef __indirect_expr<_ValExpr> _NewExpr; | |
| 2640 | return __val_expr< _NewExpr >(_NewExpr(__vs, __expr_)); | |
| 2641 | } | |
| 2630 | 2642 | |
| 2631 | 2643 | _LIBCPP_INLINE_VISIBILITY |
| 2632 | 2644 | __val_expr<_UnaryOp<__unary_plus<value_type>, _ValExpr> > |
lib/libcxx/include/variant+65-13| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===------------------------------ variant -------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 | |
| ... | ... | @@ -1090,20 +1089,73 @@ private: |
| 1090 | 1089 | } |
| 1091 | 1090 | }; |
| 1092 | 1091 | |
| 1093 | template <class... _Types> | |
| 1094 | struct __overload; | |
| 1092 | struct __no_narrowing_check { | |
| 1093 | template <class _Dest, class _Source> | |
| 1094 | using _Apply = __identity<_Dest>; | |
| 1095 | }; | |
| 1095 | 1096 | |
| 1096 | template <> | |
| 1097 | struct __overload<> { void operator()() const; }; | |
| 1097 | struct __narrowing_check { | |
| 1098 | template <class _Dest> | |
| 1099 | static auto __test_impl(_Dest (&&)[1]) -> __identity<_Dest>; | |
| 1100 | template <class _Dest, class _Source> | |
| 1101 | using _Apply _LIBCPP_NODEBUG_TYPE = decltype(__test_impl<_Dest>({std::declval<_Source>()})); | |
| 1102 | }; | |
| 1098 | 1103 | |
| 1099 | template <class _Tp, class... _Types> | |
| 1100 | struct __overload<_Tp, _Types...> : __overload<_Types...> { | |
| 1101 | using __overload<_Types...>::operator(); | |
| 1102 | __identity<_Tp> operator()(_Tp) const; | |
| 1104 | template <class _Dest, class _Source> | |
| 1105 | using __check_for_narrowing _LIBCPP_NODEBUG_TYPE = | |
| 1106 | typename _If< | |
| 1107 | #ifdef _LIBCPP_ENABLE_NARROWING_CONVERSIONS_IN_VARIANT | |
| 1108 | false && | |
| 1109 | #endif | |
| 1110 | is_arithmetic<_Dest>::value, | |
| 1111 | __narrowing_check, | |
| 1112 | __no_narrowing_check | |
| 1113 | >::template _Apply<_Dest, _Source>; | |
| 1114 | ||
| 1115 | template <class _Tp, size_t _Idx> | |
| 1116 | struct __overload { | |
| 1117 | template <class _Up> | |
| 1118 | auto operator()(_Tp, _Up&&) const -> __check_for_narrowing<_Tp, _Up>; | |
| 1103 | 1119 | }; |
| 1104 | 1120 | |
| 1121 | template <class _Tp, size_t> | |
| 1122 | struct __overload_bool { | |
| 1123 | template <class _Up, class _Ap = __uncvref_t<_Up>> | |
| 1124 | auto operator()(bool, _Up&&) const | |
| 1125 | -> enable_if_t<is_same_v<_Ap, bool>, __identity<_Tp>>; | |
| 1126 | }; | |
| 1127 | ||
| 1128 | template <size_t _Idx> | |
| 1129 | struct __overload<bool, _Idx> : __overload_bool<bool, _Idx> {}; | |
| 1130 | template <size_t _Idx> | |
| 1131 | struct __overload<bool const, _Idx> : __overload_bool<bool const, _Idx> {}; | |
| 1132 | template <size_t _Idx> | |
| 1133 | struct __overload<bool volatile, _Idx> : __overload_bool<bool volatile, _Idx> {}; | |
| 1134 | template <size_t _Idx> | |
| 1135 | struct __overload<bool const volatile, _Idx> : __overload_bool<bool const volatile, _Idx> {}; | |
| 1136 | ||
| 1137 | template <class ..._Bases> | |
| 1138 | struct __all_overloads : _Bases... { | |
| 1139 | void operator()() const; | |
| 1140 | using _Bases::operator()...; | |
| 1141 | }; | |
| 1142 | ||
| 1143 | template <class IdxSeq> | |
| 1144 | struct __make_overloads_imp; | |
| 1145 | ||
| 1146 | template <size_t ..._Idx> | |
| 1147 | struct __make_overloads_imp<__tuple_indices<_Idx...> > { | |
| 1148 | template <class ..._Types> | |
| 1149 | using _Apply _LIBCPP_NODEBUG_TYPE = __all_overloads<__overload<_Types, _Idx>...>; | |
| 1150 | }; | |
| 1151 | ||
| 1152 | template <class ..._Types> | |
| 1153 | using _MakeOverloads _LIBCPP_NODEBUG_TYPE = typename __make_overloads_imp< | |
| 1154 | __make_indices_imp<sizeof...(_Types), 0> >::template _Apply<_Types...>; | |
| 1155 | ||
| 1105 | 1156 | template <class _Tp, class... _Types> |
| 1106 | using __best_match_t = typename result_of_t<__overload<_Types...>(_Tp&&)>::type; | |
| 1157 | using __best_match_t = | |
| 1158 | typename invoke_result_t<_MakeOverloads<_Types...>, _Tp, _Tp>::type; | |
| 1107 | 1159 | |
| 1108 | 1160 | } // __variant_detail |
| 1109 | 1161 |
lib/libcxx/include/vector+23-19| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===------------------------------ vector --------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 | |
| ... | ... | @@ -665,27 +664,27 @@ public: |
| 665 | 664 | void reserve(size_type __n); |
| 666 | 665 | void shrink_to_fit() _NOEXCEPT; |
| 667 | 666 | |
| 668 | _LIBCPP_INLINE_VISIBILITY reference operator[](size_type __n); | |
| 669 | _LIBCPP_INLINE_VISIBILITY const_reference operator[](size_type __n) const; | |
| 667 | _LIBCPP_INLINE_VISIBILITY reference operator[](size_type __n) _NOEXCEPT; | |
| 668 | _LIBCPP_INLINE_VISIBILITY const_reference operator[](size_type __n) const _NOEXCEPT; | |
| 670 | 669 | reference at(size_type __n); |
| 671 | 670 | const_reference at(size_type __n) const; |
| 672 | 671 | |
| 673 | _LIBCPP_INLINE_VISIBILITY reference front() | |
| 672 | _LIBCPP_INLINE_VISIBILITY reference front() _NOEXCEPT | |
| 674 | 673 | { |
| 675 | 674 | _LIBCPP_ASSERT(!empty(), "front() called for empty vector"); |
| 676 | 675 | return *this->__begin_; |
| 677 | 676 | } |
| 678 | _LIBCPP_INLINE_VISIBILITY const_reference front() const | |
| 677 | _LIBCPP_INLINE_VISIBILITY const_reference front() const _NOEXCEPT | |
| 679 | 678 | { |
| 680 | 679 | _LIBCPP_ASSERT(!empty(), "front() called for empty vector"); |
| 681 | 680 | return *this->__begin_; |
| 682 | 681 | } |
| 683 | _LIBCPP_INLINE_VISIBILITY reference back() | |
| 682 | _LIBCPP_INLINE_VISIBILITY reference back() _NOEXCEPT | |
| 684 | 683 | { |
| 685 | 684 | _LIBCPP_ASSERT(!empty(), "back() called for empty vector"); |
| 686 | 685 | return *(this->__end_ - 1); |
| 687 | 686 | } |
| 688 | _LIBCPP_INLINE_VISIBILITY const_reference back() const | |
| 687 | _LIBCPP_INLINE_VISIBILITY const_reference back() const _NOEXCEPT | |
| 689 | 688 | { |
| 690 | 689 | _LIBCPP_ASSERT(!empty(), "back() called for empty vector"); |
| 691 | 690 | return *(this->__end_ - 1); |
| ... | ... | @@ -780,9 +779,9 @@ public: |
| 780 | 779 | |
| 781 | 780 | void swap(vector&) |
| 782 | 781 | #if _LIBCPP_STD_VER >= 14 |
| 783 | _NOEXCEPT_DEBUG; | |
| 782 | _NOEXCEPT; | |
| 784 | 783 | #else |
| 785 | _NOEXCEPT_DEBUG_(!__alloc_traits::propagate_on_container_swap::value || | |
| 784 | _NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value || | |
| 786 | 785 | __is_nothrow_swappable<allocator_type>::value); |
| 787 | 786 | #endif |
| 788 | 787 | |
| ... | ... | @@ -836,12 +835,17 @@ private: |
| 836 | 835 | } |
| 837 | 836 | |
| 838 | 837 | #ifndef _LIBCPP_CXX03_LANG |
| 839 | template <class _Up> void __push_back_slow_path(_Up&& __x); | |
| 838 | template <class _Up> | |
| 839 | _LIBCPP_INLINE_VISIBILITY | |
| 840 | inline void __push_back_slow_path(_Up&& __x); | |
| 840 | 841 | |
| 841 | 842 | template <class... _Args> |
| 842 | void __emplace_back_slow_path(_Args&&... __args); | |
| 843 | _LIBCPP_INLINE_VISIBILITY | |
| 844 | inline void __emplace_back_slow_path(_Args&&... __args); | |
| 843 | 845 | #else |
| 844 | template <class _Up> void __push_back_slow_path(_Up& __x); | |
| 846 | template <class _Up> | |
| 847 | _LIBCPP_INLINE_VISIBILITY | |
| 848 | inline void __push_back_slow_path(_Up& __x); | |
| 845 | 849 | #endif |
| 846 | 850 | |
| 847 | 851 | // The following functions are no-ops outside of AddressSanitizer mode. |
| ... | ... | @@ -1538,7 +1542,7 @@ vector<_Tp, _Allocator>::end() const _NOEXCEPT |
| 1538 | 1542 | template <class _Tp, class _Allocator> |
| 1539 | 1543 | inline _LIBCPP_INLINE_VISIBILITY |
| 1540 | 1544 | typename vector<_Tp, _Allocator>::reference |
| 1541 | vector<_Tp, _Allocator>::operator[](size_type __n) | |
| 1545 | vector<_Tp, _Allocator>::operator[](size_type __n) _NOEXCEPT | |
| 1542 | 1546 | { |
| 1543 | 1547 | _LIBCPP_ASSERT(__n < size(), "vector[] index out of bounds"); |
| 1544 | 1548 | return this->__begin_[__n]; |
| ... | ... | @@ -1547,7 +1551,7 @@ vector<_Tp, _Allocator>::operator[](size_type __n) |
| 1547 | 1551 | template <class _Tp, class _Allocator> |
| 1548 | 1552 | inline _LIBCPP_INLINE_VISIBILITY |
| 1549 | 1553 | typename vector<_Tp, _Allocator>::const_reference |
| 1550 | vector<_Tp, _Allocator>::operator[](size_type __n) const | |
| 1554 | vector<_Tp, _Allocator>::operator[](size_type __n) const _NOEXCEPT | |
| 1551 | 1555 | { |
| 1552 | 1556 | _LIBCPP_ASSERT(__n < size(), "vector[] index out of bounds"); |
| 1553 | 1557 | return this->__begin_[__n]; |
| ... | ... | @@ -2065,9 +2069,9 @@ template <class _Tp, class _Allocator> |
| 2065 | 2069 | void |
| 2066 | 2070 | vector<_Tp, _Allocator>::swap(vector& __x) |
| 2067 | 2071 | #if _LIBCPP_STD_VER >= 14 |
| 2068 | _NOEXCEPT_DEBUG | |
| 2072 | _NOEXCEPT | |
| 2069 | 2073 | #else |
| 2070 | _NOEXCEPT_DEBUG_(!__alloc_traits::propagate_on_container_swap::value || | |
| 2074 | _NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value || | |
| 2071 | 2075 | __is_nothrow_swappable<allocator_type>::value) |
| 2072 | 2076 | #endif |
| 2073 | 2077 | { |
lib/libcxx/include/version+11-6| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===--------------------------- version ----------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 | |
| ... | ... | @@ -59,6 +58,7 @@ __cpp_lib_hypot 201603L <cmath> |
| 59 | 58 | __cpp_lib_incomplete_container_elements 201505L <forward_list> <list> <vector> |
| 60 | 59 | __cpp_lib_integer_sequence 201304L <utility> |
| 61 | 60 | __cpp_lib_integral_constant_callable 201304L <type_traits> |
| 61 | __cpp_lib_interpolate 201902L <numeric> | |
| 62 | 62 | __cpp_lib_invoke 201411L <functional> |
| 63 | 63 | __cpp_lib_is_aggregate 201703L <type_traits> |
| 64 | 64 | __cpp_lib_is_constant_evaluated 201811L <type_traits> |
| ... | ... | @@ -220,10 +220,15 @@ __cpp_lib_void_t 201411L <type_traits> |
| 220 | 220 | // # define __cpp_lib_concepts 201806L |
| 221 | 221 | // # define __cpp_lib_constexpr_misc 201811L |
| 222 | 222 | // # define __cpp_lib_constexpr_swap_algorithms 201806L |
| 223 | // # define __cpp_lib_destroying_delete 201806L | |
| 223 | # if _LIBCPP_STD_VER > 17 && defined(__cpp_impl_destroying_delete) && __cpp_impl_destroying_delete >= 201806L | |
| 224 | # define __cpp_lib_destroying_delete 201806L | |
| 225 | # endif | |
| 224 | 226 | # define __cpp_lib_erase_if 201811L |
| 225 | 227 | // # define __cpp_lib_generic_unordered_lookup 201811L |
| 226 | // # define __cpp_lib_is_constant_evaluated 201811L | |
| 228 | # define __cpp_lib_interpolate 201902L | |
| 229 | # if !defined(_LIBCPP_HAS_NO_BUILTIN_IS_CONSTANT_EVALUATED) | |
| 230 | # define __cpp_lib_is_constant_evaluated 201811L | |
| 231 | # endif | |
| 227 | 232 | // # define __cpp_lib_list_remove_return_type 201806L |
| 228 | 233 | // # define __cpp_lib_ranges 201811L |
| 229 | 234 | // # define __cpp_lib_three_way_comparison 201711L |
lib/libcxx/include/wchar.h+3-4| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===--------------------------- wchar.h ----------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 |
lib/libcxx/include/wctype.h+3-4| ... | ... | @@ -1,10 +1,9 @@ |
| 1 | 1 | // -*- C++ -*- |
| 2 | 2 | //===--------------------------- wctype.h ---------------------------------===// |
| 3 | 3 | // |
| 4 | // The LLVM Compiler Infrastructure | |
| 5 | // | |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open | |
| 7 | // Source Licenses. See LICENSE.TXT for details. | |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| 5 | // See https://llvm.org/LICENSE.txt for license information. | |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| 8 | 7 | // |
| 9 | 8 | //===----------------------------------------------------------------------===// |
| 10 | 9 |