diff --git a/.gitattributes b/.gitattributes index 9ffc0e77e93d4d6496fe1c96fcf6749b7521e0f2..f59a89fff2b8f3f58fce2d82eb91d8415ef7f310 100644 --- a/.gitattributes +++ b/.gitattributes @@ -105,3 +105,4 @@ ComfyUI-YoloWorld-EfficientSAM/efficient_sam_s_gpu.jit filter=lfs diff=lfs merge miniCUDA124/lib/x64/cudart_static.lib filter=lfs diff=lfs merge=lfs -text miniCUDA124/lib/x64/nppist.lib filter=lfs diff=lfs merge=lfs -text miniCUDA124/bin/nvlink.exe filter=lfs diff=lfs merge=lfs -text +miniCUDA124/lib/x64/nvfatbin_static.lib filter=lfs diff=lfs merge=lfs -text diff --git a/miniCUDA124/lib/x64/nvfatbin_static.lib b/miniCUDA124/lib/x64/nvfatbin_static.lib new file mode 100644 index 0000000000000000000000000000000000000000..55504180e445341083a4e25c387a6e21ce92e6ae --- /dev/null +++ b/miniCUDA124/lib/x64/nvfatbin_static.lib @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4b229fd6f7c3ccdd918b5f9a9e58d2974d67ff81c27d6f3729e463ea088d8ac6 +size 4004556 diff --git a/miniMSVC/VC/Tools/MSVC/14.42.34433/include/__msvc_all_public_headers.hpp b/miniMSVC/VC/Tools/MSVC/14.42.34433/include/__msvc_all_public_headers.hpp new file mode 100644 index 0000000000000000000000000000000000000000..ad3e8286d980f81c834e4188284e8df8be01dd94 --- /dev/null +++ b/miniMSVC/VC/Tools/MSVC/14.42.34433/include/__msvc_all_public_headers.hpp @@ -0,0 +1,226 @@ +// Copyright (c) Microsoft Corporation. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +// This file is intended as a test resource for tools that want to verify that they can parse all MSVC standard +// library headers without warnings. This file disables deprecations, so it should not be included in programs directly. +// +// This file may be changed, renamed, or removed at any time. + +#ifndef __MSVC_ALL_PUBLIC_HEADERS_HPP +#define __MSVC_ALL_PUBLIC_HEADERS_HPP + +#pragma warning(push) +#pragma warning(1 : 4668) // 'MEOW' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif' + +// All STL headers should protect themselves from macroized new. +#if !(defined(__CUDACC__) && defined(__clang__)) +#pragma push_macro("new") +#undef new +#define new WILL NOT COMPILE +#endif // !(defined(__CUDACC__) && defined(__clang__)) + +// VSO-768746: mbctype.h macroizes _MS, _MP, _M1, and _M2. Include it first for test coverage. +#ifndef _MSVC_TESTING_NVCC +#include +#endif // !defined(_MSVC_TESTING_NVCC) + +#define _SILENCE_CXX17_C_HEADER_DEPRECATION_WARNING +#define _SILENCE_CXX20_CISO646_REMOVED_WARNING +#define _SILENCE_EXPERIMENTAL_FILESYSTEM_DEPRECATION_WARNING +#define _SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS + +// Core STL Headers +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// Core C Wrapper Headers +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifndef _CORE_HEADERS_ONLY + +// Non-Core STL Headers +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifndef _M_CEE_PURE +#include <__msvc_cxx_stdatomic.hpp> +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#endif // !defined(_M_CEE_PURE) + +// Non-Core C Wrapper Headers +#include +#include +#include +#include +#include +#include + +// Non-Core Experimental Headers +#include + +#endif // !defined(_CORE_HEADERS_ONLY) + +#ifndef _MSVC_TESTING_NVCC +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifndef _CORE_HEADERS_ONLY +#include +#include +#endif // !defined(_CORE_HEADERS_ONLY) + +#ifndef _M_CEE_PURE +#include +#endif // !defined(_M_CEE_PURE) +#endif // !defined(_MSVC_TESTING_NVCC) + +#if !(defined(__CUDACC__) && defined(__clang__)) +#pragma pop_macro("new") +#endif // !(defined(__CUDACC__) && defined(__clang__)) + +#pragma warning(pop) + +#endif // __MSVC_ALL_PUBLIC_HEADERS_HPP diff --git a/miniMSVC/VC/Tools/MSVC/14.42.34433/include/__msvc_bit_utils.hpp b/miniMSVC/VC/Tools/MSVC/14.42.34433/include/__msvc_bit_utils.hpp new file mode 100644 index 0000000000000000000000000000000000000000..eb86c43d0f4faa7669861d372b85069f0cec58ec --- /dev/null +++ b/miniMSVC/VC/Tools/MSVC/14.42.34433/include/__msvc_bit_utils.hpp @@ -0,0 +1,426 @@ +// __msvc_bit_utils.hpp internal header (core) + +// Copyright (c) Microsoft Corporation. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +#ifndef __MSVC_BIT_UTILS_HPP +#define __MSVC_BIT_UTILS_HPP +#include +#if _STL_COMPILER_PREPROCESSOR + +#include +#include + +#include _STL_INTRIN_HEADER + +#pragma pack(push, _CRT_PACKING) +#pragma warning(push, _STL_WARNING_LEVEL) +#pragma warning(disable : _STL_DISABLED_WARNINGS) +_STL_DISABLE_CLANG_WARNINGS +#pragma push_macro("new") +#undef new + +_STD_BEGIN +extern "C" { +extern int __isa_available; +} + +_INLINE_VAR constexpr int _Stl_isa_available_sse42 = 2; // equal to __ISA_AVAILABLE_SSE42 +_INLINE_VAR constexpr int _Stl_isa_available_avx2 = 5; // equal to __ISA_AVAILABLE_AVX2 + +template +constexpr int _Unsigned_integer_digits = sizeof(_UInt) * CHAR_BIT; + +// Implementation of countl_zero without using specialized CPU instructions. +// Used at compile time and when said instructions are not supported. +// see "Hacker's Delight" section 5-3 +template +_NODISCARD constexpr int _Countl_zero_fallback(_Ty _Val) noexcept { + _Ty _Yx = 0; + + unsigned int _Nx = _Unsigned_integer_digits<_Ty>; + unsigned int _Cx = _Unsigned_integer_digits<_Ty> / 2; + do { + _Yx = static_cast<_Ty>(_Val >> _Cx); + if (_Yx != 0) { + _Nx -= _Cx; + _Val = _Yx; + } + _Cx >>= 1; + } while (_Cx != 0); + return static_cast(_Nx) - static_cast(_Val); +} + +#if !defined(_M_CEE_PURE) && !defined(__CUDACC__) && !defined(__INTEL_COMPILER) +#define _HAS_COUNTL_ZERO_INTRINSICS 1 +#else // ^^^ intrinsics available / intrinsics unavailable vvv +#define _HAS_COUNTL_ZERO_INTRINSICS 0 +#endif // ^^^ intrinsics unavailable ^^^ + +#if _HAS_COUNTL_ZERO_INTRINSICS +#if (defined(_M_IX86) && !defined(_M_HYBRID_X86_ARM64)) || (defined(_M_X64) && !defined(_M_ARM64EC)) +template +_NODISCARD int _Countl_zero_lzcnt(const _Ty _Val) noexcept { + constexpr int _Digits = _Unsigned_integer_digits<_Ty>; + + if constexpr (_Digits <= 16) { + return static_cast(__lzcnt16(_Val) - (16 - _Digits)); + } else if constexpr (_Digits == 32) { + return static_cast(__lzcnt(_Val)); + } else { +#ifdef _M_IX86 + const unsigned int _High = _Val >> 32; + const auto _Low = static_cast(_Val); + if (_High == 0) { + return 32 + _Countl_zero_lzcnt(_Low); + } else { + return _Countl_zero_lzcnt(_High); + } +#else // ^^^ defined(_M_IX86) / !defined(_M_IX86) vvv + return static_cast(__lzcnt64(_Val)); +#endif // ^^^ !defined(_M_IX86) ^^^ + } +} + +template +_NODISCARD int _Countl_zero_bsr(const _Ty _Val) noexcept { + constexpr int _Digits = _Unsigned_integer_digits<_Ty>; + + unsigned long _Result; + if constexpr (_Digits <= 32) { + if (!_BitScanReverse(&_Result, _Val)) { + return _Digits; + } + } else { +#ifdef _M_IX86 + const unsigned int _High = _Val >> 32; + if (_BitScanReverse(&_Result, _High)) { + return static_cast(31 - _Result); + } + + const auto _Low = static_cast(_Val); + if (!_BitScanReverse(&_Result, _Low)) { + return _Digits; + } +#else // ^^^ defined(_M_IX86) / !defined(_M_IX86) vvv + if (!_BitScanReverse64(&_Result, _Val)) { + return _Digits; + } +#endif // ^^^ !defined(_M_IX86) ^^^ + } + return static_cast(_Digits - 1 - _Result); +} + +template +_NODISCARD int _Checked_x86_x64_countl_zero(const _Ty _Val) noexcept { +#ifdef __AVX2__ + return _Countl_zero_lzcnt(_Val); +#else // ^^^ defined(__AVX2__) / !defined(__AVX2__) vvv + const bool _Definitely_have_lzcnt = __isa_available >= _Stl_isa_available_avx2; + if (_Definitely_have_lzcnt) { + return _Countl_zero_lzcnt(_Val); + } else { + return _Countl_zero_bsr(_Val); + } +#endif // ^^^ !defined(__AVX2__) ^^^ +} +#endif // (defined(_M_IX86) && !defined(_M_HYBRID_X86_ARM64)) || (defined(_M_X64) && !defined(_M_ARM64EC)) + +#if defined(_M_ARM) || defined(_M_ARM64) || defined(_M_ARM64EC) || defined(_M_HYBRID_X86_ARM64) +#ifdef __clang__ // TRANSITION, GH-1586 +_NODISCARD constexpr int _Clang_arm_arm64_countl_zero(const unsigned short _Val) { + return __builtin_clzs(_Val); +} + +_NODISCARD constexpr int _Clang_arm_arm64_countl_zero(const unsigned int _Val) { + return __builtin_clz(_Val); +} + +_NODISCARD constexpr int _Clang_arm_arm64_countl_zero(const unsigned long _Val) { + return __builtin_clzl(_Val); +} + +_NODISCARD constexpr int _Clang_arm_arm64_countl_zero(const unsigned long long _Val) { + return __builtin_clzll(_Val); +} +#endif // TRANSITION, GH-1586 + +template +_NODISCARD int _Checked_arm_arm64_countl_zero(const _Ty _Val) noexcept { + constexpr int _Digits = _Unsigned_integer_digits<_Ty>; + if (_Val == 0) { + return _Digits; + } + +#ifdef __clang__ // TRANSITION, GH-1586 + if constexpr (is_same_v, unsigned char>) { + return _Clang_arm_arm64_countl_zero(static_cast(_Val)) + - (_Unsigned_integer_digits - _Digits); + } else { + return _Clang_arm_arm64_countl_zero(_Val); + } +#else // ^^^ workaround / no workaround vvv + if constexpr (_Digits <= 32) { + return static_cast(_CountLeadingZeros(_Val)) - (_Unsigned_integer_digits - _Digits); + } else { + return static_cast(_CountLeadingZeros64(_Val)); + } +#endif // ^^^ no workaround ^^^ +} +#endif // defined(_M_ARM) || defined(_M_ARM64) || defined(_M_ARM64EC) || defined(_M_HYBRID_X86_ARM64) +#endif // _HAS_COUNTL_ZERO_INTRINSICS + +// Implementation of countr_zero without using specialized CPU instructions. +// Used at compile time and when said instructions are not supported. +// see "Hacker's Delight" section 5-4 +template +_NODISCARD constexpr int _Countr_zero_fallback(const _Ty _Val) noexcept { + constexpr int _Digits = _Unsigned_integer_digits<_Ty>; + return _Digits - _Countl_zero_fallback(static_cast<_Ty>(static_cast<_Ty>(~_Val) & static_cast<_Ty>(_Val - 1))); +} + +// Implementation of popcount without using specialized CPU instructions. +// Used at compile time and when said instructions are not supported. +template +_NODISCARD constexpr int _Popcount_fallback(_Ty _Val) noexcept { + constexpr int _Digits = _Unsigned_integer_digits<_Ty>; +#if (defined(_M_IX86) && !defined(_M_HYBRID_X86_ARM64)) || defined(_M_ARM) + if constexpr (_Digits == 64) { + // 64-bit bit operations on architectures without 64-bit registers are less efficient, + // hence we split the value so that it fits in 32-bit registers + return _Popcount_fallback(static_cast(_Val)) + + _Popcount_fallback(static_cast(_Val >> 32)); + } else +#endif // (defined(_M_IX86) && !defined(_M_HYBRID_X86_ARM64)) || defined(_M_ARM) + { + // we static_cast these bit patterns in order to truncate them to the correct size + _Val = static_cast<_Ty>(_Val - ((_Val >> 1) & static_cast<_Ty>(0x5555'5555'5555'5555ull))); + _Val = static_cast<_Ty>((_Val & static_cast<_Ty>(0x3333'3333'3333'3333ull)) + + ((_Val >> 2) & static_cast<_Ty>(0x3333'3333'3333'3333ull))); + _Val = static_cast<_Ty>((_Val + (_Val >> 4)) & static_cast<_Ty>(0x0F0F'0F0F'0F0F'0F0Full)); + // Multiply by one in each byte, so that it will have the sum of all source bytes in the highest byte + _Val = static_cast<_Ty>(_Val * static_cast<_Ty>(0x0101'0101'0101'0101ull)); + // Extract highest byte + return static_cast(_Val >> (_Digits - 8)); + } +} + +#if ((defined(_M_IX86) && !defined(_M_HYBRID_X86_ARM64)) || (defined(_M_X64) && !defined(_M_ARM64EC))) \ + && !defined(_M_CEE_PURE) && !defined(__CUDACC__) && !defined(__INTEL_COMPILER) +#define _HAS_TZCNT_BSF_INTRINSICS 1 +#else // ^^^ intrinsics available / intrinsics unavailable vvv +#define _HAS_TZCNT_BSF_INTRINSICS 0 +#endif // ^^^ intrinsics unavailable ^^^ + +#if _HAS_TZCNT_BSF_INTRINSICS +#ifdef __clang__ +#define _TZCNT_U32 __builtin_ia32_tzcnt_u32 +#define _TZCNT_U64 __builtin_ia32_tzcnt_u64 +#else // ^^^ __clang__ / !__clang__ vvv +#define _TZCNT_U32 _tzcnt_u32 +#define _TZCNT_U64 _tzcnt_u64 +#endif // __clang__ + +template +_NODISCARD int _Countr_zero_tzcnt(const _Ty _Val) noexcept { + constexpr int _Digits = _Unsigned_integer_digits<_Ty>; + constexpr _Ty _Max = static_cast<_Ty>(-1); // equal to (numeric_limits<_Ty>::max)() + + if constexpr (_Digits <= 32) { + // Intended widening to int. This operation means that a narrow 0 will widen + // to 0xFFFF....FFFF0... instead of 0. We need this to avoid counting all the zeros + // of the wider type. + return static_cast(_TZCNT_U32(static_cast(~_Max | _Val))); + } else { +#ifdef _M_IX86 + const auto _Low = static_cast(_Val); + if (_Low == 0) { + const unsigned int _High = _Val >> 32; + return static_cast(32 + _TZCNT_U32(_High)); + } else { + return static_cast(_TZCNT_U32(_Low)); + } +#else // ^^^ defined(_M_IX86) / !defined(_M_IX86) vvv + return static_cast(_TZCNT_U64(_Val)); +#endif // ^^^ !defined(_M_IX86) ^^^ + } +} + +#undef _TZCNT_U32 +#undef _TZCNT_U64 + +template +_NODISCARD int _Countr_zero_bsf(const _Ty _Val) noexcept { + constexpr int _Digits = _Unsigned_integer_digits<_Ty>; + constexpr _Ty _Max = static_cast<_Ty>(-1); // equal to (numeric_limits<_Ty>::max)() + + unsigned long _Result; + if constexpr (_Digits <= 32) { + // Intended widening to int. This operation means that a narrow 0 will widen + // to 0xFFFF....FFFF0... instead of 0. We need this to avoid counting all the zeros + // of the wider type. + if (!_BitScanForward(&_Result, static_cast(~_Max | _Val))) { + return _Digits; + } + } else { +#ifdef _M_IX86 + const auto _Low = static_cast(_Val); + if (_BitScanForward(&_Result, _Low)) { + return static_cast(_Result); + } + + const unsigned int _High = _Val >> 32; + if (!_BitScanForward(&_Result, _High)) { + return _Digits; + } else { + return static_cast(_Result + 32); + } +#else // ^^^ defined(_M_IX86) / !defined(_M_IX86) vvv + if (!_BitScanForward64(&_Result, _Val)) { + return _Digits; + } +#endif // ^^^ !defined(_M_IX86) ^^^ + } + return static_cast(_Result); +} + +template +_NODISCARD int _Checked_x86_x64_countr_zero(const _Ty _Val) noexcept { +#ifdef __AVX2__ + return _Countr_zero_tzcnt(_Val); +#else // ^^^ defined(__AVX2__) / !defined(__AVX2__) vvv + const bool _Definitely_have_tzcnt = __isa_available >= _Stl_isa_available_avx2; + if (_Definitely_have_tzcnt) { + return _Countr_zero_tzcnt(_Val); + } else { + return _Countr_zero_bsf(_Val); + } +#endif // ^^^ !defined(__AVX2__) ^^^ +} + +#endif // _HAS_TZCNT_BSF_INTRINSICS + +#if (defined(_M_IX86) || defined(_M_X64) || defined(_M_ARM64)) && !defined(_M_CEE_PURE) && !defined(__CUDACC__) \ + && !defined(__INTEL_COMPILER) +#define _HAS_POPCNT_INTRINSICS 1 +#if defined(__AVX__) || defined(_M_ARM64) || defined(_M_ARM64EC) +#define _POPCNT_INTRINSICS_ALWAYS_AVAILABLE 1 +#else // ^^^ intrinsics always available / intrinsics not always available vvv +#define _POPCNT_INTRINSICS_ALWAYS_AVAILABLE 0 +#endif // ^^^ intrinsics not always available ^^^ +#else // ^^^ intrinsics available / intrinsics unavailable vvv +#define _HAS_POPCNT_INTRINSICS 0 +#endif // ^^^ intrinsics unavailable ^^^ + +#if _HAS_POPCNT_INTRINSICS +template +_NODISCARD int _Unchecked_popcount(const _Ty _Val) noexcept { + constexpr int _Digits = _Unsigned_integer_digits<_Ty>; + if constexpr (_Digits <= 16) { + return static_cast(__popcnt16(_Val)); + } else if constexpr (_Digits == 32) { + return static_cast(__popcnt(_Val)); + } else { +#ifdef _M_IX86 + return static_cast(__popcnt(_Val >> 32) + __popcnt(static_cast(_Val))); +#else // ^^^ defined(_M_IX86) / !defined(_M_IX86) vvv + return static_cast(__popcnt64(_Val)); +#endif // ^^^ !defined(_M_IX86) ^^^ + } +} + +template +_NODISCARD int _Checked_popcount(const _Ty _Val) noexcept { +#if !_POPCNT_INTRINSICS_ALWAYS_AVAILABLE + const bool _Definitely_have_popcnt = __isa_available >= _Stl_isa_available_sse42; + if (!_Definitely_have_popcnt) { + return _Popcount_fallback(_Val); + } +#endif // ^^^ !_POPCNT_INTRINSICS_ALWAYS_AVAILABLE ^^^ + return _Unchecked_popcount(_Val); +} +#endif // ^^^ _HAS_POPCNT_INTRINSICS ^^^ + +template +constexpr bool _Is_standard_unsigned_integer = + _Is_any_of_v, unsigned char, unsigned short, unsigned int, unsigned long, unsigned long long>; + +template , int> = 0> +_NODISCARD _CONSTEXPR20 int _Countr_zero(const _Ty _Val) noexcept { +#if _HAS_TZCNT_BSF_INTRINSICS +#if _HAS_CXX20 + if (!_STD is_constant_evaluated()) +#endif // _HAS_CXX20 + { + return _Checked_x86_x64_countr_zero(_Val); + } +#endif // _HAS_TZCNT_BSF_INTRINSICS + return _Countr_zero_fallback(_Val); +} + +template +constexpr decltype(auto) _Select_countr_zero_impl(_Fn _Callback) { + // TRANSITION, DevCom-1527995: Lambdas in this function ensure inlining +#if _HAS_TZCNT_BSF_INTRINSICS && _HAS_CXX20 + if (!_STD is_constant_evaluated()) { +#ifdef __AVX2__ + return _Callback([](_Ty _Val) _STATIC_CALL_OPERATOR { return _Countr_zero_tzcnt(_Val); }); +#else // ^^^ AVX2 / not AVX2 vvv + const bool _Definitely_have_tzcnt = __isa_available >= _Stl_isa_available_avx2; + if (_Definitely_have_tzcnt) { + return _Callback([](_Ty _Val) _STATIC_CALL_OPERATOR { return _Countr_zero_tzcnt(_Val); }); + } else { + return _Callback([](_Ty _Val) _STATIC_CALL_OPERATOR { return _Countr_zero_bsf(_Val); }); + } +#endif // ^^^ not AVX2 ^^^ + } +#endif // ^^^ _HAS_TZCNT_BSF_INTRINSICS && _HAS_CXX20 ^^^ + // C++17 constexpr gcd() calls this function, so it should be constexpr unless we detect runtime evaluation. + return _Callback([](_Ty _Val) _STATIC_CALL_OPERATOR { return _Countr_zero_fallback(_Val); }); +} + +template , int> = 0> +_NODISCARD _CONSTEXPR20 int _Popcount(const _Ty _Val) noexcept { +#if _HAS_POPCNT_INTRINSICS +#if _HAS_CXX20 + if (!_STD is_constant_evaluated()) +#endif // _HAS_CXX20 + { + return _Checked_popcount(_Val); + } +#endif // ^^^ _HAS_POPCNT_INTRINSICS ^^^ + return _Popcount_fallback(_Val); +} + +template +_CONSTEXPR20 decltype(auto) _Select_popcount_impl(_Fn _Callback) { + // TRANSITION, DevCom-1527995: Lambdas in this function ensure inlining +#if _HAS_POPCNT_INTRINSICS +#if _HAS_CXX20 + if (!_STD is_constant_evaluated()) +#endif // _HAS_CXX20 + { +#if !_POPCNT_INTRINSICS_ALWAYS_AVAILABLE + const bool _Definitely_have_popcnt = __isa_available >= _Stl_isa_available_sse42; + if (!_Definitely_have_popcnt) { + return _Callback([](_Ty _Val) _STATIC_CALL_OPERATOR { return _Popcount_fallback(_Val); }); + } +#endif // ^^^ !_POPCNT_INTRINSICS_ALWAYS_AVAILABLE ^^^ + return _Callback([](_Ty _Val) _STATIC_CALL_OPERATOR { return _Unchecked_popcount(_Val); }); + } +#endif // ^^^ _HAS_POPCNT_INTRINSICS ^^^ + return _Callback([](_Ty _Val) _STATIC_CALL_OPERATOR { return _Popcount_fallback(_Val); }); +} + +#undef _HAS_POPCNT_INTRINSICS +#undef _HAS_TZCNT_BSF_INTRINSICS +#undef _POPCNT_INTRINSICS_ALWAYS_AVAILABLE + +_STD_END + +#pragma pop_macro("new") +_STL_RESTORE_CLANG_WARNINGS +#pragma warning(pop) +#pragma pack(pop) +#endif // _STL_COMPILER_PREPROCESSOR +#endif // __MSVC_BIT_UTILS_HPP diff --git a/miniMSVC/VC/Tools/MSVC/14.42.34433/include/__msvc_chrono.hpp b/miniMSVC/VC/Tools/MSVC/14.42.34433/include/__msvc_chrono.hpp new file mode 100644 index 0000000000000000000000000000000000000000..08268b83b840cd699644b246ad412d7e921c2987 --- /dev/null +++ b/miniMSVC/VC/Tools/MSVC/14.42.34433/include/__msvc_chrono.hpp @@ -0,0 +1,801 @@ +// __msvc_chrono.hpp internal header + +// Copyright (c) Microsoft Corporation. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +#ifndef __MSVC_CHRONO_HPP +#define __MSVC_CHRONO_HPP +#include +#if _STL_COMPILER_PREPROCESSOR +#include +#include +#include +#include +#include +#include + +#if _HAS_CXX20 +#include +#endif + +#pragma pack(push, _CRT_PACKING) +#pragma warning(push, _STL_WARNING_LEVEL) +#pragma warning(disable : _STL_DISABLED_WARNINGS) +_STL_DISABLE_CLANG_WARNINGS +#pragma push_macro("new") +#undef new + +_STD_BEGIN +namespace chrono { + _EXPORT_STD template + struct treat_as_floating_point : is_floating_point<_Rep> {}; // tests for floating-point type + + _EXPORT_STD template + constexpr bool treat_as_floating_point_v = treat_as_floating_point<_Rep>::value; + + _EXPORT_STD template + struct duration_values { // gets arithmetic properties of a type + _NODISCARD static constexpr _Rep zero() noexcept { + // get zero value + return _Rep(0); + } + + _NODISCARD static constexpr _Rep(min)() noexcept { + // get smallest value + return numeric_limits<_Rep>::lowest(); + } + + _NODISCARD static constexpr _Rep(max)() noexcept { + // get largest value + return (numeric_limits<_Rep>::max)(); + } + }; + +#if _HAS_CXX20 + _EXPORT_STD template + constexpr bool is_clock_v = requires { + typename _Clock::rep; + typename _Clock::period; + typename _Clock::duration; + typename _Clock::time_point; + _Clock::is_steady; + _Clock::now(); + }; + _EXPORT_STD template + struct is_clock : bool_constant> {}; + + template + constexpr bool _Is_clock_v = is_clock_v<_Clock>; +#else // ^^^ _HAS_CXX20 / !_HAS_CXX20 vvv + template + constexpr bool _Is_clock_v = false; + + template + constexpr bool + _Is_clock_v<_Clock, void_t> = + true; +#endif // ^^^ !_HAS_CXX20 ^^^ + + _EXPORT_STD template > + class duration; + + template + constexpr bool _Is_duration_v = _Is_specialization_v<_Ty, duration>; + + _EXPORT_STD template , int> = 0> + constexpr _To duration_cast(const duration<_Rep, _Period>&) noexcept( + is_arithmetic_v<_Rep> && is_arithmetic_v); // strengthened + + _EXPORT_STD template + class duration { // represents a time duration + public: + using rep = _Rep; + using period = typename _Period::type; + + static_assert(!_Is_duration_v<_Rep>, "duration can't have duration as first template argument"); + static_assert(_Is_ratio_v<_Period>, "period not an instance of std::ratio"); + static_assert(0 < _Period::num, "period negative or zero"); + + constexpr duration() = default; + + template + && (treat_as_floating_point_v<_Rep> || !treat_as_floating_point_v<_Rep2>), + int> = 0> + constexpr explicit duration(const _Rep2& _Val) noexcept( + is_arithmetic_v<_Rep> && is_arithmetic_v<_Rep2>) // strengthened + : _MyRep(static_cast<_Rep>(_Val)) {} + + template + || (_Ratio_divide_sfinae<_Period2, _Period>::den == 1 && !treat_as_floating_point_v<_Rep2>), + int> = 0> + constexpr duration(const duration<_Rep2, _Period2>& _Dur) noexcept( + is_arithmetic_v<_Rep> && is_arithmetic_v<_Rep2>) // strengthened + : _MyRep(_CHRONO duration_cast(_Dur).count()) {} + + _NODISCARD constexpr _Rep count() const noexcept(is_arithmetic_v<_Rep>) /* strengthened */ { + return _MyRep; + } + + _NODISCARD constexpr common_type_t operator+() const + noexcept(is_arithmetic_v<_Rep>) /* strengthened */ { + return common_type_t(*this); + } + + _NODISCARD constexpr common_type_t operator-() const + noexcept(is_arithmetic_v<_Rep>) /* strengthened */ { + return common_type_t(-_MyRep); + } + + _CONSTEXPR17 duration& operator++() noexcept(is_arithmetic_v<_Rep>) /* strengthened */ { + ++_MyRep; + return *this; + } + + _CONSTEXPR17 duration operator++(int) noexcept(is_arithmetic_v<_Rep>) /* strengthened */ { + return duration(_MyRep++); + } + + _CONSTEXPR17 duration& operator--() noexcept(is_arithmetic_v<_Rep>) /* strengthened */ { + --_MyRep; + return *this; + } + + _CONSTEXPR17 duration operator--(int) noexcept(is_arithmetic_v<_Rep>) /* strengthened */ { + return duration(_MyRep--); + } + + _CONSTEXPR17 duration& operator+=(const duration& _Right) noexcept(is_arithmetic_v<_Rep>) /* strengthened */ { + _MyRep += _Right._MyRep; + return *this; + } + + _CONSTEXPR17 duration& operator-=(const duration& _Right) noexcept(is_arithmetic_v<_Rep>) /* strengthened */ { + _MyRep -= _Right._MyRep; + return *this; + } + + _CONSTEXPR17 duration& operator*=(const _Rep& _Right) noexcept(is_arithmetic_v<_Rep>) /* strengthened */ { + _MyRep *= _Right; + return *this; + } + + _CONSTEXPR17 duration& operator/=(const _Rep& _Right) noexcept(is_arithmetic_v<_Rep>) /* strengthened */ { + _MyRep /= _Right; + return *this; + } + + _CONSTEXPR17 duration& operator%=(const _Rep& _Right) noexcept(is_arithmetic_v<_Rep>) /* strengthened */ { + _MyRep %= _Right; + return *this; + } + + _CONSTEXPR17 duration& operator%=(const duration& _Right) noexcept(is_arithmetic_v<_Rep>) /* strengthened */ { + _MyRep %= _Right.count(); + return *this; + } + + _NODISCARD static constexpr duration zero() noexcept { + // get zero value + return duration(duration_values<_Rep>::zero()); + } + + _NODISCARD static constexpr duration(min)() noexcept { + // get minimum value + return duration((duration_values<_Rep>::min)()); + } + + _NODISCARD static constexpr duration(max)() noexcept { + // get maximum value + return duration((duration_values<_Rep>::max)()); + } + + private: + _Rep _MyRep; // the stored rep + }; + + _EXPORT_STD template + class time_point { // represents a point in time + public: + using clock = _Clock; + using duration = _Duration; + using rep = typename _Duration::rep; + using period = typename _Duration::period; + + static_assert(_Is_duration_v<_Duration>, + "N4950 [time.point.general]/1 mandates Duration to be a specialization of chrono::duration."); + + constexpr time_point() = default; + + constexpr explicit time_point(const _Duration& _Other) noexcept(is_arithmetic_v) // strengthened + : _MyDur(_Other) {} + + template , int> = 0> + constexpr time_point(const time_point<_Clock, _Duration2>& _Tp) noexcept( + is_arithmetic_v && is_arithmetic_v) // strengthened + : _MyDur(_Tp.time_since_epoch()) {} + + _NODISCARD constexpr _Duration time_since_epoch() const noexcept(is_arithmetic_v) /* strengthened */ { + return _MyDur; + } + +#if _HAS_CXX20 + constexpr time_point& operator++() noexcept(is_arithmetic_v) /* strengthened */ { + ++_MyDur; + return *this; + } + constexpr time_point operator++(int) noexcept(is_arithmetic_v) /* strengthened */ { + return time_point{_MyDur++}; + } + constexpr time_point& operator--() noexcept(is_arithmetic_v) /* strengthened */ { + --_MyDur; + return *this; + } + constexpr time_point operator--(int) noexcept(is_arithmetic_v) /* strengthened */ { + return time_point{_MyDur--}; + } +#endif // _HAS_CXX20 + + _CONSTEXPR17 time_point& operator+=(const _Duration& _Dur) noexcept(is_arithmetic_v) /* strengthened */ { + _MyDur += _Dur; + return *this; + } + + _CONSTEXPR17 time_point& operator-=(const _Duration& _Dur) noexcept(is_arithmetic_v) /* strengthened */ { + _MyDur -= _Dur; + return *this; + } + + _NODISCARD static constexpr time_point(min)() noexcept { + return time_point((_Duration::min)()); + } + + _NODISCARD static constexpr time_point(max)() noexcept { + return time_point((_Duration::max)()); + } + + private: + _Duration _MyDur{duration::zero()}; // duration since the epoch + }; +} // namespace chrono + +template +constexpr bool _Is_trivially_swappable_v> = _Is_trivially_swappable_v<_Rep>; + +template +constexpr bool _Is_trivially_swappable_v> = _Is_trivially_swappable_v<_Duration>; + +_NODISCARD constexpr intmax_t _Lcm(const intmax_t _Ax, const intmax_t _Bx) noexcept { + return (_Ax / _Gcd(_Ax, _Bx)) * _Bx; +} + +template +struct common_type<_CHRONO duration<_Rep1, _Period1>, _CHRONO duration<_Rep2, _Period2>> { + using type = _CHRONO duration, + ratio<_Gcd(_Period1::num, _Period2::num), _Lcm(_Period1::den, _Period2::den)>>; +}; + +template +struct common_type<_CHRONO time_point<_Clock, _Duration1>, + _CHRONO time_point<_Clock, _Duration2>> { // common type of two time points + using type = _CHRONO time_point<_Clock, common_type_t<_Duration1, _Duration2>>; +}; + +namespace chrono { + _EXPORT_STD template + _NODISCARD constexpr common_type_t, duration<_Rep2, _Period2>> + operator+(const duration<_Rep1, _Period1>& _Left, const duration<_Rep2, _Period2>& _Right) noexcept( + is_arithmetic_v<_Rep1> && is_arithmetic_v<_Rep2>) /* strengthened */ { + using _CD = common_type_t, duration<_Rep2, _Period2>>; + return _CD(_CD(_Left).count() + _CD(_Right).count()); + } + + _EXPORT_STD template + _NODISCARD constexpr common_type_t, duration<_Rep2, _Period2>> + operator-(const duration<_Rep1, _Period1>& _Left, const duration<_Rep2, _Period2>& _Right) noexcept( + is_arithmetic_v<_Rep1> && is_arithmetic_v<_Rep2>) /* strengthened */ { + using _CD = common_type_t, duration<_Rep2, _Period2>>; + return _CD(_CD(_Left).count() - _CD(_Right).count()); + } + + _EXPORT_STD template >, int> = 0> + _NODISCARD constexpr duration, _Period1> operator*( + const duration<_Rep1, _Period1>& _Left, + const _Rep2& _Right) noexcept(is_arithmetic_v<_Rep1> && is_arithmetic_v<_Rep2>) /* strengthened */ { + using _CR = common_type_t<_Rep1, _Rep2>; + using _CD = duration<_CR, _Period1>; + return _CD(_CD(_Left).count() * _Right); + } + + _EXPORT_STD template >, int> = 0> + _NODISCARD constexpr duration, _Period2> operator*(const _Rep1& _Left, + const duration<_Rep2, _Period2>& _Right) noexcept(is_arithmetic_v<_Rep1> + && is_arithmetic_v<_Rep2>) /* strengthened */ { + return _Right * _Left; + } + + template > + struct _Duration_div_mod1 { // return type for duration / rep and duration % rep + using type = duration<_CR, _Period1>; + }; + + template + struct _Duration_div_mod1<_CR, _Period1, _Rep2, false> {}; // no return type + + template > + struct _Duration_div_mod {}; // no return type + + template + struct _Duration_div_mod<_CR, _Period1, _Rep2, false> : _Duration_div_mod1<_CR, _Period1, _Rep2> { + // return type for duration / rep and duration % rep + }; + + _EXPORT_STD template + _NODISCARD constexpr typename _Duration_div_mod, _Period1, _Rep2>::type operator/( + const duration<_Rep1, _Period1>& _Left, + const _Rep2& _Right) noexcept(is_arithmetic_v<_Rep1> && is_arithmetic_v<_Rep2>) /* strengthened */ { + using _CR = common_type_t<_Rep1, _Rep2>; + using _CD = duration<_CR, _Period1>; + return _CD(_CD(_Left).count() / _Right); + } + + _EXPORT_STD template + _NODISCARD constexpr common_type_t<_Rep1, _Rep2> operator/(const duration<_Rep1, _Period1>& _Left, + const duration<_Rep2, _Period2>& _Right) noexcept(is_arithmetic_v<_Rep1> + && is_arithmetic_v<_Rep2>) /* strengthened */ { + using _CD = common_type_t, duration<_Rep2, _Period2>>; + return _CD(_Left).count() / _CD(_Right).count(); + } + + _EXPORT_STD template + _NODISCARD constexpr typename _Duration_div_mod, _Period1, _Rep2>::type operator%( + const duration<_Rep1, _Period1>& _Left, + const _Rep2& _Right) noexcept(is_arithmetic_v<_Rep1> && is_arithmetic_v<_Rep2>) /* strengthened */ { + using _CR = common_type_t<_Rep1, _Rep2>; + using _CD = duration<_CR, _Period1>; + return _CD(_CD(_Left).count() % _Right); + } + + _EXPORT_STD template + _NODISCARD constexpr common_type_t, duration<_Rep2, _Period2>> + operator%(const duration<_Rep1, _Period1>& _Left, const duration<_Rep2, _Period2>& _Right) noexcept( + is_arithmetic_v<_Rep1> && is_arithmetic_v<_Rep2>) /* strengthened */ { + using _CD = common_type_t, duration<_Rep2, _Period2>>; + return _CD(_CD(_Left).count() % _CD(_Right).count()); + } + + _EXPORT_STD template + _NODISCARD constexpr bool operator==(const duration<_Rep1, _Period1>& _Left, + const duration<_Rep2, _Period2>& _Right) noexcept(is_arithmetic_v<_Rep1> + && is_arithmetic_v<_Rep2>) /* strengthened */ { + using _CT = common_type_t, duration<_Rep2, _Period2>>; + return _CT(_Left).count() == _CT(_Right).count(); + } + +#if !_HAS_CXX20 + template + _NODISCARD constexpr bool operator!=(const duration<_Rep1, _Period1>& _Left, + const duration<_Rep2, _Period2>& _Right) noexcept(is_arithmetic_v<_Rep1> + && is_arithmetic_v<_Rep2>) /* strengthened */ { + return !(_Left == _Right); + } +#endif // !_HAS_CXX20 + + _EXPORT_STD template + _NODISCARD constexpr bool operator<(const duration<_Rep1, _Period1>& _Left, + const duration<_Rep2, _Period2>& _Right) noexcept(is_arithmetic_v<_Rep1> + && is_arithmetic_v<_Rep2>) /* strengthened */ { + using _CT = common_type_t, duration<_Rep2, _Period2>>; + return _CT(_Left).count() < _CT(_Right).count(); + } + + _EXPORT_STD template + _NODISCARD constexpr bool operator<=(const duration<_Rep1, _Period1>& _Left, + const duration<_Rep2, _Period2>& _Right) noexcept(is_arithmetic_v<_Rep1> + && is_arithmetic_v<_Rep2>) /* strengthened */ { + return !(_Right < _Left); + } + + _EXPORT_STD template + _NODISCARD constexpr bool operator>(const duration<_Rep1, _Period1>& _Left, + const duration<_Rep2, _Period2>& _Right) noexcept(is_arithmetic_v<_Rep1> + && is_arithmetic_v<_Rep2>) /* strengthened */ { + return _Right < _Left; + } + + _EXPORT_STD template + _NODISCARD constexpr bool operator>=(const duration<_Rep1, _Period1>& _Left, + const duration<_Rep2, _Period2>& _Right) noexcept(is_arithmetic_v<_Rep1> + && is_arithmetic_v<_Rep2>) /* strengthened */ { + return !(_Left < _Right); + } + +#if _HAS_CXX20 + _EXPORT_STD template + requires three_way_comparable, duration<_Rep2, _Period2>>::rep> + _NODISCARD constexpr auto operator<=>(const duration<_Rep1, _Period1>& _Left, + const duration<_Rep2, _Period2>& _Right) noexcept(is_arithmetic_v<_Rep1> + && is_arithmetic_v<_Rep2>) /* strengthened */ { + using _CT = common_type_t, duration<_Rep2, _Period2>>; + return _CT(_Left).count() <=> _CT(_Right).count(); + } +#endif // _HAS_CXX20 + + _EXPORT_STD template , int> /* = 0 */> + _NODISCARD constexpr _To duration_cast(const duration<_Rep, _Period>& _Dur) noexcept( + is_arithmetic_v<_Rep> && is_arithmetic_v) /* strengthened */ { + // convert duration to another duration; truncate + using _CF = ratio_divide<_Period, typename _To::period>; + + using _ToRep = typename _To::rep; + using _CR = common_type_t<_ToRep, _Rep, intmax_t>; + + constexpr bool _Num_is_one = _CF::num == 1; + constexpr bool _Den_is_one = _CF::den == 1; + + if constexpr (_Den_is_one) { + if constexpr (_Num_is_one) { + return static_cast<_To>(static_cast<_ToRep>(_Dur.count())); + } else { + return static_cast<_To>( + static_cast<_ToRep>(static_cast<_CR>(_Dur.count()) * static_cast<_CR>(_CF::num))); + } + } else { + if constexpr (_Num_is_one) { + return static_cast<_To>( + static_cast<_ToRep>(static_cast<_CR>(_Dur.count()) / static_cast<_CR>(_CF::den))); + } else { + return static_cast<_To>(static_cast<_ToRep>( + static_cast<_CR>(_Dur.count()) * static_cast<_CR>(_CF::num) / static_cast<_CR>(_CF::den))); + } + } + } + + _EXPORT_STD template , int> = 0> + _NODISCARD constexpr _To floor(const duration<_Rep, _Period>& _Dur) noexcept( + is_arithmetic_v<_Rep> && is_arithmetic_v) /* strengthened */ { + // convert duration to another duration; round towards negative infinity + // i.e. the greatest integral result such that the result <= _Dur + const _To _Casted{_CHRONO duration_cast<_To>(_Dur)}; + if (_Casted > _Dur) { + return _To{_Casted.count() - static_cast(1)}; + } + + return _Casted; + } + + _EXPORT_STD template , int> = 0> + _NODISCARD constexpr _To ceil(const duration<_Rep, _Period>& _Dur) noexcept( + is_arithmetic_v<_Rep> && is_arithmetic_v) /* strengthened */ { + // convert duration to another duration; round towards positive infinity + // i.e. the least integral result such that _Dur <= the result + const _To _Casted{_CHRONO duration_cast<_To>(_Dur)}; + if (_Casted < _Dur) { + return _To{_Casted.count() + static_cast(1)}; + } + + return _Casted; + } + + template + constexpr bool _Is_even(_Rep _Val) noexcept(is_arithmetic_v<_Rep>) /* strengthened */ { + // Tests whether _Val is even + return _Val % 2 == 0; + } + + _EXPORT_STD template && !treat_as_floating_point_v, int> = 0> + _NODISCARD constexpr _To round(const duration<_Rep, _Period>& _Dur) noexcept( + is_arithmetic_v<_Rep> && is_arithmetic_v) /* strengthened */ { + // convert duration to another duration, round to nearest, ties to even + const _To _Floored{_CHRONO floor<_To>(_Dur)}; + const _To _Ceiled{_Floored + _To{1}}; + const auto _Floor_adjustment = _Dur - _Floored; + const auto _Ceil_adjustment = _Ceiled - _Dur; + if (_Floor_adjustment < _Ceil_adjustment + || (_Floor_adjustment == _Ceil_adjustment && _Is_even(_Floored.count()))) { + return _Floored; + } + + return _Ceiled; + } + + _EXPORT_STD template ::is_signed, int> = 0> + _NODISCARD constexpr duration<_Rep, _Period> abs(const duration<_Rep, _Period> _Dur) noexcept( + is_arithmetic_v<_Rep>) /* strengthened */ { + // create a duration whose count() is the absolute value of _Dur.count() + if (_Dur < duration<_Rep, _Period>::zero()) { + return -_Dur; + } else { + return _Dur; + } + } + + _EXPORT_STD using nanoseconds = duration; + _EXPORT_STD using microseconds = duration; + _EXPORT_STD using milliseconds = duration; + _EXPORT_STD using seconds = duration; + _EXPORT_STD using minutes = duration>; + _EXPORT_STD using hours = duration>; +#if _HAS_CXX20 + _EXPORT_STD using days = duration, hours::period>>; + _EXPORT_STD using weeks = duration, days::period>>; + _EXPORT_STD using years = duration, days::period>>; + _EXPORT_STD using months = duration>>; +#endif // _HAS_CXX20 + + _EXPORT_STD template + _NODISCARD constexpr time_point<_Clock, common_type_t<_Duration, duration<_Rep, _Period>>> + operator+(const time_point<_Clock, _Duration>& _Left, const duration<_Rep, _Period>& _Right) noexcept( + is_arithmetic_v && is_arithmetic_v<_Rep>) /* strengthened */ { + using _RT = time_point<_Clock, common_type_t<_Duration, duration<_Rep, _Period>>>; + return _RT(_Left.time_since_epoch() + _Right); + } + + _EXPORT_STD template + _NODISCARD constexpr time_point<_Clock, common_type_t, _Duration>> + operator+(const duration<_Rep, _Period>& _Left, const time_point<_Clock, _Duration>& _Right) noexcept( + is_arithmetic_v<_Rep> && is_arithmetic_v) /* strengthened */ { + return _Right + _Left; + } + + _EXPORT_STD template + _NODISCARD constexpr time_point<_Clock, common_type_t<_Duration, duration<_Rep, _Period>>> + operator-(const time_point<_Clock, _Duration>& _Left, const duration<_Rep, _Period>& _Right) noexcept( + is_arithmetic_v && is_arithmetic_v<_Rep>) /* strengthened */ { + using _RT = time_point<_Clock, common_type_t<_Duration, duration<_Rep, _Period>>>; + return _RT(_Left.time_since_epoch() - _Right); + } + + _EXPORT_STD template + _NODISCARD constexpr common_type_t<_Duration1, _Duration2> + operator-(const time_point<_Clock, _Duration1>& _Left, const time_point<_Clock, _Duration2>& _Right) noexcept( + is_arithmetic_v && is_arithmetic_v) /* strengthened */ { + return _Left.time_since_epoch() - _Right.time_since_epoch(); + } + + _EXPORT_STD template + _NODISCARD constexpr bool + operator==(const time_point<_Clock, _Duration1>& _Left, const time_point<_Clock, _Duration2>& _Right) noexcept( + is_arithmetic_v && is_arithmetic_v) /* strengthened */ { + return _Left.time_since_epoch() == _Right.time_since_epoch(); + } + +#if !_HAS_CXX20 + template + _NODISCARD constexpr bool + operator!=(const time_point<_Clock, _Duration1>& _Left, const time_point<_Clock, _Duration2>& _Right) noexcept( + is_arithmetic_v && is_arithmetic_v) /* strengthened */ { + return !(_Left == _Right); + } +#endif // !_HAS_CXX20 + + _EXPORT_STD template + _NODISCARD constexpr bool + operator<(const time_point<_Clock, _Duration1>& _Left, const time_point<_Clock, _Duration2>& _Right) noexcept( + is_arithmetic_v && is_arithmetic_v) /* strengthened */ { + return _Left.time_since_epoch() < _Right.time_since_epoch(); + } + + _EXPORT_STD template + _NODISCARD constexpr bool + operator<=(const time_point<_Clock, _Duration1>& _Left, const time_point<_Clock, _Duration2>& _Right) noexcept( + is_arithmetic_v && is_arithmetic_v) /* strengthened */ { + return !(_Right < _Left); + } + + _EXPORT_STD template + _NODISCARD constexpr bool + operator>(const time_point<_Clock, _Duration1>& _Left, const time_point<_Clock, _Duration2>& _Right) noexcept( + is_arithmetic_v && is_arithmetic_v) /* strengthened */ { + return _Right < _Left; + } + + _EXPORT_STD template + _NODISCARD constexpr bool + operator>=(const time_point<_Clock, _Duration1>& _Left, const time_point<_Clock, _Duration2>& _Right) noexcept( + is_arithmetic_v && is_arithmetic_v) /* strengthened */ { + return !(_Left < _Right); + } + +#if _HAS_CXX20 + _EXPORT_STD template _Duration2> + _NODISCARD constexpr auto + operator<=>(const time_point<_Clock, _Duration1>& _Left, const time_point<_Clock, _Duration2>& _Right) noexcept( + is_arithmetic_v && is_arithmetic_v) /* strengthened */ { + return _Left.time_since_epoch() <=> _Right.time_since_epoch(); + } +#endif // _HAS_CXX20 + + _EXPORT_STD template , int> = 0> + _NODISCARD constexpr time_point<_Clock, _To> time_point_cast(const time_point<_Clock, _Duration>& _Time) noexcept( + is_arithmetic_v && is_arithmetic_v) /* strengthened */ { + // change the duration type of a time_point; truncate + return time_point<_Clock, _To>(_CHRONO duration_cast<_To>(_Time.time_since_epoch())); + } + + _EXPORT_STD template , int> = 0> + _NODISCARD constexpr time_point<_Clock, _To> floor(const time_point<_Clock, _Duration>& _Time) noexcept( + is_arithmetic_v && is_arithmetic_v) /* strengthened */ { + // change the duration type of a time_point; round towards negative infinity + return time_point<_Clock, _To>(_CHRONO floor<_To>(_Time.time_since_epoch())); + } + + _EXPORT_STD template , int> = 0> + _NODISCARD constexpr time_point<_Clock, _To> ceil(const time_point<_Clock, _Duration>& _Time) noexcept( + is_arithmetic_v && is_arithmetic_v) /* strengthened */ { + // change the duration type of a time_point; round towards positive infinity + return time_point<_Clock, _To>(_CHRONO ceil<_To>(_Time.time_since_epoch())); + } + + _EXPORT_STD template && !treat_as_floating_point_v, int> = 0> + _NODISCARD constexpr time_point<_Clock, _To> round(const time_point<_Clock, _Duration>& _Time) noexcept( + is_arithmetic_v && is_arithmetic_v) /* strengthened */ { + // change the duration type of a time_point; round to nearest, ties to even + return time_point<_Clock, _To>(_CHRONO round<_To>(_Time.time_since_epoch())); + } + + _EXPORT_STD struct system_clock { // wraps GetSystemTimePreciseAsFileTime + using rep = long long; + using period = ratio<1, 10'000'000>; // 100 nanoseconds + using duration = _CHRONO duration; + using time_point = _CHRONO time_point; + static constexpr bool is_steady = false; + + _NODISCARD static time_point now() noexcept { // get current time + return time_point(duration(_Xtime_get_ticks())); + } + + _NODISCARD static __time64_t to_time_t(const time_point& _Time) noexcept { // convert to __time64_t + return duration_cast(_Time.time_since_epoch()).count(); + } + + _NODISCARD static time_point from_time_t(__time64_t _Tm) noexcept { // convert from __time64_t + return time_point{seconds{_Tm}}; + } + }; + +#if _HAS_CXX20 + _EXPORT_STD template + using sys_time = time_point; + _EXPORT_STD using sys_seconds = sys_time; + _EXPORT_STD using sys_days = sys_time; +#endif // _HAS_CXX20 + + _EXPORT_STD struct steady_clock { // wraps QueryPerformanceCounter + using rep = long long; + using period = nano; + using duration = nanoseconds; + using time_point = _CHRONO time_point; + static constexpr bool is_steady = true; + +#if defined(_M_ARM) || defined(_M_ARM64) // vvv ARM or ARM64 arch vvv +#define _LIKELY_ARM_ARM64 _LIKELY +#define _LIKELY_X86_X64 +#elif defined(_M_IX86) || defined(_M_X64) // ^^^ ARM or ARM64 arch / x86 or x64 arch vvv +#define _LIKELY_ARM_ARM64 +#define _LIKELY_X86_X64 _LIKELY +#else // ^^^ x86 or x64 arch / other arch vvv +#define _LIKELY_ARM_ARM64 +#define _LIKELY_X86_X64 +#endif // ^^^ other arch ^^^ + _NODISCARD static time_point now() noexcept { // get current time + const long long _Freq = _Query_perf_frequency(); // doesn't change after system boot + const long long _Ctr = _Query_perf_counter(); + static_assert(period::num == 1, "This assumes period::num == 1."); + // The compiler recognizes the constants for frequency and time period and uses shifts and + // multiplies instead of divides to calculate the nanosecond value. + constexpr long long _TenMHz = 10'000'000; + constexpr long long _TwentyFourMHz = 24'000'000; + // clang-format off + if (_Freq == _TenMHz) _LIKELY_X86_X64 { + // 10 MHz is a very common QPC frequency on modern x86/x64 PCs. Optimizing for + // this specific frequency can double the performance of this function by + // avoiding the expensive frequency conversion path. + static_assert(period::den % _TenMHz == 0, "It should never fail."); + constexpr long long _Multiplier = period::den / _TenMHz; + return time_point(duration(_Ctr * _Multiplier)); + } else if (_Freq == _TwentyFourMHz) _LIKELY_ARM_ARM64 { + // 24 MHz is a common frequency on ARM/ARM64, including cases where it emulates x86/x64. + const long long _Whole = (_Ctr / _TwentyFourMHz) * period::den; + const long long _Part = (_Ctr % _TwentyFourMHz) * period::den / _TwentyFourMHz; + return time_point(duration(_Whole + _Part)); + } else { + // Instead of just having "(_Ctr * period::den) / _Freq", + // the algorithm below prevents overflow when _Ctr is sufficiently large. + // It assumes that _Freq * period::den does not overflow, which is currently true for nano period. + // It is not realistic for _Ctr to accumulate to large values from zero with this assumption, + // but the initial value of _Ctr could be large. + const long long _Whole = (_Ctr / _Freq) * period::den; + const long long _Part = (_Ctr % _Freq) * period::den / _Freq; + return time_point(duration(_Whole + _Part)); + } + // clang-format on + } +#undef _LIKELY_ARM_ARM64 +#undef _LIKELY_X86_X64 + }; + + _EXPORT_STD using high_resolution_clock = steady_clock; +} // namespace chrono + +inline namespace literals { + inline namespace chrono_literals { + _EXPORT_STD _NODISCARD constexpr _CHRONO hours operator""h(unsigned long long _Val) noexcept + /* strengthened */ { + return _CHRONO hours(_Val); + } + + _EXPORT_STD _NODISCARD constexpr _CHRONO duration> operator""h(long double _Val) noexcept + /* strengthened */ { + return _CHRONO duration>(_Val); + } + + _EXPORT_STD _NODISCARD constexpr _CHRONO minutes operator""min(unsigned long long _Val) noexcept + /* strengthened */ { + return _CHRONO minutes(_Val); + } + + _EXPORT_STD _NODISCARD constexpr _CHRONO duration> operator""min(long double _Val) noexcept + /* strengthened */ { + return _CHRONO duration>(_Val); + } + + _EXPORT_STD _NODISCARD constexpr _CHRONO seconds operator""s(unsigned long long _Val) noexcept + /* strengthened */ { + return _CHRONO seconds(_Val); + } + + _EXPORT_STD _NODISCARD constexpr _CHRONO duration operator""s(long double _Val) noexcept + /* strengthened */ { + return _CHRONO duration(_Val); + } + + _EXPORT_STD _NODISCARD constexpr _CHRONO milliseconds operator""ms(unsigned long long _Val) noexcept + /* strengthened */ { + return _CHRONO milliseconds(_Val); + } + + _EXPORT_STD _NODISCARD constexpr _CHRONO duration operator""ms(long double _Val) noexcept + /* strengthened */ { + return _CHRONO duration(_Val); + } + + _EXPORT_STD _NODISCARD constexpr _CHRONO microseconds operator""us(unsigned long long _Val) noexcept + /* strengthened */ { + return _CHRONO microseconds(_Val); + } + + _EXPORT_STD _NODISCARD constexpr _CHRONO duration operator""us(long double _Val) noexcept + /* strengthened */ { + return _CHRONO duration(_Val); + } + + _EXPORT_STD _NODISCARD constexpr _CHRONO nanoseconds operator""ns(unsigned long long _Val) noexcept + /* strengthened */ { + return _CHRONO nanoseconds(_Val); + } + + _EXPORT_STD _NODISCARD constexpr _CHRONO duration operator""ns(long double _Val) noexcept + /* strengthened */ { + return _CHRONO duration(_Val); + } + } // namespace chrono_literals +} // namespace literals + +namespace chrono { + _EXPORT_STD using namespace literals::chrono_literals; +} // namespace chrono +_STD_END + +#pragma pop_macro("new") +_STL_RESTORE_CLANG_WARNINGS +#pragma warning(pop) +#pragma pack(pop) +#endif // _STL_COMPILER_PREPROCESSOR +#endif // __MSVC_CHRONO_HPP diff --git a/miniMSVC/VC/Tools/MSVC/14.42.34433/include/__msvc_cxx_stdatomic.hpp b/miniMSVC/VC/Tools/MSVC/14.42.34433/include/__msvc_cxx_stdatomic.hpp new file mode 100644 index 0000000000000000000000000000000000000000..f6874f70a22c9847d02631461f1c9a6a0865c1a2 --- /dev/null +++ b/miniMSVC/VC/Tools/MSVC/14.42.34433/include/__msvc_cxx_stdatomic.hpp @@ -0,0 +1,138 @@ +// __msvc_cxx_stdatomic.hpp internal header + +// Copyright (c) Microsoft Corporation. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +#ifndef __MSVC_CXX_STDATOMIC_HPP +#define __MSVC_CXX_STDATOMIC_HPP + +// see _STL_COMPILER_PREPROCESSOR in yvals_core.h +#if !defined(RC_INVOKED) && !defined(Q_MOC_RUN) && !defined(__midl) + +// provide a specific error message for C compilers, before the general error message in yvals_core.h +#ifndef __cplusplus +#error <__msvc_cxx_stdatomic.hpp> is an internal header. It is incompatible with C and should not be directly included. +#endif // !defined(__cplusplus) + +#include + +#ifdef _M_CEE_PURE +#error is not supported when compiling with /clr:pure. +#endif // defined(_M_CEE_PURE) + +#if !_HAS_CXX23 +_EMIT_STL_WARNING(STL4038, "The contents of are available only with C++23 or later."); +#else // ^^^ !_HAS_CXX23 / _HAS_CXX23 vvv + +#include + +#pragma pack(push, _CRT_PACKING) +#pragma warning(push, _STL_WARNING_LEVEL) +#pragma warning(disable : _STL_DISABLED_WARNINGS) +_STL_DISABLE_CLANG_WARNINGS +#pragma push_macro("new") +#undef new + +template +using _Std_atomic = _STD atomic<_Ty>; + +#define _Atomic(T) _Std_atomic + +using _STD memory_order; +using _STD memory_order_relaxed; +using _STD memory_order_consume; +using _STD memory_order_acquire; +using _STD memory_order_release; +using _STD memory_order_acq_rel; +using _STD memory_order_seq_cst; + +using _STD atomic_flag; + +using _STD atomic_bool; +using _STD atomic_char; +using _STD atomic_schar; +using _STD atomic_uchar; +using _STD atomic_short; +using _STD atomic_ushort; +using _STD atomic_int; +using _STD atomic_uint; +using _STD atomic_long; +using _STD atomic_ulong; +using _STD atomic_llong; +using _STD atomic_ullong; + +#ifdef __cpp_lib_char8_t +using _STD atomic_char8_t; +#endif // defined(__cpp_lib_char8_t) + +using _STD atomic_char16_t; +using _STD atomic_char32_t; +using _STD atomic_wchar_t; +using _STD atomic_int8_t; +using _STD atomic_uint8_t; +using _STD atomic_int16_t; +using _STD atomic_uint16_t; +using _STD atomic_int32_t; +using _STD atomic_uint32_t; +using _STD atomic_int64_t; +using _STD atomic_uint64_t; +using _STD atomic_int_least8_t; +using _STD atomic_uint_least8_t; +using _STD atomic_int_least16_t; +using _STD atomic_uint_least16_t; +using _STD atomic_int_least32_t; +using _STD atomic_uint_least32_t; +using _STD atomic_int_least64_t; +using _STD atomic_uint_least64_t; +using _STD atomic_int_fast8_t; +using _STD atomic_uint_fast8_t; +using _STD atomic_int_fast16_t; +using _STD atomic_uint_fast16_t; +using _STD atomic_int_fast32_t; +using _STD atomic_uint_fast32_t; +using _STD atomic_int_fast64_t; +using _STD atomic_uint_fast64_t; +using _STD atomic_intptr_t; +using _STD atomic_uintptr_t; +using _STD atomic_size_t; +using _STD atomic_ptrdiff_t; +using _STD atomic_intmax_t; +using _STD atomic_uintmax_t; + +using _STD atomic_is_lock_free; +using _STD atomic_load; +using _STD atomic_load_explicit; +using _STD atomic_store; +using _STD atomic_store_explicit; +using _STD atomic_exchange; +using _STD atomic_exchange_explicit; +using _STD atomic_compare_exchange_strong; +using _STD atomic_compare_exchange_strong_explicit; +using _STD atomic_compare_exchange_weak; +using _STD atomic_compare_exchange_weak_explicit; +using _STD atomic_fetch_add; +using _STD atomic_fetch_add_explicit; +using _STD atomic_fetch_sub; +using _STD atomic_fetch_sub_explicit; +using _STD atomic_fetch_or; +using _STD atomic_fetch_or_explicit; +using _STD atomic_fetch_xor; +using _STD atomic_fetch_xor_explicit; +using _STD atomic_fetch_and; +using _STD atomic_fetch_and_explicit; +using _STD atomic_flag_test_and_set; +using _STD atomic_flag_test_and_set_explicit; +using _STD atomic_flag_clear; +using _STD atomic_flag_clear_explicit; + +using _STD atomic_thread_fence; +using _STD atomic_signal_fence; + +#pragma pop_macro("new") +_STL_RESTORE_CLANG_WARNINGS +#pragma warning(pop) +#pragma pack(pop) +#endif // ^^^ _HAS_CXX23 ^^^ + +#endif // !defined(RC_INVOKED) && !defined(Q_MOC_RUN) && !defined(__midl) +#endif // __MSVC_CXX_STDATOMIC_HPP diff --git a/miniMSVC/VC/Tools/MSVC/14.42.34433/include/__msvc_filebuf.hpp b/miniMSVC/VC/Tools/MSVC/14.42.34433/include/__msvc_filebuf.hpp new file mode 100644 index 0000000000000000000000000000000000000000..4d8e76dbc17c84d911bed2d7f5a03d763ce37a34 --- /dev/null +++ b/miniMSVC/VC/Tools/MSVC/14.42.34433/include/__msvc_filebuf.hpp @@ -0,0 +1,790 @@ +// __msvc_filebuf.hpp internal header + +// Copyright (c) Microsoft Corporation. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +#ifndef __MSVC_FILEBUF_HPP +#define __MSVC_FILEBUF_HPP +#include +#if _STL_COMPILER_PREPROCESSOR + +#include +#include + +#pragma pack(push, _CRT_PACKING) +#pragma warning(push, _STL_WARNING_LEVEL) +#pragma warning(disable : _STL_DISABLED_WARNINGS) +_STL_DISABLE_CLANG_WARNINGS +#pragma push_macro("new") +#undef new + +// TRANSITION, ABI: The _Path_ish functions accepting filesystem::path or experimental::filesystem::path are templates +// which always use the same types as a workaround for user code deriving from iostreams types and +// __declspec(dllexport)ing the derived types. Adding member functions to iostreams broke the ABI of such DLLs. +// Deriving and __declspec(dllexport)ing standard library types is not supported, but in this particular case +// the workaround was inexpensive. The workaround will be removed in the next ABI breaking release of the +// Visual C++ Libraries. +_STD_BEGIN +#if _HAS_CXX17 +namespace filesystem { + _EXPORT_STD class path; +} +#endif // _HAS_CXX17 + +#ifndef _FSTREAM_SUPPORTS_EXPERIMENTAL_FILESYSTEM +#ifdef _M_CEE +#define _FSTREAM_SUPPORTS_EXPERIMENTAL_FILESYSTEM 0 +#else // ^^^ defined(_M_CEE) / !defined(_M_CEE) vvv +#define _FSTREAM_SUPPORTS_EXPERIMENTAL_FILESYSTEM 1 +#endif // ^^^ !defined(_M_CEE) ^^^ +#endif // _FSTREAM_SUPPORTS_EXPERIMENTAL_FILESYSTEM + +#if _FSTREAM_SUPPORTS_EXPERIMENTAL_FILESYSTEM +namespace experimental { + namespace filesystem { + inline namespace v1 { + class path; + } + } // namespace filesystem +} // namespace experimental +#endif // _FSTREAM_SUPPORTS_EXPERIMENTAL_FILESYSTEM + +// clang-format off +template +constexpr bool _Is_any_path = _Is_any_of_v<_Ty +#if _FSTREAM_SUPPORTS_EXPERIMENTAL_FILESYSTEM + , experimental::filesystem::path +#endif // _FSTREAM_SUPPORTS_EXPERIMENTAL_FILESYSTEM +#if _HAS_CXX17 + , filesystem::path +#endif // _HAS_CXX17 + >; +// clang-format on + +extern "C++" _CRTIMP2_PURE FILE* __CLRCALL_PURE_OR_CDECL _Fiopen(const char*, ios_base::openmode, int); +extern "C++" _CRTIMP2_PURE FILE* __CLRCALL_PURE_OR_CDECL _Fiopen(const wchar_t*, ios_base::openmode, int); + +template +bool _Fgetc(_Elem& _Ch, FILE* _File) { // get an element from a C stream + return _CSTD fread(&_Ch, sizeof(_Elem), 1, _File) == 1; +} + +template <> +inline bool _Fgetc(char& _Byte, FILE* _File) { // get a char element from a C stream + int _Meta; + if ((_Meta = _CSTD fgetc(_File)) == EOF) { + return false; + } else { // got one, convert to char + _Byte = static_cast(_Meta); + return true; + } +} + +template <> +inline bool _Fgetc(wchar_t& _Wchar, FILE* _File) { // get a wchar_t element from a C stream + wint_t _Meta; + if ((_Meta = _CSTD fgetwc(_File)) == WEOF) { + return false; + } else { // got one, convert to wchar_t + _Wchar = static_cast(_Meta); + return true; + } +} + +#ifdef _CRTBLD +template <> +inline bool _Fgetc(unsigned short& _Wchar, FILE* _File) { // get an unsigned short element from a C stream + wint_t _Meta; + if ((_Meta = _CSTD fgetwc(_File)) == WEOF) { + return false; + } else { // got one, convert to unsigned short + _Wchar = static_cast(_Meta); + return true; + } +} +#endif // defined(_CRTBLD) + +template +bool _Fputc(_Elem _Ch, FILE* _File) { // put an element to a C stream + return _CSTD fwrite(&_Ch, 1, sizeof(_Elem), _File) == sizeof(_Elem); +} + +template <> +inline bool _Fputc(char _Byte, FILE* _File) { // put a char element to a C stream + return _CSTD fputc(_Byte, _File) != EOF; +} + +template <> +inline bool _Fputc(wchar_t _Wchar, FILE* _File) { // put a wchar_t element to a C stream + return _CSTD fputwc(_Wchar, _File) != WEOF; +} + +#ifdef _CRTBLD +template <> +inline bool _Fputc(unsigned short _Wchar, FILE* _File) { // put an unsigned short element to a C stream + return _CSTD fputwc(_Wchar, _File) != WEOF; +} +#endif // defined(_CRTBLD) + +template +bool _Ungetc(const _Elem&, FILE*) { // put back an arbitrary element to a C stream (always fail) + return false; +} + +template <> +inline bool _Ungetc(const char& _Byte, FILE* _File) { // put back a char element to a C stream + return _CSTD ungetc(static_cast(_Byte), _File) != EOF; +} + +template <> +inline bool _Ungetc(const signed char& _Byte, FILE* _File) { // put back a signed char element to a C stream + return _CSTD ungetc(static_cast(_Byte), _File) != EOF; +} + +template <> +inline bool _Ungetc(const unsigned char& _Byte, FILE* _File) { // put back an unsigned char element to a C stream + return _CSTD ungetc(_Byte, _File) != EOF; +} + +template <> +inline bool _Ungetc(const wchar_t& _Wchar, FILE* _File) { // put back a wchar_t element to a C stream + return _CSTD ungetwc(_Wchar, _File) != WEOF; +} + +#ifdef _CRTBLD +template <> +inline bool _Ungetc(const unsigned short& _Wchar, FILE* _File) { // put back an unsigned short element to a C stream + return _CSTD ungetwc(_Wchar, _File) != WEOF; +} +#endif // defined(_CRTBLD) + +_EXPORT_STD template +class basic_filebuf : public basic_streambuf<_Elem, _Traits> { // stream buffer associated with a C stream +public: + using _Mysb = basic_streambuf<_Elem, _Traits>; + using _Cvt = codecvt<_Elem, char, typename _Traits::state_type>; + + basic_filebuf() : _Mysb() { + _Init(nullptr, _Newfl); + } + + explicit basic_filebuf(FILE* const _File) : _Mysb() { // extension + _Init(_File, _Newfl); + } + + __CLR_OR_THIS_CALL ~basic_filebuf() noexcept override { + if (_Myfile) { + _Reset_back(); // revert from _Mychar buffer + } + + if (_Closef) { + close(); + } + } + + using int_type = typename _Traits::int_type; + using pos_type = typename _Traits::pos_type; + using off_type = typename _Traits::off_type; + + basic_filebuf(_Uninitialized) noexcept : _Mysb(_Noinit) {} + + basic_filebuf(basic_filebuf&& _Right) { + _Init(_Right._Myfile, _Newfl); // match buffering styles + _Init(static_cast(nullptr), _Closefl); // then make *this look closed + _Assign_rv(_STD move(_Right)); + } + + basic_filebuf& operator=(basic_filebuf&& _Right) { + _Assign_rv(_STD move(_Right)); + return *this; + } + + void _Assign_rv(basic_filebuf&& _Right) { + if (this != _STD addressof(_Right)) { + close(); + this->swap(_Right); + } + } + + void swap(basic_filebuf& _Right) noexcept /* strengthened */ { + if (this != _STD addressof(_Right)) { + FILE* _Myfile_sav = _Myfile; + const _Cvt* _Pcvt_sav = _Pcvt; + typename _Traits::state_type _State_sav = _State; + bool _Wrotesome_sav = _Wrotesome; + bool _Closef_sav = _Closef; + bool _Set_eback_sav = _Mysb::eback() == &_Mychar; + bool _Set_eback_live = _Mysb::gptr() == &_Mychar; + + _Elem* _Pfirst0 = _Mysb::pbase(); + _Elem* _Pnext0 = _Mysb::pptr(); + _Elem* _Pend = _Mysb::epptr(); + _Elem* _Gfirst0 = _Mysb::eback(); + _Elem* _Gnext0 = _Mysb::gptr(); + _Elem* _Gend = _Mysb::egptr(); + + // reinitialize *this + _Init(_Right._Myfile, _Right._Myfile ? _Openfl : _Newfl); + _Mysb::setp(_Right.pbase(), _Right.pptr(), _Right.epptr()); + if (_Right.eback() != &_Right._Mychar) { + _Mysb::setg(_Right.eback(), _Right.gptr(), _Right.egptr()); + } else if (_Right.gptr() != &_Right._Mychar) { + _Mysb::setg(&_Mychar, &_Mychar + 1, &_Mychar + 1); + } else { + _Mysb::setg(&_Mychar, &_Mychar, &_Mychar + 1); + } + + _Pcvt = _Right._Pcvt; + _State = _Right._State; + _Wrotesome = _Right._Wrotesome; + _Closef = _Right._Closef; + + // reinitialize _Right + _Right._Init(_Myfile_sav, _Myfile_sav ? _Openfl : _Newfl); + _Right.setp(_Pfirst0, _Pnext0, _Pend); + if (!_Set_eback_sav) { + _Right.setg(_Gfirst0, _Gnext0, _Gend); + } else if (!_Set_eback_live) { + _Right.setg(&_Right._Mychar, &_Right._Mychar + 1, &_Right._Mychar + 1); + } else { + _Right.setg(&_Right._Mychar, &_Right._Mychar, &_Right._Mychar + 1); + } + + _Right._Pcvt = _Pcvt_sav; + _Right._State = _State_sav; + _Right._Wrotesome = _Wrotesome_sav; + _Right._Closef = _Closef_sav; + + // swap ancillary data + _STD swap(_Set_eback, _Right._Set_eback); + _STD swap(_Set_egptr, _Right._Set_egptr); + + _STD swap(_Mychar, _Right._Mychar); + _STD swap(_Mysb::_Plocale, _Right._Plocale); + } + } + + basic_filebuf(const basic_filebuf&) = delete; + basic_filebuf& operator=(const basic_filebuf&) = delete; + + enum _Initfl { // reasons for a call to _Init + _Newfl, + _Openfl, + _Closefl + }; + + _NODISCARD bool is_open() const noexcept /* strengthened */ { + return static_cast(_Myfile); + } + + basic_filebuf* open(const char* _Filename, ios_base::openmode _Mode, int _Prot = ios_base::_Default_open_prot) { + // _Prot is an extension + if (_Myfile) { + return nullptr; + } + + const auto _File = _Fiopen(_Filename, _Mode, _Prot); + if (!_File) { + return nullptr; // open failed + } + + _Init(_File, _Openfl); + _Initcvt(_STD use_facet<_Cvt>(_Mysb::getloc())); + return this; // open succeeded + } + + basic_filebuf* open(const string& _Str, ios_base::openmode _Mode, int _Prot = ios_base::_Default_open_prot) { + // _Prot is an extension + return open(_Str.c_str(), _Mode, _Prot); + } + +#if _HAS_OLD_IOSTREAMS_MEMBERS + basic_filebuf* open(const char* _Filename, ios_base::open_mode _Mode) { + return open(_Filename, static_cast(_Mode)); + } +#endif // _HAS_OLD_IOSTREAMS_MEMBERS + + basic_filebuf* open(const wchar_t* _Filename, ios_base::openmode _Mode, int _Prot = ios_base::_Default_open_prot) { + // in standard as const std::filesystem::path::value_type *; _Prot is an extension + if (_Myfile) { + return nullptr; + } + + const auto _File = _Fiopen(_Filename, _Mode, _Prot); + if (!_File) { + return nullptr; // open failed + } + + _Init(_File, _Openfl); + _Initcvt(_STD use_facet<_Cvt>(_Mysb::getloc())); + return this; // open succeeded + } + + basic_filebuf* open(const wstring& _Str, ios_base::openmode _Mode, int _Prot = ios_base::_Default_open_prot) { + // extension + return open(_Str.c_str(), _Mode, _Prot); + } + +#if _FSTREAM_SUPPORTS_EXPERIMENTAL_FILESYSTEM + template + basic_filebuf* open( + const _Identity_t<_Path_ish>& _Path, ios_base::openmode _Mode, int _Prot = ios_base::_Default_open_prot) { + // _Prot is an extension + return open(_Path.c_str(), _Mode, _Prot); + } +#endif // _FSTREAM_SUPPORTS_EXPERIMENTAL_FILESYSTEM + +#if _HAS_CXX17 + template + basic_filebuf* open( + const _Identity_t<_Path_ish>& _Path, ios_base::openmode _Mode, int _Prot = ios_base::_Default_open_prot) { + // _Prot is an extension + return open(_Path.c_str(), _Mode, _Prot); + } +#endif // _HAS_CXX17 + +#if _HAS_OLD_IOSTREAMS_MEMBERS + basic_filebuf* open(const wchar_t* _Filename, ios_base::open_mode _Mode) { + // in standard as const std::filesystem::path::value_type * + return open(_Filename, static_cast(_Mode)); + } +#endif // _HAS_OLD_IOSTREAMS_MEMBERS + + basic_filebuf* close() { + basic_filebuf* _Ans; + if (_Myfile) { // put any homing sequence and close file + _Reset_back(); // revert from _Mychar buffer + + _Ans = this; + if (!_Endwrite()) { + _Ans = nullptr; + } + + if (_CSTD fclose(_Myfile) != 0) { + _Ans = nullptr; + } + } else { + _Ans = nullptr; + } + + _Init(nullptr, _Closefl); + return _Ans; + } + + void __CLR_OR_THIS_CALL _Lock() override { // lock file instead of stream buffer + if (_Myfile) { + _CSTD _lock_file(_Myfile); + } + } + + void __CLR_OR_THIS_CALL _Unlock() override { // unlock file instead of stream buffer + if (_Myfile) { + _CSTD _unlock_file(_Myfile); + } + } + +#if _HAS_CXX23 && defined(_CPPRTTI) + template + friend ios_base::iostate _Print_noformat_unicode(ostream&, string_view); +#endif + +protected: + int_type __CLR_OR_THIS_CALL overflow(int_type _Meta = _Traits::eof()) override { // put an element to stream + if (_Traits::eq_int_type(_Traits::eof(), _Meta)) { + return _Traits::not_eof(_Meta); // EOF, return success code + } + + if (_Mysb::pptr() && _Mysb::pptr() < _Mysb::epptr()) { // room in buffer, store it + *_Mysb::_Pninc() = _Traits::to_char_type(_Meta); + return _Meta; + } + + if (!_Myfile) { + return _Traits::eof(); // no open C stream, fail + } + + _Reset_back(); // revert from _Mychar buffer + if (!_Pcvt) { // no codecvt facet, put as is + return _Fputc(_Traits::to_char_type(_Meta), _Myfile) ? _Meta : _Traits::eof(); + } + + // put using codecvt facet + constexpr size_t _Codecvt_temp_buf = 32; + char _Str[_Codecvt_temp_buf]; + const _Elem _Ch = _Traits::to_char_type(_Meta); + const _Elem* _Src; + char* _Dest; + + // test result of converting one element + switch (_Pcvt->out(_State, &_Ch, &_Ch + 1, _Src, _Str, _Str + _Codecvt_temp_buf, _Dest)) { + case codecvt_base::partial: + case codecvt_base::ok: + { // converted something, try to put it out + const auto _Count = static_cast(_Dest - _Str); + if (0 < _Count && _Count != static_cast(_CSTD fwrite(_Str, 1, _Count, _Myfile))) { + return _Traits::eof(); // write failed + } + + _Wrotesome = true; // write succeeded + if (_Src != &_Ch) { + return _Meta; // converted whole element + } + + return _Traits::eof(); // conversion failed + } + + case codecvt_base::noconv: + // no conversion, put as is + return _Fputc(_Ch, _Myfile) ? _Meta : _Traits::eof(); + + default: + return _Traits::eof(); // conversion failed + } + } + + int_type __CLR_OR_THIS_CALL pbackfail(int_type _Meta = _Traits::eof()) override { + // put an element back to stream + if (_Mysb::gptr() && _Mysb::eback() < _Mysb::gptr() + && (_Traits::eq_int_type(_Traits::eof(), _Meta) + || _Traits::eq_int_type(_Traits::to_int_type(_Mysb::gptr()[-1]), + _Meta))) { // just back up position + _Mysb::_Gndec(); + return _Traits::not_eof(_Meta); + } else if (!_Myfile || _Traits::eq_int_type(_Traits::eof(), _Meta)) { + return _Traits::eof(); // no open C stream or EOF, fail + } else if (!_Pcvt && _Ungetc(_Traits::to_char_type(_Meta), _Myfile)) { + return _Meta; // no facet and unget succeeded, return + } else if (_Mysb::gptr() != &_Mychar) { // putback to _Mychar + _Mychar = _Traits::to_char_type(_Meta); + _Set_back(); // switch to _Mychar buffer + return _Meta; + } else { + return _Traits::eof(); // nowhere to put back + } + } + + int_type __CLR_OR_THIS_CALL underflow() override { // get an element from stream, but don't point past it + int_type _Meta; + if (_Mysb::gptr() && _Mysb::gptr() < _Mysb::egptr()) { + return _Traits::to_int_type(*_Mysb::gptr()); // return buffered + } else if (_Traits::eq_int_type(_Traits::eof(), _Meta = uflow())) { + return _Meta; // uflow failed, return EOF + } else { // get a char, don't point past it + pbackfail(_Meta); + return _Meta; + } + } + + int_type __CLR_OR_THIS_CALL uflow() override { // get an element from stream, point past it + if (_Mysb::gptr() && _Mysb::gptr() < _Mysb::egptr()) { + return _Traits::to_int_type(*_Mysb::_Gninc()); // return buffered + } + + if (!_Myfile) { + return _Traits::eof(); // no open C stream, fail + } + + _Reset_back(); // revert from _Mychar buffer + if (!_Pcvt) { // no codecvt facet, just get it + _Elem _Ch; + return _Fgetc(_Ch, _Myfile) ? _Traits::to_int_type(_Ch) : _Traits::eof(); + } + + // build string until codecvt succeeds + string _Str; + + for (;;) { // get using codecvt facet + const char* _Src; + int _Meta = _CSTD fgetc(_Myfile); + + if (_Meta == EOF) { + return _Traits::eof(); // partial char? + } + + _Str.push_back(static_cast(_Meta)); // append byte and convert + + _Elem _Ch; + _Elem* _Dest; + + // test result of converting one element + switch (_Pcvt->in(_State, _Str.data(), _Str.data() + _Str.size(), _Src, &_Ch, &_Ch + 1, _Dest)) { + case codecvt_base::partial: + case codecvt_base::ok: + if (_Dest != &_Ch) { // got an element, put back excess and deliver it + auto _Nleft = _Str.data() + _Str.size() - _Src; + while (0 < _Nleft) { + _CSTD ungetc(_Src[--_Nleft], _Myfile); + } + + return _Traits::to_int_type(_Ch); + } + + _Str.erase(0, static_cast(_Src - _Str.data())); // partial, discard used input + break; + + case codecvt_base::noconv: + // noconv is only possible if _Elem is char, so we can use it directly + return static_cast(_Str.front()); + + default: + return _Traits::eof(); // conversion failed + } + } + } + + streamsize __CLR_OR_THIS_CALL xsgetn(_Elem* _Ptr, streamsize _Count) override { + // get _Count characters from stream + if constexpr (sizeof(_Elem) == 1) { + if (_Count <= 0) { + return 0; + } + + if (_Pcvt) { // if we need a nontrivial codecvt transform, do the default expensive thing + return _Mysb::xsgetn(_Ptr, _Count); + } + + // assuming this is OK because _Ptr + _Count must be valid + auto _Count_s = static_cast(_Count); + const auto _Start_count = _Count; + const auto _Available = static_cast(_Mysb::_Gnavail()); + if (0 < _Available) { // copy from get area + const auto _Read_size = (_STD min)(_Count_s, _Available); + _Traits::copy(_Ptr, _Mysb::gptr(), _Read_size); + _Ptr += _Read_size; + _Count_s -= _Read_size; + _Mysb::gbump(static_cast(_Read_size)); + } + + if (_Myfile) { // open C stream, attempt read + _Reset_back(); // revert from _Mychar buffer + // process in 4k - 1 chunks to avoid tripping over fread's clobber-the-end behavior when + // doing \r\n -> \n translation + constexpr size_t _Read_size = 4095; // _INTERNAL_BUFSIZ - 1 + while (_Read_size < _Count_s) { + const auto _Actual_read = _CSTD fread(_Ptr, sizeof(_Elem), _Read_size, _Myfile); + _Ptr += _Actual_read; + _Count_s -= _Actual_read; + if (_Actual_read != _Read_size) { + return static_cast(_Start_count - _Count_s); + } + } + + if (0 < _Count_s) { + _Count_s -= _CSTD fread(_Ptr, sizeof(_Elem), _Count_s, _Myfile); + } + } + + return static_cast(_Start_count - _Count_s); + } else { // non-chars always get element-by-element processing + return _Mysb::xsgetn(_Ptr, _Count); + } + } + + streamsize __CLR_OR_THIS_CALL xsputn(const _Elem* _Ptr, streamsize _Count) override { + // put _Count characters to stream + if constexpr (sizeof(_Elem) == 1) { + if (_Pcvt) { // if we need a nontrivial codecvt transform, do the default expensive thing + return _Mysb::xsputn(_Ptr, _Count); + } + + const streamsize _Start_count = _Count; + streamsize _Size = _Mysb::_Pnavail(); + if (0 < _Count && 0 < _Size) { // copy to write buffer + if (_Count < _Size) { + _Size = _Count; + } + + _Traits::copy(_Mysb::pptr(), _Ptr, static_cast(_Size)); + _Ptr += _Size; + _Count -= _Size; + _Mysb::pbump(static_cast(_Size)); + } + + if (0 < _Count && _Myfile) { // open C stream, attempt write + _Count -= _CSTD fwrite(_Ptr, sizeof(_Elem), static_cast(_Count), _Myfile); + } + + return _Start_count - _Count; + } else { // non-chars always get element-by-element processing + return _Mysb::xsputn(_Ptr, _Count); + } + } + + pos_type __CLR_OR_THIS_CALL seekoff(off_type _Off, ios_base::seekdir _Way, + ios_base::openmode = ios_base::in | ios_base::out) override { // change position by _Off + fpos_t _Fileposition; + + if (_Mysb::gptr() == &_Mychar // something putback + && _Way == ios_base::cur // a relative seek + && !_Pcvt) { // not converting + _Off -= static_cast(sizeof(_Elem)); // back up over _Elem bytes + } + + if (!_Myfile || !_Endwrite() + || ((_Off != 0 || _Way != ios_base::cur) && _CSTD _fseeki64(_Myfile, _Off, _Way) != 0) + || _CSTD fgetpos(_Myfile, &_Fileposition) != 0) { + return pos_type{off_type{-1}}; // report failure + } + + _Reset_back(); // revert from _Mychar buffer, discarding any putback + return pos_type{_State, _Fileposition}; // return new position + } + + pos_type __CLR_OR_THIS_CALL seekpos(pos_type _Pos, ios_base::openmode = ios_base::in | ios_base::out) override { + // change position to _Pos + off_type _Off = static_cast(_Pos); + + if (!_Myfile || !_Endwrite() || _CSTD fsetpos(_Myfile, &_Off) != 0) { + return pos_type{off_type{-1}}; // report failure + } + + _State = _Pos.state(); + _Reset_back(); // revert from _Mychar buffer, discarding any putback + return pos_type{_State, _Off}; // return new position + } + + _Mysb* __CLR_OR_THIS_CALL setbuf(_Elem* _Buffer, streamsize _Count) override { // offer _Buffer to C stream + int _Mode; + if (!_Buffer && _Count == 0) { + _Mode = _IONBF; + } else { + _Mode = _IOFBF; + } + + const size_t _Size = static_cast(_Count) * sizeof(_Elem); + + if (!_Myfile || _CSTD setvbuf(_Myfile, reinterpret_cast(_Buffer), _Mode, _Size) != 0) { + return nullptr; // failed + } + + // new buffer, reinitialize pointers + _Init(_Myfile, _Openfl); + return this; + } + + int __CLR_OR_THIS_CALL sync() override { // synchronize C stream with external file + if (!_Myfile || _Traits::eq_int_type(_Traits::eof(), overflow()) || 0 <= _CSTD fflush(_Myfile)) { + return 0; + } + + return -1; + } + + void __CLR_OR_THIS_CALL imbue(const locale& _Loc) override { + // set locale to argument (capture nontrivial codecvt facet) + _Initcvt(_STD use_facet<_Cvt>(_Loc)); + } + + void _Init(FILE* _File, _Initfl _Which) noexcept { // initialize to C stream _File after {new, open, close} + using _State_type = typename _Traits::state_type; + + __PURE_APPDOMAIN_GLOBAL static _State_type _Stinit; // initial state + + _Closef = _Which == _Openfl; + _Wrotesome = false; + + _Mysb::_Init(); // initialize stream buffer base object + + if (_File && sizeof(_Elem) == 1) { // point inside C stream with [first, first + count) buffer + _Elem** _Pb = nullptr; + _Elem** _Pn = nullptr; + int* _Nr = nullptr; + + ::_get_stream_buffer_pointers( + _File, reinterpret_cast(&_Pb), reinterpret_cast(&_Pn), &_Nr); + int* _Nw = _Nr; + + _Mysb::_Init(_Pb, _Pn, _Nr, _Pb, _Pn, _Nw); + } + + _Myfile = _File; + _State = _Stinit; + _Pcvt = nullptr; // pointer to codecvt facet + } + + bool _Endwrite() { // put shift to initial conversion state, as needed + if (!_Pcvt || !_Wrotesome) { + return true; + } + + // may have to put + if (_Traits::eq_int_type(_Traits::eof(), overflow())) { + return false; + } + + constexpr size_t _Codecvt_temp_buf = 32; + char _Str[_Codecvt_temp_buf]; + char* _Dest; + switch (_Pcvt->unshift(_State, _Str, _Str + _Codecvt_temp_buf, _Dest)) { // test result of homing conversion + case codecvt_base::ok: + _Wrotesome = false; // homed successfully + _FALLTHROUGH; + + case codecvt_base::partial: + { // put any generated bytes + const auto _Count = static_cast(_Dest - _Str); + if (0 < _Count && _Count != static_cast(_CSTD fwrite(_Str, 1, _Count, _Myfile))) { + return false; // write failed + } + + return !_Wrotesome; + } + + case codecvt_base::noconv: + _Wrotesome = false; // homed successfully + return true; // nothing else to do + + default: + return false; // conversion failed + } + } + + void _Initcvt(const _Cvt& _Newcvt) noexcept { // initialize codecvt pointer + if (_Newcvt.always_noconv()) { + _Pcvt = nullptr; // nothing to do + } else { // set up for nontrivial codecvt facet + _Pcvt = _STD addressof(_Newcvt); + _Mysb::_Init(); // reset any buffering + } + } + +private: + const _Cvt* _Pcvt; // pointer to codecvt facet (may be null) + _Elem _Mychar; // putback character, when _Ungetc fails + bool _Wrotesome; // true if homing sequence may be needed + typename _Traits::state_type _State; // current conversion state + bool _Closef; // true if C stream must be closed + FILE* _Myfile; // pointer to C stream + + void _Reset_back() noexcept { // restore buffer after putback + if (_Mysb::eback() == &_Mychar) { + _Mysb::setg(_Set_eback, _Set_eback, _Set_egptr); + } + } + + void _Set_back() noexcept { // set up putback area + if (_Mysb::eback() != &_Mychar) { // save current get buffer + _Set_eback = _Mysb::eback(); + _Set_egptr = _Mysb::egptr(); + } + _Mysb::setg(&_Mychar, &_Mychar, &_Mychar + 1); + } + + _Elem* _Set_eback; // saves eback() during one-element putback + _Elem* _Set_egptr; // saves egptr() +}; + +_EXPORT_STD template +void swap(basic_filebuf<_Elem, _Traits>& _Left, basic_filebuf<_Elem, _Traits>& _Right) noexcept /* strengthened */ { + _Left.swap(_Right); +} + +_STD_END + +#pragma pop_macro("new") +_STL_RESTORE_CLANG_WARNINGS +#pragma warning(pop) +#pragma pack(pop) + +#endif // _STL_COMPILER_PREPROCESSOR +#endif // __MSVC_FILEBUF_HPP diff --git a/miniMSVC/VC/Tools/MSVC/14.42.34433/include/__msvc_format_ucd_tables.hpp b/miniMSVC/VC/Tools/MSVC/14.42.34433/include/__msvc_format_ucd_tables.hpp new file mode 100644 index 0000000000000000000000000000000000000000..15699df88f101562183611209f3b9c1f6090b86a --- /dev/null +++ b/miniMSVC/VC/Tools/MSVC/14.42.34433/include/__msvc_format_ucd_tables.hpp @@ -0,0 +1,551 @@ +// __msvc_format_ucd_tables.hpp internal header + +// Copyright (c) Microsoft Corporation. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +// WARNING, this entire header is generated by +// tools/unicode_properties_parse/unicode_properties_data_gen.py +// DO NOT MODIFY! + +// UNICODE, INC. LICENSE AGREEMENT - DATA FILES AND SOFTWARE +// +// See Terms of Use +// for definitions of Unicode Inc.'s Data Files and Software. +// +// NOTICE TO USER: Carefully read the following legal agreement. +// BY DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING UNICODE INC.'S +// DATA FILES ("DATA FILES"), AND/OR SOFTWARE ("SOFTWARE"), +// YOU UNEQUIVOCALLY ACCEPT, AND AGREE TO BE BOUND BY, ALL OF THE +// TERMS AND CONDITIONS OF THIS AGREEMENT. +// IF YOU DO NOT AGREE, DO NOT DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE +// THE DATA FILES OR SOFTWARE. +// +// COPYRIGHT AND PERMISSION NOTICE +// +// Copyright (c) 1991-2022 Unicode, Inc. All rights reserved. +// Distributed under the Terms of Use in https://www.unicode.org/copyright.html. +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of the Unicode data files and any associated documentation +// (the "Data Files") or Unicode software and any associated documentation +// (the "Software") to deal in the Data Files or Software +// without restriction, including without limitation the rights to use, +// copy, modify, merge, publish, distribute, and/or sell copies of +// the Data Files or Software, and to permit persons to whom the Data Files +// or Software are furnished to do so, provided that either +// (a) this copyright and permission notice appear with all copies +// of the Data Files or Software, or +// (b) this copyright and permission notice appear in associated +// Documentation. +// +// THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF +// ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +// WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT OF THIRD PARTY RIGHTS. +// IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS +// NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL +// DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, +// DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER +// TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +// PERFORMANCE OF THE DATA FILES OR SOFTWARE. +// +// Except as contained in this notice, the name of a copyright holder +// shall not be used in advertising or otherwise to promote the sale, +// use or other dealings in these Data Files or Software without prior +// written authorization of the copyright holder. + +#ifndef __MSVC_FORMAT_UCD_TABLES_HPP +#define __MSVC_FORMAT_UCD_TABLES_HPP +#include +#if _STL_COMPILER_PREPROCESSOR + +#include +#include + +#pragma pack(push, _CRT_PACKING) +#pragma warning(push, _STL_WARNING_LEVEL) +#pragma warning(disable : _STL_DISABLED_WARNINGS) +_STL_DISABLE_CLANG_WARNINGS +#pragma push_macro("new") +#undef new + +_STD_BEGIN + +template +struct _Unicode_property_data { + uint32_t _Lower_bounds[_NumRanges]; + uint16_t _Props_and_size[_NumRanges]; + _NODISCARD constexpr _ValueEnum _Get_property_for_codepoint(const uint32_t _Code_point) const noexcept { + ptrdiff_t _Upper_idx = _STD upper_bound(_Lower_bounds, _STD end(_Lower_bounds), _Code_point) - _Lower_bounds; + constexpr auto _No_value_constant = static_cast<_ValueEnum>(UINT8_MAX); + if (_Upper_idx == 0) { + return _No_value_constant; + } + --_Upper_idx; + const uint32_t _Lower_bound = _Lower_bounds[_Upper_idx]; + const uint16_t _Data = _Props_and_size[_Upper_idx]; + _STL_INTERNAL_CHECK(_Code_point >= _Lower_bound); + if constexpr (_Is_binary_property) { + if (_Code_point < _Lower_bound + _Data) { + return static_cast<_ValueEnum>(0); + } + } else { + const uint16_t _Size = static_cast(_Data & 0x0FFF); + const _ValueEnum _Prop = static_cast<_ValueEnum>((_Data & 0xF000) >> 12); + if (_Code_point < _Lower_bound + _Size) { + return _Prop; + } + } + return _No_value_constant; + } +}; + +// The following static data tables are generated from the Unicode character database. +// _Grapheme_Break_property_data comes from ucd/auxiliary/GraphemeBreakProperty.txt. +// +// _Extended_Pictographic_property_data comes from ucd/emoji/emoji-data.txt. +// +// __printable_property_data comes from ucd/extracted/DerivedGeneralCategory.txt. +// +// _Grapheme_Extend_property_data comes from ucd/DerivedCoreProperties.txt. +// +// The enums containing the values for the properties are also generated, in order to ensure they match +// up correctly with how we're parsing them. +// +// All sets of data tables are generated by tools/unicode_properties_parse/unicode_properties_data_gen.py in the +// https://github.com/microsoft/stl repository. +// +// The data format is a set of arrays for each character property. The first is an array of uint32_t encoding +// the lower bound of each range of codepoints that has the given property. +// The second is an array of uint16_t. +// - For enumerated properties, this array encodes both the range size and property value as follows: +// 16 12 0 +// +-----------------------------------------------------+ +// | property_value | range_size | +// +-----------------------------------------------------+ +// that is: the size is stored in the least significant 12 bits +// (leading to a max size of 4095), and the property value is stored in the most significant 4 bits, +// leading to a maximum of 16 property values. +// - For binary properties, this array simply stores the range size. +// +// Codepoint ranges may not overlap, and, within one property, a codepoint may only appear once. Furthermore the +// codepoint lower bounds appear in sorted (ascending) order. + +// GraphemeBreakProperty-15.0.0.txt +// Date: 2022-04-27, 17:07:38 GMT +enum class _Grapheme_Break_property_values : uint8_t { + _CR_value, + _Control_value, + _Extend_value, + _L_value, + _LF_value, + _LV_value, + _LVT_value, + _Prepend_value, + _Regional_Indicator_value, + _SpacingMark_value, + _T_value, + _V_value, + _ZWJ_value, + _No_value = 255 +}; + +// GraphemeBreakProperty-15.0.0.txt +// Date: 2022-04-27, 17:07:38 GMT +inline constexpr _Unicode_property_data<_Grapheme_Break_property_values, 1371, false> _Grapheme_Break_property_data{ + {0x0, 0xa, 0xb, 0xd, 0xe, 0x7f, 0xad, 0x300, 0x483, 0x591, 0x5bf, 0x5c1, 0x5c4, 0x5c7, 0x600, 0x610, 0x61c, 0x64b, + 0x670, 0x6d6, 0x6dd, 0x6df, 0x6e7, 0x6ea, 0x70f, 0x711, 0x730, 0x7a6, 0x7eb, 0x7fd, 0x816, 0x81b, 0x825, 0x829, + 0x859, 0x890, 0x898, 0x8ca, 0x8e2, 0x8e3, 0x903, 0x93a, 0x93b, 0x93c, 0x93e, 0x941, 0x949, 0x94d, 0x94e, 0x951, + 0x962, 0x981, 0x982, 0x9bc, 0x9be, 0x9bf, 0x9c1, 0x9c7, 0x9cb, 0x9cd, 0x9d7, 0x9e2, 0x9fe, 0xa01, 0xa03, 0xa3c, + 0xa3e, 0xa41, 0xa47, 0xa4b, 0xa51, 0xa70, 0xa75, 0xa81, 0xa83, 0xabc, 0xabe, 0xac1, 0xac7, 0xac9, 0xacb, 0xacd, + 0xae2, 0xafa, 0xb01, 0xb02, 0xb3c, 0xb3e, 0xb40, 0xb41, 0xb47, 0xb4b, 0xb4d, 0xb55, 0xb62, 0xb82, 0xbbe, 0xbbf, + 0xbc0, 0xbc1, 0xbc6, 0xbca, 0xbcd, 0xbd7, 0xc00, 0xc01, 0xc04, 0xc3c, 0xc3e, 0xc41, 0xc46, 0xc4a, 0xc55, 0xc62, + 0xc81, 0xc82, 0xcbc, 0xcbe, 0xcbf, 0xcc0, 0xcc2, 0xcc3, 0xcc6, 0xcc7, 0xcca, 0xccc, 0xcd5, 0xce2, 0xcf3, 0xd00, + 0xd02, 0xd3b, 0xd3e, 0xd3f, 0xd41, 0xd46, 0xd4a, 0xd4d, 0xd4e, 0xd57, 0xd62, 0xd81, 0xd82, 0xdca, 0xdcf, 0xdd0, + 0xdd2, 0xdd6, 0xdd8, 0xddf, 0xdf2, 0xe31, 0xe33, 0xe34, 0xe47, 0xeb1, 0xeb3, 0xeb4, 0xec8, 0xf18, 0xf35, 0xf37, + 0xf39, 0xf3e, 0xf71, 0xf7f, 0xf80, 0xf86, 0xf8d, 0xf99, 0xfc6, 0x102d, 0x1031, 0x1032, 0x1039, 0x103b, 0x103d, + 0x1056, 0x1058, 0x105e, 0x1071, 0x1082, 0x1084, 0x1085, 0x108d, 0x109d, 0x1100, 0x1160, 0x11a8, 0x135d, 0x1712, + 0x1715, 0x1732, 0x1734, 0x1752, 0x1772, 0x17b4, 0x17b6, 0x17b7, 0x17be, 0x17c6, 0x17c7, 0x17c9, 0x17dd, 0x180b, + 0x180e, 0x180f, 0x1885, 0x18a9, 0x1920, 0x1923, 0x1927, 0x1929, 0x1930, 0x1932, 0x1933, 0x1939, 0x1a17, 0x1a19, + 0x1a1b, 0x1a55, 0x1a56, 0x1a57, 0x1a58, 0x1a60, 0x1a62, 0x1a65, 0x1a6d, 0x1a73, 0x1a7f, 0x1ab0, 0x1b00, 0x1b04, + 0x1b34, 0x1b3b, 0x1b3c, 0x1b3d, 0x1b42, 0x1b43, 0x1b6b, 0x1b80, 0x1b82, 0x1ba1, 0x1ba2, 0x1ba6, 0x1ba8, 0x1baa, + 0x1bab, 0x1be6, 0x1be7, 0x1be8, 0x1bea, 0x1bed, 0x1bee, 0x1bef, 0x1bf2, 0x1c24, 0x1c2c, 0x1c34, 0x1c36, 0x1cd0, + 0x1cd4, 0x1ce1, 0x1ce2, 0x1ced, 0x1cf4, 0x1cf7, 0x1cf8, 0x1dc0, 0x200b, 0x200c, 0x200d, 0x200e, 0x2028, 0x2060, + 0x20d0, 0x2cef, 0x2d7f, 0x2de0, 0x302a, 0x3099, 0xa66f, 0xa674, 0xa69e, 0xa6f0, 0xa802, 0xa806, 0xa80b, 0xa823, + 0xa825, 0xa827, 0xa82c, 0xa880, 0xa8b4, 0xa8c4, 0xa8e0, 0xa8ff, 0xa926, 0xa947, 0xa952, 0xa960, 0xa980, 0xa983, + 0xa9b3, 0xa9b4, 0xa9b6, 0xa9ba, 0xa9bc, 0xa9be, 0xa9e5, 0xaa29, 0xaa2f, 0xaa31, 0xaa33, 0xaa35, 0xaa43, 0xaa4c, + 0xaa4d, 0xaa7c, 0xaab0, 0xaab2, 0xaab7, 0xaabe, 0xaac1, 0xaaeb, 0xaaec, 0xaaee, 0xaaf5, 0xaaf6, 0xabe3, 0xabe5, + 0xabe6, 0xabe8, 0xabe9, 0xabec, 0xabed, 0xac00, 0xac01, 0xac1c, 0xac1d, 0xac38, 0xac39, 0xac54, 0xac55, 0xac70, + 0xac71, 0xac8c, 0xac8d, 0xaca8, 0xaca9, 0xacc4, 0xacc5, 0xace0, 0xace1, 0xacfc, 0xacfd, 0xad18, 0xad19, 0xad34, + 0xad35, 0xad50, 0xad51, 0xad6c, 0xad6d, 0xad88, 0xad89, 0xada4, 0xada5, 0xadc0, 0xadc1, 0xaddc, 0xaddd, 0xadf8, + 0xadf9, 0xae14, 0xae15, 0xae30, 0xae31, 0xae4c, 0xae4d, 0xae68, 0xae69, 0xae84, 0xae85, 0xaea0, 0xaea1, 0xaebc, + 0xaebd, 0xaed8, 0xaed9, 0xaef4, 0xaef5, 0xaf10, 0xaf11, 0xaf2c, 0xaf2d, 0xaf48, 0xaf49, 0xaf64, 0xaf65, 0xaf80, + 0xaf81, 0xaf9c, 0xaf9d, 0xafb8, 0xafb9, 0xafd4, 0xafd5, 0xaff0, 0xaff1, 0xb00c, 0xb00d, 0xb028, 0xb029, 0xb044, + 0xb045, 0xb060, 0xb061, 0xb07c, 0xb07d, 0xb098, 0xb099, 0xb0b4, 0xb0b5, 0xb0d0, 0xb0d1, 0xb0ec, 0xb0ed, 0xb108, + 0xb109, 0xb124, 0xb125, 0xb140, 0xb141, 0xb15c, 0xb15d, 0xb178, 0xb179, 0xb194, 0xb195, 0xb1b0, 0xb1b1, 0xb1cc, + 0xb1cd, 0xb1e8, 0xb1e9, 0xb204, 0xb205, 0xb220, 0xb221, 0xb23c, 0xb23d, 0xb258, 0xb259, 0xb274, 0xb275, 0xb290, + 0xb291, 0xb2ac, 0xb2ad, 0xb2c8, 0xb2c9, 0xb2e4, 0xb2e5, 0xb300, 0xb301, 0xb31c, 0xb31d, 0xb338, 0xb339, 0xb354, + 0xb355, 0xb370, 0xb371, 0xb38c, 0xb38d, 0xb3a8, 0xb3a9, 0xb3c4, 0xb3c5, 0xb3e0, 0xb3e1, 0xb3fc, 0xb3fd, 0xb418, + 0xb419, 0xb434, 0xb435, 0xb450, 0xb451, 0xb46c, 0xb46d, 0xb488, 0xb489, 0xb4a4, 0xb4a5, 0xb4c0, 0xb4c1, 0xb4dc, + 0xb4dd, 0xb4f8, 0xb4f9, 0xb514, 0xb515, 0xb530, 0xb531, 0xb54c, 0xb54d, 0xb568, 0xb569, 0xb584, 0xb585, 0xb5a0, + 0xb5a1, 0xb5bc, 0xb5bd, 0xb5d8, 0xb5d9, 0xb5f4, 0xb5f5, 0xb610, 0xb611, 0xb62c, 0xb62d, 0xb648, 0xb649, 0xb664, + 0xb665, 0xb680, 0xb681, 0xb69c, 0xb69d, 0xb6b8, 0xb6b9, 0xb6d4, 0xb6d5, 0xb6f0, 0xb6f1, 0xb70c, 0xb70d, 0xb728, + 0xb729, 0xb744, 0xb745, 0xb760, 0xb761, 0xb77c, 0xb77d, 0xb798, 0xb799, 0xb7b4, 0xb7b5, 0xb7d0, 0xb7d1, 0xb7ec, + 0xb7ed, 0xb808, 0xb809, 0xb824, 0xb825, 0xb840, 0xb841, 0xb85c, 0xb85d, 0xb878, 0xb879, 0xb894, 0xb895, 0xb8b0, + 0xb8b1, 0xb8cc, 0xb8cd, 0xb8e8, 0xb8e9, 0xb904, 0xb905, 0xb920, 0xb921, 0xb93c, 0xb93d, 0xb958, 0xb959, 0xb974, + 0xb975, 0xb990, 0xb991, 0xb9ac, 0xb9ad, 0xb9c8, 0xb9c9, 0xb9e4, 0xb9e5, 0xba00, 0xba01, 0xba1c, 0xba1d, 0xba38, + 0xba39, 0xba54, 0xba55, 0xba70, 0xba71, 0xba8c, 0xba8d, 0xbaa8, 0xbaa9, 0xbac4, 0xbac5, 0xbae0, 0xbae1, 0xbafc, + 0xbafd, 0xbb18, 0xbb19, 0xbb34, 0xbb35, 0xbb50, 0xbb51, 0xbb6c, 0xbb6d, 0xbb88, 0xbb89, 0xbba4, 0xbba5, 0xbbc0, + 0xbbc1, 0xbbdc, 0xbbdd, 0xbbf8, 0xbbf9, 0xbc14, 0xbc15, 0xbc30, 0xbc31, 0xbc4c, 0xbc4d, 0xbc68, 0xbc69, 0xbc84, + 0xbc85, 0xbca0, 0xbca1, 0xbcbc, 0xbcbd, 0xbcd8, 0xbcd9, 0xbcf4, 0xbcf5, 0xbd10, 0xbd11, 0xbd2c, 0xbd2d, 0xbd48, + 0xbd49, 0xbd64, 0xbd65, 0xbd80, 0xbd81, 0xbd9c, 0xbd9d, 0xbdb8, 0xbdb9, 0xbdd4, 0xbdd5, 0xbdf0, 0xbdf1, 0xbe0c, + 0xbe0d, 0xbe28, 0xbe29, 0xbe44, 0xbe45, 0xbe60, 0xbe61, 0xbe7c, 0xbe7d, 0xbe98, 0xbe99, 0xbeb4, 0xbeb5, 0xbed0, + 0xbed1, 0xbeec, 0xbeed, 0xbf08, 0xbf09, 0xbf24, 0xbf25, 0xbf40, 0xbf41, 0xbf5c, 0xbf5d, 0xbf78, 0xbf79, 0xbf94, + 0xbf95, 0xbfb0, 0xbfb1, 0xbfcc, 0xbfcd, 0xbfe8, 0xbfe9, 0xc004, 0xc005, 0xc020, 0xc021, 0xc03c, 0xc03d, 0xc058, + 0xc059, 0xc074, 0xc075, 0xc090, 0xc091, 0xc0ac, 0xc0ad, 0xc0c8, 0xc0c9, 0xc0e4, 0xc0e5, 0xc100, 0xc101, 0xc11c, + 0xc11d, 0xc138, 0xc139, 0xc154, 0xc155, 0xc170, 0xc171, 0xc18c, 0xc18d, 0xc1a8, 0xc1a9, 0xc1c4, 0xc1c5, 0xc1e0, + 0xc1e1, 0xc1fc, 0xc1fd, 0xc218, 0xc219, 0xc234, 0xc235, 0xc250, 0xc251, 0xc26c, 0xc26d, 0xc288, 0xc289, 0xc2a4, + 0xc2a5, 0xc2c0, 0xc2c1, 0xc2dc, 0xc2dd, 0xc2f8, 0xc2f9, 0xc314, 0xc315, 0xc330, 0xc331, 0xc34c, 0xc34d, 0xc368, + 0xc369, 0xc384, 0xc385, 0xc3a0, 0xc3a1, 0xc3bc, 0xc3bd, 0xc3d8, 0xc3d9, 0xc3f4, 0xc3f5, 0xc410, 0xc411, 0xc42c, + 0xc42d, 0xc448, 0xc449, 0xc464, 0xc465, 0xc480, 0xc481, 0xc49c, 0xc49d, 0xc4b8, 0xc4b9, 0xc4d4, 0xc4d5, 0xc4f0, + 0xc4f1, 0xc50c, 0xc50d, 0xc528, 0xc529, 0xc544, 0xc545, 0xc560, 0xc561, 0xc57c, 0xc57d, 0xc598, 0xc599, 0xc5b4, + 0xc5b5, 0xc5d0, 0xc5d1, 0xc5ec, 0xc5ed, 0xc608, 0xc609, 0xc624, 0xc625, 0xc640, 0xc641, 0xc65c, 0xc65d, 0xc678, + 0xc679, 0xc694, 0xc695, 0xc6b0, 0xc6b1, 0xc6cc, 0xc6cd, 0xc6e8, 0xc6e9, 0xc704, 0xc705, 0xc720, 0xc721, 0xc73c, + 0xc73d, 0xc758, 0xc759, 0xc774, 0xc775, 0xc790, 0xc791, 0xc7ac, 0xc7ad, 0xc7c8, 0xc7c9, 0xc7e4, 0xc7e5, 0xc800, + 0xc801, 0xc81c, 0xc81d, 0xc838, 0xc839, 0xc854, 0xc855, 0xc870, 0xc871, 0xc88c, 0xc88d, 0xc8a8, 0xc8a9, 0xc8c4, + 0xc8c5, 0xc8e0, 0xc8e1, 0xc8fc, 0xc8fd, 0xc918, 0xc919, 0xc934, 0xc935, 0xc950, 0xc951, 0xc96c, 0xc96d, 0xc988, + 0xc989, 0xc9a4, 0xc9a5, 0xc9c0, 0xc9c1, 0xc9dc, 0xc9dd, 0xc9f8, 0xc9f9, 0xca14, 0xca15, 0xca30, 0xca31, 0xca4c, + 0xca4d, 0xca68, 0xca69, 0xca84, 0xca85, 0xcaa0, 0xcaa1, 0xcabc, 0xcabd, 0xcad8, 0xcad9, 0xcaf4, 0xcaf5, 0xcb10, + 0xcb11, 0xcb2c, 0xcb2d, 0xcb48, 0xcb49, 0xcb64, 0xcb65, 0xcb80, 0xcb81, 0xcb9c, 0xcb9d, 0xcbb8, 0xcbb9, 0xcbd4, + 0xcbd5, 0xcbf0, 0xcbf1, 0xcc0c, 0xcc0d, 0xcc28, 0xcc29, 0xcc44, 0xcc45, 0xcc60, 0xcc61, 0xcc7c, 0xcc7d, 0xcc98, + 0xcc99, 0xccb4, 0xccb5, 0xccd0, 0xccd1, 0xccec, 0xcced, 0xcd08, 0xcd09, 0xcd24, 0xcd25, 0xcd40, 0xcd41, 0xcd5c, + 0xcd5d, 0xcd78, 0xcd79, 0xcd94, 0xcd95, 0xcdb0, 0xcdb1, 0xcdcc, 0xcdcd, 0xcde8, 0xcde9, 0xce04, 0xce05, 0xce20, + 0xce21, 0xce3c, 0xce3d, 0xce58, 0xce59, 0xce74, 0xce75, 0xce90, 0xce91, 0xceac, 0xcead, 0xcec8, 0xcec9, 0xcee4, + 0xcee5, 0xcf00, 0xcf01, 0xcf1c, 0xcf1d, 0xcf38, 0xcf39, 0xcf54, 0xcf55, 0xcf70, 0xcf71, 0xcf8c, 0xcf8d, 0xcfa8, + 0xcfa9, 0xcfc4, 0xcfc5, 0xcfe0, 0xcfe1, 0xcffc, 0xcffd, 0xd018, 0xd019, 0xd034, 0xd035, 0xd050, 0xd051, 0xd06c, + 0xd06d, 0xd088, 0xd089, 0xd0a4, 0xd0a5, 0xd0c0, 0xd0c1, 0xd0dc, 0xd0dd, 0xd0f8, 0xd0f9, 0xd114, 0xd115, 0xd130, + 0xd131, 0xd14c, 0xd14d, 0xd168, 0xd169, 0xd184, 0xd185, 0xd1a0, 0xd1a1, 0xd1bc, 0xd1bd, 0xd1d8, 0xd1d9, 0xd1f4, + 0xd1f5, 0xd210, 0xd211, 0xd22c, 0xd22d, 0xd248, 0xd249, 0xd264, 0xd265, 0xd280, 0xd281, 0xd29c, 0xd29d, 0xd2b8, + 0xd2b9, 0xd2d4, 0xd2d5, 0xd2f0, 0xd2f1, 0xd30c, 0xd30d, 0xd328, 0xd329, 0xd344, 0xd345, 0xd360, 0xd361, 0xd37c, + 0xd37d, 0xd398, 0xd399, 0xd3b4, 0xd3b5, 0xd3d0, 0xd3d1, 0xd3ec, 0xd3ed, 0xd408, 0xd409, 0xd424, 0xd425, 0xd440, + 0xd441, 0xd45c, 0xd45d, 0xd478, 0xd479, 0xd494, 0xd495, 0xd4b0, 0xd4b1, 0xd4cc, 0xd4cd, 0xd4e8, 0xd4e9, 0xd504, + 0xd505, 0xd520, 0xd521, 0xd53c, 0xd53d, 0xd558, 0xd559, 0xd574, 0xd575, 0xd590, 0xd591, 0xd5ac, 0xd5ad, 0xd5c8, + 0xd5c9, 0xd5e4, 0xd5e5, 0xd600, 0xd601, 0xd61c, 0xd61d, 0xd638, 0xd639, 0xd654, 0xd655, 0xd670, 0xd671, 0xd68c, + 0xd68d, 0xd6a8, 0xd6a9, 0xd6c4, 0xd6c5, 0xd6e0, 0xd6e1, 0xd6fc, 0xd6fd, 0xd718, 0xd719, 0xd734, 0xd735, 0xd750, + 0xd751, 0xd76c, 0xd76d, 0xd788, 0xd789, 0xd7b0, 0xd7cb, 0xfb1e, 0xfe00, 0xfe20, 0xfeff, 0xff9e, 0xfff0, 0x101fd, + 0x102e0, 0x10376, 0x10a01, 0x10a05, 0x10a0c, 0x10a38, 0x10a3f, 0x10ae5, 0x10d24, 0x10eab, 0x10efd, 0x10f46, + 0x10f82, 0x11000, 0x11001, 0x11002, 0x11038, 0x11070, 0x11073, 0x1107f, 0x11082, 0x110b0, 0x110b3, 0x110b7, + 0x110b9, 0x110bd, 0x110c2, 0x110cd, 0x11100, 0x11127, 0x1112c, 0x1112d, 0x11145, 0x11173, 0x11180, 0x11182, + 0x111b3, 0x111b6, 0x111bf, 0x111c2, 0x111c9, 0x111ce, 0x111cf, 0x1122c, 0x1122f, 0x11232, 0x11234, 0x11235, + 0x11236, 0x1123e, 0x11241, 0x112df, 0x112e0, 0x112e3, 0x11300, 0x11302, 0x1133b, 0x1133e, 0x1133f, 0x11340, + 0x11341, 0x11347, 0x1134b, 0x11357, 0x11362, 0x11366, 0x11370, 0x11435, 0x11438, 0x11440, 0x11442, 0x11445, + 0x11446, 0x1145e, 0x114b0, 0x114b1, 0x114b3, 0x114b9, 0x114ba, 0x114bb, 0x114bd, 0x114be, 0x114bf, 0x114c1, + 0x114c2, 0x115af, 0x115b0, 0x115b2, 0x115b8, 0x115bc, 0x115be, 0x115bf, 0x115dc, 0x11630, 0x11633, 0x1163b, + 0x1163d, 0x1163e, 0x1163f, 0x116ab, 0x116ac, 0x116ad, 0x116ae, 0x116b0, 0x116b6, 0x116b7, 0x1171d, 0x11722, + 0x11726, 0x11727, 0x1182c, 0x1182f, 0x11838, 0x11839, 0x11930, 0x11931, 0x11937, 0x1193b, 0x1193d, 0x1193e, + 0x1193f, 0x11940, 0x11941, 0x11942, 0x11943, 0x119d1, 0x119d4, 0x119da, 0x119dc, 0x119e0, 0x119e4, 0x11a01, + 0x11a33, 0x11a39, 0x11a3a, 0x11a3b, 0x11a47, 0x11a51, 0x11a57, 0x11a59, 0x11a84, 0x11a8a, 0x11a97, 0x11a98, + 0x11c2f, 0x11c30, 0x11c38, 0x11c3e, 0x11c3f, 0x11c92, 0x11ca9, 0x11caa, 0x11cb1, 0x11cb2, 0x11cb4, 0x11cb5, + 0x11d31, 0x11d3a, 0x11d3c, 0x11d3f, 0x11d46, 0x11d47, 0x11d8a, 0x11d90, 0x11d93, 0x11d95, 0x11d96, 0x11d97, + 0x11ef3, 0x11ef5, 0x11f00, 0x11f02, 0x11f03, 0x11f34, 0x11f36, 0x11f3e, 0x11f40, 0x11f41, 0x11f42, 0x13430, + 0x13440, 0x13447, 0x16af0, 0x16b30, 0x16f4f, 0x16f51, 0x16f8f, 0x16fe4, 0x16ff0, 0x1bc9d, 0x1bca0, 0x1cf00, + 0x1cf30, 0x1d165, 0x1d166, 0x1d167, 0x1d16d, 0x1d16e, 0x1d173, 0x1d17b, 0x1d185, 0x1d1aa, 0x1d242, 0x1da00, + 0x1da3b, 0x1da75, 0x1da84, 0x1da9b, 0x1daa1, 0x1e000, 0x1e008, 0x1e01b, 0x1e023, 0x1e026, 0x1e08f, 0x1e130, + 0x1e2ae, 0x1e2ec, 0x1e4ec, 0x1e8d0, 0x1e944, 0x1f1e6, 0x1f3fb, 0xe0000, 0xe0020, 0xe0080, 0xe0100, 0xe01f0}, + {0x100a, 0x4001, 0x1002, 0x1, 0x1012, 0x1021, 0x1001, 0x2070, 0x2007, 0x202d, 0x2001, 0x2002, 0x2002, 0x2001, + 0x7006, 0x200b, 0x1001, 0x2015, 0x2001, 0x2007, 0x7001, 0x2006, 0x2002, 0x2004, 0x7001, 0x2001, 0x201b, 0x200b, + 0x2009, 0x2001, 0x2004, 0x2009, 0x2003, 0x2005, 0x2003, 0x7002, 0x2008, 0x2018, 0x7001, 0x2020, 0x9001, 0x2001, + 0x9001, 0x2001, 0x9003, 0x2008, 0x9004, 0x2001, 0x9002, 0x2007, 0x2002, 0x2001, 0x9002, 0x2001, 0x2001, 0x9002, + 0x2004, 0x9002, 0x9002, 0x2001, 0x2001, 0x2002, 0x2001, 0x2002, 0x9001, 0x2001, 0x9003, 0x2002, 0x2002, 0x2003, + 0x2001, 0x2002, 0x2001, 0x2002, 0x9001, 0x2001, 0x9003, 0x2005, 0x2002, 0x9001, 0x9002, 0x2001, 0x2002, 0x2006, + 0x2001, 0x9002, 0x2001, 0x2002, 0x9001, 0x2004, 0x9002, 0x9002, 0x2001, 0x2003, 0x2002, 0x2001, 0x2001, 0x9001, + 0x2001, 0x9002, 0x9003, 0x9003, 0x2001, 0x2001, 0x2001, 0x9003, 0x2001, 0x2001, 0x2003, 0x9004, 0x2003, 0x2004, + 0x2002, 0x2002, 0x2001, 0x9002, 0x2001, 0x9001, 0x2001, 0x9002, 0x2001, 0x9002, 0x2001, 0x9002, 0x9002, 0x2002, + 0x2002, 0x2002, 0x9001, 0x2002, 0x9002, 0x2002, 0x2001, 0x9002, 0x2004, 0x9003, 0x9003, 0x2001, 0x7001, 0x2001, + 0x2002, 0x2001, 0x9002, 0x2001, 0x2001, 0x9002, 0x2003, 0x2001, 0x9007, 0x2001, 0x9002, 0x2001, 0x9001, 0x2007, + 0x2008, 0x2001, 0x9001, 0x2009, 0x2007, 0x2002, 0x2001, 0x2001, 0x2001, 0x9002, 0x200e, 0x9001, 0x2005, 0x2002, + 0x200b, 0x2024, 0x2001, 0x2004, 0x9001, 0x2006, 0x2002, 0x9002, 0x2002, 0x9002, 0x2002, 0x2003, 0x2004, 0x2001, + 0x9001, 0x2002, 0x2001, 0x2001, 0x3060, 0xb048, 0xa058, 0x2003, 0x2003, 0x9001, 0x2002, 0x9001, 0x2002, 0x2002, + 0x2002, 0x9001, 0x2007, 0x9008, 0x2001, 0x9002, 0x200b, 0x2001, 0x2003, 0x1001, 0x2001, 0x2002, 0x2001, 0x2003, + 0x9004, 0x2002, 0x9003, 0x9002, 0x2001, 0x9006, 0x2003, 0x2002, 0x9002, 0x2001, 0x9001, 0x2001, 0x9001, 0x2007, + 0x2001, 0x2001, 0x2008, 0x9006, 0x200a, 0x2001, 0x201f, 0x2004, 0x9001, 0x2007, 0x9001, 0x2001, 0x9005, 0x2001, + 0x9002, 0x2009, 0x2002, 0x9001, 0x9001, 0x2004, 0x9002, 0x2002, 0x9001, 0x2003, 0x2001, 0x9001, 0x2002, 0x9003, + 0x2001, 0x9001, 0x2003, 0x9002, 0x9008, 0x2008, 0x9002, 0x2002, 0x2003, 0x200d, 0x9001, 0x2007, 0x2001, 0x2001, + 0x9001, 0x2002, 0x2040, 0x1001, 0x2001, 0xc001, 0x1002, 0x1007, 0x1010, 0x2021, 0x2003, 0x2001, 0x2020, 0x2006, + 0x2002, 0x2004, 0x200a, 0x2002, 0x2002, 0x2001, 0x2001, 0x2001, 0x9002, 0x2002, 0x9001, 0x2001, 0x9002, 0x9010, + 0x2002, 0x2012, 0x2001, 0x2008, 0x200b, 0x9002, 0x301d, 0x2003, 0x9001, 0x2001, 0x9002, 0x2004, 0x9002, 0x2002, + 0x9003, 0x2001, 0x2006, 0x9002, 0x2002, 0x9002, 0x2002, 0x2001, 0x2001, 0x9001, 0x2001, 0x2001, 0x2003, 0x2002, + 0x2002, 0x2001, 0x9001, 0x2002, 0x9002, 0x9001, 0x2001, 0x9002, 0x2001, 0x9002, 0x2001, 0x9002, 0x9001, 0x2001, + 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, + 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, + 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, + 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, + 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, + 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, + 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, + 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, + 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, + 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, + 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, + 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, + 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, + 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, + 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, + 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, + 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, + 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, + 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, + 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, + 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, + 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, + 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, + 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, + 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, + 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, + 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, + 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, + 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, + 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, + 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, + 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, + 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, + 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, + 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, + 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, + 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, + 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, + 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, + 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, + 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, + 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, + 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, + 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, + 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, + 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, + 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, + 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, + 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, + 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, + 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, + 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, + 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, + 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, + 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, + 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, + 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, + 0xb017, 0xa031, 0x2001, 0x2010, 0x2010, 0x1001, 0x2002, 0x100c, 0x2001, 0x2001, 0x2005, 0x2003, 0x2002, 0x2004, + 0x2003, 0x2001, 0x2002, 0x2004, 0x2002, 0x2003, 0x200b, 0x2004, 0x9001, 0x2001, 0x9001, 0x200f, 0x2001, 0x2002, + 0x2003, 0x9001, 0x9003, 0x2004, 0x9002, 0x2002, 0x7001, 0x2001, 0x7001, 0x2003, 0x2005, 0x9001, 0x2008, 0x9002, + 0x2001, 0x2002, 0x9001, 0x9003, 0x2009, 0x9002, 0x7002, 0x2004, 0x9001, 0x2001, 0x9003, 0x2003, 0x9002, 0x2001, + 0x9001, 0x2002, 0x2001, 0x2001, 0x2001, 0x9003, 0x2008, 0x2002, 0x9002, 0x2002, 0x2001, 0x9001, 0x2001, 0x9004, + 0x9002, 0x9003, 0x2001, 0x9002, 0x2007, 0x2005, 0x9003, 0x2008, 0x9002, 0x2003, 0x9001, 0x2001, 0x2001, 0x2001, + 0x9002, 0x2006, 0x9001, 0x2001, 0x9002, 0x2001, 0x9001, 0x2002, 0x9001, 0x2002, 0x2001, 0x9002, 0x2004, 0x9004, + 0x2002, 0x9001, 0x2002, 0x2002, 0x9003, 0x2008, 0x9002, 0x2001, 0x9001, 0x2002, 0x2001, 0x9001, 0x2001, 0x9002, + 0x2006, 0x9001, 0x2001, 0x2003, 0x2004, 0x9001, 0x2005, 0x9003, 0x2009, 0x9001, 0x2002, 0x2001, 0x9005, 0x9002, + 0x2002, 0x9001, 0x2001, 0x7001, 0x9001, 0x7001, 0x9001, 0x2001, 0x9003, 0x2004, 0x2002, 0x9004, 0x2001, 0x9001, + 0x200a, 0x2006, 0x9001, 0x7001, 0x2004, 0x2001, 0x2006, 0x9002, 0x2003, 0x7006, 0x200d, 0x9001, 0x2002, 0x9001, + 0x2007, 0x2006, 0x9001, 0x2001, 0x2016, 0x9001, 0x2007, 0x9001, 0x2002, 0x9001, 0x2002, 0x2006, 0x2001, 0x2002, + 0x2007, 0x7001, 0x2001, 0x9005, 0x2002, 0x9002, 0x2001, 0x9001, 0x2001, 0x2002, 0x9002, 0x2002, 0x7001, 0x9001, + 0x9002, 0x2005, 0x9002, 0x2001, 0x9001, 0x2001, 0x1010, 0x2001, 0x200f, 0x2005, 0x2007, 0x2001, 0x9037, 0x2004, + 0x2001, 0x9002, 0x2002, 0x1004, 0x202e, 0x2017, 0x2001, 0x9001, 0x2003, 0x9001, 0x2005, 0x1008, 0x2008, 0x2007, + 0x2004, 0x2003, 0x2037, 0x2032, 0x2001, 0x2001, 0x2005, 0x200f, 0x2007, 0x2011, 0x2007, 0x2002, 0x2005, 0x2001, + 0x2007, 0x2001, 0x2004, 0x2004, 0x2007, 0x2007, 0x801a, 0x2005, 0x1020, 0x2060, 0x1080, 0x20f0, 0x1e10}}; + +// emoji-data.txt +// Date: 2022-08-02, 00:26:10 GMT +enum class _Extended_Pictographic_property_values : uint8_t { _Extended_Pictographic_value, _No_value = 255 }; + +// emoji-data.txt +// Date: 2022-08-02, 00:26:10 GMT +inline constexpr _Unicode_property_data<_Extended_Pictographic_property_values, 78, true> + _Extended_Pictographic_property_data{ + {0xa9, 0xae, 0x203c, 0x2049, 0x2122, 0x2139, 0x2194, 0x21a9, 0x231a, 0x2328, 0x2388, 0x23cf, 0x23e9, 0x23f8, + 0x24c2, 0x25aa, 0x25b6, 0x25c0, 0x25fb, 0x2600, 0x2607, 0x2614, 0x2690, 0x2708, 0x2714, 0x2716, 0x271d, + 0x2721, 0x2728, 0x2733, 0x2744, 0x2747, 0x274c, 0x274e, 0x2753, 0x2757, 0x2763, 0x2795, 0x27a1, 0x27b0, + 0x27bf, 0x2934, 0x2b05, 0x2b1b, 0x2b50, 0x2b55, 0x3030, 0x303d, 0x3297, 0x3299, 0x1f000, 0x1f10d, 0x1f12f, + 0x1f16c, 0x1f17e, 0x1f18e, 0x1f191, 0x1f1ad, 0x1f201, 0x1f21a, 0x1f22f, 0x1f232, 0x1f23c, 0x1f249, 0x1f400, + 0x1f546, 0x1f680, 0x1f774, 0x1f7d5, 0x1f80c, 0x1f848, 0x1f85a, 0x1f888, 0x1f8ae, 0x1f90c, 0x1f93c, 0x1f947, + 0x1fc00}, + {0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x6, 0x2, 0x2, 0x1, 0x1, 0x1, 0xb, 0x3, 0x1, 0x2, 0x1, 0x1, 0x4, 0x6, 0xc, 0x72, + 0x76, 0xb, 0x1, 0x1, 0x1, 0x1, 0x1, 0x2, 0x1, 0x1, 0x1, 0x1, 0x3, 0x1, 0x5, 0x3, 0x1, 0x1, 0x1, 0x2, 0x3, + 0x2, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x100, 0x3, 0x1, 0x6, 0x2, 0x1, 0xa, 0x39, 0xf, 0x1, 0x1, 0x9, 0x4, + 0x1b2, 0x13e, 0x10a, 0x80, 0xc, 0x2b, 0x4, 0x8, 0x6, 0x8, 0x52, 0x2f, 0xa, 0x1b9, 0x3fe}}; + +// DerivedGeneralCategory-15.0.0.txt +// Date: 2022-04-26, 23:14:35 GMT +enum class __printable_property_values : uint8_t { _Yes_value, _No_value = 255 }; + +// DerivedGeneralCategory-15.0.0.txt +// Date: 2022-04-26, 23:14:35 GMT +inline constexpr _Unicode_property_data<__printable_property_values, 711, true> __printable_property_data{ + {0x20, 0xa1, 0xae, 0x37a, 0x384, 0x38c, 0x38e, 0x3a3, 0x531, 0x559, 0x58d, 0x591, 0x5d0, 0x5ef, 0x606, 0x61d, 0x6de, + 0x710, 0x74d, 0x7c0, 0x7fd, 0x830, 0x840, 0x85e, 0x860, 0x870, 0x898, 0x8e3, 0x985, 0x98f, 0x993, 0x9aa, 0x9b2, + 0x9b6, 0x9bc, 0x9c7, 0x9cb, 0x9d7, 0x9dc, 0x9df, 0x9e6, 0xa01, 0xa05, 0xa0f, 0xa13, 0xa2a, 0xa32, 0xa35, 0xa38, + 0xa3c, 0xa3e, 0xa47, 0xa4b, 0xa51, 0xa59, 0xa5e, 0xa66, 0xa81, 0xa85, 0xa8f, 0xa93, 0xaaa, 0xab2, 0xab5, 0xabc, + 0xac7, 0xacb, 0xad0, 0xae0, 0xae6, 0xaf9, 0xb01, 0xb05, 0xb0f, 0xb13, 0xb2a, 0xb32, 0xb35, 0xb3c, 0xb47, 0xb4b, + 0xb55, 0xb5c, 0xb5f, 0xb66, 0xb82, 0xb85, 0xb8e, 0xb92, 0xb99, 0xb9c, 0xb9e, 0xba3, 0xba8, 0xbae, 0xbbe, 0xbc6, + 0xbca, 0xbd0, 0xbd7, 0xbe6, 0xc00, 0xc0e, 0xc12, 0xc2a, 0xc3c, 0xc46, 0xc4a, 0xc55, 0xc58, 0xc5d, 0xc60, 0xc66, + 0xc77, 0xc8e, 0xc92, 0xcaa, 0xcb5, 0xcbc, 0xcc6, 0xcca, 0xcd5, 0xcdd, 0xce0, 0xce6, 0xcf1, 0xd00, 0xd0e, 0xd12, + 0xd46, 0xd4a, 0xd54, 0xd66, 0xd81, 0xd85, 0xd9a, 0xdb3, 0xdbd, 0xdc0, 0xdca, 0xdcf, 0xdd6, 0xdd8, 0xde6, 0xdf2, + 0xe01, 0xe3f, 0xe81, 0xe84, 0xe86, 0xe8c, 0xea5, 0xea7, 0xec0, 0xec6, 0xec8, 0xed0, 0xedc, 0xf00, 0xf49, 0xf71, + 0xf99, 0xfbe, 0xfce, 0x1000, 0x10c7, 0x10cd, 0x10d0, 0x124a, 0x1250, 0x1258, 0x125a, 0x1260, 0x128a, 0x1290, + 0x12b2, 0x12b8, 0x12c0, 0x12c2, 0x12c8, 0x12d8, 0x1312, 0x1318, 0x135d, 0x1380, 0x13a0, 0x13f8, 0x1400, 0x1681, + 0x16a0, 0x1700, 0x171f, 0x1740, 0x1760, 0x176e, 0x1772, 0x1780, 0x17e0, 0x17f0, 0x1800, 0x180f, 0x1820, 0x1880, + 0x18b0, 0x1900, 0x1920, 0x1930, 0x1940, 0x1944, 0x1970, 0x1980, 0x19b0, 0x19d0, 0x19de, 0x1a1e, 0x1a60, 0x1a7f, + 0x1a90, 0x1aa0, 0x1ab0, 0x1b00, 0x1b50, 0x1b80, 0x1bfc, 0x1c3b, 0x1c4d, 0x1c90, 0x1cbd, 0x1cd0, 0x1d00, 0x1f18, + 0x1f20, 0x1f48, 0x1f50, 0x1f59, 0x1f5b, 0x1f5d, 0x1f5f, 0x1f80, 0x1fb6, 0x1fc6, 0x1fd6, 0x1fdd, 0x1ff2, 0x1ff6, + 0x2010, 0x2030, 0x2070, 0x2074, 0x2090, 0x20a0, 0x20d0, 0x2100, 0x2190, 0x2440, 0x2460, 0x2b76, 0x2b97, 0x2cf9, + 0x2d27, 0x2d2d, 0x2d30, 0x2d6f, 0x2d7f, 0x2da0, 0x2da8, 0x2db0, 0x2db8, 0x2dc0, 0x2dc8, 0x2dd0, 0x2dd8, 0x2de0, + 0x2e80, 0x2e9b, 0x2f00, 0x2ff0, 0x3001, 0x3041, 0x3099, 0x3105, 0x3131, 0x3190, 0x31f0, 0x3220, 0xa490, 0xa4d0, + 0xa640, 0xa700, 0xa7d0, 0xa7d3, 0xa7d5, 0xa7f2, 0xa830, 0xa840, 0xa880, 0xa8ce, 0xa8e0, 0xa95f, 0xa980, 0xa9cf, + 0xa9de, 0xaa00, 0xaa40, 0xaa50, 0xaa5c, 0xaadb, 0xab01, 0xab09, 0xab11, 0xab20, 0xab28, 0xab30, 0xab70, 0xabf0, + 0xac00, 0xd7b0, 0xd7cb, 0xf900, 0xfa70, 0xfb00, 0xfb13, 0xfb1d, 0xfb38, 0xfb3e, 0xfb40, 0xfb43, 0xfb46, 0xfbd3, + 0xfd92, 0xfdcf, 0xfdf0, 0xfe20, 0xfe54, 0xfe68, 0xfe70, 0xfe76, 0xff01, 0xffc2, 0xffca, 0xffd2, 0xffda, 0xffe0, + 0xffe8, 0xfffc, 0x10000, 0x1000d, 0x10028, 0x1003c, 0x1003f, 0x10050, 0x10080, 0x10100, 0x10107, 0x10137, + 0x10190, 0x101a0, 0x101d0, 0x10280, 0x102a0, 0x102e0, 0x10300, 0x1032d, 0x10350, 0x10380, 0x1039f, 0x103c8, + 0x10400, 0x104a0, 0x104b0, 0x104d8, 0x10500, 0x10530, 0x1056f, 0x1057c, 0x1058c, 0x10594, 0x10597, 0x105a3, + 0x105b3, 0x105bb, 0x10600, 0x10740, 0x10760, 0x10780, 0x10787, 0x107b2, 0x10800, 0x10808, 0x1080a, 0x10837, + 0x1083c, 0x1083f, 0x10857, 0x108a7, 0x108e0, 0x108f4, 0x108fb, 0x1091f, 0x1093f, 0x10980, 0x109bc, 0x109d2, + 0x10a05, 0x10a0c, 0x10a15, 0x10a19, 0x10a38, 0x10a3f, 0x10a50, 0x10a60, 0x10ac0, 0x10aeb, 0x10b00, 0x10b39, + 0x10b58, 0x10b78, 0x10b99, 0x10ba9, 0x10c00, 0x10c80, 0x10cc0, 0x10cfa, 0x10d30, 0x10e60, 0x10e80, 0x10eab, + 0x10eb0, 0x10efd, 0x10f30, 0x10f70, 0x10fb0, 0x10fe0, 0x11000, 0x11052, 0x1107f, 0x110be, 0x110d0, 0x110f0, + 0x11100, 0x11136, 0x11150, 0x11180, 0x111e1, 0x11200, 0x11213, 0x11280, 0x11288, 0x1128a, 0x1128f, 0x1129f, + 0x112b0, 0x112f0, 0x11300, 0x11305, 0x1130f, 0x11313, 0x1132a, 0x11332, 0x11335, 0x1133b, 0x11347, 0x1134b, + 0x11350, 0x11357, 0x1135d, 0x11366, 0x11370, 0x11400, 0x1145d, 0x11480, 0x114d0, 0x11580, 0x115b8, 0x11600, + 0x11650, 0x11660, 0x11680, 0x116c0, 0x11700, 0x1171d, 0x11730, 0x11800, 0x118a0, 0x118ff, 0x11909, 0x1190c, + 0x11915, 0x11918, 0x11937, 0x1193b, 0x11950, 0x119a0, 0x119aa, 0x119da, 0x11a00, 0x11a50, 0x11ab0, 0x11b00, + 0x11c00, 0x11c0a, 0x11c38, 0x11c50, 0x11c70, 0x11c92, 0x11ca9, 0x11d00, 0x11d08, 0x11d0b, 0x11d3a, 0x11d3c, + 0x11d3f, 0x11d50, 0x11d60, 0x11d67, 0x11d6a, 0x11d90, 0x11d93, 0x11da0, 0x11ee0, 0x11f00, 0x11f12, 0x11f3e, + 0x11fb0, 0x11fc0, 0x11fff, 0x12400, 0x12470, 0x12480, 0x12f90, 0x13000, 0x13440, 0x14400, 0x16800, 0x16a40, + 0x16a60, 0x16a6e, 0x16ac0, 0x16ad0, 0x16af0, 0x16b00, 0x16b50, 0x16b5b, 0x16b63, 0x16b7d, 0x16e40, 0x16f00, + 0x16f4f, 0x16f8f, 0x16fe0, 0x16ff0, 0x17000, 0x18800, 0x18d00, 0x1aff0, 0x1aff5, 0x1affd, 0x1b000, 0x1b132, + 0x1b150, 0x1b155, 0x1b164, 0x1b170, 0x1bc00, 0x1bc70, 0x1bc80, 0x1bc90, 0x1bc9c, 0x1cf00, 0x1cf30, 0x1cf50, + 0x1d000, 0x1d100, 0x1d129, 0x1d17b, 0x1d200, 0x1d2c0, 0x1d2e0, 0x1d300, 0x1d360, 0x1d400, 0x1d456, 0x1d49e, + 0x1d4a2, 0x1d4a5, 0x1d4a9, 0x1d4ae, 0x1d4bb, 0x1d4bd, 0x1d4c5, 0x1d507, 0x1d50d, 0x1d516, 0x1d51e, 0x1d53b, + 0x1d540, 0x1d546, 0x1d54a, 0x1d552, 0x1d6a8, 0x1d7ce, 0x1da9b, 0x1daa1, 0x1df00, 0x1df25, 0x1e000, 0x1e008, + 0x1e01b, 0x1e023, 0x1e026, 0x1e030, 0x1e08f, 0x1e100, 0x1e130, 0x1e140, 0x1e14e, 0x1e290, 0x1e2c0, 0x1e2ff, + 0x1e4d0, 0x1e7e0, 0x1e7e8, 0x1e7ed, 0x1e7f0, 0x1e800, 0x1e8c7, 0x1e900, 0x1e950, 0x1e95e, 0x1ec71, 0x1ed01, + 0x1ee00, 0x1ee05, 0x1ee21, 0x1ee24, 0x1ee27, 0x1ee29, 0x1ee34, 0x1ee39, 0x1ee3b, 0x1ee42, 0x1ee47, 0x1ee49, + 0x1ee4b, 0x1ee4d, 0x1ee51, 0x1ee54, 0x1ee57, 0x1ee59, 0x1ee5b, 0x1ee5d, 0x1ee5f, 0x1ee61, 0x1ee64, 0x1ee67, + 0x1ee6c, 0x1ee74, 0x1ee79, 0x1ee7e, 0x1ee80, 0x1ee8b, 0x1eea1, 0x1eea5, 0x1eeab, 0x1eef0, 0x1f000, 0x1f030, + 0x1f0a0, 0x1f0b1, 0x1f0c1, 0x1f0d1, 0x1f100, 0x1f1e6, 0x1f210, 0x1f240, 0x1f250, 0x1f260, 0x1f300, 0x1f6dc, + 0x1f6f0, 0x1f700, 0x1f77b, 0x1f7e0, 0x1f7f0, 0x1f800, 0x1f810, 0x1f850, 0x1f860, 0x1f890, 0x1f8b0, 0x1f900, + 0x1fa60, 0x1fa70, 0x1fa80, 0x1fa90, 0x1fabf, 0x1face, 0x1fae0, 0x1faf0, 0x1fb00, 0x1fb94, 0x1fbf0, 0x20000, + 0x2a700, 0x2b740, 0x2b820, 0x2ceb0, 0x2f800, 0x30000, 0x31350, 0xe0100}, + {0x5f, 0xc, 0x2ca, 0x6, 0x7, 0x1, 0x14, 0x18d, 0x26, 0x32, 0x3, 0x37, 0x1b, 0x6, 0x16, 0xc0, 0x30, 0x3b, 0x65, 0x3b, + 0x31, 0xf, 0x1c, 0x1, 0xb, 0x1f, 0x4a, 0xa1, 0x8, 0x2, 0x16, 0x7, 0x1, 0x4, 0x9, 0x2, 0x4, 0x1, 0x2, 0x5, 0x19, + 0x3, 0x6, 0x2, 0x16, 0x7, 0x2, 0x2, 0x2, 0x1, 0x5, 0x2, 0x3, 0x1, 0x4, 0x1, 0x11, 0x3, 0x9, 0x3, 0x16, 0x7, 0x2, + 0x5, 0xa, 0x3, 0x3, 0x1, 0x4, 0xc, 0x7, 0x3, 0x8, 0x2, 0x16, 0x7, 0x2, 0x5, 0x9, 0x2, 0x3, 0x3, 0x2, 0x5, 0x12, + 0x2, 0x6, 0x3, 0x4, 0x2, 0x1, 0x2, 0x2, 0x3, 0xc, 0x5, 0x3, 0x4, 0x1, 0x1, 0x15, 0xd, 0x3, 0x17, 0x10, 0x9, 0x3, + 0x4, 0x2, 0x3, 0x1, 0x4, 0xa, 0x16, 0x3, 0x17, 0xa, 0x5, 0x9, 0x3, 0x4, 0x2, 0x2, 0x4, 0xa, 0x3, 0xd, 0x3, 0x33, + 0x3, 0x6, 0x10, 0x1a, 0x3, 0x12, 0x18, 0x9, 0x1, 0x7, 0x1, 0x6, 0x1, 0x8, 0xa, 0x3, 0x3a, 0x1d, 0x2, 0x1, 0x5, + 0x18, 0x1, 0x17, 0x5, 0x1, 0x7, 0xa, 0x4, 0x48, 0x24, 0x27, 0x24, 0xf, 0xd, 0xc6, 0x1, 0x1, 0x179, 0x4, 0x7, + 0x1, 0x4, 0x29, 0x4, 0x21, 0x4, 0x7, 0x1, 0x4, 0xf, 0x39, 0x4, 0x43, 0x20, 0x1a, 0x56, 0x6, 0x280, 0x1c, 0x59, + 0x16, 0x18, 0x14, 0xd, 0x3, 0x2, 0x5e, 0xa, 0xa, 0xe, 0xb, 0x59, 0x2b, 0x46, 0x1f, 0xc, 0xc, 0x1, 0x2a, 0x5, + 0x2c, 0x1a, 0xb, 0x3e, 0x41, 0x1d, 0xb, 0xa, 0xe, 0x1f, 0x4d, 0x2f, 0x74, 0x3c, 0xf, 0x3c, 0x2b, 0xb, 0x2b, + 0x216, 0x6, 0x26, 0x6, 0x8, 0x1, 0x1, 0x1, 0x1f, 0x35, 0xf, 0xe, 0x6, 0x13, 0x3, 0x9, 0x18, 0x2f, 0x2, 0x1b, + 0xd, 0x21, 0x21, 0x8c, 0x297, 0xb, 0x714, 0x20, 0x15d, 0x2d, 0x1, 0x1, 0x38, 0x2, 0x18, 0x7, 0x7, 0x7, 0x7, 0x7, + 0x7, 0x7, 0x7, 0x7e, 0x1a, 0x59, 0xd6, 0xc, 0x3f, 0x56, 0x67, 0x2b, 0x5e, 0x54, 0x2f, 0x726d, 0x37, 0x15c, 0xb8, + 0xcb, 0x2, 0x1, 0x5, 0x3b, 0xa, 0x38, 0x46, 0xc, 0x74, 0x1e, 0x4e, 0xb, 0x21, 0x37, 0xe, 0xa, 0x67, 0x1c, 0x6, + 0x6, 0x6, 0x7, 0x7, 0x3c, 0x7e, 0xa, 0x2ba4, 0x17, 0x31, 0x16e, 0x6a, 0x7, 0x5, 0x1a, 0x5, 0x1, 0x2, 0x2, 0x7d, + 0x1bd, 0x36, 0x1, 0x2a, 0x33, 0x13, 0x4, 0x5, 0x87, 0xbe, 0x6, 0x6, 0x6, 0x3, 0x7, 0x7, 0x2, 0xc, 0x1a, 0x13, + 0x2, 0xf, 0xe, 0x7b, 0x3, 0x2d, 0x58, 0xd, 0x1, 0x2e, 0x1d, 0x31, 0x1c, 0x24, 0x1e, 0x2b, 0x1e, 0x25, 0xe, 0x9e, + 0xa, 0x24, 0x24, 0x28, 0x34, 0xc, 0xf, 0x7, 0x2, 0xb, 0xf, 0x7, 0x2, 0x137, 0x16, 0x8, 0x6, 0x2a, 0x9, 0x6, 0x1, + 0x2c, 0x2, 0x1, 0x17, 0x48, 0x9, 0x13, 0x2, 0x21, 0x1b, 0x1, 0x38, 0x14, 0x32, 0x2, 0x8, 0x3, 0x1d, 0x3, 0xa, + 0x9, 0x40, 0x27, 0xc, 0x36, 0x1d, 0x1b, 0x1a, 0x4, 0x7, 0x49, 0x33, 0x33, 0x2e, 0xa, 0x1f, 0x2a, 0x3, 0x2, 0x2b, + 0x2a, 0x1a, 0x1c, 0x17, 0x4e, 0x24, 0x3e, 0x5, 0x19, 0xa, 0x35, 0x12, 0x27, 0x60, 0x14, 0x12, 0x2f, 0x7, 0x1, + 0x4, 0xf, 0xb, 0x3b, 0xa, 0x4, 0x8, 0x2, 0x16, 0x7, 0x2, 0x5, 0xa, 0x2, 0x3, 0x1, 0x1, 0x7, 0x7, 0x5, 0x5c, 0x5, + 0x48, 0xa, 0x36, 0x26, 0x45, 0xa, 0xd, 0x3a, 0xa, 0x1b, 0xf, 0x17, 0x3c, 0x53, 0x8, 0x1, 0x8, 0x2, 0x1e, 0x2, + 0xc, 0xa, 0x8, 0x2e, 0xb, 0x48, 0x53, 0x49, 0xa, 0x9, 0x2d, 0xe, 0x1d, 0x20, 0x16, 0xe, 0x7, 0x2, 0x2c, 0x1, + 0x2, 0x9, 0xa, 0x6, 0x2, 0x25, 0x2, 0x6, 0xa, 0x19, 0x11, 0x29, 0x1c, 0x1, 0x32, 0x39b, 0x6f, 0x5, 0xc4, 0x63, + 0x430, 0x16, 0x247, 0x239, 0x1f, 0xa, 0x51, 0xa, 0x1e, 0x6, 0x46, 0xa, 0x7, 0x15, 0x13, 0x5b, 0x4b, 0x39, 0x11, + 0x5, 0x2, 0x17f8, 0x4d6, 0x9, 0x4, 0x7, 0x2, 0x123, 0x1, 0x3, 0x1, 0x4, 0x18c, 0x6b, 0xd, 0x9, 0xa, 0x4, 0x2e, + 0x17, 0x74, 0xf6, 0x27, 0x4a, 0x70, 0x46, 0x14, 0x14, 0x57, 0x19, 0x55, 0x47, 0x2, 0x1, 0x2, 0x4, 0xc, 0x1, 0x7, + 0x41, 0x4, 0x8, 0x7, 0x1c, 0x4, 0x5, 0x1, 0x7, 0x154, 0x124, 0x2be, 0x5, 0xf, 0x1f, 0x6, 0x7, 0x11, 0x7, 0x2, + 0x5, 0x3e, 0x1, 0x2d, 0xe, 0xa, 0x2, 0x1f, 0x3a, 0x1, 0x2a, 0x7, 0x4, 0x2, 0xf, 0xc5, 0x10, 0x4c, 0xa, 0x2, + 0x44, 0x3d, 0x4, 0x1b, 0x2, 0x1, 0x1, 0xa, 0x4, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x3, 0x2, 0x1, 0x1, 0x1, 0x1, 0x1, + 0x1, 0x2, 0x1, 0x4, 0x7, 0x4, 0x4, 0x1, 0xa, 0x11, 0x3, 0x5, 0x11, 0x2, 0x2c, 0x64, 0xf, 0xf, 0xf, 0x25, 0xae, + 0x1d, 0x2c, 0x9, 0x2, 0x6, 0x3d8, 0x11, 0xd, 0x77, 0x5f, 0xc, 0x1, 0xc, 0x38, 0xa, 0x28, 0x1e, 0x2, 0x154, 0xe, + 0xd, 0x9, 0x2e, 0x7, 0xe, 0x9, 0x9, 0x93, 0x37, 0xa, 0xa6e0, 0x103a, 0xde, 0x1682, 0x1d31, 0x21e, 0x134b, + 0x1060, 0xf0}}; + +// DerivedCoreProperties-15.0.0.txt +// Date: 2022-08-05, 22:17:05 GMT +enum class _Grapheme_Extend_property_values : uint8_t { _Grapheme_Extend_value, _No_value = 255 }; + +// DerivedCoreProperties-15.0.0.txt +// Date: 2022-08-05, 22:17:05 GMT +inline constexpr _Unicode_property_data<_Grapheme_Extend_property_values, 363, true> _Grapheme_Extend_property_data{ + {0x300, 0x483, 0x591, 0x5bf, 0x5c1, 0x5c4, 0x5c7, 0x610, 0x64b, 0x670, 0x6d6, 0x6df, 0x6e7, 0x6ea, 0x711, 0x730, + 0x7a6, 0x7eb, 0x7fd, 0x816, 0x81b, 0x825, 0x829, 0x859, 0x898, 0x8ca, 0x8e3, 0x93a, 0x93c, 0x941, 0x94d, 0x951, + 0x962, 0x981, 0x9bc, 0x9be, 0x9c1, 0x9cd, 0x9d7, 0x9e2, 0x9fe, 0xa01, 0xa3c, 0xa41, 0xa47, 0xa4b, 0xa51, 0xa70, + 0xa75, 0xa81, 0xabc, 0xac1, 0xac7, 0xacd, 0xae2, 0xafa, 0xb01, 0xb3c, 0xb3e, 0xb41, 0xb4d, 0xb55, 0xb62, 0xb82, + 0xbbe, 0xbc0, 0xbcd, 0xbd7, 0xc00, 0xc04, 0xc3c, 0xc3e, 0xc46, 0xc4a, 0xc55, 0xc62, 0xc81, 0xcbc, 0xcbf, 0xcc2, + 0xcc6, 0xccc, 0xcd5, 0xce2, 0xd00, 0xd3b, 0xd3e, 0xd41, 0xd4d, 0xd57, 0xd62, 0xd81, 0xdca, 0xdcf, 0xdd2, 0xdd6, + 0xddf, 0xe31, 0xe34, 0xe47, 0xeb1, 0xeb4, 0xec8, 0xf18, 0xf35, 0xf37, 0xf39, 0xf71, 0xf80, 0xf86, 0xf8d, 0xf99, + 0xfc6, 0x102d, 0x1032, 0x1039, 0x103d, 0x1058, 0x105e, 0x1071, 0x1082, 0x1085, 0x108d, 0x109d, 0x135d, 0x1712, + 0x1732, 0x1752, 0x1772, 0x17b4, 0x17b7, 0x17c6, 0x17c9, 0x17dd, 0x180b, 0x180f, 0x1885, 0x18a9, 0x1920, 0x1927, + 0x1932, 0x1939, 0x1a17, 0x1a1b, 0x1a56, 0x1a58, 0x1a60, 0x1a62, 0x1a65, 0x1a73, 0x1a7f, 0x1ab0, 0x1b00, 0x1b34, + 0x1b3c, 0x1b42, 0x1b6b, 0x1b80, 0x1ba2, 0x1ba8, 0x1bab, 0x1be6, 0x1be8, 0x1bed, 0x1bef, 0x1c2c, 0x1c36, 0x1cd0, + 0x1cd4, 0x1ce2, 0x1ced, 0x1cf4, 0x1cf8, 0x1dc0, 0x200c, 0x20d0, 0x2cef, 0x2d7f, 0x2de0, 0x302a, 0x3099, 0xa66f, + 0xa674, 0xa69e, 0xa6f0, 0xa802, 0xa806, 0xa80b, 0xa825, 0xa82c, 0xa8c4, 0xa8e0, 0xa8ff, 0xa926, 0xa947, 0xa980, + 0xa9b3, 0xa9b6, 0xa9bc, 0xa9e5, 0xaa29, 0xaa31, 0xaa35, 0xaa43, 0xaa4c, 0xaa7c, 0xaab0, 0xaab2, 0xaab7, 0xaabe, + 0xaac1, 0xaaec, 0xaaf6, 0xabe5, 0xabe8, 0xabed, 0xfb1e, 0xfe00, 0xfe20, 0xff9e, 0x101fd, 0x102e0, 0x10376, + 0x10a01, 0x10a05, 0x10a0c, 0x10a38, 0x10a3f, 0x10ae5, 0x10d24, 0x10eab, 0x10efd, 0x10f46, 0x10f82, 0x11001, + 0x11038, 0x11070, 0x11073, 0x1107f, 0x110b3, 0x110b9, 0x110c2, 0x11100, 0x11127, 0x1112d, 0x11173, 0x11180, + 0x111b6, 0x111c9, 0x111cf, 0x1122f, 0x11234, 0x11236, 0x1123e, 0x11241, 0x112df, 0x112e3, 0x11300, 0x1133b, + 0x1133e, 0x11340, 0x11357, 0x11366, 0x11370, 0x11438, 0x11442, 0x11446, 0x1145e, 0x114b0, 0x114b3, 0x114ba, + 0x114bd, 0x114bf, 0x114c2, 0x115af, 0x115b2, 0x115bc, 0x115bf, 0x115dc, 0x11633, 0x1163d, 0x1163f, 0x116ab, + 0x116ad, 0x116b0, 0x116b7, 0x1171d, 0x11722, 0x11727, 0x1182f, 0x11839, 0x11930, 0x1193b, 0x1193e, 0x11943, + 0x119d4, 0x119da, 0x119e0, 0x11a01, 0x11a33, 0x11a3b, 0x11a47, 0x11a51, 0x11a59, 0x11a8a, 0x11a98, 0x11c30, + 0x11c38, 0x11c3f, 0x11c92, 0x11caa, 0x11cb2, 0x11cb5, 0x11d31, 0x11d3a, 0x11d3c, 0x11d3f, 0x11d47, 0x11d90, + 0x11d95, 0x11d97, 0x11ef3, 0x11f00, 0x11f36, 0x11f40, 0x11f42, 0x13440, 0x13447, 0x16af0, 0x16b30, 0x16f4f, + 0x16f8f, 0x16fe4, 0x1bc9d, 0x1cf00, 0x1cf30, 0x1d165, 0x1d167, 0x1d16e, 0x1d17b, 0x1d185, 0x1d1aa, 0x1d242, + 0x1da00, 0x1da3b, 0x1da75, 0x1da84, 0x1da9b, 0x1daa1, 0x1e000, 0x1e008, 0x1e01b, 0x1e023, 0x1e026, 0x1e08f, + 0x1e130, 0x1e2ae, 0x1e2ec, 0x1e4ec, 0x1e8d0, 0x1e944, 0xe0020, 0xe0100}, + {0x70, 0x7, 0x2d, 0x1, 0x2, 0x2, 0x1, 0xb, 0x15, 0x1, 0x7, 0x6, 0x2, 0x4, 0x1, 0x1b, 0xb, 0x9, 0x1, 0x4, 0x9, 0x3, + 0x5, 0x3, 0x8, 0x18, 0x20, 0x1, 0x1, 0x8, 0x1, 0x7, 0x2, 0x1, 0x1, 0x1, 0x4, 0x1, 0x1, 0x2, 0x1, 0x2, 0x1, 0x2, + 0x2, 0x3, 0x1, 0x2, 0x1, 0x2, 0x1, 0x5, 0x2, 0x1, 0x2, 0x6, 0x1, 0x1, 0x2, 0x4, 0x1, 0x3, 0x2, 0x1, 0x1, 0x1, + 0x1, 0x1, 0x1, 0x1, 0x1, 0x3, 0x3, 0x4, 0x2, 0x2, 0x1, 0x1, 0x1, 0x1, 0x1, 0x2, 0x2, 0x2, 0x2, 0x2, 0x1, 0x4, + 0x1, 0x1, 0x2, 0x1, 0x1, 0x1, 0x3, 0x1, 0x1, 0x1, 0x7, 0x8, 0x1, 0x9, 0x7, 0x2, 0x1, 0x1, 0x1, 0xe, 0x5, 0x2, + 0xb, 0x24, 0x1, 0x4, 0x6, 0x2, 0x2, 0x2, 0x3, 0x4, 0x1, 0x2, 0x1, 0x1, 0x3, 0x3, 0x2, 0x2, 0x2, 0x2, 0x7, 0x1, + 0xb, 0x1, 0x3, 0x1, 0x2, 0x1, 0x3, 0x2, 0x1, 0x3, 0x2, 0x1, 0x1, 0x7, 0x1, 0x1, 0x8, 0xa, 0x1, 0x1f, 0x4, 0x7, + 0x1, 0x1, 0x9, 0x2, 0x4, 0x2, 0x3, 0x1, 0x2, 0x1, 0x3, 0x8, 0x2, 0x3, 0xd, 0x7, 0x1, 0x1, 0x2, 0x40, 0x1, 0x21, + 0x3, 0x1, 0x20, 0x6, 0x2, 0x4, 0xa, 0x2, 0x2, 0x1, 0x1, 0x1, 0x2, 0x1, 0x2, 0x12, 0x1, 0x8, 0xb, 0x3, 0x1, 0x4, + 0x2, 0x1, 0x6, 0x2, 0x2, 0x1, 0x1, 0x1, 0x1, 0x3, 0x2, 0x2, 0x1, 0x2, 0x1, 0x1, 0x1, 0x1, 0x1, 0x10, 0x10, 0x2, + 0x1, 0x1, 0x5, 0x3, 0x2, 0x4, 0x3, 0x1, 0x2, 0x4, 0x2, 0x3, 0xb, 0x4, 0x1, 0xf, 0x1, 0x2, 0x3, 0x4, 0x2, 0x1, + 0x3, 0x5, 0x8, 0x1, 0x2, 0x9, 0x4, 0x1, 0x3, 0x1, 0x2, 0x1, 0x1, 0x1, 0x8, 0x2, 0x2, 0x1, 0x1, 0x1, 0x7, 0x5, + 0x8, 0x3, 0x1, 0x1, 0x1, 0x6, 0x1, 0x1, 0x2, 0x2, 0x1, 0x4, 0x2, 0x2, 0x2, 0x8, 0x1, 0x2, 0x1, 0x1, 0x6, 0x1, + 0x3, 0x4, 0x5, 0x9, 0x2, 0x1, 0x2, 0x1, 0x1, 0x4, 0x2, 0x1, 0xa, 0x6, 0x4, 0x1, 0x6, 0x3, 0xd, 0x2, 0x7, 0x6, + 0x1, 0x16, 0x7, 0x2, 0x2, 0x6, 0x1, 0x2, 0x7, 0x1, 0x2, 0x1, 0x1, 0x2, 0x2, 0x5, 0x1, 0x1, 0x1, 0xf, 0x5, 0x7, + 0x1, 0x4, 0x1, 0x2, 0x2e, 0x17, 0x1, 0x3, 0x5, 0x8, 0x7, 0x4, 0x3, 0x37, 0x32, 0x1, 0x1, 0x5, 0xf, 0x7, 0x11, + 0x7, 0x2, 0x5, 0x1, 0x7, 0x1, 0x4, 0x4, 0x7, 0x7, 0x60, 0xf0}}; + +// EastAsianWidth-15.0.0.txt +// Date: 2022-05-24, 17:40:20 GMT [KW, LI] +inline constexpr char32_t _Width_estimate_intervals_v2[] = {0x1100, 0x1160, 0x231a, 0x231c, 0x2329, 0x232b, 0x23e9, + 0x23ed, 0x23f0, 0x23f1, 0x23f3, 0x23f4, 0x25fd, 0x25ff, 0x2614, 0x2616, 0x2648, 0x2654, 0x267f, 0x2680, 0x2693, + 0x2694, 0x26a1, 0x26a2, 0x26aa, 0x26ac, 0x26bd, 0x26bf, 0x26c4, 0x26c6, 0x26ce, 0x26cf, 0x26d4, 0x26d5, 0x26ea, + 0x26eb, 0x26f2, 0x26f4, 0x26f5, 0x26f6, 0x26fa, 0x26fb, 0x26fd, 0x26fe, 0x2705, 0x2706, 0x270a, 0x270c, 0x2728, + 0x2729, 0x274c, 0x274d, 0x274e, 0x274f, 0x2753, 0x2756, 0x2757, 0x2758, 0x2795, 0x2798, 0x27b0, 0x27b1, 0x27bf, + 0x27c0, 0x2b1b, 0x2b1d, 0x2b50, 0x2b51, 0x2b55, 0x2b56, 0x2e80, 0x2e9a, 0x2e9b, 0x2ef4, 0x2f00, 0x2fd6, 0x2ff0, + 0x2ffc, 0x3000, 0x303f, 0x3041, 0x3097, 0x3099, 0x3100, 0x3105, 0x3130, 0x3131, 0x318f, 0x3190, 0x31e4, 0x31f0, + 0x321f, 0x3220, 0x3248, 0x3250, 0xa48d, 0xa490, 0xa4c7, 0xa960, 0xa97d, 0xac00, 0xd7a4, 0xf900, 0xfb00, 0xfe10, + 0xfe1a, 0xfe30, 0xfe53, 0xfe54, 0xfe67, 0xfe68, 0xfe6c, 0xff01, 0xff61, 0xffe0, 0xffe7, 0x16fe0, 0x16fe5, 0x16ff0, + 0x16ff2, 0x17000, 0x187f8, 0x18800, 0x18cd6, 0x18d00, 0x18d09, 0x1aff0, 0x1aff4, 0x1aff5, 0x1affc, 0x1affd, 0x1afff, + 0x1b000, 0x1b123, 0x1b132, 0x1b133, 0x1b150, 0x1b153, 0x1b155, 0x1b156, 0x1b164, 0x1b168, 0x1b170, 0x1b2fc, 0x1f004, + 0x1f005, 0x1f0cf, 0x1f0d0, 0x1f18e, 0x1f18f, 0x1f191, 0x1f19b, 0x1f200, 0x1f203, 0x1f210, 0x1f23c, 0x1f240, 0x1f249, + 0x1f250, 0x1f252, 0x1f260, 0x1f266, 0x1f300, 0x1f650, 0x1f680, 0x1f6c6, 0x1f6cc, 0x1f6cd, 0x1f6d0, 0x1f6d3, 0x1f6d5, + 0x1f6d8, 0x1f6dc, 0x1f6e0, 0x1f6eb, 0x1f6ed, 0x1f6f4, 0x1f6fd, 0x1f7e0, 0x1f7ec, 0x1f7f0, 0x1f7f1, 0x1f900, 0x1fa00, + 0x1fa70, 0x1fa7d, 0x1fa80, 0x1fa89, 0x1fa90, 0x1fabe, 0x1fabf, 0x1fac6, 0x1face, 0x1fadc, 0x1fae0, 0x1fae9, 0x1faf0, + 0x1faf9, 0x20000, 0x2fffe, 0x30000, 0x3fffe}; + +_STD_END + +#pragma pop_macro("new") +_STL_RESTORE_CLANG_WARNINGS +#pragma warning(pop) +#pragma pack(pop) + +#endif // _STL_COMPILER_PREPROCESSOR +#endif // __MSVC_FORMAT_UCD_TABLES_HPP diff --git a/miniMSVC/VC/Tools/MSVC/14.42.34433/include/__msvc_formatter.hpp b/miniMSVC/VC/Tools/MSVC/14.42.34433/include/__msvc_formatter.hpp new file mode 100644 index 0000000000000000000000000000000000000000..5ff1bea2f4b24589e2d94ebb3e75bd550258f37f --- /dev/null +++ b/miniMSVC/VC/Tools/MSVC/14.42.34433/include/__msvc_formatter.hpp @@ -0,0 +1,373 @@ +// __msvc_formatter.hpp internal header + +// Copyright (c) Microsoft Corporation. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +// NOTE: +// The contents of this header are derived in part from libfmt under the following license: + +// Copyright (c) 2012 - present, Victor Zverovich +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. + +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +// --- Optional exception to the license --- +// +// As an exception, if, as a result of your compiling your source code, portions +// of this Software are embedded into a machine-executable object form of such +// source code, you may redistribute such embedded portions in such object form +// without including the above copyright and permission notices. + +#ifndef __MSVC_FORMATTER_HPP +#define __MSVC_FORMATTER_HPP +#include +#if _STL_COMPILER_PREPROCESSOR + +#if !_HAS_CXX20 +#error The contents of are only available with C++20. (Also, you should not include this internal header.) +#endif // !_HAS_CXX20 + +#include +#include +#include +#include +#if _HAS_CXX23 +#include +#endif // _HAS_CXX23 + +#pragma pack(push, _CRT_PACKING) +#pragma warning(push, _STL_WARNING_LEVEL) +#pragma warning(disable : _STL_DISABLED_WARNINGS) +_STL_DISABLE_CLANG_WARNINGS +#pragma push_macro("new") +#undef new + +_STD_BEGIN +#if _HAS_CXX23 +#define _FMT_P2286_BEGIN inline namespace __p2286 { +#define _FMT_P2286_END } +#else // ^^^ _HAS_CXX23 / !_HAS_CXX23 vvv +#define _FMT_P2286_BEGIN +#define _FMT_P2286_END +#endif // ^^^ !_HAS_CXX23 ^^^ + +enum class _Fmt_align : uint8_t { _None, _Left, _Right, _Center }; + +enum class _Fmt_sign : uint8_t { _None, _Plus, _Minus, _Space }; + +enum class _Basic_format_arg_type : uint8_t { + _None, + _Int_type, + _UInt_type, + _Long_long_type, + _ULong_long_type, + _Bool_type, + _Char_type, + _Float_type, + _Double_type, + _Long_double_type, + _Pointer_type, + _CString_type, + _String_type, + _Custom_type, +}; +static_assert(static_cast(_Basic_format_arg_type::_Custom_type) < 16, "must fit in 4-bit bitfield"); + +#if _HAS_CXX23 +_NODISCARD consteval bool _Is_debug_enabled_fmt_type(_Basic_format_arg_type _Ty) { + return _Ty == _Basic_format_arg_type::_Char_type || _Ty == _Basic_format_arg_type::_CString_type + || _Ty == _Basic_format_arg_type::_String_type; +} +#endif // _HAS_CXX23 + +template +struct _Basic_format_specs { + int _Width = 0; + int _Precision = -1; + char _Type = '\0'; + _Fmt_align _Alignment = _Fmt_align::_None; + _Fmt_sign _Sgn = _Fmt_sign::_None; + bool _Alt = false; + bool _Localized = false; + bool _Leading_zero = false; + uint8_t _Fill_length = 1; + // At most one codepoint (so one char32_t or four utf-8 char8_t). + _CharT _Fill[4 / sizeof(_CharT)] = {_CharT{' '}}; +}; + +// Adds width and precision references to _Basic_format_specs. +// This is required for std::formatter implementations because we must +// parse the format specs without having access to the format args (via a format context). +template +struct _Dynamic_format_specs : _Basic_format_specs<_CharT> { + int _Dynamic_width_index = -1; + int _Dynamic_precision_index = -1; +}; + +_EXPORT_STD template +class basic_format_parse_context; + +template +concept _Format_supported_charT = _Is_any_of_v<_CharT, char, wchar_t>; + +// Generic formatter definition, the deleted default constructor +// makes it "disabled" as per N4950 [format.formatter.spec]/5 +_EXPORT_STD template +struct formatter { + formatter() = delete; + formatter(const formatter&) = delete; + formatter& operator=(const formatter&) = delete; +}; + +_FMT_P2286_BEGIN +// TRANSITION, VSO-1236041: Avoid declaring and defining member functions in different headers. +template <_Basic_format_arg_type _ArgType, class _CharT, class _Pc> +constexpr _Pc::iterator _Formatter_base_parse(_Dynamic_format_specs<_CharT>& _Specs, _Pc& _ParseCtx); + +template +_FormatContext::iterator _Formatter_base_format( + const _Dynamic_format_specs<_CharT>& _Specs, const _Ty& _Val, _FormatContext& _FormatCtx); + +template +struct _Formatter_base { +public: +#if _HAS_CXX23 + constexpr void _Set_debug_format() noexcept + requires (_Is_debug_enabled_fmt_type(_ArgType)) + { + _Specs._Type = '?'; + } +#endif // _HAS_CXX23 + + template > + constexpr _Pc::iterator parse(type_identity_t<_Pc&> _ParseCtx) { + return _Formatter_base_parse<_ArgType>(_Specs, _ParseCtx); + } + + template + _FormatContext::iterator format(const _Ty& _Val, _FormatContext& _FormatCtx) const { + return _Formatter_base_format(_Specs, _Val, _FormatCtx); + } + +private: + _Dynamic_format_specs<_CharT> _Specs; +}; +_FMT_P2286_END + +#define _FORMAT_SPECIALIZE_FOR(_Type, _ArgType) \ + template <_Format_supported_charT _CharT> \ + struct formatter<_Type, _CharT> : _Formatter_base<_Type, _CharT, _ArgType> {} + +_FORMAT_SPECIALIZE_FOR(int, _Basic_format_arg_type::_Int_type); +_FORMAT_SPECIALIZE_FOR(unsigned int, _Basic_format_arg_type::_UInt_type); +_FORMAT_SPECIALIZE_FOR(long long, _Basic_format_arg_type::_Long_long_type); +_FORMAT_SPECIALIZE_FOR(unsigned long long, _Basic_format_arg_type::_ULong_long_type); +_FORMAT_SPECIALIZE_FOR(bool, _Basic_format_arg_type::_Bool_type); +_FORMAT_SPECIALIZE_FOR(float, _Basic_format_arg_type::_Float_type); +_FORMAT_SPECIALIZE_FOR(double, _Basic_format_arg_type::_Double_type); +_FORMAT_SPECIALIZE_FOR(long double, _Basic_format_arg_type::_Long_double_type); +_FORMAT_SPECIALIZE_FOR(nullptr_t, _Basic_format_arg_type::_Pointer_type); +_FORMAT_SPECIALIZE_FOR(void*, _Basic_format_arg_type::_Pointer_type); +_FORMAT_SPECIALIZE_FOR(const void*, _Basic_format_arg_type::_Pointer_type); +_FORMAT_SPECIALIZE_FOR(short, _Basic_format_arg_type::_Int_type); +_FORMAT_SPECIALIZE_FOR(unsigned short, _Basic_format_arg_type::_UInt_type); +_FORMAT_SPECIALIZE_FOR(long, _Basic_format_arg_type::_Int_type); +_FORMAT_SPECIALIZE_FOR(unsigned long, _Basic_format_arg_type::_UInt_type); +_FORMAT_SPECIALIZE_FOR(signed char, _Basic_format_arg_type::_Int_type); +_FORMAT_SPECIALIZE_FOR(unsigned char, _Basic_format_arg_type::_UInt_type); + +#undef _FORMAT_SPECIALIZE_FOR + +// not using the macro because we'd like to add 'set_debug_format' member function in C++23 mode +template <_Format_supported_charT _CharT> +struct formatter : _Formatter_base { +#if _HAS_CXX23 + constexpr void set_debug_format() noexcept { + this->_Set_debug_format(); + } +#endif // _HAS_CXX23 +}; + +// not using the macro because we'd like to avoid the formatter specialization +template <> +struct formatter : _Formatter_base { +#if _HAS_CXX23 + constexpr void set_debug_format() noexcept { + _Set_debug_format(); + } +#endif // _HAS_CXX23 +}; + +// We could use the macro for these specializations, but it's confusing to refer to symbols that are defined +// inside the macro in the macro's "call". +template <_Format_supported_charT _CharT> +struct formatter<_CharT*, _CharT> : _Formatter_base<_CharT*, _CharT, _Basic_format_arg_type::_CString_type> { +#if _HAS_CXX23 + constexpr void set_debug_format() noexcept { + this->_Set_debug_format(); + } +#endif // _HAS_CXX23 +}; + +template <_Format_supported_charT _CharT> +struct formatter + : _Formatter_base { +#if _HAS_CXX23 + constexpr void set_debug_format() noexcept { + this->_Set_debug_format(); + } +#endif // _HAS_CXX23 +}; + +template <_Format_supported_charT _CharT, size_t _Nx> +struct formatter<_CharT[_Nx], _CharT> : _Formatter_base<_CharT[_Nx], _CharT, _Basic_format_arg_type::_CString_type> { +#if _HAS_CXX23 + constexpr void set_debug_format() noexcept { + this->_Set_debug_format(); + } +#endif // _HAS_CXX23 +}; + +_EXPORT_STD template +class basic_string; + +_EXPORT_STD template +class basic_string_view; + +template <_Format_supported_charT _CharT, class _Traits, class _Allocator> +struct formatter, _CharT> + : _Formatter_base, _CharT, _Basic_format_arg_type::_String_type> { +#if _HAS_CXX23 + constexpr void set_debug_format() noexcept { + this->_Set_debug_format(); + } +#endif // _HAS_CXX23 +}; + +template <_Format_supported_charT _CharT, class _Traits> +struct formatter, _CharT> + : _Formatter_base, _CharT, _Basic_format_arg_type::_String_type> { +#if _HAS_CXX23 + constexpr void set_debug_format() noexcept { + this->_Set_debug_format(); + } +#endif // _HAS_CXX23 +}; + +#if _HAS_CXX23 +template <> +struct formatter { + formatter() = delete; + formatter(const formatter&) = delete; + formatter& operator=(const formatter&) = delete; +}; + +template <> +struct formatter { + formatter() = delete; + formatter(const formatter&) = delete; + formatter& operator=(const formatter&) = delete; +}; + +template +struct formatter { + formatter() = delete; + formatter(const formatter&) = delete; + formatter& operator=(const formatter&) = delete; +}; + +template +struct formatter, wchar_t> { + formatter() = delete; + formatter(const formatter&) = delete; + formatter& operator=(const formatter&) = delete; +}; + +template +struct formatter, wchar_t> { + formatter() = delete; + formatter(const formatter&) = delete; + formatter& operator=(const formatter&) = delete; +}; + +_EXPORT_STD enum class range_format { disabled, map, set, sequence, string, debug_string }; + +template +struct _Invalid_format_kind { + static_assert(_Always_false<_Ty>, "A program that instantiates the primary template of format_kind is ill-formed. " + "(N4981 [format.range.fmtkind]/1)"); +}; + +_EXPORT_STD template +constexpr _Invalid_format_kind<_Ty> format_kind; + +template +constexpr bool _Is_two_tuple = false; + +template +constexpr bool _Is_two_tuple> = true; + +template +constexpr bool _Is_two_tuple> = true; + +template <_RANGES input_range _Rng> + requires same_as<_Rng, remove_cvref_t<_Rng>> +constexpr range_format format_kind<_Rng> = []() consteval { + using _Ref_value_t = remove_cvref_t<_RANGES range_reference_t<_Rng>>; + if constexpr (same_as<_Ref_value_t, _Rng>) { + return range_format::disabled; + } else if constexpr (requires { typename _Rng::key_type; }) { + if constexpr (requires { typename _Rng::mapped_type; } && _Is_two_tuple<_Ref_value_t>) { + return range_format::map; + } else { + return range_format::set; + } + } else { + return range_format::sequence; + } +}(); + +// Specializations for pairs, tuples, and ranges are forward-declared to avoid any risk of using the disabled primary +// template. + +// Per LWG-3997, `_CharT` in library-provided `formatter` specializations is +// constrained to character types supported by `format`. + +template +concept _Formatting_enabled_range = format_kind<_Rng> != range_format::disabled; + +template <_RANGES input_range _Rng, _Format_supported_charT _CharT> + requires _Formatting_enabled_range<_Rng> +struct formatter<_Rng, _CharT>; + +template <_Format_supported_charT _CharT, class _Ty1, class _Ty2> +struct formatter, _CharT>; + +template <_Format_supported_charT _CharT, class... _Types> +struct formatter, _CharT>; +#endif // _HAS_CXX23 +_STD_END + +#pragma pop_macro("new") +_STL_RESTORE_CLANG_WARNINGS +#pragma warning(pop) +#pragma pack(pop) + +#endif // _STL_COMPILER_PREPROCESSOR +#endif // __MSVC_FORMATTER_HPP diff --git a/miniMSVC/VC/Tools/MSVC/14.42.34433/include/system_error b/miniMSVC/VC/Tools/MSVC/14.42.34433/include/system_error new file mode 100644 index 0000000000000000000000000000000000000000..51ac72440b72592929669f4cf16c9bc911240b90 --- /dev/null +++ b/miniMSVC/VC/Tools/MSVC/14.42.34433/include/system_error @@ -0,0 +1,738 @@ +// system_error standard header + +// Copyright (c) Microsoft Corporation. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +#ifndef _SYSTEM_ERROR_ +#define _SYSTEM_ERROR_ +#include +#if _STL_COMPILER_PREPROCESSOR +#include <__msvc_system_error_abi.hpp> +#include +#include +#include +#include +#include +#ifndef _M_CEE_PURE +#include +#endif // !defined(_M_CEE_PURE) + +#if _HAS_CXX20 +#include +#endif // _HAS_CXX20 + +#pragma pack(push, _CRT_PACKING) +#pragma warning(push, _STL_WARNING_LEVEL) +#pragma warning(disable : _STL_DISABLED_WARNINGS) +_STL_DISABLE_CLANG_WARNINGS +#pragma push_macro("new") +#undef new + +// TRANSITION, non-_Ugly attribute tokens +#pragma push_macro("msvc") +#pragma push_macro("noop_dtor") +#undef msvc +#undef noop_dtor + +_STD_BEGIN +_EXPORT_STD enum class io_errc { // error codes for ios_base::failure + stream = 1 +}; + +_EXPORT_STD template +struct is_error_code_enum : false_type {}; + +template <> +struct is_error_code_enum : true_type {}; + +_EXPORT_STD template +constexpr bool is_error_code_enum_v = is_error_code_enum<_Ty>::value; + +_EXPORT_STD template +struct is_error_condition_enum : false_type {}; + +template <> +struct is_error_condition_enum : true_type {}; + +_EXPORT_STD template +constexpr bool is_error_condition_enum_v = is_error_condition_enum<_Ty>::value; + +_EXPORT_STD class error_code; +_EXPORT_STD class error_condition; + +namespace _Ensure_adl { + void make_error_code() = delete; + void make_error_condition() = delete; +} // namespace _Ensure_adl + +_EXPORT_STD class error_category; + +_EXPORT_STD _NODISCARD const error_category& generic_category() noexcept; +_EXPORT_STD _NODISCARD const error_category& iostream_category() noexcept; +_EXPORT_STD _NODISCARD const error_category& system_category() noexcept; + +_EXPORT_STD class __declspec(novtable) error_category { // categorize an error +public: +#ifdef _M_CEE_PURE + /* constexpr */ error_category() noexcept { // TRANSITION, ABI + _Addr = reinterpret_cast(this); + } +#else // ^^^ defined(_M_CEE_PURE) / !defined(_M_CEE_PURE) vvv +#pragma warning(push) +#pragma warning(disable : 4355) // 'this': used in base member initializer list + constexpr error_category() noexcept : _Addr(this) {} +#pragma warning(pop) +#endif // ^^^ !defined(_M_CEE_PURE) ^^^ + + _CONSTEXPR20 virtual ~error_category() noexcept = default; + + _NODISCARD virtual const char* name() const noexcept = 0; + + _NODISCARD virtual string message(int _Errval) const = 0; + + _NODISCARD virtual error_condition default_error_condition(int _Errval) const noexcept; + + _NODISCARD virtual bool equivalent(int _Errval, const error_condition& _Cond) const noexcept; + + _NODISCARD virtual bool equivalent(const error_code& _Code, int _Errval) const noexcept; + + _NODISCARD bool operator==(const error_category& _Right) const noexcept { +#ifdef _M_CEE_PURE + return _Addr == _Right._Addr; +#else // ^^^ defined(_M_CEE_PURE) / !defined(_M_CEE_PURE) vvv + return _Bit_cast(_Addr) == _Bit_cast(_Right._Addr); +#endif // ^^^ !defined(_M_CEE_PURE) ^^^ + } + +#if _HAS_CXX20 + _NODISCARD strong_ordering operator<=>(const error_category& _Right) const noexcept { + return _Bit_cast(_Addr) <=> _Bit_cast(_Right._Addr); + } +#else // ^^^ _HAS_CXX20 / !_HAS_CXX20 vvv + _NODISCARD bool operator!=(const error_category& _Right) const noexcept { + return !(*this == _Right); + } + + _NODISCARD bool operator<(const error_category& _Right) const noexcept { +#ifdef _M_CEE_PURE + return _Addr < _Right._Addr; +#else // ^^^ defined(_M_CEE_PURE) / !defined(_M_CEE_PURE) vvv + return _Bit_cast(_Addr) < _Bit_cast(_Right._Addr); +#endif // ^^^ !defined(_M_CEE_PURE) ^^^ + } +#endif // ^^^ !_HAS_CXX20 ^^^ + + error_category(const error_category&) = delete; + error_category& operator=(const error_category&) = delete; + +protected: +#ifdef _M_CEE_PURE + uintptr_t _Addr; +#else // ^^^ defined(_M_CEE_PURE) / !defined(_M_CEE_PURE) vvv + union _Addr_storage { + private: + uintptr_t _Num; + error_category* _Ptr; + + public: + constexpr explicit _Addr_storage(const uintptr_t _Addr_num) noexcept : _Num(_Addr_num) {} + constexpr explicit _Addr_storage(error_category* const _Addr_ptr) noexcept : _Ptr(_Addr_ptr) {} + + // TRANSITION: As of Boost 1.80.0, boost::system::detail::std_category assigns to _Addr. + constexpr _Addr_storage& operator=(const uintptr_t _Addr_num) noexcept { + _Num = _Addr_num; + return *this; + } + }; + _STL_INTERNAL_STATIC_ASSERT(sizeof(_Addr_storage) == sizeof(uintptr_t)); + _STL_INTERNAL_STATIC_ASSERT(alignof(_Addr_storage) == alignof(uintptr_t)); + + _Addr_storage _Addr; +#endif // ^^^ !defined(_M_CEE_PURE) ^^^ + + constexpr explicit error_category(const uintptr_t _Addr_) noexcept : _Addr(_Addr_) {} + + enum : uintptr_t { // symbolic addresses for Standard error_category objects + _Future_addr = 1, + _Generic_addr = 3, + _Iostream_addr = 5, + _System_addr = 7 + }; +}; + +#if _STL_OPTIMIZE_SYSTEM_ERROR_OPERATORS +_NODISCARD inline bool _System_error_equal(const error_code&, const error_condition&) noexcept; +#endif // _STL_OPTIMIZE_SYSTEM_ERROR_OPERATORS + +_EXPORT_STD class error_code { // store an implementation-specific error code and category +public: + error_code() noexcept : _Myval(0), _Mycat(&_STD system_category()) {} // construct non-error + + error_code(int _Val, const error_category& _Cat) noexcept : _Myval(_Val), _Mycat(&_Cat) {} + + template , int> = 0> + error_code(_Enum _Errcode) noexcept : _Myval(0), _Mycat(nullptr) { + using _Ensure_adl::make_error_code; + *this = make_error_code(_Errcode); // intentional ADL + } + + void assign(int _Val, const error_category& _Cat) noexcept { + _Myval = _Val; + _Mycat = &_Cat; + } + + template , int> = 0> + error_code& operator=(_Enum _Errcode) noexcept { + using _Ensure_adl::make_error_code; + *this = make_error_code(_Errcode); // intentional ADL + return *this; + } + + void clear() noexcept { + _Myval = 0; + _Mycat = &_STD system_category(); + } + + _NODISCARD int value() const noexcept { + return _Myval; + } + + _NODISCARD const error_category& category() const noexcept { + return *_Mycat; + } + + _NODISCARD error_condition default_error_condition() const noexcept; + + _NODISCARD string message() const { + return category().message(value()); + } + + explicit operator bool() const noexcept { + return value() != 0; + } + +#if _STL_OPTIMIZE_SYSTEM_ERROR_OPERATORS + _NODISCARD friend bool operator==(const error_code& _Left, const error_code& _Right) noexcept { + return _Left.category() == _Right.category() && _Left.value() == _Right.value(); + } + + _NODISCARD friend bool operator==(const error_code& _Left, const error_condition& _Right) noexcept { + return _System_error_equal(_Left, _Right); + } + +#if _HAS_CXX20 + _NODISCARD friend strong_ordering operator<=>(const error_code& _Left, const error_code& _Right) noexcept { + if (const auto _Result = _Left.category() <=> _Right.category(); _Result != 0) { + return _Result; + } + return _Left.value() <=> _Right.value(); + } +#else // ^^^ _HAS_CXX20 / !_HAS_CXX20 vvv + _NODISCARD friend bool operator<(const error_code& _Left, const error_code& _Right) noexcept { + return _Left.category() < _Right.category() + || (_Left.category() == _Right.category() && _Left.value() < _Right.value()); + } + _NODISCARD friend bool operator==(const error_condition& _Left, const error_code& _Right) noexcept { + return _System_error_equal(_Right, _Left); + } + + _NODISCARD friend bool operator!=(const error_code& _Left, const error_code& _Right) noexcept { + return !(_Left == _Right); + } + + _NODISCARD friend bool operator!=(const error_code& _Left, const error_condition& _Right) noexcept { + return !_System_error_equal(_Left, _Right); + } + + _NODISCARD friend bool operator!=(const error_condition& _Left, const error_code& _Right) noexcept { + return !_System_error_equal(_Right, _Left); + } +#endif // ^^^ !_HAS_CXX20 ^^^ +#endif // _STL_OPTIMIZE_SYSTEM_ERROR_OPERATORS + +private: + int _Myval; // the stored error number + const error_category* _Mycat; // pointer to error category +}; + +_EXPORT_STD class error_condition { // store an abstract error code and category +public: + error_condition() noexcept : _Myval(0), _Mycat(&_STD generic_category()) {} // construct non-error + + error_condition(int _Val, const error_category& _Cat) noexcept : _Myval(_Val), _Mycat(&_Cat) {} + + template , int> = 0> + error_condition(_Enum _Errcode) noexcept : _Myval(0), _Mycat(nullptr) { + using _Ensure_adl::make_error_condition; + *this = make_error_condition(_Errcode); // intentional ADL + } + + void assign(int _Val, const error_category& _Cat) noexcept { + _Myval = _Val; + _Mycat = &_Cat; + } + + template , int> = 0> + error_condition& operator=(_Enum _Errcode) noexcept { + using _Ensure_adl::make_error_condition; + *this = make_error_condition(_Errcode); // intentional ADL + return *this; + } + + void clear() noexcept { + _Myval = 0; + _Mycat = &_STD generic_category(); + } + + _NODISCARD int value() const noexcept { + return _Myval; + } + + _NODISCARD const error_category& category() const noexcept { + return *_Mycat; + } + + _NODISCARD string message() const { + return category().message(value()); + } + + explicit operator bool() const noexcept { + return value() != 0; + } + +#if _STL_OPTIMIZE_SYSTEM_ERROR_OPERATORS + _NODISCARD friend bool operator==(const error_condition& _Left, const error_condition& _Right) noexcept { + return _Left.category() == _Right.category() && _Left.value() == _Right.value(); + } + +#if _HAS_CXX20 + _NODISCARD friend strong_ordering operator<=>( + const error_condition& _Left, const error_condition& _Right) noexcept { + if (const auto _Result = _Left.category() <=> _Right.category(); _Result != 0) { + return _Result; + } + return _Left.value() <=> _Right.value(); + } +#else // ^^^ _HAS_CXX20 / !_HAS_CXX20 vvv + _NODISCARD friend bool operator<(const error_condition& _Left, const error_condition& _Right) noexcept { + return _Left.category() < _Right.category() + || (_Left.category() == _Right.category() && _Left.value() < _Right.value()); + } + _NODISCARD friend bool operator!=(const error_condition& _Left, const error_condition& _Right) noexcept { + return !(_Left == _Right); + } +#endif // ^^^ !_HAS_CXX20 ^^^ + + // We grant friendship to the operators from error_code here to allow is_error_code_enum_v but not + // is_error_condition_enum_v enums to be compared directly with error_condition; for example: + // io_errc::stream == make_error_condition(errc::out_of_memory) + friend bool operator==(const error_code& _Left, const error_condition& _Right) noexcept; +#if !_HAS_CXX20 + friend bool operator==(const error_condition& _Left, const error_code& _Right) noexcept; + friend bool operator!=(const error_code& _Left, const error_condition& _Right) noexcept; + friend bool operator!=(const error_condition& _Left, const error_code& _Right) noexcept; +#endif // !_HAS_CXX20 +#endif // _STL_OPTIMIZE_SYSTEM_ERROR_OPERATORS + +private: + int _Myval; // the stored error number + const error_category* _Mycat; // pointer to error category +}; + +#if _STL_OPTIMIZE_SYSTEM_ERROR_OPERATORS +_NODISCARD inline bool _System_error_equal(const error_code& _Left, const error_condition& _Right) noexcept { + return _Left.category().equivalent(_Left.value(), _Right) || _Right.category().equivalent(_Left, _Right.value()); +} +#else // ^^^ _STL_OPTIMIZE_SYSTEM_ERROR_OPERATORS / !_STL_OPTIMIZE_SYSTEM_ERROR_OPERATORS vvv +_EXPORT_STD _NODISCARD inline bool operator==(const error_code& _Left, const error_code& _Right) noexcept { + return _Left.category() == _Right.category() && _Left.value() == _Right.value(); +} + +_EXPORT_STD _NODISCARD inline bool operator==(const error_code& _Left, const error_condition& _Right) noexcept { + return _Left.category().equivalent(_Left.value(), _Right) || _Right.category().equivalent(_Left, _Right.value()); +} + +_EXPORT_STD _NODISCARD inline bool operator==(const error_condition& _Left, const error_condition& _Right) noexcept { + return _Left.category() == _Right.category() && _Left.value() == _Right.value(); +} + +#if _HAS_CXX20 +_EXPORT_STD _NODISCARD inline strong_ordering operator<=>(const error_code& _Left, const error_code& _Right) noexcept { + if (const auto _Result = _Left.category() <=> _Right.category(); _Result != 0) { + return _Result; + } + return _Left.value() <=> _Right.value(); +} + +_EXPORT_STD _NODISCARD inline strong_ordering operator<=>( + const error_condition& _Left, const error_condition& _Right) noexcept { + if (const auto _Result = _Left.category() <=> _Right.category(); _Result != 0) { + return _Result; + } + return _Left.value() <=> _Right.value(); +} +#else // ^^^ _HAS_CXX20 / !_HAS_CXX20 vvv +_NODISCARD inline bool operator<(const error_code& _Left, const error_code& _Right) noexcept { + return _Left.category() < _Right.category() + || (_Left.category() == _Right.category() && _Left.value() < _Right.value()); +} + +_NODISCARD inline bool operator<(const error_condition& _Left, const error_condition& _Right) noexcept { + return _Left.category() < _Right.category() + || (_Left.category() == _Right.category() && _Left.value() < _Right.value()); +} + +_NODISCARD inline bool operator==(const error_condition& _Left, const error_code& _Right) noexcept { + return _Right.category().equivalent(_Right.value(), _Left) || _Left.category().equivalent(_Right, _Left.value()); +} + +_NODISCARD inline bool operator!=(const error_code& _Left, const error_code& _Right) noexcept { + return !(_Left == _Right); +} + +_NODISCARD inline bool operator!=(const error_code& _Left, const error_condition& _Right) noexcept { + return !(_Left == _Right); +} + +_NODISCARD inline bool operator!=(const error_condition& _Left, const error_code& _Right) noexcept { + return !(_Left == _Right); +} + +_NODISCARD inline bool operator!=(const error_condition& _Left, const error_condition& _Right) noexcept { + return !(_Left == _Right); +} +#endif // ^^^ !_HAS_CXX20 ^^^ +#endif // ^^^ !_STL_OPTIMIZE_SYSTEM_ERROR_OPERATORS ^^^ + +_NODISCARD inline error_condition error_category::default_error_condition(int _Errval) const noexcept { + // make error_condition for error code + return error_condition(_Errval, *this); +} + +_NODISCARD inline bool error_category::equivalent(int _Errval, const error_condition& _Cond) const noexcept { + return default_error_condition(_Errval) == _Cond; +} + +_NODISCARD inline bool error_category::equivalent(const error_code& _Code, int _Errval) const noexcept { + return *this == _Code.category() && _Code.value() == _Errval; +} + +_NODISCARD inline error_condition error_code::default_error_condition() const noexcept { + // make error_condition for error code + return category().default_error_condition(value()); +} + +_EXPORT_STD _NODISCARD inline error_code make_error_code(errc _Ec) noexcept { + return error_code(static_cast(_Ec), _STD generic_category()); +} + +_EXPORT_STD _NODISCARD inline error_code make_error_code(io_errc _Ec) noexcept { + return error_code(static_cast(_Ec), _STD iostream_category()); +} + +_EXPORT_STD _NODISCARD inline error_condition make_error_condition(errc _Ec) noexcept { + return error_condition(static_cast(_Ec), _STD generic_category()); +} + +_EXPORT_STD _NODISCARD inline error_condition make_error_condition(io_errc _Ec) noexcept { + return error_condition(static_cast(_Ec), _STD iostream_category()); +} + +template <> +struct hash { + using _ARGUMENT_TYPE_NAME _CXX17_DEPRECATE_ADAPTOR_TYPEDEFS = error_code; + using _RESULT_TYPE_NAME _CXX17_DEPRECATE_ADAPTOR_TYPEDEFS = size_t; + + _NODISCARD _STATIC_CALL_OPERATOR size_t operator()(const error_code& _Keyval) _CONST_CALL_OPERATOR noexcept { + return hash{}(_Keyval.value()); + } +}; + +template <> +struct hash { + using _ARGUMENT_TYPE_NAME _CXX17_DEPRECATE_ADAPTOR_TYPEDEFS = error_condition; + using _RESULT_TYPE_NAME _CXX17_DEPRECATE_ADAPTOR_TYPEDEFS = size_t; + + _NODISCARD _STATIC_CALL_OPERATOR size_t operator()(const error_condition& _Keyval) _CONST_CALL_OPERATOR noexcept { + return hash{}(_Keyval.value()); + } +}; + +class _System_error : public runtime_error { // base of all system-error exceptions +private: + static string _Makestr(error_code _Errcode, string _Message) { // compose error message + if (!_Message.empty()) { + _Message.append(": "); + } + + _Message.append(_Errcode.message()); + return _Message; + } + +protected: + _System_error(error_code _Errcode) : runtime_error(_Errcode.message()), _Mycode(_Errcode) {} + + _System_error(error_code _Errcode, const string& _Message) + : runtime_error(_Makestr(_Errcode, _Message)), _Mycode(_Errcode) {} + + error_code _Mycode; // the stored error code +}; + +_EXPORT_STD class system_error : public _System_error { // base of all system-error exceptions +private: + using _Mybase = _System_error; + +public: + system_error(error_code _Errcode) : _Mybase(_Errcode) {} + + system_error(error_code _Errcode, const string& _Message) : _Mybase(_Errcode, _Message) {} + + system_error(error_code _Errcode, const char* _Message) : _Mybase(_Errcode, _Message) {} + + system_error(int _Errval, const error_category& _Errcat) : _Mybase(error_code(_Errval, _Errcat)) {} + + system_error(int _Errval, const error_category& _Errcat, const string& _Message) + : _Mybase(error_code(_Errval, _Errcat), _Message) {} + + system_error(int _Errval, const error_category& _Errcat, const char* _Message) + : _Mybase(error_code(_Errval, _Errcat), _Message) {} + + _NODISCARD const error_code& code() const noexcept { + return _Mycode; + } + +#if !_HAS_EXCEPTIONS +protected: + void _Doraise() const override { // perform class-specific exception handling + _RAISE(*this); + } +#endif // !_HAS_EXCEPTIONS +}; + +[[noreturn]] inline void _Throw_system_error(const errc _Ec) { + _THROW(system_error{_STD make_error_code(_Ec)}); +} + +extern "C++" _CRTIMP2_PURE const char* __CLRCALL_PURE_OR_CDECL _Syserror_map(int); +extern "C++" _CRTIMP2_PURE int __CLRCALL_PURE_OR_CDECL _Winerror_map(int); + +struct _System_error_message { + char* _Str; + size_t _Length; + + explicit _System_error_message(const unsigned long _Ec) noexcept + : _Str(nullptr), _Length(_CSTD __std_system_error_allocate_message(_Ec, &_Str)) {} + + _System_error_message(const _System_error_message&) = delete; + _System_error_message& operator=(const _System_error_message&) = delete; + + ~_System_error_message() { + _CSTD __std_system_error_deallocate_message(_Str); + } +}; + +class _Generic_error_category : public error_category { // categorize a generic error +public: + constexpr _Generic_error_category() noexcept : error_category(_Generic_addr) {} + + _NODISCARD const char* name() const noexcept override { + return "generic"; + } + + _NODISCARD string message(int _Errcode) const override { + return _Syserror_map(_Errcode); + } +}; + +class _Iostream_error_category2 : public error_category { // categorize an iostream error +public: + constexpr _Iostream_error_category2() noexcept : error_category(_Iostream_addr) {} + + _NODISCARD const char* name() const noexcept override { + return "iostream"; + } + + _NODISCARD string message(int _Errcode) const override { + if (_Errcode == static_cast(io_errc::stream)) { + static constexpr char _Iostream_error[] = "iostream stream error"; + constexpr size_t _Iostream_error_length = sizeof(_Iostream_error) - 1; // TRANSITION, DevCom-906503 + return string{_Iostream_error, _Iostream_error_length}; + } else { + return _Syserror_map(_Errcode); + } + } +}; + +class _System_error_category : public error_category { // categorize an operating system error +public: + constexpr _System_error_category() noexcept : error_category(_System_addr) {} + + _NODISCARD const char* name() const noexcept override { + return "system"; + } + + _NODISCARD string message(int _Errcode) const override { + const _System_error_message _Msg(static_cast(_Errcode)); + + if (_Msg._Str && _Msg._Length != 0) { + // CodeQL [SM02310] _Msg's ctor inits _Str(nullptr) before doing work, then we test _Msg._Str above. + return string{_Msg._Str, _Msg._Length}; + } else { + static constexpr char _Unknown_error[] = "unknown error"; + constexpr size_t _Unknown_error_length = sizeof(_Unknown_error) - 1; // TRANSITION, DevCom-906503 + return string{_Unknown_error, _Unknown_error_length}; + } + } + + _NODISCARD error_condition default_error_condition(int _Errval) const noexcept override { + if (_Errval == 0) { + return error_condition(0, _STD generic_category()); + } + + // make error_condition for error code (generic if possible) + const int _Posv = _Winerror_map(_Errval); + if (_Posv == 0) { + return error_condition(_Errval, _STD system_category()); + } else { + return error_condition(_Posv, _STD generic_category()); + } + } +}; + +// _Immortalize_memcpy_image is used to provide a nonstandard guarantee. +// Specifically, we want the error category objects returned from things like std::system_category() to always +// be available, even during DLL unload (otherwise, would be a huge regression vs. legacy error codes). +// Moreover, we need to be very conservative in the runtime support we request. Thus, we have these constraints: +// +// * can't use magic statics in standard modes, because that would inject a .TLS section into all binaries using +// and would likely put borderline programs over the TLS slot count limit, and would destroy the +// variable during DLL unload +// * can't declare the error_category as an ordinary constexpr variable for most compilers before C++20, because +// error_category has a virtual destructor +// * can't declare the error_category as an ordinary non-constexpr variable even with a constexpr constructor, because +// the compiler will emit code to destroy it which invalidates its use in these DLL shutdown scenarios +// +// As a result, we use a workaround: We create an atomic array to store the error_category instance, test +// if the first atomic is nonzero (acquire), and if so, we know we have formed the instance and can return a +// reinterpreted pointer to that storage. If the first atomic is zero, we write all except the first atomic (relaxed), +// then write the first one as a store-release. (The non-first values are transferred to other threads in the +// release sequence). +// +// Acknowledged undefined and implementation-defined behavior happening here: +// * There is a data race when filling in the values other than the first atomic; this is OK on all hardware we target +// because the racing threads are all writing identical values that never change afterwards. +// * We are reaching into the layout of atomic[N] and assuming we can reinterpret that as some other type. +// * We are assuming that virtual functions are implemented with a vfptr located as the first member of an object. +// (there are probably others) +// +// Inspecting the resulting assembly of any callers of _Immortalize_memcpy_image is recommended. +// + +#if defined(_M_CEE_PURE) +// /clr:pure doesn't ever do constant initialization, so rely on the CLR and magic statics +template +_NODISCARD const _Ty& _Immortalize_memcpy_image() noexcept { + /* MAGIC */ static _Immortalizer_impl<_Ty> _Static; + return _Static._Storage; +} +#elif _HAS_CXX20 +template +_NODISCARD const _Ty& _Immortalize_memcpy_image() noexcept { + static constexpr _Ty _Static; + return _Static; +} +#elif defined(__clang__) +template +_NODISCARD const _Ty& _Immortalize_memcpy_image() noexcept { + [[_Clang::__require_constant_initialization__]] static _Ty _Static; + return _Static; +} +#elif !defined(_M_CEE) +template +struct _Constexpr_immortalize_impl { + union { + _Ty _Storage; + }; + + constexpr _Constexpr_immortalize_impl() noexcept : _Storage{} {} + + _Constexpr_immortalize_impl(const _Constexpr_immortalize_impl&) = delete; + _Constexpr_immortalize_impl& operator=(const _Constexpr_immortalize_impl&) = delete; + + _MSVC_NOOP_DTOR ~_Constexpr_immortalize_impl() { + // do nothing, allowing _Ty to be used during shutdown + } +}; + +template +_NODISCARD const _Ty& _Immortalize_memcpy_image() noexcept { + static _Constexpr_immortalize_impl<_Ty> _Static; + return _Static._Storage; +} +#else // ^^^ !defined(_M_CEE) / defined(_M_CEE), TRANSITION, VSO-1153256 vvv +template +_NODISCARD const _Ty& _Immortalize_memcpy_image() noexcept { + // return reference to a memcpy'd default-initialized _Ty + // pre: A default-initialized _Ty sets the first pointer-sized field to nonzero + constexpr size_t _Pointer_count = sizeof(_Ty) / sizeof(uintptr_t); + static atomic _Storage[_Pointer_count]; + static_assert(sizeof(_Storage) == sizeof(_Ty), "Bad storage size"); + static_assert(alignof(decltype(_Storage)) >= alignof(_Ty), "Bad alignment assumptions"); + if (_Storage[0].load(memory_order_acquire) != 0) { + return reinterpret_cast<_Ty&>(_Storage); + } + + const _Ty _Target; + const auto _Target_iter = reinterpret_cast(_STD addressof(_Target)); + _CSTD memcpy(_Storage + 1, _Target_iter + 1, sizeof(_Ty) - sizeof(uintptr_t)); + _Storage[0].store(_Target_iter[0], memory_order_release); + return reinterpret_cast<_Ty&>(_Storage); +} +#endif // ^^^ defined(_M_CEE), TRANSITION, VSO-1153256 ^^^ + +_EXPORT_STD _NODISCARD inline const error_category& generic_category() noexcept { + return _Immortalize_memcpy_image<_Generic_error_category>(); +} + +_EXPORT_STD _NODISCARD inline const error_category& iostream_category() noexcept { + return _Immortalize_memcpy_image<_Iostream_error_category2>(); +} + +_EXPORT_STD _NODISCARD inline const error_category& system_category() noexcept { + return _Immortalize_memcpy_image<_System_error_category>(); +} +_STD_END + +#if _HAS_CXX17 +extern "C" { +enum class __std_win_error : unsigned long; +} // extern "C" + +_STD_BEGIN +// We would really love to use the proper way of building error_code by specializing +// is_error_code_enum and make_error_code for __std_win_error, but because: +// 1. We would like to keep the definition of __std_win_error in xfilesystem_abi.h +// 2. and xfilesystem_abi.h cannot include +// 3. and specialization of is_error_code_enum and overload of make_error_code +// need to be kept together with the enum (see limerick in N4950 [temp.expl.spec]/8) +// we resort to using this _Make_ec helper. +_NODISCARD inline error_code _Make_ec(__std_win_error _Errno) noexcept { // make an error_code + return {static_cast(_Errno), _STD system_category()}; +} + +[[noreturn]] inline void _Throw_system_error_from_std_win_error(const __std_win_error _Errno) { + _THROW(system_error{_Make_ec(_Errno)}); +} +_STD_END +#endif // _HAS_CXX17 + +// TRANSITION, non-_Ugly attribute tokens +#pragma pop_macro("noop_dtor") +#pragma pop_macro("msvc") + +#pragma pop_macro("new") +_STL_RESTORE_CLANG_WARNINGS +#pragma warning(pop) +#pragma pack(pop) +#endif // _STL_COMPILER_PREPROCESSOR +#endif // _SYSTEM_ERROR_ diff --git a/miniMSVC/VC/Tools/MSVC/14.42.34433/include/thread b/miniMSVC/VC/Tools/MSVC/14.42.34433/include/thread new file mode 100644 index 0000000000000000000000000000000000000000..079f4b7af3638749b4bffbda632a4282799dce0a --- /dev/null +++ b/miniMSVC/VC/Tools/MSVC/14.42.34433/include/thread @@ -0,0 +1,446 @@ +// thread standard header + +// Copyright (c) Microsoft Corporation. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +#ifndef _THREAD_ +#define _THREAD_ +#include +#if _STL_COMPILER_PREPROCESSOR + +#ifdef _M_CEE_PURE +#error is not supported when compiling with /clr:pure. +#endif // defined(_M_CEE_PURE) + +#include <__msvc_chrono.hpp> +#include +#include +#include +#include + +#if _HAS_CXX20 +#include +#include +#endif // _HAS_CXX20 + +#if _HAS_CXX23 +#include +#endif // _HAS_CXX23 + +#pragma pack(push, _CRT_PACKING) +#pragma warning(push, _STL_WARNING_LEVEL) +#pragma warning(disable : _STL_DISABLED_WARNINGS) +_STL_DISABLE_CLANG_WARNINGS +#pragma push_macro("new") +#undef new + +_STD_BEGIN +#if _HAS_CXX20 +_EXPORT_STD class jthread; +#endif // _HAS_CXX20 + +_EXPORT_STD class thread { // class for observing and managing threads +public: + class id; + + using native_handle_type = void*; + + thread() noexcept : _Thr{} {} + +private: +#if _HAS_CXX20 + friend jthread; +#endif // _HAS_CXX20 + + template + static unsigned int __stdcall _Invoke(void* _RawVals) noexcept /* terminates */ { + // adapt invoke of user's callable object to _beginthreadex's thread procedure + const unique_ptr<_Tuple> _FnVals(static_cast<_Tuple*>(_RawVals)); + _Tuple& _Tup = *_FnVals.get(); // avoid ADL, handle incomplete types + _STD invoke(_STD move(_STD get<_Indices>(_Tup))...); + _Cnd_do_broadcast_at_thread_exit(); // TRANSITION, ABI + return 0; + } + + template + _NODISCARD static constexpr auto _Get_invoke(index_sequence<_Indices...>) noexcept { + return &_Invoke<_Tuple, _Indices...>; + } + +#pragma warning(push) // pointer or reference to potentially throwing function passed to 'extern "C"' function under +#pragma warning(disable : 5039) // -EHc. Undefined behavior may occur if this function throws an exception. (/Wall) + template + void _Start(_Fn&& _Fx, _Args&&... _Ax) { + using _Tuple = tuple, decay_t<_Args>...>; + auto _Decay_copied = _STD make_unique<_Tuple>(_STD forward<_Fn>(_Fx), _STD forward<_Args>(_Ax)...); + constexpr auto _Invoker_proc = _Get_invoke<_Tuple>(make_index_sequence<1 + sizeof...(_Args)>{}); + + _Thr._Hnd = + reinterpret_cast(_CSTD _beginthreadex(nullptr, 0, _Invoker_proc, _Decay_copied.get(), 0, &_Thr._Id)); + + if (_Thr._Hnd) { // ownership transferred to the thread + (void) _Decay_copied.release(); + } else { // failed to start thread + _Thr._Id = 0; + _Throw_Cpp_error(_RESOURCE_UNAVAILABLE_TRY_AGAIN); + } + } +#pragma warning(pop) + +public: + template , thread>, int> = 0> + _NODISCARD_CTOR_THREAD explicit thread(_Fn&& _Fx, _Args&&... _Ax) { + _Start(_STD forward<_Fn>(_Fx), _STD forward<_Args>(_Ax)...); + } + + ~thread() noexcept { + if (joinable()) { + _STD terminate(); // per N4950 [thread.thread.destr]/1 + } + } + + thread(thread&& _Other) noexcept : _Thr(_STD exchange(_Other._Thr, {})) {} + + thread& operator=(thread&& _Other) noexcept { + if (joinable()) { + _STD terminate(); // per N4950 [thread.thread.assign]/1 + } + + _Thr = _STD exchange(_Other._Thr, {}); + return *this; + } + + thread(const thread&) = delete; + thread& operator=(const thread&) = delete; + + void swap(thread& _Other) noexcept { + _STD swap(_Thr, _Other._Thr); + } + + _NODISCARD bool joinable() const noexcept { + return _Thr._Id != 0; + } + + void join() { + if (!joinable()) { + _Throw_Cpp_error(_INVALID_ARGUMENT); + } + + if (_Thr._Id == _Thrd_id()) { + _Throw_Cpp_error(_RESOURCE_DEADLOCK_WOULD_OCCUR); + } + + if (_Thrd_join(_Thr, nullptr) != _Thrd_result::_Success) { + _Throw_Cpp_error(_NO_SUCH_PROCESS); + } + + _Thr = {}; + } + + void detach() { + if (!joinable()) { + _Throw_Cpp_error(_INVALID_ARGUMENT); + } + + if (_Thrd_detach(_Thr) != _Thrd_result::_Success) { + _Throw_Cpp_error(_INVALID_ARGUMENT); + } + + _Thr = {}; + } + + _NODISCARD id get_id() const noexcept; + + _NODISCARD native_handle_type native_handle() noexcept /* strengthened */ { // return Win32 HANDLE as void * + return _Thr._Hnd; + } + + _NODISCARD static unsigned int hardware_concurrency() noexcept { + return _Thrd_hardware_concurrency(); + } + +private: + _Thrd_t _Thr; +}; + +template +_NODISCARD auto _To_absolute_time(const chrono::duration<_Rep, _Period>& _Rel_time) noexcept { + constexpr auto _Zero = chrono::duration<_Rep, _Period>::zero(); + const auto _Now = chrono::steady_clock::now(); + decltype(_Now + _Rel_time) _Abs_time = _Now; // return common type + if (_Rel_time > _Zero) { + constexpr auto _Forever = (chrono::steady_clock::time_point::max)(); + if (_Abs_time < _Forever - _Rel_time) { + _Abs_time += _Rel_time; + } else { + _Abs_time = _Forever; + } + } + return _Abs_time; +} + +struct _Clamped_rel_time_ms_count_result { + unsigned long _Count; + bool _Clamped; +}; + +template +_NODISCARD _Clamped_rel_time_ms_count_result _Clamped_rel_time_ms_count(const _Duration& _Rel) { + // _Clamp must be less than 2^32 - 1 (INFINITE) milliseconds, but is otherwise arbitrary. + constexpr chrono::milliseconds _Clamp{chrono::hours{24}}; + + if (_Rel > _Clamp) { + return {static_cast(_Clamp.count()), true}; + } else { + const auto _Rel_ms = chrono::ceil(_Rel); + return {static_cast(_Rel_ms.count()), false}; + } +} + +namespace this_thread { + _EXPORT_STD _NODISCARD thread::id get_id() noexcept; + + _EXPORT_STD inline void yield() noexcept { + _Thrd_yield(); + } + + _EXPORT_STD template + void sleep_until(const chrono::time_point<_Clock, _Duration>& _Abs_time) { + static_assert(chrono::_Is_clock_v<_Clock>, "Clock type required"); + for (;;) { + const auto _Now = _Clock::now(); + if (_Abs_time <= _Now) { + return; + } + + const unsigned long _Rel_ms_count = _Clamped_rel_time_ms_count(_Abs_time - _Now)._Count; + _Thrd_sleep_for(_Rel_ms_count); + } + } + + _EXPORT_STD template + void sleep_for(const chrono::duration<_Rep, _Period>& _Rel_time) { + sleep_until(_To_absolute_time(_Rel_time)); + } +} // namespace this_thread + +class thread::id { // thread id +public: + id() noexcept = default; // id for no thread + +#if _HAS_CXX23 + _NODISCARD _Thrd_id_t _Get_underlying_id() const noexcept { + return _Id; + } +#endif // _HAS_CXX23 + +private: + explicit id(_Thrd_id_t _Other_id) noexcept : _Id(_Other_id) {} + + _Thrd_id_t _Id = 0; + + friend thread::id thread::get_id() const noexcept; + friend thread::id this_thread::get_id() noexcept; + friend bool operator==(thread::id _Left, thread::id _Right) noexcept; +#if _HAS_CXX20 + friend strong_ordering operator<=>(thread::id _Left, thread::id _Right) noexcept; +#else // ^^^ _HAS_CXX20 / !_HAS_CXX20 vvv + friend bool operator<(thread::id _Left, thread::id _Right) noexcept; +#endif // ^^^ !_HAS_CXX20 ^^^ + template + friend basic_ostream<_Ch, _Tr>& operator<<(basic_ostream<_Ch, _Tr>& _Str, thread::id _Id); + friend hash; +}; + +_NODISCARD inline thread::id thread::get_id() const noexcept { + return thread::id{_Thr._Id}; +} + +_EXPORT_STD _NODISCARD inline thread::id this_thread::get_id() noexcept { + return thread::id{_Thrd_id()}; +} + +_EXPORT_STD inline void swap(thread& _Left, thread& _Right) noexcept { + _Left.swap(_Right); +} + +_EXPORT_STD _NODISCARD inline bool operator==(thread::id _Left, thread::id _Right) noexcept { + return _Left._Id == _Right._Id; +} + +#if _HAS_CXX20 +_EXPORT_STD _NODISCARD inline strong_ordering operator<=>(thread::id _Left, thread::id _Right) noexcept { + return _Left._Id <=> _Right._Id; +} +#else // ^^^ _HAS_CXX20 / !_HAS_CXX20 vvv +_NODISCARD inline bool operator!=(thread::id _Left, thread::id _Right) noexcept { + return !(_Left == _Right); +} + +_NODISCARD inline bool operator<(thread::id _Left, thread::id _Right) noexcept { + return _Left._Id < _Right._Id; +} + +_NODISCARD inline bool operator<=(thread::id _Left, thread::id _Right) noexcept { + return !(_Right < _Left); +} + +_NODISCARD inline bool operator>(thread::id _Left, thread::id _Right) noexcept { + return _Right < _Left; +} + +_NODISCARD inline bool operator>=(thread::id _Left, thread::id _Right) noexcept { + return !(_Left < _Right); +} +#endif // ^^^ !_HAS_CXX20 ^^^ + +_EXPORT_STD template +basic_ostream<_Ch, _Tr>& operator<<(basic_ostream<_Ch, _Tr>& _Str, thread::id _Id) { + _STL_INTERNAL_STATIC_ASSERT(sizeof(_Thrd_id_t) == 4); + _Ch _Buff[11]; // can hold 2^32 - 1, plus terminating null + _Ch* _RNext = _STD end(_Buff); + *--_RNext = static_cast<_Ch>('\0'); + _RNext = _STD _UIntegral_to_buff(_RNext, _Id._Id); + return _Str << _RNext; +} + +#if _HAS_CXX23 +// Per LWG-3997, `_CharT` in library-provided `formatter` specializations is +// constrained to character types supported by `format`. +template <_Format_supported_charT _CharT> +struct formatter { +private: + using _Pc = basic_format_parse_context<_CharT>; + +public: + constexpr _Pc::iterator parse(_Pc& _Parse_ctx) { + return _Impl._Parse(_Parse_ctx); + } + + template + _FormatContext::iterator format(thread::id _Val, _FormatContext& _Format_ctx) const { + _STL_INTERNAL_STATIC_ASSERT(sizeof(_Thrd_id_t) == 4); + _CharT _Buff[10]; // can hold 2^32 - 1 + _CharT* const _Last = _STD end(_Buff); + const _CharT* const _First = _STD _UIntegral_to_buff(_Last, _Val._Get_underlying_id()); + return _Impl._Format(_Format_ctx, static_cast(_Last - _First), _Fmt_align::_Right, + [&](_FormatContext::iterator _Out) { return _RANGES copy(_First, _Last, _STD move(_Out)).out; }); + } + +private: + _Fill_align_and_width_formatter<_CharT> _Impl; +}; +#endif // _HAS_CXX23 + +template <> +struct hash { + using _ARGUMENT_TYPE_NAME _CXX17_DEPRECATE_ADAPTOR_TYPEDEFS = thread::id; + using _RESULT_TYPE_NAME _CXX17_DEPRECATE_ADAPTOR_TYPEDEFS = size_t; + + _NODISCARD _STATIC_CALL_OPERATOR size_t operator()(const thread::id _Keyval) _CONST_CALL_OPERATOR noexcept { + return _Hash_representation(_Keyval._Id); + } +}; + +#if _HAS_CXX20 +_EXPORT_STD class jthread { +public: + using id = thread::id; + using native_handle_type = thread::native_handle_type; + + jthread() noexcept : _Impl{}, _Ssource{nostopstate} {} + + template + requires (!is_same_v, jthread>) + _NODISCARD_CTOR_JTHREAD explicit jthread(_Fn&& _Fx, _Args&&... _Ax) { + if constexpr (is_invocable_v, stop_token, decay_t<_Args>...>) { + _Impl._Start(_STD forward<_Fn>(_Fx), _Ssource.get_token(), _STD forward<_Args>(_Ax)...); + } else { + _Impl._Start(_STD forward<_Fn>(_Fx), _STD forward<_Args>(_Ax)...); + } + } + + ~jthread() { + _Try_cancel_and_join(); + } + + jthread(const jthread&) = delete; + jthread(jthread&&) noexcept = default; + jthread& operator=(const jthread&) = delete; + + jthread& operator=(jthread&& _Other) noexcept { + if (this == _STD addressof(_Other)) { + return *this; + } + + _Try_cancel_and_join(); + _Impl = _STD move(_Other._Impl); + _Ssource = _STD move(_Other._Ssource); + return *this; + } + + void swap(jthread& _Other) noexcept { + _Impl.swap(_Other._Impl); + _Ssource.swap(_Other._Ssource); + } + + _NODISCARD bool joinable() const noexcept { + return _Impl.joinable(); + } + + void join() { + _Impl.join(); + } + + void detach() { + _Impl.detach(); + } + + _NODISCARD id get_id() const noexcept { + return _Impl.get_id(); + } + + _NODISCARD native_handle_type native_handle() noexcept /* strengthened */ { + return _Impl.native_handle(); + } + + _NODISCARD stop_source get_stop_source() noexcept { + return _Ssource; + } + + _NODISCARD stop_token get_stop_token() const noexcept { + return _Ssource.get_token(); + } + + bool request_stop() noexcept { + return _Ssource.request_stop(); + } + + friend void swap(jthread& _Lhs, jthread& _Rhs) noexcept { + _Lhs.swap(_Rhs); + } + + _NODISCARD static unsigned int hardware_concurrency() noexcept { + return thread::hardware_concurrency(); + } + +private: + void _Try_cancel_and_join() noexcept { + if (_Impl.joinable()) { + _Ssource.request_stop(); + _Impl.join(); + } + } + + thread _Impl; + stop_source _Ssource; +}; +#endif // _HAS_CXX20 +_STD_END + +#pragma pop_macro("new") +_STL_RESTORE_CLANG_WARNINGS +#pragma warning(pop) +#pragma pack(pop) +#endif // _STL_COMPILER_PREPROCESSOR +#endif // _THREAD_ diff --git a/miniMSVC/VC/Tools/MSVC/14.42.34433/include/threads.h b/miniMSVC/VC/Tools/MSVC/14.42.34433/include/threads.h new file mode 100644 index 0000000000000000000000000000000000000000..ce426dc8c9a5cc7064a4f39484a89cdf259ba7be --- /dev/null +++ b/miniMSVC/VC/Tools/MSVC/14.42.34433/include/threads.h @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. + +#pragma once +#define _THREADS_H + +#include +#include +#include +#include + +#pragma warning(push) +#pragma warning(disable : _UCRT_DISABLED_WARNINGS) +_UCRT_DISABLE_CLANG_WARNINGS +_CRT_BEGIN_C_HEADER + +#ifndef __cplusplus +#define thread_local _Thread_local +#endif + +enum { + mtx_plain = 0, + mtx_recursive = 1 << 0, + mtx_timed = 1 << 1, +}; + +typedef struct { + uintptr_t _Type; + void* _Ptr; + void* _Cv; + uint32_t _Owner; + uint32_t _Cnt; +} mtx_t; + +void __cdecl mtx_destroy(mtx_t* _Mtx); +int __cdecl mtx_init(_Out_ mtx_t* _Mtx, int _Type); +_Acquires_lock_(*_Mtx) int __cdecl mtx_lock(mtx_t* _Mtx); + +int __cdecl _mtx_timedlock32( + mtx_t* __restrict _Mtx, const struct _timespec32* __restrict _Ts); +int __cdecl _mtx_timedlock64( + mtx_t* __restrict _Mtx, const struct _timespec64* __restrict _Ts); + +#ifndef _CRT_NO_TIME_T +#ifdef _USE_32BIT_TIME_T +static inline int __cdecl mtx_timedlock(mtx_t* __restrict _Mtx, const struct timespec* __restrict _Ts) { + return _mtx_timedlock32(_Mtx, (struct _timespec32*) _Ts); +} +#else // ^^^ _CRT_32BIT_TIME_T / vvv 64-bit +static inline int __cdecl mtx_timedlock(mtx_t* __restrict _Mtx, const struct timespec* __restrict _Ts) { + return _mtx_timedlock64(_Mtx, (struct _timespec64*) _Ts); +} +#endif // _CRT_32BIT_TIME_T +#endif // _CRT_NO_TIME_T + +int __cdecl mtx_trylock(mtx_t* _Mtx); + +_Releases_lock_(*_Mtx) int __cdecl mtx_unlock(mtx_t* _Mtx); + +typedef struct { + void* _Ptr; +} cnd_t; + +int __cdecl cnd_broadcast(cnd_t* _Cond); +void __cdecl cnd_destroy(cnd_t* _Cond); +int __cdecl cnd_init(_Out_ cnd_t* _Cond); +int __cdecl cnd_signal(cnd_t* _Cond); +int __cdecl _cnd_timedwait32(cnd_t* _Cond, mtx_t* _Mtx, const struct _timespec32* _Ts); +int __cdecl _cnd_timedwait64(cnd_t* _Cond, mtx_t* _Mtx, const struct _timespec64* _Ts); + +#ifndef _CRT_NO_TIME_T +#ifdef _USE_32BIT_TIME_T +static inline int __cdecl cnd_timedwait(cnd_t* _Cond, mtx_t* _Mtx, const struct timespec* _Ts) { + return _cnd_timedwait32(_Cond, _Mtx, (struct _timespec32*) _Ts); +} +#else +static inline int __cdecl cnd_timedwait(cnd_t* _Cond, mtx_t* _Mtx, const struct timespec* _Ts) { + return _cnd_timedwait64(_Cond, _Mtx, (struct _timespec64*) _Ts); +} +#endif +#endif // _CRT_NO_TIME_T +int cnd_wait(cnd_t* _Cond, mtx_t* _Mtx); + + +typedef struct { + void* _Handle; + uint32_t _Tid; +} thrd_t; + +enum { thrd_success, thrd_nomem, thrd_timedout, thrd_busy, thrd_error }; + +typedef int(__cdecl* thrd_start_t)(void*); + +_Success_(return == thrd_success) int __cdecl thrd_create(_Out_ thrd_t* _Thr, thrd_start_t _Func, void* _Arg); +thrd_t __cdecl thrd_current(void); +int __cdecl thrd_detach(thrd_t _Thr); +int __cdecl thrd_equal(thrd_t _Thr0, thrd_t _Thr1); + +#ifdef __cplusplus // TRANSITION, [[_Noreturn]] +[[noreturn]] void __cdecl thrd_exit(int _Res); +#else +_Noreturn void __cdecl thrd_exit(int _Res); +#endif + +int __cdecl thrd_join(thrd_t _Thr, int* _Res); +int __cdecl _thrd_sleep32( + const struct _timespec32* duration, struct _timespec32* remaining); +int __cdecl _thrd_sleep64( + const struct _timespec64* duration, struct _timespec64* remaining); + +#ifndef _CRT_NO_TIME_T +#ifdef _USE_32BIT_TIME_T +static inline int __cdecl thrd_sleep(const struct timespec* duration, struct timespec* remaining) { + return _thrd_sleep32((struct _timespec32*) duration, (struct _timespec32*) remaining); +} +#else +static inline int __cdecl thrd_sleep(const struct timespec* duration, struct timespec* remaining) { + return _thrd_sleep64((struct _timespec64*) duration, (struct _timespec64*) remaining); +} +#endif +#endif + +void __cdecl thrd_yield(void); + +#define TSS_DTOR_ITERATIONS 1 +typedef struct { + uint32_t _Idx; +} tss_t; + +typedef void (*tss_dtor_t)(void*); + +int __cdecl tss_create(tss_t* _Key, tss_dtor_t _Dtor); +void __cdecl tss_delete(tss_t _Key); +void* __cdecl tss_get(tss_t _Key); +int __cdecl tss_set(tss_t _Key, void* _Val); + +typedef struct { + void* _Opaque; +} once_flag; + +void __cdecl call_once(once_flag* _Flag, void(*_Func)(void)); + +#define ONCE_FLAG_INIT { 0 } + +_CRT_END_C_HEADER +_UCRT_RESTORE_CLANG_WARNINGS +#pragma warning(pop) // _UCRT_DISABLED_WARNINGS diff --git a/miniMSVC/VC/Tools/MSVC/14.42.34433/include/tmmintrin.h b/miniMSVC/VC/Tools/MSVC/14.42.34433/include/tmmintrin.h new file mode 100644 index 0000000000000000000000000000000000000000..efd0c5781b4785db13f9ccb2d9ea38af8a56cd5f --- /dev/null +++ b/miniMSVC/VC/Tools/MSVC/14.42.34433/include/tmmintrin.h @@ -0,0 +1,147 @@ +/* + * Copyright (C) 1985-2015 Intel Corporation. + * + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + */ + +#pragma once + +#if !defined(_M_IX86) && !defined(_M_X64) && !(defined(_M_ARM64) && defined(USE_SOFT_INTRINSICS)) +#error This header is specific to X86, X64, ARM64, and ARM64EC targets +#endif + +#if (defined(_M_ARM64) || defined(_M_ARM64EC)) && !defined(__INTRIN_H_) +#error this header should only be included through +#endif + +#ifndef _INCLUDED_TMM +#define _INCLUDED_TMM +#ifndef __midl + +#if defined (_M_CEE_PURE) + #error ERROR: XMM intrinsics not supported in the pure mode! +#else /* defined (_M_CEE_PURE) */ + +#include + +#ifdef _MM2_FUNCTIONALITY +/* support old notation */ +#ifndef _MM_FUNCTIONALITY +#define _MM_FUNCTIONALITY +#endif /* _MM_FUNCTIONALITY */ +#endif /* _MM2_FUNCTIONALITY */ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + + // Horizontal Add: add pairs of adjacent words or double words. + // Each field in the result is the sum of two adjacent fields + // from the arguments, with the lower result fields coming from + // the first argument and the upper result fields coming from + // the second argument. The "hadds" forms saturate the signed + // addition rather than wrapping. + + extern __m128i _mm_hadd_epi16 (__m128i, __m128i); + extern __m128i _mm_hadd_epi32 (__m128i, __m128i); + extern __m128i _mm_hadds_epi16 (__m128i, __m128i); + +#if defined(_M_IX86) + extern __m64 _mm_hadd_pi16 (__m64, __m64); + extern __m64 _mm_hadd_pi32 (__m64, __m64); + extern __m64 _mm_hadds_pi16 (__m64, __m64); +#endif + + // Horizontal Subtract: subtract pairs of adjacent words or double + // words. Each field in the result is the difference of two adjacent + // fields from the arguments, where the upper field is subtracted + // from the lower field. The lower result fields come from + // the first argument and the upper result fields come from + // the second argument. The "hsubs" forms saturate the signed + // subtraction rather than wrapping. + + extern __m128i _mm_hsub_epi16 (__m128i, __m128i); + extern __m128i _mm_hsub_epi32 (__m128i, __m128i); + extern __m128i _mm_hsubs_epi16 (__m128i, __m128i); + +#if defined(_M_IX86) + extern __m64 _mm_hsub_pi16 (__m64, __m64); + extern __m64 _mm_hsub_pi32 (__m64, __m64); + extern __m64 _mm_hsubs_pi16 (__m64, __m64); +#endif + + // Multiply unsigned bytes by signed bytes and sum the word + // results in pairs with saturation. Each byte of the first + // argument is zero-extended to a word field and each byte + // of the second argument is sign-extended to a word field, + // then each pair of words is multiplied together to give + // signed word intermediate results. Pairs of words from + // that result are added horizontally with saturation + // to give the final result. + + extern __m128i _mm_maddubs_epi16 (__m128i, __m128i); + +#if defined(_M_IX86) + extern __m64 _mm_maddubs_pi16 (__m64, __m64); +#endif + + // Packed multiply high integers with round and scaling, + // {X,}MM2/m{128,64} (b) to {X,}MM1 (a). + + extern __m128i _mm_mulhrs_epi16 (__m128i, __m128i); + +#if defined(_M_IX86) + extern __m64 _mm_mulhrs_pi16 (__m64, __m64); +#endif + + // Packed shuffle bytes + // {X,}MM2/m{128,64} (b) by {X,}MM1 (a). + + extern __m128i _mm_shuffle_epi8 (__m128i, __m128i); + +#if defined(_M_IX86) + extern __m64 _mm_shuffle_pi8 (__m64, __m64); +#endif + + // Packed byte, word, double word sign, {X,}MM2/m{128,64} (b) to + // {X,}MM1 (a). + + extern __m128i _mm_sign_epi8 (__m128i, __m128i); + extern __m128i _mm_sign_epi16 (__m128i, __m128i); + extern __m128i _mm_sign_epi32 (__m128i, __m128i); + +#if defined(_M_IX86) + extern __m64 _mm_sign_pi8 (__m64, __m64); + extern __m64 _mm_sign_pi16 (__m64, __m64); + extern __m64 _mm_sign_pi32 (__m64, __m64); +#endif + + // Packed align and shift right by n*8 bits, + // {X,}MM2/m{128,64} (b) to {X,}MM1 (a). + + extern __m128i _mm_alignr_epi8 (__m128i, __m128i, int); + +#if defined(_M_IX86) + extern __m64 _mm_alignr_pi8 (__m64, __m64, int); +#endif + + // Packed byte, word, double word absolute value, + // {X,}MM2/m{128,64} (b) to {X,}MM1 (a). + + extern __m128i _mm_abs_epi8 (__m128i); + extern __m128i _mm_abs_epi16 (__m128i); + extern __m128i _mm_abs_epi32 (__m128i); + +#if defined(_M_IX86) + extern __m64 _mm_abs_pi8 (__m64); + extern __m64 _mm_abs_pi16 (__m64); + extern __m64 _mm_abs_pi32 (__m64); +#endif + +#ifdef __cplusplus +}; +#endif /* __cplusplus */ + +#endif /* defined (_M_CEE_PURE) */ +#endif /* __midl */ +#endif /* _INCLUDED_TMM */ diff --git a/miniMSVC/VC/Tools/MSVC/14.42.34433/include/tuple b/miniMSVC/VC/Tools/MSVC/14.42.34433/include/tuple new file mode 100644 index 0000000000000000000000000000000000000000..0f79be7872e8cfc8bcf7f5e9689e971d10d5571e --- /dev/null +++ b/miniMSVC/VC/Tools/MSVC/14.42.34433/include/tuple @@ -0,0 +1,1177 @@ +// tuple standard header (core) + +// Copyright (c) Microsoft Corporation. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +#ifndef _TUPLE_ +#define _TUPLE_ +#include +#if _STL_COMPILER_PREPROCESSOR +#if _HAS_CXX20 +#include +#endif // _HAS_CXX20 +#include <__msvc_iter_core.hpp> +#include + +#pragma pack(push, _CRT_PACKING) +#pragma warning(push, _STL_WARNING_LEVEL) +#pragma warning(disable : _STL_DISABLED_WARNINGS) +_STL_DISABLE_CLANG_WARNINGS +#pragma push_macro("new") +#undef new + +_STD_BEGIN +template +constexpr bool _Tuple_conditional_explicit_v0 = false; + +template +constexpr bool _Tuple_conditional_explicit_v0, _Srcs...> = + !conjunction_v...>; + +template +constexpr bool _Tuple_conditional_explicit_v = + _Tuple_conditional_explicit_v0 == sizeof...(_Srcs), _Dest, _Srcs...>; + +template +constexpr bool _Tuple_constructible_v0 = false; + +template +constexpr bool _Tuple_constructible_v0, _Srcs...> = + conjunction_v...>; + +template +constexpr bool _Tuple_constructible_v = + _Tuple_constructible_v0 == sizeof...(_Srcs), _Dest, _Srcs...>; + +template +struct _Tuple_constructible_val : bool_constant<_Tuple_constructible_v<_Dest, _Srcs...>> {}; + +template +constexpr bool _Tuple_nothrow_constructible_v0 = false; + +template +constexpr bool _Tuple_nothrow_constructible_v0, _Srcs...> = + conjunction_v...>; + +template +constexpr bool _Tuple_nothrow_constructible_v = + _Tuple_nothrow_constructible_v0 == sizeof...(_Srcs), _Dest, _Srcs...>; + +template +constexpr bool _Tuple_assignable_v0 = false; + +template +constexpr bool _Tuple_assignable_v0, _Srcs...> = + conjunction_v...>; // note _Dests& instead of _Dests + +#if _HAS_CXX23 +template +constexpr bool _Tuple_assignable_v0, _Srcs...> = + conjunction_v...>; +#endif // _HAS_CXX23 + +template +constexpr bool _Tuple_assignable_v = _Tuple_assignable_v0 == sizeof...(_Srcs), _Dest, _Srcs...>; + +template +struct _Tuple_assignable_val : bool_constant<_Tuple_assignable_v<_Dest, _Srcs...>> {}; + +template +constexpr bool _Tuple_nothrow_assignable_v0 = false; + +template +constexpr bool _Tuple_nothrow_assignable_v0, _Srcs...> = + conjunction_v...>; // note _Dests& instead of _Dests + +#if _HAS_CXX23 +template +constexpr bool _Tuple_nothrow_assignable_v0, _Srcs...> = + conjunction_v...>; +#endif // _HAS_CXX23 + +template +constexpr bool _Tuple_nothrow_assignable_v = + _Tuple_nothrow_assignable_v0 == sizeof...(_Srcs), _Dest, _Srcs...>; + +// Constrain tuple's converting constructors +template +struct _Tuple_convert_val : true_type {}; + +template +struct _Tuple_convert_val, _OtherTuple, _Uty> + : bool_constant, is_constructible<_This, _OtherTuple>, + is_convertible<_OtherTuple, _This>>> {}; + +// Constrain tuple's perfect forwarding constructor (LWG-3121) +template +struct _Tuple_perfect_val : true_type {}; + +template +struct _Tuple_perfect_val<_Myself, _This2> : bool_constant>> {}; + +template +struct _Tuple_perfect_val, _Uty0, _Uty1> + : bool_constant, allocator_arg_t>>, + is_same<_Remove_cvref_t<_Ty0>, allocator_arg_t>>> {}; + +template +struct _Tuple_perfect_val, _Uty0, _Uty1, _Uty2> + : bool_constant, allocator_arg_t>>, + is_same<_Remove_cvref_t<_Ty0>, allocator_arg_t>>> {}; + +// Note: To improve throughput, this file uses extra _STD qualification for names that appear in the +// arguments of enable_if_t. Specifically, we qualify names which appear anywhere in the STL as members of +// some class - including injected-class-names! - that we know are not members of the class being defined. +// This avoids pointless class-member lookup for those names in this context. + +template +struct _Tuple_val { // stores each value in a tuple + constexpr _Tuple_val() : _Val() {} + + template + constexpr _Tuple_val(_Other&& _Arg) : _Val(_STD forward<_Other>(_Arg)) {} + + template , int> = 0> + constexpr _Tuple_val(const _Alloc&, allocator_arg_t, _Other&&... _Arg) : _Val(_STD forward<_Other>(_Arg)...) {} + + template , + _STD is_constructible<_Ty, _STD allocator_arg_t, const _Alloc&, _Other...>>, + int> = 0> + constexpr _Tuple_val(const _Alloc& _Al, allocator_arg_t, _Other&&... _Arg) + : _Val(allocator_arg, _Al, _STD forward<_Other>(_Arg)...) {} + + template , + _STD negation<_STD is_constructible<_Ty, _STD allocator_arg_t, const _Alloc&, _Other...>>>, + int> = 0> + constexpr _Tuple_val(const _Alloc& _Al, allocator_arg_t, _Other&&... _Arg) + : _Val(_STD forward<_Other>(_Arg)..., _Al) {} + + _Ty _Val; +}; + +struct _Exact_args_t { + explicit _Exact_args_t() = default; +}; // tag type to disambiguate construction (from one arg per element) + +struct _Unpack_tuple_t { + explicit _Unpack_tuple_t() = default; +}; // tag type to disambiguate construction (from unpacking a tuple/pair) + +struct _Alloc_exact_args_t { + explicit _Alloc_exact_args_t() = default; +}; // tag type to disambiguate construction (from an allocator and one arg per element) + +struct _Alloc_unpack_tuple_t { + explicit _Alloc_unpack_tuple_t() = default; +}; // tag type to disambiguate construction (from an allocator and unpacking a tuple/pair) + +#if _HAS_CXX23 +template >> +constexpr bool _Can_construct_values_from_tuple_like_v = false; + +template +constexpr bool _Can_construct_values_from_tuple_like_v, _Other, index_sequence<_Indices...>> = + conjunction_v(_STD declval<_Other>()))>...>; + +#if defined(__clang__) || defined(__EDG__) // TRANSITION, LLVM-59827 and VSO-1900279 +template +concept _Can_construct_from_tuple_like = + _Different_from<_TupleLike, _Tuple> && _Tuple_like<_TupleLike> && !_Is_subrange_v> + && (tuple_size_v<_Tuple> == tuple_size_v>) // + &&_Can_construct_values_from_tuple_like_v<_Tuple, _TupleLike> + && (tuple_size_v<_Tuple> != 1 + || (!is_convertible_v<_TupleLike, tuple_element_t<0, _Tuple>> + && !is_constructible_v, _TupleLike>) ); +#endif // ^^^ workaround ^^^ + +template >> +struct _Three_way_comparison_result_with_tuple_like {}; + +template + requires +#if !defined(__clang__) && !defined(__EDG__) // TRANSITION, DevCom-10265237 + (sizeof...(_TTypes) == sizeof...(_Indices)) && +#endif // ^^^ workaround ^^^ + (requires { typename _Synth_three_way_result<_TTypes, tuple_element_t<_Indices, _UTuple>>; } && ...) +struct _Three_way_comparison_result_with_tuple_like, _UTuple, index_sequence<_Indices...>> { + using type = common_comparison_category_t<_Synth_three_way_result<_TTypes, tuple_element_t<_Indices, _UTuple>>...>; +}; + +template +using _Three_way_comparison_result_with_tuple_like_t = + _Three_way_comparison_result_with_tuple_like<_TTuple, _UTuple>::type; + +template +concept _Tuple_like_non_tuple = !_Is_specialization_v<_Ty, tuple> && _Tuple_like<_Ty>; +#endif // _HAS_CXX23 + +template <> +class tuple<> { // empty tuple +public: + constexpr tuple() noexcept = default; /* strengthened */ + + constexpr tuple(const tuple&) noexcept /* strengthened */ {} // TRANSITION, ABI: should be defaulted + +#if _HAS_CXX23 + template <_Different_from _Other> + requires _Tuple_like<_Other> && (tuple_size_v> == 0) + constexpr tuple(_Other&&) noexcept /* strengthened */ {} +#endif // _HAS_CXX23 + + template + _CONSTEXPR20 tuple(allocator_arg_t, const _Alloc&) noexcept /* strengthened */ {} + + template + _CONSTEXPR20 tuple(allocator_arg_t, const _Alloc&, const tuple&) noexcept /* strengthened */ {} + +#if _HAS_CXX23 + template _Other> + requires _Tuple_like<_Other> && (tuple_size_v> == 0) + constexpr tuple(allocator_arg_t, const _Alloc&, _Other&&) noexcept /* strengthened */ {} +#endif // _HAS_CXX23 + + template , int> = 0> + constexpr tuple(_Tag) noexcept /* strengthened */ {} + + template , int> = 0> + constexpr tuple(_Tag, const _Alloc&) noexcept /* strengthened */ {} + + constexpr tuple& operator=(const tuple&) = default; +#if _HAS_CXX23 + constexpr const tuple& operator=(const tuple&) const noexcept /* strengthened */ { + return *this; + } + + template <_Different_from _Other> + requires _Tuple_like<_Other> && (tuple_size_v> == 0) + constexpr tuple& operator=(_Other&&) noexcept /* strengthened */ { + return *this; + } + + template <_Different_from _Other> + requires _Tuple_like<_Other> && (tuple_size_v> == 0) + constexpr const tuple& operator=(_Other&&) const noexcept /* strengthened */ { + return *this; + } +#endif // _HAS_CXX23 + + _CONSTEXPR20 void swap(tuple&) noexcept {} +#if _HAS_CXX23 + constexpr void swap(const tuple&) const noexcept {} +#endif // _HAS_CXX23 + + constexpr bool _Equals(const tuple&) const noexcept { + return true; + } + +#if _HAS_CXX20 + _NODISCARD constexpr strong_ordering _Three_way_compare(const tuple&) const noexcept { + return strong_ordering::equal; + } +#else // ^^^ _HAS_CXX20 / !_HAS_CXX20 vvv + _NODISCARD constexpr bool _Less(const tuple&) const noexcept { + return false; + } +#endif // ^^^ !_HAS_CXX20 ^^^ + +#if _HAS_CXX23 + template <_Tuple_like_non_tuple _Other> + _NODISCARD friend constexpr bool operator==(const tuple&, const _Other&) noexcept /* strengthened */ { + static_assert(tuple_size_v<_Other> == 0, "Cannot compare tuples of different sizes (N4950 [tuple.rel]/2)."); + return true; + } + + template <_Tuple_like_non_tuple _Other> + requires (tuple_size_v> == 0) + _NODISCARD friend constexpr strong_ordering operator<=>(const tuple&, const _Other&) noexcept /* strengthened */ { + return strong_ordering::equal; + } +#endif // _HAS_CXX23 +}; + +template +class tuple<_This, _Rest...> : private tuple<_Rest...> { // recursive tuple definition +public: + using _This_type = _This; + using _Mybase = tuple<_Rest...>; + + template , int> = 0> + constexpr tuple(_Tag, _This2&& _This_arg, _Rest2&&... _Rest_arg) + : _Mybase(_Exact_args_t{}, _STD forward<_Rest2>(_Rest_arg)...), _Myfirst(_STD forward<_This2>(_This_arg)) {} + + template , int> = 0> + constexpr tuple(_Tag, _Tpl&& _Right, index_sequence<_Indices...>); + + template , int> = 0> + constexpr tuple(_Tag, _Tpl&& _Right) + : tuple(_Unpack_tuple_t{}, _STD forward<_Tpl>(_Right), + make_index_sequence>>{}) {} + + template , int> = 0> + constexpr tuple(_Tag, const _Alloc& _Al, _This2&& _This_arg, _Rest2&&... _Rest_arg) + : _Mybase(_Alloc_exact_args_t{}, _Al, _STD forward<_Rest2>(_Rest_arg)...), + _Myfirst(_Al, allocator_arg, _STD forward<_This2>(_This_arg)) {} + + template , int> = 0> + constexpr tuple(_Tag, const _Alloc& _Al, _Tpl&& _Right, index_sequence<_Indices...>); + + template , int> = 0> + constexpr tuple(_Tag, const _Alloc& _Al, _Tpl&& _Right) + : tuple(_Alloc_unpack_tuple_t{}, _Al, _STD forward<_Tpl>(_Right), + make_index_sequence>>{}) {} + + template , _STD is_default_constructible<_Rest>...>, + int> = 0> + constexpr explicit( + !conjunction_v<_Is_implicitly_default_constructible<_This2>, _Is_implicitly_default_constructible<_Rest>...>) + tuple() noexcept(conjunction_v, + is_nothrow_default_constructible<_Rest>...>) // strengthened + : _Mybase(), _Myfirst() {} + + template , int> = 0> + constexpr explicit(_Tuple_conditional_explicit_v) tuple( + const _This& _This_arg, const _Rest&... _Rest_arg) noexcept(conjunction_v, + is_nothrow_copy_constructible<_Rest>...>) // strengthened + : tuple(_Exact_args_t{}, _This_arg, _Rest_arg...) {} + + template , + _STD _Tuple_constructible_val>, + int> = 0> + constexpr explicit(_Tuple_conditional_explicit_v) tuple(_This2&& _This_arg, + _Rest2&&... _Rest_arg) noexcept(_Tuple_nothrow_constructible_v) // strengthened + : tuple(_Exact_args_t{}, _STD forward<_This2>(_This_arg), _STD forward<_Rest2>(_Rest_arg)...) {} + + tuple(const tuple&) = default; + tuple(tuple&&) = default; + +#if _HAS_CXX23 + template , + _STD _Tuple_convert_val&, _Other...>>, + int> = 0> + constexpr explicit(_Tuple_conditional_explicit_v) + tuple(tuple<_Other...>& _Right) noexcept(_Tuple_nothrow_constructible_v) // strengthened + : tuple(_Unpack_tuple_t{}, _Right) {} +#endif // _HAS_CXX23 + + template , + _STD _Tuple_convert_val&, _Other...>>, + int> = 0> + constexpr explicit(_Tuple_conditional_explicit_v) + tuple(const tuple<_Other...>& _Right) noexcept( + _Tuple_nothrow_constructible_v) // strengthened + : tuple(_Unpack_tuple_t{}, _Right) {} + + template , + _STD _Tuple_convert_val, _Other...>>, + int> = 0> + constexpr explicit(_Tuple_conditional_explicit_v) + tuple(tuple<_Other...>&& _Right) noexcept(_Tuple_nothrow_constructible_v) // strengthened + : tuple(_Unpack_tuple_t{}, _STD move(_Right)) {} + +#if _HAS_CXX23 + template , + _STD _Tuple_convert_val, _Other...>>, + int> = 0> + constexpr explicit(_Tuple_conditional_explicit_v) + tuple(const tuple<_Other...>&& _Right) noexcept( + _Tuple_nothrow_constructible_v) // strengthened + : tuple(_Unpack_tuple_t{}, _STD move(_Right)) {} + + template , int> = 0> + constexpr explicit(_Tuple_conditional_explicit_v) + tuple(pair<_First, _Second>& _Right) noexcept( + _Tuple_nothrow_constructible_v) // strengthened + : tuple(_Unpack_tuple_t{}, _Right) {} +#endif // _HAS_CXX23 + + template , int> = 0> + constexpr explicit(_Tuple_conditional_explicit_v) + tuple(const pair<_First, _Second>& _Right) noexcept( + _Tuple_nothrow_constructible_v) // strengthened + : tuple(_Unpack_tuple_t{}, _Right) {} + + template , int> = 0> + constexpr explicit(_Tuple_conditional_explicit_v) tuple( + pair<_First, _Second>&& _Right) noexcept(_Tuple_nothrow_constructible_v) // strengthened + : tuple(_Unpack_tuple_t{}, _STD move(_Right)) {} + +#if _HAS_CXX23 + template , int> = 0> + constexpr explicit(_Tuple_conditional_explicit_v) + tuple(const pair<_First, _Second>&& _Right) noexcept( + _Tuple_nothrow_constructible_v) // strengthened + : tuple(_Unpack_tuple_t{}, _STD move(_Right)) {} + + template > + static constexpr bool _Is_tuple_like_constructor_explicit_v = false; + + template <_Tuple_like _Other, size_t... _Indices> + static constexpr bool _Is_tuple_like_constructor_explicit_v<_Other, index_sequence<_Indices...>> = + negation_v(_STD declval<_Other>())), _This>, + is_convertible(_STD declval<_Other>())), _Rest>...>>; + +#if defined(__clang__) || defined(__EDG__) // TRANSITION, LLVM-59827 and VSO-1900279 + template , int> = 0> +#else // ^^^ workaround / no workaround vvv + template <_Different_from _Other> + requires _Tuple_like<_Other> && (!_Is_subrange_v>) + && (1 + sizeof...(_Rest) == tuple_size_v>) + && _Can_construct_values_from_tuple_like_v + && (sizeof...(_Rest) != 0 || (!is_convertible_v<_Other, _This> && !is_constructible_v<_This, _Other>) ) +#endif // ^^^ no workaround ^^^ + constexpr explicit(_Is_tuple_like_constructor_explicit_v<_Other>) tuple(_Other&& _Right) + : tuple(_Unpack_tuple_t{}, _STD forward<_Other>(_Right)) { + } +#endif // _HAS_CXX23 + + template , _STD is_default_constructible<_Rest>...>, + int> = 0> + _CONSTEXPR20 explicit( + !conjunction_v<_Is_implicitly_default_constructible<_This2>, _Is_implicitly_default_constructible<_Rest>...>) + tuple(allocator_arg_t, const _Alloc& _Al) + : _Mybase(allocator_arg, _Al), _Myfirst(_Al, allocator_arg) {} + + template , int> = 0> + _CONSTEXPR20 explicit(_Tuple_conditional_explicit_v) + tuple(allocator_arg_t, const _Alloc& _Al, const _This& _This_arg, const _Rest&... _Rest_arg) + : tuple(_Alloc_exact_args_t{}, _Al, _This_arg, _Rest_arg...) {} + + template , + _STD _Tuple_constructible_val>, + int> = 0> + _CONSTEXPR20 explicit(_Tuple_conditional_explicit_v) + tuple(allocator_arg_t, const _Alloc& _Al, _This2&& _This_arg, _Rest2&&... _Rest_arg) + : tuple(_Alloc_exact_args_t{}, _Al, _STD forward<_This2>(_This_arg), _STD forward<_Rest2>(_Rest_arg)...) {} + + template , int> = 0> + _CONSTEXPR20 tuple(allocator_arg_t, const _Alloc& _Al, const tuple& _Right) + : tuple(_Alloc_unpack_tuple_t{}, _Al, _Right) {} + + template , int> = 0> + _CONSTEXPR20 tuple(allocator_arg_t, const _Alloc& _Al, tuple&& _Right) + : tuple(_Alloc_unpack_tuple_t{}, _Al, _STD move(_Right)) {} + +#if _HAS_CXX23 + template , + _STD _Tuple_convert_val&, _Other...>>, + int> = 0> + constexpr explicit(_Tuple_conditional_explicit_v) + tuple(allocator_arg_t, const _Alloc& _Al, tuple<_Other...>& _Right) + : tuple(_Alloc_unpack_tuple_t{}, _Al, _Right) {} +#endif // _HAS_CXX23 + + template , + _STD _Tuple_convert_val&, _Other...>>, + int> = 0> + _CONSTEXPR20 explicit(_Tuple_conditional_explicit_v) + tuple(allocator_arg_t, const _Alloc& _Al, const tuple<_Other...>& _Right) + : tuple(_Alloc_unpack_tuple_t{}, _Al, _Right) {} + + template , + _STD _Tuple_convert_val, _Other...>>, + int> = 0> + _CONSTEXPR20 explicit(_Tuple_conditional_explicit_v) + tuple(allocator_arg_t, const _Alloc& _Al, tuple<_Other...>&& _Right) + : tuple(_Alloc_unpack_tuple_t{}, _Al, _STD move(_Right)) {} + +#if _HAS_CXX23 + template , + _STD _Tuple_convert_val, _Other...>>, + int> = 0> + constexpr explicit(_Tuple_conditional_explicit_v) + tuple(allocator_arg_t, const _Alloc& _Al, const tuple<_Other...>&& _Right) + : tuple(_Alloc_unpack_tuple_t{}, _Al, _STD move(_Right)) {} + + template , int> = 0> + constexpr explicit(_Tuple_conditional_explicit_v) + tuple(allocator_arg_t, const _Alloc& _Al, pair<_First, _Second>& _Right) + : tuple(_Alloc_unpack_tuple_t{}, _Al, _Right) {} +#endif // _HAS_CXX23 + + template , int> = 0> + _CONSTEXPR20 explicit(_Tuple_conditional_explicit_v) + tuple(allocator_arg_t, const _Alloc& _Al, const pair<_First, _Second>& _Right) + : tuple(_Alloc_unpack_tuple_t{}, _Al, _Right) {} + + template , int> = 0> + _CONSTEXPR20 explicit(_Tuple_conditional_explicit_v) + tuple(allocator_arg_t, const _Alloc& _Al, pair<_First, _Second>&& _Right) + : tuple(_Alloc_unpack_tuple_t{}, _Al, _STD move(_Right)) {} + +#if _HAS_CXX23 + template , int> = 0> + constexpr explicit(_Tuple_conditional_explicit_v) + tuple(allocator_arg_t, const _Alloc& _Al, const pair<_First, _Second>&& _Right) + : tuple(_Alloc_unpack_tuple_t{}, _Al, _STD move(_Right)) {} + +#if defined(__clang__) || defined(__EDG__) // TRANSITION, LLVM-59827 (Clang), VSO-1900279 (EDG) + template , int> = 0> +#else // ^^^ workaround / no workaround vvv + template _Other> + requires _Tuple_like<_Other> && (!_Is_subrange_v>) + && (1 + sizeof...(_Rest) == tuple_size_v>) + && _Can_construct_values_from_tuple_like_v + && (sizeof...(_Rest) != 0 || (!is_convertible_v<_Other, _This> && !is_constructible_v<_This, _Other>) ) +#endif // ^^^ no workaround ^^^ + constexpr explicit(_Is_tuple_like_constructor_explicit_v<_Other>) + tuple(allocator_arg_t, const _Alloc& _Al, _Other&& _Right) + : tuple(_Alloc_unpack_tuple_t{}, _Al, _STD forward<_Other>(_Right)) { + } +#endif // _HAS_CXX23 + + tuple& operator=(const volatile tuple&) = delete; + + template , + _STD _Is_copy_assignable_no_precondition_check<_Rest>...>, + int> = 0> + _CONSTEXPR20 tuple& operator=(_Identity_t _Right) noexcept( + conjunction_v, is_nothrow_copy_assignable<_Rest>...>) /* strengthened */ { + _Myfirst._Val = _Right._Myfirst._Val; + _Get_rest() = _Right._Get_rest(); + return *this; + } + +#if _HAS_CXX23 + template + requires conjunction_v<_STD _Is_copy_assignable_no_precondition_check, + _STD _Is_copy_assignable_no_precondition_check...> + constexpr const tuple& operator=(_Identity_t _Right) const + noexcept(conjunction_v, + is_nothrow_copy_assignable...>) /* strengthened */ { + _Myfirst._Val = _Right._Myfirst._Val; + _Get_rest() = _Right._Get_rest(); + return *this; + } +#endif // _HAS_CXX23 + + template , + _STD _Is_move_assignable_no_precondition_check<_Rest>...>, + int> = 0> + _CONSTEXPR20 tuple& operator=(_Identity_t<_Myself&&> _Right) noexcept( + conjunction_v, is_nothrow_move_assignable<_Rest>...>) { + _Myfirst._Val = _STD forward<_This>(_Right._Myfirst._Val); + _Get_rest() = _STD forward<_Mybase>(_Right._Get_rest()); + return *this; + } + +#if _HAS_CXX23 + template + requires conjunction_v<_STD _Is_assignable_no_precondition_check, + _STD _Is_assignable_no_precondition_check...> + constexpr const tuple& operator=(_Identity_t<_Myself&&> _Right) const + noexcept(conjunction_v, + is_nothrow_assignable...>) /* strengthened */ { + _Myfirst._Val = _STD forward<_This>(_Right._Myfirst._Val); + _Get_rest() = _STD forward<_Mybase>(_Right._Get_rest()); + return *this; + } +#endif // _HAS_CXX23 + + template >>, + _STD _Tuple_assignable_val>, + int> = 0> + _CONSTEXPR20 tuple& operator=(const tuple<_Other...>& _Right) noexcept( + _Tuple_nothrow_assignable_v) /* strengthened */ { + _Myfirst._Val = _Right._Myfirst._Val; + _Get_rest() = _Right._Get_rest(); + return *this; + } + +#if _HAS_CXX23 + template + requires (!is_same_v>) && _Tuple_assignable_v + constexpr const tuple& operator=(const tuple<_Other...>& _Right) const + noexcept(_Tuple_nothrow_assignable_v) /* strengthened */ { + _Myfirst._Val = _Right._Myfirst._Val; + _Get_rest() = _Right._Get_rest(); + return *this; + } +#endif // _HAS_CXX23 + + template >>, + _STD _Tuple_assignable_val>, + int> = 0> + _CONSTEXPR20 tuple& operator=(tuple<_Other...>&& _Right) noexcept( + _Tuple_nothrow_assignable_v) /* strengthened */ { + _Myfirst._Val = _STD forward::_This_type>(_Right._Myfirst._Val); + _Get_rest() = _STD forward::_Mybase>(_Right._Get_rest()); + return *this; + } + +#if _HAS_CXX23 + template + requires (!is_same_v>) && _Tuple_assignable_v + constexpr const tuple& operator=(tuple<_Other...>&& _Right) const + noexcept(_Tuple_nothrow_assignable_v) /* strengthened */ { + _Myfirst._Val = _STD forward::_This_type>(_Right._Myfirst._Val); + _Get_rest() = _STD forward::_Mybase>(_Right._Get_rest()); + return *this; + } +#endif // _HAS_CXX23 + + template , int> = 0> + _CONSTEXPR20 tuple& operator=(const pair<_First, _Second>& _Right) noexcept( + _Tuple_nothrow_assignable_v) /* strengthened */ { + _Myfirst._Val = _Right.first; + _Get_rest()._Myfirst._Val = _Right.second; + return *this; + } + +#if _HAS_CXX23 + template + requires _Tuple_assignable_v + constexpr const tuple& operator=(const pair<_First, _Second>& _Right) const + noexcept(_Tuple_nothrow_assignable_v) /* strengthened */ { + _Myfirst._Val = _Right.first; + _Get_rest()._Myfirst._Val = _Right.second; + return *this; + } +#endif // _HAS_CXX23 + + template , int> = 0> + _CONSTEXPR20 tuple& operator=(pair<_First, _Second>&& _Right) noexcept( + _Tuple_nothrow_assignable_v) /* strengthened */ { + _Myfirst._Val = _STD forward<_First>(_Right.first); + _Get_rest()._Myfirst._Val = _STD forward<_Second>(_Right.second); + return *this; + } + +#if _HAS_CXX23 + template + requires _Tuple_assignable_v + constexpr const tuple& operator=(pair<_First, _Second>&& _Right) const + noexcept(_Tuple_nothrow_assignable_v) /* strengthened */ { + _Myfirst._Val = _STD forward<_First>(_Right.first); + _Get_rest()._Myfirst._Val = _STD forward<_Second>(_Right.second); + return *this; + } + + template > + static constexpr bool _Can_assign_values_from_tuple_like_v = false; + + template <_Tuple_like _Other, size_t... _Indices> + static constexpr bool _Can_assign_values_from_tuple_like_v> = + conjunction_v(_STD declval<_Other>()))>, + is_assignable<_Rest&, decltype(_STD get<_Indices + 1>(_STD declval<_Other>()))>...>; + + template <_Tuple_like _Other, size_t... _Indices> + static constexpr bool _Can_assign_values_from_tuple_like_v> = + conjunction_v(_STD declval<_Other>()))>, + is_assignable(_STD declval<_Other>()))>...>; + + template <_Tuple_like _Other, size_t... _Indices> + constexpr void _Assign_tuple_like(_Other&& _Right, index_sequence<_Indices...>) { + ((void) (_STD get<_Indices>(*this) = _STD get<_Indices>(_STD forward<_Other>(_Right))), ...); + } + + template <_Tuple_like _Other, size_t... _Indices> + constexpr void _Assign_tuple_like(_Other&& _Right, index_sequence<_Indices...>) const { + ((void) (_STD get<_Indices>(*this) = _STD get<_Indices>(_STD forward<_Other>(_Right))), ...); + } + + template <_Different_from _Other> + requires _Tuple_like<_Other> && (!_Is_subrange_v>) + && (1 + sizeof...(_Rest) == tuple_size_v>) + && _Can_assign_values_from_tuple_like_v + constexpr tuple& operator=(_Other&& _Right) { + _Assign_tuple_like(_STD forward<_Other>(_Right), make_index_sequence<1 + sizeof...(_Rest)>{}); + return *this; + } + + template <_Different_from _Other> + requires _Tuple_like<_Other> && (!_Is_subrange_v>) + && (1 + sizeof...(_Rest) == tuple_size_v>) + && _Can_assign_values_from_tuple_like_v + constexpr const tuple& operator=(_Other&& _Right) const { + _Assign_tuple_like(_STD forward<_Other>(_Right), make_index_sequence<1 + sizeof...(_Rest)>{}); + return *this; + } +#endif // _HAS_CXX23 + + _CONSTEXPR20 void swap(tuple& _Right) noexcept( + conjunction_v<_Is_nothrow_swappable<_This>, _Is_nothrow_swappable<_Rest>...>) { + using _STD swap; + swap(_Myfirst._Val, _Right._Myfirst._Val); // intentional ADL + _Mybase::swap(_Right._Get_rest()); + } + +#if _HAS_CXX23 + template // see GH-3013 + constexpr void swap(const tuple& _Right) const + noexcept(conjunction_v, is_nothrow_swappable...>) { + using _STD swap; + swap(_Myfirst._Val, _Right._Myfirst._Val); // intentional ADL + _Mybase::swap(_Right._Get_rest()); + } +#endif // _HAS_CXX23 + + constexpr _Mybase& _Get_rest() noexcept { // get reference to rest of elements + return *this; + } + + constexpr const _Mybase& _Get_rest() const noexcept { // get const reference to rest of elements + return *this; + } + + template + constexpr bool _Equals(const tuple<_Other...>& _Right) const { + return _Myfirst._Val == _Right._Myfirst._Val && _Mybase::_Equals(_Right._Get_rest()); + } + +#if _HAS_CXX20 + template + _NODISCARD constexpr common_comparison_category_t<_Synth_three_way_result<_This, _First>, + _Synth_three_way_result<_Rest, _Other>...> + _Three_way_compare(const tuple<_First, _Other...>& _Right) const { + if (auto _Result = _Synth_three_way{}(_Myfirst._Val, _Right._Myfirst._Val); _Result != 0) { + return _Result; + } + return _Mybase::_Three_way_compare(_Right._Get_rest()); + } + +#if _HAS_CXX23 + template > + static constexpr bool _Can_equal_compare_with_tuple_like_v = false; + + template + static constexpr bool _Can_equal_compare_with_tuple_like_v<_Other, index_sequence<_Indices...>> = + (requires(const tuple& _Left, const _Other& _Right) { + { _STD get<_Indices>(_Left) == _STD get<_Indices>(_Right) } -> _Boolean_testable; + } && ...); + + template + _NODISCARD constexpr bool _Equals_to_tuple_like(const _Other& _Right, index_sequence<_Indices...>) const { + return ((_STD get<_Indices>(*this) == _STD get<_Indices>(_Right)) && ...); + } + + template <_Tuple_like_non_tuple _Other> + _NODISCARD friend constexpr bool operator==(const tuple& _Left, const _Other& _Right) { + static_assert(1 + sizeof...(_Rest) == tuple_size_v<_Other>, + "Cannot compare tuples of different sizes (N4950 [tuple.rel]/2)."); + static_assert(_Can_equal_compare_with_tuple_like_v<_Other>, + "For all i, where 0 <= i < sizeof...(TTypes), get(t) == get(u) must be a valid expression (N4950 " + "[tuple.rel]/2)."); + return _Left._Equals_to_tuple_like(_Right, make_index_sequence<1 + sizeof...(_Rest)>{}); + } + + template + _NODISCARD constexpr auto _Three_way_compare_with_tuple_like( + const _Other& _Right, index_sequence<_Indices...>) const { + _Three_way_comparison_result_with_tuple_like_t _Result = strong_ordering::equal; + (void) (((_Result = _Synth_three_way{}(_STD get<_Indices>(*this), _STD get<_Indices>(_Right))) == 0) && ...); + return _Result; + } + + template <_Tuple_like_non_tuple _Other> + _NODISCARD friend constexpr auto operator<=>(const tuple& _Left, const _Other& _Right) + -> _Three_way_comparison_result_with_tuple_like_t { + return _Left._Three_way_compare_with_tuple_like(_Right, make_index_sequence<1 + sizeof...(_Rest)>{}); + } +#endif // _HAS_CXX23 +#else // ^^^ _HAS_CXX20 / !_HAS_CXX20 vvv + template + _NODISCARD constexpr bool _Less(const tuple<_Other...>& _Right) const { + return _Myfirst._Val < _Right._Myfirst._Val + || (!(_Right._Myfirst._Val < _Myfirst._Val) && _Mybase::_Less(_Right._Get_rest())); + } +#endif // ^^^ !_HAS_CXX20 ^^^ + + template + friend constexpr tuple_element_t<_Index, tuple<_Types...>>& get(tuple<_Types...>& _Tuple) noexcept; + + template + friend constexpr const tuple_element_t<_Index, tuple<_Types...>>& get(const tuple<_Types...>& _Tuple) noexcept; + + template + friend constexpr tuple_element_t<_Index, tuple<_Types...>>&& get(tuple<_Types...>&& _Tuple) noexcept; + + template + friend constexpr const tuple_element_t<_Index, tuple<_Types...>>&& get(const tuple<_Types...>&& _Tuple) noexcept; + + template + friend constexpr auto&& _Tuple_get(tuple<_Types...>&& _Tuple) noexcept; + + template + friend constexpr _Ty& get(tuple<_Types...>& _Tuple) noexcept; + + template + friend constexpr const _Ty& get(const tuple<_Types...>& _Tuple) noexcept; + + template + friend constexpr _Ty&& get(tuple<_Types...>&& _Tuple) noexcept; + + template + friend constexpr const _Ty&& get(const tuple<_Types...>&& _Tuple) noexcept; + + _Tuple_val<_This> _Myfirst; // the stored element +}; + +#if _HAS_CXX17 +template +tuple(_Types...) -> tuple<_Types...>; + +template +tuple(pair<_Ty1, _Ty2>) -> tuple<_Ty1, _Ty2>; + +template +tuple(allocator_arg_t, _Alloc, _Types...) -> tuple<_Types...>; + +template +tuple(allocator_arg_t, _Alloc, pair<_Ty1, _Ty2>) -> tuple<_Ty1, _Ty2>; + +template +tuple(allocator_arg_t, _Alloc, tuple<_Types...>) -> tuple<_Types...>; +#endif // _HAS_CXX17 + +_EXPORT_STD template +_NODISCARD constexpr bool operator==(const tuple<_Types1...>& _Left, const tuple<_Types2...>& _Right) { + static_assert( + sizeof...(_Types1) == sizeof...(_Types2), "Cannot compare tuples of different sizes (N4950 [tuple.rel]/2)."); + return _Left._Equals(_Right); +} + +#if _HAS_CXX20 +_EXPORT_STD template +_NODISCARD constexpr common_comparison_category_t<_Synth_three_way_result<_Types1, _Types2>...> operator<=>( + const tuple<_Types1...>& _Left, const tuple<_Types2...>& _Right) { + return _Left._Three_way_compare(_Right); +} +#else // ^^^ _HAS_CXX20 / !_HAS_CXX20 vvv +template +_NODISCARD constexpr bool operator!=(const tuple<_Types1...>& _Left, const tuple<_Types2...>& _Right) { + return !(_Left == _Right); +} + +template +_NODISCARD constexpr bool operator<(const tuple<_Types1...>& _Left, const tuple<_Types2...>& _Right) { + static_assert(sizeof...(_Types1) == sizeof...(_Types2), "cannot compare tuples of different sizes"); + return _Left._Less(_Right); +} + +template +_NODISCARD constexpr bool operator>=(const tuple<_Types1...>& _Left, const tuple<_Types2...>& _Right) { + return !(_Left < _Right); +} + +template +_NODISCARD constexpr bool operator>(const tuple<_Types1...>& _Left, const tuple<_Types2...>& _Right) { + return _Right < _Left; +} + +template +_NODISCARD constexpr bool operator<=(const tuple<_Types1...>& _Left, const tuple<_Types2...>& _Right) { + return !(_Right < _Left); +} +#endif // ^^^ !_HAS_CXX20 ^^^ + +_EXPORT_STD template ...>, int> = 0> +_CONSTEXPR20 void swap(tuple<_Types...>& _Left, tuple<_Types...>& _Right) noexcept(noexcept(_Left.swap(_Right))) { + _Left.swap(_Right); +} + +#if _HAS_CXX23 +_EXPORT_STD template + requires conjunction_v...> +constexpr void swap(const tuple<_Types...>& _Left, const tuple<_Types...>& _Right) noexcept( + noexcept(_Left.swap(_Right))) { + _Left.swap(_Right); +} +#endif // _HAS_CXX23 + +_EXPORT_STD template +_NODISCARD constexpr tuple_element_t<_Index, tuple<_Types...>>& get(tuple<_Types...>& _Tuple) noexcept { + using _Ttype = typename tuple_element<_Index, tuple<_Types...>>::_Ttype; + return static_cast<_Ttype&>(_Tuple)._Myfirst._Val; +} + +_EXPORT_STD template +_NODISCARD constexpr const tuple_element_t<_Index, tuple<_Types...>>& get(const tuple<_Types...>& _Tuple) noexcept { + using _Ttype = typename tuple_element<_Index, tuple<_Types...>>::_Ttype; + return static_cast(_Tuple)._Myfirst._Val; +} + +_EXPORT_STD template +_NODISCARD constexpr tuple_element_t<_Index, tuple<_Types...>>&& get(tuple<_Types...>&& _Tuple) noexcept { + using _Ty = tuple_element_t<_Index, tuple<_Types...>>; + using _Ttype = typename tuple_element<_Index, tuple<_Types...>>::_Ttype; + return static_cast<_Ty&&>(static_cast<_Ttype&>(_Tuple)._Myfirst._Val); +} + +_EXPORT_STD template +_NODISCARD constexpr const tuple_element_t<_Index, tuple<_Types...>>&& get(const tuple<_Types...>&& _Tuple) noexcept { + using _Ty = tuple_element_t<_Index, tuple<_Types...>>; + using _Ttype = typename tuple_element<_Index, tuple<_Types...>>::_Ttype; + return static_cast(static_cast(_Tuple)._Myfirst._Val); +} + +template +_NODISCARD constexpr auto&& _Tuple_get(tuple<_Types...>&& _Tuple) noexcept { + // used by pair's piecewise constructor + using _Ty = tuple_element_t<_Index, tuple<_Types...>>; + using _Ttype = typename tuple_element<_Index, tuple<_Types...>>::_Ttype; + return static_cast<_Ty&&>(static_cast<_Ttype&>(_Tuple)._Myfirst._Val); +} + +_EXPORT_STD template +_NODISCARD constexpr _Ty& get(tuple<_Types...>& _Tuple) noexcept { + constexpr size_t _Idx = _Meta_find_unique_index, _Ty>::value; + if constexpr (_Idx < sizeof...(_Types)) { + using _Ttype = typename tuple_element<_Idx, tuple<_Types...>>::_Ttype; + return static_cast<_Ttype&>(_Tuple)._Myfirst._Val; + } else { + static_assert(false, "get(tuple&) " + "requires T to occur exactly once in Types. (N4971 [tuple.elem]/5)"); + } +} + +_EXPORT_STD template +_NODISCARD constexpr const _Ty& get(const tuple<_Types...>& _Tuple) noexcept { + constexpr size_t _Idx = _Meta_find_unique_index, _Ty>::value; + if constexpr (_Idx < sizeof...(_Types)) { + using _Ttype = typename tuple_element<_Idx, tuple<_Types...>>::_Ttype; + return static_cast(_Tuple)._Myfirst._Val; + } else { + static_assert(false, "get(const tuple&) " + "requires T to occur exactly once in Types. (N4971 [tuple.elem]/5)"); + } +} + +_EXPORT_STD template +_NODISCARD constexpr _Ty&& get(tuple<_Types...>&& _Tuple) noexcept { + constexpr size_t _Idx = _Meta_find_unique_index, _Ty>::value; + if constexpr (_Idx < sizeof...(_Types)) { + using _Ttype = typename tuple_element<_Idx, tuple<_Types...>>::_Ttype; + return static_cast<_Ty&&>(static_cast<_Ttype&>(_Tuple)._Myfirst._Val); + } else { + static_assert(false, "get(tuple&&) " + "requires T to occur exactly once in Types. (N4971 [tuple.elem]/5)"); + } +} + +_EXPORT_STD template +_NODISCARD constexpr const _Ty&& get(const tuple<_Types...>&& _Tuple) noexcept { + constexpr size_t _Idx = _Meta_find_unique_index, _Ty>::value; + if constexpr (_Idx < sizeof...(_Types)) { + using _Ttype = typename tuple_element<_Idx, tuple<_Types...>>::_Ttype; + return static_cast(static_cast(_Tuple)._Myfirst._Val); + } else { + static_assert(false, "get(const tuple&&) " + "requires T to occur exactly once in Types. (N4971 [tuple.elem]/5)"); + } +} + +template +template , int> /* = 0 */> +constexpr tuple<_This, _Rest...>::tuple(_Tag, _Tpl&& _Right, index_sequence<_Indices...>) + : tuple(_Exact_args_t{}, _STD get<_Indices>(_STD forward<_Tpl>(_Right))...) {} + +template +template , int> /* = 0 */> +constexpr tuple<_This, _Rest...>::tuple(_Tag, const _Alloc& _Al, _Tpl&& _Right, index_sequence<_Indices...>) + : tuple(_Alloc_exact_args_t{}, _Al, _STD get<_Indices>(_STD forward<_Tpl>(_Right))...) {} + +_EXPORT_STD template +_NODISCARD constexpr tuple<_Unrefwrap_t<_Types>...> make_tuple(_Types&&... _Args) { // make tuple from elements + using _Ttype = tuple<_Unrefwrap_t<_Types>...>; + return _Ttype(_STD forward<_Types>(_Args)...); +} + +_EXPORT_STD template +_NODISCARD constexpr tuple<_Types&...> tie(_Types&... _Args) noexcept { // make tuple from elements + using _Ttype = tuple<_Types&...>; + return _Ttype(_Args...); +} + +_EXPORT_STD template +_NODISCARD constexpr tuple<_Types&&...> forward_as_tuple(_Types&&... _Args) noexcept { // forward arguments in a tuple + return tuple<_Types&&...>(_STD forward<_Types>(_Args)...); +} + +template +struct _Tuple_cat2; + +template +struct _Tuple_cat2<_Ty, index_sequence<_Kx...>, index_sequence<_Ix...>, _Ix_next> { + using _Ret = tuple>>...>; + using _Kx_seq = index_sequence<_Kx...>; + using _Ix_seq = index_sequence<_Ix...>; +}; + +template +struct _Tuple_cat2<_Ty, index_sequence<_Kx...>, index_sequence<_Ix...>, _Ix_next, index_sequence<_Kx_next...>, _Rest...> + : _Tuple_cat2<_Ty, index_sequence<_Kx..., _Kx_next...>, + index_sequence<_Ix..., (_Ix_next + 0 * _Kx_next)...>, // repeat _Ix_next, ignoring the elements of _Kx_next + _Ix_next + 1, _Rest...> {}; + +#if _HAS_CXX23 +template <_Tuple_like... _Tuples> +#else // ^^^ _HAS_CXX23 / !_HAS_CXX23 vvv +template +#endif // ^^^ !_HAS_CXX23 ^^^ +using _Tuple_cat1 = _Tuple_cat2, index_sequence<>, index_sequence<>, 0, + make_index_sequence>>...>; + +template +constexpr _Ret _Tuple_cat(index_sequence<_Kx...>, index_sequence<_Ix...>, _Ty _Arg) { + return _Ret{_STD get<_Kx>(_STD get<_Ix>(_STD move(_Arg)))...}; +} + +#if _HAS_CXX23 +_EXPORT_STD template <_Tuple_like... _Tuples> +#else // ^^^ _HAS_CXX23 / !_HAS_CXX23 vvv +_EXPORT_STD template +#endif // ^^^ !_HAS_CXX23 ^^^ +_NODISCARD constexpr typename _Tuple_cat1<_Tuples...>::_Ret tuple_cat(_Tuples&&... _Tpls) { // concatenate tuples + using _Cat1 = _Tuple_cat1<_Tuples...>; + using _Ret = typename _Cat1::_Ret; + using _Kx_seq = typename _Cat1::_Kx_seq; + using _Ix_seq = typename _Cat1::_Ix_seq; + return _STD _Tuple_cat<_Ret>(_Kx_seq{}, _Ix_seq{}, _STD forward_as_tuple(_STD forward<_Tuples>(_Tpls)...)); +} + +#if _HAS_CXX17 +#if _HAS_CXX23 +template +#else // ^^^ _HAS_CXX23 / !_HAS_CXX23 vvv +template +#endif // ^^^ !_HAS_CXX23 ^^^ +constexpr decltype(auto) _Apply_impl(_Callable&& _Obj, _Tuple&& _Tpl, index_sequence<_Indices...>) noexcept( + noexcept(_STD invoke(_STD forward<_Callable>(_Obj), _STD get<_Indices>(_STD forward<_Tuple>(_Tpl))...))) { + return _STD invoke(_STD forward<_Callable>(_Obj), _STD get<_Indices>(_STD forward<_Tuple>(_Tpl))...); +} + +#if _HAS_CXX23 +_EXPORT_STD template +#else // ^^^ _HAS_CXX23 / !_HAS_CXX23 vvv +_EXPORT_STD template +#endif // ^^^ !_HAS_CXX23 ^^^ +constexpr decltype(auto) apply(_Callable&& _Obj, _Tuple&& _Tpl) noexcept( + noexcept(_STD _Apply_impl(_STD forward<_Callable>(_Obj), _STD forward<_Tuple>(_Tpl), + make_index_sequence>>{}))) { + return _STD _Apply_impl(_STD forward<_Callable>(_Obj), _STD forward<_Tuple>(_Tpl), + make_index_sequence>>{}); +} + +template >>> +constexpr bool _Can_make_from_tuple = false; +template +constexpr bool _Can_make_from_tuple<_Ty, _Tuple, index_sequence<_Indices...>> = + is_constructible_v<_Ty, decltype(_STD get<_Indices>(_STD declval<_Tuple>()))...>; + +template +constexpr _Ty _Make_from_tuple_impl(_Tuple&& _Tpl, index_sequence<_Indices...>) noexcept( + is_nothrow_constructible_v<_Ty, decltype(_STD get<_Indices>(_STD forward<_Tuple>(_Tpl)))...>) { + return _Ty(_STD get<_Indices>(_STD forward<_Tuple>(_Tpl))...); +} + +#if _HAS_CXX23 +_EXPORT_STD template + requires _Can_make_from_tuple<_Ty, _Tuple> +#elif _HAS_CXX20 +_EXPORT_STD template + requires _Can_make_from_tuple<_Ty, _Tuple> +#else // ^^^ _HAS_CXX20 / !_HAS_CXX20 vvv +template , int> = 0> +#endif // ^^^ !_HAS_CXX20 ^^^ +_NODISCARD constexpr _Ty make_from_tuple(_Tuple&& _Tpl) noexcept(noexcept(_STD _Make_from_tuple_impl<_Ty>( + _STD forward<_Tuple>(_Tpl), make_index_sequence>>{}))) /* strengthened */ { + // construct _Ty from the elements of _Tpl + return _STD _Make_from_tuple_impl<_Ty>( + _STD forward<_Tuple>(_Tpl), make_index_sequence>>{}); +} +#endif // _HAS_CXX17 + +template +struct uses_allocator, _Alloc> : true_type {}; // true_type if container allocator enabled + +#if _HAS_CXX23 +template <_Tuple_like _TTuple, _Tuple_like _UTuple, template class _TQual, template class _UQual, + class _Indices = make_index_sequence>> +struct _Tuple_like_common_reference; + +template class _TQual, template class _UQual, + size_t... _Indices> + requires requires { + typename tuple>, + _UQual>>...>; + } +struct _Tuple_like_common_reference<_TTuple, _UTuple, _TQual, _UQual, index_sequence<_Indices...>> { + using type = tuple< + common_reference_t<_TQual>, _UQual>>...>; +}; + +template <_Tuple_like _TTuple, _Tuple_like _UTuple, template class _TQual, template class _UQual> + requires (_Is_specialization_v<_TTuple, tuple> || _Is_specialization_v<_UTuple, tuple>) + && is_same_v<_TTuple, decay_t<_TTuple>> && is_same_v<_UTuple, decay_t<_UTuple>> + && (tuple_size_v<_TTuple> == tuple_size_v<_UTuple>) && requires { + typename _Tuple_like_common_reference<_TTuple, _UTuple, _TQual, _UQual>::type; + } +struct basic_common_reference<_TTuple, _UTuple, _TQual, _UQual> { + using type = _Tuple_like_common_reference<_TTuple, _UTuple, _TQual, _UQual>::type; +}; + +template <_Tuple_like _TTuple, _Tuple_like _UTuple, class _Indices = make_index_sequence>> +struct _Tuple_like_common_type; + +template + requires requires { + typename tuple, tuple_element_t<_Indices, _UTuple>>...>; + } +struct _Tuple_like_common_type<_TTuple, _UTuple, index_sequence<_Indices...>> { + using type = tuple, tuple_element_t<_Indices, _UTuple>>...>; +}; + +template <_Tuple_like _TTuple, _Tuple_like _UTuple> + requires (_Is_specialization_v<_TTuple, tuple> || _Is_specialization_v<_UTuple, tuple>) + && is_same_v<_TTuple, decay_t<_TTuple>> && is_same_v<_UTuple, decay_t<_UTuple>> + && (tuple_size_v<_TTuple> == tuple_size_v<_UTuple>) && requires { + typename _Tuple_like_common_type<_TTuple, _UTuple>::type; + } +struct common_type<_TTuple, _UTuple> { + using type = _Tuple_like_common_type<_TTuple, _UTuple>::type; +}; +#endif // _HAS_CXX23 + +#if _HAS_TR1_NAMESPACE +namespace _DEPRECATE_TR1_NAMESPACE tr1 { + using _STD get; + using _STD ignore; + using _STD make_tuple; + using _STD ref; + using _STD tie; + using _STD tuple; +} // namespace _DEPRECATE_TR1_NAMESPACE tr1 +#endif // _HAS_TR1_NAMESPACE + +_STD_END + +#pragma pop_macro("new") +_STL_RESTORE_CLANG_WARNINGS +#pragma warning(pop) +#pragma pack(pop) +#endif // _STL_COMPILER_PREPROCESSOR +#endif // _TUPLE_ diff --git a/miniMSVC/VC/Tools/MSVC/14.42.34433/include/type_traits b/miniMSVC/VC/Tools/MSVC/14.42.34433/include/type_traits new file mode 100644 index 0000000000000000000000000000000000000000..3f941094cd803306936c2c56f78f4dbbf9f0b08c --- /dev/null +++ b/miniMSVC/VC/Tools/MSVC/14.42.34433/include/type_traits @@ -0,0 +1,2599 @@ +// type_traits standard header (core) + +// Copyright (c) Microsoft Corporation. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +#ifndef _TYPE_TRAITS_ +#define _TYPE_TRAITS_ +#include +#if _STL_COMPILER_PREPROCESSOR +#include +#include +#include + +#pragma pack(push, _CRT_PACKING) +#pragma warning(push, _STL_WARNING_LEVEL) +#pragma warning(disable : _STL_DISABLED_WARNINGS) +_STL_DISABLE_CLANG_WARNINGS +#pragma push_macro("new") +#undef new + +// TRANSITION, non-_Ugly attribute tokens +#pragma push_macro("msvc") +#pragma push_macro("intrinsic") +#pragma push_macro("known_semantics") +#undef msvc +#undef intrinsic +#undef known_semantics + +_STD_BEGIN +template +constexpr bool _Always_false = false; // TRANSITION, needed by CUDA 12.4 in classes; see CWG-2518, VSO-2016422 (EDG) + +template +struct _Conjunction { // handle false trait or last trait + using type = _First; +}; + +template +struct _Conjunction { // the first trait is true, try the next one + using type = typename _Conjunction(_Next::value), _Next, _Rest...>::type; +}; + +_EXPORT_STD template +struct conjunction : true_type {}; // If _Traits is empty, true_type + +template +struct conjunction<_First, _Rest...> : _Conjunction(_First::value), _First, _Rest...>::type { + // the first false trait in _Traits, or the last trait if none are false +}; + +_EXPORT_STD template +constexpr bool conjunction_v = conjunction<_Traits...>::value; + +_EXPORT_STD template +struct negation : bool_constant(_Trait::value)> {}; // The negated result of _Trait + +_EXPORT_STD template +constexpr bool negation_v = negation<_Trait>::value; + +_EXPORT_STD template +constexpr bool is_void_v = is_same_v, void>; + +_EXPORT_STD template +struct is_void : bool_constant> {}; + +_EXPORT_STD template +using void_t = void; + +template +struct _Identity { + using type = _Ty; +}; +template +using _Identity_t _MSVC_KNOWN_SEMANTICS = typename _Identity<_Ty>::type; + +// Type modifiers +_EXPORT_STD template +struct add_const { // add top-level const qualifier + using type = const _Ty; +}; + +_EXPORT_STD template +using add_const_t = typename add_const<_Ty>::type; + +_EXPORT_STD template +struct add_volatile { // add top-level volatile qualifier + using type = volatile _Ty; +}; + +_EXPORT_STD template +using add_volatile_t = typename add_volatile<_Ty>::type; + +_EXPORT_STD template +struct add_cv { // add top-level const and volatile qualifiers + using type = const volatile _Ty; +}; + +_EXPORT_STD template +using add_cv_t = typename add_cv<_Ty>::type; + +template +struct _Add_reference { // add reference (non-referenceable type) + using _Lvalue = _Ty; + using _Rvalue = _Ty; +}; + +template +struct _Add_reference<_Ty, void_t<_Ty&>> { // (referenceable type) + using _Lvalue = _Ty&; + using _Rvalue = _Ty&&; +}; + +_EXPORT_STD template +struct add_lvalue_reference { + using type = typename _Add_reference<_Ty>::_Lvalue; +}; + +_EXPORT_STD template +using add_lvalue_reference_t = typename _Add_reference<_Ty>::_Lvalue; + +_EXPORT_STD template +struct add_rvalue_reference { + using type = typename _Add_reference<_Ty>::_Rvalue; +}; + +_EXPORT_STD template +using add_rvalue_reference_t = typename _Add_reference<_Ty>::_Rvalue; + +_EXPORT_STD template +add_rvalue_reference_t<_Ty> declval() noexcept { + static_assert(false, "Calling declval is ill-formed, see N4950 [declval]/2."); +} + +_EXPORT_STD template +struct remove_extent { // remove array extent + using type = _Ty; +}; + +template +struct remove_extent<_Ty[_Ix]> { + using type = _Ty; +}; + +template +struct remove_extent<_Ty[]> { + using type = _Ty; +}; + +_EXPORT_STD template +using remove_extent_t = typename remove_extent<_Ty>::type; + +_EXPORT_STD template +struct remove_all_extents { // remove all array extents + using type = _Ty; +}; + +template +struct remove_all_extents<_Ty[_Ix]> { + using type = typename remove_all_extents<_Ty>::type; +}; + +template +struct remove_all_extents<_Ty[]> { + using type = typename remove_all_extents<_Ty>::type; +}; + +_EXPORT_STD template +using remove_all_extents_t = typename remove_all_extents<_Ty>::type; + +_EXPORT_STD template +struct remove_pointer { + using type = _Ty; +}; + +template +struct remove_pointer<_Ty*> { + using type = _Ty; +}; + +template +struct remove_pointer<_Ty* const> { + using type = _Ty; +}; + +template +struct remove_pointer<_Ty* volatile> { + using type = _Ty; +}; + +template +struct remove_pointer<_Ty* const volatile> { + using type = _Ty; +}; + +_EXPORT_STD template +using remove_pointer_t = typename remove_pointer<_Ty>::type; + +template +struct _Add_pointer { // add pointer (pointer type cannot be formed) + using type = _Ty; +}; + +template +struct _Add_pointer<_Ty, void_t*>> { // (pointer type can be formed) + using type = remove_reference_t<_Ty>*; +}; + +_EXPORT_STD template +struct add_pointer { + using type = typename _Add_pointer<_Ty>::type; +}; + +_EXPORT_STD template +using add_pointer_t = typename _Add_pointer<_Ty>::type; + +_EXPORT_STD template +constexpr bool is_array_v = false; // determine whether type argument is an array + +template +constexpr bool is_array_v<_Ty[_Nx]> = true; + +template +constexpr bool is_array_v<_Ty[]> = true; + +_EXPORT_STD template +struct is_array : bool_constant> {}; + +#if _HAS_CXX20 +_EXPORT_STD template +constexpr bool is_bounded_array_v = false; + +template +constexpr bool is_bounded_array_v<_Ty[_Nx]> = true; + +_EXPORT_STD template +struct is_bounded_array : bool_constant> {}; + +_EXPORT_STD template +constexpr bool is_unbounded_array_v = false; + +template +constexpr bool is_unbounded_array_v<_Ty[]> = true; + +_EXPORT_STD template +struct is_unbounded_array : bool_constant> {}; +#endif // _HAS_CXX20 + +_EXPORT_STD template +constexpr bool is_lvalue_reference_v = false; // determine whether type argument is an lvalue reference + +template +constexpr bool is_lvalue_reference_v<_Ty&> = true; + +_EXPORT_STD template +struct is_lvalue_reference : bool_constant> {}; + +_EXPORT_STD template +constexpr bool is_rvalue_reference_v = false; // determine whether type argument is an rvalue reference + +template +constexpr bool is_rvalue_reference_v<_Ty&&> = true; + +_EXPORT_STD template +struct is_rvalue_reference : bool_constant> {}; + +_EXPORT_STD template +constexpr bool is_reference_v = false; // determine whether type argument is a reference + +template +constexpr bool is_reference_v<_Ty&> = true; + +template +constexpr bool is_reference_v<_Ty&&> = true; + +_EXPORT_STD template +struct is_reference : bool_constant> {}; + +_EXPORT_STD template +constexpr bool is_pointer_v = false; // determine whether _Ty is a pointer + +template +constexpr bool is_pointer_v<_Ty*> = true; + +template +constexpr bool is_pointer_v<_Ty* const> = true; + +template +constexpr bool is_pointer_v<_Ty* volatile> = true; + +template +constexpr bool is_pointer_v<_Ty* const volatile> = true; + +_EXPORT_STD template +struct is_pointer : bool_constant> {}; + +_EXPORT_STD template +constexpr bool is_null_pointer_v = + is_same_v, nullptr_t>; // determine whether _Ty is cv-qualified nullptr_t + +_EXPORT_STD template +struct is_null_pointer : bool_constant> {}; + +_EXPORT_STD template +struct is_union : bool_constant<__is_union(_Ty)> {}; // determine whether _Ty is a union + +_EXPORT_STD template +constexpr bool is_union_v = __is_union(_Ty); + +_EXPORT_STD template +struct is_class : bool_constant<__is_class(_Ty)> {}; // determine whether _Ty is a class + +_EXPORT_STD template +constexpr bool is_class_v = __is_class(_Ty); + +_EXPORT_STD template +constexpr bool is_fundamental_v = is_arithmetic_v<_Ty> || is_void_v<_Ty> || is_null_pointer_v<_Ty>; + +_EXPORT_STD template +struct is_fundamental : bool_constant> {}; // determine whether _Ty is a fundamental type + +_EXPORT_STD template +struct is_convertible : bool_constant<__is_convertible_to(_From, _To)> { + // determine whether _From is convertible to _To +}; + +_EXPORT_STD template +constexpr bool is_convertible_v = __is_convertible_to(_From, _To); + +#if !defined(__clang__) && !defined(__EDG__) // TRANSITION, DevCom-1627396 +template +struct is_convertible<_Ty&, volatile _Ty&> : true_type {}; + +template +struct is_convertible : true_type {}; + +template +struct is_convertible<_Ty&, const volatile _Ty&> : true_type {}; + +template +struct is_convertible : true_type {}; + +template +constexpr bool is_convertible_v<_Ty&, volatile _Ty&> = true; + +template +constexpr bool is_convertible_v = true; + +template +constexpr bool is_convertible_v<_Ty&, const volatile _Ty&> = true; + +template +constexpr bool is_convertible_v = true; +#endif // ^^^ workaround ^^^ + +_EXPORT_STD template +struct is_enum : bool_constant<__is_enum(_Ty)> {}; // determine whether _Ty is an enumerated type + +_EXPORT_STD template +constexpr bool is_enum_v = __is_enum(_Ty); + +#if _HAS_CXX23 +_EXPORT_STD template +constexpr bool is_scoped_enum_v = conjunction_v, negation>>; + +_EXPORT_STD template +struct is_scoped_enum : bool_constant> {}; +#endif // _HAS_CXX23 + +_EXPORT_STD template +struct is_compound : bool_constant> {}; // determine whether _Ty is a compound type + +_EXPORT_STD template +constexpr bool is_compound_v = !is_fundamental_v<_Ty>; + +#define _EMIT_CDECL(FUNC, OPT1, OPT2, OPT3) FUNC(__cdecl, OPT1, OPT2, OPT3) + +#ifdef _M_CEE +#define _EMIT_CLRCALL(FUNC, OPT1, OPT2, OPT3) FUNC(__clrcall, OPT1, OPT2, OPT3) +#else // ^^^ __clrcall supported / __clrcall not supported vvv +#define _EMIT_CLRCALL(FUNC, OPT1, OPT2, OPT3) +#endif // ^^^ __clrcall not supported ^^^ + +#if defined(_M_IX86) && !defined(_M_CEE) +#define _EMIT_FASTCALL(FUNC, OPT1, OPT2, OPT3) FUNC(__fastcall, OPT1, OPT2, OPT3) +#else // ^^^ __fastcall supported / __fastcall not supported vvv +#define _EMIT_FASTCALL(FUNC, OPT1, OPT2, OPT3) +#endif // ^^^ __fastcall not supported ^^^ + +#ifdef _M_IX86 +#define _EMIT_STDCALL(FUNC, OPT1, OPT2, OPT3) FUNC(__stdcall, OPT1, OPT2, OPT3) +#define _EMIT_THISCALL(FUNC, OPT1, OPT2, OPT3) FUNC(__thiscall, OPT1, OPT2, OPT3) +#else // ^^^ __stdcall and __thiscall supported / __stdcall and __thiscall not supported vvv +#define _EMIT_STDCALL(FUNC, OPT1, OPT2, OPT3) +#define _EMIT_THISCALL(FUNC, OPT1, OPT2, OPT3) +#endif // ^^^ __stdcall and __thiscall not supported ^^^ + +#if ((defined(_M_IX86) && _M_IX86_FP >= 2) || (defined(_M_X64) && !defined(_M_ARM64EC))) && !defined(_M_CEE) +#define _EMIT_VECTORCALL(FUNC, OPT1, OPT2, OPT3) FUNC(__vectorcall, OPT1, OPT2, OPT3) +#else // ^^^ __vectorcall supported / __vectorcall not supported vvv +#define _EMIT_VECTORCALL(FUNC, OPT1, OPT2, OPT3) +#endif // ^^^ __vectorcall not supported ^^^ + +#define _NON_MEMBER_CALL(FUNC, CV_OPT, REF_OPT, NOEXCEPT_OPT) \ + _EMIT_CDECL(FUNC, CV_OPT, REF_OPT, NOEXCEPT_OPT) \ + _EMIT_CLRCALL(FUNC, CV_OPT, REF_OPT, NOEXCEPT_OPT) \ + _EMIT_FASTCALL(FUNC, CV_OPT, REF_OPT, NOEXCEPT_OPT) \ + _EMIT_STDCALL(FUNC, CV_OPT, REF_OPT, NOEXCEPT_OPT) \ + _EMIT_VECTORCALL(FUNC, CV_OPT, REF_OPT, NOEXCEPT_OPT) + +#define _NON_MEMBER_CALL_CV(FUNC, REF_OPT, NOEXCEPT_OPT) \ + _NON_MEMBER_CALL(FUNC, , REF_OPT, NOEXCEPT_OPT) \ + _NON_MEMBER_CALL(FUNC, const, REF_OPT, NOEXCEPT_OPT) \ + _NON_MEMBER_CALL(FUNC, volatile, REF_OPT, NOEXCEPT_OPT) \ + _NON_MEMBER_CALL(FUNC, const volatile, REF_OPT, NOEXCEPT_OPT) + +#define _NON_MEMBER_CALL_CV_REF(FUNC, NOEXCEPT_OPT) \ + _NON_MEMBER_CALL_CV(FUNC, , NOEXCEPT_OPT) \ + _NON_MEMBER_CALL_CV(FUNC, &, NOEXCEPT_OPT) \ + _NON_MEMBER_CALL_CV(FUNC, &&, NOEXCEPT_OPT) + +#ifdef __cpp_noexcept_function_type +#define _NON_MEMBER_CALL_CV_REF_NOEXCEPT(FUNC) \ + _NON_MEMBER_CALL_CV_REF(FUNC, ) \ + _NON_MEMBER_CALL_CV_REF(FUNC, noexcept) +#else // ^^^ defined(__cpp_noexcept_function_type) / !defined(__cpp_noexcept_function_type) vvv +#define _NON_MEMBER_CALL_CV_REF_NOEXCEPT(FUNC) _NON_MEMBER_CALL_CV_REF(FUNC, ) +#endif // ^^^ !defined(__cpp_noexcept_function_type) ^^^ + +#define _MEMBER_CALL(FUNC, CV_OPT, REF_OPT, NOEXCEPT_OPT) \ + _EMIT_CDECL(FUNC, CV_OPT, REF_OPT, NOEXCEPT_OPT) \ + _EMIT_CLRCALL(FUNC, CV_OPT, REF_OPT, NOEXCEPT_OPT) \ + _EMIT_FASTCALL(FUNC, CV_OPT, REF_OPT, NOEXCEPT_OPT) \ + _EMIT_STDCALL(FUNC, CV_OPT, REF_OPT, NOEXCEPT_OPT) \ + _EMIT_THISCALL(FUNC, CV_OPT, REF_OPT, NOEXCEPT_OPT) \ + _EMIT_VECTORCALL(FUNC, CV_OPT, REF_OPT, NOEXCEPT_OPT) + +#define _MEMBER_CALL_CV(FUNC, REF_OPT, NOEXCEPT_OPT) \ + _MEMBER_CALL(FUNC, , REF_OPT, NOEXCEPT_OPT) \ + _MEMBER_CALL(FUNC, const, REF_OPT, NOEXCEPT_OPT) \ + _MEMBER_CALL(FUNC, volatile, REF_OPT, NOEXCEPT_OPT) \ + _MEMBER_CALL(FUNC, const volatile, REF_OPT, NOEXCEPT_OPT) + +#define _MEMBER_CALL_CV_REF(FUNC, NOEXCEPT_OPT) \ + _MEMBER_CALL_CV(FUNC, , NOEXCEPT_OPT) \ + _MEMBER_CALL_CV(FUNC, &, NOEXCEPT_OPT) \ + _MEMBER_CALL_CV(FUNC, &&, NOEXCEPT_OPT) + +#ifdef __cpp_noexcept_function_type +#define _MEMBER_CALL_CV_REF_NOEXCEPT(FUNC) \ + _MEMBER_CALL_CV_REF(FUNC, ) \ + _MEMBER_CALL_CV_REF(FUNC, noexcept) +#else // ^^^ defined(__cpp_noexcept_function_type) / !defined(__cpp_noexcept_function_type) vvv +#define _MEMBER_CALL_CV_REF_NOEXCEPT(FUNC) _MEMBER_CALL_CV_REF(FUNC, ) +#endif // ^^^ !defined(__cpp_noexcept_function_type) ^^^ + +#ifdef __cpp_noexcept_function_type +#define _CLASS_DEFINE_CV_REF_NOEXCEPT(CLASS) \ + CLASS(_EMPTY_ARGUMENT) \ + CLASS(const) \ + CLASS(volatile) \ + CLASS(const volatile) \ + CLASS(&) \ + CLASS(const&) \ + CLASS(volatile&) \ + CLASS(const volatile&) \ + CLASS(&&) \ + CLASS(const&&) \ + CLASS(volatile&&) \ + CLASS(const volatile&&) \ + CLASS(noexcept) \ + CLASS(const noexcept) \ + CLASS(volatile noexcept) \ + CLASS(const volatile noexcept) \ + CLASS(& noexcept) \ + CLASS(const& noexcept) \ + CLASS(volatile& noexcept) \ + CLASS(const volatile& noexcept) \ + CLASS(&& noexcept) \ + CLASS(const&& noexcept) \ + CLASS(volatile&& noexcept) \ + CLASS(const volatile&& noexcept) +#else // ^^^ defined(__cpp_noexcept_function_type) / !defined(__cpp_noexcept_function_type) vvv +#define _CLASS_DEFINE_CV_REF_NOEXCEPT(CLASS) \ + CLASS(_EMPTY_ARGUMENT) \ + CLASS(const) \ + CLASS(volatile) \ + CLASS(const volatile) \ + CLASS(&) \ + CLASS(const&) \ + CLASS(volatile&) \ + CLASS(const volatile&) \ + CLASS(&&) \ + CLASS(const&&) \ + CLASS(volatile&&) \ + CLASS(const volatile&&) +#endif // ^^^ !defined(__cpp_noexcept_function_type) ^^^ + +template +struct _Arg_types {}; // provide argument_type, etc. when sizeof...(_Types) is 1 or 2 + +template +struct _Arg_types<_Ty1> { + using _ARGUMENT_TYPE_NAME _CXX17_DEPRECATE_ADAPTOR_TYPEDEFS = _Ty1; +}; + +template +struct _Arg_types<_Ty1, _Ty2> { + using _FIRST_ARGUMENT_TYPE_NAME _CXX17_DEPRECATE_ADAPTOR_TYPEDEFS = _Ty1; + using _SECOND_ARGUMENT_TYPE_NAME _CXX17_DEPRECATE_ADAPTOR_TYPEDEFS = _Ty2; +}; + +template +struct _Is_memfunptr { // base class for member function pointer predicates + using _Bool_type = false_type; // NB: members are user-visible via _Weak_types +}; + +#define _IS_MEMFUNPTR(CALL_OPT, CV_OPT, REF_OPT, NOEXCEPT_OPT) \ + template \ + struct _Is_memfunptr<_Ret (CALL_OPT _Arg0::*)(_Types...) CV_OPT REF_OPT NOEXCEPT_OPT> \ + : _Arg_types { \ + using _Bool_type = true_type; \ + using _RESULT_TYPE_NAME _CXX17_DEPRECATE_ADAPTOR_TYPEDEFS = _Ret; \ + using _Class_type = _Arg0; \ + using _Guide_type = enable_if, _Ret(_Types...)>; \ + }; + +_MEMBER_CALL_CV_REF_NOEXCEPT(_IS_MEMFUNPTR) +#undef _IS_MEMFUNPTR + +#define _IS_MEMFUNPTR_ELLIPSIS(CV_REF_NOEXCEPT_OPT) \ + template \ + struct _Is_memfunptr<_Ret (_Arg0::*)(_Types..., ...) \ + CV_REF_NOEXCEPT_OPT> { /* no calling conventions for ellipsis */ \ + using _Bool_type = true_type; \ + using _RESULT_TYPE_NAME _CXX17_DEPRECATE_ADAPTOR_TYPEDEFS = _Ret; \ + using _Class_type = _Arg0; \ + using _Guide_type = enable_if; \ + }; + +_CLASS_DEFINE_CV_REF_NOEXCEPT(_IS_MEMFUNPTR_ELLIPSIS) +#undef _IS_MEMFUNPTR_ELLIPSIS + +#if _HAS_CXX23 && !defined(__clang__) // TRANSITION, DevCom-10107077, Clang has not implemented Deducing this +#define _IS_MEMFUNPTR_EXPLICIT_THIS_GUIDES(CALL_OPT, CV_OPT, REF_OPT, NOEXCEPT_OPT) \ + template \ + struct _Is_memfunptr<_Ret(CALL_OPT*)(_Self, _Args...) NOEXCEPT_OPT> { \ + using _Bool_type = false_type; \ + using _Guide_type = _Identity<_Ret(_Args...)>; \ + }; + +_NON_MEMBER_CALL(_IS_MEMFUNPTR_EXPLICIT_THIS_GUIDES, , , ) +#ifdef __cpp_noexcept_function_type +_NON_MEMBER_CALL(_IS_MEMFUNPTR_EXPLICIT_THIS_GUIDES, , , noexcept) +#endif // defined(__cpp_noexcept_function_type) + +#undef _IS_MEMFUNPTR_EXPLICIT_THIS_GUIDES +#endif // _HAS_CXX23 && !defined(__clang__) + +#ifdef __clang__ +_EXPORT_STD template +constexpr bool is_member_function_pointer_v = __is_member_function_pointer(_Ty); +#else // ^^^ Clang / Other vvv +_EXPORT_STD template +constexpr bool is_member_function_pointer_v = _Is_memfunptr>::_Bool_type::value; +#endif // ^^^ Other ^^^ + +_EXPORT_STD template +struct is_member_function_pointer : bool_constant> {}; + +_EXPORT_STD template +constexpr bool is_const_v = false; // determine whether type argument is const qualified + +template +constexpr bool is_const_v = true; + +_EXPORT_STD template +struct is_const : bool_constant> {}; + +_EXPORT_STD template +constexpr bool is_volatile_v = false; // determine whether type argument is volatile qualified + +template +constexpr bool is_volatile_v = true; + +_EXPORT_STD template +struct is_volatile : bool_constant> {}; + +_EXPORT_STD template +constexpr bool is_function_v = // only function types and reference types can't be const qualified + !is_const_v && !is_reference_v<_Ty>; + +_EXPORT_STD template +struct is_function : bool_constant> {}; + +_EXPORT_STD template +constexpr bool is_object_v = // only function types and reference types can't be const qualified + is_const_v && !is_void_v<_Ty>; + +_EXPORT_STD template +struct is_object : bool_constant> {}; + +template +struct _Is_member_object_pointer { + static constexpr bool value = false; +}; + +template +struct _Is_member_object_pointer<_Ty1 _Ty2::*> { + static constexpr bool value = !is_function_v<_Ty1>; + using _Class_type = _Ty2; +}; + +#ifdef __clang__ +_EXPORT_STD template +constexpr bool is_member_object_pointer_v = __is_member_object_pointer(_Ty); +#else // ^^^ Clang / Other vvv +_EXPORT_STD template +constexpr bool is_member_object_pointer_v = _Is_member_object_pointer>::value; +#endif // ^^^ Other ^^^ + +_EXPORT_STD template +struct is_member_object_pointer : bool_constant> {}; + +#ifdef __clang__ +_EXPORT_STD template +constexpr bool is_member_pointer_v = __is_member_pointer(_Ty); +#else // ^^^ Clang / Other vvv +_EXPORT_STD template +constexpr bool is_member_pointer_v = is_member_object_pointer_v<_Ty> || is_member_function_pointer_v<_Ty>; +#endif // ^^^ Other ^^^ + +_EXPORT_STD template +struct is_member_pointer : bool_constant> {}; // determine whether _Ty is a pointer to member + +_EXPORT_STD template +constexpr bool is_scalar_v = // determine whether _Ty is a scalar type + is_arithmetic_v<_Ty> || is_enum_v<_Ty> || is_pointer_v<_Ty> || is_member_pointer_v<_Ty> || is_null_pointer_v<_Ty>; + +_EXPORT_STD template +struct is_scalar : bool_constant> {}; + +_EXPORT_STD template +struct _CXX20_DEPRECATE_IS_POD is_pod : bool_constant<__is_pod(_Ty)> {}; // determine whether _Ty is a POD type + +_EXPORT_STD template +_CXX20_DEPRECATE_IS_POD constexpr bool is_pod_v = __is_pod(_Ty); + +_EXPORT_STD template +struct is_empty : bool_constant<__is_empty(_Ty)> {}; // determine whether _Ty is an empty class + +_EXPORT_STD template +constexpr bool is_empty_v = __is_empty(_Ty); + +_EXPORT_STD template +struct is_polymorphic : bool_constant<__is_polymorphic(_Ty)> {}; // determine whether _Ty is a polymorphic type + +_EXPORT_STD template +constexpr bool is_polymorphic_v = __is_polymorphic(_Ty); + +_EXPORT_STD template +struct is_abstract : bool_constant<__is_abstract(_Ty)> {}; // determine whether _Ty is an abstract class + +_EXPORT_STD template +constexpr bool is_abstract_v = __is_abstract(_Ty); + +_EXPORT_STD template +struct is_final : bool_constant<__is_final(_Ty)> {}; // determine whether _Ty is a final class + +_EXPORT_STD template +constexpr bool is_final_v = __is_final(_Ty); + +_EXPORT_STD template +struct is_standard_layout : bool_constant<__is_standard_layout(_Ty)> {}; // determine whether _Ty is standard layout + +_EXPORT_STD template +constexpr bool is_standard_layout_v = __is_standard_layout(_Ty); + +#if _HAS_DEPRECATED_IS_LITERAL_TYPE +_EXPORT_STD template +struct _CXX17_DEPRECATE_IS_LITERAL_TYPE is_literal_type : bool_constant<__is_literal_type(_Ty)> { + // determine whether _Ty is a literal type +}; + +_EXPORT_STD template +_CXX17_DEPRECATE_IS_LITERAL_TYPE constexpr bool is_literal_type_v = __is_literal_type(_Ty); +#endif // _HAS_DEPRECATED_IS_LITERAL_TYPE + +_EXPORT_STD template +struct is_trivial : bool_constant<__is_trivial(_Ty)> {}; // determine whether _Ty is a trivial type + +_EXPORT_STD template +constexpr bool is_trivial_v = __is_trivial(_Ty); + +_EXPORT_STD template +struct is_trivially_copyable : bool_constant<__is_trivially_copyable(_Ty)> { + // determine whether _Ty is a trivially copyable type +}; + +_EXPORT_STD template +constexpr bool is_trivially_copyable_v = __is_trivially_copyable(_Ty); + +_EXPORT_STD template +struct has_virtual_destructor : bool_constant<__has_virtual_destructor(_Ty)> { + // determine whether _Ty has a virtual destructor +}; + +_EXPORT_STD template +constexpr bool has_virtual_destructor_v = __has_virtual_destructor(_Ty); + +#if _HAS_CXX17 +_EXPORT_STD template +struct has_unique_object_representations : bool_constant<__has_unique_object_representations(_Ty)> { + // determine whether _Ty has unique object representations +}; + +_EXPORT_STD template +constexpr bool has_unique_object_representations_v = __has_unique_object_representations(_Ty); + +#ifdef __EDG__ // TRANSITION, VSO-1690654 +template +struct _Is_aggregate_impl : bool_constant<__is_aggregate(_Ty)> {}; + +_EXPORT_STD template +constexpr bool is_aggregate_v = disjunction_v, _Is_aggregate_impl<_Ty>>; + +_EXPORT_STD template +struct is_aggregate : bool_constant> {}; +#else // ^^^ workaround / no workaround vvv +_EXPORT_STD template +struct is_aggregate : bool_constant<__is_aggregate(_Ty)> {}; + +_EXPORT_STD template +constexpr bool is_aggregate_v = __is_aggregate(_Ty); +#endif // ^^^ no workaround ^^^ +#endif // _HAS_CXX17 + +_EXPORT_STD template +struct is_constructible : bool_constant<__is_constructible(_Ty, _Args...)> { + // determine whether _Ty can be direct-initialized with _Args... +}; + +_EXPORT_STD template +constexpr bool is_constructible_v = __is_constructible(_Ty, _Args...); + +_EXPORT_STD template +struct is_copy_constructible : bool_constant<__is_constructible(_Ty, add_lvalue_reference_t)> { + // determine whether _Ty can be direct-initialized with an lvalue const _Ty +}; + +_EXPORT_STD template +constexpr bool is_copy_constructible_v = __is_constructible(_Ty, add_lvalue_reference_t); + +_EXPORT_STD template +struct is_default_constructible : bool_constant<__is_constructible(_Ty)> { + // determine whether _Ty can be value-initialized +}; + +_EXPORT_STD template +constexpr bool is_default_constructible_v = __is_constructible(_Ty); + +template +struct _Is_implicitly_default_constructible : false_type { + // determine whether _Ty can be copy-initialized with {} +}; + +template +void _Implicitly_default_construct(const _Ty&); + +template +struct _Is_implicitly_default_constructible<_Ty, void_t({}))>> : true_type { +}; + +_EXPORT_STD template +struct is_move_constructible : bool_constant<__is_constructible(_Ty, _Ty)> { + // determine whether _Ty can be direct-initialized from an rvalue _Ty +}; + +_EXPORT_STD template +constexpr bool is_move_constructible_v = __is_constructible(_Ty, _Ty); + +_EXPORT_STD template +struct is_assignable : bool_constant<__is_assignable(_To, _From)> {}; // determine whether _From can be assigned to _To + +_EXPORT_STD template +constexpr bool is_assignable_v = __is_assignable(_To, _From); + +#if defined(_IS_ASSIGNABLE_NOCHECK_SUPPORTED) && !defined(__CUDACC__) +template +struct _Is_assignable_no_precondition_check : bool_constant<__is_assignable_no_precondition_check(_To, _From)> {}; +#else // ^^^ Use intrinsic / intrinsic not supported vvv +template +using _Is_assignable_no_precondition_check = is_assignable<_To, _From>; +#endif // ^^^ intrinsic not supported ^^^ + +_EXPORT_STD template +struct is_copy_assignable + : bool_constant<__is_assignable(add_lvalue_reference_t<_Ty>, add_lvalue_reference_t)> { + // determine whether an lvalue const _Ty can be assigned to an lvalue _Ty +}; + +_EXPORT_STD template +constexpr bool is_copy_assignable_v = __is_assignable(add_lvalue_reference_t<_Ty>, add_lvalue_reference_t); + +#if defined(_IS_ASSIGNABLE_NOCHECK_SUPPORTED) && !defined(__CUDACC__) +template +struct _Is_copy_assignable_no_precondition_check + : bool_constant<__is_assignable_no_precondition_check( + add_lvalue_reference_t<_Ty>, add_lvalue_reference_t)> {}; + +template +constexpr bool _Is_copy_assignable_unchecked_v = + __is_assignable_no_precondition_check(add_lvalue_reference_t<_Ty>, add_lvalue_reference_t); +#else // ^^^ Use intrinsic / intrinsic not supported vvv +template +using _Is_copy_assignable_no_precondition_check = is_copy_assignable<_Ty>; + +template +constexpr bool _Is_copy_assignable_unchecked_v = is_copy_assignable_v<_Ty>; +#endif // ^^^ intrinsic not supported ^^^ + +_EXPORT_STD template +struct is_move_assignable : bool_constant<__is_assignable(add_lvalue_reference_t<_Ty>, _Ty)> { + // determine whether an rvalue _Ty can be assigned to an lvalue _Ty +}; + +_EXPORT_STD template +constexpr bool is_move_assignable_v = __is_assignable(add_lvalue_reference_t<_Ty>, _Ty); + +#if defined(_IS_ASSIGNABLE_NOCHECK_SUPPORTED) && !defined(__CUDACC__) +template +struct _Is_move_assignable_no_precondition_check + : bool_constant<__is_assignable_no_precondition_check(add_lvalue_reference_t<_Ty>, _Ty)> {}; + +template +constexpr bool _Is_move_assignable_unchecked_v = + __is_assignable_no_precondition_check(add_lvalue_reference_t<_Ty>, _Ty); +#else // ^^^ Use intrinsic / intrinsic not supported vvv +template +using _Is_move_assignable_no_precondition_check = is_move_assignable<_Ty>; + +template +constexpr bool _Is_move_assignable_unchecked_v = is_move_assignable_v<_Ty>; +#endif // ^^^ intrinsic not supported ^^^ + +_EXPORT_STD template +struct is_destructible : bool_constant<__is_destructible(_Ty)> { + // true iff remove_all_extents_t<_Ty> is a reference type, or can be explicitly destroyed +}; + +_EXPORT_STD template +constexpr bool is_destructible_v = __is_destructible(_Ty); + +_EXPORT_STD template +struct is_trivially_constructible : bool_constant<__is_trivially_constructible(_Ty, _Args...)> { + // determine whether direct-initialization of _Ty with _Args... is trivial +}; + +_EXPORT_STD template +constexpr bool is_trivially_constructible_v = __is_trivially_constructible(_Ty, _Args...); + +_EXPORT_STD template +struct is_trivially_copy_constructible + : bool_constant<__is_trivially_constructible(_Ty, add_lvalue_reference_t)> { + // determine whether direct-initialization of _Ty with an lvalue const _Ty is trivial +}; + +_EXPORT_STD template +constexpr bool is_trivially_copy_constructible_v = __is_trivially_constructible(_Ty, add_lvalue_reference_t); + +_EXPORT_STD template +struct is_trivially_default_constructible : bool_constant<__is_trivially_constructible(_Ty)> { + // determine whether value-initialization of _Ty is trivial +}; + +_EXPORT_STD template +constexpr bool is_trivially_default_constructible_v = __is_trivially_constructible(_Ty); + +_EXPORT_STD template +struct is_trivially_move_constructible : bool_constant<__is_trivially_constructible(_Ty, _Ty)> { + // determine whether direct-initialization of _Ty with an rvalue _Ty is trivial +}; + +_EXPORT_STD template +constexpr bool is_trivially_move_constructible_v = __is_trivially_constructible(_Ty, _Ty); + +_EXPORT_STD template +struct is_trivially_assignable : bool_constant<__is_trivially_assignable(_To, _From)> { + // determine whether _From can be trivially assigned to _To +}; + +_EXPORT_STD template +constexpr bool is_trivially_assignable_v = __is_trivially_assignable(_To, _From); + +_EXPORT_STD template +struct is_trivially_copy_assignable + : bool_constant<__is_trivially_assignable(add_lvalue_reference_t<_Ty>, add_lvalue_reference_t)> { + // determine whether an lvalue const _Ty can be trivially assigned to an lvalue _Ty +}; + +_EXPORT_STD template +constexpr bool is_trivially_copy_assignable_v = + __is_trivially_assignable(add_lvalue_reference_t<_Ty>, add_lvalue_reference_t); + +_EXPORT_STD template +struct is_trivially_move_assignable : bool_constant<__is_trivially_assignable(add_lvalue_reference_t<_Ty>, _Ty)> { + // determine whether an rvalue _Ty can be trivially assigned to an lvalue _Ty +}; + +_EXPORT_STD template +constexpr bool is_trivially_move_assignable_v = __is_trivially_assignable(add_lvalue_reference_t<_Ty>, _Ty); + +_EXPORT_STD template +struct is_trivially_destructible : bool_constant<__is_trivially_destructible(_Ty)> { + // determine whether remove_all_extents_t<_Ty> is a reference type or can trivially be explicitly destroyed +}; + +_EXPORT_STD template +constexpr bool is_trivially_destructible_v = __is_trivially_destructible(_Ty); + +_EXPORT_STD template +struct is_nothrow_constructible : bool_constant<__is_nothrow_constructible(_Ty, _Args...)> { + // determine whether direct-initialization of _Ty from _Args... is both valid and not potentially-throwing +}; + +_EXPORT_STD template +constexpr bool is_nothrow_constructible_v = __is_nothrow_constructible(_Ty, _Args...); + +_EXPORT_STD template +struct is_nothrow_copy_constructible + : bool_constant<__is_nothrow_constructible(_Ty, add_lvalue_reference_t)> { + // determine whether direct-initialization of _Ty from an lvalue const _Ty is both valid + // and not potentially-throwing +}; + +_EXPORT_STD template +constexpr bool is_nothrow_copy_constructible_v = __is_nothrow_constructible(_Ty, add_lvalue_reference_t); + +_EXPORT_STD template +struct is_nothrow_default_constructible : bool_constant<__is_nothrow_constructible(_Ty)> { + // determine whether value-initialization of _Ty is both valid and not potentially-throwing +}; + +_EXPORT_STD template +constexpr bool is_nothrow_default_constructible_v = __is_nothrow_constructible(_Ty); + +_EXPORT_STD template +struct is_nothrow_move_constructible : bool_constant<__is_nothrow_constructible(_Ty, _Ty)> { + // determine whether direct-initialization of _Ty from an rvalue _Ty is both valid and not potentially-throwing +}; + +_EXPORT_STD template +constexpr bool is_nothrow_move_constructible_v = __is_nothrow_constructible(_Ty, _Ty); + +_EXPORT_STD template +struct is_nothrow_assignable : bool_constant<__is_nothrow_assignable(_To, _From)> { + // determine whether assignment of _From to _To is both valid and not potentially-throwing +}; + +_EXPORT_STD template +constexpr bool is_nothrow_assignable_v = __is_nothrow_assignable(_To, _From); + +_EXPORT_STD template +struct is_nothrow_copy_assignable + : bool_constant<__is_nothrow_assignable(add_lvalue_reference_t<_Ty>, add_lvalue_reference_t)> { + // determine whether assignment of an lvalue const _Ty to an lvalue _Ty is both valid and not potentially-throwing +}; + +_EXPORT_STD template +constexpr bool is_nothrow_copy_assignable_v = + __is_nothrow_assignable(add_lvalue_reference_t<_Ty>, add_lvalue_reference_t); + +_EXPORT_STD template +struct is_nothrow_move_assignable : bool_constant<__is_nothrow_assignable(add_lvalue_reference_t<_Ty>, _Ty)> { + // determine whether assignment of an rvalue _Ty to an lvalue _Ty is both valid and not potentially-throwing +}; + +_EXPORT_STD template +constexpr bool is_nothrow_move_assignable_v = __is_nothrow_assignable(add_lvalue_reference_t<_Ty>, _Ty); + +_EXPORT_STD template +struct is_nothrow_destructible : bool_constant<__is_nothrow_destructible(_Ty)> { + // determine whether remove_all_extents_t<_Ty> is a reference type or has + // non-potentially-throwing explicit destruction +}; + +_EXPORT_STD template +constexpr bool is_nothrow_destructible_v = __is_nothrow_destructible(_Ty); + +template > +struct _Sign_base { // determine whether integral type _Ty is signed or unsigned + using _Uty = remove_cv_t<_Ty>; + + static constexpr bool _Signed = static_cast<_Uty>(-1) < static_cast<_Uty>(0); + static constexpr bool _Unsigned = !_Signed; +}; + +template +struct _Sign_base<_Ty, false> { // floating-point _Ty is signed + // non-arithmetic _Ty is neither signed nor unsigned + static constexpr bool _Signed = is_floating_point_v<_Ty>; + static constexpr bool _Unsigned = false; +}; + +_EXPORT_STD template +struct is_signed : bool_constant<_Sign_base<_Ty>::_Signed> {}; // determine whether _Ty is a signed type + +_EXPORT_STD template +constexpr bool is_signed_v = _Sign_base<_Ty>::_Signed; + +_EXPORT_STD template +struct is_unsigned : bool_constant<_Sign_base<_Ty>::_Unsigned> {}; // determine whether _Ty is an unsigned type + +_EXPORT_STD template +constexpr bool is_unsigned_v = _Sign_base<_Ty>::_Unsigned; + +template +constexpr bool _Is_nonbool_integral = is_integral_v<_Ty> && !is_same_v, bool>; + +template +struct _Select { // Select between aliases that extract either their first or second parameter + template + using _Apply = _Ty1; +}; + +template <> +struct _Select { + template + using _Apply = _Ty2; +}; + +template +struct _Make_signed2; // Choose make_signed strategy by type size + +template <> +struct _Make_signed2<1> { + template + using _Apply = signed char; +}; + +template <> +struct _Make_signed2<2> { + template + using _Apply = short; +}; + +template <> +struct _Make_signed2<4> { + template + using _Apply = // assumes LLP64 + typename _Select || is_same_v<_Ty, unsigned long>>::template _Apply; +}; + +template <> +struct _Make_signed2<8> { + template + using _Apply = long long; +}; + +template +using _Make_signed1 = // signed partner to cv-unqualified _Ty + typename _Make_signed2::template _Apply<_Ty>; + +_EXPORT_STD template +struct make_signed { // signed partner to _Ty + static_assert(_Is_nonbool_integral<_Ty> || is_enum_v<_Ty>, + "make_signed requires that T shall be a (possibly cv-qualified) " + "integral type or enumeration but not a bool type."); + + using type = typename remove_cv<_Ty>::template _Apply<_Make_signed1>; +}; + +_EXPORT_STD template +using make_signed_t = typename make_signed<_Ty>::type; + +template +struct _Make_unsigned2; // Choose make_unsigned strategy by type size + +template <> +struct _Make_unsigned2<1> { + template + using _Apply = unsigned char; +}; + +template <> +struct _Make_unsigned2<2> { + template + using _Apply = unsigned short; +}; + +template <> +struct _Make_unsigned2<4> { + template + using _Apply = // assumes LLP64 + typename _Select || is_same_v<_Ty, unsigned long>>::template _Apply; +}; + +template <> +struct _Make_unsigned2<8> { + template + using _Apply = unsigned long long; +}; + +template +using _Make_unsigned1 = // unsigned partner to cv-unqualified _Ty + typename _Make_unsigned2::template _Apply<_Ty>; + +_EXPORT_STD template +struct make_unsigned { // unsigned partner to _Ty + static_assert(_Is_nonbool_integral<_Ty> || is_enum_v<_Ty>, + "make_unsigned requires that T shall be a (possibly cv-qualified) " + "integral type or enumeration but not a bool type."); + + using type = typename remove_cv<_Ty>::template _Apply<_Make_unsigned1>; +}; + +_EXPORT_STD template +using make_unsigned_t = typename make_unsigned<_Ty>::type; + +template +constexpr make_unsigned_t<_Rep> _Unsigned_value(_Rep _Val) { // makes _Val unsigned + return static_cast>(_Val); +} + +_EXPORT_STD template +struct alignment_of : integral_constant {}; // determine alignment of _Ty + +_EXPORT_STD template +constexpr size_t alignment_of_v = alignof(_Ty); + +template +union _Align_type { // union with size _Len bytes and alignment of _Ty + _Ty _Val; + char _Pad[_Len]; +}; + +template +struct _Aligned; // define type with size _Len and alignment _Ty + +template +struct _Aligned<_Len, _Align, _Ty, true> { + using type = _Align_type<_Ty, _Len>; +}; + +template +struct _Aligned<_Len, _Align, double, false> { +#ifdef _ENABLE_EXTENDED_ALIGNED_STORAGE + struct type { + alignas(_Align) char _Space[_Len]; + }; +#else // ^^^ defined(_ENABLE_EXTENDED_ALIGNED_STORAGE) / !defined(_ENABLE_EXTENDED_ALIGNED_STORAGE) vvv +#ifndef _DISABLE_EXTENDED_ALIGNED_STORAGE + static_assert(_Always_false<_Aligned>, + "You've instantiated std::aligned_storage with an extended alignment (in other " + "words, Align > alignof(max_align_t)). Before VS 2017 15.8, the member \"type\" would " + "non-conformingly have an alignment of only alignof(max_align_t). VS 2017 15.8 was fixed to " + "handle this correctly, but the fix inherently changes layout and breaks binary compatibility " + "(*only* for uses of aligned_storage with extended alignments). " + "To suppress this error, please define either " + "(1) _ENABLE_EXTENDED_ALIGNED_STORAGE to confirm that you want a type with an extended alignment, or " + "(2) _DISABLE_EXTENDED_ALIGNED_STORAGE to get the old non-conforming behavior."); +#endif // ^^^ !defined(_DISABLE_EXTENDED_ALIGNED_STORAGE) ^^^ + using type = _Align_type; +#endif // ^^^ !defined(_ENABLE_EXTENDED_ALIGNED_STORAGE) ^^^ +}; + +template +struct _Aligned<_Len, _Align, int, false> { + using _Next = double; + static constexpr bool _Fits = _Align <= alignof(_Next); + using type = typename _Aligned<_Len, _Align, _Next, _Fits>::type; +}; + +template +struct _Aligned<_Len, _Align, short, false> { + using _Next = int; + static constexpr bool _Fits = _Align <= alignof(_Next); + using type = typename _Aligned<_Len, _Align, _Next, _Fits>::type; +}; + +template +struct _Aligned<_Len, _Align, char, false> { + using _Next = short; + static constexpr bool _Fits = _Align <= alignof(_Next); + using type = typename _Aligned<_Len, _Align, _Next, _Fits>::type; +}; + +// TRANSITION, ABI: Internal non-deprecated version to avoid ABI changes due to deprecation +template +struct _Aligned_storage { // define type with size _Len and alignment _Align + using _Next = char; + static constexpr bool _Fits = _Align <= alignof(_Next); + using type = typename _Aligned<_Len, _Align, _Next, _Fits>::type; +}; + +template +using _Aligned_storage_t = typename _Aligned_storage<_Len, _Align>::type; + +_EXPORT_STD template +struct _CXX23_DEPRECATE_ALIGNED_STORAGE aligned_storage { // define type with size _Len and alignment _Align + using type = _Aligned_storage_t<_Len, _Align>; +}; + +_EXPORT_STD template +using aligned_storage_t _CXX23_DEPRECATE_ALIGNED_STORAGE = _Aligned_storage_t<_Len, _Align>; + +template +struct _Maximum; + +template <> +struct _Maximum<> : integral_constant {}; // maximum of nothing is 0 + +template +struct _Maximum<_Val> : integral_constant {}; // maximum of _Val is _Val + +template +struct _Maximum<_First, _Second, _Rest...> : _Maximum<(_First < _Second ? _Second : _First), _Rest...>::type { + // find maximum value in _First, _Second, _Rest... +}; + +_EXPORT_STD template +struct _CXX23_DEPRECATE_ALIGNED_UNION aligned_union { + // define type with size at least _Len, for storing anything in _Types + static constexpr size_t _Max_len = _Maximum<_Len, sizeof(_Types)...>::value; // NOT sizeof...(_Types) + static constexpr size_t alignment_value = _Maximum::value; + + using type = _Aligned_storage_t<_Max_len, alignment_value>; +}; + +_STL_DISABLE_DEPRECATED_WARNING +_EXPORT_STD template +using aligned_union_t _CXX23_DEPRECATE_ALIGNED_UNION = typename aligned_union<_Len, _Types...>::type; +_STL_RESTORE_DEPRECATED_WARNING + +template > +struct _Underlying_type { + using type = __underlying_type(_Ty); +}; + +template +struct _Underlying_type<_Ty, false> {}; + +_EXPORT_STD template +struct underlying_type : _Underlying_type<_Ty> {}; // determine underlying type for enum + +_EXPORT_STD template +using underlying_type_t = typename _Underlying_type<_Ty>::type; + +_EXPORT_STD template +constexpr size_t rank_v = 0; // determine number of dimensions of array _Ty + +template +constexpr size_t rank_v<_Ty[_Nx]> = rank_v<_Ty> + 1; + +template +constexpr size_t rank_v<_Ty[]> = rank_v<_Ty> + 1; + +_EXPORT_STD template +struct rank : integral_constant> {}; + +_EXPORT_STD template +constexpr size_t extent_v = 0; // determine extent of dimension _Ix of array _Ty + +template +constexpr size_t extent_v<_Ty[_Nx], 0> = _Nx; + +template +constexpr size_t extent_v<_Ty[_Nx], _Ix> = extent_v<_Ty, _Ix - 1>; + +template +constexpr size_t extent_v<_Ty[], _Ix> = extent_v<_Ty, _Ix - 1>; + +_EXPORT_STD template +struct extent : integral_constant> {}; + +_EXPORT_STD template +struct is_base_of : bool_constant<__is_base_of(_Base, _Derived)> { + // determine whether _Base is a base of or the same as _Derived +}; + +_EXPORT_STD template +constexpr bool is_base_of_v = __is_base_of(_Base, _Derived); + +_EXPORT_STD template +struct decay { // determines decayed version of _Ty + using _Ty1 = remove_reference_t<_Ty>; + using _Ty2 = typename _Select>::template _Apply, remove_cv<_Ty1>>; + using type = typename _Select>::template _Apply>, _Ty2>::type; +}; + +_EXPORT_STD template +using decay_t = typename decay<_Ty>::type; + +template +using _Conditional_type = decltype(false ? _STD declval<_Ty1>() : _STD declval<_Ty2>()); + +#if _HAS_CXX20 +template +struct _Const_lvalue_cond_oper {}; + +// N4950 [meta.trans.other]/3.3.4 (per the proposed resolution of LWG-3205): "Otherwise, if remove_cvref_t denotes +// a type..." +template + requires requires { typename _Conditional_type; } +struct _Const_lvalue_cond_oper<_Ty1, _Ty2> { + using type = remove_cvref_t<_Conditional_type>; +}; + +template +struct _Decayed_cond_oper : _Const_lvalue_cond_oper<_Ty1, _Ty2> {}; +#else // ^^^ _HAS_CXX20 / !_HAS_CXX20 vvv +template +struct _Decayed_cond_oper {}; +#endif // ^^^ !_HAS_CXX20 ^^^ + +template +struct _Decayed_cond_oper<_Ty1, _Ty2, void_t<_Conditional_type<_Ty1, _Ty2>>> { + using type = decay_t<_Conditional_type<_Ty1, _Ty2>>; +}; + +_EXPORT_STD template +struct common_type; + +_EXPORT_STD template +using common_type_t = typename common_type<_Ty...>::type; + +template <> +struct common_type<> {}; + +template +struct common_type<_Ty1> : common_type<_Ty1, _Ty1> {}; + +template , class _Decayed2 = decay_t<_Ty2>> +struct _Common_type2 : common_type<_Decayed1, _Decayed2> {}; + +template +struct _Common_type2<_Ty1, _Ty2, _Ty1, _Ty2> : _Decayed_cond_oper<_Ty1, _Ty2> {}; + +template +struct common_type<_Ty1, _Ty2> : _Common_type2<_Ty1, _Ty2> {}; + +template +struct _Common_type3 {}; + +template +struct _Common_type3>, _Ty1, _Ty2, _Rest...> + : common_type, _Rest...> {}; + +template +struct common_type<_Ty1, _Ty2, _Rest...> : _Common_type3 {}; + +template +_Ty _Returns_exactly() noexcept; // not defined + +#if _HAS_CXX20 +_EXPORT_STD template class, template class> +struct basic_common_reference {}; + +template +struct _Copy_cv_impl { + template + using _Apply = _To; +}; +template +struct _Copy_cv_impl { + template + using _Apply = const _To; +}; +template +struct _Copy_cv_impl { + template + using _Apply = volatile _To; +}; +template +struct _Copy_cv_impl { + template + using _Apply = const volatile _To; +}; +template +using _Copy_cv = // N4950 [meta.trans.other]/2.3 + _Copy_cv_impl<_From>::template _Apply<_To>; + +template +struct _Add_qualifiers { // _Add_qualifiers::template _Apply is XREF(A) from N4950 [meta.trans.other]/2.2 + template + using _Apply = _Copy_cv<_Ty1, _Ty2>; +}; +template +struct _Add_qualifiers<_Ty1&> { + template + using _Apply = add_lvalue_reference_t<_Copy_cv<_Ty1, _Ty2>>; +}; +template +struct _Add_qualifiers<_Ty1&&> { + template + using _Apply = add_rvalue_reference_t<_Copy_cv<_Ty1, _Ty2>>; +}; + +template +using _Cond_res = // N4950 [meta.trans.other]/2.4 + decltype(false ? _Returns_exactly<_Ty1>() : _Returns_exactly<_Ty2>()); + +_EXPORT_STD template +struct common_reference; + +_EXPORT_STD template +using common_reference_t = common_reference<_Types...>::type; + +// N4950 [meta.trans.other]/5.1: "If sizeof...(T) is zero ..." +template <> +struct common_reference<> {}; + +// N4950 [meta.trans.other]/5.2: "...if sizeof...(T) is one ..." +template +struct common_reference<_Ty> { + using type = _Ty; +}; + +// N4950 [meta.trans.other]/5.3: "...if sizeof...(T) is two..." + +// N4950 [meta.trans.other]/5.3.4: "if common_type_t is well-formed..." +// N4950 [meta.trans.other]/5.3.5: "Otherwise, there shall be no member type." +template +struct _Common_reference2C : common_type<_Ty1, _Ty2> {}; + +// N4950 [meta.trans.other]/5.3.3: "if COND_RES(T1, T2) is well-formed..." +template + requires requires { typename _Cond_res<_Ty1, _Ty2>; } +struct _Common_reference2C<_Ty1, _Ty2> { + using type = _Cond_res<_Ty1, _Ty2>; +}; + +// N4950 [meta.trans.other]/5.3.2: "if basic_common_reference<[...]>::type is well-formed..." +template +using _Basic_specialization = basic_common_reference, remove_cvref_t<_Ty2>, + _Add_qualifiers<_Ty1>::template _Apply, _Add_qualifiers<_Ty2>::template _Apply>::type; + +template +struct _Common_reference2B : _Common_reference2C<_Ty1, _Ty2> {}; + +template + requires requires { typename _Basic_specialization<_Ty1, _Ty2>; } +struct _Common_reference2B<_Ty1, _Ty2> { + using type = _Basic_specialization<_Ty1, _Ty2>; +}; + +// N4950 [meta.trans.other]/5.3.1: "Let R be COMMON-REF(T1, T2). If T1 and T2 are reference types, R is well-formed, and +// is_convertible_v, add_pointer_t> && is_convertible_v, add_pointer_t> is +// true, then the member typedef type denotes R." +template +struct _Common_reference2A : _Common_reference2B<_Ty1, _Ty2> {}; + +template + requires is_lvalue_reference_v<_Cond_res<_Copy_cv<_Ty1, _Ty2>&, _Copy_cv<_Ty2, _Ty1>&>> +using _LL_common_ref = _Cond_res<_Copy_cv<_Ty1, _Ty2>&, _Copy_cv<_Ty2, _Ty1>&>; + +template +struct _Common_reference2AX {}; + +template + requires requires { typename _LL_common_ref<_Ty1, _Ty2>; } +struct _Common_reference2AX<_Ty1&, _Ty2&> { + using type = _LL_common_ref<_Ty1, _Ty2>; // "both lvalues" case from N4950 [meta.trans.other]/2.5 +}; + +template + requires is_convertible_v<_Ty1&&, _LL_common_ref> +struct _Common_reference2AX<_Ty1&&, _Ty2&> { + using type = _LL_common_ref; // "rvalue and lvalue" case from N4950 [meta.trans.other]/2.7 +}; + +template + requires is_convertible_v<_Ty2&&, _LL_common_ref> +struct _Common_reference2AX<_Ty1&, _Ty2&&> { + using type = _LL_common_ref; // "lvalue and rvalue" case from N4950 [meta.trans.other]/2.8 +}; + +template +using _RR_common_ref = remove_reference_t<_LL_common_ref<_Ty1, _Ty2>>&&; + +template + requires is_convertible_v<_Ty1&&, _RR_common_ref<_Ty1, _Ty2>> + && is_convertible_v<_Ty2&&, _RR_common_ref<_Ty1, _Ty2>> +struct _Common_reference2AX<_Ty1&&, _Ty2&&> { + using type = _RR_common_ref<_Ty1, _Ty2>; // "both rvalues" case from N4950 [meta.trans.other]/2.6 +}; + +template +using _Common_ref_2AX_t = _Common_reference2AX<_Ty1, _Ty2>::type; + +template + requires is_convertible_v, add_pointer_t<_Common_ref_2AX_t<_Ty1, _Ty2>>> + && is_convertible_v, add_pointer_t<_Common_ref_2AX_t<_Ty1, _Ty2>>> +struct _Common_reference2A<_Ty1, _Ty2> { + using type = _Common_ref_2AX_t<_Ty1, _Ty2>; +}; + +template +struct common_reference<_Ty1, _Ty2> : _Common_reference2A<_Ty1, _Ty2> {}; + +// N4950 [meta.trans.other]/5.4: "if sizeof...(T) is greater than two..." +template +struct common_reference<_Ty1, _Ty2, _Ty3, _Rest...> {}; +template + requires requires { typename common_reference_t<_Ty1, _Ty2>; } +struct common_reference<_Ty1, _Ty2, _Ty3, _Rest...> : common_reference, _Ty3, _Rest...> { +}; + +_EXPORT_STD template +struct type_identity { + using type = _Ty; +}; +_EXPORT_STD template +using type_identity_t = type_identity<_Ty>::type; +#endif // _HAS_CXX20 + +template class _Template> +constexpr bool _Is_specialization_v = false; // true if and only if _Type is a specialization of _Template +template