From c55fc52d9d921b07bf9d5b6c11e3bfa081772b44 Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Tue, 10 Sep 2024 15:04:22 -0700 Subject: [PATCH 01/30] PowerShell 7.4.5. --- azure-devops/provision-image.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-devops/provision-image.ps1 b/azure-devops/provision-image.ps1 index e864be3747..b35d53a36b 100644 --- a/azure-devops/provision-image.ps1 +++ b/azure-devops/provision-image.ps1 @@ -40,7 +40,7 @@ foreach ($workload in $VisualStudioWorkloads) { } # https://github.com/PowerShell/PowerShell/releases/latest -$PowerShellUrl = 'https://github.com/PowerShell/PowerShell/releases/download/v7.4.4/PowerShell-7.4.4-win-x64.msi' +$PowerShellUrl = 'https://github.com/PowerShell/PowerShell/releases/download/v7.4.5/PowerShell-7.4.5-win-x64.msi' $PowerShellArgs = @('/quiet', '/norestart') $PythonUrl = 'https://www.python.org/ftp/python/3.12.5/python-3.12.5-amd64.exe' From c573e44054e663ebeb52294119a358c20cd8f5ed Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Tue, 10 Sep 2024 15:05:23 -0700 Subject: [PATCH 02/30] Python 3.12.6. --- azure-devops/provision-image.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-devops/provision-image.ps1 b/azure-devops/provision-image.ps1 index b35d53a36b..9117f0a8bd 100644 --- a/azure-devops/provision-image.ps1 +++ b/azure-devops/provision-image.ps1 @@ -43,7 +43,7 @@ foreach ($workload in $VisualStudioWorkloads) { $PowerShellUrl = 'https://github.com/PowerShell/PowerShell/releases/download/v7.4.5/PowerShell-7.4.5-win-x64.msi' $PowerShellArgs = @('/quiet', '/norestart') -$PythonUrl = 'https://www.python.org/ftp/python/3.12.5/python-3.12.5-amd64.exe' +$PythonUrl = 'https://www.python.org/ftp/python/3.12.6/python-3.12.6-amd64.exe' $PythonArgs = @('/quiet', 'InstallAllUsers=1', 'PrependPath=1', 'CompileAll=1', 'Include_doc=0') $CudaUrl = 'https://developer.download.nvidia.com/compute/cuda/12.4.0/local_installers/cuda_12.4.0_551.61_windows.exe' From effa7793a0c2e6fbbb5674d339915c99b63e9e11 Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Tue, 10 Sep 2024 15:43:47 -0700 Subject: [PATCH 03/30] New pool. --- azure-devops/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-devops/config.yml b/azure-devops/config.yml index af1ef4d88f..bc90f9f8e7 100644 --- a/azure-devops/config.yml +++ b/azure-devops/config.yml @@ -5,7 +5,7 @@ variables: - name: poolName - value: 'StlBuild-2024-08-14T0018-Pool' + value: 'StlBuild-2024-09-10T1506-Pool' readonly: true - name: poolDemands value: 'EnableSpotVM -equals false' From 758ad0dd717c7f8e22cc6e306b7f65048f22b996 Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Tue, 10 Sep 2024 15:45:20 -0700 Subject: [PATCH 04/30] VS 2022 17.12 Preview 2. (Still not updating yvals_core.h) --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 84077532ae..e5631dc1c8 100644 --- a/README.md +++ b/README.md @@ -141,7 +141,7 @@ Just try to follow these rules, so we can spend more time fixing bugs and implem # How To Build With The Visual Studio IDE -1. Install Visual Studio 2022 17.12 Preview 1 or later. +1. Install Visual Studio 2022 17.12 Preview 2 or later. * Select "Windows 11 SDK (10.0.22621.0)" in the VS Installer. * Select "MSVC v143 - VS 2022 C++ ARM64/ARM64EC build tools (Latest)" in the VS Installer if you would like to build the ARM64/ARM64EC target. @@ -160,7 +160,7 @@ Just try to follow these rules, so we can spend more time fixing bugs and implem # How To Build With A Native Tools Command Prompt -1. Install Visual Studio 2022 17.12 Preview 1 or later. +1. Install Visual Studio 2022 17.12 Preview 2 or later. * Select "Windows 11 SDK (10.0.22621.0)" in the VS Installer. * Select "MSVC v143 - VS 2022 C++ ARM64/ARM64EC build tools (Latest)" in the VS Installer if you would like to build the ARM64/ARM64EC target. From 61fd79bb6291117105901c61fe1014bb6f3d65a3 Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Tue, 10 Sep 2024 15:53:10 -0700 Subject: [PATCH 05/30] Clang 18.1.8 (we now require Clang 18). --- stl/inc/yvals_core.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stl/inc/yvals_core.h b/stl/inc/yvals_core.h index dbe2a17c87..bbf9cbd75f 100644 --- a/stl/inc/yvals_core.h +++ b/stl/inc/yvals_core.h @@ -897,8 +897,8 @@ _EMIT_STL_ERROR(STL1002, "Unexpected compiler version, expected CUDA 12.4 or new #elif defined(__EDG__) // not attempting to detect __EDG_VERSION__ being less than expected #elif defined(__clang__) -#if __clang_major__ < 17 -_EMIT_STL_ERROR(STL1000, "Unexpected compiler version, expected Clang 17.0.0 or newer."); +#if __clang_major__ < 18 +_EMIT_STL_ERROR(STL1000, "Unexpected compiler version, expected Clang 18.0.0 or newer."); #endif // ^^^ old Clang ^^^ #elif defined(_MSC_VER) #if _MSC_VER < 1941 // Coarse-grained, not inspecting _MSC_FULL_VER From bea0b23e0c3e96ea6f90ca30920fd39690ea76f3 Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Tue, 10 Sep 2024 15:55:41 -0700 Subject: [PATCH 06/30] Remove workarounds for VSO-2170500 (C1XX type trait optimization). --- tests/libcxx/expected_results.txt | 6 ------ .../test.compile.pass.cpp | 2 -- 2 files changed, 8 deletions(-) diff --git a/tests/libcxx/expected_results.txt b/tests/libcxx/expected_results.txt index 849419c527..271d435b1d 100644 --- a/tests/libcxx/expected_results.txt +++ b/tests/libcxx/expected_results.txt @@ -356,12 +356,6 @@ std/algorithms/alg.modifying.operations/alg.move/move.pass.cpp:1 FAIL std/language.support/support.rtti/type.info/type_info.equal.pass.cpp:0 FAIL std/language.support/support.rtti/type.info/type_info.equal.pass.cpp:1 FAIL -# VSO-2170500 C1XX's type trait optimization mishandles conjunction/disjunction with non-bool types -std/utilities/meta/meta.logical/conjunction.compile.pass.cpp:0 FAIL -std/utilities/meta/meta.logical/conjunction.compile.pass.cpp:1 FAIL -std/utilities/meta/meta.logical/disjunction.compile.pass.cpp:0 FAIL -std/utilities/meta/meta.logical/disjunction.compile.pass.cpp:1 FAIL - # *** CLANG COMPILER BUGS *** # LLVM-46207 Clang's tgmath.h interferes with the UCRT's tgmath.h diff --git a/tests/std/tests/GH_004845_logical_operator_traits_with_non_bool_constant/test.compile.pass.cpp b/tests/std/tests/GH_004845_logical_operator_traits_with_non_bool_constant/test.compile.pass.cpp index 0f621d7f99..dfa927e256 100644 --- a/tests/std/tests/GH_004845_logical_operator_traits_with_non_bool_constant/test.compile.pass.cpp +++ b/tests/std/tests/GH_004845_logical_operator_traits_with_non_bool_constant/test.compile.pass.cpp @@ -14,10 +14,8 @@ void test_base_derived() { using ValueType = typename Base::value_type; STATIC_ASSERT(is_same_v); STATIC_ASSERT(Base::value == Derived::type::value); -#if defined(__clang__) || defined(__EDG__) // TRANSITION, VSO-2170500 (C1XX type trait optimization) STATIC_ASSERT(is_same_v); STATIC_ASSERT(Base::value == Derived::value); -#endif // ^^^ no workaround ^^^ } template From ba2fd0320912fe1690b2876ac8156596cbba68b0 Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Tue, 10 Sep 2024 16:03:31 -0700 Subject: [PATCH 07/30] Clang 18 fixed LLVM-59827. --- stl/inc/tuple | 6 +++--- stl/inc/utility | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/stl/inc/tuple b/stl/inc/tuple index 0f79be7872..a37877844b 100644 --- a/stl/inc/tuple +++ b/stl/inc/tuple @@ -175,7 +175,7 @@ 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 +#ifdef __EDG__ // TRANSITION, VSO-1900279 template concept _Can_construct_from_tuple_like = _Different_from<_TupleLike, _Tuple> && _Tuple_like<_TupleLike> && !_Is_subrange_v> @@ -418,7 +418,7 @@ public: negation_v(_STD declval<_Other>())), _This>, is_convertible(_STD declval<_Other>())), _Rest>...>>; -#if defined(__clang__) || defined(__EDG__) // TRANSITION, LLVM-59827 and VSO-1900279 +#ifdef __EDG__ // TRANSITION, VSO-1900279 template , int> = 0> #else // ^^^ workaround / no workaround vvv template <_Different_from _Other> @@ -524,7 +524,7 @@ public: 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) +#ifdef __EDG__ // TRANSITION, VSO-1900279 template , int> = 0> #else // ^^^ workaround / no workaround vvv template _Other> diff --git a/stl/inc/utility b/stl/inc/utility index 2281bf7c01..b8ed6ad7f0 100644 --- a/stl/inc/utility +++ b/stl/inc/utility @@ -222,7 +222,7 @@ concept _Tuple_like = _Tuple_like_impl>; template concept _Pair_like = _Tuple_like<_Ty> && tuple_size_v> == 2; -#if defined(__clang__) || defined(__EDG__) // TRANSITION, LLVM-59827 and VSO-1900279 +#ifdef __EDG__ // TRANSITION, VSO-1900279 template concept _Can_construct_from_pair_like = _Pair_like<_PairLike> && !_Is_subrange_v> && is_constructible_v<_Ty1, decltype(_STD get<0>(_STD declval<_PairLike>()))> @@ -300,7 +300,7 @@ struct pair { // store a pair of values && is_nothrow_constructible_v<_Ty2, const _Other2>) // strengthened : first(_STD forward(_Right.first)), second(_STD forward(_Right.second)) {} -#if defined(__clang__) || defined(__EDG__) // TRANSITION, LLVM-59827 (Clang), VSO-1900279 (EDG) +#ifdef __EDG__ // TRANSITION, VSO-1900279 template , int> = 0> #else // ^^^ workaround / no workaround vvv template <_Pair_like _Other> From eaefb9821360ead22d0237da636532766163f382 Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Tue, 10 Sep 2024 16:11:19 -0700 Subject: [PATCH 08/30] Clang 18 fixed GH 1586 (remember to mark it as fixed by my PR). --- stl/inc/__msvc_bit_utils.hpp | 27 --------------------------- 1 file changed, 27 deletions(-) diff --git a/stl/inc/__msvc_bit_utils.hpp b/stl/inc/__msvc_bit_utils.hpp index eb86c43d0f..48567e8d52 100644 --- a/stl/inc/__msvc_bit_utils.hpp +++ b/stl/inc/__msvc_bit_utils.hpp @@ -127,24 +127,6 @@ _NODISCARD int _Checked_x86_x64_countl_zero(const _Ty _Val) noexcept { #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>; @@ -152,20 +134,11 @@ _NODISCARD int _Checked_arm_arm64_countl_zero(const _Ty _Val) noexcept { 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 From cb41ff04112b68c1baba2bda8812b95bb6010414 Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Tue, 10 Sep 2024 16:17:07 -0700 Subject: [PATCH 09/30] Clang 18 understands `-Wno-overriding-option`, so drop `-Wno-unknown-warning-option -Wno-overriding-t-option`. GH 4452 originally added this. --- tests/std/tests/floating_point_model_matrix.lst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/std/tests/floating_point_model_matrix.lst b/tests/std/tests/floating_point_model_matrix.lst index 7df38b8484..493927165e 100644 --- a/tests/std/tests/floating_point_model_matrix.lst +++ b/tests/std/tests/floating_point_model_matrix.lst @@ -28,6 +28,6 @@ ASAN PM_CL="/O2 /MD /permissive- -fsanitize=address /Zi" PM_LINK="/debug" PM_CL="/O2 /MT /GL" ASAN PM_CL="/O2 /MT /GL -fsanitize=address /Zi" PM_LINK="/debug" # TRANSITION, -Wno-unused-command-line-argument is needed for the internal test harness -PM_COMPILER="clang-cl" PM_CL="-fno-ms-compatibility -fno-delayed-template-parsing -Wno-unqualified-std-cast-call -Wno-unused-command-line-argument -Wno-unknown-warning-option -Wno-overriding-t-option -Wno-overriding-option /Od /MTd" -PM_COMPILER="clang-cl" PM_CL="-fno-ms-compatibility -fno-delayed-template-parsing -Wno-unqualified-std-cast-call -Wno-unused-command-line-argument -Wno-unknown-warning-option -Wno-overriding-t-option -Wno-overriding-option /O2 /MT" -PM_COMPILER="clang-cl" PM_CL="-fno-ms-compatibility -fno-delayed-template-parsing -Wno-unqualified-std-cast-call -Wno-unused-command-line-argument -Wno-unknown-warning-option -Wno-overriding-t-option -Wno-overriding-option /O2 /MD /Oi-" +PM_COMPILER="clang-cl" PM_CL="-fno-ms-compatibility -fno-delayed-template-parsing -Wno-unqualified-std-cast-call -Wno-unused-command-line-argument -Wno-overriding-option /Od /MTd" +PM_COMPILER="clang-cl" PM_CL="-fno-ms-compatibility -fno-delayed-template-parsing -Wno-unqualified-std-cast-call -Wno-unused-command-line-argument -Wno-overriding-option /O2 /MT" +PM_COMPILER="clang-cl" PM_CL="-fno-ms-compatibility -fno-delayed-template-parsing -Wno-unqualified-std-cast-call -Wno-unused-command-line-argument -Wno-overriding-option /O2 /MD /Oi-" From e1cc6d57aa5b0024138de7fe8bfaa0ca2f1c18dc Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Tue, 10 Sep 2024 16:26:58 -0700 Subject: [PATCH 10/30] Clang 18 understands `-Wno-nan-infinity-disabled`, so drop `-Wno-unknown-warning-option`. --- .../VSO_0000000_vector_algorithms_floats/env.lst | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/tests/std/tests/VSO_0000000_vector_algorithms_floats/env.lst b/tests/std/tests/VSO_0000000_vector_algorithms_floats/env.lst index b2af3deb67..c4da2f88d6 100644 --- a/tests/std/tests/VSO_0000000_vector_algorithms_floats/env.lst +++ b/tests/std/tests/VSO_0000000_vector_algorithms_floats/env.lst @@ -42,13 +42,12 @@ PM_CL="/BE /c /EHsc /MD /std:c++14 /w14640 /Zc:threadSafeInit-" PM_CL="/BE /c /EHsc /MDd /std:c++17 /permissive- /w14640 /Zc:threadSafeInit-" PM_CL="/BE /c /EHsc /MT /std:c++20 /permissive- /w14640 /Zc:threadSafeInit-" PM_CL="/BE /c /EHsc /MTd /std:c++latest /permissive- /w14640 /Zc:threadSafeInit-" -# TRANSITION, Clang 18: remove `-Wno-unknown-warning-option` from the below five clang-cl configs -PM_COMPILER="clang-cl" PM_CL="-fno-ms-compatibility -fno-delayed-template-parsing -Wno-unqualified-std-cast-call -Wno-unknown-warning-option -Wno-nan-infinity-disabled /EHsc /MD /std:c++14 /w14640 /Zc:threadSafeInit- --start-no-unused-arguments" -PM_COMPILER="clang-cl" PM_CL="-fno-ms-compatibility -fno-delayed-template-parsing -Wno-unqualified-std-cast-call -Wno-unknown-warning-option -Wno-nan-infinity-disabled /EHsc /MDd /std:c++17 /w14640 /Zc:threadSafeInit- --start-no-unused-arguments" -PM_COMPILER="clang-cl" PM_CL="-fno-ms-compatibility -fno-delayed-template-parsing -Wno-unqualified-std-cast-call -Wno-unknown-warning-option -Wno-nan-infinity-disabled /EHsc /MT /std:c++20 /permissive- /w14640 /Zc:threadSafeInit- --start-no-unused-arguments" -PM_COMPILER="clang-cl" PM_CL="-fno-ms-compatibility -fno-delayed-template-parsing -Wno-unqualified-std-cast-call -Wno-unknown-warning-option -Wno-nan-infinity-disabled /EHsc /MTd /std:c++latest /permissive- /w14640 /Zc:threadSafeInit- --start-no-unused-arguments" +PM_COMPILER="clang-cl" PM_CL="-fno-ms-compatibility -fno-delayed-template-parsing -Wno-unqualified-std-cast-call -Wno-nan-infinity-disabled /EHsc /MD /std:c++14 /w14640 /Zc:threadSafeInit- --start-no-unused-arguments" +PM_COMPILER="clang-cl" PM_CL="-fno-ms-compatibility -fno-delayed-template-parsing -Wno-unqualified-std-cast-call -Wno-nan-infinity-disabled /EHsc /MDd /std:c++17 /w14640 /Zc:threadSafeInit- --start-no-unused-arguments" +PM_COMPILER="clang-cl" PM_CL="-fno-ms-compatibility -fno-delayed-template-parsing -Wno-unqualified-std-cast-call -Wno-nan-infinity-disabled /EHsc /MT /std:c++20 /permissive- /w14640 /Zc:threadSafeInit- --start-no-unused-arguments" +PM_COMPILER="clang-cl" PM_CL="-fno-ms-compatibility -fno-delayed-template-parsing -Wno-unqualified-std-cast-call -Wno-nan-infinity-disabled /EHsc /MTd /std:c++latest /permissive- /w14640 /Zc:threadSafeInit- --start-no-unused-arguments" # TRANSITION, GH-3568 -# PM_COMPILER="clang-cl" PM_CL="-fno-ms-compatibility -fno-delayed-template-parsing -Wno-unqualified-std-cast-call -Wno-unknown-warning-option -Wno-nan-infinity-disabled /EHsc /MT /std:c++latest /permissive- /w14640 /Zc:threadSafeInit- -fsanitize=undefined -fno-sanitize-recover=undefined --start-no-unused-arguments" +# PM_COMPILER="clang-cl" PM_CL="-fno-ms-compatibility -fno-delayed-template-parsing -Wno-unqualified-std-cast-call -Wno-nan-infinity-disabled /EHsc /MT /std:c++latest /permissive- /w14640 /Zc:threadSafeInit- -fsanitize=undefined -fno-sanitize-recover=undefined --start-no-unused-arguments" RUNALL_CROSSLIST * PM_CL="/fp:strict" * PM_CL="/fp:precise" From 1b8a20f41c1f7f63b8f36254b1de31592cdf768b Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Tue, 10 Sep 2024 16:39:42 -0700 Subject: [PATCH 11/30] Add 'TRANSITION, Clang 20' comment noting that `__builtin_isgreater` etc. will be constexpr. --- stl/inc/cmath | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/stl/inc/cmath b/stl/inc/cmath index 34052e7628..885819380b 100644 --- a/stl/inc/cmath +++ b/stl/inc/cmath @@ -605,7 +605,8 @@ _STD _Common_float_type_t<_Ty1, _Ty2> remquo(_Ty1 _Left, _Ty2 _Right, int* _Pquo return __builtin_##NAME(_Xx); \ } -// Updated by P0533R9 "constexpr For And ", but the builtins aren't constexpr as of Clang 18. +// Updated by P0533R9 "constexpr For And ". +// TRANSITION, Clang 20: The builtins were made constexpr by LLVM-94118. #define _CLANG_BUILTIN2_ARG(NAME, ARG) \ _NODISCARD _Check_return_ inline bool NAME(_In_ ARG _Xx, _In_ ARG _Yx) noexcept /* strengthened */ { \ return __builtin_##NAME(_Xx, _Yx); \ From 0852e27ea53c1d0e1543c9ed419d2a007dd0b61b Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Tue, 10 Sep 2024 16:43:25 -0700 Subject: [PATCH 12/30] Clang 18 fixed LLVM-62594. --- .../tests/P1169R4_static_call_operator/test.compile.pass.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/std/tests/P1169R4_static_call_operator/test.compile.pass.cpp b/tests/std/tests/P1169R4_static_call_operator/test.compile.pass.cpp index 47b6bcd637..ecd82ea1de 100644 --- a/tests/std/tests/P1169R4_static_call_operator/test.compile.pass.cpp +++ b/tests/std/tests/P1169R4_static_call_operator/test.compile.pass.cpp @@ -43,10 +43,8 @@ void test_ctad() { static_assert(is_same_v>); static_assert(is_same_v>); -#if !(defined(__clang__) && defined(_M_IX86)) // TRANSITION, LLVM-62594, fixed in Clang 18 auto lambda = [](int* p, int** q) static { return *p + **q; }; static_assert(is_same_v>); -#endif // ^^^ no workaround ^^^ } void all_tests() { From 049b2b31a114a30d50415052fdd0048aca8e4e4e Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Tue, 10 Sep 2024 16:46:06 -0700 Subject: [PATCH 13/30] Clang 18 fixed a bug with static call operators. --- stl/inc/format | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/stl/inc/format b/stl/inc/format index 265940b4c9..e88c38fe63 100644 --- a/stl/inc/format +++ b/stl/inc/format @@ -715,9 +715,8 @@ public: template explicit handle(_Ty& _Val) noexcept - : _Ptr(_STD addressof(_Val)), - _Format([](basic_format_parse_context<_CharType>& _Parse_ctx, _Context& _Format_ctx, const void* _Ptr) { - // TRANSITION, Clang 18, should be marked _STATIC_CALL_OPERATOR + : _Ptr(_STD addressof(_Val)), _Format([](basic_format_parse_context<_CharType>& _Parse_ctx, + _Context& _Format_ctx, const void* _Ptr) _STATIC_CALL_OPERATOR { using _Td = remove_const_t<_Ty>; // doesn't drop const-qualifier per an unnumbered LWG issue using _Tq = conditional_t<_Formattable_with, const _Ty, _Ty>; From e7f938add8ee5a5947e3441761e6a8691255ca33 Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Tue, 10 Sep 2024 16:50:04 -0700 Subject: [PATCH 14/30] Expect clang-format 18.1.8. --- tools/format/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/format/CMakeLists.txt b/tools/format/CMakeLists.txt index 08ba8066af..d336d7dd5e 100644 --- a/tools/format/CMakeLists.txt +++ b/tools/format/CMakeLists.txt @@ -18,7 +18,7 @@ execute_process( ) if(clang_format_version MATCHES "clang-format version ([0-9]+\.[0-9]+\.[0-9]+)") - set(expected_version "17.0.3") + set(expected_version "18.1.8") if(CMAKE_MATCH_1 VERSION_LESS expected_version) message(FATAL_ERROR "Found clang-format ${CMAKE_MATCH_1}, older than expected ${expected_version}.") elseif(CMAKE_MATCH_1 VERSION_EQUAL expected_version) From 2742a28a197c88ea24f7d60b4715c37ade3b2077 Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Tue, 10 Sep 2024 17:17:06 -0700 Subject: [PATCH 15/30] Update .clang-format. Comment my .clang-format update process. Accept defaults, except for: * Change BreakAfterAttributes from Leave to Never (the old default). --- .clang-format | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/.clang-format b/.clang-format index 525a846df7..f3a204fb33 100644 --- a/.clang-format +++ b/.clang-format @@ -1,7 +1,18 @@ # Copyright (c) Microsoft Corporation. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -# https://releases.llvm.org/17.0.1/tools/clang/docs/ClangFormatStyleOptions.html +# https://releases.llvm.org/18.1.8/tools/clang/docs/ClangFormatStyleOptions.html + +# To update this .clang-format file for a new clang-format version: +# 1. Update the documentation link above. +# 2. Copy the output of `clang-format -dump-config` into a temporary file. +# a. Comment out all of its lines. +# b. Uncomment `BasedOnStyle: LLVM`. +# 3. Compare that temporary file to this .clang-format file. +# 4. Adjust this .clang-format file to record new and updated options. +# a. Read the new documentation to understand such changes. +# 5. The goal is for the comparison from the temporary file to this .clang-format file to be pure additions (green). +# a. That is, comments here are recording the defaults, while added lines are our customized settings. --- # Language: Cpp @@ -17,6 +28,7 @@ AlignAfterOpenBracket: DontAlign # AcrossEmptyLines: false # AcrossComments: false # AlignCompound: false +# AlignFunctionPointers: false # PadOperators: true AlignConsecutiveAssignments: Consecutive # AlignConsecutiveBitFields: @@ -24,18 +36,21 @@ AlignConsecutiveAssignments: Consecutive # AcrossEmptyLines: false # AcrossComments: false # AlignCompound: false +# AlignFunctionPointers: false # PadOperators: false # AlignConsecutiveDeclarations: # Enabled: false # AcrossEmptyLines: false # AcrossComments: false # AlignCompound: false +# AlignFunctionPointers: false # PadOperators: false # AlignConsecutiveMacros: # Enabled: false # AcrossEmptyLines: false # AcrossComments: false # AlignCompound: false +# AlignFunctionPointers: false # PadOperators: false AlignConsecutiveMacros: Consecutive # AlignConsecutiveShortCaseStatements: @@ -54,8 +69,10 @@ AlignTrailingComments: Kind: Never # AllowAllArgumentsOnNextLine: true # AllowAllParametersOfDeclarationOnNextLine: true +# AllowBreakBeforeNoexceptSpecifier: Never # AllowShortBlocksOnASingleLine: Never # AllowShortCaseLabelsOnASingleLine: false +# AllowShortCompoundRequirementOnASingleLine: true # AllowShortEnumsOnASingleLine: true # AllowShortFunctionsOnASingleLine: All AllowShortFunctionsOnASingleLine: Empty @@ -91,7 +108,9 @@ AlwaysBreakTemplateDeclarations: Yes # SplitEmptyFunction: true # SplitEmptyRecord: true # SplitEmptyNamespace: true -# BreakAfterAttributes: Never +# BreakAdjacentStringLiterals: true +# BreakAfterAttributes: Leave +BreakAfterAttributes: Never # BreakAfterJavaFieldAnnotations: false # BreakArrays: true # BreakBeforeBinaryOperators: None @@ -203,6 +222,7 @@ NamespaceIndentation: All # PenaltyBreakComment: 300 # PenaltyBreakFirstLessLess: 120 # PenaltyBreakOpenParenthesis: 0 +# PenaltyBreakScopeResolution: 500 # PenaltyBreakString: 1000 # PenaltyBreakTemplateDeclaration: 10 # PenaltyExcessCharacter: 1000000 @@ -222,6 +242,7 @@ RemoveSemicolon: true # RequiresExpressionIndentation: OuterScope # SeparateDefinitionBlocks: Leave # ShortNamespaceLines: 1 +# SkipMacroDefinitionBody: false # SortIncludes: CaseSensitive # SortJavaStaticImport: Before # SortUsingDeclarations: LexicographicNumeric @@ -244,6 +265,7 @@ SpaceAfterCStyleCast: true # AfterFunctionDeclarationName: false # AfterIfMacros: true # AfterOverloadedOperator: false +# AfterPlacementOperator: true # AfterRequiresInClause: false # AfterRequiresInExpression: false # BeforeNonEmptyParentheses: false From 951d4d3321f67c893fb2365faeac62c90c10dc77 Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Tue, 10 Sep 2024 17:50:14 -0700 Subject: [PATCH 16/30] Regen clang-format, no manual changes. --- stl/inc/__msvc_ranges_to.hpp | 18 ++-- stl/inc/atomic | 3 +- stl/inc/chrono | 6 +- stl/inc/execution | 4 +- stl/inc/expected | 4 +- stl/inc/format | 5 +- stl/inc/functional | 65 ++++++------ stl/inc/map | 20 ++-- stl/inc/mdspan | 10 +- stl/inc/memory | 6 +- stl/inc/queue | 24 ++--- stl/inc/ranges | 99 ++++++++++--------- stl/inc/scoped_allocator | 4 +- stl/inc/set | 4 +- stl/inc/stacktrace | 12 +-- stl/inc/tuple | 18 ++-- stl/inc/type_traits | 40 ++++---- stl/inc/unordered_map | 70 ++++++------- stl/inc/unordered_set | 61 ++++++------ stl/inc/variant | 2 +- stl/inc/vector | 6 +- stl/inc/xhash | 2 +- stl/inc/xlocnum | 4 +- stl/inc/xmemory | 32 +++--- stl/inc/xstring | 18 ++-- stl/inc/xtree | 14 +-- stl/inc/xutility | 70 ++++++------- stl/src/vector_algorithms.cpp | 36 +++---- stl/src/xfvalues.cpp | 6 +- stl/src/xlvalues.cpp | 6 +- stl/src/xvalues.cpp | 6 +- tests/std/include/range_algorithm_support.hpp | 4 +- .../test.cpp | 6 +- .../test.compile.pass.cpp | 24 ++--- .../test.compile.pass.cpp | 4 +- tests/std/tests/P0218R1_filesystem/test.cpp | 10 +- .../test.cpp | 5 +- .../test.cpp | 5 +- .../P0896R4_ranges_alg_find_first_of/test.cpp | 4 +- .../test.cpp | 3 +- .../test.cpp | 3 +- .../tests/P0896R4_ranges_alg_search/test.cpp | 4 +- .../test.cpp | 2 +- .../test.cpp | 2 +- .../test.cpp | 2 +- .../test.cpp | 2 +- .../tests/P0896R4_views_lazy_split/test.cpp | 2 +- tests/std/tests/P0896R4_views_split/test.cpp | 2 +- .../tests/P0896R4_views_transform/test.cpp | 2 +- .../tests/P0898R3_concepts/invocable_cc.hpp | 4 +- tests/std/tests/P0898R3_concepts/test.cpp | 2 +- .../tests/P1645R1_constexpr_numeric/test.cpp | 6 +- tests/std/tests/P2321R2_views_zip/test.cpp | 2 +- .../P2321R2_views_zip_transform/test.cpp | 12 +-- .../P2374R4_views_cartesian_product/test.cpp | 11 +-- .../test.cpp | 2 +- .../tests/P2441R2_views_join_with/test.cpp | 4 +- 57 files changed, 396 insertions(+), 408 deletions(-) diff --git a/stl/inc/__msvc_ranges_to.hpp b/stl/inc/__msvc_ranges_to.hpp index 5477a7347e..4810a44c42 100644 --- a/stl/inc/__msvc_ranges_to.hpp +++ b/stl/inc/__msvc_ranges_to.hpp @@ -73,7 +73,7 @@ namespace ranges { void operator()(auto&&) const&& = delete; template - _NODISCARD constexpr decltype(auto) operator()(_Ty && _Val) & noexcept( + _NODISCARD constexpr decltype(auto) operator()(_Ty&& _Val) & noexcept( noexcept(_Right(_Left(_STD forward<_Ty>(_Val))))) requires requires { _Right(_Left(_STD forward<_Ty>(_Val))); } { @@ -81,7 +81,7 @@ namespace ranges { } template - _NODISCARD constexpr decltype(auto) operator()(_Ty && _Val) const& noexcept( + _NODISCARD constexpr decltype(auto) operator()(_Ty&& _Val) const& noexcept( noexcept(_Right(_Left(_STD forward<_Ty>(_Val))))) requires requires { _Right(_Left(_STD forward<_Ty>(_Val))); } { @@ -89,7 +89,7 @@ namespace ranges { } template - _NODISCARD constexpr decltype(auto) operator()(_Ty && _Val) && noexcept( + _NODISCARD constexpr decltype(auto) operator()(_Ty&& _Val) && noexcept( noexcept(_STD move(_Right)(_STD move(_Left)(_STD forward<_Ty>(_Val))))) requires requires { _STD move(_Right)(_STD move(_Left)(_STD forward<_Ty>(_Val))); } { @@ -97,7 +97,7 @@ namespace ranges { } template - _NODISCARD constexpr decltype(auto) operator()(_Ty && _Val) const&& noexcept( + _NODISCARD constexpr decltype(auto) operator()(_Ty&& _Val) const&& noexcept( noexcept(_STD move(_Right)(_STD move(_Left)(_STD forward<_Ty>(_Val))))) requires requires { _STD move(_Right)(_STD move(_Left)(_STD forward<_Ty>(_Val))); } { @@ -119,7 +119,7 @@ namespace ranges { _EXPORT_STD template requires (_Range_adaptor_closure_object<_Right> && range<_Left>) - _NODISCARD constexpr decltype(auto) operator|(_Left && __l, _Right && __r) noexcept( + _NODISCARD constexpr decltype(auto) operator|(_Left&& __l, _Right&& __r) noexcept( noexcept(_STD forward<_Right>(__r)(_STD forward<_Left>(__l)))) requires requires { static_cast<_Right&&>(__r)(static_cast<_Left&&>(__l)); } { @@ -412,28 +412,28 @@ namespace ranges { template requires invocable<_Fn, _Ty, _Types&...> - constexpr decltype(auto) operator()(_Ty && _Arg) & noexcept( + constexpr decltype(auto) operator()(_Ty&& _Arg) & noexcept( noexcept(_Call(*this, _STD forward<_Ty>(_Arg), _Indices{}))) { return _Call(*this, _STD forward<_Ty>(_Arg), _Indices{}); } template requires invocable<_Fn, _Ty, const _Types&...> - constexpr decltype(auto) operator()(_Ty && _Arg) const& noexcept( + constexpr decltype(auto) operator()(_Ty&& _Arg) const& noexcept( noexcept(_Call(*this, _STD forward<_Ty>(_Arg), _Indices{}))) { return _Call(*this, _STD forward<_Ty>(_Arg), _Indices{}); } template requires invocable<_Fn, _Ty, _Types...> - constexpr decltype(auto) operator()(_Ty && _Arg) && noexcept( + constexpr decltype(auto) operator()(_Ty&& _Arg) && noexcept( noexcept(_Call(_STD move(*this), _STD forward<_Ty>(_Arg), _Indices{}))) { return _Call(_STD move(*this), _STD forward<_Ty>(_Arg), _Indices{}); } template requires invocable<_Fn, _Ty, const _Types...> - constexpr decltype(auto) operator()(_Ty && _Arg) const&& noexcept( + constexpr decltype(auto) operator()(_Ty&& _Arg) const&& noexcept( noexcept(_Call(_STD move(*this), _STD forward<_Ty>(_Arg), _Indices{}))) { return _Call(_STD move(*this), _STD forward<_Ty>(_Arg), _Indices{}); } diff --git a/stl/inc/atomic b/stl/inc/atomic index 67582d9b4f..b9b4831656 100644 --- a/stl/inc/atomic +++ b/stl/inc/atomic @@ -2089,8 +2089,7 @@ struct _Atomic_nonobject_pointer : _Atomic_storage<_Ty> { using _Base::_Base; }; -#define ATOMIC_VAR_INIT(_Value) \ - { _Value } +#define ATOMIC_VAR_INIT(_Value) {_Value} template using _Choose_atomic_base2_t = diff --git a/stl/inc/chrono b/stl/inc/chrono index fefe806cd6..ff63a35a89 100644 --- a/stl/inc/chrono +++ b/stl/inc/chrono @@ -5076,7 +5076,7 @@ namespace chrono { basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& _Os, const month& _Val) { return _Os << (_Val.ok() ? _STD format(_Os.getloc(), _STATICALLY_WIDEN(_CharT, "{:L%b}"), _Val) : _STD format(_Os.getloc(), _STATICALLY_WIDEN(_CharT, "{} is not a valid month"), - static_cast(_Val))); + static_cast(_Val))); } _EXPORT_STD template @@ -5089,7 +5089,7 @@ namespace chrono { basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& _Os, const weekday& _Val) { return _Os << (_Val.ok() ? _STD format(_Os.getloc(), _STATICALLY_WIDEN(_CharT, "{:L%a}"), _Val) : _STD format(_Os.getloc(), _STATICALLY_WIDEN(_CharT, "{} is not a valid weekday"), - _Val.c_encoding())); + _Val.c_encoding())); } _EXPORT_STD template @@ -5098,7 +5098,7 @@ namespace chrono { return _Os << (_Idx >= 1 && _Idx <= 5 ? _STD format(_Os.getloc(), _STATICALLY_WIDEN(_CharT, "{:L}[{}]"), _Val.weekday(), _Idx) : _STD format(_Os.getloc(), _STATICALLY_WIDEN(_CharT, "{:L}[{} is not a valid index]"), - _Val.weekday(), _Idx)); + _Val.weekday(), _Idx)); } _EXPORT_STD template diff --git a/stl/inc/execution b/stl/inc/execution index d331de71d6..fe63943160 100644 --- a/stl/inc/execution +++ b/stl/inc/execution @@ -351,7 +351,7 @@ struct _Generalized_sum_drop { // drop off point for GENERALIZED_SUM intermediat explicit _Generalized_sum_drop(const size_t _Slots) : _Data(static_cast<_Ty*>( - _Allocate<_New_alignof<_Ty>, _Parallelism_allocate_traits>(_Get_size_of_n(_Slots)))), + _Allocate<_New_alignof<_Ty>, _Parallelism_allocate_traits>(_Get_size_of_n(_Slots)))), _Slots(_Slots), _Frontier(0) {} ~_Generalized_sum_drop() noexcept { @@ -681,7 +681,7 @@ public: private: atomic _Bottom{0}; // modified by only owning thread atomic _Top{0}; // modified by all threads - _Guarded_by_(_Segment_lock) _Circular_buffer<_Ty>* _Segment{_Circular_buffer<_Ty>::_New_circular_buffer()}; + _Guarded_by_(_Segment_lock) _Circular_buffer<_Ty>* _Segment { _Circular_buffer<_Ty>::_New_circular_buffer() }; mutex _Segment_lock{}; }; diff --git a/stl/inc/expected b/stl/inc/expected index fd82ba69ac..8ee7320481 100644 --- a/stl/inc/expected +++ b/stl/inc/expected @@ -1137,8 +1137,8 @@ public: template requires (!is_void_v<_Uty>) _NODISCARD friend constexpr bool operator==(const expected& _Left, const expected<_Uty, _UErr>& _Right) noexcept( - noexcept(_STD _Fake_copy_init(_Left._Value == *_Right)) && noexcept( - _STD _Fake_copy_init(_Left._Unexpected == _Right.error()))) /* strengthened */ { + noexcept(_STD _Fake_copy_init(_Left._Value == *_Right)) + && noexcept(_STD _Fake_copy_init(_Left._Unexpected == _Right.error()))) /* strengthened */ { if (_Left._Has_value != _Right.has_value()) { return false; } else if (_Left._Has_value) { diff --git a/stl/inc/format b/stl/inc/format index e88c38fe63..4613a4d6c8 100644 --- a/stl/inc/format +++ b/stl/inc/format @@ -3493,9 +3493,8 @@ _NODISCARD _OutputIt _Fmt_write( int _Width = _Specs._Precision; const _CharT* _Last = _Measure_string_prefix(_Value, _Width); - return _Write_aligned(_STD move(_Out), _Width, _Specs, _Fmt_align::_Left, [=](_OutputIt _Out) { - return _Fmt_write(_STD move(_Out), basic_string_view<_CharT>{_Value.data(), _Last}); - }); + return _Write_aligned(_STD move(_Out), _Width, _Specs, _Fmt_align::_Left, + [=](_OutputIt _Out) { return _Fmt_write(_STD move(_Out), basic_string_view<_CharT>{_Value.data(), _Last}); }); } // This is the visitor that's used for "simple" replacement fields. diff --git a/stl/inc/functional b/stl/inc/functional index d06f4e1291..68a93e53cb 100644 --- a/stl/inc/functional +++ b/stl/inc/functional @@ -146,8 +146,8 @@ struct bit_not { template <> struct divides { template - _NODISCARD constexpr auto operator()(_Ty1&& _Left, _Ty2&& _Right) const - -> decltype(_STD forward<_Ty1>(_Left) / _STD forward<_Ty2>(_Right)) { + _NODISCARD constexpr auto operator()( + _Ty1&& _Left, _Ty2&& _Right) const -> decltype(_STD forward<_Ty1>(_Left) / _STD forward<_Ty2>(_Right)) { return _STD forward<_Ty1>(_Left) / _STD forward<_Ty2>(_Right); } @@ -157,8 +157,8 @@ struct divides { template <> struct modulus { template - _NODISCARD constexpr auto operator()(_Ty1&& _Left, _Ty2&& _Right) const - -> decltype(_STD forward<_Ty1>(_Left) % _STD forward<_Ty2>(_Right)) { + _NODISCARD constexpr auto operator()( + _Ty1&& _Left, _Ty2&& _Right) const -> decltype(_STD forward<_Ty1>(_Left) % _STD forward<_Ty2>(_Right)) { return _STD forward<_Ty1>(_Left) % _STD forward<_Ty2>(_Right); } @@ -180,8 +180,8 @@ struct negate { template <> struct logical_and { template - _NODISCARD constexpr auto operator()(_Ty1&& _Left, _Ty2&& _Right) const - -> decltype(_STD forward<_Ty1>(_Left) && _STD forward<_Ty2>(_Right)) { + _NODISCARD constexpr auto operator()( + _Ty1&& _Left, _Ty2&& _Right) const -> decltype(_STD forward<_Ty1>(_Left) && _STD forward<_Ty2>(_Right)) { return _STD forward<_Ty1>(_Left) && _STD forward<_Ty2>(_Right); } @@ -191,8 +191,8 @@ struct logical_and { template <> struct logical_or { template - _NODISCARD constexpr auto operator()(_Ty1&& _Left, _Ty2&& _Right) const - -> decltype(_STD forward<_Ty1>(_Left) || _STD forward<_Ty2>(_Right)) { + _NODISCARD constexpr auto operator()( + _Ty1&& _Left, _Ty2&& _Right) const -> decltype(_STD forward<_Ty1>(_Left) || _STD forward<_Ty2>(_Right)) { return _STD forward<_Ty1>(_Left) || _STD forward<_Ty2>(_Right); } @@ -212,8 +212,8 @@ struct logical_not { template <> struct bit_and { template - _NODISCARD constexpr auto operator()(_Ty1&& _Left, _Ty2&& _Right) const - -> decltype(_STD forward<_Ty1>(_Left) & _STD forward<_Ty2>(_Right)) { + _NODISCARD constexpr auto operator()( + _Ty1&& _Left, _Ty2&& _Right) const -> decltype(_STD forward<_Ty1>(_Left) & _STD forward<_Ty2>(_Right)) { return _STD forward<_Ty1>(_Left) & _STD forward<_Ty2>(_Right); } @@ -223,8 +223,8 @@ struct bit_and { template <> struct bit_or { template - _NODISCARD constexpr auto operator()(_Ty1&& _Left, _Ty2&& _Right) const - -> decltype(_STD forward<_Ty1>(_Left) | _STD forward<_Ty2>(_Right)) { + _NODISCARD constexpr auto operator()( + _Ty1&& _Left, _Ty2&& _Right) const -> decltype(_STD forward<_Ty1>(_Left) | _STD forward<_Ty2>(_Right)) { return _STD forward<_Ty1>(_Left) | _STD forward<_Ty2>(_Right); } @@ -234,8 +234,8 @@ struct bit_or { template <> struct bit_xor { template - _NODISCARD constexpr auto operator()(_Ty1&& _Left, _Ty2&& _Right) const - -> decltype(_STD forward<_Ty1>(_Left) ^ _STD forward<_Ty2>(_Right)) { + _NODISCARD constexpr auto operator()( + _Ty1&& _Left, _Ty2&& _Right) const -> decltype(_STD forward<_Ty1>(_Left) ^ _STD forward<_Ty2>(_Right)) { return _STD forward<_Ty1>(_Left) ^ _STD forward<_Ty2>(_Right); } @@ -572,9 +572,8 @@ public: constexpr explicit _Mem_fn(_Memptr _Val) noexcept : _Pm(_Val) {} template - _CONSTEXPR20 auto operator()(_Types&&... _Args) const - noexcept(noexcept(_STD invoke(_Pm, _STD forward<_Types>(_Args)...))) - -> decltype(_STD invoke(_Pm, _STD forward<_Types>(_Args)...)) { + _CONSTEXPR20 auto operator()(_Types&&... _Args) const noexcept(noexcept(_STD invoke( + _Pm, _STD forward<_Types>(_Args)...))) -> decltype(_STD invoke(_Pm, _STD forward<_Types>(_Args)...)) { return _STD invoke(_Pm, _STD forward<_Types>(_Args)...); } }; @@ -651,30 +650,26 @@ public: void operator()(_Types&&...) const&& = delete; #else // ^^^ _HAS_CXX20 / !_HAS_CXX20 vvv template - auto operator()(_Types&&... _Args) & noexcept( - noexcept(!_STD invoke(this->_Get_val(), _STD forward<_Types>(_Args)...))) - -> decltype(!_STD declval>()) { + auto operator()(_Types&&... _Args) & noexcept(noexcept(!_STD invoke(this->_Get_val(), + _STD forward<_Types>(_Args)...))) -> decltype(!_STD declval>()) { return !_STD invoke(this->_Get_val(), _STD forward<_Types>(_Args)...); } template - auto operator()(_Types&&... _Args) const& noexcept( - noexcept(!_STD invoke(this->_Get_val(), _STD forward<_Types>(_Args)...))) - -> decltype(!_STD declval>()) { + auto operator()(_Types&&... _Args) const& noexcept(noexcept(!_STD invoke(this->_Get_val(), + _STD forward<_Types>(_Args)...))) -> decltype(!_STD declval>()) { return !_STD invoke(this->_Get_val(), _STD forward<_Types>(_Args)...); } template - auto operator()(_Types&&... _Args) && noexcept( - noexcept(!_STD invoke(_STD move(this->_Get_val()), _STD forward<_Types>(_Args)...))) - -> decltype(!_STD declval>()) { + auto operator()(_Types&&... _Args) && noexcept(noexcept(!_STD invoke(_STD move(this->_Get_val()), + _STD forward<_Types>(_Args)...))) -> decltype(!_STD declval>()) { return !_STD invoke(_STD move(this->_Get_val()), _STD forward<_Types>(_Args)...); } template - auto operator()(_Types&&... _Args) const&& noexcept( - noexcept(!_STD invoke(_STD move(this->_Get_val()), _STD forward<_Types>(_Args)...))) - -> decltype(!_STD declval>()) { + auto operator()(_Types&&... _Args) const&& noexcept(noexcept(!_STD invoke(_STD move(this->_Get_val()), + _STD forward<_Types>(_Args)...))) -> decltype(!_STD declval>()) { return !_STD invoke(_STD move(this->_Get_val()), _STD forward<_Types>(_Args)...); } #endif // ^^^ !_HAS_CXX20 ^^^ @@ -2020,9 +2015,9 @@ struct _Select_fixer<_Cv_TiD, false, true, 0> { // nested bind fixer } template - static constexpr auto _Fix(_Cv_TiD& _Tid, _Untuple&& _Ut) noexcept( - noexcept(_Apply(_Tid, _STD move(_Ut), make_index_sequence>{}))) - -> decltype(_Apply(_Tid, _STD move(_Ut), make_index_sequence>{})) { + static constexpr auto _Fix(_Cv_TiD& _Tid, _Untuple&& _Ut) noexcept(noexcept(_Apply(_Tid, _STD move(_Ut), + make_index_sequence>{}))) -> decltype(_Apply(_Tid, _STD move(_Ut), + make_index_sequence>{})) { // call a nested bind expression return _Apply(_Tid, _STD move(_Ut), make_index_sequence>{}); } @@ -2049,9 +2044,9 @@ struct _Select_fixer<_Cv_TiD, false, false, _Jx> { // placeholder fixer }; template -constexpr auto _Fix_arg(_Cv_TiD& _Tid, _Untuple&& _Ut) noexcept( - noexcept(_Select_fixer<_Cv_TiD>::_Fix(_Tid, _STD move(_Ut)))) - -> decltype(_Select_fixer<_Cv_TiD>::_Fix(_Tid, _STD move(_Ut))) { // translate an argument for bind +constexpr auto _Fix_arg(_Cv_TiD& _Tid, _Untuple&& _Ut) noexcept(noexcept( + _Select_fixer<_Cv_TiD>::_Fix(_Tid, _STD move(_Ut)))) -> decltype(_Select_fixer<_Cv_TiD>::_Fix(_Tid, + _STD move(_Ut))) { // translate an argument for bind return _Select_fixer<_Cv_TiD>::_Fix(_Tid, _STD move(_Ut)); } diff --git a/stl/inc/map b/stl/inc/map index ecb13ccb94..32fe59cf6a 100644 --- a/stl/inc/map +++ b/stl/inc/map @@ -387,12 +387,12 @@ map(initializer_list>, _Alloc) -> map<_Kty, _Ty, less<_Kty>, _Al template <_RANGES input_range _Rng, class _Pr = less<_Range_key_type<_Rng>>, _Allocator_for_container _Alloc = allocator<_Range_to_alloc_type<_Rng>>> requires (!_Allocator_for_container<_Pr>) -map(from_range_t, _Rng&&, _Pr = _Pr(), _Alloc = _Alloc()) - -> map<_Range_key_type<_Rng>, _Range_mapped_type<_Rng>, _Pr, _Alloc>; +map(from_range_t, _Rng&&, _Pr = _Pr(), + _Alloc = _Alloc()) -> map<_Range_key_type<_Rng>, _Range_mapped_type<_Rng>, _Pr, _Alloc>; template <_RANGES input_range _Rng, _Allocator_for_container _Alloc> -map(from_range_t, _Rng&&, _Alloc) - -> map<_Range_key_type<_Rng>, _Range_mapped_type<_Rng>, less<_Range_key_type<_Rng>>, _Alloc>; +map(from_range_t, _Rng&&, + _Alloc) -> map<_Range_key_type<_Rng>, _Range_mapped_type<_Rng>, less<_Range_key_type<_Rng>>, _Alloc>; #endif // _HAS_CXX23 #endif // _HAS_CXX17 @@ -601,8 +601,8 @@ public: #if _HAS_CXX17 template >, class _Alloc = allocator<_Guide_pair_t<_Iter>>, enable_if_t, negation<_Is_allocator<_Pr>>, _Is_allocator<_Alloc>>, int> = 0> -multimap(_Iter, _Iter, _Pr = _Pr(), _Alloc = _Alloc()) - -> multimap<_Guide_key_t<_Iter>, _Guide_val_t<_Iter>, _Pr, _Alloc>; +multimap( + _Iter, _Iter, _Pr = _Pr(), _Alloc = _Alloc()) -> multimap<_Guide_key_t<_Iter>, _Guide_val_t<_Iter>, _Pr, _Alloc>; template , class _Alloc = allocator>, enable_if_t>, _Is_allocator<_Alloc>>, int> = 0> @@ -618,12 +618,12 @@ multimap(initializer_list>, _Alloc) -> multimap<_Kty, _Ty, less< template <_RANGES input_range _Rng, class _Pr = less<_Range_key_type<_Rng>>, _Allocator_for_container _Alloc = allocator<_Range_to_alloc_type<_Rng>>> requires (!_Allocator_for_container<_Pr>) -multimap(from_range_t, _Rng&&, _Pr = _Pr(), _Alloc = _Alloc()) - -> multimap<_Range_key_type<_Rng>, _Range_mapped_type<_Rng>, _Pr, _Alloc>; +multimap(from_range_t, _Rng&&, _Pr = _Pr(), + _Alloc = _Alloc()) -> multimap<_Range_key_type<_Rng>, _Range_mapped_type<_Rng>, _Pr, _Alloc>; template <_RANGES input_range _Rng, _Allocator_for_container _Alloc> -multimap(from_range_t, _Rng&&, _Alloc) - -> multimap<_Range_key_type<_Rng>, _Range_mapped_type<_Rng>, less<_Range_key_type<_Rng>>, _Alloc>; +multimap(from_range_t, _Rng&&, + _Alloc) -> multimap<_Range_key_type<_Rng>, _Range_mapped_type<_Rng>, less<_Range_key_type<_Rng>>, _Alloc>; #endif // _HAS_CXX23 #endif // _HAS_CXX17 diff --git a/stl/inc/mdspan b/stl/inc/mdspan index ce21eb7428..a3023b9b1a 100644 --- a/stl/inc/mdspan +++ b/stl/inc/mdspan @@ -1464,17 +1464,17 @@ template mdspan(_ElementType*, const array<_OtherIndexType, _Nx>&) -> mdspan<_ElementType, dextents>; template -mdspan(_ElementType*, const extents<_IndexType, _ExtentsPack...>&) - -> mdspan<_ElementType, extents<_IndexType, _ExtentsPack...>>; +mdspan(_ElementType*, + const extents<_IndexType, _ExtentsPack...>&) -> mdspan<_ElementType, extents<_IndexType, _ExtentsPack...>>; template mdspan(_ElementType*, const _MappingType&) -> mdspan<_ElementType, typename _MappingType::extents_type, typename _MappingType::layout_type>; template -mdspan(const typename _AccessorType::data_handle_type&, const _MappingType&, const _AccessorType&) - -> mdspan; +mdspan(const typename _AccessorType::data_handle_type&, const _MappingType&, + const _AccessorType&) -> mdspan; _STD_END diff --git a/stl/inc/memory b/stl/inc/memory index d185be6674..9534bb5898 100644 --- a/stl/inc/memory +++ b/stl/inc/memory @@ -3034,8 +3034,8 @@ _NODISCARD shared_ptr<_Ty> _Allocate_shared_unbounded_array( // make a shared_ptr to an unbounded array static_assert(is_unbounded_array_v<_Ty>); using _Refc = conditional_t<_IsForOverwrite, // - _Ref_count_unbounded_array_alloc_for_overwrite, _Alloc>, - _Ref_count_unbounded_array_alloc, _Alloc>>; + _Ref_count_unbounded_array_alloc_for_overwrite, _Alloc>, + _Ref_count_unbounded_array_alloc, _Alloc>>; constexpr size_t _Align = alignof(_Refc); using _Storage = _Alignas_storage_unit<_Align>; _Rebind_alloc_t<_Alloc, _Storage> _Rebound(_Al); @@ -4401,7 +4401,7 @@ private: public: explicit inout_ptr_t(_SmartPtr& _Smart_ptr_, _ArgsT... _Args_) noexcept( is_nothrow_constructible_v, _ArgsT...> // - && noexcept(_Get_ptr_from_smart(_Smart_ptr_))) /* strengthened */ + && noexcept(_Get_ptr_from_smart(_Smart_ptr_))) /* strengthened */ : _Smart_ptr(_Smart_ptr_), _Mypair(_One_then_variadic_args_t{}, tuple<_ArgsT...>{_STD forward<_ArgsT>(_Args_)...}, _Get_ptr_from_smart(_Smart_ptr_)) {} diff --git a/stl/inc/queue b/stl/inc/queue index 832ed8fbc3..49b4c5aa12 100644 --- a/stl/inc/queue +++ b/stl/inc/queue @@ -174,8 +174,8 @@ template <_Iterator_for_container _InIt, _Allocator_for_container _Alloc = alloc queue(_InIt, _InIt, _Alloc = _Alloc()) -> queue<_Iter_value_t<_InIt>, deque<_Iter_value_t<_InIt>, _Alloc>>; template <_RANGES input_range _Rng, _Allocator_for_container _Alloc = allocator<_RANGES range_value_t<_Rng>>> -queue(from_range_t, _Rng&&, _Alloc = _Alloc()) - -> queue<_RANGES range_value_t<_Rng>, deque<_RANGES range_value_t<_Rng>, _Alloc>>; +queue(from_range_t, _Rng&&, + _Alloc = _Alloc()) -> queue<_RANGES range_value_t<_Rng>, deque<_RANGES range_value_t<_Rng>, _Alloc>>; #endif // _HAS_CXX23 _EXPORT_STD template @@ -450,8 +450,8 @@ priority_queue(_Pr, _Container) -> priority_queue>, class _Container = vector<_Iter_value_t<_Iter>>, enable_if_t, negation<_Is_allocator<_Pr>>, negation<_Is_allocator<_Container>>>, int> = 0> -priority_queue(_Iter, _Iter, _Pr = _Pr(), _Container = _Container()) - -> priority_queue<_Iter_value_t<_Iter>, _Container, _Pr>; +priority_queue( + _Iter, _Iter, _Pr = _Pr(), _Container = _Container()) -> priority_queue<_Iter_value_t<_Iter>, _Container, _Pr>; template >, negation<_Is_allocator<_Container>>, @@ -469,23 +469,23 @@ priority_queue(_Iter, _Iter, _Compare, _Alloc) -> priority_queue<_Iter_value_t<_ template , uses_allocator<_Container, _Alloc>>, int> = 0> -priority_queue(_Iter, _Iter, _Compare, _Container, _Alloc) - -> priority_queue; +priority_queue(_Iter, _Iter, _Compare, _Container, + _Alloc) -> priority_queue; #if _HAS_CXX23 template <_RANGES input_range _Rng, class _Pr = less<_RANGES range_value_t<_Rng>>, enable_if_t::value, int> = 0> -priority_queue(from_range_t, _Rng&&, _Pr = _Pr()) - -> priority_queue<_RANGES range_value_t<_Rng>, vector<_RANGES range_value_t<_Rng>>, _Pr>; +priority_queue(from_range_t, _Rng&&, + _Pr = _Pr()) -> priority_queue<_RANGES range_value_t<_Rng>, vector<_RANGES range_value_t<_Rng>>, _Pr>; template <_RANGES input_range _Rng, class _Pr, class _Alloc, enable_if_t>, _Is_allocator<_Alloc>>, int> = 0> -priority_queue(from_range_t, _Rng&&, _Pr, _Alloc) - -> priority_queue<_RANGES range_value_t<_Rng>, vector<_RANGES range_value_t<_Rng>, _Alloc>, _Pr>; +priority_queue(from_range_t, _Rng&&, _Pr, + _Alloc) -> priority_queue<_RANGES range_value_t<_Rng>, vector<_RANGES range_value_t<_Rng>, _Alloc>, _Pr>; template <_RANGES input_range _Rng, class _Alloc, enable_if_t<_Is_allocator<_Alloc>::value, int> = 0> -priority_queue(from_range_t, _Rng&&, _Alloc) - -> priority_queue<_RANGES range_value_t<_Rng>, vector<_RANGES range_value_t<_Rng>, _Alloc>>; +priority_queue(from_range_t, _Rng&&, + _Alloc) -> priority_queue<_RANGES range_value_t<_Rng>, vector<_RANGES range_value_t<_Rng>, _Alloc>>; #endif // _HAS_CXX23 #endif // _HAS_CXX17 diff --git a/stl/inc/ranges b/stl/inc/ranges index 692a65504c..083628139d 100644 --- a/stl/inc/ranges +++ b/stl/inc/ranges @@ -368,8 +368,9 @@ namespace ranges { template <_Different_from<_Ty> _Uty> requires convertible_to - constexpr _Defaultabox(const _Defaultabox<_Uty>& _That) noexcept(is_nothrow_default_constructible_v<_Ty> // - && noexcept(_Value = static_cast<_Ty>(*_That))) { + constexpr _Defaultabox(const _Defaultabox<_Uty>& _That) noexcept( + is_nothrow_default_constructible_v<_Ty> // + && noexcept(_Value = static_cast<_Ty>(*_That))) { if (_That) { _Value = static_cast<_Ty>(*_That); } @@ -377,8 +378,9 @@ namespace ranges { template <_Different_from<_Ty> _Uty> requires convertible_to<_Uty, _Ty> - constexpr _Defaultabox(_Defaultabox<_Uty>&& _That) noexcept(is_nothrow_default_constructible_v<_Ty> // - && noexcept(_Value = static_cast<_Ty>(_STD move(*_That)))) { + constexpr _Defaultabox(_Defaultabox<_Uty>&& _That) noexcept( + is_nothrow_default_constructible_v<_Ty> // + && noexcept(_Value = static_cast<_Ty>(_STD move(*_That)))) { if (_That) { _Value = static_cast<_Ty>(_STD move(*_That)); } @@ -731,7 +733,7 @@ namespace ranges { } constexpr _Ioterator operator--(int) noexcept(is_nothrow_copy_constructible_v<_Wi> // - && noexcept(--_Current)) /* strengthened */ + && noexcept(--_Current)) /* strengthened */ requires _Decrementable<_Wi> { auto _Tmp = *this; @@ -854,7 +856,7 @@ namespace ranges { _NODISCARD friend constexpr _Ioterator operator+(_Ioterator _It, const difference_type _Off) noexcept( is_nothrow_move_constructible_v<_Ioterator> // - && noexcept(_It += _Off)) /* strengthened */ + && noexcept(_It += _Off)) /* strengthened */ requires _Advanceable<_Wi> { _It += _Off; @@ -862,7 +864,7 @@ namespace ranges { } _NODISCARD friend constexpr _Ioterator operator+(const difference_type _Off, _Ioterator _It) noexcept( is_nothrow_move_constructible_v<_Wi> // - && noexcept(static_cast<_Wi>(_It._Current + _Off))) /* strengthened */ + && noexcept(static_cast<_Wi>(_It._Current + _Off))) /* strengthened */ requires _Advanceable<_Wi> { return _Ioterator{static_cast<_Wi>(_It._Current + _Off)}; @@ -870,7 +872,7 @@ namespace ranges { _NODISCARD friend constexpr _Ioterator operator-(_Ioterator _It, const difference_type _Off) noexcept( is_nothrow_move_constructible_v<_Ioterator> // - && noexcept(_It -= _Off)) /* strengthened */ + && noexcept(_It -= _Off)) /* strengthened */ requires _Advanceable<_Wi> { _It -= _Off; @@ -1266,7 +1268,8 @@ namespace ranges { requires constructible_from<_Ty, _TArgs...> && constructible_from<_Bo, _BArgs...> _NODISCARD_CTOR constexpr explicit repeat_view(piecewise_construct_t, tuple<_TArgs...> _Val_args, tuple<_BArgs...> _Bound_args = tuple<>{}) noexcept(is_nothrow_constructible_v<_Ty, _TArgs...> // - && noexcept(_STD make_from_tuple<_Bo>(_Bound_args))) // strengthened + && noexcept(_STD make_from_tuple<_Bo>( + _Bound_args))) // strengthened : repeat_view(_Val_args, index_sequence_for<_TArgs...>{}, _STD make_from_tuple<_Bo>(_Bound_args)) { #if _CONTAINER_DEBUG_LEVEL > 0 if constexpr (_Signed_integer_like<_Bo>) { @@ -3504,8 +3507,8 @@ namespace ranges { requires constructible_from<_Vw, views::all_t<_Rng>> && constructible_from<_Pat, single_view>>> constexpr explicit join_with_view(_Rng&& _Range_, range_value_t<_InnerRng> _Elem) noexcept( - noexcept(_Vw(views::all(_STD forward<_Rng>(_Range_)))) && noexcept( - _Pat(views::single(_STD move(_Elem))))) // strengthened + noexcept(_Vw(views::all(_STD forward<_Rng>(_Range_)))) + && noexcept(_Pat(views::single(_STD move(_Elem))))) // strengthened : _Range(views::all(_STD forward<_Rng>(_Range_))), _Pattern(views::single(_STD move(_Elem))) {} _NODISCARD constexpr _Vw base() const& noexcept(is_nothrow_copy_constructible_v<_Vw>) /* strengthened */ @@ -3950,8 +3953,9 @@ namespace ranges { template requires constructible_from<_Vw, views::all_t<_Rng>> && constructible_from<_Pat, single_view>> - constexpr explicit lazy_split_view(_Rng&& _Range_, range_value_t<_Rng> _Elem) noexcept(noexcept(_Vw(views::all( - _STD forward<_Rng>(_Range_)))) && noexcept(_Pat(views::single(_STD move(_Elem))))) // strengthened + constexpr explicit lazy_split_view(_Rng&& _Range_, range_value_t<_Rng> _Elem) noexcept( + noexcept(_Vw(views::all(_STD forward<_Rng>(_Range_)))) + && noexcept(_Pat(views::single(_STD move(_Elem))))) // strengthened : _Range(views::all(_STD forward<_Rng>(_Range_))), _Pattern(views::single(_STD move(_Elem))) {} _NODISCARD constexpr _Vw base() const& noexcept(is_nothrow_copy_constructible_v<_Vw>) /* strengthened */ @@ -3999,8 +4003,8 @@ namespace ranges { lazy_split_view(_Rng&&, _Pat&&) -> lazy_split_view, views::all_t<_Pat>>; template - lazy_split_view(_Rng&&, range_value_t<_Rng>) - -> lazy_split_view, single_view>>; + lazy_split_view( + _Rng&&, range_value_t<_Rng>) -> lazy_split_view, single_view>>; #if _HAS_CXX23 template @@ -4781,7 +4785,7 @@ namespace ranges { _NODISCARD constexpr decltype(auto) operator*() const noexcept(is_nothrow_move_constructible_v>> // - && noexcept(_STD get<_Index>(*_Current))) /* strengthened */ { + && noexcept(_STD get<_Index>(*_Current))) /* strengthened */ { using _ElemTy = remove_cv_t>>; return static_cast<_ElemTy>(_STD get<_Index>(*_Current)); } @@ -4864,7 +4868,7 @@ namespace ranges { _NODISCARD constexpr decltype(auto) operator[](const difference_type _Idx) const noexcept(is_nothrow_move_constructible_v>> // - && noexcept(_STD get<_Index>(*(_Current + _Idx)))) /* strengthened */ + && noexcept(_STD get<_Index>(*(_Current + _Idx)))) /* strengthened */ requires random_access_range<_Base> { #if _ITERATOR_DEBUG_LEVEL != 0 @@ -5150,8 +5154,8 @@ namespace ranges { public: using iterator_category = input_iterator_tag; using iterator_concept = conditional_t, random_access_iterator_tag, - conditional_t, bidirectional_iterator_tag, - conditional_t, forward_iterator_tag, input_iterator_tag>>>; + conditional_t, bidirectional_iterator_tag, + conditional_t, forward_iterator_tag, input_iterator_tag>>>; using difference_type = range_difference_t<_Base_t>; using value_type = tuple>; @@ -5254,7 +5258,7 @@ namespace ranges { _NODISCARD friend constexpr _Iterator operator+(const _Iterator& _It, const difference_type _Off) noexcept( is_nothrow_copy_constructible_v<_Iterator> // - && noexcept(_STD declval<_Iterator&>() += _Off)) // strengthened + && noexcept(_STD declval<_Iterator&>() += _Off)) // strengthened requires random_access_range<_Base_t> { auto _Tmp = _It; @@ -5271,7 +5275,7 @@ namespace ranges { _NODISCARD friend constexpr _Iterator operator-(const _Iterator& _It, const difference_type _Off) noexcept( is_nothrow_copy_constructible_v<_Iterator> // - && noexcept(_STD declval<_Iterator&>() -= _Off)) // strengthened + && noexcept(_STD declval<_Iterator&>() -= _Off)) // strengthened requires random_access_range<_Base_t> { auto _Tmp = _It; @@ -5359,13 +5363,13 @@ namespace ranges { template static constexpr bool _Is_end_nothrow_v = is_nothrow_move_constructible_v> // - && noexcept(_RANGES end(_STD declval<_Rng&>())); + && noexcept(_RANGES end(_STD declval<_Rng&>())); template requires common_range<_Rng> && sized_range<_Rng> static constexpr bool _Is_end_nothrow_v<_Rng> = is_nothrow_move_constructible_v> // - && noexcept(_RANGES end(_STD declval<_Rng&>())) // - && noexcept(_RANGES distance(_STD declval<_Rng&>())); + && noexcept(_RANGES end(_STD declval<_Rng&>())) // + && noexcept(_RANGES distance(_STD declval<_Rng&>())); public: // clang-format off @@ -5517,8 +5521,9 @@ namespace ranges { return **_Parent->_Current; } - constexpr _Inner_iterator& operator++() noexcept(noexcept(++*_Parent->_Current) && noexcept( - static_cast(*_Parent->_Current == _RANGES end(_Parent->_Range)))) /* strengthened */ { + constexpr _Inner_iterator& operator++() noexcept( + noexcept(++*_Parent->_Current) + && noexcept(static_cast(*_Parent->_Current == _RANGES end(_Parent->_Range)))) /* strengthened */ { #if _ITERATOR_DEBUG_LEVEL != 0 _STL_VERIFY(*this != default_sentinel, "cannot increment chunk_view end iterator"); #endif // _ITERATOR_DEBUG_LEVEL != 0 @@ -5532,8 +5537,9 @@ namespace ranges { return *this; } - constexpr void operator++(int) noexcept(noexcept(++*_Parent->_Current) && noexcept( - static_cast(*_Parent->_Current == _RANGES end(_Parent->_Range)))) /* strengthened */ { + constexpr void operator++(int) noexcept( + noexcept(++*_Parent->_Current) + && noexcept(static_cast(*_Parent->_Current == _RANGES end(_Parent->_Range)))) /* strengthened */ { #if _ITERATOR_DEBUG_LEVEL != 0 _STL_VERIFY(*this != default_sentinel, "cannot increment chunk_view end iterator"); #endif // _ITERATOR_DEBUG_LEVEL != 0 @@ -5749,7 +5755,7 @@ namespace ranges { public: using iterator_category = input_iterator_tag; using iterator_concept = conditional_t, random_access_iterator_tag, - conditional_t, bidirectional_iterator_tag, forward_iterator_tag>>; + conditional_t, bidirectional_iterator_tag, forward_iterator_tag>>; using value_type = decltype(views::take(subrange(_Current, _End), _Count)); using difference_type = range_difference_t<_Base>; @@ -5897,7 +5903,7 @@ namespace ranges { _NODISCARD friend constexpr _Iterator operator+(const _Iterator& _It, const difference_type _Off) noexcept( is_nothrow_copy_constructible_v<_Iterator> // - && noexcept(_STD declval<_Iterator&>() += _Off)) /* strengthened */ + && noexcept(_STD declval<_Iterator&>() += _Off)) /* strengthened */ requires random_access_range<_Base> { auto _Copy = _It; @@ -5907,7 +5913,7 @@ namespace ranges { _NODISCARD friend constexpr _Iterator operator+(const difference_type _Off, const _Iterator& _It) noexcept( is_nothrow_copy_constructible_v<_Iterator> // - && noexcept(_STD declval<_Iterator&>() += _Off)) /* strengthened */ + && noexcept(_STD declval<_Iterator&>() += _Off)) /* strengthened */ requires random_access_range<_Base> { auto _Copy = _It; @@ -5917,7 +5923,7 @@ namespace ranges { _NODISCARD friend constexpr _Iterator operator-(const _Iterator& _It, const difference_type _Off) noexcept( is_nothrow_copy_constructible_v<_Iterator> // - && noexcept(_STD declval<_Iterator&>() -= _Off)) /* strengthened */ + && noexcept(_STD declval<_Iterator&>() -= _Off)) /* strengthened */ requires random_access_range<_Base> { auto _Copy = _It; @@ -6126,7 +6132,7 @@ namespace ranges { using difference_type = range_difference_t<_Base>; using iterator_category = input_iterator_tag; using iterator_concept = conditional_t, random_access_iterator_tag, - conditional_t, bidirectional_iterator_tag, forward_iterator_tag>>; + conditional_t, bidirectional_iterator_tag, forward_iterator_tag>>; _Iterator() = default; @@ -6150,7 +6156,7 @@ namespace ranges { } constexpr _Iterator operator++(int) noexcept(is_nothrow_copy_constructible_v<_Base_iterator> // - && noexcept(++_Current)) /* strengthened */ { + && noexcept(++_Current)) /* strengthened */ { auto _Tmp = *this; ++*this; return _Tmp; @@ -6168,7 +6174,7 @@ namespace ranges { } constexpr _Iterator operator--(int) noexcept(is_nothrow_copy_constructible_v<_Base_iterator> // - && noexcept(--_Current)) /* strengthened */ + && noexcept(--_Current)) /* strengthened */ requires bidirectional_range<_Base> { auto _Tmp = *this; @@ -6394,7 +6400,8 @@ namespace ranges { } _NODISCARD constexpr auto end() const noexcept(is_nothrow_move_constructible_v> // - && noexcept(_RANGES distance(_Range)) && noexcept(_RANGES begin(_Range) + _Count)) /* strengthened */ + && noexcept(_RANGES distance(_Range)) + && noexcept(_RANGES begin(_Range) + _Count)) /* strengthened */ requires _Slide_caches_nothing { const auto _Size = _RANGES distance(_Range) - (_Count - 1); @@ -7633,7 +7640,7 @@ namespace ranges { public: using iterator_concept = _Ziperator<_IsConst>::iterator_concept; using value_type = remove_cvref_t&, - range_reference_t<_Maybe_const<_IsConst, _ViewTypes>>...>>; + range_reference_t<_Maybe_const<_IsConst, _ViewTypes>>...>>; using difference_type = range_difference_t<_Base_t>; _Iterator() = default; @@ -7658,7 +7665,7 @@ namespace ranges { } constexpr _Iterator operator++(int) noexcept(is_nothrow_copy_constructible_v<_Iterator> // - && noexcept(++*this)) // strengthened + && noexcept(++*this)) // strengthened requires forward_range<_Base_t> { auto _Temp = *this; @@ -7674,7 +7681,7 @@ namespace ranges { } constexpr _Iterator operator--(int) noexcept(is_nothrow_copy_constructible_v<_Iterator> // - && noexcept(--*this)) // strengthened + && noexcept(--*this)) // strengthened requires bidirectional_range<_Base_t> { auto _Temp = *this; @@ -8037,7 +8044,7 @@ namespace ranges { public: using iterator_category = input_iterator_tag; using iterator_concept = conditional_t, random_access_iterator_tag, - conditional_t, bidirectional_iterator_tag, forward_iterator_tag>>; + conditional_t, bidirectional_iterator_tag, forward_iterator_tag>>; using value_type = _Repeated_tuple, _Nx>; using difference_type = range_difference_t<_Base>; @@ -8437,7 +8444,7 @@ namespace ranges { using iterator_category = decltype(_Get_iterator_category()); using iterator_concept = _Inner_iterator<_Const>::iterator_concept; using value_type = remove_cvref_t< - _Invoke_result_with_repeated_type<_Maybe_const<_Const, _Fn>&, range_reference_t<_Base>, _Nx>>; + _Invoke_result_with_repeated_type<_Maybe_const<_Const, _Fn>&, range_reference_t<_Base>, _Nx>>; using difference_type = range_difference_t<_Base>; _Iterator() = default; @@ -8956,14 +8963,14 @@ namespace ranges { public: using iterator_category = input_iterator_tag; using iterator_concept = conditional_t<_Cartesian_product_is_random_access<_Const, _First, _Rest...>, - random_access_iterator_tag, - conditional_t<_Cartesian_product_is_bidirectional<_Const, _First, _Rest...>, bidirectional_iterator_tag, - conditional_t>, forward_iterator_tag, - input_iterator_tag>>>; + random_access_iterator_tag, + conditional_t<_Cartesian_product_is_bidirectional<_Const, _First, _Rest...>, bidirectional_iterator_tag, + conditional_t>, forward_iterator_tag, + input_iterator_tag>>>; using value_type = tuple>, range_value_t<_Maybe_const<_Const, _Rest>>...>; using reference = tuple>, - range_reference_t<_Maybe_const<_Const, _Rest>>...>; + range_reference_t<_Maybe_const<_Const, _Rest>>...>; using difference_type = _Difference_type<_Const>; _Iterator() = default; diff --git a/stl/inc/scoped_allocator b/stl/inc/scoped_allocator index e6884b3650..6d5f2c034c 100644 --- a/stl/inc/scoped_allocator +++ b/stl/inc/scoped_allocator @@ -205,8 +205,8 @@ public: return static_cast(*this); } - _NODISCARD_RAW_PTR_ALLOC __declspec(allocator) pointer - allocate(_CRT_GUARDOVERFLOW size_type _Count) { // allocate array of _Count elements, ignore hint + _NODISCARD_RAW_PTR_ALLOC __declspec(allocator) pointer allocate( + _CRT_GUARDOVERFLOW size_type _Count) { // allocate array of _Count elements, ignore hint return _Outer_traits::allocate(outer_allocator(), _Count); } diff --git a/stl/inc/set b/stl/inc/set index 44bb78db03..02f8edc052 100644 --- a/stl/inc/set +++ b/stl/inc/set @@ -415,8 +415,8 @@ template <_RANGES input_range _Rng, class _Pr = less<_RANGES range_value_t<_Rng> multiset(from_range_t, _Rng&&, _Pr = _Pr(), _Alloc = _Alloc()) -> multiset<_RANGES range_value_t<_Rng>, _Pr, _Alloc>; template <_RANGES input_range _Rng, _Allocator_for_container _Alloc> -multiset(from_range_t, _Rng&&, _Alloc) - -> multiset<_RANGES range_value_t<_Rng>, less<_RANGES range_value_t<_Rng>>, _Alloc>; +multiset( + from_range_t, _Rng&&, _Alloc) -> multiset<_RANGES range_value_t<_Rng>, less<_RANGES range_value_t<_Rng>>, _Alloc>; #endif // _HAS_CXX23 #endif // _HAS_CXX17 diff --git a/stl/inc/stacktrace b/stl/inc/stacktrace index c2e109235b..682f978f92 100644 --- a/stl/inc/stacktrace +++ b/stl/inc/stacktrace @@ -136,8 +136,8 @@ public: // __declspec(noinline) to make the same behavior for debug and release. // We force the current function to be always noinline and add its frame to skipped. - _NODISCARD __declspec(noinline) static basic_stacktrace - current(const allocator_type& _Al = allocator_type()) noexcept { + _NODISCARD __declspec(noinline) static basic_stacktrace current( + const allocator_type& _Al = allocator_type()) noexcept { _TRY_BEGIN basic_stacktrace _Result{_Internal_t{}, _Max_frames, _Al}; const unsigned short _Actual_size = __std_stacktrace_capture( @@ -149,8 +149,8 @@ public: _CATCH_END } - _NODISCARD __declspec(noinline) static basic_stacktrace - current(const size_type _Skip, const allocator_type& _Al = allocator_type()) noexcept { + _NODISCARD __declspec(noinline) static basic_stacktrace current( + const size_type _Skip, const allocator_type& _Al = allocator_type()) noexcept { _TRY_BEGIN basic_stacktrace _Result{_Internal_t{}, _Max_frames, _Al}; const unsigned short _Actual_size = __std_stacktrace_capture( @@ -162,8 +162,8 @@ public: _CATCH_END } - _NODISCARD __declspec(noinline) static basic_stacktrace - current(const size_type _Skip, size_type _Max_depth, const allocator_type& _Al = allocator_type()) noexcept { + _NODISCARD __declspec(noinline) static basic_stacktrace current( + const size_type _Skip, size_type _Max_depth, const allocator_type& _Al = allocator_type()) noexcept { _TRY_BEGIN if (_Max_depth > _Max_frames) { _Max_depth = _Max_frames; diff --git a/stl/inc/tuple b/stl/inc/tuple index a37877844b..da30037785 100644 --- a/stl/inc/tuple +++ b/stl/inc/tuple @@ -307,7 +307,7 @@ public: template , int> = 0> constexpr tuple(_Tag, _Tpl&& _Right) : tuple(_Unpack_tuple_t{}, _STD forward<_Tpl>(_Right), - make_index_sequence>>{}) {} + make_index_sequence>>{}) {} template , int> = 0> @@ -322,7 +322,7 @@ public: template , int> = 0> constexpr tuple(_Tag, const _Alloc& _Al, _Tpl&& _Right) : tuple(_Alloc_unpack_tuple_t{}, _Al, _STD forward<_Tpl>(_Right), - make_index_sequence>>{}) {} + make_index_sequence>>{}) {} template , _STD is_default_constructible<_Rest>...>, @@ -786,8 +786,8 @@ public: } 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 { + _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 @@ -1127,9 +1127,8 @@ struct _Tuple_like_common_reference<_TTuple, _UTuple, _TQual, _UQual, index_sequ 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; - } + && (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; }; @@ -1148,9 +1147,8 @@ struct _Tuple_like_common_type<_TTuple, _UTuple, index_sequence<_Indices...>> { 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; - } + && (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; }; diff --git a/stl/inc/type_traits b/stl/inc/type_traits index 3f941094cd..6fa346c45f 100644 --- a/stl/inc/type_traits +++ b/stl/inc/type_traits @@ -1597,8 +1597,8 @@ struct _Invoker_functor { template static constexpr auto _Call(_Callable&& _Obj, _Types&&... _Args) noexcept( - noexcept(static_cast<_Callable&&>(_Obj)(static_cast<_Types&&>(_Args)...))) - -> decltype(static_cast<_Callable&&>(_Obj)(static_cast<_Types&&>(_Args)...)) { + noexcept(static_cast<_Callable&&>(_Obj)(static_cast<_Types&&>( + _Args)...))) -> decltype(static_cast<_Callable&&>(_Obj)(static_cast<_Types&&>(_Args)...)) { return static_cast<_Callable&&>(_Obj)(static_cast<_Types&&>(_Args)...); } }; @@ -1608,8 +1608,8 @@ struct _Invoker_pmf_object { template static constexpr auto _Call(_Decayed _Pmf, _Ty1&& _Arg1, _Types2&&... _Args2) noexcept( - noexcept((static_cast<_Ty1&&>(_Arg1).*_Pmf)(static_cast<_Types2&&>(_Args2)...))) - -> decltype((static_cast<_Ty1&&>(_Arg1).*_Pmf)(static_cast<_Types2&&>(_Args2)...)) { + noexcept((static_cast<_Ty1&&>(_Arg1).*_Pmf)(static_cast<_Types2&&>( + _Args2)...))) -> decltype((static_cast<_Ty1&&>(_Arg1).*_Pmf)(static_cast<_Types2&&>(_Args2)...)) { return (static_cast<_Ty1&&>(_Arg1).*_Pmf)(static_cast<_Types2&&>(_Args2)...); } }; @@ -1618,9 +1618,8 @@ struct _Invoker_pmf_refwrap { static constexpr _Invoker_strategy _Strategy = _Invoker_strategy::_Pmf_refwrap; template - static constexpr auto _Call(_Decayed _Pmf, _Refwrap _Rw, _Types2&&... _Args2) noexcept( - noexcept((_Rw.get().*_Pmf)(static_cast<_Types2&&>(_Args2)...))) - -> decltype((_Rw.get().*_Pmf)(static_cast<_Types2&&>(_Args2)...)) { + static constexpr auto _Call(_Decayed _Pmf, _Refwrap _Rw, _Types2&&... _Args2) noexcept(noexcept((_Rw.get().*_Pmf)( + static_cast<_Types2&&>(_Args2)...))) -> decltype((_Rw.get().*_Pmf)(static_cast<_Types2&&>(_Args2)...)) { return (_Rw.get().*_Pmf)(static_cast<_Types2&&>(_Args2)...); } }; @@ -1630,8 +1629,8 @@ struct _Invoker_pmf_pointer { template static constexpr auto _Call(_Decayed _Pmf, _Ty1&& _Arg1, _Types2&&... _Args2) noexcept( - noexcept(((*static_cast<_Ty1&&>(_Arg1)).*_Pmf)(static_cast<_Types2&&>(_Args2)...))) - -> decltype(((*static_cast<_Ty1&&>(_Arg1)).*_Pmf)(static_cast<_Types2&&>(_Args2)...)) { + noexcept(((*static_cast<_Ty1&&>(_Arg1)).*_Pmf)(static_cast<_Types2&&>( + _Args2)...))) -> decltype(((*static_cast<_Ty1&&>(_Arg1)).*_Pmf)(static_cast<_Types2&&>(_Args2)...)) { return ((*static_cast<_Ty1&&>(_Arg1)).*_Pmf)(static_cast<_Types2&&>(_Args2)...); } }; @@ -1658,8 +1657,8 @@ struct _Invoker_pmd_pointer { static constexpr _Invoker_strategy _Strategy = _Invoker_strategy::_Pmd_pointer; template - static constexpr auto _Call(_Decayed _Pmd, _Ty1&& _Arg1) noexcept(noexcept((*static_cast<_Ty1&&>(_Arg1)).*_Pmd)) - -> decltype((*static_cast<_Ty1&&>(_Arg1)).*_Pmd) { + static constexpr auto _Call(_Decayed _Pmd, _Ty1&& _Arg1) noexcept( + noexcept((*static_cast<_Ty1&&>(_Arg1)).*_Pmd)) -> decltype((*static_cast<_Ty1&&>(_Arg1)).*_Pmd) { return (*static_cast<_Ty1&&>(_Arg1)).*_Pmd; } }; @@ -1690,17 +1689,17 @@ template struct _Invoker1<_Callable, _Ty1, _Removed_cvref, false, false> : _Invoker_functor {}; _EXPORT_STD template -constexpr auto invoke(_Callable&& _Obj) noexcept(noexcept(static_cast<_Callable&&>(_Obj)())) - -> decltype(static_cast<_Callable&&>(_Obj)()) { +constexpr auto invoke(_Callable&& _Obj) noexcept( + noexcept(static_cast<_Callable&&>(_Obj)())) -> decltype(static_cast<_Callable&&>(_Obj)()) { return static_cast<_Callable&&>(_Obj)(); } _EXPORT_STD template -constexpr auto invoke(_Callable&& _Obj, _Ty1&& _Arg1, _Types2&&... _Args2) noexcept( - noexcept(_Invoker1<_Callable, _Ty1>::_Call( - static_cast<_Callable&&>(_Obj), static_cast<_Ty1&&>(_Arg1), static_cast<_Types2&&>(_Args2)...))) - -> decltype(_Invoker1<_Callable, _Ty1>::_Call( - static_cast<_Callable&&>(_Obj), static_cast<_Ty1&&>(_Arg1), static_cast<_Types2&&>(_Args2)...)) { +constexpr auto invoke(_Callable&& _Obj, _Ty1&& _Arg1, + _Types2&&... _Args2) noexcept(noexcept(_Invoker1<_Callable, _Ty1>::_Call(static_cast<_Callable&&>(_Obj), + static_cast<_Ty1&&>(_Arg1), + static_cast<_Types2&&>(_Args2)...))) -> decltype(_Invoker1<_Callable, _Ty1>::_Call(static_cast<_Callable&&>(_Obj), + static_cast<_Ty1&&>(_Arg1), static_cast<_Types2&&>(_Args2)...)) { if constexpr (_Invoker1<_Callable, _Ty1>::_Strategy == _Invoker_strategy::_Functor) { return static_cast<_Callable&&>(_Obj)(static_cast<_Ty1&&>(_Arg1), static_cast<_Types2&&>(_Args2)...); } else if constexpr (_Invoker1<_Callable, _Ty1>::_Strategy == _Invoker_strategy::_Pmf_object) { @@ -2027,9 +2026,8 @@ private: public: template - _CONSTEXPR20 auto operator()(_Types&&... _Args) const - noexcept(noexcept(_STD invoke(*_Ptr, static_cast<_Types&&>(_Args)...))) - -> decltype(_STD invoke(*_Ptr, static_cast<_Types&&>(_Args)...)) { + _CONSTEXPR20 auto operator()(_Types&&... _Args) const noexcept(noexcept(_STD invoke( + *_Ptr, static_cast<_Types&&>(_Args)...))) -> decltype(_STD invoke(*_Ptr, static_cast<_Types&&>(_Args)...)) { return _STD invoke(*_Ptr, static_cast<_Types&&>(_Args)...); } }; diff --git a/stl/inc/unordered_map b/stl/inc/unordered_map index d0f0b2aa90..b9308cbaf8 100644 --- a/stl/inc/unordered_map +++ b/stl/inc/unordered_map @@ -461,8 +461,8 @@ template >, class _Keyeq = enable_if_t< conjunction_v<_Is_iterator<_Iter>, _Is_hasher<_Hasher>, negation<_Is_allocator<_Keyeq>>, _Is_allocator<_Alloc>>, int> = 0> -unordered_map(_Iter, _Iter, _Guide_size_type_t<_Alloc> = 0, _Hasher = _Hasher(), _Keyeq = _Keyeq(), _Alloc = _Alloc()) - -> unordered_map<_Guide_key_t<_Iter>, _Guide_val_t<_Iter>, _Hasher, _Keyeq, _Alloc>; +unordered_map(_Iter, _Iter, _Guide_size_type_t<_Alloc> = 0, _Hasher = _Hasher(), _Keyeq = _Keyeq(), + _Alloc = _Alloc()) -> unordered_map<_Guide_key_t<_Iter>, _Guide_val_t<_Iter>, _Hasher, _Keyeq, _Alloc>; template , class _Keyeq = equal_to<_Kty>, class _Alloc = allocator>, @@ -472,29 +472,30 @@ unordered_map(initializer_list>, _Guide_size_type_t<_Alloc> = 0, template , _Is_allocator<_Alloc>>, int> = 0> unordered_map(_Iter, _Iter, _Alloc) -> unordered_map<_Guide_key_t<_Iter>, _Guide_val_t<_Iter>, - hash<_Guide_key_t<_Iter>>, equal_to<_Guide_key_t<_Iter>>, _Alloc>; + hash<_Guide_key_t<_Iter>>, equal_to<_Guide_key_t<_Iter>>, _Alloc>; template , _Is_allocator<_Alloc>>, int> = 0> -unordered_map(_Iter, _Iter, _Guide_size_type_t<_Alloc>, _Alloc) -> unordered_map<_Guide_key_t<_Iter>, - _Guide_val_t<_Iter>, hash<_Guide_key_t<_Iter>>, equal_to<_Guide_key_t<_Iter>>, _Alloc>; +unordered_map(_Iter, _Iter, _Guide_size_type_t<_Alloc>, + _Alloc) -> unordered_map<_Guide_key_t<_Iter>, _Guide_val_t<_Iter>, hash<_Guide_key_t<_Iter>>, + equal_to<_Guide_key_t<_Iter>>, _Alloc>; template , _Is_hasher<_Hasher>, _Is_allocator<_Alloc>>, int> = 0> -unordered_map(_Iter, _Iter, _Guide_size_type_t<_Alloc>, _Hasher, _Alloc) - -> unordered_map<_Guide_key_t<_Iter>, _Guide_val_t<_Iter>, _Hasher, equal_to<_Guide_key_t<_Iter>>, _Alloc>; +unordered_map(_Iter, _Iter, _Guide_size_type_t<_Alloc>, _Hasher, + _Alloc) -> unordered_map<_Guide_key_t<_Iter>, _Guide_val_t<_Iter>, _Hasher, equal_to<_Guide_key_t<_Iter>>, _Alloc>; template ::value, int> = 0> -unordered_map(initializer_list>, _Alloc) - -> unordered_map<_Kty, _Ty, hash<_Kty>, equal_to<_Kty>, _Alloc>; +unordered_map( + initializer_list>, _Alloc) -> unordered_map<_Kty, _Ty, hash<_Kty>, equal_to<_Kty>, _Alloc>; template ::value, int> = 0> -unordered_map(initializer_list>, _Guide_size_type_t<_Alloc>, _Alloc) - -> unordered_map<_Kty, _Ty, hash<_Kty>, equal_to<_Kty>, _Alloc>; +unordered_map(initializer_list>, _Guide_size_type_t<_Alloc>, + _Alloc) -> unordered_map<_Kty, _Ty, hash<_Kty>, equal_to<_Kty>, _Alloc>; template , _Is_allocator<_Alloc>>, int> = 0> -unordered_map(initializer_list>, _Guide_size_type_t<_Alloc>, _Hasher, _Alloc) - -> unordered_map<_Kty, _Ty, _Hasher, equal_to<_Kty>, _Alloc>; +unordered_map(initializer_list>, _Guide_size_type_t<_Alloc>, _Hasher, + _Alloc) -> unordered_map<_Kty, _Ty, _Hasher, equal_to<_Kty>, _Alloc>; #if _HAS_CXX23 template <_RANGES input_range _Rng, _Hasher_for_container _Hasher = hash<_Range_key_type<_Rng>>, @@ -505,12 +506,13 @@ unordered_map(from_range_t, _Rng&&, _Guide_size_type_t<_Alloc> = 0, _Hasher = _H _Alloc = _Alloc()) -> unordered_map<_Range_key_type<_Rng>, _Range_mapped_type<_Rng>, _Hasher, _Keyeq, _Alloc>; template <_RANGES input_range _Rng, _Allocator_for_container _Alloc> -unordered_map(from_range_t, _Rng&&, _Guide_size_type_t<_Alloc>, _Alloc) -> unordered_map<_Range_key_type<_Rng>, - _Range_mapped_type<_Rng>, hash<_Range_key_type<_Rng>>, equal_to<_Range_key_type<_Rng>>, _Alloc>; +unordered_map(from_range_t, _Rng&&, _Guide_size_type_t<_Alloc>, + _Alloc) -> unordered_map<_Range_key_type<_Rng>, _Range_mapped_type<_Rng>, hash<_Range_key_type<_Rng>>, + equal_to<_Range_key_type<_Rng>>, _Alloc>; template <_RANGES input_range _Rng, _Allocator_for_container _Alloc> unordered_map(from_range_t, _Rng&&, _Alloc) -> unordered_map<_Range_key_type<_Rng>, _Range_mapped_type<_Rng>, - hash<_Range_key_type<_Rng>>, equal_to<_Range_key_type<_Rng>>, _Alloc>; + hash<_Range_key_type<_Rng>>, equal_to<_Range_key_type<_Rng>>, _Alloc>; template <_RANGES input_range _Rng, _Hasher_for_container _Hasher, _Allocator_for_container _Alloc> unordered_map(from_range_t, _Rng&&, _Guide_size_type_t<_Alloc>, _Hasher, _Alloc) @@ -842,11 +844,12 @@ unordered_multimap(initializer_list>, _Guide_size_type_t<_Alloc> template , _Is_allocator<_Alloc>>, int> = 0> unordered_multimap(_Iter, _Iter, _Alloc) -> unordered_multimap<_Guide_key_t<_Iter>, _Guide_val_t<_Iter>, - hash<_Guide_key_t<_Iter>>, equal_to<_Guide_key_t<_Iter>>, _Alloc>; + hash<_Guide_key_t<_Iter>>, equal_to<_Guide_key_t<_Iter>>, _Alloc>; template , _Is_allocator<_Alloc>>, int> = 0> -unordered_multimap(_Iter, _Iter, _Guide_size_type_t<_Alloc>, _Alloc) -> unordered_multimap<_Guide_key_t<_Iter>, - _Guide_val_t<_Iter>, hash<_Guide_key_t<_Iter>>, equal_to<_Guide_key_t<_Iter>>, _Alloc>; +unordered_multimap(_Iter, _Iter, _Guide_size_type_t<_Alloc>, + _Alloc) -> unordered_multimap<_Guide_key_t<_Iter>, _Guide_val_t<_Iter>, hash<_Guide_key_t<_Iter>>, + equal_to<_Guide_key_t<_Iter>>, _Alloc>; template , _Is_hasher<_Hasher>, _Is_allocator<_Alloc>>, int> = 0> @@ -854,17 +857,17 @@ unordered_multimap(_Iter, _Iter, _Guide_size_type_t<_Alloc>, _Hasher, _Alloc) -> unordered_multimap<_Guide_key_t<_Iter>, _Guide_val_t<_Iter>, _Hasher, equal_to<_Guide_key_t<_Iter>>, _Alloc>; template ::value, int> = 0> -unordered_multimap(initializer_list>, _Alloc) - -> unordered_multimap<_Kty, _Ty, hash<_Kty>, equal_to<_Kty>, _Alloc>; +unordered_multimap( + initializer_list>, _Alloc) -> unordered_multimap<_Kty, _Ty, hash<_Kty>, equal_to<_Kty>, _Alloc>; template ::value, int> = 0> -unordered_multimap(initializer_list>, _Guide_size_type_t<_Alloc>, _Alloc) - -> unordered_multimap<_Kty, _Ty, hash<_Kty>, equal_to<_Kty>, _Alloc>; +unordered_multimap(initializer_list>, _Guide_size_type_t<_Alloc>, + _Alloc) -> unordered_multimap<_Kty, _Ty, hash<_Kty>, equal_to<_Kty>, _Alloc>; template , _Is_allocator<_Alloc>>, int> = 0> -unordered_multimap(initializer_list>, _Guide_size_type_t<_Alloc>, _Hasher, _Alloc) - -> unordered_multimap<_Kty, _Ty, _Hasher, equal_to<_Kty>, _Alloc>; +unordered_multimap(initializer_list>, _Guide_size_type_t<_Alloc>, _Hasher, + _Alloc) -> unordered_multimap<_Kty, _Ty, _Hasher, equal_to<_Kty>, _Alloc>; #if _HAS_CXX23 template <_RANGES input_range _Rng, _Hasher_for_container _Hasher = hash<_Range_key_type<_Rng>>, @@ -875,18 +878,19 @@ unordered_multimap(from_range_t, _Rng&&, _Guide_size_type_t<_Alloc> = 0, _Hasher _Alloc = _Alloc()) -> unordered_multimap<_Range_key_type<_Rng>, _Range_mapped_type<_Rng>, _Hasher, _Keyeq, _Alloc>; template <_RANGES input_range _Rng, _Allocator_for_container _Alloc> -unordered_multimap(from_range_t, _Rng&&, _Guide_size_type_t<_Alloc>, _Alloc) - -> unordered_multimap<_Range_key_type<_Rng>, _Range_mapped_type<_Rng>, hash<_Range_key_type<_Rng>>, - equal_to<_Range_key_type<_Rng>>, _Alloc>; +unordered_multimap(from_range_t, _Rng&&, _Guide_size_type_t<_Alloc>, + _Alloc) -> unordered_multimap<_Range_key_type<_Rng>, _Range_mapped_type<_Rng>, hash<_Range_key_type<_Rng>>, + equal_to<_Range_key_type<_Rng>>, _Alloc>; template <_RANGES input_range _Rng, _Allocator_for_container _Alloc> -unordered_multimap(from_range_t, _Rng&&, _Alloc) -> unordered_multimap<_Range_key_type<_Rng>, _Range_mapped_type<_Rng>, - hash<_Range_key_type<_Rng>>, equal_to<_Range_key_type<_Rng>>, _Alloc>; +unordered_multimap( + from_range_t, _Rng&&, _Alloc) -> unordered_multimap<_Range_key_type<_Rng>, _Range_mapped_type<_Rng>, + hash<_Range_key_type<_Rng>>, equal_to<_Range_key_type<_Rng>>, _Alloc>; template <_RANGES input_range _Rng, _Hasher_for_container _Hasher, _Allocator_for_container _Alloc> -unordered_multimap(from_range_t, _Rng&&, _Guide_size_type_t<_Alloc>, _Hasher, _Alloc) - -> unordered_multimap<_Range_key_type<_Rng>, _Range_mapped_type<_Rng>, _Hasher, equal_to<_Range_key_type<_Rng>>, - _Alloc>; +unordered_multimap(from_range_t, _Rng&&, _Guide_size_type_t<_Alloc>, _Hasher, + _Alloc) -> unordered_multimap<_Range_key_type<_Rng>, _Range_mapped_type<_Rng>, _Hasher, + equal_to<_Range_key_type<_Rng>>, _Alloc>; #endif // _HAS_CXX23 #endif // _HAS_CXX17 diff --git a/stl/inc/unordered_set b/stl/inc/unordered_set index e94e2b6806..67f174b8d9 100644 --- a/stl/inc/unordered_set +++ b/stl/inc/unordered_set @@ -326,8 +326,8 @@ template >, class _Keyeq enable_if_t< conjunction_v<_Is_iterator<_Iter>, _Is_hasher<_Hasher>, negation<_Is_allocator<_Keyeq>>, _Is_allocator<_Alloc>>, int> = 0> -unordered_set(_Iter, _Iter, _Guide_size_type_t<_Alloc> = 0, _Hasher = _Hasher(), _Keyeq = _Keyeq(), _Alloc = _Alloc()) - -> unordered_set<_Iter_value_t<_Iter>, _Hasher, _Keyeq, _Alloc>; +unordered_set(_Iter, _Iter, _Guide_size_type_t<_Alloc> = 0, _Hasher = _Hasher(), _Keyeq = _Keyeq(), + _Alloc = _Alloc()) -> unordered_set<_Iter_value_t<_Iter>, _Hasher, _Keyeq, _Alloc>; template , class _Keyeq = equal_to<_Kty>, class _Alloc = allocator<_Kty>, enable_if_t, negation<_Is_allocator<_Keyeq>>, _Is_allocator<_Alloc>>, int> = 0> @@ -335,22 +335,22 @@ unordered_set(initializer_list<_Kty>, _Guide_size_type_t<_Alloc> = 0, _Hasher = _Alloc = _Alloc()) -> unordered_set<_Kty, _Hasher, _Keyeq, _Alloc>; template , _Is_allocator<_Alloc>>, int> = 0> -unordered_set(_Iter, _Iter, _Guide_size_type_t<_Alloc>, _Alloc) - -> unordered_set<_Iter_value_t<_Iter>, hash<_Iter_value_t<_Iter>>, equal_to<_Iter_value_t<_Iter>>, _Alloc>; +unordered_set(_Iter, _Iter, _Guide_size_type_t<_Alloc>, + _Alloc) -> unordered_set<_Iter_value_t<_Iter>, hash<_Iter_value_t<_Iter>>, equal_to<_Iter_value_t<_Iter>>, _Alloc>; template , _Is_hasher<_Hasher>, _Is_allocator<_Alloc>>, int> = 0> -unordered_set(_Iter, _Iter, _Guide_size_type_t<_Alloc>, _Hasher, _Alloc) - -> unordered_set<_Iter_value_t<_Iter>, _Hasher, equal_to<_Iter_value_t<_Iter>>, _Alloc>; +unordered_set(_Iter, _Iter, _Guide_size_type_t<_Alloc>, _Hasher, + _Alloc) -> unordered_set<_Iter_value_t<_Iter>, _Hasher, equal_to<_Iter_value_t<_Iter>>, _Alloc>; template ::value, int> = 0> -unordered_set(initializer_list<_Kty>, _Guide_size_type_t<_Alloc>, _Alloc) - -> unordered_set<_Kty, hash<_Kty>, equal_to<_Kty>, _Alloc>; +unordered_set(initializer_list<_Kty>, _Guide_size_type_t<_Alloc>, + _Alloc) -> unordered_set<_Kty, hash<_Kty>, equal_to<_Kty>, _Alloc>; template , _Is_allocator<_Alloc>>, int> = 0> -unordered_set(initializer_list<_Kty>, _Guide_size_type_t<_Alloc>, _Hasher, _Alloc) - -> unordered_set<_Kty, _Hasher, equal_to<_Kty>, _Alloc>; +unordered_set(initializer_list<_Kty>, _Guide_size_type_t<_Alloc>, _Hasher, + _Alloc) -> unordered_set<_Kty, _Hasher, equal_to<_Kty>, _Alloc>; #if _HAS_CXX23 template <_RANGES input_range _Rng, _Hasher_for_container _Hasher = hash<_RANGES range_value_t<_Rng>>, @@ -361,16 +361,18 @@ unordered_set(from_range_t, _Rng&&, _Guide_size_type_t<_Alloc> = 0, _Hasher = _H _Alloc = _Alloc()) -> unordered_set<_RANGES range_value_t<_Rng>, _Hasher, _Keyeq, _Alloc>; template <_RANGES input_range _Rng, _Allocator_for_container _Alloc> -unordered_set(from_range_t, _Rng&&, _Guide_size_type_t<_Alloc>, _Alloc) -> unordered_set<_RANGES range_value_t<_Rng>, - hash<_RANGES range_value_t<_Rng>>, equal_to<_RANGES range_value_t<_Rng>>, _Alloc>; +unordered_set(from_range_t, _Rng&&, _Guide_size_type_t<_Alloc>, + _Alloc) -> unordered_set<_RANGES range_value_t<_Rng>, hash<_RANGES range_value_t<_Rng>>, + equal_to<_RANGES range_value_t<_Rng>>, _Alloc>; template <_RANGES input_range _Rng, _Allocator_for_container _Alloc> -unordered_set(from_range_t, _Rng&&, _Alloc) -> unordered_set<_RANGES range_value_t<_Rng>, - hash<_RANGES range_value_t<_Rng>>, equal_to<_RANGES range_value_t<_Rng>>, _Alloc>; +unordered_set( + from_range_t, _Rng&&, _Alloc) -> unordered_set<_RANGES range_value_t<_Rng>, hash<_RANGES range_value_t<_Rng>>, + equal_to<_RANGES range_value_t<_Rng>>, _Alloc>; template <_RANGES input_range _Rng, _Hasher_for_container _Hasher, _Allocator_for_container _Alloc> -unordered_set(from_range_t, _Rng&&, _Guide_size_type_t<_Alloc>, _Hasher, _Alloc) - -> unordered_set<_RANGES range_value_t<_Rng>, _Hasher, equal_to<_RANGES range_value_t<_Rng>>, _Alloc>; +unordered_set(from_range_t, _Rng&&, _Guide_size_type_t<_Alloc>, _Hasher, + _Alloc) -> unordered_set<_RANGES range_value_t<_Rng>, _Hasher, equal_to<_RANGES range_value_t<_Rng>>, _Alloc>; #endif // _HAS_CXX23 #endif // _HAS_CXX17 @@ -683,17 +685,17 @@ unordered_multiset(_Iter, _Iter, _Guide_size_type_t<_Alloc>, _Alloc) template , _Is_hasher<_Hasher>, _Is_allocator<_Alloc>>, int> = 0> -unordered_multiset(_Iter, _Iter, _Guide_size_type_t<_Alloc>, _Hasher, _Alloc) - -> unordered_multiset<_Iter_value_t<_Iter>, _Hasher, equal_to<_Iter_value_t<_Iter>>, _Alloc>; +unordered_multiset(_Iter, _Iter, _Guide_size_type_t<_Alloc>, _Hasher, + _Alloc) -> unordered_multiset<_Iter_value_t<_Iter>, _Hasher, equal_to<_Iter_value_t<_Iter>>, _Alloc>; template ::value, int> = 0> -unordered_multiset(initializer_list<_Kty>, _Guide_size_type_t<_Alloc>, _Alloc) - -> unordered_multiset<_Kty, hash<_Kty>, equal_to<_Kty>, _Alloc>; +unordered_multiset(initializer_list<_Kty>, _Guide_size_type_t<_Alloc>, + _Alloc) -> unordered_multiset<_Kty, hash<_Kty>, equal_to<_Kty>, _Alloc>; template , _Is_allocator<_Alloc>>, int> = 0> -unordered_multiset(initializer_list<_Kty>, _Guide_size_type_t<_Alloc>, _Hasher, _Alloc) - -> unordered_multiset<_Kty, _Hasher, equal_to<_Kty>, _Alloc>; +unordered_multiset(initializer_list<_Kty>, _Guide_size_type_t<_Alloc>, _Hasher, + _Alloc) -> unordered_multiset<_Kty, _Hasher, equal_to<_Kty>, _Alloc>; #if _HAS_CXX23 template <_RANGES input_range _Rng, _Hasher_for_container _Hasher = hash<_RANGES range_value_t<_Rng>>, @@ -704,17 +706,18 @@ unordered_multiset(from_range_t, _Rng&&, _Guide_size_type_t<_Alloc> = 0, _Hasher _Alloc = _Alloc()) -> unordered_multiset<_RANGES range_value_t<_Rng>, _Hasher, _Keyeq, _Alloc>; template <_RANGES input_range _Rng, _Allocator_for_container _Alloc> -unordered_multiset(from_range_t, _Rng&&, _Guide_size_type_t<_Alloc>, _Alloc) - -> unordered_multiset<_RANGES range_value_t<_Rng>, hash<_RANGES range_value_t<_Rng>>, - equal_to<_RANGES range_value_t<_Rng>>, _Alloc>; +unordered_multiset(from_range_t, _Rng&&, _Guide_size_type_t<_Alloc>, + _Alloc) -> unordered_multiset<_RANGES range_value_t<_Rng>, hash<_RANGES range_value_t<_Rng>>, + equal_to<_RANGES range_value_t<_Rng>>, _Alloc>; template <_RANGES input_range _Rng, _Allocator_for_container _Alloc> -unordered_multiset(from_range_t, _Rng&&, _Alloc) -> unordered_multiset<_RANGES range_value_t<_Rng>, - hash<_RANGES range_value_t<_Rng>>, equal_to<_RANGES range_value_t<_Rng>>, _Alloc>; +unordered_multiset( + from_range_t, _Rng&&, _Alloc) -> unordered_multiset<_RANGES range_value_t<_Rng>, hash<_RANGES range_value_t<_Rng>>, + equal_to<_RANGES range_value_t<_Rng>>, _Alloc>; template <_RANGES input_range _Rng, _Hasher_for_container _Hasher, _Allocator_for_container _Alloc> -unordered_multiset(from_range_t, _Rng&&, _Guide_size_type_t<_Alloc>, _Hasher, _Alloc) - -> unordered_multiset<_RANGES range_value_t<_Rng>, _Hasher, equal_to<_RANGES range_value_t<_Rng>>, _Alloc>; +unordered_multiset(from_range_t, _Rng&&, _Guide_size_type_t<_Alloc>, _Hasher, + _Alloc) -> unordered_multiset<_RANGES range_value_t<_Rng>, _Hasher, equal_to<_RANGES range_value_t<_Rng>>, _Alloc>; #endif // _HAS_CXX23 #endif // _HAS_CXX17 diff --git a/stl/inc/variant b/stl/inc/variant index f27bddbc91..b80a8b8636 100644 --- a/stl/inc/variant +++ b/stl/inc/variant @@ -1367,7 +1367,7 @@ _NODISCARD constexpr common_comparison_category_t...>, _Types...>; + common_comparison_category_t...>, _Types...>; const size_t _Left_offset = _Left.index() + 1; const size_t _Right_offset = _Right.index() + 1; const auto _Offset_order = _Left_offset <=> _Right_offset; diff --git a/stl/inc/vector b/stl/inc/vector index f682d41fee..088543c0fd 100644 --- a/stl/inc/vector +++ b/stl/inc/vector @@ -689,9 +689,9 @@ public: _CONSTEXPR20 vector(vector&& _Right) noexcept : _Mypair(_One_then_variadic_args_t{}, _STD move(_Right._Getal()), - _STD exchange(_Right._Mypair._Myval2._Myfirst, nullptr), - _STD exchange(_Right._Mypair._Myval2._Mylast, nullptr), - _STD exchange(_Right._Mypair._Myval2._Myend, nullptr)) { + _STD exchange(_Right._Mypair._Myval2._Myfirst, nullptr), + _STD exchange(_Right._Mypair._Myval2._Mylast, nullptr), + _STD exchange(_Right._Mypair._Myval2._Myend, nullptr)) { _Mypair._Myval2._Alloc_proxy(_GET_PROXY_ALLOCATOR(_Alty, _Getal())); _Mypair._Myval2._Swap_proxy_and_iterators(_Right._Mypair._Myval2); } diff --git a/stl/inc/xhash b/stl/inc/xhash index dfa0cf3f2b..a02b31e79c 100644 --- a/stl/inc/xhash +++ b/stl/inc/xhash @@ -361,7 +361,7 @@ public: using const_iterator = typename _Mylist::const_iterator; using _Unchecked_iterator = conditional_t, - typename _Mylist::_Unchecked_const_iterator, typename _Mylist::_Unchecked_iterator>; + typename _Mylist::_Unchecked_const_iterator, typename _Mylist::_Unchecked_iterator>; using _Unchecked_const_iterator = typename _Mylist::_Unchecked_const_iterator; using _Aliter = _Rebind_alloc_t<_Alnode, _Unchecked_iterator>; diff --git a/stl/inc/xlocnum b/stl/inc/xlocnum index e06101f63e..6cc2d13261 100644 --- a/stl/inc/xlocnum +++ b/stl/inc/xlocnum @@ -970,7 +970,7 @@ private: *_Ptr++ = '0'; // save at least one leading digit for hex } - const char _Decimal_point = _CSTD localeconv()->decimal_point[0]; + const char _Decimal_point = _CSTD localeconv() -> decimal_point[0]; if (_First != _Last && *_First == _Punct_fac.decimal_point()) { // add . *_Ptr++ = _Decimal_point; ++_First; @@ -1487,7 +1487,7 @@ private: } const size_t _Eoff = _CSTD strcspn(&_Buf[0], _Exps); // find exponent char _Dp[2] = {"."}; - _Dp[0] = _CSTD localeconv()->decimal_point[0]; + _Dp[0] = _CSTD localeconv() -> decimal_point[0]; const size_t _Poff = _CSTD strcspn(&_Buf[0], &_Dp[0]); // find decimal point const ctype<_Elem>& _Ctype_fac = _STD use_facet>(_Iosbase.getloc()); diff --git a/stl/inc/xmemory b/stl/inc/xmemory index 45913c396c..19f0e62cb0 100644 --- a/stl/inc/xmemory +++ b/stl/inc/xmemory @@ -97,7 +97,8 @@ struct _Default_allocate_traits { #ifdef __clang__ // Clang and MSVC implement P0784R7 differently; see GH-1532 _CONSTEXPR20 #endif // defined(__clang__) - void* _Allocate(const size_t _Bytes) { + void* + _Allocate(const size_t _Bytes) { return ::operator new(_Bytes); } @@ -106,7 +107,8 @@ struct _Default_allocate_traits { #ifdef __clang__ // Clang and MSVC implement P0784R7 differently; see GH-1532 _CONSTEXPR20 #endif // defined(__clang__) - void* _Allocate_aligned(const size_t _Bytes, const size_t _Align) { + void* + _Allocate_aligned(const size_t _Bytes, const size_t _Align) { #ifdef __clang__ // Clang and MSVC implement P0784R7 differently; see GH-1532 #if _HAS_CXX20 if (_STD is_constant_evaluated()) { @@ -547,13 +549,13 @@ struct _Normal_allocator_traits { // defines traits for allocators template using rebind_traits = allocator_traits>; - _NODISCARD_RAW_PTR_ALLOC static _CONSTEXPR20 __declspec(allocator) pointer - allocate(_Alloc& _Al, _CRT_GUARDOVERFLOW const size_type _Count) { + _NODISCARD_RAW_PTR_ALLOC static _CONSTEXPR20 __declspec(allocator) pointer allocate( + _Alloc& _Al, _CRT_GUARDOVERFLOW const size_type _Count) { return _Al.allocate(_Count); } - _NODISCARD_RAW_PTR_ALLOC static _CONSTEXPR20 __declspec(allocator) pointer - allocate(_Alloc& _Al, _CRT_GUARDOVERFLOW const size_type _Count, const const_void_pointer _Hint) { + _NODISCARD_RAW_PTR_ALLOC static _CONSTEXPR20 __declspec(allocator) pointer allocate( + _Alloc& _Al, _CRT_GUARDOVERFLOW const size_type _Count, const const_void_pointer _Hint) { if constexpr (_Has_allocate_hint<_Alloc, size_type, const_void_pointer>::value) { return _Al.allocate(_Count, _Hint); } else { @@ -644,8 +646,8 @@ struct _Default_allocator_traits { // traits for std::allocator template using rebind_traits = allocator_traits>; - _NODISCARD_RAW_PTR_ALLOC static _CONSTEXPR20 __declspec(allocator) pointer - allocate(_Alloc& _Al, _CRT_GUARDOVERFLOW const size_type _Count) { + _NODISCARD_RAW_PTR_ALLOC static _CONSTEXPR20 __declspec(allocator) pointer allocate( + _Alloc& _Al, _CRT_GUARDOVERFLOW const size_type _Count) { #if _HAS_CXX20 // TRANSITION, GH-1532 if (_STD is_constant_evaluated()) { return _Al.allocate(_Count); @@ -658,8 +660,8 @@ struct _Default_allocator_traits { // traits for std::allocator } } - _NODISCARD_RAW_PTR_ALLOC static _CONSTEXPR20 __declspec(allocator) pointer - allocate(_Alloc& _Al, _CRT_GUARDOVERFLOW const size_type _Count, const_void_pointer) { + _NODISCARD_RAW_PTR_ALLOC static _CONSTEXPR20 __declspec(allocator) pointer allocate( + _Alloc& _Al, _CRT_GUARDOVERFLOW const size_type _Count, const_void_pointer) { #if _HAS_CXX20 // TRANSITION, GH-1532 if (_STD is_constant_evaluated()) { return _Al.allocate(_Count); @@ -739,8 +741,8 @@ template constexpr _Pocma_values _Choose_pocma_v = allocator_traits<_Alloc>::is_always_equal::value ? _Pocma_values::_Equal_allocators : (allocator_traits<_Alloc>::propagate_on_container_move_assignment::value - ? _Pocma_values::_Propagate_allocators - : _Pocma_values::_No_propagate_allocators); + ? _Pocma_values::_Propagate_allocators + : _Pocma_values::_No_propagate_allocators); template using _Rebind_alloc_t = typename allocator_traits<_Alloc>::template rebind_alloc<_Value_type>; @@ -962,8 +964,8 @@ public: #endif // _HAS_CXX23 #if _HAS_DEPRECATED_ALLOCATOR_MEMBERS - _CXX17_DEPRECATE_OLD_ALLOCATOR_MEMBERS _NODISCARD_RAW_PTR_ALLOC __declspec(allocator) _Ty* allocate( - _CRT_GUARDOVERFLOW const size_t _Count, const void*) { + _CXX17_DEPRECATE_OLD_ALLOCATOR_MEMBERS _NODISCARD_RAW_PTR_ALLOC __declspec(allocator) + _Ty* allocate(_CRT_GUARDOVERFLOW const size_t _Count, const void*) { return allocate(_Count); } @@ -2503,7 +2505,7 @@ _EXPORT_STD inline constexpr from_range_t from_range; template concept _Container_compatible_range = - (_RANGES input_range<_Rng>) &&convertible_to<_RANGES range_reference_t<_Rng>, _Elem>; + (_RANGES input_range<_Rng>) && convertible_to<_RANGES range_reference_t<_Rng>, _Elem>; template <_RANGES input_range _Rng> using _Range_key_type = remove_const_t::first_type>; diff --git a/stl/inc/xstring b/stl/inc/xstring index 7b458d16c5..022750d3f6 100644 --- a/stl/inc/xstring +++ b/stl/inc/xstring @@ -520,7 +520,7 @@ struct _String_constructor_rvalue_allocator_tag { #if _HAS_CXX23 template concept _Contiguous_range_of = - (_RANGES contiguous_range<_Rng>) &&same_as>, _Ty>; + (_RANGES contiguous_range<_Rng>) && same_as>, _Ty>; #endif // _HAS_CXX23 _EXPORT_STD template , class _Alloc = allocator<_Elem>> @@ -1029,8 +1029,8 @@ public: _CONSTEXPR20 basic_string(_String_constructor_concat_tag, const basic_string& _Source_of_al, const _Elem* const _Left_ptr, const size_type _Left_size, const _Elem* const _Right_ptr, const size_type _Right_size) - : _Mypair( - _One_then_variadic_args_t{}, _Alty_traits::select_on_container_copy_construction(_Source_of_al._Getal())) { + : _Mypair(_One_then_variadic_args_t{}, + _Alty_traits::select_on_container_copy_construction(_Source_of_al._Getal())) { _STL_INTERNAL_CHECK(_Left_size <= max_size()); _STL_INTERNAL_CHECK(_Right_size <= max_size()); _STL_INTERNAL_CHECK(_Right_size <= max_size() - _Left_size); @@ -3092,13 +3092,13 @@ private: #if _HAS_CXX17 template >, enable_if_t, _Is_allocator<_Alloc>>, int> = 0> -basic_string(_Iter, _Iter, _Alloc = _Alloc()) - -> basic_string<_Iter_value_t<_Iter>, char_traits<_Iter_value_t<_Iter>>, _Alloc>; +basic_string( + _Iter, _Iter, _Alloc = _Alloc()) -> basic_string<_Iter_value_t<_Iter>, char_traits<_Iter_value_t<_Iter>>, _Alloc>; template , enable_if_t<_Is_allocator<_Alloc>::value, int> = 0> -explicit basic_string(basic_string_view<_Elem, _Traits>, const _Alloc& = _Alloc()) - -> basic_string<_Elem, _Traits, _Alloc>; +explicit basic_string( + basic_string_view<_Elem, _Traits>, const _Alloc& = _Alloc()) -> basic_string<_Elem, _Traits, _Alloc>; template , enable_if_t<_Is_allocator<_Alloc>::value, int> = 0> @@ -3107,8 +3107,8 @@ basic_string(basic_string_view<_Elem, _Traits>, _Guide_size_type_t<_Alloc>, _Gui #if _HAS_CXX23 template <_RANGES input_range _Rng, _Allocator_for_container _Alloc = allocator<_RANGES range_value_t<_Rng>>> -basic_string(from_range_t, _Rng&&, _Alloc = _Alloc()) - -> basic_string<_RANGES range_value_t<_Rng>, char_traits<_RANGES range_value_t<_Rng>>, _Alloc>; +basic_string(from_range_t, _Rng&&, + _Alloc = _Alloc()) -> basic_string<_RANGES range_value_t<_Rng>, char_traits<_RANGES range_value_t<_Rng>>, _Alloc>; #endif // _HAS_CXX23 #endif // _HAS_CXX17 diff --git a/stl/inc/xtree b/stl/inc/xtree index 42c10a9534..f0848f56b4 100644 --- a/stl/inc/xtree +++ b/stl/inc/xtree @@ -903,7 +903,7 @@ public: template _Tree(const _Tree& _Right, _Any_alloc&& _Al) : _Mypair(_One_then_variadic_args_t{}, _Right.key_comp(), _One_then_variadic_args_t{}, - _STD forward<_Any_alloc>(_Al)) { + _STD forward<_Any_alloc>(_Al)) { auto&& _Alproxy = _GET_PROXY_ALLOCATOR(_Alnode, _Getal()); const auto _Scary = _Get_scary(); _Container_proxy_ptr<_Alty> _Proxy(_Alproxy, *_Scary); @@ -915,14 +915,14 @@ public: _Tree(_Tree&& _Right) : _Mypair(_One_then_variadic_args_t{}, _Right.key_comp(), // intentionally copy comparator, see LWG-2227 - _One_then_variadic_args_t{}, _STD move(_Right._Getal())) { + _One_then_variadic_args_t{}, _STD move(_Right._Getal())) { _Alloc_sentinel_and_proxy(); _Swap_val_excluding_comp(_Right); } _Tree(_Tree&& _Right, const allocator_type& _Al) : _Mypair(_One_then_variadic_args_t{}, _Right.key_comp(), // intentionally copy comparator, see LWG-2227 - _One_then_variadic_args_t{}, _Al) { + _One_then_variadic_args_t{}, _Al) { if constexpr (!_Alnode_traits::is_always_equal::value) { if (_Getal() != _Right._Getal()) { auto&& _Alproxy = _GET_PROXY_ALLOCATOR(_Alnode, _Getal()); @@ -1350,8 +1350,8 @@ public: #if _HAS_CXX23 template - requires _Is_transparent_v - && (!is_convertible_v<_Kx, const_iterator>) && (!is_convertible_v<_Kx, iterator>) + requires _Is_transparent_v && (!is_convertible_v<_Kx, const_iterator>) + && (!is_convertible_v<_Kx, iterator>) size_type erase(_Kx&& _Keyval) noexcept(noexcept(_Eqrange(_Keyval))) /* strengthened */ { return _Erase(_Eqrange(_Keyval)); } @@ -1754,8 +1754,8 @@ public: #if _HAS_CXX23 template - requires _Is_transparent_v - && (!is_convertible_v<_Kx, const_iterator>) && (!is_convertible_v<_Kx, iterator>) + requires _Is_transparent_v && (!is_convertible_v<_Kx, const_iterator>) + && (!is_convertible_v<_Kx, iterator>) node_type extract(_Kx&& _Keyval) { const const_iterator _Where = find(_Keyval); if (_Where == end()) { diff --git a/stl/inc/xutility b/stl/inc/xutility index cd5a0c206b..ade445a043 100644 --- a/stl/inc/xutility +++ b/stl/inc/xutility @@ -79,14 +79,14 @@ __declspec(noalias) void __cdecl __std_reverse_trivially_swappable_8(void* _Firs __declspec(noalias) void __cdecl __std_swap_ranges_trivially_swappable_noalias( void* _First1, void* _Last1, void* _First2) noexcept; -__declspec(noalias) size_t - __stdcall __std_count_trivial_1(const void* _First, const void* _Last, uint8_t _Val) noexcept; -__declspec(noalias) size_t - __stdcall __std_count_trivial_2(const void* _First, const void* _Last, uint16_t _Val) noexcept; -__declspec(noalias) size_t - __stdcall __std_count_trivial_4(const void* _First, const void* _Last, uint32_t _Val) noexcept; -__declspec(noalias) size_t - __stdcall __std_count_trivial_8(const void* _First, const void* _Last, uint64_t _Val) noexcept; +__declspec(noalias) size_t __stdcall __std_count_trivial_1( + const void* _First, const void* _Last, uint8_t _Val) noexcept; +__declspec(noalias) size_t __stdcall __std_count_trivial_2( + const void* _First, const void* _Last, uint16_t _Val) noexcept; +__declspec(noalias) size_t __stdcall __std_count_trivial_4( + const void* _First, const void* _Last, uint32_t _Val) noexcept; +__declspec(noalias) size_t __stdcall __std_count_trivial_8( + const void* _First, const void* _Last, uint64_t _Val) noexcept; const void* __stdcall __std_find_trivial_1(const void* _First, const void* _Last, uint8_t _Val) noexcept; const void* __stdcall __std_find_trivial_2(const void* _First, const void* _Last, uint16_t _Val) noexcept; @@ -439,7 +439,7 @@ _EXPORT_STD template ::new (static_cast(_Location)) _Ty(_STD forward<_Types>(_Args)...); // per LWG-3888 } constexpr _Ty* construct_at(_Ty* const _Location, _Types&&... _Args) noexcept( - noexcept(::new(static_cast(_Location)) _Ty(_STD forward<_Types>(_Args)...))) /* strengthened */ { + noexcept(::new (static_cast(_Location)) _Ty(_STD forward<_Types>(_Args)...))) /* strengthened */ { _MSVC_CONSTEXPR return ::new (static_cast(_Location)) _Ty(_STD forward<_Types>(_Args)...); } #endif // _HAS_CXX20 @@ -836,7 +836,7 @@ namespace ranges { public: template requires (_Choice<_Ty>._Strategy != _St::_None) - _NODISCARD _STATIC_CALL_OPERATOR constexpr decltype(auto) operator()(_Ty && _Val) _CONST_CALL_OPERATOR + _NODISCARD _STATIC_CALL_OPERATOR constexpr decltype(auto) operator()(_Ty&& _Val) _CONST_CALL_OPERATOR noexcept(_Choice<_Ty>._No_throw) { constexpr _St _Strat = _Choice<_Ty>._Strategy; @@ -1755,16 +1755,16 @@ public: return current; } - _NODISCARD _CONSTEXPR17 reference operator*() const noexcept(is_nothrow_copy_constructible_v<_BidIt> // - && noexcept(*--(_STD declval<_BidIt&>()))) /* strengthened */ { + _NODISCARD _CONSTEXPR17 reference operator*() const + noexcept(is_nothrow_copy_constructible_v<_BidIt> // + && noexcept(*--(_STD declval<_BidIt&>()))) /* strengthened */ { _BidIt _Tmp = current; return *--_Tmp; } - _NODISCARD _CONSTEXPR17 pointer operator->() const - noexcept(is_nothrow_copy_constructible_v<_BidIt> // - && noexcept(--(_STD declval<_BidIt&>())) - && _Has_nothrow_operator_arrow<_BidIt&, pointer>) /* strengthened */ + _NODISCARD _CONSTEXPR17 pointer operator->() const noexcept( + is_nothrow_copy_constructible_v<_BidIt> // + && noexcept(--(_STD declval<_BidIt&>())) && _Has_nothrow_operator_arrow<_BidIt&, pointer>) /* strengthened */ #if _HAS_CXX20 requires (is_pointer_v<_BidIt> || requires(const _BidIt __i) { __i.operator->(); }) #endif @@ -1784,7 +1784,7 @@ public: } _CONSTEXPR17 reverse_iterator operator++(int) noexcept(is_nothrow_copy_constructible_v<_BidIt> // - && noexcept(--current)) /* strengthened */ { + && noexcept(--current)) /* strengthened */ { reverse_iterator _Tmp = *this; --current; return _Tmp; @@ -1796,7 +1796,7 @@ public: } _CONSTEXPR17 reverse_iterator operator--(int) noexcept(is_nothrow_copy_constructible_v<_BidIt> // - && noexcept(++current)) /* strengthened */ { + && noexcept(++current)) /* strengthened */ { reverse_iterator _Tmp = *this; ++current; return _Tmp; @@ -1832,7 +1832,7 @@ public: #if _HAS_CXX20 _NODISCARD friend constexpr iter_rvalue_reference_t<_BidIt> iter_move(const reverse_iterator& _It) noexcept( is_nothrow_copy_constructible_v<_BidIt> // - && noexcept(_RANGES iter_move(--_STD declval<_BidIt&>()))) { + && noexcept(_RANGES iter_move(--_STD declval<_BidIt&>()))) { auto _Tmp = _It.current; --_Tmp; return _RANGES iter_move(_Tmp); @@ -1840,9 +1840,8 @@ public: template _BidIt2> friend constexpr void iter_swap(const reverse_iterator& _Left, const reverse_iterator<_BidIt2>& _Right) noexcept( - is_nothrow_copy_constructible_v<_BidIt> - && is_nothrow_copy_constructible_v<_BidIt2> // - && noexcept(_RANGES iter_swap(--_STD declval<_BidIt&>(), --_STD declval<_BidIt2&>()))) { + is_nothrow_copy_constructible_v<_BidIt> && is_nothrow_copy_constructible_v<_BidIt2> // + && noexcept(_RANGES iter_swap(--_STD declval<_BidIt&>(), --_STD declval<_BidIt2&>()))) { auto _LTmp = _Left.current; auto _RTmp = _Right.base(); --_LTmp; @@ -2039,14 +2038,14 @@ _NODISCARD constexpr _Ty* end(_Ty (&_Array)[_Size]) noexcept { } _EXPORT_STD template -_NODISCARD constexpr auto cbegin(const _Container& _Cont) noexcept(noexcept(_STD begin(_Cont))) - -> decltype(_STD begin(_Cont)) { +_NODISCARD constexpr auto cbegin(const _Container& _Cont) noexcept( + noexcept(_STD begin(_Cont))) -> decltype(_STD begin(_Cont)) { return _STD begin(_Cont); } _EXPORT_STD template -_NODISCARD constexpr auto cend(const _Container& _Cont) noexcept(noexcept(_STD end(_Cont))) - -> decltype(_STD end(_Cont)) { +_NODISCARD constexpr auto cend(const _Container& _Cont) noexcept( + noexcept(_STD end(_Cont))) -> decltype(_STD end(_Cont)) { return _STD end(_Cont); } @@ -4123,9 +4122,10 @@ namespace ranges { subrange(_It, _Se, _Make_unsigned_like_t>) -> subrange<_It, _Se, subrange_kind::sized>; template - subrange(_Rng&&) -> subrange, sentinel_t<_Rng>, - (sized_range<_Rng> || sized_sentinel_for, iterator_t<_Rng>>) ? subrange_kind::sized - : subrange_kind::unsized>; + subrange(_Rng&&) + -> subrange, sentinel_t<_Rng>, + (sized_range<_Rng> || sized_sentinel_for, iterator_t<_Rng>>) ? subrange_kind::sized + : subrange_kind::unsized>; template subrange(_Rng&&, _Make_unsigned_like_t>) @@ -4288,7 +4288,7 @@ public: } _CONSTEXPR17 auto operator++(int) noexcept(is_nothrow_copy_constructible_v<_Iter> // - && noexcept(++_Current)) /* strengthened */ { + && noexcept(++_Current)) /* strengthened */ { #if _HAS_CXX20 if constexpr (forward_iterator<_Iter>) { #endif // _HAS_CXX20 @@ -4308,21 +4308,21 @@ public: } _CONSTEXPR17 move_iterator operator--(int) noexcept(is_nothrow_copy_constructible_v<_Iter> // - && noexcept(--_Current)) /* strengthened */ { + && noexcept(--_Current)) /* strengthened */ { move_iterator _Tmp = *this; --_Current; return _Tmp; } template - _NODISCARD auto operator==(_Default_sentinel _Sentinel) const noexcept - -> decltype(_STD declval() == _Sentinel) { + _NODISCARD auto operator==( + _Default_sentinel _Sentinel) const noexcept -> decltype(_STD declval() == _Sentinel) { return _Current == _Sentinel; } template - _NODISCARD auto operator!=(_Default_sentinel _Sentinel) const noexcept - -> decltype(_STD declval() != _Sentinel) { + _NODISCARD auto operator!=( + _Default_sentinel _Sentinel) const noexcept -> decltype(_STD declval() != _Sentinel) { return _Current != _Sentinel; } diff --git a/stl/src/vector_algorithms.cpp b/stl/src/vector_algorithms.cpp index b8a3649b67..657feab547 100644 --- a/stl/src/vector_algorithms.cpp +++ b/stl/src/vector_algorithms.cpp @@ -2709,8 +2709,8 @@ namespace { }; template - __declspec(noalias) size_t - __stdcall __std_count_trivial_impl(const void* _First, const void* const _Last, const _Ty _Val) noexcept { + __declspec(noalias) size_t __stdcall __std_count_trivial_impl( + const void* _First, const void* const _Last, const _Ty _Val) noexcept { size_t _Result = 0; #ifndef _M_ARM64EC @@ -3473,23 +3473,23 @@ const void* __stdcall __std_find_last_trivial_8( return __std_find_last_trivial_impl<_Find_traits_8>(_First, _Last, _Val); } -__declspec(noalias) size_t - __stdcall __std_count_trivial_1(const void* const _First, const void* const _Last, const uint8_t _Val) noexcept { +__declspec(noalias) size_t __stdcall __std_count_trivial_1( + const void* const _First, const void* const _Last, const uint8_t _Val) noexcept { return __std_count_trivial_impl<_Count_traits_1>(_First, _Last, _Val); } -__declspec(noalias) size_t - __stdcall __std_count_trivial_2(const void* const _First, const void* const _Last, const uint16_t _Val) noexcept { +__declspec(noalias) size_t __stdcall __std_count_trivial_2( + const void* const _First, const void* const _Last, const uint16_t _Val) noexcept { return __std_count_trivial_impl<_Count_traits_2>(_First, _Last, _Val); } -__declspec(noalias) size_t - __stdcall __std_count_trivial_4(const void* const _First, const void* const _Last, const uint32_t _Val) noexcept { +__declspec(noalias) size_t __stdcall __std_count_trivial_4( + const void* const _First, const void* const _Last, const uint32_t _Val) noexcept { return __std_count_trivial_impl<_Count_traits_4>(_First, _Last, _Val); } -__declspec(noalias) size_t - __stdcall __std_count_trivial_8(const void* const _First, const void* const _Last, const uint64_t _Val) noexcept { +__declspec(noalias) size_t __stdcall __std_count_trivial_8( + const void* const _First, const void* const _Last, const uint64_t _Val) noexcept { return __std_count_trivial_impl<_Count_traits_8>(_First, _Last, _Val); } @@ -3523,23 +3523,23 @@ const void* __stdcall __std_search_2( return __std_search_impl<_Find_traits_2, uint16_t>(_First1, _Last1, _First2, _Count2); } -__declspec(noalias) size_t - __stdcall __std_mismatch_1(const void* const _First1, const void* const _First2, const size_t _Count) noexcept { +__declspec(noalias) size_t __stdcall __std_mismatch_1( + const void* const _First1, const void* const _First2, const size_t _Count) noexcept { return __std_mismatch_impl<_Find_traits_1, uint8_t>(_First1, _First2, _Count); } -__declspec(noalias) size_t - __stdcall __std_mismatch_2(const void* const _First1, const void* const _First2, const size_t _Count) noexcept { +__declspec(noalias) size_t __stdcall __std_mismatch_2( + const void* const _First1, const void* const _First2, const size_t _Count) noexcept { return __std_mismatch_impl<_Find_traits_2, uint16_t>(_First1, _First2, _Count); } -__declspec(noalias) size_t - __stdcall __std_mismatch_4(const void* const _First1, const void* const _First2, const size_t _Count) noexcept { +__declspec(noalias) size_t __stdcall __std_mismatch_4( + const void* const _First1, const void* const _First2, const size_t _Count) noexcept { return __std_mismatch_impl<_Find_traits_4, uint32_t>(_First1, _First2, _Count); } -__declspec(noalias) size_t - __stdcall __std_mismatch_8(const void* const _First1, const void* const _First2, const size_t _Count) noexcept { +__declspec(noalias) size_t __stdcall __std_mismatch_8( + const void* const _First1, const void* const _First2, const size_t _Count) noexcept { return __std_mismatch_impl<_Find_traits_8, uint64_t>(_First1, _First2, _Count); } diff --git a/stl/src/xfvalues.cpp b/stl/src/xfvalues.cpp index d0329ee486..71f6af41bc 100644 --- a/stl/src/xfvalues.cpp +++ b/stl/src/xfvalues.cpp @@ -13,10 +13,8 @@ // macros #define NBITS (16 + _FOFF) -#define INIT(w0) \ - { 0, w0 } -#define INIT2(w0, w1) \ - { w1, w0 } +#define INIT(w0) {0, w0} +#define INIT2(w0, w1) {w1, w0} _EXTERN_C_UNLESS_PURE diff --git a/stl/src/xlvalues.cpp b/stl/src/xlvalues.cpp index 7ec133738c..06d08e1b71 100644 --- a/stl/src/xlvalues.cpp +++ b/stl/src/xlvalues.cpp @@ -13,10 +13,8 @@ // macros -- 64-bit #define NBITS (48 + _DOFF) -#define INIT(w0) \ - { 0, 0, 0, w0 } -#define INIT2(w0, w1) \ - { w1, 0, 0, w0 } +#define INIT(w0) {0, 0, 0, w0} +#define INIT2(w0, w1) {w1, 0, 0, w0} // static data extern /* const */ _Dconst _LDenorm = {INIT2(0, 1)}; diff --git a/stl/src/xvalues.cpp b/stl/src/xvalues.cpp index 1d9a1fb1e3..83728371fb 100644 --- a/stl/src/xvalues.cpp +++ b/stl/src/xvalues.cpp @@ -14,10 +14,8 @@ // macros #define NBITS (48 + _DOFF) -#define INIT(w0) \ - { 0, 0, 0, w0 } -#define INIT2(w0, w1) \ - { w1, 0, 0, w0 } +#define INIT(w0) {0, 0, 0, w0} +#define INIT2(w0, w1) {w1, 0, 0, w0} // static data extern /* const */ _Dconst _Denorm = {INIT2(0, 1)}; diff --git a/tests/std/include/range_algorithm_support.hpp b/tests/std/include/range_algorithm_support.hpp index eb8e8247a0..bacd8e809a 100644 --- a/tests/std/include/range_algorithm_support.hpp +++ b/tests/std/include/range_algorithm_support.hpp @@ -672,7 +672,7 @@ namespace test { } using unwrap = std::conditional_t, Element*, - iterator>; + iterator>; using unwrapping_ignorant = iterator; [[nodiscard]] constexpr auto _Unwrapped() const& noexcept @@ -745,7 +745,7 @@ template > { using pointer = ::test::iterator; + ::test::ProxyRef::no, Wrapped>; using element_type = Element; using difference_type = ptrdiff_t; diff --git a/tests/std/tests/Dev11_0289403_partition_point_complexity/test.cpp b/tests/std/tests/Dev11_0289403_partition_point_complexity/test.cpp index dd67957c7b..5b53e6604e 100644 --- a/tests/std/tests/Dev11_0289403_partition_point_complexity/test.cpp +++ b/tests/std/tests/Dev11_0289403_partition_point_complexity/test.cpp @@ -77,10 +77,8 @@ int main() { forward_list fl(v.begin(), v.end()); for (int x = 0; x <= k; ++x) { - test_partition_point( - v, [x](int e) { return e < x; }, x); - test_partition_point( - fl, [x](int e) { return e < x; }, x); + test_partition_point(v, [x](int e) { return e < x; }, x); + test_partition_point(fl, [x](int e) { return e < x; }, x); } } diff --git a/tests/std/tests/GH_000140_adl_proof_comparison/test.compile.pass.cpp b/tests/std/tests/GH_000140_adl_proof_comparison/test.compile.pass.cpp index 70c5665ca4..865cfbbac5 100644 --- a/tests/std/tests/GH_000140_adl_proof_comparison/test.compile.pass.cpp +++ b/tests/std/tests/GH_000140_adl_proof_comparison/test.compile.pass.cpp @@ -142,34 +142,34 @@ struct validating_iterator_provider::iterator { } template , int> = 0> - friend constexpr auto operator==(iterator i, OtherIter j) noexcept - -> decltype(pointer{} == typename OtherIter::pointer{} ? placeholder_addr : nullptr) { + friend constexpr auto operator==(iterator i, + OtherIter j) noexcept -> decltype(pointer{} == typename OtherIter::pointer{} ? placeholder_addr : nullptr) { return i.operator->() == j.operator->() ? placeholder_addr : nullptr; } template , int> = 0> - friend constexpr auto operator!=(iterator i, OtherIter j) noexcept - -> decltype(pointer{} != typename OtherIter::pointer{} ? placeholder_addr : nullptr) { + friend constexpr auto operator!=(iterator i, + OtherIter j) noexcept -> decltype(pointer{} != typename OtherIter::pointer{} ? placeholder_addr : nullptr) { return i.operator->() != j.operator->() ? placeholder_addr : nullptr; } template , int> = 0> - friend constexpr auto operator<(iterator i, OtherIter j) noexcept - -> decltype(pointer{} < typename OtherIter::pointer{} ? placeholder_addr : nullptr) { + friend constexpr auto operator<(iterator i, + OtherIter j) noexcept -> decltype(pointer{} < typename OtherIter::pointer{} ? placeholder_addr : nullptr) { return i.operator->() < j.operator->() ? placeholder_addr : nullptr; } template , int> = 0> - friend constexpr auto operator>(iterator i, OtherIter j) noexcept - -> decltype(pointer{} > typename OtherIter::pointer{} ? placeholder_addr : nullptr) { + friend constexpr auto operator>(iterator i, + OtherIter j) noexcept -> decltype(pointer{} > typename OtherIter::pointer{} ? placeholder_addr : nullptr) { return i.operator->() > j.operator->() ? placeholder_addr : nullptr; } template , int> = 0> - friend constexpr auto operator<=(iterator i, OtherIter j) noexcept - -> decltype(pointer{} <= typename OtherIter::pointer{} ? placeholder_addr : nullptr) { + friend constexpr auto operator<=(iterator i, + OtherIter j) noexcept -> decltype(pointer{} <= typename OtherIter::pointer{} ? placeholder_addr : nullptr) { return i.operator->() <= j.operator->() ? placeholder_addr : nullptr; } template , int> = 0> - friend constexpr auto operator>=(iterator i, OtherIter j) noexcept - -> decltype(pointer{} >= typename OtherIter::pointer{} ? placeholder_addr : nullptr) { + friend constexpr auto operator>=(iterator i, + OtherIter j) noexcept -> decltype(pointer{} >= typename OtherIter::pointer{} ? placeholder_addr : nullptr) { return i.operator->() >= j.operator->() ? placeholder_addr : nullptr; } diff --git a/tests/std/tests/GH_001596_adl_proof_algorithms/test.compile.pass.cpp b/tests/std/tests/GH_001596_adl_proof_algorithms/test.compile.pass.cpp index cec3c700de..e1f614e1b7 100644 --- a/tests/std/tests/GH_001596_adl_proof_algorithms/test.compile.pass.cpp +++ b/tests/std/tests/GH_001596_adl_proof_algorithms/test.compile.pass.cpp @@ -40,8 +40,8 @@ struct tagged_less { template struct tagged_zero_equality { template - constexpr auto operator()(T&& t) const - -> decltype(std::forward(t) == std::remove_cv_t>{}) { + constexpr auto operator()( + T&& t) const -> decltype(std::forward(t) == std::remove_cv_t>{}) { return std::forward(t) == std::remove_cv_t>{}; } }; diff --git a/tests/std/tests/P0218R1_filesystem/test.cpp b/tests/std/tests/P0218R1_filesystem/test.cpp index c1c17d9741..7f656e02a7 100644 --- a/tests/std/tests/P0218R1_filesystem/test.cpp +++ b/tests/std/tests/P0218R1_filesystem/test.cpp @@ -1284,10 +1284,7 @@ void test_directory_iterator_common_parts(const string_view typeName) { EXPECT(throws_filesystem_error([&] { DirectoryIterator bad_dir{nonexistent}; }, typeName, nonexistent)); EXPECT(throws_filesystem_error( - [&] { - DirectoryIterator bad_dir{nonexistent, directory_options::none}; - }, - typeName, nonexistent)); + [&] { DirectoryIterator bad_dir{nonexistent, directory_options::none}; }, typeName, nonexistent)); } // Test VSO-844835 "directory_iterator constructed with empty path iterates over the current directory" @@ -3030,9 +3027,8 @@ void test_locale_conversions() { const path p4(utf8_koshka_cat.begin(), utf8_koshka_cat.end(), utf8_locale); EXPECT(p4.native() == utf16_koshka_cat); - EXPECT(throws_system_error([&] { - (void) path{utf8_koshka_cat.begin() + 1, utf8_koshka_cat.end(), utf8_locale}; - })); + EXPECT( + throws_system_error([&] { (void) path{utf8_koshka_cat.begin() + 1, utf8_koshka_cat.end(), utf8_locale}; })); } } diff --git a/tests/std/tests/P0355R7_calendars_and_time_zones_clocks/test.cpp b/tests/std/tests/P0355R7_calendars_and_time_zones_clocks/test.cpp index eb4812739b..09cb4b1f4b 100644 --- a/tests/std/tests/P0355R7_calendars_and_time_zones_clocks/test.cpp +++ b/tests/std/tests/P0355R7_calendars_and_time_zones_clocks/test.cpp @@ -385,9 +385,8 @@ tzdb copy_tzdb() { const auto& my_tzdb = get_tzdb_list().front(); vector zones; vector links; - transform(my_tzdb.zones.begin(), my_tzdb.zones.end(), back_inserter(zones), [](const auto& tz) { - return time_zone{_Secret_time_zone_construct_tag{}, tz.name()}; - }); + transform(my_tzdb.zones.begin(), my_tzdb.zones.end(), back_inserter(zones), + [](const auto& tz) { return time_zone{_Secret_time_zone_construct_tag{}, tz.name()}; }); transform(my_tzdb.links.begin(), my_tzdb.links.end(), back_inserter(links), [](const auto& link) { return time_zone_link{_Secret_time_zone_link_construct_tag{}, link.name(), link.target()}; }); diff --git a/tests/std/tests/P0355R7_calendars_and_time_zones_io/test.cpp b/tests/std/tests/P0355R7_calendars_and_time_zones_io/test.cpp index 64fbc3c229..8b394ab63c 100644 --- a/tests/std/tests/P0355R7_calendars_and_time_zones_io/test.cpp +++ b/tests/std/tests/P0355R7_calendars_and_time_zones_io/test.cpp @@ -921,9 +921,8 @@ tzdb copy_tzdb() { const auto& my_tzdb = get_tzdb_list().front(); vector zones; vector links; - transform(my_tzdb.zones.begin(), my_tzdb.zones.end(), back_inserter(zones), [](const auto& tz) { - return time_zone{_Secret_time_zone_construct_tag{}, tz.name()}; - }); + transform(my_tzdb.zones.begin(), my_tzdb.zones.end(), back_inserter(zones), + [](const auto& tz) { return time_zone{_Secret_time_zone_construct_tag{}, tz.name()}; }); transform(my_tzdb.links.begin(), my_tzdb.links.end(), back_inserter(links), [](const auto& link) { return time_zone_link{_Secret_time_zone_link_construct_tag{}, link.name(), link.target()}; }); diff --git a/tests/std/tests/P0896R4_ranges_alg_find_first_of/test.cpp b/tests/std/tests/P0896R4_ranges_alg_find_first_of/test.cpp index 6f3ede0113..02e891e71b 100644 --- a/tests/std/tests/P0896R4_ranges_alg_find_first_of/test.cpp +++ b/tests/std/tests/P0896R4_ranges_alg_find_first_of/test.cpp @@ -73,8 +73,8 @@ int main() { #else // ^^^ test all range combinations / test only interesting range combos vvv constexpr bool run_tests() { // The algorithm is oblivious to anything except maybe proxies so take the bare minimum input/forward range - using in_test_range = test::range; + using in_test_range = test::range; using fwd_test_range = test::range; diff --git a/tests/std/tests/P0896R4_ranges_alg_is_permutation/test.cpp b/tests/std/tests/P0896R4_ranges_alg_is_permutation/test.cpp index c10fd58c63..8c20e4f066 100644 --- a/tests/std/tests/P0896R4_ranges_alg_is_permutation/test.cpp +++ b/tests/std/tests/P0896R4_ranges_alg_is_permutation/test.cpp @@ -131,8 +131,7 @@ struct instantiator { assert(!ranges::is_permutation(r1, r2)); assert(!ranges::is_permutation(r1, r2, {}, {}, [](int n) { return n - 1; })); assert(ranges::is_permutation(r1, r2, {}, {}, [](int n) { return n - 2; })); - assert(ranges::is_permutation( - r1, r2, {}, [](int n) { return n + 1; }, [](int n) { return n - 1; })); + assert(ranges::is_permutation(r1, r2, {}, [](int n) { return n + 1; }, [](int n) { return n - 1; })); } { // Test GH-2888: ``: `ranges::is_permutation`'s helper lambda does not specify return type struct NonCopyableBool { diff --git a/tests/std/tests/P0896R4_ranges_alg_partition_copy/test.cpp b/tests/std/tests/P0896R4_ranges_alg_partition_copy/test.cpp index b48007bfb7..3af2b9d04d 100644 --- a/tests/std/tests/P0896R4_ranges_alg_partition_copy/test.cpp +++ b/tests/std/tests/P0896R4_ranges_alg_partition_copy/test.cpp @@ -74,8 +74,7 @@ struct partition_copy_test { ranges::fill(dest, P{-1, 13}); const R range{source}; - auto result = partition_copy( - range, O1{dest}, O2{dest + i}, [i](int x) { return x < i; }, get_first); + auto result = partition_copy(range, O1{dest}, O2{dest + i}, [i](int x) { return x < i; }, get_first); assert(result.in == range.end()); assert(result.out1.peek() == dest + i); assert(result.out2.peek() == dest + N); diff --git a/tests/std/tests/P0896R4_ranges_alg_search/test.cpp b/tests/std/tests/P0896R4_ranges_alg_search/test.cpp index 78fa57aff2..cb860bfc05 100644 --- a/tests/std/tests/P0896R4_ranges_alg_search/test.cpp +++ b/tests/std/tests/P0896R4_ranges_alg_search/test.cpp @@ -159,8 +159,8 @@ constexpr bool run_tests() { { // Validate the memcmp optimization const int haystack[] = {1, 2, 3, 1, 2, 3, 1, 2, 3}; - const int needle[] = {1, 2, 3}; - const auto result = ranges::search(span{haystack}, needle); + const int needle[] = {1, 2, 3}; + const auto result = ranges::search(span{haystack}, needle); static_assert(same_as::iterator>>); assert(to_address(result.begin()) == haystack + 0); assert(to_address(result.end()) == haystack + 3); diff --git a/tests/std/tests/P0896R4_ranges_alg_uninitialized_copy/test.cpp b/tests/std/tests/P0896R4_ranges_alg_uninitialized_copy/test.cpp index fb707534e1..0c05bcbc0c 100644 --- a/tests/std/tests/P0896R4_ranges_alg_uninitialized_copy/test.cpp +++ b/tests/std/tests/P0896R4_ranges_alg_uninitialized_copy/test.cpp @@ -271,7 +271,7 @@ struct memcpy_test { template using test_input = test::range; + test::CanCompare::no, IsProxy>; using test_output = test::range; diff --git a/tests/std/tests/P0896R4_ranges_alg_uninitialized_copy_n/test.cpp b/tests/std/tests/P0896R4_ranges_alg_uninitialized_copy_n/test.cpp index 92d0037479..a21e074f57 100644 --- a/tests/std/tests/P0896R4_ranges_alg_uninitialized_copy_n/test.cpp +++ b/tests/std/tests/P0896R4_ranges_alg_uninitialized_copy_n/test.cpp @@ -235,7 +235,7 @@ struct memcpy_test { template using test_input = test::range; + test::CanCompare::no, IsProxy>; using test_output = test::range; diff --git a/tests/std/tests/P0896R4_ranges_alg_uninitialized_move/test.cpp b/tests/std/tests/P0896R4_ranges_alg_uninitialized_move/test.cpp index dc5b5b6af7..8c9e27af3b 100644 --- a/tests/std/tests/P0896R4_ranges_alg_uninitialized_move/test.cpp +++ b/tests/std/tests/P0896R4_ranges_alg_uninitialized_move/test.cpp @@ -261,7 +261,7 @@ struct memcpy_test { template using test_input = test::range; + test::CanCompare::no, IsProxy>; using test_output = test::range; diff --git a/tests/std/tests/P0896R4_ranges_alg_uninitialized_move_n/test.cpp b/tests/std/tests/P0896R4_ranges_alg_uninitialized_move_n/test.cpp index e0bd3f4ba4..5878d39727 100644 --- a/tests/std/tests/P0896R4_ranges_alg_uninitialized_move_n/test.cpp +++ b/tests/std/tests/P0896R4_ranges_alg_uninitialized_move_n/test.cpp @@ -236,7 +236,7 @@ struct memcpy_test { template using test_input = test::range; + test::CanCompare::no, IsProxy>; using test_output = test::range; diff --git a/tests/std/tests/P0896R4_views_lazy_split/test.cpp b/tests/std/tests/P0896R4_views_lazy_split/test.cpp index ccbbfe4f35..e2aa5b8664 100644 --- a/tests/std/tests/P0896R4_views_lazy_split/test.cpp +++ b/tests/std/tests/P0896R4_views_lazy_split/test.cpp @@ -56,7 +56,7 @@ constexpr void test_one(Base&& base, Delimiter&& delimiter, Expected&& expected) static_assert(CanViewLazySplit == (!is_view || copy_constructible>) ); if constexpr (CanViewLazySplit) { // Validate lvalue constexpr bool is_noexcept = - (!is_view || is_nothrow_copy_constructible_v>) &&is_nothrow_copy_constructible_v; + (!is_view || is_nothrow_copy_constructible_v>) && is_nothrow_copy_constructible_v; static_assert(same_as); static_assert(noexcept(views::lazy_split(base, delimiter)) == is_noexcept); diff --git a/tests/std/tests/P0896R4_views_split/test.cpp b/tests/std/tests/P0896R4_views_split/test.cpp index 2d0bcd18d8..2534520a7e 100644 --- a/tests/std/tests/P0896R4_views_split/test.cpp +++ b/tests/std/tests/P0896R4_views_split/test.cpp @@ -58,7 +58,7 @@ constexpr void test_one(Base&& base, Delimiter&& delimiter, Expected&& expected) static_assert(CanViewSplit == (!is_view || copy_constructible>) ); if constexpr (CanViewSplit) { // Validate lvalue constexpr bool is_noexcept = - (!is_view || is_nothrow_copy_constructible_v>) &&is_nothrow_copy_constructible_v; + (!is_view || is_nothrow_copy_constructible_v>) && is_nothrow_copy_constructible_v; static_assert(same_as); static_assert(noexcept(views::split(base, delimiter)) == is_noexcept); diff --git a/tests/std/tests/P0896R4_views_transform/test.cpp b/tests/std/tests/P0896R4_views_transform/test.cpp index 0d0dd04bc6..eb2c729102 100644 --- a/tests/std/tests/P0896R4_views_transform/test.cpp +++ b/tests/std/tests/P0896R4_views_transform/test.cpp @@ -180,7 +180,7 @@ constexpr bool test_one(Rng&& rng, Expected&& expected) { } } - static_assert(CanMemberEmpty == ((sized_range || forward_range) &&const_invocable)); + static_assert(CanMemberEmpty == ((sized_range || forward_range) && const_invocable)); static_assert(CanBool == CanEmpty); if constexpr (CanMemberEmpty) { assert(as_const(r).empty() == is_empty); diff --git a/tests/std/tests/P0898R3_concepts/invocable_cc.hpp b/tests/std/tests/P0898R3_concepts/invocable_cc.hpp index c9846f969c..fdafd627ff 100644 --- a/tests/std/tests/P0898R3_concepts/invocable_cc.hpp +++ b/tests/std/tests/P0898R3_concepts/invocable_cc.hpp @@ -554,8 +554,8 @@ void NAME() { static_assert(test()); using PMF0RR = int (MCALLCONV S::*)()&&; - using PMF1RR = int* (MCALLCONV S::*) (long) &&; - using PMF2RR = int& (MCALLCONV S::*) (long, int) &&; + using PMF1RR = int* (MCALLCONV S::*) (long)&&; + using PMF2RR = int& (MCALLCONV S::*) (long, int)&&; using PMF1PRR = int const& (S::*) (int, ...)&&; static_assert(test()); static_assert(!test()); diff --git a/tests/std/tests/P0898R3_concepts/test.cpp b/tests/std/tests/P0898R3_concepts/test.cpp index 22b6dd0cdd..86aa9df97d 100644 --- a/tests/std/tests/P0898R3_concepts/test.cpp +++ b/tests/std/tests/P0898R3_concepts/test.cpp @@ -3323,7 +3323,7 @@ namespace test_relation { struct Equivalent { template - constexpr decltype(auto) operator()(T && t, U && u) const + constexpr decltype(auto) operator()(T&& t, U&& u) const requires requires { static_cast(t) == static_cast(u); } { return static_cast(t) == static_cast(u); diff --git a/tests/std/tests/P1645R1_constexpr_numeric/test.cpp b/tests/std/tests/P1645R1_constexpr_numeric/test.cpp index e557580f55..8a5842a193 100644 --- a/tests/std/tests/P1645R1_constexpr_numeric/test.cpp +++ b/tests/std/tests/P1645R1_constexpr_numeric/test.cpp @@ -11,21 +11,21 @@ using namespace std; struct not_std_plus { template - constexpr decltype(auto) operator()(T && t, U && u) const { + constexpr decltype(auto) operator()(T&& t, U&& u) const { return forward(t) + forward(u); } }; struct not_std_minus { template - constexpr decltype(auto) operator()(T && t, U && u) const { + constexpr decltype(auto) operator()(T&& t, U&& u) const { return forward(t) - forward(u); } }; struct not_std_multiplies { template - constexpr decltype(auto) operator()(T && t, U && u) const { + constexpr decltype(auto) operator()(T&& t, U&& u) const { return forward(t) * forward(u); } }; diff --git a/tests/std/tests/P2321R2_views_zip/test.cpp b/tests/std/tests/P2321R2_views_zip/test.cpp index 4de54111c0..5f370874c8 100644 --- a/tests/std/tests/P2321R2_views_zip/test.cpp +++ b/tests/std/tests/P2321R2_views_zip/test.cpp @@ -703,7 +703,7 @@ class instantiator_impl : private range_type_solver { using differing_size_member_range_type = range_type; using differing_is_common_range_type = range_type; + (IsCommon == test::Common::yes ? test::Common::no : test::Common::yes), Diff>; using differing_iterator_sentinel_diff_range_type = range_type; diff --git a/tests/std/tests/P2321R2_views_zip_transform/test.cpp b/tests/std/tests/P2321R2_views_zip_transform/test.cpp index c48172ab60..dd08fcb1b9 100644 --- a/tests/std/tests/P2321R2_views_zip_transform/test.cpp +++ b/tests/std/tests/P2321R2_views_zip_transform/test.cpp @@ -139,8 +139,8 @@ constexpr bool validate_iterators_sentinels( if constexpr (ranges::forward_range) { same_as> auto duplicate_itr = itr++; assert(*duplicate_itr == *ranges::begin(transformed_elements)); - static_assert(noexcept(itr++) - == is_nothrow_copy_constructible_v>&& noexcept(++itr)); + static_assert(noexcept(itr++) == is_nothrow_copy_constructible_v> + && noexcept(++itr)); } else { itr++; static_assert(noexcept(itr++) == noexcept(++itr)); @@ -150,8 +150,8 @@ constexpr bool validate_iterators_sentinels( if constexpr (ranges::bidirectional_range) { assert(*itr-- == transformed_elements[2]); - static_assert(noexcept(itr--) - == is_nothrow_copy_constructible_v>&& noexcept(--itr)); + static_assert(noexcept(itr--) == is_nothrow_copy_constructible_v> + && noexcept(--itr)); assert(*--itr == transformed_elements[0]); static_assert(noexcept(--itr) == noexcept(--declval&>())); @@ -696,9 +696,9 @@ class instantiator_impl : private range_type_solver { range_type, forward_iterator_tag, input_iterator_tag>, const int, IsSized, IsCommon, Diff>; using differing_size_member_range_type = range_type; + (IsSized == test::Sized::yes ? test::Sized::no : test::Sized::yes), IsCommon, Diff>; using differing_is_common_range_type = range_type; + (IsCommon == test::Common::yes ? test::Common::no : test::Common::yes), Diff>; using differing_iterator_sentinel_diff_range_type = range_type; diff --git a/tests/std/tests/P2374R4_views_cartesian_product/test.cpp b/tests/std/tests/P2374R4_views_cartesian_product/test.cpp index afeff50be6..8a63476a84 100644 --- a/tests/std/tests/P2374R4_views_cartesian_product/test.cpp +++ b/tests/std/tests/P2374R4_views_cartesian_product/test.cpp @@ -58,9 +58,8 @@ concept UnsignedIntegerLike = _Integer_like && !_Signed_integer_like; template constexpr bool is_iter_move_nothrow() { constexpr bool is_inner_iter_move_nothrow = - (noexcept(ranges::iter_move(declval&>())) - && ... // - && noexcept(ranges::iter_move(declval&>()))); + (noexcept(ranges::iter_move(declval&>())) && ... // + && noexcept(ranges::iter_move(declval&>()))); constexpr bool are_references_nothrow_movable = conjunction_v>, is_nothrow_move_constructible>...>; @@ -71,7 +70,7 @@ template constexpr bool is_iter_swap_nothrow() { return (noexcept(ranges::iter_swap(declval&>(), declval&>())) && ... // - && noexcept(ranges::iter_swap(declval&>(), declval&>()))); + && noexcept(ranges::iter_swap(declval&>(), declval&>()))); } template @@ -474,7 +473,7 @@ constexpr bool test_one(Expected&& expected_range, First&& first, Rest&&... rest if constexpr ((random_access_range && ... && random_access_range>) ) { // Check 3way comparisons using Cat = common_comparison_category_t>, - compare_three_way_result_t>>...>; + compare_three_way_result_t>>...>; auto i2 = r.begin(); same_as auto cmp1 = i <=> i2; assert(cmp1 == Cat::equivalent); @@ -791,7 +790,7 @@ constexpr void test_iter_swap(Rngs&... rngs) { } // Check iter_swap for cartesian_product_view::iterator - if constexpr (((CanMemberBegin && indirectly_swappable>) &&...)) { + if constexpr (((CanMemberBegin && indirectly_swappable>) && ...)) { using CVal = ranges::range_value_t; auto i = as_const(r).begin(); CVal first = *i; diff --git a/tests/std/tests/P2387R3_pipe_support_for_user_defined_range_adaptors/test.cpp b/tests/std/tests/P2387R3_pipe_support_for_user_defined_range_adaptors/test.cpp index 0d57f55415..ea545e4a99 100644 --- a/tests/std/tests/P2387R3_pipe_support_for_user_defined_range_adaptors/test.cpp +++ b/tests/std/tests/P2387R3_pipe_support_for_user_defined_range_adaptors/test.cpp @@ -40,7 +40,7 @@ constexpr bool is_range_adaptor_closure() { struct IdentityRangeAdaptorClosure : ranges::range_adaptor_closure { template - constexpr decltype(auto) operator()(T && range) const { + constexpr decltype(auto) operator()(T&& range) const { return forward(range); } }; diff --git a/tests/std/tests/P2441R2_views_join_with/test.cpp b/tests/std/tests/P2441R2_views_join_with/test.cpp index 4af69a6c4a..cc1d255977 100644 --- a/tests/std/tests/P2441R2_views_join_with/test.cpp +++ b/tests/std/tests/P2441R2_views_join_with/test.cpp @@ -112,7 +112,7 @@ constexpr void test_one(Outer&& rng, Delimiter&& delimiter, Expected&& expected) static_assert(CanViewJoinWith == (!is_view || copy_constructible) ); if constexpr (CanViewJoinWith) { constexpr bool is_noexcept = - (!is_view || is_nothrow_copy_constructible_v) &&is_nothrow_copy_constructible_v; + (!is_view || is_nothrow_copy_constructible_v) && is_nothrow_copy_constructible_v; static_assert(same_as); static_assert(noexcept(views::join_with(rng, delimiter)) == is_noexcept); @@ -127,7 +127,7 @@ constexpr void test_one(Outer&& rng, Delimiter&& delimiter, Expected&& expected) if constexpr (CanViewJoinWith&, Delimiter&>) { using RC = join_with_view&>, DV>; constexpr bool is_noexcept = - (!is_view || is_nothrow_copy_constructible_v) &&is_nothrow_copy_constructible_v; + (!is_view || is_nothrow_copy_constructible_v) && is_nothrow_copy_constructible_v; static_assert(same_as); static_assert(noexcept(views::join_with(as_const(rng), delimiter)) == is_noexcept); From 20c3d4161ad0cac39a61b2b51cfe9c75fe5e4dec Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Tue, 10 Sep 2024 17:46:49 -0700 Subject: [PATCH 17/30] Change AllowBreakBeforeNoexceptSpecifier from Never to OnlyWithParen. --- .clang-format | 1 + 1 file changed, 1 insertion(+) diff --git a/.clang-format b/.clang-format index f3a204fb33..ef32fa976c 100644 --- a/.clang-format +++ b/.clang-format @@ -70,6 +70,7 @@ AlignTrailingComments: # AllowAllArgumentsOnNextLine: true # AllowAllParametersOfDeclarationOnNextLine: true # AllowBreakBeforeNoexceptSpecifier: Never +AllowBreakBeforeNoexceptSpecifier: OnlyWithParen # AllowShortBlocksOnASingleLine: Never # AllowShortCaseLabelsOnASingleLine: false # AllowShortCompoundRequirementOnASingleLine: true From 8b164e9f967804161ff3dff7fa805d4cf604a009 Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Tue, 10 Sep 2024 17:51:56 -0700 Subject: [PATCH 18/30] Regen clang-format, no manual changes. --- stl/inc/__msvc_chrono.hpp | 192 ++-- stl/inc/__msvc_ranges_to.hpp | 128 +-- stl/inc/algorithm | 6 +- stl/inc/complex | 108 +- stl/inc/condition_variable | 4 +- stl/inc/deque | 4 +- stl/inc/expected | 181 ++-- stl/inc/format | 4 +- stl/inc/forward_list | 8 +- stl/inc/functional | 52 +- stl/inc/hash_map | 8 +- stl/inc/hash_set | 8 +- stl/inc/iterator | 100 +- stl/inc/list | 4 +- stl/inc/map | 12 +- stl/inc/mdspan | 45 +- stl/inc/memory | 14 +- stl/inc/optional | 162 +-- stl/inc/queue | 44 +- stl/inc/ranges | 994 +++++++++--------- stl/inc/regex | 4 +- stl/inc/set | 8 +- stl/inc/span | 4 +- stl/inc/sstream | 20 +- stl/inc/stack | 12 +- stl/inc/stacktrace | 4 +- stl/inc/stop_token | 8 +- stl/inc/tuple | 87 +- stl/inc/type_traits | 20 +- stl/inc/unordered_map | 12 +- stl/inc/unordered_set | 16 +- stl/inc/utility | 78 +- stl/inc/variant | 140 +-- stl/inc/vector | 28 +- stl/inc/xcall_once.h | 4 +- stl/inc/xhash | 20 +- stl/inc/xmemory | 24 +- stl/inc/xsmf_control.h | 16 +- stl/inc/xstring | 8 +- stl/inc/xutility | 266 +++-- tests/std/include/range_algorithm_support.hpp | 4 +- tests/std/tests/P0323R12_expected/test.cpp | 12 +- .../std/tests/P0768R1_spaceship_cpos/test.cpp | 8 +- .../std/tests/P1206R7_ranges_to_misc/test.cpp | 4 +- 44 files changed, 1438 insertions(+), 1447 deletions(-) diff --git a/stl/inc/__msvc_chrono.hpp b/stl/inc/__msvc_chrono.hpp index 08268b83b8..226df1df84 100644 --- a/stl/inc/__msvc_chrono.hpp +++ b/stl/inc/__msvc_chrono.hpp @@ -84,8 +84,8 @@ namespace chrono { 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 + 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 @@ -103,16 +103,16 @@ namespace chrono { enable_if_t && (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 + 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 + 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 */ { @@ -213,8 +213,8 @@ namespace chrono { : _MyDur(_Other) {} template , int> = 0> - constexpr time_point(const time_point<_Clock, _Duration2>& _Tp) noexcept( - is_arithmetic_v && is_arithmetic_v) // strengthened + 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 */ { @@ -285,17 +285,17 @@ struct common_type<_CHRONO time_point<_Clock, _Duration1>, 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 */ { + _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 */ { + _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()); } @@ -303,8 +303,8 @@ namespace chrono { _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 */ { + 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); @@ -312,9 +312,9 @@ namespace chrono { _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 */ { + _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; } @@ -336,98 +336,96 @@ namespace chrono { _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 */ { + 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 */ { + _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 */ { + 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 */ { + _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 */ { + _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 */ { + _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 */ { + _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 */ { + _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 */ { + _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 */ { + _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 */ { + _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 */ { + _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>; @@ -456,8 +454,8 @@ namespace chrono { } _EXPORT_STD template , int> = 0> - _NODISCARD constexpr _To floor(const duration<_Rep, _Period>& _Dur) noexcept( - is_arithmetic_v<_Rep> && is_arithmetic_v) /* strengthened */ { + _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)}; @@ -469,8 +467,8 @@ namespace chrono { } _EXPORT_STD template , int> = 0> - _NODISCARD constexpr _To ceil(const duration<_Rep, _Period>& _Dur) noexcept( - is_arithmetic_v<_Rep> && is_arithmetic_v) /* strengthened */ { + _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)}; @@ -489,8 +487,8 @@ namespace chrono { _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 */ { + _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}}; @@ -505,8 +503,8 @@ namespace chrono { } _EXPORT_STD template ::is_signed, int> = 0> - _NODISCARD constexpr duration<_Rep, _Period> abs(const duration<_Rep, _Period> _Dur) noexcept( - is_arithmetic_v<_Rep>) /* strengthened */ { + _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; @@ -529,113 +527,121 @@ namespace chrono { #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 */ { + _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 */ { + _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 */ { + _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( + _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( + _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( + _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( + _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( + _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( + _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( + _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( + _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 */ { + _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 */ { + _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 */ { + _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 */ { + _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())); } diff --git a/stl/inc/__msvc_ranges_to.hpp b/stl/inc/__msvc_ranges_to.hpp index 4810a44c42..524bb51f1a 100644 --- a/stl/inc/__msvc_ranges_to.hpp +++ b/stl/inc/__msvc_ranges_to.hpp @@ -112,15 +112,15 @@ namespace ranges { requires _Range_adaptor_closure_object<_Left> && _Range_adaptor_closure_object<_Right> && constructible_from, _Left> && constructible_from, _Right> - _NODISCARD constexpr auto operator|(_Left&& __l, _Right&& __r) noexcept( - noexcept(_Pipeline{static_cast<_Left&&>(__l), static_cast<_Right&&>(__r)})) { + _NODISCARD constexpr auto operator|(_Left&& __l, _Right&& __r) + noexcept(noexcept(_Pipeline{static_cast<_Left&&>(__l), static_cast<_Right&&>(__r)})) { return _Pipeline{static_cast<_Left&&>(__l), static_cast<_Right&&>(__r)}; } _EXPORT_STD template requires (_Range_adaptor_closure_object<_Right> && range<_Left>) - _NODISCARD constexpr decltype(auto) operator|(_Left&& __l, _Right&& __r) noexcept( - noexcept(_STD forward<_Right>(__r)(_STD forward<_Left>(__l)))) + _NODISCARD constexpr decltype(auto) operator|(_Left&& __l, _Right&& __r) + noexcept(noexcept(_STD forward<_Right>(__r)(_STD forward<_Left>(__l)))) requires requires { static_cast<_Right&&>(__r)(static_cast<_Left&&>(__l)); } { return _STD forward<_Right>(__r)(_STD forward<_Left>(__l)); @@ -147,8 +147,8 @@ namespace ranges { : _Val(), _Engaged{true} {} template - constexpr _Movable_box(in_place_t, _Types&&... _Args) noexcept( - is_nothrow_constructible_v<_Ty, _Types...>) // strengthened + constexpr _Movable_box(in_place_t, _Types&&... _Args) + noexcept(is_nothrow_constructible_v<_Ty, _Types...>) // strengthened : _Val(_STD forward<_Types>(_Args)...), _Engaged{true} {} constexpr ~_Movable_box() { @@ -187,8 +187,8 @@ namespace ranges { requires copyable<_Ty> && is_trivially_copy_assignable_v<_Ty> = default; // clang-format on - constexpr _Movable_box& operator=(const _Movable_box& _That) noexcept( - is_nothrow_copy_constructible_v<_Ty> && is_nothrow_copy_assignable_v<_Ty>) // strengthened + constexpr _Movable_box& operator=(const _Movable_box& _That) + noexcept(is_nothrow_copy_constructible_v<_Ty> && is_nothrow_copy_assignable_v<_Ty>) // strengthened requires copyable<_Ty> { if (_Engaged) { @@ -235,8 +235,8 @@ namespace ranges { requires movable<_Ty> && is_trivially_move_assignable_v<_Ty> = default; // clang-format on - constexpr _Movable_box& operator=(_Movable_box&& _That) noexcept( - is_nothrow_move_constructible_v<_Ty> && is_nothrow_move_assignable_v<_Ty>) // strengthened + constexpr _Movable_box& operator=(_Movable_box&& _That) + noexcept(is_nothrow_move_constructible_v<_Ty> && is_nothrow_move_assignable_v<_Ty>) // strengthened requires movable<_Ty> { if (_Engaged) { @@ -319,8 +319,8 @@ namespace ranges { // clang-format on template - constexpr _Movable_box(in_place_t, _Types&&... _Args) noexcept( - is_nothrow_constructible_v<_Ty, _Types...>) // strengthened + constexpr _Movable_box(in_place_t, _Types&&... _Args) + noexcept(is_nothrow_constructible_v<_Ty, _Types...>) // strengthened : _Val(_STD forward<_Types>(_Args)...) {} // clang-format off @@ -342,8 +342,8 @@ namespace ranges { _Movable_box& operator=(_Movable_box&&) requires movable<_Ty> && is_trivially_move_assignable_v<_Ty> = default; // clang-format on - constexpr _Movable_box& operator=(const _Movable_box& _That) noexcept( - is_nothrow_copy_assignable_v<_Ty> || !copyable<_Ty>) // strengthened + constexpr _Movable_box& operator=(const _Movable_box& _That) + noexcept(is_nothrow_copy_assignable_v<_Ty> || !copyable<_Ty>) // strengthened requires copy_constructible<_Ty> { if constexpr (copyable<_Ty>) { @@ -357,8 +357,8 @@ namespace ranges { return *this; } - constexpr _Movable_box& operator=(_Movable_box&& _That) noexcept( - is_nothrow_move_assignable_v<_Ty> || !movable<_Ty>) /* strengthened */ { + constexpr _Movable_box& operator=(_Movable_box&& _That) + noexcept(is_nothrow_move_assignable_v<_Ty> || !movable<_Ty>) /* strengthened */ { if constexpr (movable<_Ty>) { static_cast<_Ty&>(_Val) = static_cast<_Ty&&>(_That._Val); } else { @@ -399,8 +399,8 @@ namespace ranges { template requires (same_as, _Types> && ...) - constexpr explicit _Range_closure(_UTypes&&... _Args) noexcept( - conjunction_v...>) + constexpr explicit _Range_closure(_UTypes&&... _Args) + noexcept(conjunction_v...>) : _Captures(_STD forward<_UTypes>(_Args)...) {} void operator()(auto&&) & = delete; @@ -704,8 +704,8 @@ namespace ranges { _Iterator() requires default_initializable> = default; // clang-format on - constexpr _Iterator(_Parent_t& _Parent_, iterator_t<_Base> _Current_) noexcept( - is_nothrow_move_constructible_v>) // strengthened + constexpr _Iterator(_Parent_t& _Parent_, iterator_t<_Base> _Current_) + noexcept(is_nothrow_move_constructible_v>) // strengthened : _Current{_STD move(_Current_)}, _Parent{_STD addressof(_Parent_)} { #if _ITERATOR_DEBUG_LEVEL != 0 _STD _Adl_verify_range(_Current, _RANGES end(_Parent_._Range)); @@ -715,8 +715,8 @@ namespace ranges { #endif // _ITERATOR_DEBUG_LEVEL != 0 } - constexpr _Iterator(_Iterator _It) noexcept( - is_nothrow_constructible_v, iterator_t<_Vw>>) // strengthened + constexpr _Iterator(_Iterator _It) + noexcept(is_nothrow_constructible_v, iterator_t<_Vw>>) // strengthened requires _Const && convertible_to, iterator_t<_Base>> : _Current(_STD move(_It._Current)), _Parent(_It._Parent) {} @@ -773,8 +773,8 @@ namespace ranges { --_Current; return *this; } - constexpr _Iterator operator--(int) noexcept( - noexcept(--_Current) && is_nothrow_copy_constructible_v>) /* strengthened */ + constexpr _Iterator operator--(int) + noexcept(noexcept(--_Current) && is_nothrow_copy_constructible_v>) /* strengthened */ requires bidirectional_range<_Base> { auto _Tmp = *this; @@ -793,8 +793,8 @@ namespace ranges { } #endif // _ITERATOR_DEBUG_LEVEL != 0 - constexpr _Iterator& operator+=(const difference_type _Off) noexcept( - noexcept(_Current += _Off)) /* strengthened */ + constexpr _Iterator& operator+=(const difference_type _Off) + noexcept(noexcept(_Current += _Off)) /* strengthened */ requires random_access_range<_Base> { #if _ITERATOR_DEBUG_LEVEL != 0 @@ -803,8 +803,8 @@ namespace ranges { _Current += _Off; return *this; } - constexpr _Iterator& operator-=(const difference_type _Off) noexcept( - noexcept(_Current -= _Off)) /* strengthened */ + constexpr _Iterator& operator-=(const difference_type _Off) + noexcept(noexcept(_Current -= _Off)) /* strengthened */ requires random_access_range<_Base> { #if _ITERATOR_DEBUG_LEVEL != 0 @@ -827,8 +827,8 @@ namespace ranges { return _STD invoke(*_Parent->_Fun, _Current[_Idx]); } - _NODISCARD friend constexpr bool operator==(const _Iterator& _Left, const _Iterator& _Right) noexcept( - noexcept(_Left._Current == _Right._Current)) /* strengthened */ + _NODISCARD friend constexpr bool operator==(const _Iterator& _Left, const _Iterator& _Right) + noexcept(noexcept(_Left._Current == _Right._Current)) /* strengthened */ requires equality_comparable> { #if _ITERATOR_DEBUG_LEVEL != 0 @@ -837,8 +837,8 @@ namespace ranges { return _Left._Current == _Right._Current; } - _NODISCARD friend constexpr bool operator<(const _Iterator& _Left, const _Iterator& _Right) noexcept( - noexcept(_Left._Current < _Right._Current)) /* strengthened */ + _NODISCARD friend constexpr bool operator<(const _Iterator& _Left, const _Iterator& _Right) + noexcept(noexcept(_Left._Current < _Right._Current)) /* strengthened */ requires random_access_range<_Base> { #if _ITERATOR_DEBUG_LEVEL != 0 @@ -846,26 +846,26 @@ namespace ranges { #endif // _ITERATOR_DEBUG_LEVEL != 0 return _Left._Current < _Right._Current; } - _NODISCARD friend constexpr bool operator>(const _Iterator& _Left, const _Iterator& _Right) noexcept( - noexcept(_Left._Current < _Right._Current)) /* strengthened */ + _NODISCARD friend constexpr bool operator>(const _Iterator& _Left, const _Iterator& _Right) + noexcept(noexcept(_Left._Current < _Right._Current)) /* strengthened */ requires random_access_range<_Base> { return _Right < _Left; } - _NODISCARD friend constexpr bool operator<=(const _Iterator& _Left, const _Iterator& _Right) noexcept( - noexcept(_Left._Current < _Right._Current)) /* strengthened */ + _NODISCARD friend constexpr bool operator<=(const _Iterator& _Left, const _Iterator& _Right) + noexcept(noexcept(_Left._Current < _Right._Current)) /* strengthened */ requires random_access_range<_Base> { return !(_Right < _Left); } - _NODISCARD friend constexpr bool operator>=(const _Iterator& _Left, const _Iterator& _Right) noexcept( - noexcept(_Left._Current < _Right._Current)) /* strengthened */ + _NODISCARD friend constexpr bool operator>=(const _Iterator& _Left, const _Iterator& _Right) + noexcept(noexcept(_Left._Current < _Right._Current)) /* strengthened */ requires random_access_range<_Base> { return !(_Left < _Right); } - _NODISCARD friend constexpr auto operator<=>(const _Iterator& _Left, const _Iterator& _Right) noexcept( - noexcept(_Left._Current <=> _Right._Current)) /* strengthened */ + _NODISCARD friend constexpr auto operator<=>(const _Iterator& _Left, const _Iterator& _Right) + noexcept(noexcept(_Left._Current <=> _Right._Current)) /* strengthened */ requires random_access_range<_Base> && three_way_comparable> { #if _ITERATOR_DEBUG_LEVEL != 0 @@ -874,8 +874,8 @@ namespace ranges { return _Left._Current <=> _Right._Current; } - _NODISCARD friend constexpr _Iterator operator+(_Iterator _It, const difference_type _Off) noexcept( - noexcept(_It._Current += _Off)) /* strengthened */ + _NODISCARD friend constexpr _Iterator operator+(_Iterator _It, const difference_type _Off) + noexcept(noexcept(_It._Current += _Off)) /* strengthened */ requires random_access_range<_Base> { #if _ITERATOR_DEBUG_LEVEL != 0 @@ -884,8 +884,8 @@ namespace ranges { _It._Current += _Off; return _It; } - _NODISCARD friend constexpr _Iterator operator+(const difference_type _Off, _Iterator _It) noexcept( - noexcept(_It._Current += _Off)) /* strengthened */ + _NODISCARD friend constexpr _Iterator operator+(const difference_type _Off, _Iterator _It) + noexcept(noexcept(_It._Current += _Off)) /* strengthened */ requires random_access_range<_Base> { #if _ITERATOR_DEBUG_LEVEL != 0 @@ -895,8 +895,8 @@ namespace ranges { return _It; } - _NODISCARD friend constexpr _Iterator operator-(_Iterator _It, const difference_type _Off) noexcept( - noexcept(_It._Current -= _Off)) /* strengthened */ + _NODISCARD friend constexpr _Iterator operator-(_Iterator _It, const difference_type _Off) + noexcept(noexcept(_It._Current -= _Off)) /* strengthened */ requires random_access_range<_Base> { #if _ITERATOR_DEBUG_LEVEL != 0 @@ -907,8 +907,8 @@ namespace ranges { return _It; } - _NODISCARD friend constexpr difference_type operator-(const _Iterator& _Left, - const _Iterator& _Right) noexcept(noexcept(_Left._Current - _Right._Current)) /* strengthened */ + _NODISCARD friend constexpr difference_type operator-(const _Iterator& _Left, const _Iterator& _Right) + noexcept(noexcept(_Left._Current - _Right._Current)) /* strengthened */ requires sized_sentinel_for, iterator_t<_Base>> { #if _ITERATOR_DEBUG_LEVEL != 0 @@ -942,12 +942,12 @@ namespace ranges { public: _Sentinel() = default; - constexpr explicit _Sentinel(sentinel_t<_Base> _Last_) noexcept( - is_nothrow_move_constructible_v>) // strengthened + constexpr explicit _Sentinel(sentinel_t<_Base> _Last_) + noexcept(is_nothrow_move_constructible_v>) // strengthened : _Last(_STD move(_Last_)) {} - constexpr _Sentinel(_Sentinel _Se) noexcept( - is_nothrow_constructible_v, sentinel_t<_Vw>>) // strengthened + constexpr _Sentinel(_Sentinel _Se) + noexcept(is_nothrow_constructible_v, sentinel_t<_Vw>>) // strengthened requires _Const && convertible_to, sentinel_t<_Base>> : _Last(_STD move(_Se._Last)) {} @@ -958,24 +958,24 @@ namespace ranges { template requires sentinel_for, _Maybe_const_iter<_OtherConst>> - _NODISCARD friend constexpr bool operator==(const _Iterator<_OtherConst>& _Left, - const _Sentinel& _Right) noexcept(noexcept(_Get_current(_Left) == _Right._Last)) /* strengthened */ { + _NODISCARD friend constexpr bool operator==(const _Iterator<_OtherConst>& _Left, const _Sentinel& _Right) + noexcept(noexcept(_Get_current(_Left) == _Right._Last)) /* strengthened */ { return _Get_current(_Left) == _Right._Last; } template requires sized_sentinel_for, _Maybe_const_iter<_OtherConst>> _NODISCARD friend constexpr range_difference_t<_Maybe_const<_OtherConst, _Vw>> operator-( - const _Iterator<_OtherConst>& _Left, - const _Sentinel& _Right) noexcept(noexcept(_Get_current(_Left) - _Right._Last)) /* strengthened */ { + const _Iterator<_OtherConst>& _Left, const _Sentinel& _Right) + noexcept(noexcept(_Get_current(_Left) - _Right._Last)) /* strengthened */ { return _Get_current(_Left) - _Right._Last; } template requires sized_sentinel_for, _Maybe_const_iter<_OtherConst>> - _NODISCARD friend constexpr range_difference_t<_Maybe_const<_OtherConst, _Vw>> - operator-(const _Sentinel& _Left, const _Iterator<_OtherConst>& _Right) noexcept( - noexcept(_Left._Last - _Get_current(_Right))) /* strengthened */ { + _NODISCARD friend constexpr range_difference_t<_Maybe_const<_OtherConst, _Vw>> operator-( + const _Sentinel& _Left, const _Iterator<_OtherConst>& _Right) + noexcept(noexcept(_Left._Last - _Get_current(_Right))) /* strengthened */ { return _Left._Last - _Get_current(_Right); } }; @@ -985,8 +985,8 @@ namespace ranges { transform_view() requires default_initializable<_Vw> && default_initializable<_Fn> = default; // clang-format on - constexpr explicit transform_view(_Vw _Range_, _Fn _Fun_) noexcept( - is_nothrow_move_constructible_v<_Vw> && is_nothrow_move_constructible_v<_Fn>) // strengthened + constexpr explicit transform_view(_Vw _Range_, _Fn _Fun_) + noexcept(is_nothrow_move_constructible_v<_Vw> && is_nothrow_move_constructible_v<_Fn>) // strengthened : _Range(_STD move(_Range_)), _Fun{in_place, _STD move(_Fun_)} {} _NODISCARD constexpr _Vw base() const& noexcept(is_nothrow_copy_constructible_v<_Vw>) /* strengthened */ @@ -1010,9 +1010,9 @@ namespace ranges { return _Iterator{*this, _RANGES begin(_Range)}; } - _NODISCARD constexpr auto end() noexcept( - noexcept(_RANGES end(_Range)) - && is_nothrow_move_constructible_v) /* strengthened */ { + _NODISCARD constexpr auto end() + noexcept(noexcept(_RANGES end(_Range)) + && is_nothrow_move_constructible_v) /* strengthened */ { if constexpr (common_range<_Vw>) { return _Iterator{*this, _RANGES end(_Range)}; } else { diff --git a/stl/inc/algorithm b/stl/inc/algorithm index de1b8d6846..c16afa7d04 100644 --- a/stl/inc/algorithm +++ b/stl/inc/algorithm @@ -10173,9 +10173,9 @@ namespace ranges { #endif // _HAS_CXX17 _EXPORT_STD template -_NODISCARD constexpr pair minmax(const _Ty& _Left _MSVC_LIFETIMEBOUND, - const _Ty& _Right _MSVC_LIFETIMEBOUND, - _Pr _Pred) noexcept(noexcept(_DEBUG_LT_PRED(_Pred, _Right, _Left))) /* strengthened */ { +_NODISCARD constexpr pair minmax( + const _Ty& _Left _MSVC_LIFETIMEBOUND, const _Ty& _Right _MSVC_LIFETIMEBOUND, _Pr _Pred) + noexcept(noexcept(_DEBUG_LT_PRED(_Pred, _Right, _Left))) /* strengthened */ { // return pair(leftmost/smaller, rightmost/larger) of _Left and _Right if (_DEBUG_LT_PRED(_Pred, _Right, _Left)) { return {_Right, _Left}; diff --git a/stl/inc/complex b/stl/inc/complex index 0292883927..d1df8ab2c4 100644 --- a/stl/inc/complex +++ b/stl/inc/complex @@ -1418,147 +1418,147 @@ public: }; _EXPORT_STD template -_NODISCARD _CONSTEXPR20 complex<_Ty> operator+(const complex<_Ty>& _Left, const complex<_Ty>& _Right) noexcept( - _Is_unqual_fp<_Ty>) /* strengthened */ { +_NODISCARD _CONSTEXPR20 complex<_Ty> operator+(const complex<_Ty>& _Left, const complex<_Ty>& _Right) + noexcept(_Is_unqual_fp<_Ty>) /* strengthened */ { complex<_Ty> _Tmp(_Left); _Tmp += _Right; return _Tmp; } _EXPORT_STD template -_NODISCARD _CONSTEXPR20 complex<_Ty> operator+(const complex<_Ty>& _Left, const _Ty& _Right) noexcept( - _Is_unqual_fp<_Ty>) /* strengthened */ { +_NODISCARD _CONSTEXPR20 complex<_Ty> operator+(const complex<_Ty>& _Left, const _Ty& _Right) + noexcept(_Is_unqual_fp<_Ty>) /* strengthened */ { complex<_Ty> _Tmp(_Left); _Tmp += _Right; return _Tmp; } _EXPORT_STD template -_NODISCARD _CONSTEXPR20 complex<_Ty> operator+(const _Ty& _Left, const complex<_Ty>& _Right) noexcept( - _Is_unqual_fp<_Ty>) /* strengthened */ { +_NODISCARD _CONSTEXPR20 complex<_Ty> operator+(const _Ty& _Left, const complex<_Ty>& _Right) + noexcept(_Is_unqual_fp<_Ty>) /* strengthened */ { complex<_Ty> _Tmp(_Right); _Tmp += _Left; return _Tmp; } _EXPORT_STD template -_NODISCARD _CONSTEXPR20 complex<_Ty> operator-(const complex<_Ty>& _Left, const complex<_Ty>& _Right) noexcept( - _Is_unqual_fp<_Ty>) /* strengthened */ { +_NODISCARD _CONSTEXPR20 complex<_Ty> operator-(const complex<_Ty>& _Left, const complex<_Ty>& _Right) + noexcept(_Is_unqual_fp<_Ty>) /* strengthened */ { complex<_Ty> _Tmp(_Left); _Tmp -= _Right; return _Tmp; } _EXPORT_STD template -_NODISCARD _CONSTEXPR20 complex<_Ty> operator-(const complex<_Ty>& _Left, const _Ty& _Right) noexcept( - _Is_unqual_fp<_Ty>) /* strengthened */ { +_NODISCARD _CONSTEXPR20 complex<_Ty> operator-(const complex<_Ty>& _Left, const _Ty& _Right) + noexcept(_Is_unqual_fp<_Ty>) /* strengthened */ { complex<_Ty> _Tmp(_Left); _Tmp -= _Right; return _Tmp; } _EXPORT_STD template -_NODISCARD _CONSTEXPR20 complex<_Ty> operator-(const _Ty& _Left, const complex<_Ty>& _Right) noexcept( - _Is_unqual_fp<_Ty>) /* strengthened */ { +_NODISCARD _CONSTEXPR20 complex<_Ty> operator-(const _Ty& _Left, const complex<_Ty>& _Right) + noexcept(_Is_unqual_fp<_Ty>) /* strengthened */ { complex<_Ty> _Tmp(_Left); _Tmp -= _Right; return _Tmp; } _EXPORT_STD template -_NODISCARD _CONSTEXPR20 complex<_Ty> operator*(const complex<_Ty>& _Left, const complex<_Ty>& _Right) noexcept( - _Is_unqual_fp<_Ty>) /* strengthened */ { +_NODISCARD _CONSTEXPR20 complex<_Ty> operator*(const complex<_Ty>& _Left, const complex<_Ty>& _Right) + noexcept(_Is_unqual_fp<_Ty>) /* strengthened */ { complex<_Ty> _Tmp(_Left); _Tmp *= _Right; return _Tmp; } _EXPORT_STD template -_NODISCARD _CONSTEXPR20 complex<_Ty> operator*(const complex<_Ty>& _Left, const _Ty& _Right) noexcept( - _Is_unqual_fp<_Ty>) /* strengthened */ { +_NODISCARD _CONSTEXPR20 complex<_Ty> operator*(const complex<_Ty>& _Left, const _Ty& _Right) + noexcept(_Is_unqual_fp<_Ty>) /* strengthened */ { complex<_Ty> _Tmp(_Left); _Tmp *= _Right; return _Tmp; } _EXPORT_STD template -_NODISCARD _CONSTEXPR20 complex<_Ty> operator*(const _Ty& _Left, const complex<_Ty>& _Right) noexcept( - _Is_unqual_fp<_Ty>) /* strengthened */ { +_NODISCARD _CONSTEXPR20 complex<_Ty> operator*(const _Ty& _Left, const complex<_Ty>& _Right) + noexcept(_Is_unqual_fp<_Ty>) /* strengthened */ { complex<_Ty> _Tmp(_Right); _Tmp *= _Left; return _Tmp; } _EXPORT_STD template -_NODISCARD _CONSTEXPR20 complex<_Ty> operator/(const complex<_Ty>& _Left, const complex<_Ty>& _Right) noexcept( - _Is_unqual_fp<_Ty>) /* strengthened */ { +_NODISCARD _CONSTEXPR20 complex<_Ty> operator/(const complex<_Ty>& _Left, const complex<_Ty>& _Right) + noexcept(_Is_unqual_fp<_Ty>) /* strengthened */ { complex<_Ty> _Tmp(_Left); _Tmp /= _Right; return _Tmp; } _EXPORT_STD template -_NODISCARD _CONSTEXPR20 complex<_Ty> operator/(const complex<_Ty>& _Left, const _Ty& _Right) noexcept( - _Is_unqual_fp<_Ty>) /* strengthened */ { +_NODISCARD _CONSTEXPR20 complex<_Ty> operator/(const complex<_Ty>& _Left, const _Ty& _Right) + noexcept(_Is_unqual_fp<_Ty>) /* strengthened */ { complex<_Ty> _Tmp(_Left); _Tmp /= _Right; return _Tmp; } _EXPORT_STD template -_NODISCARD _CONSTEXPR20 complex<_Ty> operator/(const _Ty& _Left, const complex<_Ty>& _Right) noexcept( - _Is_unqual_fp<_Ty>) /* strengthened */ { +_NODISCARD _CONSTEXPR20 complex<_Ty> operator/(const _Ty& _Left, const complex<_Ty>& _Right) + noexcept(_Is_unqual_fp<_Ty>) /* strengthened */ { complex<_Ty> _Tmp(_Left); _Tmp /= _Right; return _Tmp; } _EXPORT_STD template -_NODISCARD _CONSTEXPR20 complex<_Ty> operator+(const complex<_Ty>& _Left) noexcept( - _Is_unqual_fp<_Ty>) /* strengthened */ { +_NODISCARD _CONSTEXPR20 complex<_Ty> operator+(const complex<_Ty>& _Left) + noexcept(_Is_unqual_fp<_Ty>) /* strengthened */ { return _Left; } _EXPORT_STD template -_NODISCARD _CONSTEXPR20 complex<_Ty> operator-(const complex<_Ty>& _Left) noexcept( - _Is_unqual_fp<_Ty>) /* strengthened */ { +_NODISCARD _CONSTEXPR20 complex<_Ty> operator-(const complex<_Ty>& _Left) + noexcept(_Is_unqual_fp<_Ty>) /* strengthened */ { return complex<_Ty>(-_Left.real(), -_Left.imag()); } _EXPORT_STD template -_NODISCARD constexpr bool operator==(const complex<_Ty>& _Left, const complex<_Ty>& _Right) noexcept( - _Is_unqual_fp<_Ty>) /* strengthened */ { +_NODISCARD constexpr bool operator==(const complex<_Ty>& _Left, const complex<_Ty>& _Right) + noexcept(_Is_unqual_fp<_Ty>) /* strengthened */ { return _Left.real() == _Right.real() && _Left.imag() == _Right.imag(); } _EXPORT_STD template -_NODISCARD constexpr bool operator==(const complex<_Ty>& _Left, const _Ty& _Right) noexcept( - _Is_unqual_fp<_Ty>) /* strengthened */ { +_NODISCARD constexpr bool operator==(const complex<_Ty>& _Left, const _Ty& _Right) + noexcept(_Is_unqual_fp<_Ty>) /* strengthened */ { return _Left.real() == _Right && _Left.imag() == 0; } #if !_HAS_CXX20 template -_NODISCARD constexpr bool operator==(const _Ty& _Left, const complex<_Ty>& _Right) noexcept( - _Is_unqual_fp<_Ty>) /* strengthened */ { +_NODISCARD constexpr bool operator==(const _Ty& _Left, const complex<_Ty>& _Right) + noexcept(_Is_unqual_fp<_Ty>) /* strengthened */ { return _Left == _Right.real() && 0 == _Right.imag(); } template -_NODISCARD constexpr bool operator!=(const complex<_Ty>& _Left, const complex<_Ty>& _Right) noexcept( - _Is_unqual_fp<_Ty>) /* strengthened */ { +_NODISCARD constexpr bool operator!=(const complex<_Ty>& _Left, const complex<_Ty>& _Right) + noexcept(_Is_unqual_fp<_Ty>) /* strengthened */ { return !(_Left == _Right); } template -_NODISCARD constexpr bool operator!=(const complex<_Ty>& _Left, const _Ty& _Right) noexcept( - _Is_unqual_fp<_Ty>) /* strengthened */ { +_NODISCARD constexpr bool operator!=(const complex<_Ty>& _Left, const _Ty& _Right) + noexcept(_Is_unqual_fp<_Ty>) /* strengthened */ { return !(_Left == _Right); } template -_NODISCARD constexpr bool operator!=(const _Ty& _Left, const complex<_Ty>& _Right) noexcept( - _Is_unqual_fp<_Ty>) /* strengthened */ { +_NODISCARD constexpr bool operator!=(const _Ty& _Left, const complex<_Ty>& _Right) + noexcept(_Is_unqual_fp<_Ty>) /* strengthened */ { return !(_Left == _Right); } #endif // !_HAS_CXX20 @@ -1856,8 +1856,8 @@ _NODISCARD complex<_Ty> cosh(const complex<_Ty>& _Left) noexcept(_Is_unqual_fp<_ } template -_NODISCARD complex<_Ty> _Polar_positive_nan_inf_zero_rho(const _Ty& _Rho, const _Ty& _Theta) noexcept( - _Is_unqual_fp<_Ty>) { // _Rho is +NaN/+Inf/+0 +_NODISCARD complex<_Ty> _Polar_positive_nan_inf_zero_rho(const _Ty& _Rho, const _Ty& _Theta) + noexcept(_Is_unqual_fp<_Ty>) { // _Rho is +NaN/+Inf/+0 if (_Ctraits<_Ty>::_Isnan(_Theta) || _Ctraits<_Ty>::_Isinf(_Theta)) { // _Theta is NaN/Inf if (_Ctraits<_Ty>::_Isinf(_Rho)) { return complex<_Ty>(_Rho, _Ctraits<_Ty>::sin(_Theta)); // (Inf, NaN/Inf) @@ -1990,8 +1990,8 @@ complex<_Ty> _Pow(const _Ty& _Left, const _Ty& _Right) noexcept(_Is_unqual_fp<_T } _EXPORT_STD template -_NODISCARD complex<_Ty> pow(const complex<_Ty>& _Left, const _Ty& _Right) noexcept( - _Is_unqual_fp<_Ty>) /* strengthened */ { +_NODISCARD complex<_Ty> pow(const complex<_Ty>& _Left, const _Ty& _Right) + noexcept(_Is_unqual_fp<_Ty>) /* strengthened */ { if (imag(_Left) == 0) { if (_Ctraits<_Ty>::_Signbit(imag(_Left))) { return conj(_Pow(real(_Left), _Right)); @@ -2004,8 +2004,8 @@ _NODISCARD complex<_Ty> pow(const complex<_Ty>& _Left, const _Ty& _Right) noexce } _EXPORT_STD template -_NODISCARD complex<_Ty> pow(const _Ty& _Left, const complex<_Ty>& _Right) noexcept( - _Is_unqual_fp<_Ty>) /* strengthened */ { +_NODISCARD complex<_Ty> pow(const _Ty& _Left, const complex<_Ty>& _Right) + noexcept(_Is_unqual_fp<_Ty>) /* strengthened */ { if (imag(_Right) == 0) { return _Pow(_Left, real(_Right)); } else if (0 < _Left) { @@ -2016,8 +2016,8 @@ _NODISCARD complex<_Ty> pow(const _Ty& _Left, const complex<_Ty>& _Right) noexce } _EXPORT_STD template -_NODISCARD complex<_Ty> pow(const complex<_Ty>& _Left, const complex<_Ty>& _Right) noexcept( - _Is_unqual_fp<_Ty>) /* strengthened */ { +_NODISCARD complex<_Ty> pow(const complex<_Ty>& _Left, const complex<_Ty>& _Right) + noexcept(_Is_unqual_fp<_Ty>) /* strengthened */ { if (imag(_Right) == 0) { return pow(_Left, real(_Right)); } else if (imag(_Left) == 0 && 0 < real(_Left)) { @@ -2227,23 +2227,23 @@ _NODISCARD complex<_Upgrade_to_double<_Ty>> proj(_Ty _Left) noexcept /* strength } _EXPORT_STD template -_NODISCARD complex<_Common_float_type_t<_Ty1, _Ty2>> pow(const complex<_Ty1>& _Left, - const complex<_Ty2>& _Right) noexcept(_Is_unqual_fp<_Ty1> && _Is_unqual_fp<_Ty2>) /* strengthened */ { +_NODISCARD complex<_Common_float_type_t<_Ty1, _Ty2>> pow(const complex<_Ty1>& _Left, const complex<_Ty2>& _Right) + noexcept(_Is_unqual_fp<_Ty1> && _Is_unqual_fp<_Ty2>) /* strengthened */ { using _Type = complex<_Common_float_type_t<_Ty1, _Ty2>>; return _STD pow(_Type(_Left), _Type(_Right)); } _EXPORT_STD template , int> = 0> -_NODISCARD complex<_Common_float_type_t<_Ty1, _Ty2>> pow(const complex<_Ty1>& _Left, const _Ty2& _Right) noexcept( - _Is_unqual_fp<_Ty1>) /* strengthened */ { +_NODISCARD complex<_Common_float_type_t<_Ty1, _Ty2>> pow(const complex<_Ty1>& _Left, const _Ty2& _Right) + noexcept(_Is_unqual_fp<_Ty1>) /* strengthened */ { using _Promoted = _Common_float_type_t<_Ty1, _Ty2>; using _Type = complex<_Promoted>; return _STD pow(_Type(_Left), _Type(static_cast<_Promoted>(_Right))); } _EXPORT_STD template , int> = 0> -_NODISCARD complex<_Common_float_type_t<_Ty1, _Ty2>> pow(const _Ty1& _Left, const complex<_Ty2>& _Right) noexcept( - _Is_unqual_fp<_Ty2>) /* strengthened */ { +_NODISCARD complex<_Common_float_type_t<_Ty1, _Ty2>> pow(const _Ty1& _Left, const complex<_Ty2>& _Right) + noexcept(_Is_unqual_fp<_Ty2>) /* strengthened */ { using _Promoted = _Common_float_type_t<_Ty1, _Ty2>; using _Type = complex<_Promoted>; return _STD pow(_Type(static_cast<_Promoted>(_Left)), _Type(_Right)); diff --git a/stl/inc/condition_variable b/stl/inc/condition_variable index 2931b1b03f..8d52f7265b 100644 --- a/stl/inc/condition_variable +++ b/stl/inc/condition_variable @@ -168,8 +168,8 @@ private: public: template - bool wait(_Lock& _Lck, stop_token _Stoken, _Predicate _Pred) noexcept( - noexcept(static_cast(_Pred()))) /* strengthened */ { + bool wait(_Lock& _Lck, stop_token _Stoken, _Predicate _Pred) + noexcept(noexcept(static_cast(_Pred()))) /* strengthened */ { // TRANSITION, ABI: Due to the unsynchronized delivery of notify_all by _Stoken, // this implementation cannot tolerate *this destruction while an interruptible wait // is outstanding. A future ABI should store both the internal CV and internal mutex diff --git a/stl/inc/deque b/stl/inc/deque index 7c8ad1f9be..457136014d 100644 --- a/stl/inc/deque +++ b/stl/inc/deque @@ -1516,8 +1516,8 @@ public: return erase(_Where, _Next_iter(_Where)); } - iterator erase(const_iterator _First_arg, const_iterator _Last_arg) noexcept( - is_nothrow_move_assignable_v) /* strengthened */ { + iterator erase(const_iterator _First_arg, const_iterator _Last_arg) + noexcept(is_nothrow_move_assignable_v) /* strengthened */ { iterator _First = _Make_iter(_First_arg); iterator _Last = _Make_iter(_Last_arg); diff --git a/stl/inc/expected b/stl/inc/expected index 8ee7320481..610a1840a7 100644 --- a/stl/inc/expected +++ b/stl/inc/expected @@ -55,14 +55,14 @@ public: template requires is_constructible_v<_Err, _Args...> - constexpr explicit unexpected(in_place_t, _Args&&... _Vals) noexcept( - is_nothrow_constructible_v<_Err, _Args...>) // strengthened + constexpr explicit unexpected(in_place_t, _Args&&... _Vals) + noexcept(is_nothrow_constructible_v<_Err, _Args...>) // strengthened : _Unexpected(_STD forward<_Args>(_Vals)...) {} template requires is_constructible_v<_Err, initializer_list<_Uty>&, _Args...> - constexpr explicit unexpected(in_place_t, initializer_list<_Uty> _Ilist, _Args&&... _Vals) noexcept( - is_nothrow_constructible_v<_Err, initializer_list<_Uty>&, _Args...>) // strengthened + constexpr explicit unexpected(in_place_t, initializer_list<_Uty> _Ilist, _Args&&... _Vals) + noexcept(is_nothrow_constructible_v<_Err, initializer_list<_Uty>&, _Args...>) // strengthened : _Unexpected(_Ilist, _STD forward<_Args>(_Vals)...) {} // [expected.un.obs] @@ -94,8 +94,8 @@ public: // [expected.un.eq] template - _NODISCARD friend constexpr bool operator==(const unexpected& _Left, const unexpected<_UErr>& _Right) noexcept( - noexcept(_STD _Fake_copy_init(_Left._Unexpected == _Right.error()))) /* strengthened */ { + _NODISCARD friend constexpr bool operator==(const unexpected& _Left, const unexpected<_UErr>& _Right) + noexcept(noexcept(_STD _Fake_copy_init(_Left._Unexpected == _Right.error()))) /* strengthened */ { return _Left._Unexpected == _Right.error(); } @@ -241,8 +241,8 @@ public: requires is_default_constructible_v<_Ty> : _Value(), _Has_value(true) {} - constexpr expected(const expected& _Other) noexcept( - is_nothrow_copy_constructible_v<_Ty> && is_nothrow_copy_constructible_v<_Err>) // strengthened + constexpr expected(const expected& _Other) + noexcept(is_nothrow_copy_constructible_v<_Ty> && is_nothrow_copy_constructible_v<_Err>) // strengthened requires (!(is_trivially_copy_constructible_v<_Ty> && is_trivially_copy_constructible_v<_Err>) && is_copy_constructible_v<_Ty> && is_copy_constructible_v<_Err>) : _Has_value(_Other._Has_value) { @@ -260,8 +260,8 @@ public: expected(const expected&) = delete; - constexpr expected(expected&& _Other) noexcept( - is_nothrow_move_constructible_v<_Ty> && is_nothrow_move_constructible_v<_Err>) + constexpr expected(expected&& _Other) + noexcept(is_nothrow_move_constructible_v<_Ty> && is_nothrow_move_constructible_v<_Err>) requires (!(is_trivially_move_constructible_v<_Ty> && is_trivially_move_constructible_v<_Err>) && is_move_constructible_v<_Ty> && is_move_constructible_v<_Err>) : _Has_value(_Other._Has_value) { @@ -280,9 +280,10 @@ public: template requires _Different_from, expected> && is_constructible_v<_Ty, const _Uty&> && is_constructible_v<_Err, const _UErr&> && _Allow_unwrapping<_Uty, _UErr> - constexpr explicit(!is_convertible_v || !is_convertible_v) expected( - const expected<_Uty, _UErr>& _Other) noexcept(is_nothrow_constructible_v<_Ty, const _Uty&> - && is_nothrow_constructible_v<_Err, const _UErr&>) // strengthened + constexpr explicit(!is_convertible_v || !is_convertible_v) + expected(const expected<_Uty, _UErr>& _Other) + noexcept(is_nothrow_constructible_v<_Ty, const _Uty&> + && is_nothrow_constructible_v<_Err, const _UErr&>) // strengthened : _Has_value(_Other._Has_value) { if (_Has_value) { _STD construct_at(_STD addressof(_Value), _Other._Value); @@ -295,8 +296,8 @@ public: requires _Different_from, expected> && is_constructible_v<_Ty, _Uty> && is_constructible_v<_Err, _UErr> && _Allow_unwrapping<_Uty, _UErr> constexpr explicit(!is_convertible_v<_Uty, _Ty> || !is_convertible_v<_UErr, _Err>) - expected(expected<_Uty, _UErr>&& _Other) noexcept( - is_nothrow_constructible_v<_Ty, _Uty> && is_nothrow_constructible_v<_Err, _UErr>) // strengthened + expected(expected<_Uty, _UErr>&& _Other) + noexcept(is_nothrow_constructible_v<_Ty, _Uty> && is_nothrow_constructible_v<_Err, _UErr>) // strengthened : _Has_value(_Other._Has_value) { if (_Has_value) { _STD construct_at(_STD addressof(_Value), _STD move(_Other._Value)); @@ -316,8 +317,8 @@ public: #endif // ^^^ workaround ^^^ ) && is_constructible_v<_Ty, _Uty>) - constexpr explicit(!is_convertible_v<_Uty, _Ty>) - expected(_Uty&& _Other) noexcept(is_nothrow_constructible_v<_Ty, _Uty>) // strengthened + constexpr explicit(!is_convertible_v<_Uty, _Ty>) expected(_Uty&& _Other) + noexcept(is_nothrow_constructible_v<_Ty, _Uty>) // strengthened : _Value(_STD forward<_Uty>(_Other)), _Has_value(true) { } @@ -335,26 +336,26 @@ public: template requires is_constructible_v<_Ty, _Args...> - constexpr explicit expected(in_place_t, _Args&&... _Vals) noexcept( - is_nothrow_constructible_v<_Ty, _Args...>) // strengthened + constexpr explicit expected(in_place_t, _Args&&... _Vals) + noexcept(is_nothrow_constructible_v<_Ty, _Args...>) // strengthened : _Value(_STD forward<_Args>(_Vals)...), _Has_value(true) {} template requires is_constructible_v<_Ty, initializer_list<_Uty>&, _Args...> - constexpr explicit expected(in_place_t, initializer_list<_Uty> _Ilist, _Args&&... _Vals) noexcept( - is_nothrow_constructible_v<_Ty, initializer_list<_Uty>&, _Args...>) // strengthened + constexpr explicit expected(in_place_t, initializer_list<_Uty> _Ilist, _Args&&... _Vals) + noexcept(is_nothrow_constructible_v<_Ty, initializer_list<_Uty>&, _Args...>) // strengthened : _Value(_Ilist, _STD forward<_Args>(_Vals)...), _Has_value(true) {} template requires is_constructible_v<_Err, _Args...> - constexpr explicit expected(unexpect_t, _Args&&... _Vals) noexcept( - is_nothrow_constructible_v<_Err, _Args...>) // strengthened + constexpr explicit expected(unexpect_t, _Args&&... _Vals) + noexcept(is_nothrow_constructible_v<_Err, _Args...>) // strengthened : _Unexpected(_STD forward<_Args>(_Vals)...), _Has_value(false) {} template requires is_constructible_v<_Err, initializer_list<_Uty>&, _Args...> - constexpr explicit expected(unexpect_t, initializer_list<_Uty> _Ilist, _Args&&... _Vals) noexcept( - is_nothrow_constructible_v<_Err, initializer_list<_Uty>&, _Args...>) // strengthened + constexpr explicit expected(unexpect_t, initializer_list<_Uty> _Ilist, _Args&&... _Vals) + noexcept(is_nothrow_constructible_v<_Err, initializer_list<_Uty>&, _Args...>) // strengthened : _Unexpected(_Ilist, _STD forward<_Args>(_Vals)...), _Has_value(false) {} // [expected.object.dtor] @@ -393,8 +394,8 @@ public: }; template - static constexpr void _Reinit_expected(_First& _New_val, _Second& _Old_val, _Args&&... _Vals) noexcept( - is_nothrow_constructible_v<_First, _Args...>) /* strengthened */ { + static constexpr void _Reinit_expected(_First& _New_val, _Second& _Old_val, _Args&&... _Vals) + noexcept(is_nothrow_constructible_v<_First, _Args...>) /* strengthened */ { if constexpr (is_nothrow_constructible_v<_First, _Args...>) { if constexpr (!is_trivially_destructible_v<_Second>) { _Old_val.~_Second(); @@ -418,9 +419,9 @@ public: } } - constexpr expected& operator=(const expected& _Other) noexcept( - is_nothrow_copy_constructible_v<_Ty> && is_nothrow_copy_constructible_v<_Err> - && is_nothrow_copy_assignable_v<_Ty> && is_nothrow_copy_assignable_v<_Err>) // strengthened + constexpr expected& operator=(const expected& _Other) + noexcept(is_nothrow_copy_constructible_v<_Ty> && is_nothrow_copy_constructible_v<_Err> + && is_nothrow_copy_assignable_v<_Ty> && is_nothrow_copy_assignable_v<_Err>) // strengthened requires _Expected_binary_copy_assignable<_Ty, _Err> { if (_Has_value && _Other._Has_value) { @@ -445,9 +446,9 @@ public: expected& operator=(const expected&) = delete; - constexpr expected& operator=(expected&& _Other) noexcept( - is_nothrow_move_constructible_v<_Ty> && is_nothrow_move_constructible_v<_Err> - && is_nothrow_move_assignable_v<_Ty> && is_nothrow_move_assignable_v<_Err>) + constexpr expected& operator=(expected&& _Other) + noexcept(is_nothrow_move_constructible_v<_Ty> && is_nothrow_move_constructible_v<_Err> + && is_nothrow_move_assignable_v<_Ty> && is_nothrow_move_assignable_v<_Err>) requires _Expected_binary_move_assignable<_Ty, _Err> { if (_Has_value && _Other._Has_value) { @@ -475,8 +476,8 @@ public: && is_constructible_v<_Ty, _Uty> && is_assignable_v<_Ty&, _Uty> && (is_nothrow_constructible_v<_Ty, _Uty> || is_nothrow_move_constructible_v<_Ty> || is_nothrow_move_constructible_v<_Err>) ) - constexpr expected& operator=(_Uty&& _Other) noexcept( - is_nothrow_constructible_v<_Ty, _Uty> && is_nothrow_assignable_v<_Ty&, _Uty>) /* strengthened */ { + constexpr expected& operator=(_Uty&& _Other) + noexcept(is_nothrow_constructible_v<_Ty, _Uty> && is_nothrow_assignable_v<_Ty&, _Uty>) /* strengthened */ { if (_Has_value) { _Value = _STD forward<_Uty>(_Other); } else { @@ -491,9 +492,9 @@ public: requires (is_constructible_v<_Err, const _UErr&> && is_assignable_v<_Err&, const _UErr&> && (is_nothrow_constructible_v<_Err, const _UErr&> || is_nothrow_move_constructible_v<_Ty> || is_nothrow_move_constructible_v<_Err>) ) - constexpr expected& operator=(const unexpected<_UErr>& _Other) noexcept( - is_nothrow_constructible_v<_Err, const _UErr&> - && is_nothrow_assignable_v<_Err&, const _UErr&>) /* strengthened */ { + constexpr expected& operator=(const unexpected<_UErr>& _Other) + noexcept(is_nothrow_constructible_v<_Err, const _UErr&> + && is_nothrow_assignable_v<_Err&, const _UErr&>) /* strengthened */ { if (_Has_value) { _Reinit_expected(_Unexpected, _Value, _Other._Unexpected); _Has_value = false; @@ -508,8 +509,8 @@ public: requires (is_constructible_v<_Err, _UErr> && is_assignable_v<_Err&, _UErr> && (is_nothrow_constructible_v<_Err, _UErr> || is_nothrow_move_constructible_v<_Ty> || is_nothrow_move_constructible_v<_Err>) ) - constexpr expected& operator=(unexpected<_UErr>&& _Other) noexcept( - is_nothrow_constructible_v<_Err, _UErr> && is_nothrow_assignable_v<_Err&, _UErr>) /* strengthened */ { + constexpr expected& operator=(unexpected<_UErr>&& _Other) + noexcept(is_nothrow_constructible_v<_Err, _UErr> && is_nothrow_assignable_v<_Err&, _UErr>) /* strengthened */ { if (_Has_value) { _Reinit_expected(_Unexpected, _Value, _STD move(_Other._Unexpected)); _Has_value = false; @@ -555,9 +556,9 @@ public: } // [expected.object.swap] - constexpr void swap(expected& _Other) noexcept(is_nothrow_move_constructible_v<_Ty> && is_nothrow_swappable_v<_Ty> - && is_nothrow_move_constructible_v<_Err> - && is_nothrow_swappable_v<_Err>) + constexpr void swap(expected& _Other) + noexcept(is_nothrow_move_constructible_v<_Ty> && is_nothrow_swappable_v<_Ty> + && is_nothrow_move_constructible_v<_Err> && is_nothrow_swappable_v<_Err>) requires is_swappable_v<_Ty> && is_swappable_v<_Err> // && is_move_constructible_v<_Ty> && is_move_constructible_v<_Err> && (is_nothrow_move_constructible_v<_Ty> || is_nothrow_move_constructible_v<_Err>) @@ -609,9 +610,9 @@ public: } } - friend constexpr void swap(expected& _Lhs, expected& _Rhs) noexcept( - is_nothrow_move_constructible_v<_Ty> && is_nothrow_swappable_v<_Ty> && is_nothrow_move_constructible_v<_Err> - && is_nothrow_swappable_v<_Err>) + friend constexpr void swap(expected& _Lhs, expected& _Rhs) + noexcept(is_nothrow_move_constructible_v<_Ty> && is_nothrow_swappable_v<_Ty> + && is_nothrow_move_constructible_v<_Err> && is_nothrow_swappable_v<_Err>) requires is_swappable<_Ty>::value && is_swappable<_Err>::value // TRANSITION, /permissive needs ::value && is_move_constructible_v<_Ty> && is_move_constructible_v<_Err> && (is_nothrow_move_constructible_v<_Ty> || is_nothrow_move_constructible_v<_Err>) @@ -1136,9 +1137,9 @@ public: // [expected.object.eq] template requires (!is_void_v<_Uty>) - _NODISCARD friend constexpr bool operator==(const expected& _Left, const expected<_Uty, _UErr>& _Right) noexcept( - noexcept(_STD _Fake_copy_init(_Left._Value == *_Right)) - && noexcept(_STD _Fake_copy_init(_Left._Unexpected == _Right.error()))) /* strengthened */ { + _NODISCARD friend constexpr bool operator==(const expected& _Left, const expected<_Uty, _UErr>& _Right) + noexcept(noexcept(_STD _Fake_copy_init(_Left._Value == *_Right)) + && noexcept(_STD _Fake_copy_init(_Left._Unexpected == _Right.error()))) /* strengthened */ { if (_Left._Has_value != _Right.has_value()) { return false; } else if (_Left._Has_value) { @@ -1149,8 +1150,8 @@ public: } template - _NODISCARD friend constexpr bool operator==(const expected& _Left, const _Uty& _Right) noexcept( - noexcept(static_cast(_Left._Value == _Right))) /* strengthened */ { + _NODISCARD friend constexpr bool operator==(const expected& _Left, const _Uty& _Right) + noexcept(noexcept(static_cast(_Left._Value == _Right))) /* strengthened */ { if (_Left._Has_value) { return static_cast(_Left._Value == _Right); } else { @@ -1159,8 +1160,8 @@ public: } template - _NODISCARD friend constexpr bool operator==(const expected& _Left, const unexpected<_UErr>& _Right) noexcept( - noexcept(static_cast(_Left._Unexpected == _Right.error()))) /* strengthened */ { + _NODISCARD friend constexpr bool operator==(const expected& _Left, const unexpected<_UErr>& _Right) + noexcept(noexcept(static_cast(_Left._Unexpected == _Right.error()))) /* strengthened */ { if (_Left._Has_value) { return false; } else { @@ -1171,19 +1172,19 @@ public: private: // These overloads force copy elision from the invoke call into _Value template - constexpr expected(_Construct_expected_from_invoke_result_tag, _Fn&& _Func, _Ux&& _Arg) noexcept( - noexcept(static_cast<_Ty>(_STD invoke(_STD forward<_Fn>(_Func), _STD forward<_Ux>(_Arg))))) + constexpr expected(_Construct_expected_from_invoke_result_tag, _Fn&& _Func, _Ux&& _Arg) + noexcept(noexcept(static_cast<_Ty>(_STD invoke(_STD forward<_Fn>(_Func), _STD forward<_Ux>(_Arg))))) : _Value(_STD invoke(_STD forward<_Fn>(_Func), _STD forward<_Ux>(_Arg))), _Has_value{true} {} // For when transform is called on an expected and requires calling _Func with no arg template - constexpr expected(_Construct_expected_from_invoke_result_tag, _Fn&& _Func) noexcept( - noexcept(static_cast<_Ty>(_STD forward<_Fn>(_Func)()))) // f() is equivalent to invoke(f) + constexpr expected(_Construct_expected_from_invoke_result_tag, _Fn&& _Func) + noexcept(noexcept(static_cast<_Ty>(_STD forward<_Fn>(_Func)()))) // f() is equivalent to invoke(f) : _Value(_STD forward<_Fn>(_Func)()), _Has_value{true} {} // f() is equivalent to invoke(f) template - constexpr expected(_Construct_expected_from_invoke_result_tag, unexpect_t, _Fn&& _Func, _Ux&& _Arg) noexcept( - noexcept(static_cast<_Err>(_STD invoke(_STD forward<_Fn>(_Func), _STD forward<_Ux>(_Arg))))) + constexpr expected(_Construct_expected_from_invoke_result_tag, unexpect_t, _Fn&& _Func, _Ux&& _Arg) + noexcept(noexcept(static_cast<_Err>(_STD invoke(_STD forward<_Fn>(_Func), _STD forward<_Ux>(_Arg))))) : _Unexpected(_STD invoke(_STD forward<_Fn>(_Func), _STD forward<_Ux>(_Arg))), _Has_value{false} {} [[noreturn]] void _Throw_bad_expected_access_lv() const { @@ -1264,8 +1265,8 @@ public: template requires _Different_from, expected> && is_void_v<_Uty> && is_constructible_v<_Err, const _UErr&> && _Allow_unwrapping<_Uty, _UErr> - constexpr explicit(!is_convertible_v) expected(const expected<_Uty, _UErr>& _Other) noexcept( - is_nothrow_constructible_v<_Err, const _UErr&>) // strengthened + constexpr explicit(!is_convertible_v) expected(const expected<_Uty, _UErr>& _Other) + noexcept(is_nothrow_constructible_v<_Err, const _UErr&>) // strengthened : _Has_value(_Other._Has_value) { if (!_Has_value) { _STD construct_at(_STD addressof(_Unexpected), _Other._Unexpected); @@ -1275,8 +1276,8 @@ public: template requires _Different_from, expected> && is_void_v<_Uty> && is_constructible_v<_Err, _UErr> && _Allow_unwrapping<_Uty, _UErr> - constexpr explicit(!is_convertible_v<_UErr, _Err>) - expected(expected<_Uty, _UErr>&& _Other) noexcept(is_nothrow_constructible_v<_Err, _UErr>) // strengthened + constexpr explicit(!is_convertible_v<_UErr, _Err>) expected(expected<_Uty, _UErr>&& _Other) + noexcept(is_nothrow_constructible_v<_Err, _UErr>) // strengthened : _Has_value(_Other._Has_value) { if (!_Has_value) { _STD construct_at(_STD addressof(_Unexpected), _STD move(_Other._Unexpected)); @@ -1285,28 +1286,28 @@ public: template requires is_constructible_v<_Err, const _UErr&> - constexpr explicit(!is_convertible_v) expected(const unexpected<_UErr>& _Other) noexcept( - is_nothrow_constructible_v<_Err, const _UErr&>) // strengthened + constexpr explicit(!is_convertible_v) expected(const unexpected<_UErr>& _Other) + noexcept(is_nothrow_constructible_v<_Err, const _UErr&>) // strengthened : _Unexpected(_Other._Unexpected), _Has_value(false) {} template requires is_constructible_v<_Err, _UErr> - constexpr explicit(!is_convertible_v<_UErr, _Err>) - expected(unexpected<_UErr>&& _Other) noexcept(is_nothrow_constructible_v<_Err, _UErr>) // strengthened + constexpr explicit(!is_convertible_v<_UErr, _Err>) expected(unexpected<_UErr>&& _Other) + noexcept(is_nothrow_constructible_v<_Err, _UErr>) // strengthened : _Unexpected(_STD move(_Other._Unexpected)), _Has_value(false) {} constexpr explicit expected(in_place_t) noexcept : _Has_value(true) {} template requires is_constructible_v<_Err, _Args...> - constexpr explicit expected(unexpect_t, _Args&&... _Vals) noexcept( - is_nothrow_constructible_v<_Err, _Args...>) // strengthened + constexpr explicit expected(unexpect_t, _Args&&... _Vals) + noexcept(is_nothrow_constructible_v<_Err, _Args...>) // strengthened : _Unexpected(_STD forward<_Args>(_Vals)...), _Has_value(false) {} template requires is_constructible_v<_Err, initializer_list<_Uty>&, _Args...> - constexpr explicit expected(unexpect_t, initializer_list<_Uty> _Ilist, _Args&&... _Vals) noexcept( - is_nothrow_constructible_v<_Err, initializer_list<_Uty>&, _Args...>) // strengthened + constexpr explicit expected(unexpect_t, initializer_list<_Uty> _Ilist, _Args&&... _Vals) + noexcept(is_nothrow_constructible_v<_Err, initializer_list<_Uty>&, _Args...>) // strengthened : _Unexpected(_Ilist, _STD forward<_Args>(_Vals)...), _Has_value(false) {} // [expected.void.dtor] @@ -1325,8 +1326,8 @@ public: // clang-format on // [expected.void.assign] - constexpr expected& operator=(const expected& _Other) noexcept( - is_nothrow_copy_constructible_v<_Err> && is_nothrow_copy_assignable_v<_Err>) // strengthened + constexpr expected& operator=(const expected& _Other) + noexcept(is_nothrow_copy_constructible_v<_Err> && is_nothrow_copy_assignable_v<_Err>) // strengthened requires _Expected_unary_copy_assignable<_Err> { if (_Has_value && _Other._Has_value) { @@ -1352,8 +1353,8 @@ public: expected& operator=(const expected&) = delete; - constexpr expected& operator=(expected&& _Other) noexcept( - is_nothrow_move_constructible_v<_Err> && is_nothrow_move_assignable_v<_Err>) + constexpr expected& operator=(expected&& _Other) + noexcept(is_nothrow_move_constructible_v<_Err> && is_nothrow_move_assignable_v<_Err>) requires _Expected_unary_move_assignable<_Err> { if (_Has_value && _Other._Has_value) { @@ -1379,9 +1380,9 @@ public: template requires is_constructible_v<_Err, const _UErr&> && is_assignable_v<_Err&, const _UErr&> - constexpr expected& operator=(const unexpected<_UErr>& _Other) noexcept( - is_nothrow_constructible_v<_Err, const _UErr&> - && is_nothrow_assignable_v<_Err&, const _UErr&>) /* strengthened */ { + constexpr expected& operator=(const unexpected<_UErr>& _Other) + noexcept(is_nothrow_constructible_v<_Err, const _UErr&> + && is_nothrow_assignable_v<_Err&, const _UErr&>) /* strengthened */ { if (_Has_value) { _STD construct_at(_STD addressof(_Unexpected), _Other._Unexpected); _Has_value = false; @@ -1394,8 +1395,8 @@ public: template requires is_constructible_v<_Err, _UErr> && is_assignable_v<_Err&, _UErr> - constexpr expected& operator=(unexpected<_UErr>&& _Other) noexcept( - is_nothrow_constructible_v<_Err, _UErr> && is_nothrow_assignable_v<_Err&, _UErr>) /* strengthened */ { + constexpr expected& operator=(unexpected<_UErr>&& _Other) + noexcept(is_nothrow_constructible_v<_Err, _UErr> && is_nothrow_assignable_v<_Err&, _UErr>) /* strengthened */ { if (_Has_value) { _STD construct_at(_STD addressof(_Unexpected), _STD move(_Other._Unexpected)); _Has_value = false; @@ -1416,8 +1417,8 @@ public: } // [expected.void.swap] - constexpr void swap(expected& _Other) noexcept( - is_nothrow_move_constructible_v<_Err> && is_nothrow_swappable_v<_Err>) + constexpr void swap(expected& _Other) + noexcept(is_nothrow_move_constructible_v<_Err> && is_nothrow_swappable_v<_Err>) requires is_swappable_v<_Err> && is_move_constructible_v<_Err> { using _STD swap; @@ -1442,8 +1443,8 @@ public: } } - friend constexpr void swap(expected& _Left, expected& _Right) noexcept( - is_nothrow_move_constructible_v<_Err> && is_nothrow_swappable_v<_Err>) + friend constexpr void swap(expected& _Left, expected& _Right) + noexcept(is_nothrow_move_constructible_v<_Err> && is_nothrow_swappable_v<_Err>) #if defined(__clang__) || defined(__EDG__) // TRANSITION, /permissive requires is_swappable_v<_Err> #else // ^^^ no workaround / workaround vvv @@ -1876,8 +1877,8 @@ public: // [expected.void.eq] template requires is_void_v<_Uty> - _NODISCARD friend constexpr bool operator==(const expected& _Left, const expected<_Uty, _UErr>& _Right) noexcept( - noexcept(static_cast(_Left._Unexpected == _Right.error()))) /* strengthened */ { + _NODISCARD friend constexpr bool operator==(const expected& _Left, const expected<_Uty, _UErr>& _Right) + noexcept(noexcept(static_cast(_Left._Unexpected == _Right.error()))) /* strengthened */ { if (_Left._Has_value != _Right.has_value()) { return false; } else { @@ -1886,8 +1887,8 @@ public: } template - _NODISCARD friend constexpr bool operator==(const expected& _Left, const unexpected<_UErr>& _Right) noexcept( - noexcept(static_cast(_Left._Unexpected == _Right.error()))) /* strengthened */ { + _NODISCARD friend constexpr bool operator==(const expected& _Left, const unexpected<_UErr>& _Right) + noexcept(noexcept(static_cast(_Left._Unexpected == _Right.error()))) /* strengthened */ { if (_Left._Has_value) { return false; } else { @@ -1897,8 +1898,8 @@ public: private: template - constexpr expected(_Construct_expected_from_invoke_result_tag, unexpect_t, _Fn&& _Func, _Ux&& _Arg) noexcept( - noexcept(_Err(_STD invoke(_STD forward<_Fn>(_Func), _STD forward<_Ux>(_Arg))))) + constexpr expected(_Construct_expected_from_invoke_result_tag, unexpect_t, _Fn&& _Func, _Ux&& _Arg) + noexcept(noexcept(_Err(_STD invoke(_STD forward<_Fn>(_Func), _STD forward<_Ux>(_Arg))))) : _Unexpected(_STD invoke(_STD forward<_Fn>(_Func), _STD forward<_Ux>(_Arg))), _Has_value{false} {} [[noreturn]] void _Throw_bad_expected_access_lv() const { diff --git a/stl/inc/format b/stl/inc/format index 4613a4d6c8..9e2ce6e57a 100644 --- a/stl/inc/format +++ b/stl/inc/format @@ -4274,8 +4274,8 @@ private: range_formatter<_Element_type, _CharT> _Underlying; public: - constexpr _Range_default_formatter() noexcept( - is_nothrow_default_constructible_v>) /* strengthened */ { + constexpr _Range_default_formatter() + noexcept(is_nothrow_default_constructible_v>) /* strengthened */ { static_assert(_Is_two_tuple<_Element_type>, "the element type of the formatted range must be either pair " "or tuple (N4981 [format.range.fmtmap]/1)"); diff --git a/stl/inc/forward_list b/stl/inc/forward_list index ead270e4c9..f55da31fd9 100644 --- a/stl/inc/forward_list +++ b/stl/inc/forward_list @@ -635,8 +635,8 @@ public: _Take_head(_Right); } - forward_list(forward_list&& _Right, const _Identity_t<_Alloc>& _Al) noexcept( - _Alnode_traits::is_always_equal::value) // strengthened + forward_list(forward_list&& _Right, const _Identity_t<_Alloc>& _Al) + noexcept(_Alnode_traits::is_always_equal::value) // strengthened : _Mypair(_One_then_variadic_args_t{}, _Al) { if constexpr (!_Alty_traits::is_always_equal::value) { if (_Getal() != _Right._Getal()) { @@ -653,8 +653,8 @@ public: _Take_head(_Right); } - forward_list& operator=(forward_list&& _Right) noexcept( - _Choose_pocma_v<_Alnode> != _Pocma_values::_No_propagate_allocators) /* strengthened */ { + forward_list& operator=(forward_list&& _Right) + noexcept(_Choose_pocma_v<_Alnode> != _Pocma_values::_No_propagate_allocators) /* strengthened */ { if (this == _STD addressof(_Right)) { return *this; } diff --git a/stl/inc/functional b/stl/inc/functional index 68a93e53cb..be22133b67 100644 --- a/stl/inc/functional +++ b/stl/inc/functional @@ -601,8 +601,8 @@ private: public: template , int> = 0> - constexpr explicit _Not_fn(_Callable&& _Obj, _Tag) noexcept( - is_nothrow_constructible_v<_Decayed, _Callable>) // strengthened + constexpr explicit _Not_fn(_Callable&& _Obj, _Tag) + noexcept(is_nothrow_constructible_v<_Decayed, _Callable>) // strengthened : _Mybase(_STD forward<_Callable>(_Obj)) {} // store a callable object constexpr _Not_fn(const _Not_fn&) = default; @@ -676,8 +676,8 @@ public: }; _EXPORT_STD template -_NODISCARD _CONSTEXPR20 _Not_fn> not_fn(_Callable&& _Obj) noexcept( - is_nothrow_constructible_v, _Callable>) /* strengthened */ { +_NODISCARD _CONSTEXPR20 _Not_fn> not_fn(_Callable&& _Obj) + noexcept(is_nothrow_constructible_v, _Callable>) /* strengthened */ { // wrap a callable object to be negated static_assert(is_move_constructible_v>, "the callable type used with std::not_fn should be move constructible."); @@ -2008,16 +2008,16 @@ template struct _Select_fixer<_Cv_TiD, false, true, 0> { // nested bind fixer template )>...>, int> = 0> - static constexpr auto _Apply(_Cv_TiD& _Tid, _Untuple&& _Ut, index_sequence<_Jx...>) noexcept( - noexcept(_Tid(_STD get<_Jx>(_STD move(_Ut))...))) -> decltype(_Tid(_STD get<_Jx>(_STD move(_Ut))...)) { + static constexpr auto _Apply(_Cv_TiD& _Tid, _Untuple&& _Ut, index_sequence<_Jx...>) + noexcept(noexcept(_Tid(_STD get<_Jx>(_STD move(_Ut))...))) -> decltype(_Tid(_STD get<_Jx>(_STD move(_Ut))...)) { // call a nested bind expression return _Tid(_STD get<_Jx>(_STD move(_Ut))...); } template - static constexpr auto _Fix(_Cv_TiD& _Tid, _Untuple&& _Ut) noexcept(noexcept(_Apply(_Tid, _STD move(_Ut), - make_index_sequence>{}))) -> decltype(_Apply(_Tid, _STD move(_Ut), - make_index_sequence>{})) { + static constexpr auto _Fix(_Cv_TiD& _Tid, _Untuple&& _Ut) + noexcept(noexcept(_Apply(_Tid, _STD move(_Ut), make_index_sequence>{}))) + -> decltype(_Apply(_Tid, _STD move(_Ut), make_index_sequence>{})) { // call a nested bind expression return _Apply(_Tid, _STD move(_Ut), make_index_sequence>{}); } @@ -2075,18 +2075,18 @@ struct _Invoker_ret { // selected for all _Rx other than _Unforced template <> struct _Invoker_ret<_Unforced> { // selected for _Rx being _Unforced template - static _CONSTEXPR20 auto _Call(_Fx&& _Func, _Valtys&&... _Vals) noexcept( - _Select_invoke_traits<_Fx, _Valtys...>::_Is_nothrow_invocable::value) - -> decltype(_STD invoke(static_cast<_Fx&&>(_Func), static_cast<_Valtys&&>(_Vals)...)) { // INVOKE, unchanged + static _CONSTEXPR20 auto _Call(_Fx&& _Func, _Valtys&&... _Vals) + noexcept(_Select_invoke_traits<_Fx, _Valtys...>::_Is_nothrow_invocable::value) + -> decltype(_STD invoke(static_cast<_Fx&&>(_Func), static_cast<_Valtys&&>(_Vals)...)) { // INVOKE, unchanged return _STD invoke(static_cast<_Fx&&>(_Func), static_cast<_Valtys&&>(_Vals)...); } }; template -_CONSTEXPR20 auto _Call_binder(_Invoker_ret<_Ret>, index_sequence<_Ix...>, _Cv_FD& _Obj, _Cv_tuple_TiD& _Tpl, - _Untuple&& _Ut) noexcept(noexcept(_Invoker_ret<_Ret>::_Call(_Obj, - _STD _Fix_arg(_STD get<_Ix>(_Tpl), _STD move(_Ut))...))) - -> decltype(_Invoker_ret<_Ret>::_Call(_Obj, _STD _Fix_arg(_STD get<_Ix>(_Tpl), _STD move(_Ut))...)) { +_CONSTEXPR20 auto _Call_binder( + _Invoker_ret<_Ret>, index_sequence<_Ix...>, _Cv_FD& _Obj, _Cv_tuple_TiD& _Tpl, _Untuple&& _Ut) + noexcept(noexcept(_Invoker_ret<_Ret>::_Call(_Obj, _STD _Fix_arg(_STD get<_Ix>(_Tpl), _STD move(_Ut))...))) + -> decltype(_Invoker_ret<_Ret>::_Call(_Obj, _STD _Fix_arg(_STD get<_Ix>(_Tpl), _STD move(_Ut))...)) { // bind() and bind() invocation return _Invoker_ret<_Ret>::_Call(_Obj, _STD _Fix_arg(_STD get<_Ix>(_Tpl), _STD move(_Ut))...); } @@ -2215,11 +2215,11 @@ namespace placeholders { #if _HAS_CXX20 template -constexpr auto _Call_front_binder(index_sequence<_Ix...>, _Cv_FD&& _Obj, _Cv_tuple_TiD&& _Tpl, - _Unbound&&... _Unbargs) noexcept(noexcept(_STD invoke(_STD forward<_Cv_FD>(_Obj), - _STD get<_Ix>(_STD forward<_Cv_tuple_TiD>(_Tpl))..., _STD forward<_Unbound>(_Unbargs)...))) - -> decltype(_STD invoke(_STD forward<_Cv_FD>(_Obj), _STD get<_Ix>(_STD forward<_Cv_tuple_TiD>(_Tpl))..., - _STD forward<_Unbound>(_Unbargs)...)) { +constexpr auto _Call_front_binder(index_sequence<_Ix...>, _Cv_FD&& _Obj, _Cv_tuple_TiD&& _Tpl, _Unbound&&... _Unbargs) + noexcept(noexcept(_STD invoke(_STD forward<_Cv_FD>(_Obj), _STD get<_Ix>(_STD forward<_Cv_tuple_TiD>(_Tpl))..., + _STD forward<_Unbound>(_Unbargs)...))) -> decltype(_STD invoke(_STD forward<_Cv_FD>(_Obj), + _STD get<_Ix>(_STD forward<_Cv_tuple_TiD>(_Tpl))..., + _STD forward<_Unbound>(_Unbargs)...)) { return _STD invoke(_STD forward<_Cv_FD>(_Obj), _STD get<_Ix>(_STD forward<_Cv_tuple_TiD>(_Tpl))..., _STD forward<_Unbound>(_Unbargs)...); } @@ -2308,11 +2308,11 @@ _NODISCARD constexpr auto bind_front(_Fx&& _Func, _Types&&... _Args) { #if _HAS_CXX23 template -constexpr auto _Call_back_binder(index_sequence<_Ix...>, _Cv_FD&& _Obj, _Cv_tuple_TiD&& _Tpl, - _Unbound&&... _Unbargs) noexcept(noexcept(_STD invoke(_STD forward<_Cv_FD>(_Obj), - _STD forward<_Unbound>(_Unbargs)..., _STD get<_Ix>(_STD forward<_Cv_tuple_TiD>(_Tpl))...))) - -> decltype(_STD invoke(_STD forward<_Cv_FD>(_Obj), _STD forward<_Unbound>(_Unbargs)..., - _STD get<_Ix>(_STD forward<_Cv_tuple_TiD>(_Tpl))...)) { +constexpr auto _Call_back_binder(index_sequence<_Ix...>, _Cv_FD&& _Obj, _Cv_tuple_TiD&& _Tpl, _Unbound&&... _Unbargs) + noexcept(noexcept(_STD invoke(_STD forward<_Cv_FD>(_Obj), _STD forward<_Unbound>(_Unbargs)..., + _STD get<_Ix>(_STD forward<_Cv_tuple_TiD>(_Tpl))...))) + -> decltype(_STD invoke(_STD forward<_Cv_FD>(_Obj), _STD forward<_Unbound>(_Unbargs)..., + _STD get<_Ix>(_STD forward<_Cv_tuple_TiD>(_Tpl))...)) { return _STD invoke(_STD forward<_Cv_FD>(_Obj), _STD forward<_Unbound>(_Unbargs)..., _STD get<_Ix>(_STD forward<_Cv_tuple_TiD>(_Tpl))...); } diff --git a/stl/inc/hash_map b/stl/inc/hash_map index 011a066768..b204ecba06 100644 --- a/stl/inc/hash_map +++ b/stl/inc/hash_map @@ -279,8 +279,8 @@ namespace stdext { }; template - void swap(hash_map<_Kty, _Ty, _Tr, _Alloc>& _Left, hash_map<_Kty, _Ty, _Tr, _Alloc>& _Right) noexcept( - noexcept(_Left.swap(_Right))) { + void swap(hash_map<_Kty, _Ty, _Tr, _Alloc>& _Left, hash_map<_Kty, _Ty, _Tr, _Alloc>& _Right) + noexcept(noexcept(_Left.swap(_Right))) { _Left.swap(_Right); } @@ -439,8 +439,8 @@ namespace stdext { }; template - void swap(hash_multimap<_Kty, _Ty, _Tr, _Alloc>& _Left, hash_multimap<_Kty, _Ty, _Tr, _Alloc>& _Right) noexcept( - noexcept(_Left.swap(_Right))) { + void swap(hash_multimap<_Kty, _Ty, _Tr, _Alloc>& _Left, hash_multimap<_Kty, _Ty, _Tr, _Alloc>& _Right) + noexcept(noexcept(_Left.swap(_Right))) { _Left.swap(_Right); } diff --git a/stl/inc/hash_set b/stl/inc/hash_set index 8b7f9a2586..914a09c558 100644 --- a/stl/inc/hash_set +++ b/stl/inc/hash_set @@ -215,8 +215,8 @@ namespace stdext { }; template - void swap(hash_set<_Kty, _Tr, _Alloc>& _Left, hash_set<_Kty, _Tr, _Alloc>& _Right) noexcept( - noexcept(_Left.swap(_Right))) { + void swap(hash_set<_Kty, _Tr, _Alloc>& _Left, hash_set<_Kty, _Tr, _Alloc>& _Right) + noexcept(noexcept(_Left.swap(_Right))) { _Left.swap(_Right); } @@ -358,8 +358,8 @@ namespace stdext { }; template - void swap(hash_multiset<_Kty, _Tr, _Alloc>& _Left, hash_multiset<_Kty, _Tr, _Alloc>& _Right) noexcept( - noexcept(_Left.swap(_Right))) { + void swap(hash_multiset<_Kty, _Tr, _Alloc>& _Left, hash_multiset<_Kty, _Tr, _Alloc>& _Right) + noexcept(noexcept(_Left.swap(_Right))) { _Left.swap(_Right); } diff --git a/stl/inc/iterator b/stl/inc/iterator index 25ebe3b434..d6926e5df8 100644 --- a/stl/inc/iterator +++ b/stl/inc/iterator @@ -190,14 +190,14 @@ public: template requires convertible_to - constexpr move_sentinel(const move_sentinel<_Se2>& _Val) noexcept( - is_nothrow_constructible_v<_Se, const _Se2&>) // strengthened + constexpr move_sentinel(const move_sentinel<_Se2>& _Val) + noexcept(is_nothrow_constructible_v<_Se, const _Se2&>) // strengthened : _Last(_Val._Get_last()) {} template requires assignable_from<_Se&, const _Se2&> - constexpr move_sentinel& operator=(const move_sentinel<_Se2>& _Val) noexcept( - is_nothrow_assignable_v<_Se&, const _Se2&>) /* strengthened */ { + constexpr move_sentinel& operator=(const move_sentinel<_Se2>& _Val) + noexcept(is_nothrow_assignable_v<_Se&, const _Se2&>) /* strengthened */ { _Last = _Val._Get_last(); return *this; } @@ -251,8 +251,8 @@ public: constexpr istream_iterator() noexcept(is_nothrow_default_constructible_v<_Ty>) /* strengthened */ {} #if _HAS_CXX20 - constexpr istream_iterator(default_sentinel_t) noexcept( - is_nothrow_default_constructible_v<_Ty>) /* strengthened */ {} + constexpr istream_iterator(default_sentinel_t) + noexcept(is_nothrow_default_constructible_v<_Ty>) /* strengthened */ {} #endif // _HAS_CXX20 istream_iterator(istream_type& _Istr) : _Myistr(_STD addressof(_Istr)) { @@ -393,8 +393,8 @@ private: private: friend istreambuf_iterator; - _Istreambuf_proxy(streambuf_type* _Strbuf_, _Elem _Keep_) noexcept( - is_nothrow_copy_constructible_v<_Elem>) // strengthened + _Istreambuf_proxy(streambuf_type* _Strbuf_, _Elem _Keep_) + noexcept(is_nothrow_copy_constructible_v<_Elem>) // strengthened : _Strbuf(_Strbuf_), _Keep(_Keep_) {} streambuf_type* _Strbuf; @@ -575,20 +575,20 @@ public: : _First{}, _Contains{_Variantish_state::_Holds_first} {} template - constexpr explicit _Variantish(in_place_type_t<_Ty1>, _Types&&... _Args) noexcept( - is_nothrow_constructible_v<_Ty1, _Types...>) + constexpr explicit _Variantish(in_place_type_t<_Ty1>, _Types&&... _Args) + noexcept(is_nothrow_constructible_v<_Ty1, _Types...>) : _First(_STD forward<_Types>(_Args)...), _Contains{_Variantish_state::_Holds_first} {} template requires _Different_from<_Ty1, _Ty2> - constexpr explicit _Variantish(in_place_type_t<_Ty2>, _Types&&... _Args) noexcept( - is_nothrow_constructible_v<_Ty2, _Types...>) + constexpr explicit _Variantish(in_place_type_t<_Ty2>, _Types&&... _Args) + noexcept(is_nothrow_constructible_v<_Ty2, _Types...>) : _Second(_STD forward<_Types>(_Args)...), _Contains{_Variantish_state::_Holds_second} {} template requires _Different_from<_Variantish<_Uty1, _Uty2>, _Variantish> - constexpr _Variantish(const _Variantish<_Uty1, _Uty2>& _That) noexcept( - is_nothrow_constructible_v<_Ty1, const _Uty1&> && is_nothrow_constructible_v<_Ty2, const _Uty2&>) + constexpr _Variantish(const _Variantish<_Uty1, _Uty2>& _That) + noexcept(is_nothrow_constructible_v<_Ty1, const _Uty1&> && is_nothrow_constructible_v<_Ty2, const _Uty2&>) : _Contains{_That._Contains} { switch (_That._Contains) { case _Variantish_state::_Holds_first: @@ -607,8 +607,8 @@ public: && is_trivially_copy_constructible_v<_Ty2> = default; // clang-format on - constexpr _Variantish(const _Variantish& _That) noexcept( - is_nothrow_copy_constructible_v<_Ty1> && is_nothrow_copy_constructible_v<_Ty2>) + constexpr _Variantish(const _Variantish& _That) + noexcept(is_nothrow_copy_constructible_v<_Ty1> && is_nothrow_copy_constructible_v<_Ty2>) : _Contains{_That._Contains} { switch (_Contains) { case _Variantish_state::_Holds_first: @@ -627,8 +627,8 @@ public: && is_trivially_move_constructible_v<_Ty2> = default; // clang-format on - constexpr _Variantish(_Variantish&& _That) noexcept( - is_nothrow_move_constructible_v<_Ty1> && is_nothrow_move_constructible_v<_Ty2>) + constexpr _Variantish(_Variantish&& _That) + noexcept(is_nothrow_move_constructible_v<_Ty1> && is_nothrow_move_constructible_v<_Ty2>) : _Contains{_That._Contains} { switch (_Contains) { case _Variantish_state::_Holds_first: @@ -657,9 +657,9 @@ public: && is_trivially_copy_assignable_v<_Ty2> = default; // clang-format on - constexpr _Variantish& operator=(const _Variantish& _That) noexcept( - is_nothrow_copy_constructible_v<_Ty1> && is_nothrow_copy_constructible_v<_Ty2> - && is_nothrow_copy_assignable_v<_Ty1> && is_nothrow_copy_assignable_v<_Ty2>) { + constexpr _Variantish& operator=(const _Variantish& _That) + noexcept(is_nothrow_copy_constructible_v<_Ty1> && is_nothrow_copy_constructible_v<_Ty2> + && is_nothrow_copy_assignable_v<_Ty1> && is_nothrow_copy_assignable_v<_Ty2>) { if (_Contains == _That._Contains) { switch (_Contains) { case _Variantish_state::_Holds_first: @@ -702,9 +702,9 @@ public: && is_trivially_move_assignable_v<_Ty2> = default; // clang-format on - constexpr _Variantish& operator=(_Variantish&& _That) noexcept( - is_nothrow_move_constructible_v<_Ty1> && is_nothrow_move_constructible_v<_Ty2> - && is_nothrow_move_assignable_v<_Ty1> && is_nothrow_move_assignable_v<_Ty2>) { + constexpr _Variantish& operator=(_Variantish&& _That) + noexcept(is_nothrow_move_constructible_v<_Ty1> && is_nothrow_move_constructible_v<_Ty2> + && is_nothrow_move_assignable_v<_Ty1> && is_nothrow_move_assignable_v<_Ty2>) { if (_Contains == _That._Contains) { switch (_Contains) { case _Variantish_state::_Holds_first: @@ -740,9 +740,9 @@ public: template requires _Different_from<_Variantish<_Uty1, _Uty2>, _Variantish> - constexpr _Variantish& operator=(const _Variantish<_Uty1, _Uty2>& _That) noexcept( - is_nothrow_constructible_v<_Ty1, const _Uty1&> && is_nothrow_constructible_v<_Ty2, const _Uty2&> - && is_nothrow_assignable_v<_Ty1&, const _Uty1&> && is_nothrow_assignable_v<_Ty2&, const _Uty2&>) { + constexpr _Variantish& operator=(const _Variantish<_Uty1, _Uty2>& _That) + noexcept(is_nothrow_constructible_v<_Ty1, const _Uty1&> && is_nothrow_constructible_v<_Ty2, const _Uty2&> + && is_nothrow_assignable_v<_Ty1&, const _Uty1&> && is_nothrow_assignable_v<_Ty2&, const _Uty2&>) { if (_Contains == _That._Contains) { switch (_Contains) { case _Variantish_state::_Holds_first: @@ -873,8 +873,8 @@ private: struct _Proxy_base { iter_value_t<_Iter> _Keep; - constexpr explicit _Proxy_base(iter_reference_t<_Iter>&& _Right) noexcept( - is_nothrow_constructible_v, iter_reference_t<_Iter>>) // strengthened + constexpr explicit _Proxy_base(iter_reference_t<_Iter>&& _Right) + noexcept(is_nothrow_constructible_v, iter_reference_t<_Iter>>) // strengthened : _Keep(_STD forward>(_Right)) {} }; @@ -893,18 +893,18 @@ public: template requires convertible_to && convertible_to - constexpr common_iterator(const common_iterator<_OIter, _OSe>& _Right) noexcept( - is_nothrow_constructible_v<_Iter, const _OIter&> - && is_nothrow_constructible_v<_Se, const _OSe&>) // strengthened + constexpr common_iterator(const common_iterator<_OIter, _OSe>& _Right) + noexcept(is_nothrow_constructible_v<_Iter, const _OIter&> + && is_nothrow_constructible_v<_Se, const _OSe&>) // strengthened : _Val{_Right._Get_val()} {} template requires convertible_to && convertible_to && assignable_from<_Iter&, const _OIter&> && assignable_from<_Se&, const _OSe&> - constexpr common_iterator& operator=(const common_iterator<_OIter, _OSe>& _Right) noexcept( - is_nothrow_constructible_v<_Iter, const _OIter&> && is_nothrow_constructible_v<_Se, const _OSe&> - && is_nothrow_assignable_v<_Iter&, const _OIter&> - && is_nothrow_assignable_v<_Se&, const _OSe&>) /* strengthened */ { + constexpr common_iterator& operator=(const common_iterator<_OIter, _OSe>& _Right) + noexcept(is_nothrow_constructible_v<_Iter, const _OIter&> && is_nothrow_constructible_v<_Se, const _OSe&> + && is_nothrow_assignable_v<_Iter&, const _OIter&> + && is_nothrow_assignable_v<_Se&, const _OSe&>) /* strengthened */ { _Val = _Right._Get_val(); return *this; } @@ -1051,8 +1051,8 @@ public: } } - _NODISCARD friend constexpr decltype(auto) iter_move(const common_iterator& _Right) noexcept( - noexcept(_RANGES iter_move(_Right._Val._Get_first()))) + _NODISCARD friend constexpr decltype(auto) iter_move(const common_iterator& _Right) + noexcept(noexcept(_RANGES iter_move(_Right._Val._Get_first()))) requires input_iterator<_Iter> { #if _ITERATOR_DEBUG_LEVEL != 0 @@ -1063,8 +1063,8 @@ public: } template _OIter, class _OSe> - friend constexpr void iter_swap(const common_iterator& _Left, const common_iterator<_OIter, _OSe>& _Right) noexcept( - noexcept(_RANGES iter_swap(_Left._Val._Get_first(), _Right._Get_val()._Get_first()))) { + friend constexpr void iter_swap(const common_iterator& _Left, const common_iterator<_OIter, _OSe>& _Right) + noexcept(noexcept(_RANGES iter_swap(_Left._Val._Get_first(), _Right._Get_val()._Get_first()))) { auto& _Right_val = _Right._Get_val(); #if _ITERATOR_DEBUG_LEVEL != 0 _STL_VERIFY(_Left._Val._Contains == _Variantish_state::_Holds_first @@ -1160,8 +1160,8 @@ public: constexpr counted_iterator() requires default_initializable<_Iter> = default; // clang-format on - constexpr counted_iterator(_Iter _Right, const iter_difference_t<_Iter> _Diff) noexcept( - is_nothrow_move_constructible_v<_Iter>) // strengthened + constexpr counted_iterator(_Iter _Right, const iter_difference_t<_Iter> _Diff) + noexcept(is_nothrow_move_constructible_v<_Iter>) // strengthened : _Current(_STD move(_Right)), _Length(_Diff) { #if _ITERATOR_DEBUG_LEVEL != 0 _STL_VERIFY(_Diff >= 0, "counted_iterator requires non-negative length n"); @@ -1170,14 +1170,14 @@ public: template requires convertible_to - constexpr counted_iterator(const counted_iterator<_Other>& _Right) noexcept( - is_nothrow_constructible_v<_Iter, const _Other&>) // strengthened + constexpr counted_iterator(const counted_iterator<_Other>& _Right) + noexcept(is_nothrow_constructible_v<_Iter, const _Other&>) // strengthened : _Current(_Right.base()), _Length(_Right.count()) {} template requires assignable_from<_Iter&, const _Other&> - constexpr counted_iterator& operator=(const counted_iterator<_Other>& _Right) noexcept( - is_nothrow_assignable_v<_Iter&, const _Other&>) /* strengthened */ { + constexpr counted_iterator& operator=(const counted_iterator<_Other>& _Right) + noexcept(is_nothrow_assignable_v<_Iter&, const _Other&>) /* strengthened */ { _Current = _Right.base(); _Length = _Right.count(); return *this; @@ -1367,16 +1367,16 @@ public: } // [counted.iter.cust] - _NODISCARD friend constexpr decltype(auto) iter_move(const counted_iterator& _Right) noexcept( - noexcept(_RANGES iter_move(_Right._Current))) + _NODISCARD friend constexpr decltype(auto) iter_move(const counted_iterator& _Right) + noexcept(noexcept(_RANGES iter_move(_Right._Current))) requires input_iterator<_Iter> { return _RANGES iter_move(_Right._Current); } template _Other> - friend constexpr void iter_swap(const counted_iterator& _Left, const counted_iterator<_Other>& _Right) noexcept( - noexcept(_RANGES iter_swap(_Left._Current, _Right.base()))) { + friend constexpr void iter_swap(const counted_iterator& _Left, const counted_iterator<_Other>& _Right) + noexcept(noexcept(_RANGES iter_swap(_Left._Current, _Right.base()))) { _RANGES iter_swap(_Left._Current, _Right.base()); } diff --git a/stl/inc/list b/stl/inc/list index 3d427f80e6..5d42e9fe73 100644 --- a/stl/inc/list +++ b/stl/inc/list @@ -916,8 +916,8 @@ public: _Swap_val(_Right); } - list& operator=(list&& _Right) noexcept( - _Choose_pocma_v<_Alnode> == _Pocma_values::_Equal_allocators) /* strengthened */ { + list& operator=(list&& _Right) + noexcept(_Choose_pocma_v<_Alnode> == _Pocma_values::_Equal_allocators) /* strengthened */ { if (this == _STD addressof(_Right)) { return *this; } diff --git a/stl/inc/map b/stl/inc/map index 32fe59cf6a..4e601e3a0b 100644 --- a/stl/inc/map +++ b/stl/inc/map @@ -438,8 +438,8 @@ _NODISCARD bool operator>=(const map<_Kty, _Ty, _Pr, _Alloc>& _Left, const map<_ #endif // ^^^ !_HAS_CXX20 ^^^ _EXPORT_STD template -void swap(map<_Kty, _Ty, _Pr, _Alloc>& _Left, map<_Kty, _Ty, _Pr, _Alloc>& _Right) noexcept( - noexcept(_Left.swap(_Right))) { +void swap(map<_Kty, _Ty, _Pr, _Alloc>& _Left, map<_Kty, _Ty, _Pr, _Alloc>& _Right) + noexcept(noexcept(_Left.swap(_Right))) { _Left.swap(_Right); } @@ -544,8 +544,8 @@ public: multimap(multimap&& _Right, const allocator_type& _Al) : _Mybase(_STD move(_Right), _Al) {} - multimap& operator=(multimap&& _Right) noexcept( - _Alnode_traits::is_always_equal::value && is_nothrow_move_assignable_v<_Pr>) { + multimap& operator=(multimap&& _Right) + noexcept(_Alnode_traits::is_always_equal::value && is_nothrow_move_assignable_v<_Pr>) { _Mybase::operator=(_STD move(_Right)); return *this; } @@ -675,8 +675,8 @@ _NODISCARD bool operator>=( #endif // ^^^ !_HAS_CXX20 ^^^ _EXPORT_STD template -void swap(multimap<_Kty, _Ty, _Pr, _Alloc>& _Left, multimap<_Kty, _Ty, _Pr, _Alloc>& _Right) noexcept( - noexcept(_Left.swap(_Right))) { +void swap(multimap<_Kty, _Ty, _Pr, _Alloc>& _Left, multimap<_Kty, _Ty, _Pr, _Alloc>& _Right) + noexcept(noexcept(_Left.swap(_Right))) { _Left.swap(_Right); } diff --git a/stl/inc/mdspan b/stl/inc/mdspan index a3023b9b1a..3bb2292c5e 100644 --- a/stl/inc/mdspan +++ b/stl/inc/mdspan @@ -1143,8 +1143,8 @@ struct _Mdspan_accessor_base<_AccessorPolicy> { #if _CONTAINER_DEBUG_LEVEL > 0 template -_NODISCARD constexpr _IndexType _Mdspan_checked_index_cast(_OtherIndexType&& _Idx) noexcept( - is_nothrow_constructible_v<_IndexType, _OtherIndexType>) { +_NODISCARD constexpr _IndexType _Mdspan_checked_index_cast(_OtherIndexType&& _Idx) + noexcept(is_nothrow_constructible_v<_IndexType, _OtherIndexType>) { _STL_INTERNAL_STATIC_ASSERT(is_integral_v<_IndexType> && is_constructible_v<_IndexType, _OtherIndexType>); using _Arg_value_t = remove_cvref_t<_OtherIndexType>; @@ -1225,9 +1225,9 @@ public: is_nothrow_constructible...> && (sizeof...(_OtherIndexTypes) == rank() || sizeof...(_OtherIndexTypes) == rank_dynamic()) && is_constructible_v && is_default_constructible_v - constexpr explicit mdspan(data_handle_type _Ptr_, _OtherIndexTypes... _Exts) noexcept( - is_nothrow_constructible_v - && is_nothrow_default_constructible_v) // strengthened + constexpr explicit mdspan(data_handle_type _Ptr_, _OtherIndexTypes... _Exts) + noexcept(is_nothrow_constructible_v + && is_nothrow_default_constructible_v) // strengthened : _Mapping_base(extents_type{static_cast(_STD move(_Exts))...}), _Accessor_base(), _Ptr(_STD move(_Ptr_)) {} @@ -1236,10 +1236,9 @@ public: && is_nothrow_constructible_v && (_Size == rank() || _Size == rank_dynamic()) && is_constructible_v && is_default_constructible_v - constexpr explicit(_Size != rank_dynamic()) - mdspan(data_handle_type _Ptr_, span<_OtherIndexType, _Size> _Exts) noexcept( - is_nothrow_constructible_v - && is_nothrow_default_constructible_v) // strengthened + constexpr explicit(_Size != rank_dynamic()) mdspan(data_handle_type _Ptr_, span<_OtherIndexType, _Size> _Exts) + noexcept(is_nothrow_constructible_v + && is_nothrow_default_constructible_v) // strengthened : _Mapping_base(extents_type{_Exts}), _Accessor_base(), _Ptr(_STD move(_Ptr_)) {} template @@ -1248,20 +1247,20 @@ public: && (_Size == rank() || _Size == rank_dynamic()) && is_constructible_v && is_default_constructible_v constexpr explicit(_Size != rank_dynamic()) - mdspan(data_handle_type _Ptr_, const array<_OtherIndexType, _Size>& _Exts) noexcept( - is_nothrow_constructible_v - && is_nothrow_default_constructible_v) // strengthened + mdspan(data_handle_type _Ptr_, const array<_OtherIndexType, _Size>& _Exts) + noexcept(is_nothrow_constructible_v + && is_nothrow_default_constructible_v) // strengthened : _Mapping_base(extents_type{_Exts}), _Accessor_base(), _Ptr(_STD move(_Ptr_)) {} - constexpr mdspan(data_handle_type _Ptr_, const extents_type& _Exts) noexcept( - is_nothrow_constructible_v - && is_nothrow_default_constructible_v) // strengthened + constexpr mdspan(data_handle_type _Ptr_, const extents_type& _Exts) + noexcept(is_nothrow_constructible_v + && is_nothrow_default_constructible_v) // strengthened requires is_constructible_v && is_default_constructible_v : _Mapping_base(_Exts), _Accessor_base(), _Ptr(_STD move(_Ptr_)) {} - constexpr mdspan(data_handle_type _Ptr_, const mapping_type& _Map_) noexcept( - is_nothrow_copy_constructible_v - && is_nothrow_default_constructible_v) // strengthened + constexpr mdspan(data_handle_type _Ptr_, const mapping_type& _Map_) + noexcept(is_nothrow_copy_constructible_v + && is_nothrow_default_constructible_v) // strengthened requires is_default_constructible_v : _Mapping_base(_Map_), _Accessor_base(), _Ptr(_STD move(_Ptr_)) {} @@ -1275,11 +1274,11 @@ public: constexpr explicit( !is_convertible_v&, mapping_type> || !is_convertible_v) - mdspan(const mdspan<_OtherElementType, _OtherExtents, _OtherLayoutPolicy, _OtherAccessor>& _Other) noexcept( - is_nothrow_constructible_v - && is_nothrow_constructible_v&> - && is_nothrow_constructible_v) // strengthened + mdspan(const mdspan<_OtherElementType, _OtherExtents, _OtherLayoutPolicy, _OtherAccessor>& _Other) + noexcept(is_nothrow_constructible_v + && is_nothrow_constructible_v&> + && is_nothrow_constructible_v) // strengthened : _Mapping_base(_Other.mapping()), _Accessor_base(_Other.accessor()), _Ptr(_Other.data_handle()) { static_assert(is_constructible_v, "The data_handle_type must be constructible from const typename OtherAccessor::data_handle_type& (N4950 " diff --git a/stl/inc/memory b/stl/inc/memory index 9534bb5898..7d9fc4c7af 100644 --- a/stl/inc/memory +++ b/stl/inc/memory @@ -3852,8 +3852,8 @@ struct owner_less { template struct hash> : _Conditionally_enabled_hash, is_default_constructible_v::pointer>>> { - static size_t _Do_hash(const unique_ptr<_Ty, _Dx>& _Keyval) noexcept( - _Is_nothrow_hashable::pointer>::value) { + static size_t _Do_hash(const unique_ptr<_Ty, _Dx>& _Keyval) + noexcept(_Is_nothrow_hashable::pointer>::value) { return hash::pointer>{}(_Keyval.get()); } }; @@ -4315,8 +4315,8 @@ class out_ptr_t { "out_ptr_t with shared_ptr requires a deleter (N4950 [out.ptr.t]/3)"); public: - explicit out_ptr_t(_SmartPtr& _Smart_ptr_, _ArgsT... _Args_) noexcept( - is_nothrow_constructible_v, _ArgsT...>) /* strengthened */ + explicit out_ptr_t(_SmartPtr& _Smart_ptr_, _ArgsT... _Args_) + noexcept(is_nothrow_constructible_v, _ArgsT...>) /* strengthened */ : _Smart_ptr(_Smart_ptr_), _Mypair(_One_then_variadic_args_t{}, tuple<_ArgsT...>{_STD forward<_ArgsT>(_Args_)...}) { constexpr bool _Is_resettable = requires { _Smart_ptr.reset(); }; // TRANSITION, DevCom-10291456 @@ -4399,9 +4399,9 @@ private: } public: - explicit inout_ptr_t(_SmartPtr& _Smart_ptr_, _ArgsT... _Args_) noexcept( - is_nothrow_constructible_v, _ArgsT...> // - && noexcept(_Get_ptr_from_smart(_Smart_ptr_))) /* strengthened */ + explicit inout_ptr_t(_SmartPtr& _Smart_ptr_, _ArgsT... _Args_) + noexcept(is_nothrow_constructible_v, _ArgsT...> // + && noexcept(_Get_ptr_from_smart(_Smart_ptr_))) /* strengthened */ : _Smart_ptr(_Smart_ptr_), _Mypair(_One_then_variadic_args_t{}, tuple<_ArgsT...>{_STD forward<_ArgsT>(_Args_)...}, _Get_ptr_from_smart(_Smart_ptr_)) {} diff --git a/stl/inc/optional b/stl/inc/optional index 7afd642560..6ce1bcf4c3 100644 --- a/stl/inc/optional +++ b/stl/inc/optional @@ -77,14 +77,14 @@ struct _Optional_destruct_base { // either contains a value of _Ty or is empty ( constexpr _Optional_destruct_base() noexcept : _Dummy{}, _Has_value{false} {} // initialize an empty optional template - constexpr explicit _Optional_destruct_base(in_place_t, _Types&&... _Args) noexcept( - is_nothrow_constructible_v<_Ty, _Types...>) + constexpr explicit _Optional_destruct_base(in_place_t, _Types&&... _Args) + noexcept(is_nothrow_constructible_v<_Ty, _Types...>) : _Value(_STD forward<_Types>(_Args)...), _Has_value{true} {} // initialize contained value with _Args... #if _HAS_CXX23 template - constexpr _Optional_destruct_base(_Construct_from_invoke_result_tag, _Fn&& _Func, _Ux&& _Arg) noexcept( - noexcept(static_cast<_Ty>(_STD invoke(_STD forward<_Fn>(_Func), _STD forward<_Ux>(_Arg))))) + constexpr _Optional_destruct_base(_Construct_from_invoke_result_tag, _Fn&& _Func, _Ux&& _Arg) + noexcept(noexcept(static_cast<_Ty>(_STD invoke(_STD forward<_Fn>(_Func), _STD forward<_Ux>(_Arg))))) : _Value(_STD invoke(_STD forward<_Fn>(_Func), _STD forward<_Ux>(_Arg))), _Has_value{true} {} #endif // _HAS_CXX23 @@ -110,14 +110,14 @@ struct _Optional_destruct_base<_Ty, false> { // either contains a value of _Ty o constexpr _Optional_destruct_base() noexcept : _Dummy{}, _Has_value{false} {} // initialize an empty optional template - constexpr explicit _Optional_destruct_base(in_place_t, _Types&&... _Args) noexcept( - is_nothrow_constructible_v<_Ty, _Types...>) + constexpr explicit _Optional_destruct_base(in_place_t, _Types&&... _Args) + noexcept(is_nothrow_constructible_v<_Ty, _Types...>) : _Value(_STD forward<_Types>(_Args)...), _Has_value{true} {} // initialize contained value with _Args... #if _HAS_CXX23 template - constexpr _Optional_destruct_base(_Construct_from_invoke_result_tag, _Fn&& _Func, _Ux&& _Arg) noexcept( - noexcept(static_cast<_Ty>(_STD invoke(_STD forward<_Fn>(_Func), _STD forward<_Ux>(_Arg))))) + constexpr _Optional_destruct_base(_Construct_from_invoke_result_tag, _Fn&& _Func, _Ux&& _Arg) + noexcept(noexcept(static_cast<_Ty>(_STD invoke(_STD forward<_Fn>(_Func), _STD forward<_Ux>(_Arg))))) : _Value(_STD invoke(_STD forward<_Fn>(_Func), _STD forward<_Ux>(_Arg))), _Has_value{true} {} #endif // _HAS_CXX23 @@ -149,8 +149,8 @@ struct _Optional_construct_base : _Optional_destruct_base<_Ty> { } template - _CONSTEXPR20 void _Assign(_Ty2&& _Right) noexcept( - is_nothrow_assignable_v<_Ty&, _Ty2> && is_nothrow_constructible_v<_Ty, _Ty2>) { + _CONSTEXPR20 void _Assign(_Ty2&& _Right) + noexcept(is_nothrow_assignable_v<_Ty&, _Ty2> && is_nothrow_constructible_v<_Ty, _Ty2>) { // assign / initialize the contained value from _Right if (this->_Has_value) { static_cast<_Ty&>(this->_Value) = _STD forward<_Ty2>(_Right); @@ -160,8 +160,8 @@ struct _Optional_construct_base : _Optional_destruct_base<_Ty> { } template - _CONSTEXPR20 void _Construct_from(_Self&& _Right) noexcept( - is_nothrow_constructible_v<_Ty, decltype(*_STD forward<_Self>(_Right))>) { + _CONSTEXPR20 void _Construct_from(_Self&& _Right) + noexcept(is_nothrow_constructible_v<_Ty, decltype(*_STD forward<_Self>(_Right))>) { // initialize contained value from _Right iff it contains a value if (_Right._Has_value) { _Construct(*_STD forward<_Self>(_Right)); @@ -169,9 +169,9 @@ struct _Optional_construct_base : _Optional_destruct_base<_Ty> { } template - _CONSTEXPR20 void _Assign_from(_Self&& _Right) noexcept( - is_nothrow_constructible_v<_Ty, decltype(*_STD forward<_Self>(_Right))> - && is_nothrow_assignable_v<_Ty&, decltype(*_STD forward<_Self>(_Right))>) { + _CONSTEXPR20 void _Assign_from(_Self&& _Right) + noexcept(is_nothrow_constructible_v<_Ty, decltype(*_STD forward<_Self>(_Right))> + && is_nothrow_assignable_v<_Ty&, decltype(*_STD forward<_Self>(_Right))>) { // assign/initialize/destroy contained value from _Right if (_Right._Has_value) { _Assign(*_STD forward<_Self>(_Right)); @@ -226,14 +226,14 @@ public: constexpr optional(nullopt_t) noexcept {} template , int> = 0> - constexpr explicit optional(in_place_t, _Types&&... _Args) noexcept( - is_nothrow_constructible_v<_Ty, _Types...>) // strengthened + constexpr explicit optional(in_place_t, _Types&&... _Args) + noexcept(is_nothrow_constructible_v<_Ty, _Types...>) // strengthened : _Mybase(in_place, _STD forward<_Types>(_Args)...) {} template &, _Types...>, int> = 0> - constexpr explicit optional(in_place_t, initializer_list<_Elem> _Ilist, _Types&&... _Args) noexcept( - is_nothrow_constructible_v<_Ty, initializer_list<_Elem>&, _Types...>) // strengthened + constexpr explicit optional(in_place_t, initializer_list<_Elem> _Ilist, _Types&&... _Args) + noexcept(is_nothrow_constructible_v<_Ty, initializer_list<_Elem>&, _Types...>) // strengthened : _Mybase(in_place, _Ilist, _STD forward<_Types>(_Args)...) {} template @@ -243,8 +243,8 @@ public: is_constructible<_Ty, _Ty2>>>; template ::value, int> = 0> - constexpr explicit(!is_convertible_v<_Ty2, _Ty>) - optional(_Ty2&& _Right) noexcept(is_nothrow_constructible_v<_Ty, _Ty2>) // strengthened + constexpr explicit(!is_convertible_v<_Ty2, _Ty>) optional(_Ty2&& _Right) + noexcept(is_nothrow_constructible_v<_Ty, _Ty2>) // strengthened : _Mybase(in_place, _STD forward<_Ty2>(_Right)) {} template @@ -258,16 +258,16 @@ public: template , is_constructible<_Ty, const _Ty2&>>, int> = 0> - _CONSTEXPR20 explicit(!is_convertible_v) optional(const optional<_Ty2>& _Right) noexcept( - is_nothrow_constructible_v<_Ty, const _Ty2&>) /* strengthened */ { + _CONSTEXPR20 explicit(!is_convertible_v) optional(const optional<_Ty2>& _Right) + noexcept(is_nothrow_constructible_v<_Ty, const _Ty2&>) /* strengthened */ { if (_Right) { this->_Construct(*_Right); } } template , is_constructible<_Ty, _Ty2>>, int> = 0> - _CONSTEXPR20 explicit(!is_convertible_v<_Ty2, _Ty>) - optional(optional<_Ty2>&& _Right) noexcept(is_nothrow_constructible_v<_Ty, _Ty2>) /* strengthened */ { + _CONSTEXPR20 explicit(!is_convertible_v<_Ty2, _Ty>) optional(optional<_Ty2>&& _Right) + noexcept(is_nothrow_constructible_v<_Ty, _Ty2>) /* strengthened */ { if (_Right) { this->_Construct(_STD move(*_Right)); } @@ -275,8 +275,8 @@ public: #if _HAS_CXX23 template - constexpr optional(_Construct_from_invoke_result_tag _Tag, _Fn&& _Func, _Ux&& _Arg) noexcept( - noexcept(static_cast<_Ty>(_STD invoke(_STD forward<_Fn>(_Func), _STD forward<_Ux>(_Arg))))) + constexpr optional(_Construct_from_invoke_result_tag _Tag, _Fn&& _Func, _Ux&& _Arg) + noexcept(noexcept(static_cast<_Ty>(_STD invoke(_STD forward<_Fn>(_Func), _STD forward<_Ux>(_Arg))))) : _Mybase(_Tag, _STD forward<_Fn>(_Func), _STD forward<_Ux>(_Arg)) {} #endif // _HAS_CXX23 @@ -289,8 +289,8 @@ public: negation, is_same<_Ty, decay_t<_Ty2>>>>, is_constructible<_Ty, _Ty2>, is_assignable<_Ty&, _Ty2>>, int> = 0> - _CONSTEXPR20 optional& operator=(_Ty2&& _Right) noexcept( - is_nothrow_assignable_v<_Ty&, _Ty2> && is_nothrow_constructible_v<_Ty, _Ty2>) /* strengthened */ { + _CONSTEXPR20 optional& operator=(_Ty2&& _Right) + noexcept(is_nothrow_assignable_v<_Ty&, _Ty2> && is_nothrow_constructible_v<_Ty, _Ty2>) /* strengthened */ { this->_Assign(_STD forward<_Ty2>(_Right)); return *this; } @@ -318,8 +318,8 @@ public: template , is_constructible<_Ty, _Ty2>, is_assignable<_Ty&, _Ty2>>, int> = 0> - _CONSTEXPR20 optional& operator=(optional<_Ty2>&& _Right) noexcept( - is_nothrow_assignable_v<_Ty&, _Ty2> && is_nothrow_constructible_v<_Ty, _Ty2>) /* strengthened */ { + _CONSTEXPR20 optional& operator=(optional<_Ty2>&& _Right) + noexcept(is_nothrow_assignable_v<_Ty&, _Ty2> && is_nothrow_constructible_v<_Ty, _Ty2>) /* strengthened */ { if (_Right) { this->_Assign(_STD move(*_Right)); } else { @@ -330,22 +330,22 @@ public: } template - _CONSTEXPR20 _Ty& emplace(_Types&&... _Args) noexcept( - is_nothrow_constructible_v<_Ty, _Types...>) /* strengthened */ { + _CONSTEXPR20 _Ty& emplace(_Types&&... _Args) + noexcept(is_nothrow_constructible_v<_Ty, _Types...>) /* strengthened */ { reset(); return this->_Construct(_STD forward<_Types>(_Args)...); } template &, _Types...>, int> = 0> - _CONSTEXPR20 _Ty& emplace(initializer_list<_Elem> _Ilist, _Types&&... _Args) noexcept( - is_nothrow_constructible_v<_Ty, initializer_list<_Elem>&, _Types...>) /* strengthened */ { + _CONSTEXPR20 _Ty& emplace(initializer_list<_Elem> _Ilist, _Types&&... _Args) + noexcept(is_nothrow_constructible_v<_Ty, initializer_list<_Elem>&, _Types...>) /* strengthened */ { reset(); return this->_Construct(_Ilist, _STD forward<_Types>(_Args)...); } - _CONSTEXPR20 void swap(optional& _Right) noexcept( - is_nothrow_move_constructible_v<_Ty> && is_nothrow_swappable_v<_Ty>) { + _CONSTEXPR20 void swap(optional& _Right) + noexcept(is_nothrow_move_constructible_v<_Ty> && is_nothrow_swappable_v<_Ty>) { static_assert(is_move_constructible_v<_Ty>, "optional::swap requires T to be move constructible (N4950 [optional.swap]/1)."); static_assert(!is_move_constructible_v<_Ty> || is_swappable_v<_Ty>, @@ -620,8 +620,8 @@ template optional(_Ty) -> optional<_Ty>; _EXPORT_STD template -_NODISCARD constexpr bool operator==(const optional<_Ty1>& _Left, const optional<_Ty2>& _Right) noexcept( - noexcept(_STD _Fake_copy_init(*_Left == *_Right))) /* strengthened */ +_NODISCARD constexpr bool operator==(const optional<_Ty1>& _Left, const optional<_Ty2>& _Right) + noexcept(noexcept(_STD _Fake_copy_init(*_Left == *_Right))) /* strengthened */ #if _HAS_CXX20 requires requires { { *_Left == *_Right } -> _Implicitly_convertible_to; @@ -637,8 +637,8 @@ _NODISCARD constexpr bool operator==(const optional<_Ty1>& _Left, const optional } _EXPORT_STD template -_NODISCARD constexpr bool operator!=(const optional<_Ty1>& _Left, const optional<_Ty2>& _Right) noexcept( - noexcept(_STD _Fake_copy_init(*_Left != *_Right))) /* strengthened */ +_NODISCARD constexpr bool operator!=(const optional<_Ty1>& _Left, const optional<_Ty2>& _Right) + noexcept(noexcept(_STD _Fake_copy_init(*_Left != *_Right))) /* strengthened */ #if _HAS_CXX20 requires requires { { *_Left != *_Right } -> _Implicitly_convertible_to; @@ -654,8 +654,8 @@ _NODISCARD constexpr bool operator!=(const optional<_Ty1>& _Left, const optional } _EXPORT_STD template -_NODISCARD constexpr bool operator<(const optional<_Ty1>& _Left, const optional<_Ty2>& _Right) noexcept( - noexcept(_STD _Fake_copy_init(*_Left < *_Right))) /* strengthened */ +_NODISCARD constexpr bool operator<(const optional<_Ty1>& _Left, const optional<_Ty2>& _Right) + noexcept(noexcept(_STD _Fake_copy_init(*_Left < *_Right))) /* strengthened */ #if _HAS_CXX20 requires requires { { *_Left < *_Right } -> _Implicitly_convertible_to; @@ -671,8 +671,8 @@ _NODISCARD constexpr bool operator<(const optional<_Ty1>& _Left, const optional< } _EXPORT_STD template -_NODISCARD constexpr bool operator>(const optional<_Ty1>& _Left, const optional<_Ty2>& _Right) noexcept( - noexcept(_STD _Fake_copy_init(*_Left > *_Right))) /* strengthened */ +_NODISCARD constexpr bool operator>(const optional<_Ty1>& _Left, const optional<_Ty2>& _Right) + noexcept(noexcept(_STD _Fake_copy_init(*_Left > *_Right))) /* strengthened */ #if _HAS_CXX20 requires requires { { *_Left > *_Right } -> _Implicitly_convertible_to; @@ -688,8 +688,8 @@ _NODISCARD constexpr bool operator>(const optional<_Ty1>& _Left, const optional< } _EXPORT_STD template -_NODISCARD constexpr bool operator<=(const optional<_Ty1>& _Left, const optional<_Ty2>& _Right) noexcept( - noexcept(_STD _Fake_copy_init(*_Left <= *_Right))) /* strengthened */ +_NODISCARD constexpr bool operator<=(const optional<_Ty1>& _Left, const optional<_Ty2>& _Right) + noexcept(noexcept(_STD _Fake_copy_init(*_Left <= *_Right))) /* strengthened */ #if _HAS_CXX20 requires requires { { *_Left <= *_Right } -> _Implicitly_convertible_to; @@ -705,8 +705,8 @@ _NODISCARD constexpr bool operator<=(const optional<_Ty1>& _Left, const optional } _EXPORT_STD template -_NODISCARD constexpr bool operator>=(const optional<_Ty1>& _Left, const optional<_Ty2>& _Right) noexcept( - noexcept(_STD _Fake_copy_init(*_Left >= *_Right))) /* strengthened */ +_NODISCARD constexpr bool operator>=(const optional<_Ty1>& _Left, const optional<_Ty2>& _Right) + noexcept(noexcept(_STD _Fake_copy_init(*_Left >= *_Right))) /* strengthened */ #if _HAS_CXX20 requires requires { { *_Left >= *_Right } -> _Implicitly_convertible_to; @@ -825,8 +825,8 @@ using _Enable_if_comparable_with_greater_equal = _Enable_if_bool_convertible() >= _STD declval())>; _EXPORT_STD template = 0> -_NODISCARD constexpr bool operator==(const optional<_Ty1>& _Left, const _Ty2& _Right) noexcept( - noexcept(_STD _Fake_copy_init(*_Left == _Right))) /* strengthened */ { +_NODISCARD constexpr bool operator==(const optional<_Ty1>& _Left, const _Ty2& _Right) + noexcept(noexcept(_STD _Fake_copy_init(*_Left == _Right))) /* strengthened */ { if (_Left) { return *_Left == _Right; } @@ -834,8 +834,8 @@ _NODISCARD constexpr bool operator==(const optional<_Ty1>& _Left, const _Ty2& _R } _EXPORT_STD template = 0> -_NODISCARD constexpr bool operator==(const _Ty1& _Left, const optional<_Ty2>& _Right) noexcept( - noexcept(_STD _Fake_copy_init(_Left == *_Right))) /* strengthened */ { +_NODISCARD constexpr bool operator==(const _Ty1& _Left, const optional<_Ty2>& _Right) + noexcept(noexcept(_STD _Fake_copy_init(_Left == *_Right))) /* strengthened */ { if (_Right) { return _Left == *_Right; } @@ -843,16 +843,16 @@ _NODISCARD constexpr bool operator==(const _Ty1& _Left, const optional<_Ty2>& _R } _EXPORT_STD template = 0> -_NODISCARD constexpr bool operator!=(const optional<_Ty1>& _Left, const _Ty2& _Right) noexcept( - noexcept(_STD _Fake_copy_init(*_Left != _Right))) /* strengthened */ { +_NODISCARD constexpr bool operator!=(const optional<_Ty1>& _Left, const _Ty2& _Right) + noexcept(noexcept(_STD _Fake_copy_init(*_Left != _Right))) /* strengthened */ { if (_Left) { return *_Left != _Right; } return true; } _EXPORT_STD template = 0> -_NODISCARD constexpr bool operator!=(const _Ty1& _Left, const optional<_Ty2>& _Right) noexcept( - noexcept(_STD _Fake_copy_init(_Left != *_Right))) /* strengthened */ { +_NODISCARD constexpr bool operator!=(const _Ty1& _Left, const optional<_Ty2>& _Right) + noexcept(noexcept(_STD _Fake_copy_init(_Left != *_Right))) /* strengthened */ { if (_Right) { return _Left != *_Right; } @@ -860,16 +860,16 @@ _NODISCARD constexpr bool operator!=(const _Ty1& _Left, const optional<_Ty2>& _R } _EXPORT_STD template = 0> -_NODISCARD constexpr bool operator<(const optional<_Ty1>& _Left, const _Ty2& _Right) noexcept( - noexcept(_STD _Fake_copy_init(*_Left < _Right))) /* strengthened */ { +_NODISCARD constexpr bool operator<(const optional<_Ty1>& _Left, const _Ty2& _Right) + noexcept(noexcept(_STD _Fake_copy_init(*_Left < _Right))) /* strengthened */ { if (_Left) { return *_Left < _Right; } return true; } _EXPORT_STD template = 0> -_NODISCARD constexpr bool operator<(const _Ty1& _Left, const optional<_Ty2>& _Right) noexcept( - noexcept(_STD _Fake_copy_init(_Left < *_Right))) /* strengthened */ { +_NODISCARD constexpr bool operator<(const _Ty1& _Left, const optional<_Ty2>& _Right) + noexcept(noexcept(_STD _Fake_copy_init(_Left < *_Right))) /* strengthened */ { if (_Right) { return _Left < *_Right; } @@ -877,16 +877,16 @@ _NODISCARD constexpr bool operator<(const _Ty1& _Left, const optional<_Ty2>& _Ri } _EXPORT_STD template = 0> -_NODISCARD constexpr bool operator>(const optional<_Ty1>& _Left, const _Ty2& _Right) noexcept( - noexcept(_STD _Fake_copy_init(*_Left > _Right))) /* strengthened */ { +_NODISCARD constexpr bool operator>(const optional<_Ty1>& _Left, const _Ty2& _Right) + noexcept(noexcept(_STD _Fake_copy_init(*_Left > _Right))) /* strengthened */ { if (_Left) { return *_Left > _Right; } return false; } _EXPORT_STD template = 0> -_NODISCARD constexpr bool operator>(const _Ty1& _Left, const optional<_Ty2>& _Right) noexcept( - noexcept(_STD _Fake_copy_init(_Left > *_Right))) /* strengthened */ { +_NODISCARD constexpr bool operator>(const _Ty1& _Left, const optional<_Ty2>& _Right) + noexcept(noexcept(_STD _Fake_copy_init(_Left > *_Right))) /* strengthened */ { if (_Right) { return _Left > *_Right; } @@ -894,16 +894,16 @@ _NODISCARD constexpr bool operator>(const _Ty1& _Left, const optional<_Ty2>& _Ri } _EXPORT_STD template = 0> -_NODISCARD constexpr bool operator<=(const optional<_Ty1>& _Left, const _Ty2& _Right) noexcept( - noexcept(_STD _Fake_copy_init(*_Left <= _Right))) /* strengthened */ { +_NODISCARD constexpr bool operator<=(const optional<_Ty1>& _Left, const _Ty2& _Right) + noexcept(noexcept(_STD _Fake_copy_init(*_Left <= _Right))) /* strengthened */ { if (_Left) { return *_Left <= _Right; } return true; } _EXPORT_STD template = 0> -_NODISCARD constexpr bool operator<=(const _Ty1& _Left, const optional<_Ty2>& _Right) noexcept( - noexcept(_STD _Fake_copy_init(_Left <= *_Right))) /* strengthened */ { +_NODISCARD constexpr bool operator<=(const _Ty1& _Left, const optional<_Ty2>& _Right) + noexcept(noexcept(_STD _Fake_copy_init(_Left <= *_Right))) /* strengthened */ { if (_Right) { return _Left <= *_Right; } @@ -911,16 +911,16 @@ _NODISCARD constexpr bool operator<=(const _Ty1& _Left, const optional<_Ty2>& _R } _EXPORT_STD template = 0> -_NODISCARD constexpr bool operator>=(const optional<_Ty1>& _Left, const _Ty2& _Right) noexcept( - noexcept(_STD _Fake_copy_init(*_Left >= _Right))) /* strengthened */ { +_NODISCARD constexpr bool operator>=(const optional<_Ty1>& _Left, const _Ty2& _Right) + noexcept(noexcept(_STD _Fake_copy_init(*_Left >= _Right))) /* strengthened */ { if (_Left) { return *_Left >= _Right; } return false; } _EXPORT_STD template = 0> -_NODISCARD constexpr bool operator>=(const _Ty1& _Left, const optional<_Ty2>& _Right) noexcept( - noexcept(_STD _Fake_copy_init(_Left >= *_Right))) /* strengthened */ { +_NODISCARD constexpr bool operator>=(const _Ty1& _Left, const optional<_Ty2>& _Right) + noexcept(noexcept(_STD _Fake_copy_init(_Left >= *_Right))) /* strengthened */ { if (_Right) { return _Left >= *_Right; } @@ -930,8 +930,8 @@ _NODISCARD constexpr bool operator>=(const _Ty1& _Left, const optional<_Ty2>& _R #if _HAS_CXX20 _EXPORT_STD template requires (!_Derived_from_specialization_of<_Ty2, optional>) && three_way_comparable_with<_Ty1, _Ty2> -_NODISCARD constexpr compare_three_way_result_t<_Ty1, _Ty2> operator<=>( - const optional<_Ty1>& _Left, const _Ty2& _Right) noexcept(noexcept(*_Left <=> _Right)) /* strengthened */ { +_NODISCARD constexpr compare_three_way_result_t<_Ty1, _Ty2> operator<=>(const optional<_Ty1>& _Left, const _Ty2& _Right) + noexcept(noexcept(*_Left <=> _Right)) /* strengthened */ { if (_Left) { return *_Left <=> _Right; } @@ -946,19 +946,19 @@ _CONSTEXPR20 void swap(optional<_Ty>& _Left, optional<_Ty>& _Right) noexcept(noe } _EXPORT_STD template , _Ty>, int> = 0> // LWG-3627 -_NODISCARD constexpr optional> make_optional(_Ty&& _Value) noexcept( - noexcept(optional>{_STD forward<_Ty>(_Value)})) /* strengthened */ { +_NODISCARD constexpr optional> make_optional(_Ty&& _Value) + noexcept(noexcept(optional>{_STD forward<_Ty>(_Value)})) /* strengthened */ { return optional>{_STD forward<_Ty>(_Value)}; } _EXPORT_STD template , int> = 0> -_NODISCARD constexpr optional<_Ty> make_optional(_Types&&... _Args) noexcept( - noexcept(optional<_Ty>{in_place, _STD forward<_Types>(_Args)...})) /* strengthened */ { +_NODISCARD constexpr optional<_Ty> make_optional(_Types&&... _Args) + noexcept(noexcept(optional<_Ty>{in_place, _STD forward<_Types>(_Args)...})) /* strengthened */ { return optional<_Ty>{in_place, _STD forward<_Types>(_Args)...}; } _EXPORT_STD template &, _Types...>, int> = 0> -_NODISCARD constexpr optional<_Ty> make_optional(initializer_list<_Elem> _Ilist, _Types&&... _Args) noexcept( - noexcept(optional<_Ty>{in_place, _Ilist, _STD forward<_Types>(_Args)...})) /* strengthened */ { +_NODISCARD constexpr optional<_Ty> make_optional(initializer_list<_Elem> _Ilist, _Types&&... _Args) + noexcept(noexcept(optional<_Ty>{in_place, _Ilist, _STD forward<_Types>(_Args)...})) /* strengthened */ { return optional<_Ty>{in_place, _Ilist, _STD forward<_Types>(_Args)...}; } diff --git a/stl/inc/queue b/stl/inc/queue index 49b4c5aa12..2d8b6bd0df 100644 --- a/stl/inc/queue +++ b/stl/inc/queue @@ -67,23 +67,23 @@ public: queue(const _Container& _Cont, const _Alloc& _Al) : c(_Cont, _Al) {} template , int> = 0> - queue(_Container&& _Cont, const _Alloc& _Al) noexcept( - is_nothrow_constructible_v<_Container, _Container, const _Alloc&>) // strengthened + queue(_Container&& _Cont, const _Alloc& _Al) + noexcept(is_nothrow_constructible_v<_Container, _Container, const _Alloc&>) // strengthened : c(_STD move(_Cont), _Al) {} template , int> = 0> queue(const queue& _Right, const _Alloc& _Al) : c(_Right.c, _Al) {} template , int> = 0> - queue(queue&& _Right, const _Alloc& _Al) noexcept( - is_nothrow_constructible_v<_Container, _Container, const _Alloc&>) // strengthened + queue(queue&& _Right, const _Alloc& _Al) + noexcept(is_nothrow_constructible_v<_Container, _Container, const _Alloc&>) // strengthened : c(_STD move(_Right.c), _Al) {} #if _HAS_CXX23 template <_Iterator_for_container _InIt, class _Alloc> requires uses_allocator_v<_Container, _Alloc> - queue(_InIt _First, _InIt _Last, const _Alloc& _Al) noexcept( - is_nothrow_constructible_v<_Container, _InIt, _InIt, const _Alloc&>) // strengthened + queue(_InIt _First, _InIt _Last, const _Alloc& _Al) + noexcept(is_nothrow_constructible_v<_Container, _InIt, _InIt, const _Alloc&>) // strengthened : c(_STD move(_First), _STD move(_Last), _Al) {} template <_Container_compatible_range<_Ty> _Rng, class _Alloc> @@ -248,9 +248,9 @@ public: priority_queue() = default; - explicit priority_queue(const _Pr& _Pred) noexcept( - is_nothrow_default_constructible_v<_Container> - && is_nothrow_copy_constructible_v) // strengthened + explicit priority_queue(const _Pr& _Pred) + noexcept(is_nothrow_default_constructible_v<_Container> + && is_nothrow_copy_constructible_v) // strengthened : c(), comp(_Pred) {} priority_queue(const _Pr& _Pred, const _Container& _Cont) : c(_Cont), comp(_Pred) { @@ -292,15 +292,15 @@ public: #endif // _HAS_CXX23 template , int> = 0> - explicit priority_queue(const _Alloc& _Al) noexcept( - is_nothrow_constructible_v<_Container, const _Alloc&> - && is_nothrow_default_constructible_v) // strengthened + explicit priority_queue(const _Alloc& _Al) + noexcept(is_nothrow_constructible_v<_Container, const _Alloc&> + && is_nothrow_default_constructible_v) // strengthened : c(_Al), comp() {} template , int> = 0> - priority_queue(const _Pr& _Pred, const _Alloc& _Al) noexcept( - is_nothrow_constructible_v<_Container, const _Alloc&> - && is_nothrow_copy_constructible_v) // strengthened + priority_queue(const _Pr& _Pred, const _Alloc& _Al) + noexcept(is_nothrow_constructible_v<_Container, const _Alloc&> + && is_nothrow_copy_constructible_v) // strengthened : c(_Al), comp(_Pred) {} template , int> = 0> @@ -317,9 +317,9 @@ public: priority_queue(const priority_queue& _Right, const _Alloc& _Al) : c(_Right.c, _Al), comp(_Right.comp) {} template , int> = 0> - priority_queue(priority_queue&& _Right, const _Alloc& _Al) noexcept( - is_nothrow_constructible_v<_Container, _Container, const _Alloc&> - && is_nothrow_move_constructible_v) // strengthened + priority_queue(priority_queue&& _Right, const _Alloc& _Al) + noexcept(is_nothrow_constructible_v<_Container, _Container, const _Alloc&> + && is_nothrow_move_constructible_v) // strengthened : c(_STD move(_Right.c), _Al), comp(_STD move(_Right.comp)) {} template ::value && _Is_nothrow_swappable<_Pr>::value) { + void swap(priority_queue& _Right) + noexcept(_Is_nothrow_swappable<_Container>::value && _Is_nothrow_swappable<_Pr>::value) { using _STD swap; swap(c, _Right.c); // intentional ADL swap(comp, _Right.comp); // intentional ADL @@ -491,8 +491,8 @@ priority_queue(from_range_t, _Rng&&, _EXPORT_STD template ::value && _Is_swappable<_Pr>::value, int> = 0> -void swap(priority_queue<_Ty, _Container, _Pr>& _Left, priority_queue<_Ty, _Container, _Pr>& _Right) noexcept( - noexcept(_Left.swap(_Right))) { +void swap(priority_queue<_Ty, _Container, _Pr>& _Left, priority_queue<_Ty, _Container, _Pr>& _Right) + noexcept(noexcept(_Left.swap(_Right))) { _Left.swap(_Right); } diff --git a/stl/inc/ranges b/stl/inc/ranges index 083628139d..cb77f96469 100644 --- a/stl/inc/ranges +++ b/stl/inc/ranges @@ -183,8 +183,8 @@ namespace ranges { return _RANGES begin(_Range) + _Off; } - constexpr void _Set_cache(_Rng& _Range, const _It& _Iter) noexcept( - noexcept(_Off = _Iter - _RANGES begin(_Range))) { + constexpr void _Set_cache(_Rng& _Range, const _It& _Iter) + noexcept(noexcept(_Off = _Iter - _RANGES begin(_Range))) { _Off = _Iter - _RANGES begin(_Range); } }; @@ -252,8 +252,8 @@ namespace ranges { requires copyable<_Ty> && is_trivially_copy_assignable_v<_Ty> = default; // clang-format on - constexpr _Defaultabox& operator=(const _Defaultabox& _That) noexcept( - is_nothrow_copy_constructible_v<_Ty> && is_nothrow_copy_assignable_v<_Ty>) + constexpr _Defaultabox& operator=(const _Defaultabox& _That) + noexcept(is_nothrow_copy_constructible_v<_Ty> && is_nothrow_copy_assignable_v<_Ty>) requires copyable<_Ty> { if (_Engaged) { @@ -279,8 +279,8 @@ namespace ranges { _Defaultabox& operator=(_Defaultabox&&) noexcept requires is_trivially_move_assignable_v<_Ty> = default; // clang-format on - constexpr _Defaultabox& operator=(_Defaultabox&& _That) noexcept( - is_nothrow_move_constructible_v<_Ty> && is_nothrow_move_assignable_v<_Ty>) { + constexpr _Defaultabox& operator=(_Defaultabox&& _That) + noexcept(is_nothrow_move_constructible_v<_Ty> && is_nothrow_move_assignable_v<_Ty>) { if (_Engaged) { if (_That._Engaged) { static_cast<_Ty&>(_Val) = static_cast<_Ty&&>(_That._Val); @@ -300,8 +300,8 @@ namespace ranges { return *this; } - constexpr _Defaultabox& operator=(_Ty&& _That) noexcept( - is_nothrow_move_constructible_v<_Ty> && is_nothrow_move_assignable_v<_Ty>) { + constexpr _Defaultabox& operator=(_Ty&& _That) + noexcept(is_nothrow_move_constructible_v<_Ty> && is_nothrow_move_assignable_v<_Ty>) { if (_Engaged) { static_cast<_Ty&>(_Val) = _STD move(_That); } else { @@ -312,8 +312,8 @@ namespace ranges { return *this; } - constexpr _Defaultabox& operator=(const _Ty& _That) noexcept( - is_nothrow_copy_constructible_v<_Ty> && is_nothrow_copy_assignable_v<_Ty>) + constexpr _Defaultabox& operator=(const _Ty& _That) + noexcept(is_nothrow_copy_constructible_v<_Ty> && is_nothrow_copy_assignable_v<_Ty>) requires copyable<_Ty> { if (_Engaged) { @@ -368,9 +368,9 @@ namespace ranges { template <_Different_from<_Ty> _Uty> requires convertible_to - constexpr _Defaultabox(const _Defaultabox<_Uty>& _That) noexcept( - is_nothrow_default_constructible_v<_Ty> // - && noexcept(_Value = static_cast<_Ty>(*_That))) { + constexpr _Defaultabox(const _Defaultabox<_Uty>& _That) + noexcept(is_nothrow_default_constructible_v<_Ty> // + && noexcept(_Value = static_cast<_Ty>(*_That))) { if (_That) { _Value = static_cast<_Ty>(*_That); } @@ -378,9 +378,9 @@ namespace ranges { template <_Different_from<_Ty> _Uty> requires convertible_to<_Uty, _Ty> - constexpr _Defaultabox(_Defaultabox<_Uty>&& _That) noexcept( - is_nothrow_default_constructible_v<_Ty> // - && noexcept(_Value = static_cast<_Ty>(_STD move(*_That)))) { + constexpr _Defaultabox(_Defaultabox<_Uty>&& _That) + noexcept(is_nothrow_default_constructible_v<_Ty> // + && noexcept(_Value = static_cast<_Ty>(_STD move(*_That)))) { if (_That) { _Value = static_cast<_Ty>(_STD move(*_That)); } @@ -598,8 +598,8 @@ namespace ranges { template requires constructible_from<_Ty, _Types...> - constexpr explicit single_view(in_place_t, _Types&&... _Args) noexcept( - is_nothrow_constructible_v<_Ty, _Types...>) // strengthened + constexpr explicit single_view(in_place_t, _Types&&... _Args) + noexcept(is_nothrow_constructible_v<_Ty, _Types...>) // strengthened : _Val{in_place, _STD forward<_Types>(_Args)...} {} _NODISCARD constexpr _Ty* begin() noexcept { @@ -815,72 +815,72 @@ namespace ranges { } } - _NODISCARD friend constexpr bool operator==(const _Ioterator& _Left, const _Ioterator& _Right) noexcept( - noexcept(_Left._Current == _Right._Current)) + _NODISCARD friend constexpr bool operator==(const _Ioterator& _Left, const _Ioterator& _Right) + noexcept(noexcept(_Left._Current == _Right._Current)) requires equality_comparable<_Wi> { return _Left._Current == _Right._Current; } - _NODISCARD friend constexpr bool operator<(const _Ioterator& _Left, const _Ioterator& _Right) noexcept( - noexcept(_Left._Current < _Right._Current)) /* strengthened */ + _NODISCARD friend constexpr bool operator<(const _Ioterator& _Left, const _Ioterator& _Right) + noexcept(noexcept(_Left._Current < _Right._Current)) /* strengthened */ requires totally_ordered<_Wi> { return _Left._Current < _Right._Current; } - _NODISCARD friend constexpr bool operator>(const _Ioterator& _Left, const _Ioterator& _Right) noexcept( - noexcept(_Right._Current < _Left._Current)) /* strengthened */ + _NODISCARD friend constexpr bool operator>(const _Ioterator& _Left, const _Ioterator& _Right) + noexcept(noexcept(_Right._Current < _Left._Current)) /* strengthened */ requires totally_ordered<_Wi> { return _Right._Current < _Left._Current; } - _NODISCARD friend constexpr bool operator<=(const _Ioterator& _Left, const _Ioterator& _Right) noexcept( - noexcept(!(_Right._Current < _Left._Current))) /* strengthened */ + _NODISCARD friend constexpr bool operator<=(const _Ioterator& _Left, const _Ioterator& _Right) + noexcept(noexcept(!(_Right._Current < _Left._Current))) /* strengthened */ requires totally_ordered<_Wi> { return !(_Right._Current < _Left._Current); } - _NODISCARD friend constexpr bool operator>=(const _Ioterator& _Left, const _Ioterator& _Right) noexcept( - noexcept(!(_Left._Current < _Right._Current))) /* strengthened */ + _NODISCARD friend constexpr bool operator>=(const _Ioterator& _Left, const _Ioterator& _Right) + noexcept(noexcept(!(_Left._Current < _Right._Current))) /* strengthened */ requires totally_ordered<_Wi> { return !(_Left._Current < _Right._Current); } - _NODISCARD friend constexpr auto operator<=>(const _Ioterator& _Left, const _Ioterator& _Right) noexcept( - noexcept(_Left._Current <=> _Right._Current)) + _NODISCARD friend constexpr auto operator<=>(const _Ioterator& _Left, const _Ioterator& _Right) + noexcept(noexcept(_Left._Current <=> _Right._Current)) requires totally_ordered<_Wi> && three_way_comparable<_Wi> { return _Left._Current <=> _Right._Current; } - _NODISCARD friend constexpr _Ioterator operator+(_Ioterator _It, const difference_type _Off) noexcept( - is_nothrow_move_constructible_v<_Ioterator> // - && noexcept(_It += _Off)) /* strengthened */ + _NODISCARD friend constexpr _Ioterator operator+(_Ioterator _It, const difference_type _Off) + noexcept(is_nothrow_move_constructible_v<_Ioterator> // + && noexcept(_It += _Off)) /* strengthened */ requires _Advanceable<_Wi> { _It += _Off; return _It; } - _NODISCARD friend constexpr _Ioterator operator+(const difference_type _Off, _Ioterator _It) noexcept( - is_nothrow_move_constructible_v<_Wi> // - && noexcept(static_cast<_Wi>(_It._Current + _Off))) /* strengthened */ + _NODISCARD friend constexpr _Ioterator operator+(const difference_type _Off, _Ioterator _It) + noexcept(is_nothrow_move_constructible_v<_Wi> // + && noexcept(static_cast<_Wi>(_It._Current + _Off))) /* strengthened */ requires _Advanceable<_Wi> { return _Ioterator{static_cast<_Wi>(_It._Current + _Off)}; } - _NODISCARD friend constexpr _Ioterator operator-(_Ioterator _It, const difference_type _Off) noexcept( - is_nothrow_move_constructible_v<_Ioterator> // - && noexcept(_It -= _Off)) /* strengthened */ + _NODISCARD friend constexpr _Ioterator operator-(_Ioterator _It, const difference_type _Off) + noexcept(is_nothrow_move_constructible_v<_Ioterator> // + && noexcept(_It -= _Off)) /* strengthened */ requires _Advanceable<_Wi> { _It -= _Off; return _It; } - _NODISCARD friend constexpr difference_type operator-(const _Ioterator& _Left, - const _Ioterator& _Right) noexcept(noexcept(_Left._Current - _Right._Current)) /* strengthened */ + _NODISCARD friend constexpr difference_type operator-(const _Ioterator& _Left, const _Ioterator& _Right) + noexcept(noexcept(_Left._Current - _Right._Current)) /* strengthened */ requires _Advanceable<_Wi> { if constexpr (_Integer_like<_Wi>) { @@ -918,20 +918,20 @@ namespace ranges { public: /* [[no_unique_address]] */ _Bo _Last{}; - _NODISCARD friend constexpr bool operator==(const _It& _Left, const _Iotinel& _Right) noexcept( - noexcept(_Right._Equal(_Left))) /* strengthened */ { + _NODISCARD friend constexpr bool operator==(const _It& _Left, const _Iotinel& _Right) + noexcept(noexcept(_Right._Equal(_Left))) /* strengthened */ { return _Right._Equal(_Left); } - _NODISCARD friend constexpr iter_difference_t<_Wi> operator-(const _It& _Left, const _Iotinel& _Right) noexcept( - noexcept(_Right._Delta(_Left))) /* strengthened */ + _NODISCARD friend constexpr iter_difference_t<_Wi> operator-(const _It& _Left, const _Iotinel& _Right) + noexcept(noexcept(_Right._Delta(_Left))) /* strengthened */ requires sized_sentinel_for<_Bo, _Wi> { return -_Right._Delta(_Left); } - _NODISCARD friend constexpr iter_difference_t<_Wi> operator-(const _Iotinel& _Left, const _It& _Right) noexcept( - noexcept(_Left._Delta(_Right))) /* strengthened */ + _NODISCARD friend constexpr iter_difference_t<_Wi> operator-(const _Iotinel& _Left, const _It& _Right) + noexcept(noexcept(_Left._Delta(_Right))) /* strengthened */ requires sized_sentinel_for<_Bo, _Wi> { return _Left._Delta(_Right); @@ -964,8 +964,8 @@ namespace ranges { iota_view() requires default_initializable<_Wi> = default; // clang-format on - constexpr explicit iota_view(_Wi _Value_) noexcept( - is_nothrow_move_constructible_v<_Wi> && is_nothrow_default_constructible_v<_Bo>) // strengthened + constexpr explicit iota_view(_Wi _Value_) + noexcept(is_nothrow_move_constructible_v<_Wi> && is_nothrow_default_constructible_v<_Bo>) // strengthened : _Value(_STD move(_Value_)) { #if _CONTAINER_DEBUG_LEVEL > 0 if constexpr (totally_ordered_with<_Wi, _Bo>) { @@ -975,8 +975,8 @@ namespace ranges { #endif // _CONTAINER_DEBUG_LEVEL > 0 } - constexpr explicit iota_view(type_identity_t<_Wi> _Value_, type_identity_t<_Bo> _Bound_) noexcept( - is_nothrow_move_constructible_v<_Wi> && is_nothrow_move_constructible_v<_Bo>) // strengthened + constexpr explicit iota_view(type_identity_t<_Wi> _Value_, type_identity_t<_Bo> _Bound_) + noexcept(is_nothrow_move_constructible_v<_Wi> && is_nothrow_move_constructible_v<_Bo>) // strengthened : _Value(_STD move(_Value_)), _Bound(_STD move(_Bound_)) { #if _CONTAINER_DEBUG_LEVEL > 0 if constexpr (totally_ordered_with<_Wi, _Bo>) { @@ -986,8 +986,8 @@ namespace ranges { #endif // _CONTAINER_DEBUG_LEVEL > 0 } - constexpr explicit iota_view(_It _First, _Se _Last) noexcept( - is_nothrow_move_constructible_v<_Wi> && is_nothrow_move_constructible_v<_Bo>) // strengthened + constexpr explicit iota_view(_It _First, _Se _Last) + noexcept(is_nothrow_move_constructible_v<_Wi> && is_nothrow_move_constructible_v<_Bo>) // strengthened : _Value(_STD move(_First._Current)), _Bound(_STD move(_Bound_from(_Last))) { #if _CONTAINER_DEBUG_LEVEL > 0 if constexpr (totally_ordered_with<_Wi, _Bo>) { @@ -1236,8 +1236,8 @@ namespace ranges { /* [[no_unique_address]] */ _Bo _Bound{}; template - _NODISCARD_CTOR constexpr repeat_view(_Tuple& _Val, index_sequence<_Indices...>, _Bo _Bound_) noexcept( - is_nothrow_constructible_v<_Ty, tuple_element_t<_Indices, _Tuple>...>) + _NODISCARD_CTOR constexpr repeat_view(_Tuple& _Val, index_sequence<_Indices...>, _Bo _Bound_) + noexcept(is_nothrow_constructible_v<_Ty, tuple_element_t<_Indices, _Tuple>...>) : _Value(in_place, _Tuple_get<_Indices>(_STD move(_Val))...), _Bound(_STD move(_Bound_)) {} public: @@ -1245,8 +1245,8 @@ namespace ranges { repeat_view() requires default_initializable<_Ty> = default; // clang-format on - _NODISCARD_CTOR constexpr explicit repeat_view(const _Ty& _Value_, _Bo _Bound_ = _Bo{}) noexcept( - is_nothrow_copy_constructible_v<_Ty>) // strengthened + _NODISCARD_CTOR constexpr explicit repeat_view(const _Ty& _Value_, _Bo _Bound_ = _Bo{}) + noexcept(is_nothrow_copy_constructible_v<_Ty>) // strengthened requires copy_constructible<_Ty> : _Value(in_place, _Value_), _Bound(_STD move(_Bound_)) { #if _CONTAINER_DEBUG_LEVEL > 0 @@ -1255,8 +1255,8 @@ namespace ranges { } #endif // _CONTAINER_DEBUG_LEVEL > 0 } - _NODISCARD_CTOR constexpr explicit repeat_view(_Ty&& _Value_, _Bo _Bound_ = _Bo{}) noexcept( - is_nothrow_move_constructible_v<_Ty>) // strengthened + _NODISCARD_CTOR constexpr explicit repeat_view(_Ty&& _Value_, _Bo _Bound_ = _Bo{}) + noexcept(is_nothrow_move_constructible_v<_Ty>) // strengthened : _Value(in_place, _STD move(_Value_)), _Bound(_STD move(_Bound_)) { #if _CONTAINER_DEBUG_LEVEL > 0 if constexpr (_Signed_integer_like<_Bo>) { @@ -1266,10 +1266,10 @@ namespace ranges { } template requires constructible_from<_Ty, _TArgs...> && constructible_from<_Bo, _BArgs...> - _NODISCARD_CTOR constexpr explicit repeat_view(piecewise_construct_t, tuple<_TArgs...> _Val_args, - tuple<_BArgs...> _Bound_args = tuple<>{}) noexcept(is_nothrow_constructible_v<_Ty, _TArgs...> // - && noexcept(_STD make_from_tuple<_Bo>( - _Bound_args))) // strengthened + _NODISCARD_CTOR constexpr explicit repeat_view( + piecewise_construct_t, tuple<_TArgs...> _Val_args, tuple<_BArgs...> _Bound_args = tuple<>{}) + noexcept(is_nothrow_constructible_v<_Ty, _TArgs...> // + && noexcept(_STD make_from_tuple<_Bo>(_Bound_args))) // strengthened : repeat_view(_Val_args, index_sequence_for<_TArgs...>{}, _STD make_from_tuple<_Bo>(_Bound_args)) { #if _CONTAINER_DEBUG_LEVEL > 0 if constexpr (_Signed_integer_like<_Bo>) { @@ -1379,8 +1379,8 @@ namespace ranges { _Ty _Val = _Ty{}; public: - constexpr explicit basic_istream_view(basic_istream<_Elem, _Traits>& _Stream_) noexcept( - is_nothrow_default_constructible_v<_Ty>) // strengthened + constexpr explicit basic_istream_view(basic_istream<_Elem, _Traits>& _Stream_) + noexcept(is_nothrow_default_constructible_v<_Ty>) // strengthened : _Stream{_STD addressof(_Stream_)} {} _NODISCARD constexpr auto begin() { @@ -1612,8 +1612,8 @@ namespace ranges { _Iterator() requires default_initializable> = default; // clang-format on - constexpr _Iterator(filter_view& _Parent_, iterator_t<_Vw> _Current_) noexcept( - is_nothrow_move_constructible_v>) // strengthened + constexpr _Iterator(filter_view& _Parent_, iterator_t<_Vw> _Current_) + noexcept(is_nothrow_move_constructible_v>) // strengthened : _Current(_STD move(_Current_)), _Parent{_STD addressof(_Parent_)} { #if _ITERATOR_DEBUG_LEVEL != 0 _STD _Adl_verify_range(_Current, _RANGES end(_Parent_._Range)); @@ -1703,16 +1703,16 @@ namespace ranges { return _Left._Current == _Right._Current; } - _NODISCARD friend constexpr range_rvalue_reference_t<_Vw> iter_move(const _Iterator& _It) noexcept( - noexcept(_RANGES iter_move(_It._Current))) { + _NODISCARD friend constexpr range_rvalue_reference_t<_Vw> iter_move(const _Iterator& _It) + noexcept(noexcept(_RANGES iter_move(_It._Current))) { #if _ITERATOR_DEBUG_LEVEL != 0 _It._Check_dereference(); #endif // _ITERATOR_DEBUG_LEVEL != 0 return _RANGES iter_move(_It._Current); } - friend constexpr void iter_swap(const _Iterator& _Left, const _Iterator& _Right) noexcept( - noexcept(_RANGES iter_swap(_Left._Current, _Right._Current))) + friend constexpr void iter_swap(const _Iterator& _Left, const _Iterator& _Right) + noexcept(noexcept(_RANGES iter_swap(_Left._Current, _Right._Current))) requires indirectly_swappable> { #if _ITERATOR_DEBUG_LEVEL != 0 @@ -1734,9 +1734,9 @@ namespace ranges { public: _Sentinel() = default; - constexpr explicit _Sentinel(filter_view& _Parent) noexcept( - noexcept(_RANGES end(_Parent._Range)) - && is_nothrow_move_constructible_v>) // strengthened + constexpr explicit _Sentinel(filter_view& _Parent) + noexcept(noexcept(_RANGES end(_Parent._Range)) + && is_nothrow_move_constructible_v>) // strengthened : _Last(_RANGES end(_Parent._Range)) {} _NODISCARD constexpr sentinel_t<_Vw> base() const @@ -1744,8 +1744,8 @@ namespace ranges { return _Last; } - _NODISCARD friend constexpr bool operator==(const _Iterator& _It, const _Sentinel& _Se) noexcept( - noexcept(_It._Equal(_Se._Last))) /* strengthened */ { + _NODISCARD friend constexpr bool operator==(const _Iterator& _It, const _Sentinel& _Se) + noexcept(noexcept(_It._Equal(_Se._Last))) /* strengthened */ { return _It._Equal(_Se._Last); } }; @@ -1755,8 +1755,8 @@ namespace ranges { filter_view() requires default_initializable<_Vw> && default_initializable<_Pr> = default; // clang-format on - constexpr explicit filter_view(_Vw _Range_, _Pr _Pred_) noexcept( - is_nothrow_move_constructible_v<_Vw> && is_nothrow_move_constructible_v<_Pr>) // strengthened + constexpr explicit filter_view(_Vw _Range_, _Pr _Pred_) + noexcept(is_nothrow_move_constructible_v<_Vw> && is_nothrow_move_constructible_v<_Pr>) // strengthened : _Range(_STD move(_Range_)), _Pred{in_place, _STD move(_Pred_)} {} _NODISCARD constexpr _Vw base() const& noexcept(is_nothrow_copy_constructible_v<_Vw>) /* strengthened */ @@ -1863,8 +1863,8 @@ namespace ranges { public: _Sentinel() = default; - constexpr explicit _Sentinel(_Base_sentinel _Last_) noexcept( - is_nothrow_move_constructible_v<_Base_sentinel>) // strengthened + constexpr explicit _Sentinel(_Base_sentinel _Last_) + noexcept(is_nothrow_move_constructible_v<_Base_sentinel>) // strengthened : _Last(_STD move(_Last_)) {} constexpr _Sentinel(_Sentinel _That) noexcept( @@ -1922,8 +1922,8 @@ namespace ranges { take_view() requires default_initializable<_Vw> = default; // clang-format on - constexpr explicit take_view(_Vw _Range_, const range_difference_t<_Vw> _Count_) noexcept( - is_nothrow_move_constructible_v<_Vw>) // strengthened + constexpr explicit take_view(_Vw _Range_, const range_difference_t<_Vw> _Count_) + noexcept(is_nothrow_move_constructible_v<_Vw>) // strengthened : _Range(_STD move(_Range_)), _Count{_Count_} { #if _CONTAINER_DEBUG_LEVEL > 0 _STL_VERIFY(_Count_ >= 0, "Number of elements to take must be non-negative (N4971 [range.take.view]/1)"); @@ -2160,8 +2160,8 @@ namespace ranges { public: _Sentinel() = default; - constexpr explicit _Sentinel(_Base_sentinel _Last_, const _Pr* const _Pred_) noexcept( - is_nothrow_move_constructible_v<_Base_sentinel>) // strengthened + constexpr explicit _Sentinel(_Base_sentinel _Last_, const _Pr* const _Pred_) + noexcept(is_nothrow_move_constructible_v<_Base_sentinel>) // strengthened : _Last(_STD move(_Last_)), _Pred(_Pred_) {} constexpr _Sentinel(_Sentinel _That) noexcept( @@ -2219,8 +2219,8 @@ namespace ranges { take_while_view() requires default_initializable<_Vw> && default_initializable<_Pr> = default; // clang-format on - constexpr explicit take_while_view(_Vw _Range_, _Pr _Pred_) noexcept( - is_nothrow_move_constructible_v<_Vw> && is_nothrow_move_constructible_v<_Pr>) // strengthened + constexpr explicit take_while_view(_Vw _Range_, _Pr _Pred_) + noexcept(is_nothrow_move_constructible_v<_Vw> && is_nothrow_move_constructible_v<_Pr>) // strengthened : _Range(_STD move(_Range_)), _Pred{in_place, _STD move(_Pred_)} {} _NODISCARD constexpr _Vw base() const& noexcept(is_nothrow_copy_constructible_v<_Vw>) /* strengthened */ @@ -2342,8 +2342,8 @@ namespace ranges { drop_view() requires default_initializable<_Vw> = default; // clang-format on - constexpr explicit drop_view(_Vw _Range_, const range_difference_t<_Vw> _Count_) noexcept( - is_nothrow_move_constructible_v<_Vw>) // strengthened + constexpr explicit drop_view(_Vw _Range_, const range_difference_t<_Vw> _Count_) + noexcept(is_nothrow_move_constructible_v<_Vw>) // strengthened : _Range(_STD move(_Range_)), _Count{_Count_} { #if _CONTAINER_DEBUG_LEVEL > 0 _STL_VERIFY(_Count_ >= 0, "Number of elements to drop must be non-negative (N4971 [range.drop.view]/1)"); @@ -2553,8 +2553,8 @@ namespace ranges { drop_while_view() requires default_initializable<_Vw> && default_initializable<_Pr> = default; // clang-format on - constexpr explicit drop_while_view(_Vw _Range_, _Pr _Pred_) noexcept( - is_nothrow_move_constructible_v<_Vw> && is_nothrow_move_constructible_v<_Pr>) // strengthened + constexpr explicit drop_while_view(_Vw _Range_, _Pr _Pred_) + noexcept(is_nothrow_move_constructible_v<_Vw> && is_nothrow_move_constructible_v<_Pr>) // strengthened : _Range(_STD move(_Range_)), _Pred{in_place, _STD move(_Pred_)} {} _NODISCARD constexpr _Vw base() const& noexcept(is_nothrow_copy_constructible_v<_Vw>) /* strengthened */ @@ -2647,8 +2647,8 @@ namespace ranges { private: struct _Cache_wrapper { template - constexpr _Cache_wrapper(_Construct_tag, const _Iter& _It) noexcept( - noexcept(static_cast(*_It))) + constexpr _Cache_wrapper(_Construct_tag, const _Iter& _It) + noexcept(noexcept(static_cast(*_It))) : _Val(*_It) {} remove_cv_t> _Val; @@ -2889,8 +2889,8 @@ namespace ranges { return _Tmp; } - _NODISCARD friend constexpr bool operator==(const _Iterator& _Left, const _Iterator& _Right) noexcept( - noexcept(_Left._Outer == _Right._Outer && _Left._Inner == _Right._Inner)) /* strengthened */ + _NODISCARD friend constexpr bool operator==(const _Iterator& _Left, const _Iterator& _Right) + noexcept(noexcept(_Left._Outer == _Right._Outer && _Left._Inner == _Right._Inner)) /* strengthened */ requires _Deref_is_glvalue && forward_range<_Base> && equality_comparable<_InnerIter> { #if _ITERATOR_DEBUG_LEVEL != 0 @@ -2899,16 +2899,16 @@ namespace ranges { return _Left._Outer == _Right._Outer && _Left._Inner == _Right._Inner; } - _NODISCARD friend constexpr decltype(auto) iter_move(const _Iterator& _It) noexcept( - noexcept(_RANGES iter_move(*_It._Inner))) { + _NODISCARD friend constexpr decltype(auto) iter_move(const _Iterator& _It) + noexcept(noexcept(_RANGES iter_move(*_It._Inner))) { #if _ITERATOR_DEBUG_LEVEL != 0 _It._Check_dereference(); #endif // _ITERATOR_DEBUG_LEVEL != 0 return _RANGES iter_move(*_It._Inner); } - friend constexpr void iter_swap(const _Iterator& _Left, const _Iterator& _Right) noexcept( - noexcept(_RANGES iter_swap(*_Left._Inner, *_Right._Inner))) + friend constexpr void iter_swap(const _Iterator& _Left, const _Iterator& _Right) + noexcept(noexcept(_RANGES iter_swap(*_Left._Inner, *_Right._Inner))) requires indirectly_swappable<_InnerIter> { #if _ITERATOR_DEBUG_LEVEL != 0 @@ -2941,20 +2941,20 @@ namespace ranges { public: _Sentinel() = default; - constexpr explicit _Sentinel(_Parent_t& _Parent) noexcept( - noexcept(_RANGES end(_Parent._Range)) - && is_nothrow_move_constructible_v>) // strengthened + constexpr explicit _Sentinel(_Parent_t& _Parent) + noexcept(noexcept(_RANGES end(_Parent._Range)) + && is_nothrow_move_constructible_v>) // strengthened : _Last(_RANGES end(_Parent._Range)) {} - constexpr _Sentinel(_Sentinel _Se) noexcept( - is_nothrow_constructible_v, sentinel_t<_Vw>>) // strengthened + constexpr _Sentinel(_Sentinel _Se) + noexcept(is_nothrow_constructible_v, sentinel_t<_Vw>>) // strengthened requires _Const && convertible_to, sentinel_t<_Base>> : _Last(_STD move(_Se._Last)) {} template requires sentinel_for, _Maybe_const_iter<_OtherConst>> - _NODISCARD friend constexpr bool operator==(const _Iterator<_OtherConst>& _Left, - const _Sentinel& _Right) noexcept(noexcept(_Right._Equal(_Left))) /* strengthened */ { + _NODISCARD friend constexpr bool operator==(const _Iterator<_OtherConst>& _Left, const _Sentinel& _Right) + noexcept(noexcept(_Right._Equal(_Left))) /* strengthened */ { return _Right._Equal(_Left); } }; @@ -3095,8 +3095,8 @@ namespace ranges { private: struct _Cache_wrapper { template - constexpr _Cache_wrapper(_Construct_tag, const _Iter& _It) noexcept( - noexcept(static_cast(*_It))) + constexpr _Cache_wrapper(_Construct_tag, const _Iter& _It) + noexcept(noexcept(static_cast(*_It))) : _Val(*_It) {} remove_cv_t> _Val; @@ -3465,9 +3465,9 @@ namespace ranges { /* [[no_unique_address]] */ sentinel_t<_Base> _Last{}; - constexpr explicit _Sentinel(_Parent_t& _Parent) noexcept( - noexcept(_RANGES end(_Parent._Range)) - && is_nothrow_move_constructible_v>) // strengthened + constexpr explicit _Sentinel(_Parent_t& _Parent) + noexcept(noexcept(_RANGES end(_Parent._Range)) + && is_nothrow_move_constructible_v>) // strengthened : _Last(_RANGES end(_Parent._Range)) {} template @@ -3481,15 +3481,15 @@ namespace ranges { public: _Sentinel() = default; - constexpr _Sentinel(_Sentinel _Se) noexcept( - is_nothrow_constructible_v, sentinel_t<_Vw>>) // strengthened + constexpr _Sentinel(_Sentinel _Se) + noexcept(is_nothrow_constructible_v, sentinel_t<_Vw>>) // strengthened requires _Const && convertible_to, sentinel_t<_Base>> : _Last(_STD move(_Se._Last)) {} template requires sentinel_for, iterator_t<_Maybe_const<_OtherConst, _Vw>>> - _NODISCARD friend constexpr bool operator==(const _Iterator<_OtherConst>& _Left, - const _Sentinel& _Right) noexcept(noexcept(_Right._Equal(_Left))) /* strengthened */ { + _NODISCARD friend constexpr bool operator==(const _Iterator<_OtherConst>& _Left, const _Sentinel& _Right) + noexcept(noexcept(_Right._Equal(_Left))) /* strengthened */ { return _Right._Equal(_Left); } }; @@ -3499,16 +3499,16 @@ namespace ranges { join_with_view() requires default_initializable<_Vw> && default_initializable<_Pat> = default; // clang-format on - constexpr explicit join_with_view(_Vw _Range_, _Pat _Pattern_) noexcept( - is_nothrow_move_constructible_v<_Vw> && is_nothrow_move_constructible_v<_Pat>) // strengthened + constexpr explicit join_with_view(_Vw _Range_, _Pat _Pattern_) + noexcept(is_nothrow_move_constructible_v<_Vw> && is_nothrow_move_constructible_v<_Pat>) // strengthened : _Range{_STD move(_Range_)}, _Pattern{_STD move(_Pattern_)} {} template requires constructible_from<_Vw, views::all_t<_Rng>> && constructible_from<_Pat, single_view>>> - constexpr explicit join_with_view(_Rng&& _Range_, range_value_t<_InnerRng> _Elem) noexcept( - noexcept(_Vw(views::all(_STD forward<_Rng>(_Range_)))) - && noexcept(_Pat(views::single(_STD move(_Elem))))) // strengthened + constexpr explicit join_with_view(_Rng&& _Range_, range_value_t<_InnerRng> _Elem) + noexcept(noexcept(_Vw(views::all(_STD forward<_Rng>(_Range_)))) + && noexcept(_Pat(views::single(_STD move(_Elem))))) // strengthened : _Range(views::all(_STD forward<_Rng>(_Range_))), _Pattern(views::single(_STD move(_Elem))) {} _NODISCARD constexpr _Vw base() const& noexcept(is_nothrow_copy_constructible_v<_Vw>) /* strengthened */ @@ -3708,8 +3708,8 @@ namespace ranges { private: /* [[no_unique_address]] */ _Outer_iter _First{}; - constexpr explicit value_type(_Outer_iter _First_) noexcept( - is_nothrow_move_constructible_v<_Outer_iter>) + constexpr explicit value_type(_Outer_iter _First_) + noexcept(is_nothrow_move_constructible_v<_Outer_iter>) : _First{_STD move(_First_)} {} friend _Outer_iter; @@ -3730,8 +3730,8 @@ namespace ranges { requires (!forward_range<_BaseTy>) : _Parent{_STD addressof(_Parent_)} {} - constexpr _Outer_iter(_ParentTy& _Parent_, iterator_t<_BaseTy> _Current_) noexcept( - is_nothrow_move_constructible_v>) // strengthened + constexpr _Outer_iter(_ParentTy& _Parent_, iterator_t<_BaseTy> _Current_) + noexcept(is_nothrow_move_constructible_v>) // strengthened requires forward_range<_BaseTy> : _Mybase{_STD move(_Current_)}, _Parent{_STD addressof(_Parent_)} {} @@ -3788,14 +3788,14 @@ namespace ranges { } } - _NODISCARD friend constexpr bool operator==(const _Outer_iter& _Left, const _Outer_iter& _Right) noexcept( - noexcept(_Left._Current == _Right._Current)) /* strengthened */ + _NODISCARD friend constexpr bool operator==(const _Outer_iter& _Left, const _Outer_iter& _Right) + noexcept(noexcept(_Left._Current == _Right._Current)) /* strengthened */ requires forward_range<_BaseTy> { return _Left._Current == _Right._Current && _Left._Trailing_empty == _Right._Trailing_empty; } - _NODISCARD friend constexpr bool operator==(const _Outer_iter& _Left, default_sentinel_t) noexcept( - noexcept(_Left._At_end())) /* strengthened */ { + _NODISCARD friend constexpr bool operator==(const _Outer_iter& _Left, default_sentinel_t) + noexcept(noexcept(_Left._At_end())) /* strengthened */ { return _Left._At_end() && !_Left._Trailing_empty; } }; @@ -3878,8 +3878,8 @@ namespace ranges { using difference_type = range_difference_t<_BaseTy>; _Inner_iter() = default; - constexpr explicit _Inner_iter(_Outer_iter<_Const> _It_) noexcept( - is_nothrow_move_constructible_v<_Outer_iter<_Const>>) // strengthened + constexpr explicit _Inner_iter(_Outer_iter<_Const> _It_) + noexcept(is_nothrow_move_constructible_v<_Outer_iter<_Const>>) // strengthened : _It{_STD move(_It_)} {} _NODISCARD constexpr const iterator_t<_BaseTy>& base() const& noexcept { @@ -3928,13 +3928,13 @@ namespace ranges { return _Left._At_end(); } - _NODISCARD friend constexpr decltype(auto) iter_move(const _Inner_iter& _Iter) noexcept( - noexcept(_RANGES iter_move(_Iter._Get_current()))) { + _NODISCARD friend constexpr decltype(auto) iter_move(const _Inner_iter& _Iter) + noexcept(noexcept(_RANGES iter_move(_Iter._Get_current()))) { return _RANGES iter_move(_Iter._Get_current()); } - friend constexpr void iter_swap(const _Inner_iter& _Left, const _Inner_iter& _Right) noexcept( - noexcept(_RANGES iter_swap(_Left._Get_current(), _Right._Get_current()))) + friend constexpr void iter_swap(const _Inner_iter& _Left, const _Inner_iter& _Right) + noexcept(noexcept(_RANGES iter_swap(_Left._Get_current(), _Right._Get_current()))) requires indirectly_swappable> { _RANGES iter_swap(_Left._Get_current(), _Right._Get_current()); @@ -3946,16 +3946,16 @@ namespace ranges { lazy_split_view() requires default_initializable<_Vw> && default_initializable<_Pat> = default; // clang-format on - constexpr explicit lazy_split_view(_Vw _Range_, _Pat _Pattern_) noexcept( - is_nothrow_move_constructible_v<_Vw> && is_nothrow_move_constructible_v<_Pat>) // strengthened + constexpr explicit lazy_split_view(_Vw _Range_, _Pat _Pattern_) + noexcept(is_nothrow_move_constructible_v<_Vw> && is_nothrow_move_constructible_v<_Pat>) // strengthened : _Range(_STD move(_Range_)), _Pattern(_STD move(_Pattern_)) {} template requires constructible_from<_Vw, views::all_t<_Rng>> && constructible_from<_Pat, single_view>> - constexpr explicit lazy_split_view(_Rng&& _Range_, range_value_t<_Rng> _Elem) noexcept( - noexcept(_Vw(views::all(_STD forward<_Rng>(_Range_)))) - && noexcept(_Pat(views::single(_STD move(_Elem))))) // strengthened + constexpr explicit lazy_split_view(_Rng&& _Range_, range_value_t<_Rng> _Elem) + noexcept(noexcept(_Vw(views::all(_STD forward<_Rng>(_Range_)))) + && noexcept(_Pat(views::single(_STD move(_Elem))))) // strengthened : _Range(views::all(_STD forward<_Rng>(_Range_))), _Pattern(views::single(_STD move(_Elem))) {} _NODISCARD constexpr _Vw base() const& noexcept(is_nothrow_copy_constructible_v<_Vw>) /* strengthened */ @@ -4106,8 +4106,8 @@ namespace ranges { return _Tmp; } - _NODISCARD friend constexpr bool operator==(const _Iterator& _Left, const _Iterator& _Right) noexcept( - noexcept(_Left._Current == _Right._Current)) /* strengthened */ { + _NODISCARD friend constexpr bool operator==(const _Iterator& _Left, const _Iterator& _Right) + noexcept(noexcept(_Left._Current == _Right._Current)) /* strengthened */ { return _Left._Current == _Right._Current && _Left._Trailing_empty == _Right._Trailing_empty; } }; @@ -4123,13 +4123,13 @@ namespace ranges { public: _Sentinel() = default; - constexpr explicit _Sentinel(split_view& _Parent) noexcept( - noexcept(_RANGES end(_Parent._Range)) - && is_nothrow_move_constructible_v>) // strengthened + constexpr explicit _Sentinel(split_view& _Parent) + noexcept(noexcept(_RANGES end(_Parent._Range)) + && is_nothrow_move_constructible_v>) // strengthened : _Last(_RANGES end(_Parent._Range)) {} - _NODISCARD friend constexpr bool operator==(const _Iterator& _It, const _Sentinel& _Se) noexcept( - noexcept(_Se._Equal(_It))) /* strengthened */ { + _NODISCARD friend constexpr bool operator==(const _Iterator& _It, const _Sentinel& _Se) + noexcept(noexcept(_Se._Equal(_It))) /* strengthened */ { return _Se._Equal(_It); } }; @@ -4150,17 +4150,17 @@ namespace ranges { split_view() requires default_initializable<_Vw> && default_initializable<_Pat> = default; // clang-format on - constexpr explicit split_view(_Vw _Range_, _Pat _Pattern_) noexcept( - is_nothrow_move_constructible_v<_Vw> && is_nothrow_move_constructible_v<_Pat>) // strengthened + constexpr explicit split_view(_Vw _Range_, _Pat _Pattern_) + noexcept(is_nothrow_move_constructible_v<_Vw> && is_nothrow_move_constructible_v<_Pat>) // strengthened : _Range(_STD move(_Range_)), _Pattern(_STD move(_Pattern_)) {} template requires constructible_from<_Vw, views::all_t<_Rng>> && constructible_from<_Pat, single_view>> - constexpr explicit split_view(_Rng&& _Range_, range_value_t<_Rng> _Elem) noexcept( - is_nothrow_constructible_v<_Vw, views::all_t<_Rng>> - && is_nothrow_constructible_v<_Pat, single_view>> - && is_nothrow_move_constructible_v>) // strengthened + constexpr explicit split_view(_Rng&& _Range_, range_value_t<_Rng> _Elem) + noexcept(is_nothrow_constructible_v<_Vw, views::all_t<_Rng>> + && is_nothrow_constructible_v<_Pat, single_view>> + && is_nothrow_move_constructible_v>) // strengthened : _Range(views::all(_STD forward<_Rng>(_Range_))), _Pattern(views::single(_STD move(_Elem))) {} _NODISCARD constexpr _Vw base() const& noexcept(is_nothrow_copy_constructible_v<_Vw>) /* strengthened */ @@ -4452,8 +4452,8 @@ namespace ranges { return _Rev_iter{_RANGES end(_Range)}; } - _NODISCARD constexpr _Rev_iter<_Vw> end() noexcept( - noexcept(_Rev_iter<_Vw>{_RANGES begin(_Range)})) /* strengthened */ { + _NODISCARD constexpr _Rev_iter<_Vw> end() + noexcept(noexcept(_Rev_iter<_Vw>{_RANGES begin(_Range)})) /* strengthened */ { return _Rev_iter<_Vw>{_RANGES begin(_Range)}; } _NODISCARD constexpr auto end() const @@ -4758,12 +4758,12 @@ namespace ranges { _Iterator() requires default_initializable> = default; // clang-format on - constexpr explicit _Iterator(iterator_t<_Base> _Current_) noexcept( - is_nothrow_move_constructible_v>) // strengthened + constexpr explicit _Iterator(iterator_t<_Base> _Current_) + noexcept(is_nothrow_move_constructible_v>) // strengthened : _Current{_STD move(_Current_)} {} - constexpr _Iterator(_Iterator _It) noexcept( - is_nothrow_constructible_v, iterator_t<_Vw>>) // strengthened + constexpr _Iterator(_Iterator _It) + noexcept(is_nothrow_constructible_v, iterator_t<_Vw>>) // strengthened requires _Const && convertible_to, iterator_t<_Base>> : _Current(_STD move(_It._Current)) {} @@ -4799,8 +4799,8 @@ namespace ranges { ++_Current; } - constexpr _Iterator operator++(int) noexcept( - noexcept(++_Current) && is_nothrow_copy_constructible_v>) /* strengthened */ + constexpr _Iterator operator++(int) + noexcept(noexcept(++_Current) && is_nothrow_copy_constructible_v>) /* strengthened */ requires forward_range<_Base> { auto _Tmp = *this; @@ -4815,8 +4815,8 @@ namespace ranges { return *this; } - constexpr _Iterator operator--(int) noexcept( - noexcept(--_Current) && is_nothrow_copy_constructible_v>) /* strengthened */ + constexpr _Iterator operator--(int) + noexcept(noexcept(--_Current) && is_nothrow_copy_constructible_v>) /* strengthened */ requires bidirectional_range<_Base> { auto _Tmp = *this; @@ -4834,8 +4834,8 @@ namespace ranges { } #endif // _ITERATOR_DEBUG_LEVEL != 0 - constexpr _Iterator& operator+=(const difference_type _Off) noexcept( - noexcept(_Current += _Off)) /* strengthened */ + constexpr _Iterator& operator+=(const difference_type _Off) + noexcept(noexcept(_Current += _Off)) /* strengthened */ requires random_access_range<_Base> { #if _ITERATOR_DEBUG_LEVEL != 0 @@ -4844,8 +4844,8 @@ namespace ranges { _Current += _Off; return *this; } - constexpr _Iterator& operator-=(const difference_type _Off) noexcept( - noexcept(_Current -= _Off)) /* strengthened */ + constexpr _Iterator& operator-=(const difference_type _Off) + noexcept(noexcept(_Current -= _Off)) /* strengthened */ requires random_access_range<_Base> { #if _ITERATOR_DEBUG_LEVEL != 0 @@ -4878,48 +4878,48 @@ namespace ranges { return static_cast<_ElemTy>(_STD get<_Index>(*(_Current + _Idx))); } - _NODISCARD friend constexpr bool operator==(const _Iterator& _Left, const _Iterator& _Right) noexcept( - noexcept(_Left._Current == _Right._Current)) /* strengthened */ + _NODISCARD friend constexpr bool operator==(const _Iterator& _Left, const _Iterator& _Right) + noexcept(noexcept(_Left._Current == _Right._Current)) /* strengthened */ requires equality_comparable> { return _Left._Current == _Right._Current; } - _NODISCARD friend constexpr bool operator<(const _Iterator& _Left, const _Iterator& _Right) noexcept( - noexcept(_Left._Current < _Right._Current)) /* strengthened */ + _NODISCARD friend constexpr bool operator<(const _Iterator& _Left, const _Iterator& _Right) + noexcept(noexcept(_Left._Current < _Right._Current)) /* strengthened */ requires random_access_range<_Base> { return _Left._Current < _Right._Current; } - _NODISCARD friend constexpr bool operator>(const _Iterator& _Left, const _Iterator& _Right) noexcept( - noexcept(_Left._Current < _Right._Current)) /* strengthened */ + _NODISCARD friend constexpr bool operator>(const _Iterator& _Left, const _Iterator& _Right) + noexcept(noexcept(_Left._Current < _Right._Current)) /* strengthened */ requires random_access_range<_Base> { return _Right < _Left; } - _NODISCARD friend constexpr bool operator<=(const _Iterator& _Left, const _Iterator& _Right) noexcept( - noexcept(_Left._Current < _Right._Current)) /* strengthened */ + _NODISCARD friend constexpr bool operator<=(const _Iterator& _Left, const _Iterator& _Right) + noexcept(noexcept(_Left._Current < _Right._Current)) /* strengthened */ requires random_access_range<_Base> { return !(_Right < _Left); } - _NODISCARD friend constexpr bool operator>=(const _Iterator& _Left, const _Iterator& _Right) noexcept( - noexcept(_Left._Current < _Right._Current)) /* strengthened */ + _NODISCARD friend constexpr bool operator>=(const _Iterator& _Left, const _Iterator& _Right) + noexcept(noexcept(_Left._Current < _Right._Current)) /* strengthened */ requires random_access_range<_Base> { return !(_Left < _Right); } - _NODISCARD friend constexpr auto operator<=>(const _Iterator& _Left, const _Iterator& _Right) noexcept( - noexcept(_Left._Current <=> _Right._Current)) /* strengthened */ + _NODISCARD friend constexpr auto operator<=>(const _Iterator& _Left, const _Iterator& _Right) + noexcept(noexcept(_Left._Current <=> _Right._Current)) /* strengthened */ requires random_access_range<_Base> && three_way_comparable> { return _Left._Current <=> _Right._Current; } - _NODISCARD friend constexpr _Iterator operator+(const _Iterator& _It, const difference_type _Off) noexcept( - noexcept(_STD declval&>() += _Off) - && is_nothrow_copy_constructible_v>) /* strengthened */ + _NODISCARD friend constexpr _Iterator operator+(const _Iterator& _It, const difference_type _Off) + noexcept(noexcept(_STD declval&>() += _Off) + && is_nothrow_copy_constructible_v>) /* strengthened */ requires random_access_range<_Base> { #if _ITERATOR_DEBUG_LEVEL != 0 @@ -4930,9 +4930,9 @@ namespace ranges { return _Copy; } - _NODISCARD friend constexpr _Iterator operator+(const difference_type _Off, const _Iterator& _It) noexcept( - noexcept(_STD declval&>() += _Off) - && is_nothrow_copy_constructible_v>) /* strengthened */ + _NODISCARD friend constexpr _Iterator operator+(const difference_type _Off, const _Iterator& _It) + noexcept(noexcept(_STD declval&>() += _Off) + && is_nothrow_copy_constructible_v>) /* strengthened */ requires random_access_range<_Base> { #if _ITERATOR_DEBUG_LEVEL != 0 @@ -4943,9 +4943,9 @@ namespace ranges { return _Copy; } - _NODISCARD friend constexpr _Iterator operator-(const _Iterator& _It, const difference_type _Off) noexcept( - noexcept(_STD declval&>() -= _Off) - && is_nothrow_copy_constructible_v>) /* strengthened */ + _NODISCARD friend constexpr _Iterator operator-(const _Iterator& _It, const difference_type _Off) + noexcept(noexcept(_STD declval&>() -= _Off) + && is_nothrow_copy_constructible_v>) /* strengthened */ requires random_access_range<_Base> { #if _ITERATOR_DEBUG_LEVEL != 0 @@ -4957,8 +4957,8 @@ namespace ranges { return _Copy; } - _NODISCARD friend constexpr difference_type operator-(const _Iterator& _Left, - const _Iterator& _Right) noexcept(noexcept(_Left._Current - _Right._Current)) /* strengthened */ + _NODISCARD friend constexpr difference_type operator-(const _Iterator& _Left, const _Iterator& _Right) + noexcept(noexcept(_Left._Current - _Right._Current)) /* strengthened */ requires sized_sentinel_for, iterator_t<_Base>> { return _Left._Current - _Right._Current; @@ -4984,12 +4984,12 @@ namespace ranges { public: _Sentinel() = default; - constexpr explicit _Sentinel(sentinel_t<_Base> _Last_) noexcept( - is_nothrow_move_constructible_v>) // strengthened + constexpr explicit _Sentinel(sentinel_t<_Base> _Last_) + noexcept(is_nothrow_move_constructible_v>) // strengthened : _Last(_STD move(_Last_)) {} - constexpr _Sentinel(_Sentinel _Se) noexcept( - is_nothrow_constructible_v, sentinel_t<_Vw>>) // strengthened + constexpr _Sentinel(_Sentinel _Se) + noexcept(is_nothrow_constructible_v, sentinel_t<_Vw>>) // strengthened requires _Const && convertible_to, sentinel_t<_Base>> : _Last(_STD move(_Se._Last)) {} @@ -5000,24 +5000,24 @@ namespace ranges { template requires sentinel_for, _Maybe_const_iter<_OtherConst>> - _NODISCARD friend constexpr bool operator==(const _Iterator<_OtherConst>& _Left, - const _Sentinel& _Right) noexcept(noexcept(_Get_current(_Left) == _Right._Last)) /* strengthened */ { + _NODISCARD friend constexpr bool operator==(const _Iterator<_OtherConst>& _Left, const _Sentinel& _Right) + noexcept(noexcept(_Get_current(_Left) == _Right._Last)) /* strengthened */ { return _Get_current(_Left) == _Right._Last; } template requires sized_sentinel_for, _Maybe_const_iter<_OtherConst>> _NODISCARD friend constexpr range_difference_t<_Maybe_const<_OtherConst, _Vw>> operator-( - const _Iterator<_OtherConst>& _Left, - const _Sentinel& _Right) noexcept(noexcept(_Get_current(_Left) - _Right._Last)) /* strengthened */ { + const _Iterator<_OtherConst>& _Left, const _Sentinel& _Right) + noexcept(noexcept(_Get_current(_Left) - _Right._Last)) /* strengthened */ { return _Get_current(_Left) - _Right._Last; } template requires sized_sentinel_for, _Maybe_const_iter<_OtherConst>> - _NODISCARD friend constexpr range_difference_t<_Maybe_const<_OtherConst, _Vw>> - operator-(const _Sentinel& _Left, const _Iterator<_OtherConst>& _Right) noexcept( - noexcept(_Left._Last - _Get_current(_Right))) /* strengthened */ { + _NODISCARD friend constexpr range_difference_t<_Maybe_const<_OtherConst, _Vw>> operator-( + const _Sentinel& _Left, const _Iterator<_OtherConst>& _Right) + noexcept(noexcept(_Left._Last - _Get_current(_Right))) /* strengthened */ { return _Left._Last - _Get_current(_Right); } }; @@ -5147,8 +5147,8 @@ namespace ranges { /* [[no_unique_address]] */ _Base_iterator _Current{}; range_difference_t<_Base_t> _Pos = 0; - constexpr explicit _Iterator(_Base_iterator _Current_, range_difference_t<_Base_t> _Pos_) noexcept( - is_nothrow_move_constructible_v<_Base_iterator>) // strengthened + constexpr explicit _Iterator(_Base_iterator _Current_, range_difference_t<_Base_t> _Pos_) + noexcept(is_nothrow_move_constructible_v<_Base_iterator>) // strengthened : _Current(_STD move(_Current_)), _Pos(_Pos_) {} public: @@ -5163,8 +5163,8 @@ namespace ranges { _Iterator() requires default_initializable<_Base_iterator> = default; // clang-format on - constexpr _Iterator(_Iterator _Other) noexcept( - is_nothrow_constructible_v<_Base_iterator, iterator_t<_Vw>>) // strengthened + constexpr _Iterator(_Iterator _Other) + noexcept(is_nothrow_constructible_v<_Base_iterator, iterator_t<_Vw>>) // strengthened requires _Const && convertible_to, _Base_iterator> : _Current(_STD move(_Other._Current)), _Pos(_Other._Pos) {} @@ -5196,8 +5196,8 @@ namespace ranges { ++*this; } - constexpr _Iterator operator++(int) noexcept( - noexcept(++*this) && is_nothrow_copy_constructible_v<_Iterator>) // strengthened + constexpr _Iterator operator++(int) + noexcept(noexcept(++*this) && is_nothrow_copy_constructible_v<_Iterator>) // strengthened requires forward_range<_Base_t> { auto _Tmp = *this; @@ -5213,8 +5213,8 @@ namespace ranges { return *this; } - constexpr _Iterator operator--(int) noexcept( - noexcept(--*this) && is_nothrow_copy_constructible_v<_Iterator>) // strengthened + constexpr _Iterator operator--(int) + noexcept(noexcept(--*this) && is_nothrow_copy_constructible_v<_Iterator>) // strengthened requires bidirectional_range<_Base_t> { auto _Tmp = *this; @@ -5222,8 +5222,8 @@ namespace ranges { return _Tmp; } - constexpr _Iterator& operator+=(const difference_type _Off) noexcept( - noexcept(_Current += _Off)) // strengthened + constexpr _Iterator& operator+=(const difference_type _Off) + noexcept(noexcept(_Current += _Off)) // strengthened requires random_access_range<_Base_t> { _Current += _Off; @@ -5231,8 +5231,8 @@ namespace ranges { return *this; } - constexpr _Iterator& operator-=(const difference_type _Off) noexcept( - noexcept(_Current -= _Off)) // strengthened + constexpr _Iterator& operator-=(const difference_type _Off) + noexcept(noexcept(_Current -= _Off)) // strengthened requires random_access_range<_Base_t> { _Current -= _Off; @@ -5256,9 +5256,9 @@ namespace ranges { return _Left._Pos <=> _Right._Pos; } - _NODISCARD friend constexpr _Iterator operator+(const _Iterator& _It, const difference_type _Off) noexcept( - is_nothrow_copy_constructible_v<_Iterator> // - && noexcept(_STD declval<_Iterator&>() += _Off)) // strengthened + _NODISCARD friend constexpr _Iterator operator+(const _Iterator& _It, const difference_type _Off) + noexcept(is_nothrow_copy_constructible_v<_Iterator> // + && noexcept(_STD declval<_Iterator&>() += _Off)) // strengthened requires random_access_range<_Base_t> { auto _Tmp = _It; @@ -5266,16 +5266,16 @@ namespace ranges { return _Tmp; } - _NODISCARD friend constexpr _Iterator operator+(const difference_type _Off, const _Iterator& _It) noexcept( - noexcept(_It + _Off)) // strengthened + _NODISCARD friend constexpr _Iterator operator+(const difference_type _Off, const _Iterator& _It) + noexcept(noexcept(_It + _Off)) // strengthened requires random_access_range<_Base_t> { return _It + _Off; } - _NODISCARD friend constexpr _Iterator operator-(const _Iterator& _It, const difference_type _Off) noexcept( - is_nothrow_copy_constructible_v<_Iterator> // - && noexcept(_STD declval<_Iterator&>() -= _Off)) // strengthened + _NODISCARD friend constexpr _Iterator operator-(const _Iterator& _It, const difference_type _Off) + noexcept(is_nothrow_copy_constructible_v<_Iterator> // + && noexcept(_STD declval<_Iterator&>() -= _Off)) // strengthened requires random_access_range<_Base_t> { auto _Tmp = _It; @@ -5288,9 +5288,9 @@ namespace ranges { return _Left._Pos - _Right._Pos; } - _NODISCARD friend constexpr auto iter_move(const _Iterator& _It) noexcept( - noexcept(_RANGES iter_move(_It._Current)) - && is_nothrow_move_constructible_v>) { + _NODISCARD friend constexpr auto iter_move(const _Iterator& _It) + noexcept(noexcept(_RANGES iter_move(_It._Current)) + && is_nothrow_move_constructible_v>) { return tuple>{ _It._Pos, _RANGES iter_move(_It._Current)}; } @@ -5306,8 +5306,8 @@ namespace ranges { /* [[no_unique_address]] */ _Base_sentinel _End{}; - constexpr explicit _Sentinel(_Base_sentinel _End_) noexcept( - is_nothrow_move_constructible_v<_Base_sentinel>) // strengthened + constexpr explicit _Sentinel(_Base_sentinel _End_) + noexcept(is_nothrow_move_constructible_v<_Base_sentinel>) // strengthened : _End(_STD move(_End_)) {} template @@ -5327,8 +5327,8 @@ namespace ranges { public: _Sentinel() = default; - constexpr _Sentinel(_Sentinel _Other) noexcept( - is_nothrow_constructible_v<_Base_sentinel, sentinel_t<_Vw>>) // strengthened + constexpr _Sentinel(_Sentinel _Other) + noexcept(is_nothrow_constructible_v<_Base_sentinel, sentinel_t<_Vw>>) // strengthened requires _Const && convertible_to, _Base_sentinel> : _End(_STD move(_Other._End)) {} @@ -5339,8 +5339,8 @@ namespace ranges { template requires sentinel_for<_Base_sentinel, iterator_t<_Maybe_const<_OtherConst, _Vw>>> - _NODISCARD friend constexpr bool operator==(const _Iterator<_OtherConst>& _It, - const _Sentinel& _Se) noexcept(noexcept(_Se._Equal(_It))) /* strengthened */ { + _NODISCARD friend constexpr bool operator==(const _Iterator<_OtherConst>& _It, const _Sentinel& _Se) + noexcept(noexcept(_Se._Equal(_It))) /* strengthened */ { return _Se._Equal(_It); } @@ -5556,27 +5556,27 @@ namespace ranges { return _Left._Get_remainder() == 0; } - _NODISCARD friend constexpr difference_type operator-(default_sentinel_t, - const _Inner_iterator& _Right) noexcept(noexcept(_Right._Get_size())) /* strengthened */ + _NODISCARD friend constexpr difference_type operator-(default_sentinel_t, const _Inner_iterator& _Right) + noexcept(noexcept(_Right._Get_size())) /* strengthened */ requires sized_sentinel_for, iterator_t<_Vw>> { return _Right._Get_size(); } - _NODISCARD friend constexpr difference_type operator-(const _Inner_iterator& _Left, - default_sentinel_t) noexcept(noexcept(_Left._Get_size())) /* strengthened */ + _NODISCARD friend constexpr difference_type operator-(const _Inner_iterator& _Left, default_sentinel_t) + noexcept(noexcept(_Left._Get_size())) /* strengthened */ requires sized_sentinel_for, iterator_t<_Vw>> { return -_Left._Get_size(); } - _NODISCARD friend constexpr range_rvalue_reference_t<_Vw> iter_move(const _Inner_iterator& _It) noexcept( - noexcept(_RANGES iter_move(_It._Get_current()))) { + _NODISCARD friend constexpr range_rvalue_reference_t<_Vw> iter_move(const _Inner_iterator& _It) + noexcept(noexcept(_RANGES iter_move(_It._Get_current()))) { return _RANGES iter_move(_It._Get_current()); } - friend constexpr void iter_swap(const _Inner_iterator& _Left, const _Inner_iterator& _Right) noexcept( - noexcept(_RANGES iter_swap(_Left._Get_current(), _Right._Get_current()))) + friend constexpr void iter_swap(const _Inner_iterator& _Left, const _Inner_iterator& _Right) + noexcept(noexcept(_RANGES iter_swap(_Left._Get_current(), _Right._Get_current()))) requires indirectly_swappable> { _RANGES iter_swap(_Left._Get_current(), _Right._Get_current()); @@ -5660,20 +5660,20 @@ namespace ranges { _Parent->_Remainder = _Parent->_Count; } - _NODISCARD friend constexpr bool operator==(const _Outer_iterator& _Left, default_sentinel_t) noexcept( - noexcept(_Left._Is_end())) /* strengthened */ { + _NODISCARD friend constexpr bool operator==(const _Outer_iterator& _Left, default_sentinel_t) + noexcept(noexcept(_Left._Is_end())) /* strengthened */ { return _Left._Is_end(); } - _NODISCARD friend constexpr difference_type operator-(default_sentinel_t, - const _Outer_iterator& _Right) noexcept(noexcept(_Right._Get_size())) /* strengthened */ + _NODISCARD friend constexpr difference_type operator-(default_sentinel_t, const _Outer_iterator& _Right) + noexcept(noexcept(_Right._Get_size())) /* strengthened */ requires sized_sentinel_for, iterator_t<_Vw>> { return _Right._Get_size(); } - _NODISCARD friend constexpr difference_type operator-(const _Outer_iterator& _Left, - default_sentinel_t) noexcept(noexcept(_Left._Get_size())) /* strengthened */ + _NODISCARD friend constexpr difference_type operator-(const _Outer_iterator& _Left, default_sentinel_t) + noexcept(noexcept(_Left._Get_size())) /* strengthened */ requires sized_sentinel_for, iterator_t<_Vw>> { return -_Left._Get_size(); @@ -5681,8 +5681,8 @@ namespace ranges { }; public: - constexpr explicit chunk_view(_Vw _Range_, const range_difference_t<_Vw> _Count_) noexcept( - is_nothrow_move_constructible_v<_Vw>) /* strengthened */ + constexpr explicit chunk_view(_Vw _Range_, const range_difference_t<_Vw> _Count_) + noexcept(is_nothrow_move_constructible_v<_Vw>) /* strengthened */ : _Range(_STD move(_Range_)), _Count{_Count_} { #if _CONTAINER_DEBUG_LEVEL > 0 _STL_VERIFY(_Count > 0, "chunk size must be greater than 0"); @@ -5699,8 +5699,8 @@ namespace ranges { return _STD move(_Range); } - _NODISCARD constexpr _Outer_iterator begin() noexcept( - noexcept(_Current._Emplace(_RANGES begin(_Range)))) /* strengthened */ { + _NODISCARD constexpr _Outer_iterator begin() + noexcept(noexcept(_Current._Emplace(_RANGES begin(_Range)))) /* strengthened */ { _Current._Emplace(_RANGES begin(_Range)); _Remainder = _Count; return _Outer_iterator{this}; @@ -5761,10 +5761,10 @@ namespace ranges { _Iterator() = default; - constexpr _Iterator(_Iterator _Other) noexcept( - is_nothrow_constructible_v<_Base_iterator, typename _Iterator::_Base_iterator> // - && is_nothrow_constructible_v<_Base_sentinel, typename _Iterator::_Base_sentinel> // - ) /* strengthened */ + constexpr _Iterator(_Iterator _Other) + noexcept(is_nothrow_constructible_v<_Base_iterator, typename _Iterator::_Base_iterator> // + && is_nothrow_constructible_v<_Base_sentinel, typename _Iterator::_Base_sentinel> // + ) /* strengthened */ requires _Const && convertible_to, _Base_iterator> && convertible_to, _Base_sentinel> : _Current(_STD move(_Other._Current)), _End(_STD move(_Other._End)), _Count(_Other._Count), @@ -5856,54 +5856,54 @@ namespace ranges { return *(*this + _Off); } - _NODISCARD friend constexpr bool operator==(const _Iterator& _Left, const _Iterator& _Right) noexcept( - noexcept(_STD _Fake_copy_init(_Left._Current == _Right._Current))) /* strengthened */ { + _NODISCARD friend constexpr bool operator==(const _Iterator& _Left, const _Iterator& _Right) + noexcept(noexcept(_STD _Fake_copy_init(_Left._Current == _Right._Current))) /* strengthened */ { return _Left._Current == _Right._Current; } - _NODISCARD friend constexpr bool operator==(const _Iterator& _Left, default_sentinel_t) noexcept( - noexcept(_STD _Fake_copy_init(_Left._Current == _Left._End))) /* strengthened */ { + _NODISCARD friend constexpr bool operator==(const _Iterator& _Left, default_sentinel_t) + noexcept(noexcept(_STD _Fake_copy_init(_Left._Current == _Left._End))) /* strengthened */ { return _Left._Current == _Left._End; } - _NODISCARD friend constexpr bool operator<(const _Iterator& _Left, const _Iterator& _Right) noexcept( - noexcept(_STD _Fake_copy_init(_Left._Current < _Right._Current))) /* strengthened */ + _NODISCARD friend constexpr bool operator<(const _Iterator& _Left, const _Iterator& _Right) + noexcept(noexcept(_STD _Fake_copy_init(_Left._Current < _Right._Current))) /* strengthened */ requires random_access_range<_Base> { return _Left._Current < _Right._Current; } - _NODISCARD friend constexpr bool operator>(const _Iterator& _Left, const _Iterator& _Right) noexcept( - noexcept(_STD _Fake_copy_init(_Right._Current < _Left._Current))) /* strengthened */ + _NODISCARD friend constexpr bool operator>(const _Iterator& _Left, const _Iterator& _Right) + noexcept(noexcept(_STD _Fake_copy_init(_Right._Current < _Left._Current))) /* strengthened */ requires random_access_range<_Base> { return _Right._Current < _Left._Current; } - _NODISCARD friend constexpr bool operator<=(const _Iterator& _Left, const _Iterator& _Right) noexcept( - noexcept(_STD _Fake_copy_init(!(_Right._Current < _Left._Current)))) /* strengthened */ + _NODISCARD friend constexpr bool operator<=(const _Iterator& _Left, const _Iterator& _Right) + noexcept(noexcept(_STD _Fake_copy_init(!(_Right._Current < _Left._Current)))) /* strengthened */ requires random_access_range<_Base> { return !(_Right._Current < _Left._Current); } - _NODISCARD friend constexpr bool operator>=(const _Iterator& _Left, const _Iterator& _Right) noexcept( - noexcept(_STD _Fake_copy_init(!(_Left._Current < _Right._Current)))) /* strengthened */ + _NODISCARD friend constexpr bool operator>=(const _Iterator& _Left, const _Iterator& _Right) + noexcept(noexcept(_STD _Fake_copy_init(!(_Left._Current < _Right._Current)))) /* strengthened */ requires random_access_range<_Base> { return !(_Left._Current < _Right._Current); } - _NODISCARD friend constexpr auto operator<=>(const _Iterator& _Left, const _Iterator& _Right) noexcept( - noexcept(_Left._Current <=> _Right._Current)) /* strengthened */ + _NODISCARD friend constexpr auto operator<=>(const _Iterator& _Left, const _Iterator& _Right) + noexcept(noexcept(_Left._Current <=> _Right._Current)) /* strengthened */ requires random_access_range<_Base> && three_way_comparable<_Base_iterator> { return _Left._Current <=> _Right._Current; } - _NODISCARD friend constexpr _Iterator operator+(const _Iterator& _It, const difference_type _Off) noexcept( - is_nothrow_copy_constructible_v<_Iterator> // - && noexcept(_STD declval<_Iterator&>() += _Off)) /* strengthened */ + _NODISCARD friend constexpr _Iterator operator+(const _Iterator& _It, const difference_type _Off) + noexcept(is_nothrow_copy_constructible_v<_Iterator> // + && noexcept(_STD declval<_Iterator&>() += _Off)) /* strengthened */ requires random_access_range<_Base> { auto _Copy = _It; @@ -5911,9 +5911,9 @@ namespace ranges { return _Copy; } - _NODISCARD friend constexpr _Iterator operator+(const difference_type _Off, const _Iterator& _It) noexcept( - is_nothrow_copy_constructible_v<_Iterator> // - && noexcept(_STD declval<_Iterator&>() += _Off)) /* strengthened */ + _NODISCARD friend constexpr _Iterator operator+(const difference_type _Off, const _Iterator& _It) + noexcept(is_nothrow_copy_constructible_v<_Iterator> // + && noexcept(_STD declval<_Iterator&>() += _Off)) /* strengthened */ requires random_access_range<_Base> { auto _Copy = _It; @@ -5921,9 +5921,9 @@ namespace ranges { return _Copy; } - _NODISCARD friend constexpr _Iterator operator-(const _Iterator& _It, const difference_type _Off) noexcept( - is_nothrow_copy_constructible_v<_Iterator> // - && noexcept(_STD declval<_Iterator&>() -= _Off)) /* strengthened */ + _NODISCARD friend constexpr _Iterator operator-(const _Iterator& _It, const difference_type _Off) + noexcept(is_nothrow_copy_constructible_v<_Iterator> // + && noexcept(_STD declval<_Iterator&>() -= _Off)) /* strengthened */ requires random_access_range<_Base> { auto _Copy = _It; @@ -5931,22 +5931,22 @@ namespace ranges { return _Copy; } - _NODISCARD friend constexpr difference_type operator-(const _Iterator& _Left, - const _Iterator& _Right) noexcept(noexcept(_Left._Current - _Right._Current)) /* strengthened */ + _NODISCARD friend constexpr difference_type operator-(const _Iterator& _Left, const _Iterator& _Right) + noexcept(noexcept(_Left._Current - _Right._Current)) /* strengthened */ requires sized_sentinel_for<_Base_iterator, _Base_iterator> { return (_Left._Current - _Right._Current + _Left._Missing - _Right._Missing) / _Left._Count; } - _NODISCARD friend constexpr difference_type operator-(default_sentinel_t, const _Iterator& _Right) noexcept( - noexcept(_Right._End - _Right._Current)) /* strengthened */ + _NODISCARD friend constexpr difference_type operator-(default_sentinel_t, const _Iterator& _Right) + noexcept(noexcept(_Right._End - _Right._Current)) /* strengthened */ requires sized_sentinel_for<_Base_sentinel, _Base_iterator> { return _Div_ceil(_Right._End - _Right._Current, _Right._Count); } - _NODISCARD friend constexpr difference_type operator-(const _Iterator& _Left, default_sentinel_t) noexcept( - noexcept(_Left._End - _Left._Current)) /* strengthened */ + _NODISCARD friend constexpr difference_type operator-(const _Iterator& _Left, default_sentinel_t) + noexcept(noexcept(_Left._End - _Left._Current)) /* strengthened */ requires sized_sentinel_for<_Base_sentinel, _Base_iterator> { return -_Div_ceil(_Left._End - _Left._Current, _Left._Count); @@ -5954,8 +5954,8 @@ namespace ranges { }; public: - constexpr explicit chunk_view(_Vw _Range_, const range_difference_t<_Vw> _Count_) noexcept( - is_nothrow_move_constructible_v<_Vw>) /* strengthened */ + constexpr explicit chunk_view(_Vw _Range_, const range_difference_t<_Vw> _Count_) + noexcept(is_nothrow_move_constructible_v<_Vw>) /* strengthened */ : _Range(_STD move(_Range_)), _Count{_Count_} { #if _CONTAINER_DEBUG_LEVEL > 0 _STL_VERIFY(_Count > 0, "chunk size must be greater than 0"); @@ -6097,8 +6097,8 @@ namespace ranges { public: _Iter_base() = default; - constexpr explicit _Iter_base(_Base_iterator _Last_element_) noexcept( - is_nothrow_move_constructible_v<_Base_iterator>) + constexpr explicit _Iter_base(_Base_iterator _Last_element_) + noexcept(is_nothrow_move_constructible_v<_Base_iterator>) : _Last_element{_STD move(_Last_element_)} {} _NODISCARD constexpr const _Base_iterator& _Get_last_element() const noexcept { @@ -6117,8 +6117,8 @@ namespace ranges { /* [[no_unique_address]] */ _Base_iterator _Current{}; range_difference_t<_Base> _Count = 0; - constexpr _Iterator(_Base_iterator _Current_, range_difference_t<_Base> _Count_) noexcept( - is_nothrow_move_constructible_v<_Base_iterator>) /* strengthened */ + constexpr _Iterator(_Base_iterator _Current_, range_difference_t<_Base> _Count_) + noexcept(is_nothrow_move_constructible_v<_Base_iterator>) /* strengthened */ requires (!_Slide_caches_first<_Base>) : _Current(_STD move(_Current_)), _Count(_Count_) {} @@ -6136,8 +6136,8 @@ namespace ranges { _Iterator() = default; - constexpr _Iterator(_Iterator _Other) noexcept( - is_nothrow_constructible_v<_Base_iterator, iterator_t<_Vw>>) // strengthened + constexpr _Iterator(_Iterator _Other) + noexcept(is_nothrow_constructible_v<_Base_iterator, iterator_t<_Vw>>) // strengthened requires _Const && convertible_to, _Base_iterator> : _Current(_STD move(_Other._Current)), _Count(_Other._Count) {} @@ -6182,8 +6182,8 @@ namespace ranges { return _Tmp; } - constexpr _Iterator& operator+=(const difference_type _Off) noexcept( - noexcept(_Current += _Off)) /* strengthened */ + constexpr _Iterator& operator+=(const difference_type _Off) + noexcept(noexcept(_Current += _Off)) /* strengthened */ requires random_access_range<_Base> { _Current += _Off; @@ -6194,8 +6194,8 @@ namespace ranges { return *this; } - constexpr _Iterator& operator-=(const difference_type _Off) noexcept( - noexcept(_Current -= _Off)) /* strengthened */ + constexpr _Iterator& operator-=(const difference_type _Off) + noexcept(noexcept(_Current -= _Off)) /* strengthened */ requires random_access_range<_Base> { _Current -= _Off; @@ -6213,8 +6213,8 @@ namespace ranges { return views::counted(_Current + _Off, _Count); } - _NODISCARD friend constexpr bool operator==(const _Iterator& _Left, const _Iterator& _Right) noexcept( - noexcept(_STD _Fake_copy_init(_Left._Current == _Right._Current))) /* strengthened */ { + _NODISCARD friend constexpr bool operator==(const _Iterator& _Left, const _Iterator& _Right) + noexcept(noexcept(_STD _Fake_copy_init(_Left._Current == _Right._Current))) /* strengthened */ { if constexpr (_Slide_caches_first<_Base>) { return _Left._Last_element == _Right._Last_element; } else { @@ -6222,43 +6222,43 @@ namespace ranges { } } - _NODISCARD friend constexpr bool operator<(const _Iterator& _Left, const _Iterator& _Right) noexcept( - noexcept(_STD _Fake_copy_init(_Left._Current < _Right._Current))) /* strengthened */ + _NODISCARD friend constexpr bool operator<(const _Iterator& _Left, const _Iterator& _Right) + noexcept(noexcept(_STD _Fake_copy_init(_Left._Current < _Right._Current))) /* strengthened */ requires random_access_range<_Base> { return _Left._Current < _Right._Current; } - _NODISCARD friend constexpr bool operator>(const _Iterator& _Left, const _Iterator& _Right) noexcept( - noexcept(_STD _Fake_copy_init(_Right._Current < _Left._Current))) /* strengthened */ + _NODISCARD friend constexpr bool operator>(const _Iterator& _Left, const _Iterator& _Right) + noexcept(noexcept(_STD _Fake_copy_init(_Right._Current < _Left._Current))) /* strengthened */ requires random_access_range<_Base> { return _Right._Current < _Left._Current; } - _NODISCARD friend constexpr bool operator<=(const _Iterator& _Left, const _Iterator& _Right) noexcept( - noexcept(_STD _Fake_copy_init(!(_Right._Current < _Left._Current)))) /* strengthened */ + _NODISCARD friend constexpr bool operator<=(const _Iterator& _Left, const _Iterator& _Right) + noexcept(noexcept(_STD _Fake_copy_init(!(_Right._Current < _Left._Current)))) /* strengthened */ requires random_access_range<_Base> { return !(_Right._Current < _Left._Current); } - _NODISCARD friend constexpr bool operator>=(const _Iterator& _Left, const _Iterator& _Right) noexcept( - noexcept(_STD _Fake_copy_init(!(_Left._Current < _Right._Current)))) /* strengthened */ + _NODISCARD friend constexpr bool operator>=(const _Iterator& _Left, const _Iterator& _Right) + noexcept(noexcept(_STD _Fake_copy_init(!(_Left._Current < _Right._Current)))) /* strengthened */ requires random_access_range<_Base> { return !(_Left._Current < _Right._Current); } - _NODISCARD friend constexpr auto operator<=>(const _Iterator& _Left, const _Iterator& _Right) noexcept( - noexcept(_Left._Current <=> _Right._Current)) /* strengthened */ + _NODISCARD friend constexpr auto operator<=>(const _Iterator& _Left, const _Iterator& _Right) + noexcept(noexcept(_Left._Current <=> _Right._Current)) /* strengthened */ requires random_access_range<_Base> && three_way_comparable<_Base_iterator> { return _Left._Current <=> _Right._Current; } - _NODISCARD friend constexpr _Iterator operator+(const _Iterator& _It, const difference_type _Off) noexcept( - noexcept(_STD declval<_Iterator&>() += _Off)) /* strengthened */ + _NODISCARD friend constexpr _Iterator operator+(const _Iterator& _It, const difference_type _Off) + noexcept(noexcept(_STD declval<_Iterator&>() += _Off)) /* strengthened */ requires random_access_range<_Base> { auto _Copy = _It; @@ -6266,8 +6266,8 @@ namespace ranges { return _Copy; } - _NODISCARD friend constexpr _Iterator operator+(const difference_type _Off, const _Iterator& _It) noexcept( - noexcept(_STD declval<_Iterator&>() += _Off)) /* strengthened */ + _NODISCARD friend constexpr _Iterator operator+(const difference_type _Off, const _Iterator& _It) + noexcept(noexcept(_STD declval<_Iterator&>() += _Off)) /* strengthened */ requires random_access_range<_Base> { auto _Copy = _It; @@ -6275,8 +6275,8 @@ namespace ranges { return _Copy; } - _NODISCARD friend constexpr _Iterator operator-(const _Iterator& _It, const difference_type _Off) noexcept( - noexcept(_STD declval<_Iterator&>() -= _Off)) /* strengthened */ + _NODISCARD friend constexpr _Iterator operator-(const _Iterator& _It, const difference_type _Off) + noexcept(noexcept(_STD declval<_Iterator&>() -= _Off)) /* strengthened */ requires random_access_range<_Base> { auto _Copy = _It; @@ -6284,8 +6284,8 @@ namespace ranges { return _Copy; } - _NODISCARD friend constexpr difference_type operator-(const _Iterator& _Left, - const _Iterator& _Right) noexcept(noexcept(_Left._Current - _Right._Current)) /* strengthened */ + _NODISCARD friend constexpr difference_type operator-(const _Iterator& _Left, const _Iterator& _Right) + noexcept(noexcept(_Left._Current - _Right._Current)) /* strengthened */ requires sized_sentinel_for<_Base_iterator, _Base_iterator> { if constexpr (_Slide_caches_first<_Base>) { @@ -6301,15 +6301,15 @@ namespace ranges { friend slide_view; /* [[no_unique_address]] */ sentinel_t<_Vw> _Last{}; - constexpr explicit _Sentinel(sentinel_t<_Vw> _Last_) noexcept( - is_nothrow_move_constructible_v>) /* strengthened */ + constexpr explicit _Sentinel(sentinel_t<_Vw> _Last_) + noexcept(is_nothrow_move_constructible_v>) /* strengthened */ : _Last(_STD move(_Last_)) {} public: _Sentinel() = default; - _NODISCARD friend constexpr bool - operator==(const _Iterator& _Left, const _Sentinel& _Right) noexcept(noexcept( + _NODISCARD friend constexpr bool operator==(const _Iterator& _Left, const _Sentinel& _Right) + noexcept(noexcept( _STD _Fake_copy_init(_Left._Get_last_element() == _Right._Last))) /* strengthened */ { return _Left._Get_last_element() == _Right._Last; } @@ -6321,9 +6321,9 @@ namespace ranges { return _Left._Get_last_element() - _Right._Last; } - _NODISCARD friend constexpr range_difference_t<_Vw> - operator-(const _Sentinel& _Left, const _Iterator& _Right) noexcept( - noexcept(_Left._Last - _Right._Get_last_element())) /* strengthened */ + _NODISCARD friend constexpr range_difference_t<_Vw> operator-( + const _Sentinel& _Left, const _Iterator& _Right) + noexcept(noexcept(_Left._Last - _Right._Get_last_element())) /* strengthened */ requires sized_sentinel_for, iterator_t<_Vw>> { return _Left._Last - _Right._Get_last_element(); @@ -6331,8 +6331,8 @@ namespace ranges { }; public: - constexpr explicit slide_view(_Vw _Range_, const range_difference_t<_Vw> _Count_) noexcept( - is_nothrow_move_constructible_v<_Vw>) /* strengthened */ + constexpr explicit slide_view(_Vw _Range_, const range_difference_t<_Vw> _Count_) + noexcept(is_nothrow_move_constructible_v<_Vw>) /* strengthened */ : _Range(_STD move(_Range_)), _Count{_Count_} { #if _CONTAINER_DEBUG_LEVEL > 0 _STL_VERIFY(_Count > 0, "The window size must be positive (N4950 [range.slide.view]/1)"); @@ -6503,8 +6503,8 @@ namespace ranges { /* [[no_unique_address]] */ iterator_t<_Vw> _Current{}; /* [[no_unique_address]] */ iterator_t<_Vw> _Next{}; - constexpr _Iterator(chunk_by_view& _Parent_, iterator_t<_Vw> _Current_, iterator_t<_Vw> _Next_) noexcept( - is_nothrow_move_constructible_v>) // strengthened + constexpr _Iterator(chunk_by_view& _Parent_, iterator_t<_Vw> _Current_, iterator_t<_Vw> _Next_) + noexcept(is_nothrow_move_constructible_v>) // strengthened : _Parent(_STD addressof(_Parent_)), _Current(_STD move(_Current_)), _Next(_STD move(_Next_)) {} public: @@ -6560,13 +6560,13 @@ namespace ranges { return _Tmp; } - _NODISCARD friend constexpr bool operator==(const _Iterator& _Left, const _Iterator& _Right) noexcept( - noexcept(_STD _Fake_copy_init(_Left._Current == _Right._Current))) /* strengthened */ { + _NODISCARD friend constexpr bool operator==(const _Iterator& _Left, const _Iterator& _Right) + noexcept(noexcept(_STD _Fake_copy_init(_Left._Current == _Right._Current))) /* strengthened */ { return _Left._Current == _Right._Current; } - _NODISCARD friend constexpr bool operator==(const _Iterator& _Left, default_sentinel_t) noexcept( - noexcept(_STD _Fake_copy_init(_Left._Current == _Left._Next))) /* strengthened */ { + _NODISCARD friend constexpr bool operator==(const _Iterator& _Left, default_sentinel_t) + noexcept(noexcept(_STD _Fake_copy_init(_Left._Current == _Left._Next))) /* strengthened */ { return _Left._Current == _Left._Next; } }; @@ -6596,8 +6596,8 @@ namespace ranges { chunk_by_view() requires default_initializable<_Vw> && default_initializable<_Pr> = default; // clang-format on - constexpr explicit chunk_by_view(_Vw _Range_, _Pr _Pred_) noexcept( - is_nothrow_move_constructible_v<_Vw> && is_nothrow_move_constructible_v<_Pr>) // strengthened + constexpr explicit chunk_by_view(_Vw _Range_, _Pr _Pred_) + noexcept(is_nothrow_move_constructible_v<_Vw> && is_nothrow_move_constructible_v<_Pr>) // strengthened : _Range(_STD move(_Range_)), _Pred{in_place, _STD move(_Pred_)} {} _NODISCARD constexpr _Vw base() const& noexcept(is_nothrow_copy_constructible_v<_Vw>) /* strengthened */ @@ -6721,10 +6721,10 @@ namespace ranges { _Iterator() requires default_initializable<_Base_iterator> = default; // clang-format on - constexpr _Iterator(_Iterator _Other) noexcept( - is_nothrow_constructible_v<_Base_iterator, iterator_t<_Vw>> // - && is_nothrow_constructible_v<_Base_sentinel, sentinel_t<_Vw>> // - ) /* strengthened */ + constexpr _Iterator(_Iterator _Other) + noexcept(is_nothrow_constructible_v<_Base_iterator, iterator_t<_Vw>> // + && is_nothrow_constructible_v<_Base_sentinel, sentinel_t<_Vw>> // + ) /* strengthened */ requires _Const && convertible_to, _Base_iterator> && convertible_to, _Base_sentinel> : _Current(_STD move(_Other._Current)), _End(_STD move(_Other._End)), _Stride(_Other._Stride), @@ -6825,48 +6825,48 @@ namespace ranges { return *(*this + _Off); } - _NODISCARD friend constexpr bool operator==(const _Iterator& _It, default_sentinel_t) noexcept( - noexcept(_STD _Fake_copy_init(_It._Current == _It._End))) /* strengthened */ { + _NODISCARD friend constexpr bool operator==(const _Iterator& _It, default_sentinel_t) + noexcept(noexcept(_STD _Fake_copy_init(_It._Current == _It._End))) /* strengthened */ { return _It._Current == _It._End; } - _NODISCARD friend constexpr bool operator==(const _Iterator& _Left, const _Iterator& _Right) noexcept( - noexcept(_STD _Fake_copy_init(_Left._Current == _Right._Current))) // strengthened + _NODISCARD friend constexpr bool operator==(const _Iterator& _Left, const _Iterator& _Right) + noexcept(noexcept(_STD _Fake_copy_init(_Left._Current == _Right._Current))) // strengthened requires equality_comparable<_Base_iterator> { return _Left._Current == _Right._Current; } - _NODISCARD friend constexpr bool operator<(const _Iterator& _Left, const _Iterator& _Right) noexcept( - noexcept(_STD _Fake_copy_init(_Left._Current < _Right._Current))) // strengthened + _NODISCARD friend constexpr bool operator<(const _Iterator& _Left, const _Iterator& _Right) + noexcept(noexcept(_STD _Fake_copy_init(_Left._Current < _Right._Current))) // strengthened requires random_access_range<_Base> { return _Left._Current < _Right._Current; } - _NODISCARD friend constexpr bool operator>(const _Iterator& _Left, const _Iterator& _Right) noexcept( - noexcept(_STD _Fake_copy_init(_Right._Current < _Left._Current))) // strengthened + _NODISCARD friend constexpr bool operator>(const _Iterator& _Left, const _Iterator& _Right) + noexcept(noexcept(_STD _Fake_copy_init(_Right._Current < _Left._Current))) // strengthened requires random_access_range<_Base> { return _Right._Current < _Left._Current; } - _NODISCARD friend constexpr bool operator<=(const _Iterator& _Left, const _Iterator& _Right) noexcept( - noexcept(_STD _Fake_copy_init(!(_Right._Current < _Left._Current)))) // strengthened + _NODISCARD friend constexpr bool operator<=(const _Iterator& _Left, const _Iterator& _Right) + noexcept(noexcept(_STD _Fake_copy_init(!(_Right._Current < _Left._Current)))) // strengthened requires random_access_range<_Base> { return !(_Right._Current < _Left._Current); } - _NODISCARD friend constexpr bool operator>=(const _Iterator& _Left, const _Iterator& _Right) noexcept( - noexcept(_STD _Fake_copy_init(!(_Left._Current < _Right._Current)))) // strengthened + _NODISCARD friend constexpr bool operator>=(const _Iterator& _Left, const _Iterator& _Right) + noexcept(noexcept(_STD _Fake_copy_init(!(_Left._Current < _Right._Current)))) // strengthened requires random_access_range<_Base> { return !(_Left._Current < _Right._Current); } - _NODISCARD friend constexpr auto operator<=>(const _Iterator& _Left, const _Iterator& _Right) noexcept( - noexcept(_Left._Current <=> _Right._Current)) // strengthened + _NODISCARD friend constexpr auto operator<=>(const _Iterator& _Left, const _Iterator& _Right) + noexcept(noexcept(_Left._Current <=> _Right._Current)) // strengthened requires random_access_range<_Base> && three_way_comparable<_Base_iterator> { return _Left._Current <=> _Right._Current; @@ -6912,27 +6912,27 @@ namespace ranges { } } - _NODISCARD friend constexpr difference_type operator-(default_sentinel_t, const _Iterator& _It) noexcept( - noexcept(_It._End - _It._Current)) // strengthened + _NODISCARD friend constexpr difference_type operator-(default_sentinel_t, const _Iterator& _It) + noexcept(noexcept(_It._End - _It._Current)) // strengthened requires sized_sentinel_for<_Base_sentinel, _Base_iterator> { return _Div_ceil(_It._End - _It._Current, _It._Stride); } - _NODISCARD friend constexpr difference_type operator-(const _Iterator& _It, default_sentinel_t) noexcept( - noexcept(_It._End - _It._Current)) // strengthened + _NODISCARD friend constexpr difference_type operator-(const _Iterator& _It, default_sentinel_t) + noexcept(noexcept(_It._End - _It._Current)) // strengthened requires sized_sentinel_for<_Base_sentinel, _Base_iterator> { return -_Div_ceil(_It._End - _It._Current, _It._Stride); } - _NODISCARD friend constexpr range_rvalue_reference_t<_Base> iter_move(const _Iterator& _It) noexcept( - noexcept(_RANGES iter_move(_It._Current))) { + _NODISCARD friend constexpr range_rvalue_reference_t<_Base> iter_move(const _Iterator& _It) + noexcept(noexcept(_RANGES iter_move(_It._Current))) { return _RANGES iter_move(_It._Current); } - friend constexpr void iter_swap(const _Iterator& _Left, const _Iterator& _Right) noexcept( - noexcept(_RANGES iter_swap(_Left._Current, _Right._Current))) + friend constexpr void iter_swap(const _Iterator& _Left, const _Iterator& _Right) + noexcept(noexcept(_RANGES iter_swap(_Left._Current, _Right._Current))) requires indirectly_swappable<_Base_iterator> { return _RANGES iter_swap(_Left._Current, _Right._Current); @@ -6940,8 +6940,8 @@ namespace ranges { }; public: - constexpr explicit stride_view(_Vw _Range_, range_difference_t<_Vw> _Stride_) noexcept( - is_nothrow_move_constructible_v<_Vw>) // strengthened + constexpr explicit stride_view(_Vw _Range_, range_difference_t<_Vw> _Stride_) + noexcept(is_nothrow_move_constructible_v<_Vw>) // strengthened : _Range(_STD move(_Range_)), _Stride(_Stride_) { #if _CONTAINER_DEBUG_LEVEL > 0 _STL_VERIFY(_Stride > 0, "stride must be greater than 0"); @@ -7187,8 +7187,8 @@ namespace ranges { /* [[no_unique_address]] */ _My_tuple _Current; - constexpr explicit _Iterator(_My_tuple _Current_) noexcept( - is_nothrow_move_constructible_v<_My_tuple>) // strengthened + constexpr explicit _Iterator(_My_tuple _Current_) + noexcept(is_nothrow_move_constructible_v<_My_tuple>) // strengthened : _Current(_STD move(_Current_)) {} public: @@ -7254,10 +7254,10 @@ namespace ranges { return _Temp; } - constexpr _Iterator& operator+=(const difference_type _Off) noexcept( - (noexcept(_STD declval>&>() += - static_cast>>>(_Off)) - && ...)) // strengthened + constexpr _Iterator& operator+=(const difference_type _Off) + noexcept((noexcept(_STD declval>&>() += + static_cast>>>(_Off)) + && ...)) // strengthened requires _All_random_access<_IsConst, _ViewTypes...> { _Tuple_for_each( @@ -7270,10 +7270,10 @@ namespace ranges { return *this; } - constexpr _Iterator& operator-=(const difference_type _Off) noexcept( - (noexcept(_STD declval>&>() -= - static_cast>>>(_Off)) - && ...)) // strengthened + constexpr _Iterator& operator-=(const difference_type _Off) + noexcept((noexcept(_STD declval>&>() -= + static_cast>>>(_Off)) + && ...)) // strengthened requires _All_random_access<_IsConst, _ViewTypes...> { _Tuple_for_each( @@ -7300,8 +7300,8 @@ namespace ranges { _Current); } - _NODISCARD friend constexpr bool operator==(const _Iterator& _Lhs, const _Iterator& _Rhs) noexcept( - noexcept(_Zip_iterator_sentinel_equal(_Lhs._Current, _Rhs._Current))) // strengthened + _NODISCARD friend constexpr bool operator==(const _Iterator& _Lhs, const _Iterator& _Rhs) + noexcept(noexcept(_Zip_iterator_sentinel_equal(_Lhs._Current, _Rhs._Current))) // strengthened requires (equality_comparable>> && ...) { if constexpr (!_Zip_is_common<_Maybe_const<_IsConst, _ViewTypes>...> @@ -7318,9 +7318,9 @@ namespace ranges { return _Lhs._Current <=> _Rhs._Current; } - _NODISCARD friend constexpr _Iterator operator+(const _Iterator& _Lhs, const difference_type _Rhs) noexcept( - noexcept(_STD declval<_Iterator&>() += _Rhs) - && is_nothrow_copy_constructible_v<_Iterator>) // strengthened + _NODISCARD friend constexpr _Iterator operator+(const _Iterator& _Lhs, const difference_type _Rhs) + noexcept(noexcept(_STD declval<_Iterator&>() += _Rhs) + && is_nothrow_copy_constructible_v<_Iterator>) // strengthened requires _All_random_access<_IsConst, _ViewTypes...> { auto _Modified_iterator = _Lhs; @@ -7329,16 +7329,16 @@ namespace ranges { return _Modified_iterator; } - _NODISCARD friend constexpr _Iterator operator+(const difference_type _Lhs, const _Iterator& _Rhs) noexcept( - noexcept(_Rhs + _Lhs)) /* strengthened */ + _NODISCARD friend constexpr _Iterator operator+(const difference_type _Lhs, const _Iterator& _Rhs) + noexcept(noexcept(_Rhs + _Lhs)) /* strengthened */ requires _All_random_access<_IsConst, _ViewTypes...> { return _Rhs + _Lhs; } - _NODISCARD friend constexpr _Iterator operator-(const _Iterator& _Lhs, const difference_type _Rhs) noexcept( - noexcept(_STD declval<_Iterator&>() -= _Rhs) - && is_nothrow_copy_constructible_v<_Iterator>) // strengthened + _NODISCARD friend constexpr _Iterator operator-(const _Iterator& _Lhs, const difference_type _Rhs) + noexcept(noexcept(_STD declval<_Iterator&>() -= _Rhs) + && is_nothrow_copy_constructible_v<_Iterator>) // strengthened requires _All_random_access<_IsConst, _ViewTypes...> { auto _Modified_iterator = _Lhs; @@ -7347,10 +7347,9 @@ namespace ranges { return _Modified_iterator; } - _NODISCARD friend constexpr difference_type - operator-(const _Iterator& _Lhs, const _Iterator& _Rhs) noexcept( - noexcept(_Zip_get_smallest_distance(_STD declval<_My_tuple>(), - _STD declval<_My_tuple>()))) // strengthened + _NODISCARD friend constexpr difference_type operator-(const _Iterator& _Lhs, const _Iterator& _Rhs) + noexcept(noexcept(_Zip_get_smallest_distance(_STD declval<_My_tuple>(), + _STD declval<_My_tuple>()))) // strengthened requires (sized_sentinel_for>, iterator_t<_Maybe_const<_IsConst, _ViewTypes>>> && ...) @@ -7395,8 +7394,8 @@ namespace ranges { /* [[no_unique_address]] */ _My_tuple _End; - constexpr explicit _Sentinel(_My_tuple _End_) noexcept( - is_nothrow_copy_constructible_v<_My_tuple>) // strengthened + constexpr explicit _Sentinel(_My_tuple _End_) + noexcept(is_nothrow_copy_constructible_v<_My_tuple>) // strengthened : _End(_End_) {} template @@ -7419,8 +7418,8 @@ namespace ranges { requires (sentinel_for>, iterator_t<_Maybe_const<_IteratorConst, _ViewTypes>>> && ...) - _NODISCARD friend constexpr bool - operator==(const _Iterator<_IteratorConst>& _Lhs, const _Sentinel& _Rhs) noexcept( + _NODISCARD friend constexpr bool operator==(const _Iterator<_IteratorConst>& _Lhs, const _Sentinel& _Rhs) + noexcept( noexcept(_Zip_iterator_sentinel_equal(_Get_iterator_tuple(_Lhs), _Rhs._End))) /* strengthened */ { return _Zip_iterator_sentinel_equal(_Get_iterator_tuple(_Lhs), _Rhs._End); } @@ -7430,8 +7429,8 @@ namespace ranges { iterator_t<_Maybe_const<_IteratorConst, _ViewTypes>>> && ...) _NODISCARD friend constexpr common_type_t>...> - operator-(const _Iterator<_IteratorConst>& _Lhs, const _Sentinel& _Rhs) noexcept( - noexcept(_Zip_get_smallest_distance< + operator-(const _Iterator<_IteratorConst>& _Lhs, const _Sentinel& _Rhs) + noexcept(noexcept(_Zip_get_smallest_distance< common_type_t>...>>( _Get_iterator_tuple(_Lhs), _Rhs._End))) /* strengthened */ { using _Difference_type = common_type_t>...>; @@ -7443,8 +7442,8 @@ namespace ranges { iterator_t<_Maybe_const<_IteratorConst, _ViewTypes>>> && ...) _NODISCARD friend constexpr common_type_t>...> - operator-(const _Sentinel& _Lhs, const _Iterator<_IteratorConst>& _Rhs) noexcept( - noexcept(-(_Rhs - _Lhs))) /* strengthened */ { + operator-(const _Sentinel& _Lhs, const _Iterator<_IteratorConst>& _Rhs) + noexcept(noexcept(-(_Rhs - _Lhs))) /* strengthened */ { return -(_Rhs - _Lhs); } }; @@ -7472,12 +7471,12 @@ namespace ranges { public: zip_view() noexcept((is_nothrow_default_constructible_v<_ViewTypes> && ...)) = default; - constexpr explicit zip_view(_ViewTypes... _Args) noexcept( - (is_nothrow_move_constructible_v<_ViewTypes> && ...)) // strengthened + constexpr explicit zip_view(_ViewTypes... _Args) + noexcept((is_nothrow_move_constructible_v<_ViewTypes> && ...)) // strengthened : _Views(_STD move(_Args)...) {} - _NODISCARD constexpr auto begin() noexcept( - noexcept(_Iterator{_Tuple_transform(_RANGES begin, _Views)})) // strengthened + _NODISCARD constexpr auto begin() + noexcept(noexcept(_Iterator{_Tuple_transform(_RANGES begin, _Views)})) // strengthened requires (!(_Simple_view<_ViewTypes> && ...)) { return _Iterator{_Tuple_transform(_RANGES begin, _Views)}; @@ -7514,8 +7513,8 @@ namespace ranges { } } - _NODISCARD constexpr auto size() noexcept( - noexcept(_STD apply(_Size_closure, _Tuple_transform(_RANGES size, _Views)))) // strengthened + _NODISCARD constexpr auto size() + noexcept(noexcept(_STD apply(_Size_closure, _Tuple_transform(_RANGES size, _Views)))) // strengthened requires (sized_range<_ViewTypes> && ...) { return _STD apply(_Size_closure, _Tuple_transform(_RANGES size, _Views)); @@ -7633,8 +7632,8 @@ namespace ranges { _Parent_t* _Parent = nullptr; /* [[no_unique_address]] */ _Ziperator<_IsConst> _Inner; - constexpr _Iterator(_Parent_t& _Parent_, _Ziperator<_IsConst> _Inner_) noexcept( - is_nothrow_move_constructible_v<_Ziperator<_IsConst>>) // strengthened + constexpr _Iterator(_Parent_t& _Parent_, _Ziperator<_IsConst> _Inner_) + noexcept(is_nothrow_move_constructible_v<_Ziperator<_IsConst>>) // strengthened : _Parent(_STD addressof(_Parent_)), _Inner(_STD move(_Inner_)) {} public: @@ -7645,8 +7644,8 @@ namespace ranges { _Iterator() = default; - constexpr _Iterator(_Iterator _Rhs) noexcept( - is_nothrow_convertible_v<_Ziperator, _Ziperator<_IsConst>>) // strengthened + constexpr _Iterator(_Iterator _Rhs) + noexcept(is_nothrow_convertible_v<_Ziperator, _Ziperator<_IsConst>>) // strengthened requires (_IsConst && convertible_to<_Ziperator, _Ziperator<_IsConst>>) : _Parent(_Rhs._Parent), _Inner(_STD move(_Rhs._Inner)) {} @@ -7689,16 +7688,16 @@ namespace ranges { return _Temp; } - constexpr _Iterator& operator+=(const difference_type _Off) noexcept( - noexcept(_Inner += _Off)) // strengthened + constexpr _Iterator& operator+=(const difference_type _Off) + noexcept(noexcept(_Inner += _Off)) // strengthened requires random_access_range<_Base_t> { _Inner += _Off; return *this; } - constexpr _Iterator& operator-=(const difference_type _Off) noexcept( - noexcept(_Inner -= _Off)) // strengthened + constexpr _Iterator& operator-=(const difference_type _Off) + noexcept(noexcept(_Inner -= _Off)) // strengthened requires random_access_range<_Base_t> { _Inner -= _Off; @@ -7712,36 +7711,36 @@ namespace ranges { return _STD apply(_Subscript_closure(_Where), _Inner._Current); } - _NODISCARD friend constexpr bool operator==(const _Iterator& _Lhs, const _Iterator& _Rhs) noexcept( - noexcept(_Lhs._Inner == _Rhs._Inner)) // strengthened + _NODISCARD friend constexpr bool operator==(const _Iterator& _Lhs, const _Iterator& _Rhs) + noexcept(noexcept(_Lhs._Inner == _Rhs._Inner)) // strengthened requires equality_comparable<_Ziperator<_IsConst>> { return _Lhs._Inner == _Rhs._Inner; } - _NODISCARD friend constexpr auto operator<=>(const _Iterator& _Lhs, const _Iterator& _Rhs) noexcept( - noexcept(_Lhs._Inner <=> _Rhs._Inner)) // strengthened + _NODISCARD friend constexpr auto operator<=>(const _Iterator& _Lhs, const _Iterator& _Rhs) + noexcept(noexcept(_Lhs._Inner <=> _Rhs._Inner)) // strengthened requires random_access_range<_Base_t> { return _Lhs._Inner <=> _Rhs._Inner; } - _NODISCARD friend constexpr _Iterator operator+(const _Iterator& _Lhs, const difference_type _Rhs) noexcept( - noexcept(_Iterator{*_Lhs._Parent, _Lhs._Inner + _Rhs})) // strengthened + _NODISCARD friend constexpr _Iterator operator+(const _Iterator& _Lhs, const difference_type _Rhs) + noexcept(noexcept(_Iterator{*_Lhs._Parent, _Lhs._Inner + _Rhs})) // strengthened requires random_access_range<_Base_t> { return _Iterator{*_Lhs._Parent, _Lhs._Inner + _Rhs}; } - _NODISCARD friend constexpr _Iterator operator+(const difference_type _Lhs, const _Iterator& _Rhs) noexcept( - noexcept(_Iterator{*_Rhs._Parent, _Rhs._Inner + _Lhs})) // strengthened + _NODISCARD friend constexpr _Iterator operator+(const difference_type _Lhs, const _Iterator& _Rhs) + noexcept(noexcept(_Iterator{*_Rhs._Parent, _Rhs._Inner + _Lhs})) // strengthened requires random_access_range<_Base_t> { return _Iterator{*_Rhs._Parent, _Rhs._Inner + _Lhs}; } - _NODISCARD friend constexpr _Iterator operator-(const _Iterator& _Lhs, const difference_type _Rhs) noexcept( - noexcept(_Iterator{*_Lhs._Parent, _Lhs._Inner - _Rhs})) // strengthened + _NODISCARD friend constexpr _Iterator operator-(const _Iterator& _Lhs, const difference_type _Rhs) + noexcept(noexcept(_Iterator{*_Lhs._Parent, _Lhs._Inner - _Rhs})) // strengthened requires random_access_range<_Base_t> { return _Iterator{*_Lhs._Parent, _Lhs._Inner - _Rhs}; @@ -7781,8 +7780,8 @@ namespace ranges { /* [[no_unique_address]] */ _Zentinel<_IsConst> _Inner; - constexpr explicit _Sentinel(_Zentinel<_IsConst> _Inner_) noexcept( - is_nothrow_copy_constructible_v<_Zentinel<_IsConst>>) // strengthened + constexpr explicit _Sentinel(_Zentinel<_IsConst> _Inner_) + noexcept(is_nothrow_copy_constructible_v<_Zentinel<_IsConst>>) // strengthened : _Inner(_Inner_) {} template @@ -7794,31 +7793,31 @@ namespace ranges { public: _Sentinel() = default; - constexpr _Sentinel(_Sentinel _Rhs) noexcept( - is_nothrow_convertible_v<_Zentinel, _Zentinel<_IsConst>>) // strengthened + constexpr _Sentinel(_Sentinel _Rhs) + noexcept(is_nothrow_convertible_v<_Zentinel, _Zentinel<_IsConst>>) // strengthened requires (_IsConst && convertible_to<_Zentinel, _Zentinel<_IsConst>>) : _Inner(_STD move(_Rhs._Inner)) {} template requires sentinel_for<_Zentinel<_IsConst>, _Ziperator<_IteratorConst>> - _NODISCARD friend constexpr bool operator==(const _Iterator<_IteratorConst>& _Lhs, - const _Sentinel& _Rhs) noexcept(noexcept(_Get_iterator_inner(_Lhs) == _Rhs._Inner)) /* strengthened */ { + _NODISCARD friend constexpr bool operator==(const _Iterator<_IteratorConst>& _Lhs, const _Sentinel& _Rhs) + noexcept(noexcept(_Get_iterator_inner(_Lhs) == _Rhs._Inner)) /* strengthened */ { return _Get_iterator_inner(_Lhs) == _Rhs._Inner; } template requires sized_sentinel_for<_Zentinel<_IsConst>, _Ziperator<_IteratorConst>> _NODISCARD friend constexpr _Iter_sent_difference_type<_IteratorConst> // TRANSITION, DevCom-10253131 - operator-(const _Iterator<_IteratorConst>& _Lhs, const _Sentinel & _Rhs) noexcept( - noexcept(_Get_iterator_inner(_Lhs) - _Rhs._Inner)) /* strengthened */ { + operator-(const _Iterator<_IteratorConst>& _Lhs, const _Sentinel & _Rhs) + noexcept(noexcept(_Get_iterator_inner(_Lhs) - _Rhs._Inner)) /* strengthened */ { return _Get_iterator_inner(_Lhs) - _Rhs._Inner; } template requires sized_sentinel_for<_Zentinel<_IsConst>, _Ziperator<_IteratorConst>> _NODISCARD friend constexpr _Iter_sent_difference_type<_IteratorConst> // TRANSITION, DevCom-10253131 - operator-(const _Sentinel & _Lhs, const _Iterator<_IteratorConst>& _Rhs) noexcept( - noexcept(_Lhs._Inner - _Get_iterator_inner(_Rhs))) /* strengthened */ { + operator-(const _Sentinel & _Lhs, const _Iterator<_IteratorConst>& _Rhs) + noexcept(noexcept(_Lhs._Inner - _Get_iterator_inner(_Rhs))) /* strengthened */ { return _Lhs._Inner - _Get_iterator_inner(_Rhs); } }; @@ -7836,9 +7835,9 @@ namespace ranges { public: zip_transform_view() = default; - constexpr explicit zip_transform_view(_Func _Function_, _ViewTypes... _Views) noexcept( - is_nothrow_move_constructible_v<_Func> - && is_nothrow_constructible_v<_Inner_view, remove_reference_t<_ViewTypes>&&...>) // strengthened + constexpr explicit zip_transform_view(_Func _Function_, _ViewTypes... _Views) + noexcept(is_nothrow_move_constructible_v<_Func> + && is_nothrow_constructible_v<_Inner_view, remove_reference_t<_ViewTypes>&&...>) // strengthened : _Function(in_place, _STD move(_Function_)), _Zip(_STD move(_Views)...) {} _NODISCARD constexpr auto begin() noexcept(noexcept(_Iterator{*this, _Zip.begin()})) /* strengthened */ { @@ -8036,8 +8035,8 @@ namespace ranges { } template - constexpr _Iterator(_Iterator& _Other, index_sequence<_Indices...>) noexcept( - is_nothrow_convertible_v, _Base_iterator>) + constexpr _Iterator(_Iterator& _Other, index_sequence<_Indices...>) + noexcept(is_nothrow_convertible_v, _Base_iterator>) requires _Const && convertible_to, _Base_iterator> : _Current{_STD move(_Other._Current[_Indices])...} {} @@ -8050,8 +8049,8 @@ namespace ranges { _Iterator() = default; - constexpr _Iterator(_Iterator _Other) noexcept( - is_nothrow_convertible_v, _Base_iterator>) // strengthened + constexpr _Iterator(_Iterator _Other) + noexcept(is_nothrow_convertible_v, _Base_iterator>) // strengthened requires _Const && convertible_to, _Base_iterator> : _Iterator(_Other, make_index_sequence<_Nx>{}) {} @@ -8067,8 +8066,8 @@ namespace ranges { return *this; } - constexpr _Iterator operator++(int) noexcept( - noexcept(++*this) && is_nothrow_copy_constructible_v<_Iterator>) /* strengthened */ { + constexpr _Iterator operator++(int) + noexcept(noexcept(++*this) && is_nothrow_copy_constructible_v<_Iterator>) /* strengthened */ { auto _Tmp = *this; ++*this; return _Tmp; @@ -8083,8 +8082,8 @@ namespace ranges { return *this; } - constexpr _Iterator operator--(int) noexcept( - noexcept(--*this) && is_nothrow_copy_constructible_v<_Iterator>) // strengthened + constexpr _Iterator operator--(int) + noexcept(noexcept(--*this) && is_nothrow_copy_constructible_v<_Iterator>) // strengthened requires bidirectional_range<_Base> { auto _Tmp = *this; @@ -8092,8 +8091,8 @@ namespace ranges { return _Tmp; } - constexpr _Iterator& operator+=(const difference_type _Off) noexcept( - noexcept(_Current.back() += _Off)) // strengthened + constexpr _Iterator& operator+=(const difference_type _Off) + noexcept(noexcept(_Current.back() += _Off)) // strengthened requires random_access_range<_Base> { for (_Base_iterator& _It : _Current) { @@ -8102,8 +8101,8 @@ namespace ranges { return *this; } - constexpr _Iterator& operator-=(const difference_type _Off) noexcept( - noexcept(_Current.back() -= _Off)) // strengthened + constexpr _Iterator& operator-=(const difference_type _Off) + noexcept(noexcept(_Current.back() -= _Off)) // strengthened requires random_access_range<_Base> { for (_Base_iterator& _It : _Current) { @@ -8131,37 +8130,37 @@ namespace ranges { return _Left._Current.back() < _Right._Current.back(); } - _NODISCARD friend constexpr bool operator>(const _Iterator& _Left, const _Iterator& _Right) noexcept( - noexcept(_Right < _Left)) // strengthened + _NODISCARD friend constexpr bool operator>(const _Iterator& _Left, const _Iterator& _Right) + noexcept(noexcept(_Right < _Left)) // strengthened requires random_access_range<_Base> { return _Right < _Left; } - _NODISCARD friend constexpr bool operator<=(const _Iterator& _Left, const _Iterator& _Right) noexcept( - noexcept(!(_Right < _Left))) // strengthened + _NODISCARD friend constexpr bool operator<=(const _Iterator& _Left, const _Iterator& _Right) + noexcept(noexcept(!(_Right < _Left))) // strengthened requires random_access_range<_Base> { return !(_Right < _Left); } - _NODISCARD friend constexpr bool operator>=(const _Iterator& _Left, const _Iterator& _Right) noexcept( - noexcept(!(_Left < _Right))) // strengthened + _NODISCARD friend constexpr bool operator>=(const _Iterator& _Left, const _Iterator& _Right) + noexcept(noexcept(!(_Left < _Right))) // strengthened requires random_access_range<_Base> { return !(_Left < _Right); } - _NODISCARD friend constexpr auto operator<=>(const _Iterator& _Left, const _Iterator& _Right) noexcept( - noexcept(_Left._Current.back() <=> _Right._Current.back())) // strengthened + _NODISCARD friend constexpr auto operator<=>(const _Iterator& _Left, const _Iterator& _Right) + noexcept(noexcept(_Left._Current.back() <=> _Right._Current.back())) // strengthened requires random_access_range<_Base> && three_way_comparable<_Base_iterator> { return _Left._Current.back() <=> _Right._Current.back(); } - _NODISCARD friend constexpr _Iterator operator+(const _Iterator& _It, const difference_type _Off) noexcept( - noexcept(_STD declval<_Iterator&>() += _Off) - && is_nothrow_copy_constructible_v<_Iterator>) // strengthened + _NODISCARD friend constexpr _Iterator operator+(const _Iterator& _It, const difference_type _Off) + noexcept(noexcept(_STD declval<_Iterator&>() += _Off) + && is_nothrow_copy_constructible_v<_Iterator>) // strengthened requires random_access_range<_Base> { auto _Tmp = _It; @@ -8169,9 +8168,9 @@ namespace ranges { return _Tmp; } - _NODISCARD friend constexpr _Iterator operator+(const difference_type _Off, const _Iterator& _It) noexcept( - noexcept(_STD declval<_Iterator&>() += _Off) - && is_nothrow_copy_constructible_v<_Iterator>) // strengthened + _NODISCARD friend constexpr _Iterator operator+(const difference_type _Off, const _Iterator& _It) + noexcept(noexcept(_STD declval<_Iterator&>() += _Off) + && is_nothrow_copy_constructible_v<_Iterator>) // strengthened requires random_access_range<_Base> { auto _Tmp = _It; @@ -8179,9 +8178,9 @@ namespace ranges { return _Tmp; } - _NODISCARD friend constexpr _Iterator operator-(const _Iterator& _It, const difference_type _Off) noexcept( - noexcept(_STD declval<_Iterator&>() -= _Off) - && is_nothrow_copy_constructible_v<_Iterator>) // strengthened + _NODISCARD friend constexpr _Iterator operator-(const _Iterator& _It, const difference_type _Off) + noexcept(noexcept(_STD declval<_Iterator&>() -= _Off) + && is_nothrow_copy_constructible_v<_Iterator>) // strengthened requires random_access_range<_Base> { auto _Tmp = _It; @@ -8189,22 +8188,21 @@ namespace ranges { return _Tmp; } - _NODISCARD friend constexpr difference_type - operator-(const _Iterator& _Left, const _Iterator& _Right) noexcept( - noexcept(_Left._Current.back() - _Right._Current.back())) // strengthened + _NODISCARD friend constexpr difference_type operator-(const _Iterator& _Left, const _Iterator& _Right) + noexcept(noexcept(_Left._Current.back() - _Right._Current.back())) // strengthened requires sized_sentinel_for<_Base_iterator, _Base_iterator> { return _Left._Current.back() - _Right._Current.back(); } - _NODISCARD friend constexpr auto iter_move(const _Iterator& _It) noexcept( - noexcept(_RANGES iter_move(_STD declval())) - && is_nothrow_move_constructible_v>) { + _NODISCARD friend constexpr auto iter_move(const _Iterator& _It) + noexcept(noexcept(_RANGES iter_move(_STD declval())) + && is_nothrow_move_constructible_v>) { return _RANGES _Tuple_transform(_RANGES iter_move, _It._Current); } - friend constexpr void iter_swap(const _Iterator& _Left, const _Iterator& _Right) noexcept( - noexcept(_RANGES iter_swap(_STD declval<_Base_iterator>(), _STD declval<_Base_iterator>()))) + friend constexpr void iter_swap(const _Iterator& _Left, const _Iterator& _Right) + noexcept(noexcept(_RANGES iter_swap(_STD declval<_Base_iterator>(), _STD declval<_Base_iterator>()))) requires indirectly_swappable<_Base_iterator> { for (size_t _Ix = 0; _Ix < _Nx; ++_Ix) { @@ -8223,8 +8221,8 @@ namespace ranges { /* [[no_unique_address]] */ _Base_sentinel _End{}; - constexpr explicit _Sentinel(_Base_sentinel _Last_) noexcept( - is_nothrow_move_constructible_v<_Base_sentinel>) // strengthened + constexpr explicit _Sentinel(_Base_sentinel _Last_) + noexcept(is_nothrow_move_constructible_v<_Base_sentinel>) // strengthened : _End(_STD move(_Last_)) {} template @@ -8244,15 +8242,15 @@ namespace ranges { public: _Sentinel() = default; - constexpr _Sentinel(_Sentinel _Other) noexcept( - is_nothrow_convertible_v, _Base_sentinel>) // strengthened + constexpr _Sentinel(_Sentinel _Other) + noexcept(is_nothrow_convertible_v, _Base_sentinel>) // strengthened requires _Const && convertible_to, _Base_sentinel> : _End(_STD move(_Other._End)) {} template requires sentinel_for<_Base_sentinel, iterator_t<_Maybe_const<_OtherConst, _Vw>>> - _NODISCARD friend constexpr bool operator==(const _Iterator<_OtherConst>& _It, - const _Sentinel& _Se) noexcept(noexcept(_Se._Equal(_It))) /* strengthened */ { + _NODISCARD friend constexpr bool operator==(const _Iterator<_OtherConst>& _It, const _Sentinel& _Se) + noexcept(noexcept(_Se._Equal(_It))) /* strengthened */ { return _Se._Equal(_It); } @@ -8411,8 +8409,8 @@ namespace ranges { _Parent_t* _Parent = nullptr; _Inner_iterator<_Const> _Inner; - constexpr _Iterator(_Parent_t& _Parent_, _Inner_iterator<_Const> _Inner_) noexcept( - is_nothrow_move_constructible_v<_Inner_iterator<_Const>>) // strengthened + constexpr _Iterator(_Parent_t& _Parent_, _Inner_iterator<_Const> _Inner_) + noexcept(is_nothrow_move_constructible_v<_Inner_iterator<_Const>>) // strengthened : _Parent(_STD addressof(_Parent_)), _Inner(_STD move(_Inner_)) {} _NODISCARD static consteval auto _Get_iterator_category() noexcept { @@ -8465,8 +8463,8 @@ namespace ranges { return *this; } - constexpr _Iterator operator++(int) noexcept( - noexcept(++*this) && is_nothrow_copy_constructible_v<_Iterator>) /* strengthened */ { + constexpr _Iterator operator++(int) + noexcept(noexcept(++*this) && is_nothrow_copy_constructible_v<_Iterator>) /* strengthened */ { auto _Tmp = *this; ++*this; return _Tmp; @@ -8479,8 +8477,8 @@ namespace ranges { return *this; } - constexpr _Iterator operator--(int) noexcept( - noexcept(--*this) && is_nothrow_copy_constructible_v<_Iterator>) // strengthened + constexpr _Iterator operator--(int) + noexcept(noexcept(--*this) && is_nothrow_copy_constructible_v<_Iterator>) // strengthened requires bidirectional_range<_Base> { auto _Tmp = *this; @@ -8488,16 +8486,16 @@ namespace ranges { return _Tmp; } - constexpr _Iterator& operator+=(const difference_type _Off) noexcept( - noexcept(_Inner += _Off)) // strengthened + constexpr _Iterator& operator+=(const difference_type _Off) + noexcept(noexcept(_Inner += _Off)) // strengthened requires random_access_range<_Base> { _Inner += _Off; return *this; } - constexpr _Iterator& operator-=(const difference_type _Off) noexcept( - noexcept(_Inner -= _Off)) // strengthened + constexpr _Iterator& operator-=(const difference_type _Off) + noexcept(noexcept(_Inner -= _Off)) // strengthened requires random_access_range<_Base> { _Inner -= _Off; @@ -8514,41 +8512,41 @@ namespace ranges { _Inner._Current); } - _NODISCARD friend constexpr bool operator==(const _Iterator& _Left, const _Iterator& _Right) noexcept( - noexcept(_Left._Inner == _Right._Inner)) /* strengthened */ { + _NODISCARD friend constexpr bool operator==(const _Iterator& _Left, const _Iterator& _Right) + noexcept(noexcept(_Left._Inner == _Right._Inner)) /* strengthened */ { return _Left._Inner == _Right._Inner; } - _NODISCARD friend constexpr bool operator<(const _Iterator& _Left, const _Iterator& _Right) noexcept( - noexcept(_Left._Inner < _Right._Inner)) // strengthened + _NODISCARD friend constexpr bool operator<(const _Iterator& _Left, const _Iterator& _Right) + noexcept(noexcept(_Left._Inner < _Right._Inner)) // strengthened requires random_access_range<_Base> { return _Left._Inner < _Right._Inner; } - _NODISCARD friend constexpr bool operator>(const _Iterator& _Left, const _Iterator& _Right) noexcept( - noexcept(_Left._Inner > _Right._Inner)) // strengthened + _NODISCARD friend constexpr bool operator>(const _Iterator& _Left, const _Iterator& _Right) + noexcept(noexcept(_Left._Inner > _Right._Inner)) // strengthened requires random_access_range<_Base> { return _Left._Inner > _Right._Inner; } - _NODISCARD friend constexpr bool operator<=(const _Iterator& _Left, const _Iterator& _Right) noexcept( - noexcept(_Left._Inner <= _Right._Inner)) // strengthened + _NODISCARD friend constexpr bool operator<=(const _Iterator& _Left, const _Iterator& _Right) + noexcept(noexcept(_Left._Inner <= _Right._Inner)) // strengthened requires random_access_range<_Base> { return _Left._Inner <= _Right._Inner; } - _NODISCARD friend constexpr bool operator>=(const _Iterator& _Left, const _Iterator& _Right) noexcept( - noexcept(_Left._Inner >= _Right._Inner)) // strengthened + _NODISCARD friend constexpr bool operator>=(const _Iterator& _Left, const _Iterator& _Right) + noexcept(noexcept(_Left._Inner >= _Right._Inner)) // strengthened requires random_access_range<_Base> { return _Left._Inner >= _Right._Inner; } - _NODISCARD friend constexpr auto operator<=>(const _Iterator& _Left, const _Iterator& _Right) noexcept( - noexcept(_Left._Inner <=> _Right._Inner)) // strengthened + _NODISCARD friend constexpr auto operator<=>(const _Iterator& _Left, const _Iterator& _Right) + noexcept(noexcept(_Left._Inner <=> _Right._Inner)) // strengthened requires random_access_range<_Base> && three_way_comparable<_Inner_iterator<_Const>> { return _Left._Inner <=> _Right._Inner; @@ -8615,8 +8613,8 @@ namespace ranges { template requires sentinel_for<_Inner_sentinel<_Const>, _Inner_iterator<_OtherConst>> - _NODISCARD friend constexpr bool operator==(const _Iterator<_OtherConst>& _It, - const _Sentinel& _Se) noexcept(noexcept(_Se._Equal(_It))) /* strengthened */ { + _NODISCARD friend constexpr bool operator==(const _Iterator<_OtherConst>& _It, const _Sentinel& _Se) + noexcept(noexcept(_Se._Equal(_It))) /* strengthened */ { return _Se._Equal(_It); } @@ -8640,8 +8638,8 @@ namespace ranges { public: adjacent_transform_view() = default; - constexpr explicit adjacent_transform_view(_Vw _Range_, _Fn _Func_) noexcept( - is_nothrow_move_constructible_v<_Vw> && is_nothrow_move_constructible_v<_Fn>) // strengthened + constexpr explicit adjacent_transform_view(_Vw _Range_, _Fn _Func_) + noexcept(is_nothrow_move_constructible_v<_Vw> && is_nothrow_move_constructible_v<_Fn>) // strengthened : _Func(in_place, _STD move(_Func_)), _Inner(_STD move(_Range_)) {} _NODISCARD constexpr _Vw base() const& noexcept(noexcept(_Inner.base())) // strengthened @@ -9090,13 +9088,13 @@ namespace ranges { return -(_It - _Se); } - _NODISCARD friend constexpr auto iter_move(const _Iterator& _It) noexcept( - _Is_iter_move_nothrow(make_index_sequence<1 + sizeof...(_Rest)>{})) { + _NODISCARD friend constexpr auto iter_move(const _Iterator& _It) + noexcept(_Is_iter_move_nothrow(make_index_sequence<1 + sizeof...(_Rest)>{})) { return _RANGES _Tuple_transform(_RANGES iter_move, _It._Current); } - friend constexpr void iter_swap(const _Iterator& _Left, const _Iterator& _Right) noexcept( - _Is_iter_swap_nothrow(make_index_sequence<1 + sizeof...(_Rest)>{})) + friend constexpr void iter_swap(const _Iterator& _Left, const _Iterator& _Right) + noexcept(_Is_iter_swap_nothrow(make_index_sequence<1 + sizeof...(_Rest)>{})) requires (indirectly_swappable>> && ... && indirectly_swappable>>) { diff --git a/stl/inc/regex b/stl/inc/regex index 587c3b6055..06cf594662 100644 --- a/stl/inc/regex +++ b/stl/inc/regex @@ -2067,8 +2067,8 @@ void swap(basic_regex<_Elem, _RxTraits>& _Left, basic_regex<_Elem, _RxTraits>& _ } _EXPORT_STD template -void swap(match_results<_BidIt, _Alloc>& _Left, match_results<_BidIt, _Alloc>& _Right) noexcept( - noexcept(_Left.swap(_Right))) /* strengthened */ { +void swap(match_results<_BidIt, _Alloc>& _Left, match_results<_BidIt, _Alloc>& _Right) + noexcept(noexcept(_Left.swap(_Right))) /* strengthened */ { _Left.swap(_Right); } diff --git a/stl/inc/set b/stl/inc/set index 02f8edc052..5e049118ad 100644 --- a/stl/inc/set +++ b/stl/inc/set @@ -351,8 +351,8 @@ public: multiset(multiset&& _Right, const allocator_type& _Al) : _Mybase(_STD move(_Right), _Al) {} - multiset& operator=(multiset&& _Right) noexcept( - _Alnode_traits::is_always_equal::value && is_nothrow_move_assignable_v<_Pr>) { + multiset& operator=(multiset&& _Right) + noexcept(_Alnode_traits::is_always_equal::value && is_nothrow_move_assignable_v<_Pr>) { _Mybase::operator=(_STD move(_Right)); return *this; } @@ -462,8 +462,8 @@ _NODISCARD bool operator>=(const multiset<_Kty, _Pr, _Alloc>& _Left, const multi #endif // ^^^ !_HAS_CXX20 ^^^ _EXPORT_STD template -void swap(multiset<_Kty, _Pr, _Alloc>& _Left, multiset<_Kty, _Pr, _Alloc>& _Right) noexcept( - noexcept(_Left.swap(_Right))) { +void swap(multiset<_Kty, _Pr, _Alloc>& _Left, multiset<_Kty, _Pr, _Alloc>& _Right) + noexcept(noexcept(_Left.swap(_Right))) { _Left.swap(_Right); } diff --git a/stl/inc/span b/stl/inc/span index d30d805d10..de9d6909bf 100644 --- a/stl/inc/span +++ b/stl/inc/span @@ -304,8 +304,8 @@ public: } template <_Span_compatible_iterator _It, _Span_compatible_sentinel<_It> _Sentinel> - constexpr explicit(_Extent != dynamic_extent) - span(_It _First, _Sentinel _Last) noexcept(noexcept(_Last - _First)) // strengthened + constexpr explicit(_Extent != dynamic_extent) span(_It _First, _Sentinel _Last) + noexcept(noexcept(_Last - _First)) // strengthened : _Mybase(_STD to_address(_First), static_cast(_Last - _First)) { _STD _Adl_verify_range(_First, _Last); #if _CONTAINER_DEBUG_LEVEL > 0 diff --git a/stl/inc/sstream b/stl/inc/sstream index 338f3f41cd..83e7ad49aa 100644 --- a/stl/inc/sstream +++ b/stl/inc/sstream @@ -85,8 +85,8 @@ public: _Mysb::swap(_Right); } - basic_stringbuf& operator=(basic_stringbuf&& _Right) noexcept( - _Choose_pocma_v<_Alloc> != _Pocma_values::_No_propagate_allocators) /* strengthened */ { + basic_stringbuf& operator=(basic_stringbuf&& _Right) + noexcept(_Choose_pocma_v<_Alloc> != _Pocma_values::_No_propagate_allocators) /* strengthened */ { if (this != _STD addressof(_Right)) { _Assign_rv_no_alias(_STD move(_Right)); } @@ -135,8 +135,8 @@ public: _Right._Tidy(); } - void _Assign_rv_no_alias(basic_stringbuf&& _Right) noexcept( - _Choose_pocma_v<_Alloc> != _Pocma_values::_No_propagate_allocators) { + void _Assign_rv_no_alias(basic_stringbuf&& _Right) + noexcept(_Choose_pocma_v<_Alloc> != _Pocma_values::_No_propagate_allocators) { // pre: this != std::addressof(_Right) _Tidy(); if constexpr (_Choose_pocma_v<_Alloc> == _Pocma_values::_No_propagate_allocators) { @@ -654,8 +654,8 @@ public: : _Mybase(_STD addressof(_Stringbuffer)), _Stringbuffer((_Mybase::swap(_Right), _STD move(_Right._Stringbuffer))) {} - basic_istringstream& operator=(basic_istringstream&& _Right) noexcept( - _Choose_pocma_v<_Alloc> != _Pocma_values::_No_propagate_allocators) /* strengthened */ { + basic_istringstream& operator=(basic_istringstream&& _Right) + noexcept(_Choose_pocma_v<_Alloc> != _Pocma_values::_No_propagate_allocators) /* strengthened */ { if (this != _STD addressof(_Right)) { _Mybase::swap(_Right); _Stringbuffer._Assign_rv_no_alias(_STD move(_Right._Stringbuffer)); @@ -773,8 +773,8 @@ public: : _Mybase(_STD addressof(_Stringbuffer)), _Stringbuffer((_Mybase::swap(_Right), _STD move(_Right._Stringbuffer))) {} - basic_ostringstream& operator=(basic_ostringstream&& _Right) noexcept( - _Choose_pocma_v<_Alloc> != _Pocma_values::_No_propagate_allocators) /* strengthened */ { + basic_ostringstream& operator=(basic_ostringstream&& _Right) + noexcept(_Choose_pocma_v<_Alloc> != _Pocma_values::_No_propagate_allocators) /* strengthened */ { if (this != _STD addressof(_Right)) { _Mybase::swap(_Right); _Stringbuffer._Assign_rv_no_alias(_STD move(_Right._Stringbuffer)); @@ -898,8 +898,8 @@ public: : _Mybase(_STD addressof(_Stringbuffer)), _Stringbuffer((_Mybase::swap(_Right), _STD move(_Right._Stringbuffer))) {} - basic_stringstream& operator=(basic_stringstream&& _Right) noexcept( - _Choose_pocma_v<_Alloc> != _Pocma_values::_No_propagate_allocators) /* strengthened */ { + basic_stringstream& operator=(basic_stringstream&& _Right) + noexcept(_Choose_pocma_v<_Alloc> != _Pocma_values::_No_propagate_allocators) /* strengthened */ { if (this != _STD addressof(_Right)) { _Mybase::swap(_Right); _Stringbuffer._Assign_rv_no_alias(_STD move(_Right._Stringbuffer)); diff --git a/stl/inc/stack b/stl/inc/stack index 0993120233..02c404594c 100644 --- a/stl/inc/stack +++ b/stl/inc/stack @@ -60,23 +60,23 @@ public: stack(const _Container& _Cont, const _Alloc& _Al) : c(_Cont, _Al) {} template , int> = 0> - stack(_Container&& _Cont, const _Alloc& _Al) noexcept( - is_nothrow_constructible_v<_Container, _Container, const _Alloc&>) // strengthened + stack(_Container&& _Cont, const _Alloc& _Al) + noexcept(is_nothrow_constructible_v<_Container, _Container, const _Alloc&>) // strengthened : c(_STD move(_Cont), _Al) {} template , int> = 0> stack(const stack& _Right, const _Alloc& _Al) : c(_Right.c, _Al) {} template , int> = 0> - stack(stack&& _Right, const _Alloc& _Al) noexcept( - is_nothrow_constructible_v<_Container, _Container, const _Alloc&>) // strengthened + stack(stack&& _Right, const _Alloc& _Al) + noexcept(is_nothrow_constructible_v<_Container, _Container, const _Alloc&>) // strengthened : c(_STD move(_Right.c), _Al) {} #if _HAS_CXX23 template <_Iterator_for_container _InIt, class _Alloc> requires uses_allocator_v<_Container, _Alloc> - stack(_InIt _First, _InIt _Last, const _Alloc& _Al) noexcept( - is_nothrow_constructible_v<_Container, _InIt, _InIt, const _Alloc&>) // strengthened + stack(_InIt _First, _InIt _Last, const _Alloc& _Al) + noexcept(is_nothrow_constructible_v<_Container, _InIt, _InIt, const _Alloc&>) // strengthened : c(_STD move(_First), _STD move(_Last), _Al) {} template <_Container_compatible_range<_Ty> _Rng, class _Alloc> diff --git a/stl/inc/stacktrace b/stl/inc/stacktrace index 682f978f92..a4e5e838fc 100644 --- a/stl/inc/stacktrace +++ b/stl/inc/stacktrace @@ -46,8 +46,8 @@ _NODISCARD unsigned short __stdcall __std_stacktrace_capture(unsigned long _Fram // Some of these functions may throw // (they would propagate bad_alloc potentially thrown from string::resize_and_overwrite) -void __stdcall __std_stacktrace_address_to_string( - const void* _Address, void* _Str, _Stacktrace_string_fill _Fill) noexcept(false); +void __stdcall __std_stacktrace_address_to_string(const void* _Address, void* _Str, _Stacktrace_string_fill _Fill) + noexcept(false); void __stdcall __std_stacktrace_description( // const void* _Address, void* _Str, _Stacktrace_string_fill _Fill) noexcept(false); diff --git a/stl/inc/stop_token b/stl/inc/stop_token index 6e37adb015..7444a69048 100644 --- a/stl/inc/stop_token +++ b/stl/inc/stop_token @@ -359,16 +359,16 @@ public: template requires is_constructible_v<_Callback, _CbInitTy> - explicit stop_callback(const stop_token& _Token, _CbInitTy&& _Cb_) noexcept( - is_nothrow_constructible_v<_Callback, _CbInitTy>) + explicit stop_callback(const stop_token& _Token, _CbInitTy&& _Cb_) + noexcept(is_nothrow_constructible_v<_Callback, _CbInitTy>) : _Stop_callback_base{_Invoke_by_stop}, _Cb(_STD forward<_CbInitTy>(_Cb_)) { _Attach(_Token); } template requires is_constructible_v<_Callback, _CbInitTy> - explicit stop_callback(stop_token&& _Token, _CbInitTy&& _Cb_) noexcept( - is_nothrow_constructible_v<_Callback, _CbInitTy>) + explicit stop_callback(stop_token&& _Token, _CbInitTy&& _Cb_) + noexcept(is_nothrow_constructible_v<_Callback, _CbInitTy>) : _Stop_callback_base{_Invoke_by_stop}, _Cb(_STD forward<_CbInitTy>(_Cb_)) { _Attach(_STD move(_Token)); } diff --git a/stl/inc/tuple b/stl/inc/tuple index da30037785..720b833129 100644 --- a/stl/inc/tuple +++ b/stl/inc/tuple @@ -334,17 +334,19 @@ public: : _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 + 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 + 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; @@ -354,60 +356,57 @@ public: template , _STD _Tuple_convert_val&, _Other...>>, int> = 0> - constexpr explicit(_Tuple_conditional_explicit_v) - tuple(tuple<_Other...>& _Right) noexcept(_Tuple_nothrow_constructible_v) // strengthened + 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 + 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 + 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 + 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 + 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(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 + 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(const pair<_First, _Second>&& _Right) + noexcept(_Tuple_nothrow_constructible_v) // strengthened : tuple(_Unpack_tuple_t{}, _STD move(_Right)) {} template > @@ -569,8 +568,8 @@ public: enable_if_t, _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>...>) { + _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; @@ -592,8 +591,8 @@ public: template >>, _STD _Tuple_assignable_val>, int> = 0> - _CONSTEXPR20 tuple& operator=(const tuple<_Other...>& _Right) noexcept( - _Tuple_nothrow_assignable_v) /* strengthened */ { + _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; @@ -613,8 +612,8 @@ public: template >>, _STD _Tuple_assignable_val>, int> = 0> - _CONSTEXPR20 tuple& operator=(tuple<_Other...>&& _Right) noexcept( - _Tuple_nothrow_assignable_v) /* strengthened */ { + _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; @@ -633,8 +632,8 @@ public: template , int> = 0> - _CONSTEXPR20 tuple& operator=(const pair<_First, _Second>& _Right) noexcept( - _Tuple_nothrow_assignable_v) /* strengthened */ { + _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; @@ -652,8 +651,8 @@ public: #endif // _HAS_CXX23 template , int> = 0> - _CONSTEXPR20 tuple& operator=(pair<_First, _Second>&& _Right) noexcept( - _Tuple_nothrow_assignable_v) /* strengthened */ { + _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; @@ -711,8 +710,8 @@ public: } #endif // _HAS_CXX23 - _CONSTEXPR20 void swap(tuple& _Right) noexcept( - conjunction_v<_Is_nothrow_swappable<_This>, _Is_nothrow_swappable<_Rest>...>) { + _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()); @@ -895,8 +894,8 @@ _CONSTEXPR20 void swap(tuple<_Types...>& _Left, tuple<_Types...>& _Right) noexce #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))) { +constexpr void swap(const tuple<_Types...>& _Left, const tuple<_Types...>& _Right) + noexcept(noexcept(_Left.swap(_Right))) { _Left.swap(_Right); } #endif // _HAS_CXX23 @@ -1059,8 +1058,8 @@ 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))...))) { +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))...); } @@ -1069,8 +1068,8 @@ _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), +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>>{}); @@ -1083,8 +1082,8 @@ 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)))...>) { +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))...); } diff --git a/stl/inc/type_traits b/stl/inc/type_traits index 6fa346c45f..c8a9246f2e 100644 --- a/stl/inc/type_traits +++ b/stl/inc/type_traits @@ -1596,8 +1596,8 @@ struct _Invoker_functor { static constexpr _Invoker_strategy _Strategy = _Invoker_strategy::_Functor; template - static constexpr auto _Call(_Callable&& _Obj, _Types&&... _Args) noexcept( - noexcept(static_cast<_Callable&&>(_Obj)(static_cast<_Types&&>( + static constexpr auto _Call(_Callable&& _Obj, _Types&&... _Args) + noexcept(noexcept(static_cast<_Callable&&>(_Obj)(static_cast<_Types&&>( _Args)...))) -> decltype(static_cast<_Callable&&>(_Obj)(static_cast<_Types&&>(_Args)...)) { return static_cast<_Callable&&>(_Obj)(static_cast<_Types&&>(_Args)...); } @@ -1607,8 +1607,8 @@ struct _Invoker_pmf_object { static constexpr _Invoker_strategy _Strategy = _Invoker_strategy::_Pmf_object; template - static constexpr auto _Call(_Decayed _Pmf, _Ty1&& _Arg1, _Types2&&... _Args2) noexcept( - noexcept((static_cast<_Ty1&&>(_Arg1).*_Pmf)(static_cast<_Types2&&>( + static constexpr auto _Call(_Decayed _Pmf, _Ty1&& _Arg1, _Types2&&... _Args2) + noexcept(noexcept((static_cast<_Ty1&&>(_Arg1).*_Pmf)(static_cast<_Types2&&>( _Args2)...))) -> decltype((static_cast<_Ty1&&>(_Arg1).*_Pmf)(static_cast<_Types2&&>(_Args2)...)) { return (static_cast<_Ty1&&>(_Arg1).*_Pmf)(static_cast<_Types2&&>(_Args2)...); } @@ -1628,8 +1628,8 @@ struct _Invoker_pmf_pointer { static constexpr _Invoker_strategy _Strategy = _Invoker_strategy::_Pmf_pointer; template - static constexpr auto _Call(_Decayed _Pmf, _Ty1&& _Arg1, _Types2&&... _Args2) noexcept( - noexcept(((*static_cast<_Ty1&&>(_Arg1)).*_Pmf)(static_cast<_Types2&&>( + static constexpr auto _Call(_Decayed _Pmf, _Ty1&& _Arg1, _Types2&&... _Args2) + noexcept(noexcept(((*static_cast<_Ty1&&>(_Arg1)).*_Pmf)(static_cast<_Types2&&>( _Args2)...))) -> decltype(((*static_cast<_Ty1&&>(_Arg1)).*_Pmf)(static_cast<_Types2&&>(_Args2)...)) { return ((*static_cast<_Ty1&&>(_Arg1)).*_Pmf)(static_cast<_Types2&&>(_Args2)...); } @@ -1657,8 +1657,8 @@ struct _Invoker_pmd_pointer { static constexpr _Invoker_strategy _Strategy = _Invoker_strategy::_Pmd_pointer; template - static constexpr auto _Call(_Decayed _Pmd, _Ty1&& _Arg1) noexcept( - noexcept((*static_cast<_Ty1&&>(_Arg1)).*_Pmd)) -> decltype((*static_cast<_Ty1&&>(_Arg1)).*_Pmd) { + static constexpr auto _Call(_Decayed _Pmd, _Ty1&& _Arg1) + noexcept(noexcept((*static_cast<_Ty1&&>(_Arg1)).*_Pmd)) -> decltype((*static_cast<_Ty1&&>(_Arg1)).*_Pmd) { return (*static_cast<_Ty1&&>(_Arg1)).*_Pmd; } }; @@ -1689,8 +1689,8 @@ template struct _Invoker1<_Callable, _Ty1, _Removed_cvref, false, false> : _Invoker_functor {}; _EXPORT_STD template -constexpr auto invoke(_Callable&& _Obj) noexcept( - noexcept(static_cast<_Callable&&>(_Obj)())) -> decltype(static_cast<_Callable&&>(_Obj)()) { +constexpr auto invoke(_Callable&& _Obj) + noexcept(noexcept(static_cast<_Callable&&>(_Obj)())) -> decltype(static_cast<_Callable&&>(_Obj)()) { return static_cast<_Callable&&>(_Obj)(); } diff --git a/stl/inc/unordered_map b/stl/inc/unordered_map index b9308cbaf8..b8aff218ae 100644 --- a/stl/inc/unordered_map +++ b/stl/inc/unordered_map @@ -249,9 +249,9 @@ public: unordered_map(unordered_map&& _Right, const allocator_type& _Al) : _Mybase(_STD move(_Right), _Al) {} - unordered_map& operator=(unordered_map&& _Right) noexcept(_Alnode_traits::is_always_equal::value - && is_nothrow_move_assignable_v<_Hasher> - && is_nothrow_move_assignable_v<_Keyeq>) { + unordered_map& operator=(unordered_map&& _Right) + noexcept(_Alnode_traits::is_always_equal::value + && is_nothrow_move_assignable_v<_Hasher> && is_nothrow_move_assignable_v<_Keyeq>) { _Mybase::operator=(_STD move(_Right)); return *this; } @@ -739,9 +739,9 @@ public: unordered_multimap(unordered_multimap&& _Right, const allocator_type& _Al) : _Mybase(_STD move(_Right), _Al) {} - unordered_multimap& operator=(unordered_multimap&& _Right) noexcept(_Alnode_traits::is_always_equal::value - && is_nothrow_move_assignable_v<_Hasher> - && is_nothrow_move_assignable_v<_Keyeq>) { + unordered_multimap& operator=(unordered_multimap&& _Right) + noexcept(_Alnode_traits::is_always_equal::value + && is_nothrow_move_assignable_v<_Hasher> && is_nothrow_move_assignable_v<_Keyeq>) { _Mybase::operator=(_STD move(_Right)); return *this; } diff --git a/stl/inc/unordered_set b/stl/inc/unordered_set index 67f174b8d9..7e49770386 100644 --- a/stl/inc/unordered_set +++ b/stl/inc/unordered_set @@ -245,9 +245,9 @@ public: unordered_set(unordered_set&& _Right, const allocator_type& _Al) : _Mybase(_STD move(_Right), _Al) {} - unordered_set& operator=(unordered_set&& _Right) noexcept(_Alnode_traits::is_always_equal::value - && is_nothrow_move_assignable_v<_Hasher> - && is_nothrow_move_assignable_v<_Keyeq>) { + unordered_set& operator=(unordered_set&& _Right) + noexcept(_Alnode_traits::is_always_equal::value + && is_nothrow_move_assignable_v<_Hasher> && is_nothrow_move_assignable_v<_Keyeq>) { _Mybase::operator=(_STD move(_Right)); return *this; } @@ -377,8 +377,8 @@ unordered_set(from_range_t, _Rng&&, _Guide_size_type_t<_Alloc>, _Hasher, #endif // _HAS_CXX17 _EXPORT_STD template -void swap(unordered_set<_Kty, _Hasher, _Keyeq, _Alloc>& _Left, - unordered_set<_Kty, _Hasher, _Keyeq, _Alloc>& _Right) noexcept(noexcept(_Left.swap(_Right))) { +void swap(unordered_set<_Kty, _Hasher, _Keyeq, _Alloc>& _Left, unordered_set<_Kty, _Hasher, _Keyeq, _Alloc>& _Right) + noexcept(noexcept(_Left.swap(_Right))) { _Left.swap(_Right); } @@ -589,9 +589,9 @@ public: } #endif // _HAS_CXX23 - unordered_multiset& operator=(unordered_multiset&& _Right) noexcept(_Alnode_traits::is_always_equal::value - && is_nothrow_move_assignable_v<_Hasher> - && is_nothrow_move_assignable_v<_Keyeq>) { + unordered_multiset& operator=(unordered_multiset&& _Right) + noexcept(_Alnode_traits::is_always_equal::value + && is_nothrow_move_assignable_v<_Hasher> && is_nothrow_move_assignable_v<_Keyeq>) { _Mybase::operator=(_STD move(_Right)); return *this; } diff --git a/stl/inc/utility b/stl/inc/utility index b8ed6ad7f0..c5f9265dcf 100644 --- a/stl/inc/utility +++ b/stl/inc/utility @@ -71,8 +71,8 @@ _NODISCARD constexpr const _Ty&(max) (const _Ty& _Left _MSVC_LIFETIMEBOUND, cons #pragma warning(disable : 28285) // (syntax error in SAL annotation, occurs when _Ty is not an integral type) _EXPORT_STD template _NODISCARD _Post_equal_to_(_Left < _Right ? _Right : _Left) constexpr const _Ty& // - (max) (const _Ty& _Left _MSVC_LIFETIMEBOUND, const _Ty& _Right _MSVC_LIFETIMEBOUND) noexcept( - noexcept(_Left < _Right)) /* strengthened */ { + (max) (const _Ty& _Left _MSVC_LIFETIMEBOUND, const _Ty& _Right _MSVC_LIFETIMEBOUND) + noexcept(noexcept(_Left < _Right)) /* strengthened */ { // return larger of _Left and _Right return _Left < _Right ? _Right : _Left; } @@ -95,8 +95,8 @@ _NODISCARD constexpr const _Ty&(min) (const _Ty& _Left _MSVC_LIFETIMEBOUND, cons #pragma warning(disable : 28285) // (syntax error in SAL annotation, occurs when _Ty is not an integral type) _EXPORT_STD template _NODISCARD _Post_equal_to_(_Right < _Left ? _Right : _Left) constexpr const _Ty& // - (min) (const _Ty& _Left _MSVC_LIFETIMEBOUND, const _Ty& _Right _MSVC_LIFETIMEBOUND) noexcept( - noexcept(_Right < _Left)) /* strengthened */ { + (min) (const _Ty& _Left _MSVC_LIFETIMEBOUND, const _Ty& _Right _MSVC_LIFETIMEBOUND) + noexcept(noexcept(_Right < _Left)) /* strengthened */ { // return smaller of _Left and _Right return _Right < _Left ? _Right : _Left; } @@ -125,8 +125,8 @@ _EXPORT_STD template && is_ #else // ^^^ _HAS_CXX17 / !_HAS_CXX17 vvv template #endif // ^^^ !_HAS_CXX17 ^^^ -_CONSTEXPR20 void swap(_Ty& _Left, _Ty& _Right) noexcept( - is_nothrow_move_constructible_v<_Ty> && is_nothrow_move_assignable_v<_Ty>) { +_CONSTEXPR20 void swap(_Ty& _Left, _Ty& _Right) + noexcept(is_nothrow_move_constructible_v<_Ty> && is_nothrow_move_assignable_v<_Ty>) { _Ty _Tmp = _STD move(_Left); _Left = _STD move(_Right); _Right = _STD move(_Tmp); @@ -239,16 +239,15 @@ struct pair { // store a pair of values template , is_default_constructible<_Uty2>>, int> = 0> constexpr explicit( - !conjunction_v<_Is_implicitly_default_constructible<_Uty1>, _Is_implicitly_default_constructible<_Uty2>>) - pair() noexcept( - is_nothrow_default_constructible_v<_Uty1> && is_nothrow_default_constructible_v<_Uty2>) // strengthened + !conjunction_v<_Is_implicitly_default_constructible<_Uty1>, _Is_implicitly_default_constructible<_Uty2>>) pair() + noexcept(is_nothrow_default_constructible_v<_Uty1> && is_nothrow_default_constructible_v<_Uty2>) // strengthened : first(), second() {} template , is_copy_constructible<_Uty2>>, int> = 0> constexpr explicit(!conjunction_v, is_convertible>) - pair(const _Ty1& _Val1, const _Ty2& _Val2) noexcept( - is_nothrow_copy_constructible_v<_Uty1> && is_nothrow_copy_constructible_v<_Uty2>) // strengthened + pair(const _Ty1& _Val1, const _Ty2& _Val2) + noexcept(is_nothrow_copy_constructible_v<_Uty1> && is_nothrow_copy_constructible_v<_Uty2>) // strengthened : first(_Val1), second(_Val2) {} #if _HAS_CXX23 @@ -279,9 +278,9 @@ struct pair { // store a pair of values enable_if_t, is_constructible<_Ty2, const _Other2&>>, int> = 0> constexpr explicit(!conjunction_v, is_convertible>) - pair(const pair<_Other1, _Other2>& _Right) noexcept( - is_nothrow_constructible_v<_Ty1, const _Other1&> - && is_nothrow_constructible_v<_Ty2, const _Other2&>) // strengthened + pair(const pair<_Other1, _Other2>& _Right) + noexcept(is_nothrow_constructible_v<_Ty1, const _Other1&> + && is_nothrow_constructible_v<_Ty2, const _Other2&>) // strengthened : first(_Right.first), second(_Right.second) {} template requires is_constructible_v<_Ty1, const _Other1> && is_constructible_v<_Ty2, const _Other2> constexpr explicit(!conjunction_v, is_convertible>) - pair(const pair<_Other1, _Other2>&& _Right) noexcept( - is_nothrow_constructible_v<_Ty1, const _Other1> - && is_nothrow_constructible_v<_Ty2, const _Other2>) // strengthened + pair(const pair<_Other1, _Other2>&& _Right) + noexcept(is_nothrow_constructible_v<_Ty1, const _Other1> + && is_nothrow_constructible_v<_Ty2, const _Other2>) // strengthened : first(_STD forward(_Right.first)), second(_STD forward(_Right.second)) {} #ifdef __EDG__ // TRANSITION, VSO-1900279 @@ -309,10 +308,9 @@ struct pair { // store a pair of values is_constructible<_Ty2, decltype(_STD get<1>(_STD declval<_Other>()))>> #endif // ^^^ no workaround ^^^ constexpr explicit(!conjunction_v(_STD declval<_Other>())), _Ty1>, - is_convertible(_STD declval<_Other>())), _Ty2>>) - pair(_Other&& _Right) noexcept( - is_nothrow_constructible_v<_Ty1, decltype(_STD get<0>(_STD declval<_Other>()))> - && is_nothrow_constructible_v<_Ty2, decltype(_STD get<1>(_STD declval<_Other>()))>) // strengthened + is_convertible(_STD declval<_Other>())), _Ty2>>) pair(_Other&& _Right) + noexcept(is_nothrow_constructible_v<_Ty1, decltype(_STD get<0>(_STD declval<_Other>()))> + && is_nothrow_constructible_v<_Ty2, decltype(_STD get<1>(_STD declval<_Other>()))>) // strengthened : first(_STD get<0>(_STD forward<_Other>(_Right))), second(_STD get<1>(_STD forward<_Other>(_Right))) { } #endif // _HAS_CXX23 @@ -332,8 +330,8 @@ struct pair { // store a pair of values enable_if_t, _Is_copy_assignable_no_precondition_check>, int> = 0> - _CONSTEXPR20 pair& operator=(_Identity_t _Right) noexcept( - conjunction_v, is_nothrow_copy_assignable<_Ty2>>) /* strengthened */ { + _CONSTEXPR20 pair& operator=(_Identity_t _Right) + noexcept(conjunction_v, is_nothrow_copy_assignable<_Ty2>>) /* strengthened */ { first = _Right.first; second = _Right.second; return *this; @@ -356,8 +354,8 @@ struct pair { // store a pair of values enable_if_t, _Is_move_assignable_no_precondition_check>, int> = 0> - _CONSTEXPR20 pair& operator=(_Identity_t<_Myself&&> _Right) noexcept( - conjunction_v, is_nothrow_move_assignable<_Ty2>>) /* strengthened */ { + _CONSTEXPR20 pair& operator=(_Identity_t<_Myself&&> _Right) + noexcept(conjunction_v, is_nothrow_move_assignable<_Ty2>>) /* strengthened */ { first = _STD forward<_Ty1>(_Right.first); second = _STD forward<_Ty2>(_Right.second); return *this; @@ -380,9 +378,9 @@ struct pair { // store a pair of values enable_if_t>>, is_assignable<_Ty1&, const _Other1&>, is_assignable<_Ty2&, const _Other2&>>, int> = 0> - _CONSTEXPR20 pair& operator=(const pair<_Other1, _Other2>& _Right) noexcept( - is_nothrow_assignable_v<_Ty1&, const _Other1&> - && is_nothrow_assignable_v<_Ty2&, const _Other2&>) /* strengthened */ { + _CONSTEXPR20 pair& operator=(const pair<_Other1, _Other2>& _Right) + noexcept(is_nothrow_assignable_v<_Ty1&, const _Other1&> + && is_nothrow_assignable_v<_Ty2&, const _Other2&>) /* strengthened */ { first = _Right.first; second = _Right.second; return *this; @@ -428,9 +426,9 @@ struct pair { // store a pair of values requires _Different_from<_Other, pair> && (!_Is_subrange_v>) && is_assignable_v<_Ty1&, decltype(_STD get<0>(_STD declval<_Other>()))> && is_assignable_v<_Ty2&, decltype(_STD get<1>(_STD declval<_Other>()))> - constexpr pair& operator=(_Other&& _Right) noexcept( - is_nothrow_assignable_v<_Ty1&, decltype(_STD get<0>(_STD declval<_Other>()))> - && is_nothrow_assignable_v<_Ty2&, decltype(_STD get<1>(_STD declval<_Other>()))>) /* strengthened */ { + constexpr pair& operator=(_Other&& _Right) + noexcept(is_nothrow_assignable_v<_Ty1&, decltype(_STD get<0>(_STD declval<_Other>()))> + && is_nothrow_assignable_v<_Ty2&, decltype(_STD get<1>(_STD declval<_Other>()))>) /* strengthened */ { first = _STD get<0>(_STD forward<_Other>(_Right)); second = _STD get<1>(_STD forward<_Other>(_Right)); return *this; @@ -449,8 +447,8 @@ struct pair { // store a pair of values } #endif // _HAS_CXX23 - _CONSTEXPR20 void swap(pair& _Right) noexcept( - _Is_nothrow_swappable<_Ty1>::value && _Is_nothrow_swappable<_Ty2>::value) { + _CONSTEXPR20 void swap(pair& _Right) + noexcept(_Is_nothrow_swappable<_Ty1>::value && _Is_nothrow_swappable<_Ty2>::value) { using _STD swap; swap(first, _Right.first); // intentional ADL swap(second, _Right.second); // intentional ADL @@ -484,8 +482,8 @@ _CONSTEXPR20 void swap(pair<_Ty1, _Ty2>& _Left, pair<_Ty1, _Ty2>& _Right) noexce #if _HAS_CXX23 _EXPORT_STD template requires is_swappable::value && is_swappable::value // TRANSITION, /permissive needs ::value -constexpr void swap(const pair<_Ty1, _Ty2>& _Left, const pair<_Ty1, _Ty2>& _Right) noexcept( - noexcept(_Left.swap(_Right))) { +constexpr void swap(const pair<_Ty1, _Ty2>& _Left, const pair<_Ty1, _Ty2>& _Right) + noexcept(noexcept(_Left.swap(_Right))) { _Left.swap(_Right); } #endif // _HAS_CXX23 @@ -564,9 +562,9 @@ template using _Unrefwrap_t = typename _Unrefwrap_helper>::type; _EXPORT_STD template -_NODISCARD constexpr pair<_Unrefwrap_t<_Ty1>, _Unrefwrap_t<_Ty2>> make_pair(_Ty1&& _Val1, _Ty2&& _Val2) noexcept( - is_nothrow_constructible_v<_Unrefwrap_t<_Ty1>, _Ty1> - && is_nothrow_constructible_v<_Unrefwrap_t<_Ty2>, _Ty2>) /* strengthened */ { +_NODISCARD constexpr pair<_Unrefwrap_t<_Ty1>, _Unrefwrap_t<_Ty2>> make_pair(_Ty1&& _Val1, _Ty2&& _Val2) + noexcept(is_nothrow_constructible_v<_Unrefwrap_t<_Ty1>, _Ty1> + && is_nothrow_constructible_v<_Unrefwrap_t<_Ty2>, _Ty2>) /* strengthened */ { // return pair composed from arguments using _Mypair = pair<_Unrefwrap_t<_Ty1>, _Unrefwrap_t<_Ty2>>; return _Mypair(_STD forward<_Ty1>(_Val1), _STD forward<_Ty2>(_Val2)); @@ -758,8 +756,8 @@ _NODISCARD constexpr const _Ty2&& get(const pair<_Ty1, _Ty2>&& _Pr) noexcept { } _EXPORT_STD template -_CONSTEXPR20 _Ty exchange(_Ty& _Val, _Other&& _New_val) noexcept( - conjunction_v, is_nothrow_assignable<_Ty&, _Other>>) { +_CONSTEXPR20 _Ty exchange(_Ty& _Val, _Other&& _New_val) + noexcept(conjunction_v, is_nothrow_assignable<_Ty&, _Other>>) { // assign _New_val to _Val, return previous _Val _Ty _Old_val = static_cast<_Ty&&>(_Val); _Val = static_cast<_Other&&>(_New_val); diff --git a/stl/inc/variant b/stl/inc/variant index b80a8b8636..ef2a1bf9a8 100644 --- a/stl/inc/variant +++ b/stl/inc/variant @@ -346,13 +346,13 @@ public: _CONSTEXPR20 _Variant_storage_() noexcept {} // no initialization (no active member) template - constexpr explicit _Variant_storage_(integral_constant, _Types&&... _Args) noexcept( - is_nothrow_constructible_v<_First, _Types...>) + constexpr explicit _Variant_storage_(integral_constant, _Types&&... _Args) + noexcept(is_nothrow_constructible_v<_First, _Types...>) : _Head(static_cast<_Types&&>(_Args)...) {} // initialize _Head with _Args... template 0), int> = 0> - constexpr explicit _Variant_storage_(integral_constant, _Types&&... _Args) noexcept( - is_nothrow_constructible_v<_Variant_storage<_Rest...>, integral_constant, _Types...>) + constexpr explicit _Variant_storage_(integral_constant, _Types&&... _Args) + noexcept(is_nothrow_constructible_v<_Variant_storage<_Rest...>, integral_constant, _Types...>) : _Tail(integral_constant{}, static_cast<_Types&&>(_Args)...) {} // initialize _Tail (recurse) _NODISCARD constexpr _First& _Get() & noexcept { @@ -390,13 +390,13 @@ public: _CONSTEXPR20 _Variant_storage_() noexcept {} // no initialization (no active member) template - constexpr explicit _Variant_storage_(integral_constant, _Types&&... _Args) noexcept( - is_nothrow_constructible_v<_First, _Types...>) + constexpr explicit _Variant_storage_(integral_constant, _Types&&... _Args) + noexcept(is_nothrow_constructible_v<_First, _Types...>) : _Head(static_cast<_Types&&>(_Args)...) {} // initialize _Head with _Args... template 0), int> = 0> - constexpr explicit _Variant_storage_(integral_constant, _Types&&... _Args) noexcept( - is_nothrow_constructible_v<_Variant_storage<_Rest...>, integral_constant, _Types...>) + constexpr explicit _Variant_storage_(integral_constant, _Types&&... _Args) + noexcept(is_nothrow_constructible_v<_Variant_storage<_Rest...>, integral_constant, _Types...>) : _Tail(integral_constant{}, static_cast<_Types&&>(_Args)...) {} // initialize _Tail (recurse) _Variant_storage_(_Variant_storage_&&) = default; @@ -447,13 +447,13 @@ public: _CONSTEXPR20 _Variant_storage_() noexcept {} // no initialization (no active member) template - constexpr explicit _Variant_storage_(integral_constant, _Types&&... _Args) noexcept( - is_nothrow_constructible_v<_First ^, _Types...>) + constexpr explicit _Variant_storage_(integral_constant, _Types&&... _Args) + noexcept(is_nothrow_constructible_v<_First ^, _Types...>) : _Head(static_cast<_Types&&>(_Args)...) {} // initialize _Head with _Args... template 0), int> = 0> - constexpr explicit _Variant_storage_(integral_constant, _Types&&... _Args) noexcept( - is_nothrow_constructible_v<_Variant_storage<_Rest...>, integral_constant, _Types...>) + constexpr explicit _Variant_storage_(integral_constant, _Types&&... _Args) + noexcept(is_nothrow_constructible_v<_Variant_storage<_Rest...>, integral_constant, _Types...>) : _Tail(integral_constant{}, static_cast<_Types&&>(_Args)...) {} // initialize _Tail (recurse) _Variant_storage_(_Variant_storage_&&) = default; @@ -530,16 +530,16 @@ template using _Variant_raw_visit_t = decltype(_STD declval<_Fn>()(_STD declval<_Variant_tagged_ref_t<_Storage, 0>>())); template -_NODISCARD constexpr _Variant_raw_visit_t<_Fn, _Storage> _Variant_raw_visit_dispatch( - _Fn&& _Func, _Storage&& _Var) noexcept(is_nothrow_invocable_v<_Fn, _Variant_tagged_ref_t<_Storage, _Idx>>) { +_NODISCARD constexpr _Variant_raw_visit_t<_Fn, _Storage> _Variant_raw_visit_dispatch(_Fn&& _Func, _Storage&& _Var) + noexcept(is_nothrow_invocable_v<_Fn, _Variant_tagged_ref_t<_Storage, _Idx>>) { // call _Func with the _Idx-th element in _Storage (tagged with _Idx) return static_cast<_Fn&&>(_Func)( _Variant_tagged_ref_t<_Storage, _Idx>{_STD _Variant_raw_get<_Idx>(static_cast<_Storage&&>(_Var))}); } template -_NODISCARD constexpr _Variant_raw_visit_t<_Fn, _Storage> _Variant_raw_visit_valueless( - _Fn&& _Func, _Storage&& _Obj) noexcept(is_nothrow_invocable_v<_Fn, _Tagged<_Storage&&, variant_npos>>) { +_NODISCARD constexpr _Variant_raw_visit_t<_Fn, _Storage> _Variant_raw_visit_valueless(_Fn&& _Func, _Storage&& _Obj) + noexcept(is_nothrow_invocable_v<_Fn, _Tagged<_Storage&&, variant_npos>>) { // call _Func with _Storage (tagged with variant_npos) return static_cast<_Fn&&>(_Func)(_Tagged<_Storage&&, variant_npos>{static_cast<_Storage&&>(_Obj)}); } @@ -559,8 +559,8 @@ struct _Variant_raw_dispatch_table1; // undefined template struct _Variant_raw_dispatch_table1<_Fn, _Storage, index_sequence<_Idxs...>> { // map from canonical index to visitation target - using _Dispatch_t = _Variant_raw_visit_t<_Fn, _Storage> (*)(_Fn&&, _Storage&&) noexcept( - _Variant_raw_visit_noexcept<_Fn, _Storage>); + using _Dispatch_t = _Variant_raw_visit_t<_Fn, _Storage> (*)(_Fn&&, _Storage&&) + noexcept(_Variant_raw_visit_noexcept<_Fn, _Storage>); static constexpr _Dispatch_t _Array[] = { &_STD _Variant_raw_visit_valueless<_Fn, _Storage>, &_STD _Variant_raw_visit_dispatch<_Idxs, _Fn, _Storage>...}; }; @@ -571,8 +571,8 @@ struct _Variant_raw_visit1; template <> struct _Variant_raw_visit1<-1> { // Fallback case for variants too large for any of the following "switch" strategies template - _NODISCARD static constexpr _Variant_raw_visit_t<_Fn, _Storage> _Visit( - size_t _Idx, _Fn&& _Func, _Storage&& _Obj) noexcept(_Variant_raw_visit_noexcept<_Fn, _Storage>) { + _NODISCARD static constexpr _Variant_raw_visit_t<_Fn, _Storage> _Visit(size_t _Idx, _Fn&& _Func, _Storage&& _Obj) + noexcept(_Variant_raw_visit_noexcept<_Fn, _Storage>) { // dispatch a visitor for a _Variant_storage with many states constexpr size_t _Size = remove_reference_t<_Storage>::_Size; static_assert(_Size > 256); @@ -605,8 +605,8 @@ struct _Variant_raw_visit1<-1> { // Fallback case for variants too large for any template <> struct _Variant_raw_visit1<1> { template - _NODISCARD static constexpr _Variant_raw_visit_t<_Fn, _Storage> _Visit( - size_t _Idx, _Fn&& _Func, _Storage&& _Obj) noexcept(_Variant_raw_visit_noexcept<_Fn, _Storage>) { + _NODISCARD static constexpr _Variant_raw_visit_t<_Fn, _Storage> _Visit(size_t _Idx, _Fn&& _Func, _Storage&& _Obj) + noexcept(_Variant_raw_visit_noexcept<_Fn, _Storage>) { // dispatch a visitor for a _Variant_storage with at most 4^1 states _STL_STAMP(4, _STL_VISIT_STAMP); } @@ -615,8 +615,8 @@ struct _Variant_raw_visit1<1> { template <> struct _Variant_raw_visit1<2> { template - _NODISCARD static constexpr _Variant_raw_visit_t<_Fn, _Storage> _Visit( - size_t _Idx, _Fn&& _Func, _Storage&& _Obj) noexcept(_Variant_raw_visit_noexcept<_Fn, _Storage>) { + _NODISCARD static constexpr _Variant_raw_visit_t<_Fn, _Storage> _Visit(size_t _Idx, _Fn&& _Func, _Storage&& _Obj) + noexcept(_Variant_raw_visit_noexcept<_Fn, _Storage>) { // dispatch a visitor for a _Variant_storage with at most 4^2 states _STL_STAMP(16, _STL_VISIT_STAMP); } @@ -625,8 +625,8 @@ struct _Variant_raw_visit1<2> { template <> struct _Variant_raw_visit1<3> { template - _NODISCARD static constexpr _Variant_raw_visit_t<_Fn, _Storage> _Visit( - size_t _Idx, _Fn&& _Func, _Storage&& _Obj) noexcept(_Variant_raw_visit_noexcept<_Fn, _Storage>) { + _NODISCARD static constexpr _Variant_raw_visit_t<_Fn, _Storage> _Visit(size_t _Idx, _Fn&& _Func, _Storage&& _Obj) + noexcept(_Variant_raw_visit_noexcept<_Fn, _Storage>) { // dispatch a visitor for a _Variant_storage with at most 4^3 states _STL_STAMP(64, _STL_VISIT_STAMP); } @@ -635,8 +635,8 @@ struct _Variant_raw_visit1<3> { template <> struct _Variant_raw_visit1<4> { template - _NODISCARD static constexpr _Variant_raw_visit_t<_Fn, _Storage> _Visit( - size_t _Idx, _Fn&& _Func, _Storage&& _Obj) noexcept(_Variant_raw_visit_noexcept<_Fn, _Storage>) { + _NODISCARD static constexpr _Variant_raw_visit_t<_Fn, _Storage> _Visit(size_t _Idx, _Fn&& _Func, _Storage&& _Obj) + noexcept(_Variant_raw_visit_noexcept<_Fn, _Storage>) { // dispatch a visitor for a _Variant_storage with at most 4^4 states _STL_STAMP(256, _STL_VISIT_STAMP); } @@ -646,8 +646,8 @@ struct _Variant_raw_visit1<4> { #undef _STL_CASE template -_NODISCARD constexpr _Variant_raw_visit_t<_Fn, _Storage> _Variant_raw_visit( - size_t _Idx, _Storage&& _Obj, _Fn&& _Func) noexcept(_Variant_raw_visit_noexcept<_Fn, _Storage>) { +_NODISCARD constexpr _Variant_raw_visit_t<_Fn, _Storage> _Variant_raw_visit(size_t _Idx, _Storage&& _Obj, _Fn&& _Func) + noexcept(_Variant_raw_visit_noexcept<_Fn, _Storage>) { // Call _Func with _Storage if _Idx is variant_npos, and otherwise the _Idx-th element in _Storage. // pre: _Idx + 1 <= remove_reference_t<_Storage>::_Size constexpr size_t _Size = remove_reference_t<_Storage>::_Size; @@ -753,8 +753,8 @@ public: template , _Idx>, _UTypes...>, int> = 0> - constexpr explicit _Variant_base(in_place_index_t<_Idx>, _UTypes&&... _Args) noexcept( - is_nothrow_constructible_v<_Meta_at_c, _Idx>, _UTypes...>) + constexpr explicit _Variant_base(in_place_index_t<_Idx>, _UTypes&&... _Args) + noexcept(is_nothrow_constructible_v<_Meta_at_c, _Idx>, _UTypes...>) : _Storage_t(integral_constant{}, static_cast<_UTypes&&>(_Args)...), _Which{static_cast<_Index_t>(_Idx)} { // initialize alternative _Idx from _Args... } @@ -808,29 +808,29 @@ public: } } - _CONSTEXPR20 void _Construct_from(const _Variant_base& _That) noexcept( - conjunction_v...>) { + _CONSTEXPR20 void _Construct_from(const _Variant_base& _That) + noexcept(conjunction_v...>) { // copy _That's contained value into *this // pre: valueless_by_exception() _STD _Variant_raw_visit(_That.index(), _That._Storage(), _Variant_construct_visitor<_Types...>{*this}); } - _CONSTEXPR20 void _Construct_from(_Variant_base&& _That) noexcept( - conjunction_v...>) { + _CONSTEXPR20 void _Construct_from(_Variant_base&& _That) + noexcept(conjunction_v...>) { // move _That's contained value into *this // pre: valueless_by_exception() _STD _Variant_raw_visit( _That.index(), _STD move(_That)._Storage(), _Variant_construct_visitor<_Types...>{*this}); } - _CONSTEXPR20 void _Assign_from(const _Variant_base& _That) noexcept( - conjunction_v..., is_nothrow_copy_assignable<_Types>...>) { + _CONSTEXPR20 void _Assign_from(const _Variant_base& _That) + noexcept(conjunction_v..., is_nothrow_copy_assignable<_Types>...>) { // copy assign _That's contained value (if any) into *this _STD _Variant_raw_visit(_That.index(), _That._Storage(), _Variant_assign_visitor<_Types...>{*this}); } - _CONSTEXPR20 void _Assign_from(_Variant_base&& _That) noexcept( - conjunction_v..., is_nothrow_move_assignable<_Types>...>) { + _CONSTEXPR20 void _Assign_from(_Variant_base&& _That) + noexcept(conjunction_v..., is_nothrow_move_assignable<_Types>...>) { // move assign _That's contained value (if any) into *this _STD _Variant_raw_visit(_That.index(), _STD move(_That)._Storage(), _Variant_assign_visitor<_Types...>{*this}); } @@ -947,31 +947,31 @@ public: template , enable_if_t<_Idx::value != _Meta_npos && is_constructible_v<_Ty, _UTypes...>, int> = 0> - constexpr explicit variant(in_place_type_t<_Ty>, _UTypes&&... _Args) noexcept( - is_nothrow_constructible_v<_Ty, _UTypes...>) // strengthened + constexpr explicit variant(in_place_type_t<_Ty>, _UTypes&&... _Args) + noexcept(is_nothrow_constructible_v<_Ty, _UTypes...>) // strengthened : _Mybase(in_place_index<_Idx::value>, static_cast<_UTypes&&>(_Args)...) { // initialize alternative _Ty from _Args... } template , enable_if_t<_Idx::value != _Meta_npos && is_constructible_v<_Ty, initializer_list<_Elem>&, _UTypes...>, int> = 0> - constexpr explicit variant(in_place_type_t<_Ty>, initializer_list<_Elem> _Ilist, _UTypes&&... _Args) noexcept( - is_nothrow_constructible_v<_Ty, initializer_list<_Elem>&, _UTypes...>) // strengthened + constexpr explicit variant(in_place_type_t<_Ty>, initializer_list<_Elem> _Ilist, _UTypes&&... _Args) + noexcept(is_nothrow_constructible_v<_Ty, initializer_list<_Elem>&, _UTypes...>) // strengthened : _Mybase(in_place_index<_Idx::value>, _Ilist, static_cast<_UTypes&&>(_Args)...) { // initialize alternative _Ty from _Ilist and _Args... } template , _UTypes...>, int> = 0> - constexpr explicit variant(in_place_index_t<_Idx>, _UTypes&&... _Args) noexcept( - is_nothrow_constructible_v<_Meta_at_c, _UTypes...>) // strengthened + constexpr explicit variant(in_place_index_t<_Idx>, _UTypes&&... _Args) + noexcept(is_nothrow_constructible_v<_Meta_at_c, _UTypes...>) // strengthened : _Mybase(in_place_index<_Idx>, static_cast<_UTypes&&>(_Args)...) { // initialize alternative _Idx from _Args... } template , initializer_list<_Elem>&, _UTypes...>, int> = 0> - constexpr explicit variant(in_place_index_t<_Idx>, initializer_list<_Elem> _Ilist, _UTypes&&... _Args) noexcept( - is_constructible_v<_Meta_at_c, initializer_list<_Elem>&, _UTypes...>) // strengthened + constexpr explicit variant(in_place_index_t<_Idx>, initializer_list<_Elem> _Ilist, _UTypes&&... _Args) + noexcept(is_constructible_v<_Meta_at_c, initializer_list<_Elem>&, _UTypes...>) // strengthened : _Mybase(in_place_index<_Idx>, _Ilist, static_cast<_UTypes&&>(_Args)...) { // initialize alternative _Idx from _Ilist and _Args... } @@ -980,9 +980,9 @@ public: && is_constructible_v<_Variant_init_type<_Ty, _Types...>, _Ty> && is_assignable_v<_Variant_init_type<_Ty, _Types...>&, _Ty>, int> = 0> - _CONSTEXPR20 variant& operator=(_Ty&& _Obj) noexcept( - is_nothrow_assignable_v<_Variant_init_type<_Ty, _Types...>&, _Ty> - && is_nothrow_constructible_v<_Variant_init_type<_Ty, _Types...>, _Ty>) { + _CONSTEXPR20 variant& operator=(_Ty&& _Obj) + noexcept(is_nothrow_assignable_v<_Variant_init_type<_Ty, _Types...>&, _Ty> + && is_nothrow_constructible_v<_Variant_init_type<_Ty, _Types...>, _Ty>) { // assign/emplace the alternative chosen by overload resolution of _Obj with f(_Types)... constexpr size_t _TargetIdx = _Variant_init_index<_Ty, _Types...>::value; if (index() == _TargetIdx) { @@ -1007,16 +1007,16 @@ public: template ::value, enable_if_t<_Idx != _Meta_npos && is_constructible_v<_Ty, _ArgTypes...>, int> = 0> - _CONSTEXPR20 _Ty& emplace(_ArgTypes&&... _Args) noexcept( - is_nothrow_constructible_v<_Ty, _ArgTypes...>) /* strengthened */ { + _CONSTEXPR20 _Ty& emplace(_ArgTypes&&... _Args) + noexcept(is_nothrow_constructible_v<_Ty, _ArgTypes...>) /* strengthened */ { // emplace alternative _Ty from _Args... this->_Reset(); return _Emplace_valueless<_Idx>(static_cast<_ArgTypes&&>(_Args)...); } template ::value, enable_if_t<_Idx != _Meta_npos && is_constructible_v<_Ty, initializer_list<_Elem>&, _ArgTypes...>, int> = 0> - _CONSTEXPR20 _Ty& emplace(initializer_list<_Elem> _Ilist, _ArgTypes&&... _Args) noexcept( - is_nothrow_constructible_v<_Ty, initializer_list<_Elem>&, _ArgTypes...>) /* strengthened */ { + _CONSTEXPR20 _Ty& emplace(initializer_list<_Elem> _Ilist, _ArgTypes&&... _Args) + noexcept(is_nothrow_constructible_v<_Ty, initializer_list<_Elem>&, _ArgTypes...>) /* strengthened */ { // emplace alternative _Ty from _Ilist and _Args... this->_Reset(); return _Emplace_valueless<_Idx>(_Ilist, static_cast<_ArgTypes&&>(_Args)...); @@ -1024,16 +1024,16 @@ public: template , _ArgTypes...>, int> = 0> - _CONSTEXPR20 _Meta_at_c& emplace(_ArgTypes&&... _Args) noexcept( - is_nothrow_constructible_v<_Meta_at_c, _ArgTypes...>) /* strengthened */ { + _CONSTEXPR20 _Meta_at_c& emplace(_ArgTypes&&... _Args) + noexcept(is_nothrow_constructible_v<_Meta_at_c, _ArgTypes...>) /* strengthened */ { // emplace alternative _Idx from _Args... this->_Reset(); return _Emplace_valueless<_Idx>(static_cast<_ArgTypes&&>(_Args)...); } template , initializer_list<_Elem>&, _ArgTypes...>, int> = 0> - _CONSTEXPR20 _Meta_at_c& emplace(initializer_list<_Elem> _Ilist, _ArgTypes&&... _Args) noexcept( - is_nothrow_constructible_v<_Meta_at_c, initializer_list<_Elem>&, + _CONSTEXPR20 _Meta_at_c& emplace(initializer_list<_Elem> _Ilist, _ArgTypes&&... _Args) + noexcept(is_nothrow_constructible_v<_Meta_at_c, initializer_list<_Elem>&, _ArgTypes...>) /* strengthened */ { // emplace alternative _Idx from _Ilist and _Args... this->_Reset(); @@ -1047,8 +1047,8 @@ public: #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wunused-lambda-capture" #endif // ^^^ workaround ^^^ - _CONSTEXPR20 void swap(variant& _That) noexcept( - conjunction_v..., is_nothrow_swappable<_Types>...>) { + _CONSTEXPR20 void swap(variant& _That) + noexcept(conjunction_v..., is_nothrow_swappable<_Types>...>) { // exchange the contained values if *this and _That hold the same alternative, otherwise exchange the values of // the variants themselves static_assert(conjunction_v...>, @@ -1111,8 +1111,8 @@ public: private: template - _CONSTEXPR20 _Meta_at_c& _Emplace_valueless(_ArgTypes&&... _Args) noexcept( - is_nothrow_constructible_v<_Meta_at_c, _ArgTypes...>) { + _CONSTEXPR20 _Meta_at_c& _Emplace_valueless(_ArgTypes&&... _Args) + noexcept(is_nothrow_constructible_v<_Meta_at_c, _ArgTypes...>) { // initialize alternative _Idx from _Args... _STL_INTERNAL_CHECK(valueless_by_exception()); _STD _Construct_in_place(_Storage(), integral_constant{}, static_cast<_ArgTypes&&>(_Args)...); @@ -1306,8 +1306,8 @@ _NODISCARD constexpr bool operator!=(const variant<_Types...>& _Left, const vari } _EXPORT_STD template -_NODISCARD constexpr bool operator<(const variant<_Types...>& _Left, const variant<_Types...>& _Right) noexcept( - conjunction_v, const _Types&, const _Types&>...>) /* strengthened */ { +_NODISCARD constexpr bool operator<(const variant<_Types...>& _Left, const variant<_Types...>& _Right) + noexcept(conjunction_v, const _Types&, const _Types&>...>) /* strengthened */ { // determine if _Left has a lesser index(), or equal index() and lesser // contained value than _Right using _Visitor = _Variant_relop_visitor2, bool, _Types...>; @@ -1360,9 +1360,9 @@ _NODISCARD constexpr bool operator>=(const variant<_Types...>& _Left, const vari #if _HAS_CXX20 _EXPORT_STD template requires (three_way_comparable<_Types> && ...) -_NODISCARD constexpr common_comparison_category_t...> - operator<=>(const variant<_Types...>& _Left, const variant<_Types...>& _Right) noexcept( - conjunction_v...>, +_NODISCARD constexpr common_comparison_category_t...> operator<=>( + const variant<_Types...>& _Left, const variant<_Types...>& _Right) + noexcept(conjunction_v...>, compare_three_way, const _Types&, const _Types&>...>) /* strengthened */ { // determine the three-way comparison of _Left's and _Right's index, if equal // return the three-way comparison of the contained values of _Left and _Right @@ -1684,8 +1684,8 @@ struct _Variant_hash_visitor { // visitation function for hashing variants template struct hash> : _Conditionally_enabled_hash, conjunction_v>>...>> { - _NODISCARD static size_t _Do_hash(const variant<_Types...>& _Var) noexcept( - conjunction_v<_Is_nothrow_hashable>...>) { + _NODISCARD static size_t _Do_hash(const variant<_Types...>& _Var) + noexcept(conjunction_v<_Is_nothrow_hashable>...>) { // called from the CRTP base to hash _Var iff the hash is enabled return _STD _Variant_raw_visit(_Var.index(), _Var._Storage(), _Variant_hash_visitor{}); } diff --git a/stl/inc/vector b/stl/inc/vector index 088543c0fd..8a123af1f3 100644 --- a/stl/inc/vector +++ b/stl/inc/vector @@ -696,8 +696,8 @@ public: _Mypair._Myval2._Swap_proxy_and_iterators(_Right._Mypair._Myval2); } - _CONSTEXPR20 vector(vector&& _Right, const _Identity_t<_Alloc>& _Al_) noexcept( - _Alty_traits::is_always_equal::value) // strengthened + _CONSTEXPR20 vector(vector&& _Right, const _Identity_t<_Alloc>& _Al_) + noexcept(_Alty_traits::is_always_equal::value) // strengthened : _Mypair(_One_then_variadic_args_t{}, _Al_) { _Alty& _Al = _Getal(); auto&& _Alproxy = _GET_PROXY_ALLOCATOR(_Alty, _Al); @@ -726,8 +726,8 @@ public: _Proxy._Release(); } - _CONSTEXPR20 vector& operator=(vector&& _Right) noexcept( - _Choose_pocma_v<_Alty> != _Pocma_values::_No_propagate_allocators) { + _CONSTEXPR20 vector& operator=(vector&& _Right) + noexcept(_Choose_pocma_v<_Alty> != _Pocma_values::_No_propagate_allocators) { if (this == _STD addressof(_Right)) { return *this; } @@ -1717,8 +1717,8 @@ public: --_Mylast; } - _CONSTEXPR20 iterator erase(const_iterator _Where) noexcept( - is_nothrow_move_assignable_v) /* strengthened */ { + _CONSTEXPR20 iterator erase(const_iterator _Where) + noexcept(is_nothrow_move_assignable_v) /* strengthened */ { const pointer _Whereptr = _Where._Ptr; auto& _My_data = _Mypair._Myval2; pointer& _Mylast = _My_data._Mylast; @@ -1737,8 +1737,8 @@ public: return iterator(_Whereptr, _STD addressof(_My_data)); } - _CONSTEXPR20 iterator erase(const_iterator _First, const_iterator _Last) noexcept( - is_nothrow_move_assignable_v) /* strengthened */ { + _CONSTEXPR20 iterator erase(const_iterator _First, const_iterator _Last) + noexcept(is_nothrow_move_assignable_v) /* strengthened */ { const pointer _Firstptr = _First._Ptr; const pointer _Lastptr = _Last._Ptr; auto& _My_data = _Mypair._Myval2; @@ -2807,8 +2807,8 @@ public: this->_Alloc_proxy(_GET_PROXY_ALLOCATOR(_Alvbase, _Getal())); } - _CONSTEXPR20 _Vb_val(_Vb_val&& _Right, const _Alloc& _Al) noexcept( - is_nothrow_constructible_v<_Vectype, _Vectype, _Alvbase>) + _CONSTEXPR20 _Vb_val(_Vb_val&& _Right, const _Alloc& _Al) + noexcept(is_nothrow_constructible_v<_Vectype, _Vectype, _Alvbase>) : _Myvec(_STD move(_Right._Myvec), static_cast<_Alvbase>(_Al)), _Mysize(_Right._Mysize) { if (_Right._Myvec.empty()) { // we took _Right's buffer, so zero out size @@ -2917,8 +2917,8 @@ public: this->_Swap_proxy_and_iterators(_Right); } - _CONSTEXPR20 vector(vector&& _Right, const _Identity_t<_Alloc>& _Al) noexcept( - is_nothrow_constructible_v<_Mybase, _Mybase, const _Alloc&>) // strengthened + _CONSTEXPR20 vector(vector&& _Right, const _Identity_t<_Alloc>& _Al) + noexcept(is_nothrow_constructible_v<_Mybase, _Mybase, const _Alloc&>) // strengthened : _Mybase(_STD move(_Right), _Al) { if constexpr (!_Alvbase_traits::is_always_equal::value) { if (this->_Getal() != _Right._Getal()) { @@ -2929,8 +2929,8 @@ public: this->_Swap_proxy_and_iterators(_Right); } - _CONSTEXPR20 vector& operator=(vector&& _Right) noexcept( - _Choose_pocma_v<_Alvbase> != _Pocma_values::_No_propagate_allocators) { + _CONSTEXPR20 vector& operator=(vector&& _Right) + noexcept(_Choose_pocma_v<_Alvbase> != _Pocma_values::_No_propagate_allocators) { if (this == _STD addressof(_Right)) { return *this; } diff --git a/stl/inc/xcall_once.h b/stl/inc/xcall_once.h index 3a99d9bc03..5057ca65d1 100644 --- a/stl/inc/xcall_once.h +++ b/stl/inc/xcall_once.h @@ -89,8 +89,8 @@ struct _Init_once_completer { }; _EXPORT_STD template -void(call_once)(once_flag& _Once, _Fn&& _Fx, _Args&&... _Ax) noexcept( - noexcept(_STD invoke(_STD forward<_Fn>(_Fx), _STD forward<_Args>(_Ax)...))) /* strengthened */ { +void(call_once)(once_flag& _Once, _Fn&& _Fx, _Args&&... _Ax) + noexcept(noexcept(_STD invoke(_STD forward<_Fn>(_Fx), _STD forward<_Args>(_Ax)...))) /* strengthened */ { // call _Fx(_Ax...) once // parentheses against common "#define call_once(flag,func) pthread_once(flag,func)" int _Pending; diff --git a/stl/inc/xhash b/stl/inc/xhash index a02b31e79c..0581696c1a 100644 --- a/stl/inc/xhash +++ b/stl/inc/xhash @@ -132,16 +132,16 @@ public: bucket_size = 1 // 0 < bucket_size }; - _Uhash_compare() noexcept( - conjunction_v, is_nothrow_default_constructible<_Keyeq>>) + _Uhash_compare() + noexcept(conjunction_v, is_nothrow_default_constructible<_Keyeq>>) : _Mypair(_Zero_then_variadic_args_t{}, _Zero_then_variadic_args_t{}, 0.0f) {} - explicit _Uhash_compare(const _Hasher& _Hasharg) noexcept( - conjunction_v, is_nothrow_default_constructible<_Keyeq>>) + explicit _Uhash_compare(const _Hasher& _Hasharg) + noexcept(conjunction_v, is_nothrow_default_constructible<_Keyeq>>) : _Mypair(_One_then_variadic_args_t{}, _Hasharg, _Zero_then_variadic_args_t{}, 0.0f) {} - explicit _Uhash_compare(const _Hasher& _Hasharg, const _Keyeq& _Keyeqarg) noexcept( - conjunction_v, is_nothrow_copy_constructible<_Keyeq>>) + explicit _Uhash_compare(const _Hasher& _Hasharg, const _Keyeq& _Keyeqarg) + noexcept(conjunction_v, is_nothrow_copy_constructible<_Keyeq>>) : _Mypair(_One_then_variadic_args_t{}, _Hasharg, _One_then_variadic_args_t{}, _Keyeqarg, 0.0f) {} template @@ -165,8 +165,8 @@ public: return _Mypair._Myval2._Myval2; } - void swap(_Uhash_compare& _Rhs) noexcept( - conjunction_v<_Is_nothrow_swappable<_Hasher>, _Is_nothrow_swappable<_Keyeq>>) { + void swap(_Uhash_compare& _Rhs) + noexcept(conjunction_v<_Is_nothrow_swappable<_Hasher>, _Is_nothrow_swappable<_Keyeq>>) { using _STD swap; swap(_Mypair._Get_first(), _Rhs._Mypair._Get_first()); // intentional ADL auto& _Lsecond = _Mypair._Myval2; @@ -1132,8 +1132,8 @@ public: return _List._Make_iter(_Unchecked_erase(_Plist._Ptr)); } - iterator erase(const_iterator _First, const_iterator _Last) noexcept( - _Nothrow_hash<_Traits, key_type>) /* strengthened */ { + iterator erase(const_iterator _First, const_iterator _Last) + noexcept(_Nothrow_hash<_Traits, key_type>) /* strengthened */ { return _List._Make_iter(_Unchecked_erase(_First._Ptr, _Last._Ptr)); } diff --git a/stl/inc/xmemory b/stl/inc/xmemory index 19f0e62cb0..4944352f3a 100644 --- a/stl/inc/xmemory +++ b/stl/inc/xmemory @@ -1082,8 +1082,8 @@ _CONSTEXPR20 void _Destroy_range(_NoThrowFwdIt _First, const _NoThrowSentinel _L } template -_NODISCARD constexpr _Size_type _Convert_size(const _Unsigned_type _Len) noexcept( - sizeof(_Unsigned_type) <= sizeof(_Size_type)) { +_NODISCARD constexpr _Size_type _Convert_size(const _Unsigned_type _Len) + noexcept(sizeof(_Unsigned_type) <= sizeof(_Size_type)) { // convert _Unsigned_type to _Size_type, avoiding truncation _STL_INTERNAL_STATIC_ASSERT(_Unsigned_type(-1) > 0); _STL_INTERNAL_STATIC_ASSERT(_Size_type(-1) > 0); @@ -1492,13 +1492,13 @@ public: using _Mybase = _Ty1; // for visualization template - constexpr explicit _Compressed_pair(_Zero_then_variadic_args_t, _Other2&&... _Val2) noexcept( - conjunction_v, is_nothrow_constructible<_Ty2, _Other2...>>) + constexpr explicit _Compressed_pair(_Zero_then_variadic_args_t, _Other2&&... _Val2) + noexcept(conjunction_v, is_nothrow_constructible<_Ty2, _Other2...>>) : _Ty1(), _Myval2(_STD forward<_Other2>(_Val2)...) {} template - constexpr _Compressed_pair(_One_then_variadic_args_t, _Other1&& _Val1, _Other2&&... _Val2) noexcept( - conjunction_v, is_nothrow_constructible<_Ty2, _Other2...>>) + constexpr _Compressed_pair(_One_then_variadic_args_t, _Other1&& _Val1, _Other2&&... _Val2) + noexcept(conjunction_v, is_nothrow_constructible<_Ty2, _Other2...>>) : _Ty1(_STD forward<_Other1>(_Val1)), _Myval2(_STD forward<_Other2>(_Val2)...) {} constexpr _Ty1& _Get_first() noexcept { @@ -1517,13 +1517,13 @@ public: _Ty2 _Myval2; template - constexpr explicit _Compressed_pair(_Zero_then_variadic_args_t, _Other2&&... _Val2) noexcept( - conjunction_v, is_nothrow_constructible<_Ty2, _Other2...>>) + constexpr explicit _Compressed_pair(_Zero_then_variadic_args_t, _Other2&&... _Val2) + noexcept(conjunction_v, is_nothrow_constructible<_Ty2, _Other2...>>) : _Myval1(), _Myval2(_STD forward<_Other2>(_Val2)...) {} template - constexpr _Compressed_pair(_One_then_variadic_args_t, _Other1&& _Val1, _Other2&&... _Val2) noexcept( - conjunction_v, is_nothrow_constructible<_Ty2, _Other2...>>) + constexpr _Compressed_pair(_One_then_variadic_args_t, _Other1&& _Val1, _Other2&&... _Val2) + noexcept(conjunction_v, is_nothrow_constructible<_Ty2, _Other2...>>) : _Myval1(_STD forward<_Other1>(_Val1)), _Myval2(_STD forward<_Other2>(_Val2)...) {} constexpr _Ty1& _Get_first() noexcept { @@ -2134,8 +2134,8 @@ struct _Alloc_temporary2 { #endif // ^^^ no workaround ^^^ template - _CONSTEXPR20 explicit _Alloc_temporary2(_Alloc& _Al_, _Args&&... _Vals) noexcept( - noexcept(_Traits::construct(_Al_, _STD addressof(_Get_value()), _STD forward<_Args>(_Vals)...))) + _CONSTEXPR20 explicit _Alloc_temporary2(_Alloc& _Al_, _Args&&... _Vals) + noexcept(noexcept(_Traits::construct(_Al_, _STD addressof(_Get_value()), _STD forward<_Args>(_Vals)...))) : _Al(_Al_) { _Traits::construct(_Al, _STD addressof(_Get_value()), _STD forward<_Args>(_Vals)...); } diff --git a/stl/inc/xsmf_control.h b/stl/inc/xsmf_control.h index 381f0499f7..9f8b64aa48 100644 --- a/stl/inc/xsmf_control.h +++ b/stl/inc/xsmf_control.h @@ -24,8 +24,8 @@ struct _Non_trivial_copy : _Base { // non-trivial copy construction facade using _Base::_Base; _Non_trivial_copy() = default; - _CONSTEXPR20 _Non_trivial_copy(const _Non_trivial_copy& _That) noexcept( - noexcept(_Base::_Construct_from(static_cast(_That)))) { + _CONSTEXPR20 _Non_trivial_copy(const _Non_trivial_copy& _That) + noexcept(noexcept(_Base::_Construct_from(static_cast(_That)))) { _Base::_Construct_from(static_cast(_That)); } _Non_trivial_copy(_Non_trivial_copy&&) = default; @@ -55,8 +55,8 @@ struct _Non_trivial_move : _SMF_control_copy<_Base, _Types...> { // non-trivial _Non_trivial_move() = default; _Non_trivial_move(const _Non_trivial_move&) = default; - _CONSTEXPR20 _Non_trivial_move(_Non_trivial_move&& _That) noexcept( - noexcept(_Mybase::_Construct_from(static_cast<_Base&&>(_That)))) { + _CONSTEXPR20 _Non_trivial_move(_Non_trivial_move&& _That) + noexcept(noexcept(_Mybase::_Construct_from(static_cast<_Base&&>(_That)))) { _Mybase::_Construct_from(static_cast<_Base&&>(_That)); } _Non_trivial_move& operator=(const _Non_trivial_move&) = default; @@ -90,8 +90,8 @@ struct _Non_trivial_copy_assign : _SMF_control_move<_Base, _Types...> { // non-t _Non_trivial_copy_assign(const _Non_trivial_copy_assign&) = default; _Non_trivial_copy_assign(_Non_trivial_copy_assign&&) = default; - _CONSTEXPR20 _Non_trivial_copy_assign& operator=(const _Non_trivial_copy_assign& _That) noexcept( - noexcept(_Mybase::_Assign_from(static_cast(_That)))) { + _CONSTEXPR20 _Non_trivial_copy_assign& operator=(const _Non_trivial_copy_assign& _That) + noexcept(noexcept(_Mybase::_Assign_from(static_cast(_That)))) { _Mybase::_Assign_from(static_cast(_That)); return *this; } @@ -128,8 +128,8 @@ struct _Non_trivial_move_assign : _SMF_control_copy_assign<_Base, _Types...> { / _Non_trivial_move_assign(_Non_trivial_move_assign&&) = default; _Non_trivial_move_assign& operator=(const _Non_trivial_move_assign&) = default; - _CONSTEXPR20 _Non_trivial_move_assign& operator=(_Non_trivial_move_assign&& _That) noexcept( - noexcept(_Mybase::_Assign_from(static_cast<_Base&&>(_That)))) { + _CONSTEXPR20 _Non_trivial_move_assign& operator=(_Non_trivial_move_assign&& _That) + noexcept(noexcept(_Mybase::_Assign_from(static_cast<_Base&&>(_That)))) { _Mybase::_Assign_from(static_cast<_Base&&>(_That)); return *this; } diff --git a/stl/inc/xstring b/stl/inc/xstring index 022750d3f6..212d55880a 100644 --- a/stl/inc/xstring +++ b/stl/inc/xstring @@ -1011,8 +1011,8 @@ public: _Take_contents(_Right); } - _CONSTEXPR20 basic_string(basic_string&& _Right, const _Alloc& _Al) noexcept( - _Alty_traits::is_always_equal::value) // strengthened + _CONSTEXPR20 basic_string(basic_string&& _Right, const _Alloc& _Al) + noexcept(_Alty_traits::is_always_equal::value) // strengthened : _Mypair(_One_then_variadic_args_t{}, _Al) { if constexpr (!_Alty_traits::is_always_equal::value) { if (_Getal() != _Right._Getal()) { @@ -1208,8 +1208,8 @@ public: } #endif // _HAS_CXX20 - _CONSTEXPR20 basic_string& operator=(basic_string&& _Right) noexcept( - _Choose_pocma_v<_Alty> != _Pocma_values::_No_propagate_allocators) { + _CONSTEXPR20 basic_string& operator=(basic_string&& _Right) + noexcept(_Choose_pocma_v<_Alty> != _Pocma_values::_No_propagate_allocators) { if (this == _STD addressof(_Right)) { return *this; } diff --git a/stl/inc/xutility b/stl/inc/xutility index ade445a043..3cfc072d24 100644 --- a/stl/inc/xutility +++ b/stl/inc/xutility @@ -438,15 +438,15 @@ _EXPORT_STD template requires requires(_Ty* _Location, _Types&&... _Args) { ::new (static_cast(_Location)) _Ty(_STD forward<_Types>(_Args)...); // per LWG-3888 } -constexpr _Ty* construct_at(_Ty* const _Location, _Types&&... _Args) noexcept( - noexcept(::new (static_cast(_Location)) _Ty(_STD forward<_Types>(_Args)...))) /* strengthened */ { +constexpr _Ty* construct_at(_Ty* const _Location, _Types&&... _Args) + noexcept(noexcept(::new (static_cast(_Location)) _Ty(_STD forward<_Types>(_Args)...))) /* strengthened */ { _MSVC_CONSTEXPR return ::new (static_cast(_Location)) _Ty(_STD forward<_Types>(_Args)...); } #endif // _HAS_CXX20 template -_CONSTEXPR20 void _Construct_in_place(_Ty& _Obj, _Types&&... _Args) noexcept( - is_nothrow_constructible_v<_Ty, _Types...>) { +_CONSTEXPR20 void _Construct_in_place(_Ty& _Obj, _Types&&... _Args) + noexcept(is_nothrow_constructible_v<_Ty, _Types...>) { #if _HAS_CXX20 if (_STD is_constant_evaluated()) { _STD construct_at(_STD addressof(_Obj), _STD forward<_Types>(_Args)...); @@ -473,8 +473,8 @@ struct _Ptr_traits_base { using _Reftype = conditional_t, char, _Elem>&; - _NODISCARD static _CONSTEXPR20 pointer pointer_to(_Reftype _Val) noexcept( - noexcept(_Ty::pointer_to(_Val))) /* strengthened */ { // Per LWG-3454 + _NODISCARD static _CONSTEXPR20 pointer pointer_to(_Reftype _Val) + noexcept(noexcept(_Ty::pointer_to(_Val))) /* strengthened */ { // Per LWG-3454 return _Ty::pointer_to(_Val); } }; @@ -761,8 +761,8 @@ _NODISCARD constexpr auto _Pass_fn(_Fn& _Func) noexcept { #if _HAS_CXX23 _EXPORT_STD template requires is_invocable_r_v<_Result_type, _Callable, _Types...> -_NODISCARD constexpr _Result_type invoke_r(_Callable&& _Obj, _Types&&... _Args) noexcept( - is_nothrow_invocable_r_v<_Result_type, _Callable, _Types...>) { +_NODISCARD constexpr _Result_type invoke_r(_Callable&& _Obj, _Types&&... _Args) + noexcept(is_nothrow_invocable_r_v<_Result_type, _Callable, _Types...>) { if constexpr (is_void_v<_Result_type>) { (void) _STD invoke(static_cast<_Callable&&>(_Obj), static_cast<_Types&&>(_Args)...); } else { @@ -1139,8 +1139,8 @@ namespace ranges { && indirectly_movable_storable, remove_reference_t<_Ty1>>; template - _NODISCARD constexpr iter_value_t> _Iter_exchange_move(_Xty&& _XVal, - _Yty&& _YVal) noexcept(noexcept(iter_value_t>(_RANGES iter_move(_XVal)))) { + _NODISCARD constexpr iter_value_t> _Iter_exchange_move(_Xty&& _XVal, _Yty&& _YVal) + noexcept(noexcept(iter_value_t>(_RANGES iter_move(_XVal)))) { iter_value_t> _Tmp(_RANGES iter_move(_XVal)); *_XVal = _RANGES iter_move(_YVal); return _Tmp; @@ -1373,8 +1373,8 @@ constexpr bool _Has_nothrow_unwrapped<_Iter, void_t noexcept(_STD declval<_Iter>()._Unwrapped()); template -_NODISCARD constexpr decltype(auto) _Get_unwrapped(_Iter&& _It) noexcept( - !_Unwrappable_v<_Iter> || _Has_nothrow_unwrapped<_Iter>) { +_NODISCARD constexpr decltype(auto) _Get_unwrapped(_Iter&& _It) + noexcept(!_Unwrappable_v<_Iter> || _Has_nothrow_unwrapped<_Iter>) { // unwrap an iterator previously subjected to _Adl_verify_range or otherwise validated if constexpr (is_pointer_v>) { // special-case pointers and arrays return _It + 0; @@ -1589,8 +1589,8 @@ template constexpr bool _Debug_lt_pred_order_check_noexcept<_Pr, _Ty1, _Ty2, false> = true; template -_NODISCARD constexpr bool _Debug_lt_pred(_Pr&& _Pred, _Ty1&& _Left, _Ty2&& _Right) noexcept( - noexcept(_Pred(_Left, _Right)) && _Debug_lt_pred_order_check_noexcept<_Pr, _Ty1, _Ty2>) { +_NODISCARD constexpr bool _Debug_lt_pred(_Pr&& _Pred, _Ty1&& _Left, _Ty2&& _Right) + noexcept(noexcept(_Pred(_Left, _Right)) && _Debug_lt_pred_order_check_noexcept<_Pr, _Ty1, _Ty2>) { const auto _Result = static_cast(_Pred(_Left, _Right)); if constexpr (_Enable_debug_lt_pred_order_check<_Pr, _Ty1, _Ty2>) { @@ -1727,16 +1727,16 @@ public: _CONSTEXPR17 reverse_iterator() = default; - _CONSTEXPR17 explicit reverse_iterator(_BidIt _Right) noexcept( - is_nothrow_move_constructible_v<_BidIt>) // strengthened + _CONSTEXPR17 explicit reverse_iterator(_BidIt _Right) + noexcept(is_nothrow_move_constructible_v<_BidIt>) // strengthened : current(_STD move(_Right)) {} template #if _HAS_CXX20 requires (!is_same_v<_Other, _BidIt>) && convertible_to #endif // _HAS_CXX20 - _CONSTEXPR17 reverse_iterator(const reverse_iterator<_Other>& _Right) noexcept( - is_nothrow_constructible_v<_BidIt, const _Other&>) // strengthened + _CONSTEXPR17 reverse_iterator(const reverse_iterator<_Other>& _Right) + noexcept(is_nothrow_constructible_v<_BidIt, const _Other&>) // strengthened : current(_Right.current) { } @@ -1745,8 +1745,8 @@ public: requires (!is_same_v<_Other, _BidIt>) && convertible_to && assignable_from<_BidIt&, const _Other&> #endif // _HAS_CXX20 - _CONSTEXPR17 reverse_iterator& operator=(const reverse_iterator<_Other>& _Right) noexcept( - is_nothrow_assignable_v<_BidIt&, const _Other&>) /* strengthened */ { + _CONSTEXPR17 reverse_iterator& operator=(const reverse_iterator<_Other>& _Right) + noexcept(is_nothrow_assignable_v<_BidIt&, const _Other&>) /* strengthened */ { current = _Right.current; return *this; } @@ -1807,8 +1807,8 @@ public: return reverse_iterator(current - _Off); } - _CONSTEXPR17 reverse_iterator& operator+=(const difference_type _Off) noexcept( - noexcept(current -= _Off)) /* strengthened */ { + _CONSTEXPR17 reverse_iterator& operator+=(const difference_type _Off) + noexcept(noexcept(current -= _Off)) /* strengthened */ { current -= _Off; return *this; } @@ -1818,8 +1818,8 @@ public: return reverse_iterator(current + _Off); } - _CONSTEXPR17 reverse_iterator& operator-=(const difference_type _Off) noexcept( - noexcept(current += _Off)) /* strengthened */ { + _CONSTEXPR17 reverse_iterator& operator-=(const difference_type _Off) + noexcept(noexcept(current += _Off)) /* strengthened */ { current += _Off; return *this; } @@ -1830,18 +1830,18 @@ public: } #if _HAS_CXX20 - _NODISCARD friend constexpr iter_rvalue_reference_t<_BidIt> iter_move(const reverse_iterator& _It) noexcept( - is_nothrow_copy_constructible_v<_BidIt> // - && noexcept(_RANGES iter_move(--_STD declval<_BidIt&>()))) { + _NODISCARD friend constexpr iter_rvalue_reference_t<_BidIt> iter_move(const reverse_iterator& _It) + noexcept(is_nothrow_copy_constructible_v<_BidIt> // + && noexcept(_RANGES iter_move(--_STD declval<_BidIt&>()))) { auto _Tmp = _It.current; --_Tmp; return _RANGES iter_move(_Tmp); } template _BidIt2> - friend constexpr void iter_swap(const reverse_iterator& _Left, const reverse_iterator<_BidIt2>& _Right) noexcept( - is_nothrow_copy_constructible_v<_BidIt> && is_nothrow_copy_constructible_v<_BidIt2> // - && noexcept(_RANGES iter_swap(--_STD declval<_BidIt&>(), --_STD declval<_BidIt2&>()))) { + friend constexpr void iter_swap(const reverse_iterator& _Left, const reverse_iterator<_BidIt2>& _Right) + noexcept(is_nothrow_copy_constructible_v<_BidIt> && is_nothrow_copy_constructible_v<_BidIt2> // + && noexcept(_RANGES iter_swap(--_STD declval<_BidIt&>(), --_STD declval<_BidIt2&>()))) { auto _LTmp = _Left.current; auto _RTmp = _Right.base(); --_LTmp; @@ -1891,9 +1891,8 @@ protected: }; _EXPORT_STD template -_NODISCARD _CONSTEXPR17 bool - operator==(const reverse_iterator<_BidIt1>& _Left, const reverse_iterator<_BidIt2>& _Right) noexcept( - noexcept(_STD _Fake_copy_init(_Left._Get_current() == _Right._Get_current()))) /* strengthened */ +_NODISCARD _CONSTEXPR17 bool operator==(const reverse_iterator<_BidIt1>& _Left, const reverse_iterator<_BidIt2>& _Right) + noexcept(noexcept(_STD _Fake_copy_init(_Left._Get_current() == _Right._Get_current()))) /* strengthened */ #if _HAS_CXX20 requires requires { { _Left._Get_current() == _Right._Get_current() } -> _Implicitly_convertible_to; @@ -1904,9 +1903,8 @@ _NODISCARD _CONSTEXPR17 bool } _EXPORT_STD template -_NODISCARD _CONSTEXPR17 bool - operator!=(const reverse_iterator<_BidIt1>& _Left, const reverse_iterator<_BidIt2>& _Right) noexcept( - noexcept(_STD _Fake_copy_init(_Left._Get_current() != _Right._Get_current()))) /* strengthened */ +_NODISCARD _CONSTEXPR17 bool operator!=(const reverse_iterator<_BidIt1>& _Left, const reverse_iterator<_BidIt2>& _Right) + noexcept(noexcept(_STD _Fake_copy_init(_Left._Get_current() != _Right._Get_current()))) /* strengthened */ #if _HAS_CXX20 requires requires { { _Left._Get_current() != _Right._Get_current() } -> _Implicitly_convertible_to; @@ -1917,9 +1915,8 @@ _NODISCARD _CONSTEXPR17 bool } _EXPORT_STD template -_NODISCARD _CONSTEXPR17 bool - operator<(const reverse_iterator<_BidIt1>& _Left, const reverse_iterator<_BidIt2>& _Right) noexcept( - noexcept(_STD _Fake_copy_init(_Left._Get_current() > _Right._Get_current()))) /* strengthened */ +_NODISCARD _CONSTEXPR17 bool operator<(const reverse_iterator<_BidIt1>& _Left, const reverse_iterator<_BidIt2>& _Right) + noexcept(noexcept(_STD _Fake_copy_init(_Left._Get_current() > _Right._Get_current()))) /* strengthened */ #if _HAS_CXX20 requires requires { { _Left._Get_current() > _Right._Get_current() } -> _Implicitly_convertible_to; @@ -1930,9 +1927,8 @@ _NODISCARD _CONSTEXPR17 bool } _EXPORT_STD template -_NODISCARD _CONSTEXPR17 bool - operator>(const reverse_iterator<_BidIt1>& _Left, const reverse_iterator<_BidIt2>& _Right) noexcept( - noexcept(_STD _Fake_copy_init(_Left._Get_current() < _Right._Get_current()))) /* strengthened */ +_NODISCARD _CONSTEXPR17 bool operator>(const reverse_iterator<_BidIt1>& _Left, const reverse_iterator<_BidIt2>& _Right) + noexcept(noexcept(_STD _Fake_copy_init(_Left._Get_current() < _Right._Get_current()))) /* strengthened */ #if _HAS_CXX20 requires requires { { _Left._Get_current() < _Right._Get_current() } -> _Implicitly_convertible_to; @@ -1943,9 +1939,8 @@ _NODISCARD _CONSTEXPR17 bool } _EXPORT_STD template -_NODISCARD _CONSTEXPR17 bool - operator<=(const reverse_iterator<_BidIt1>& _Left, const reverse_iterator<_BidIt2>& _Right) noexcept( - noexcept(_STD _Fake_copy_init(_Left._Get_current() >= _Right._Get_current()))) /* strengthened */ +_NODISCARD _CONSTEXPR17 bool operator<=(const reverse_iterator<_BidIt1>& _Left, const reverse_iterator<_BidIt2>& _Right) + noexcept(noexcept(_STD _Fake_copy_init(_Left._Get_current() >= _Right._Get_current()))) /* strengthened */ #if _HAS_CXX20 requires requires { { _Left._Get_current() >= _Right._Get_current() } -> _Implicitly_convertible_to; @@ -1956,9 +1951,8 @@ _NODISCARD _CONSTEXPR17 bool } _EXPORT_STD template -_NODISCARD _CONSTEXPR17 bool - operator>=(const reverse_iterator<_BidIt1>& _Left, const reverse_iterator<_BidIt2>& _Right) noexcept( - noexcept(_STD _Fake_copy_init(_Left._Get_current() <= _Right._Get_current()))) /* strengthened */ +_NODISCARD _CONSTEXPR17 bool operator>=(const reverse_iterator<_BidIt1>& _Left, const reverse_iterator<_BidIt2>& _Right) + noexcept(noexcept(_STD _Fake_copy_init(_Left._Get_current() <= _Right._Get_current()))) /* strengthened */ #if _HAS_CXX20 requires requires { { _Left._Get_current() <= _Right._Get_current() } -> _Implicitly_convertible_to; @@ -1970,17 +1964,16 @@ _NODISCARD _CONSTEXPR17 bool #if _HAS_CXX20 _EXPORT_STD template _BidIt2> -_NODISCARD constexpr compare_three_way_result_t<_BidIt1, _BidIt2> - operator<=>(const reverse_iterator<_BidIt1>& _Left, const reverse_iterator<_BidIt2>& _Right) noexcept( - noexcept(_Right._Get_current() <=> _Left._Get_current())) /* strengthened */ { +_NODISCARD constexpr compare_three_way_result_t<_BidIt1, _BidIt2> operator<=>( + const reverse_iterator<_BidIt1>& _Left, const reverse_iterator<_BidIt2>& _Right) + noexcept(noexcept(_Right._Get_current() <=> _Left._Get_current())) /* strengthened */ { return _Right._Get_current() <=> _Left._Get_current(); } #endif // _HAS_CXX20 _EXPORT_STD template -_NODISCARD _CONSTEXPR17 auto - operator-(const reverse_iterator<_BidIt1>& _Left, const reverse_iterator<_BidIt2>& _Right) noexcept( - noexcept(_Right._Get_current() - _Left._Get_current())) /* strengthened */ +_NODISCARD _CONSTEXPR17 auto operator-(const reverse_iterator<_BidIt1>& _Left, const reverse_iterator<_BidIt2>& _Right) + noexcept(noexcept(_Right._Get_current() - _Left._Get_current())) /* strengthened */ -> decltype(_Right._Get_current() - _Left._Get_current()) { return _Right._Get_current() - _Left._Get_current(); } @@ -1992,8 +1985,8 @@ _NODISCARD _CONSTEXPR17 reverse_iterator<_BidIt> operator+(typename reverse_iter } _EXPORT_STD template -_NODISCARD _CONSTEXPR17 reverse_iterator<_BidIt> make_reverse_iterator(_BidIt _Iter) noexcept( - is_nothrow_move_constructible_v<_BidIt>) /* strengthened */ { +_NODISCARD _CONSTEXPR17 reverse_iterator<_BidIt> make_reverse_iterator(_BidIt _Iter) + noexcept(is_nothrow_move_constructible_v<_BidIt>) /* strengthened */ { return reverse_iterator<_BidIt>(_STD move(_Iter)); } @@ -2038,14 +2031,14 @@ _NODISCARD constexpr _Ty* end(_Ty (&_Array)[_Size]) noexcept { } _EXPORT_STD template -_NODISCARD constexpr auto cbegin(const _Container& _Cont) noexcept( - noexcept(_STD begin(_Cont))) -> decltype(_STD begin(_Cont)) { +_NODISCARD constexpr auto cbegin(const _Container& _Cont) + noexcept(noexcept(_STD begin(_Cont))) -> decltype(_STD begin(_Cont)) { return _STD begin(_Cont); } _EXPORT_STD template -_NODISCARD constexpr auto cend(const _Container& _Cont) noexcept( - noexcept(_STD end(_Cont))) -> decltype(_STD end(_Cont)) { +_NODISCARD constexpr auto cend(const _Container& _Cont) + noexcept(noexcept(_STD end(_Cont))) -> decltype(_STD end(_Cont)) { return _STD end(_Cont); } @@ -2134,8 +2127,8 @@ _NODISCARD constexpr ptrdiff_t ssize(const _Ty (&)[_Size]) noexcept { #endif // _HAS_CXX20 _EXPORT_STD template -_NODISCARD_EMPTY_NON_MEMBER constexpr auto empty(const _Container& _Cont) noexcept( - noexcept(_Cont.empty())) /* strengthened */ +_NODISCARD_EMPTY_NON_MEMBER constexpr auto empty(const _Container& _Cont) + noexcept(noexcept(_Cont.empty())) /* strengthened */ -> decltype(_Cont.empty()) { return _Cont.empty(); } @@ -2248,14 +2241,14 @@ public: : _Current(_STD move(_Current_)) {} template _Other> - constexpr basic_const_iterator(basic_const_iterator<_Other> _Current_) noexcept( - is_nothrow_constructible_v<_Iter, _Other>) // strengthened + constexpr basic_const_iterator(basic_const_iterator<_Other> _Current_) + noexcept(is_nothrow_constructible_v<_Iter, _Other>) // strengthened : _Current(_STD move(_Current_._Current)) {} template <_Different_from _Other> requires convertible_to<_Other, _Iter> - constexpr basic_const_iterator(_Other&& _Current_) noexcept( - is_nothrow_constructible_v<_Iter, _Other>) // strengthened + constexpr basic_const_iterator(_Other&& _Current_) + noexcept(is_nothrow_constructible_v<_Iter, _Other>) // strengthened : _Current(_STD forward<_Other>(_Current_)) {} _NODISCARD constexpr const _Iter& base() const& noexcept { @@ -2292,8 +2285,8 @@ public: ++_Current; } - constexpr basic_const_iterator operator++(int) noexcept( - noexcept(++*this) && is_nothrow_copy_constructible_v) // strengthened + constexpr basic_const_iterator operator++(int) + noexcept(noexcept(++*this) && is_nothrow_copy_constructible_v) // strengthened requires forward_iterator<_Iter> { auto _Tmp = *this; @@ -2308,8 +2301,8 @@ public: return *this; } - constexpr basic_const_iterator operator--(int) noexcept( - noexcept(--*this) && is_nothrow_copy_constructible_v) // strengthened + constexpr basic_const_iterator operator--(int) + noexcept(noexcept(--*this) && is_nothrow_copy_constructible_v) // strengthened requires bidirectional_iterator<_Iter> { auto _Tmp = *this; @@ -2317,16 +2310,16 @@ public: return _Tmp; } - constexpr basic_const_iterator& operator+=(const difference_type _Off) noexcept( - noexcept(_Current += _Off)) // strengthened + constexpr basic_const_iterator& operator+=(const difference_type _Off) + noexcept(noexcept(_Current += _Off)) // strengthened requires random_access_iterator<_Iter> { _Current += _Off; return *this; } - constexpr basic_const_iterator& operator-=(const difference_type _Off) noexcept( - noexcept(_Current -= _Off)) // strengthened + constexpr basic_const_iterator& operator-=(const difference_type _Off) + noexcept(noexcept(_Current -= _Off)) // strengthened requires random_access_iterator<_Iter> { _Current -= _Off; @@ -2432,29 +2425,29 @@ public: template <_Not_a_const_iterator _Other> requires random_access_iterator<_Iter> && totally_ordered_with<_Iter, _Other> - _NODISCARD friend constexpr bool operator<(const _Other& _Left, const basic_const_iterator& _Right) noexcept( - noexcept(_STD _Fake_copy_init(_Left < _Right._Current))) /* strengthened */ { + _NODISCARD friend constexpr bool operator<(const _Other& _Left, const basic_const_iterator& _Right) + noexcept(noexcept(_STD _Fake_copy_init(_Left < _Right._Current))) /* strengthened */ { return _Left < _Right._Current; } template <_Not_a_const_iterator _Other> requires random_access_iterator<_Iter> && totally_ordered_with<_Iter, _Other> - _NODISCARD friend constexpr bool operator>(const _Other& _Left, const basic_const_iterator& _Right) noexcept( - noexcept(_STD _Fake_copy_init(_Left > _Right._Current))) /* strengthened */ { + _NODISCARD friend constexpr bool operator>(const _Other& _Left, const basic_const_iterator& _Right) + noexcept(noexcept(_STD _Fake_copy_init(_Left > _Right._Current))) /* strengthened */ { return _Left > _Right._Current; } template <_Not_a_const_iterator _Other> requires random_access_iterator<_Iter> && totally_ordered_with<_Iter, _Other> - _NODISCARD friend constexpr bool operator<=(const _Other& _Left, const basic_const_iterator& _Right) noexcept( - noexcept(_STD _Fake_copy_init(_Left <= _Right._Current))) /* strengthened */ { + _NODISCARD friend constexpr bool operator<=(const _Other& _Left, const basic_const_iterator& _Right) + noexcept(noexcept(_STD _Fake_copy_init(_Left <= _Right._Current))) /* strengthened */ { return _Left <= _Right._Current; } template <_Not_a_const_iterator _Other> requires random_access_iterator<_Iter> && totally_ordered_with<_Iter, _Other> - _NODISCARD friend constexpr bool operator>=(const _Other& _Left, const basic_const_iterator& _Right) noexcept( - noexcept(_STD _Fake_copy_init(_Left >= _Right._Current))) /* strengthened */ { + _NODISCARD friend constexpr bool operator>=(const _Other& _Left, const basic_const_iterator& _Right) + noexcept(noexcept(_STD _Fake_copy_init(_Left >= _Right._Current))) /* strengthened */ { return _Left >= _Right._Current; } @@ -2487,13 +2480,13 @@ public: template <_Not_a_const_iterator _Sent> requires sized_sentinel_for<_Sent, _Iter> - _NODISCARD friend constexpr difference_type operator-(const _Sent& _Se, const basic_const_iterator& _It) noexcept( - noexcept(_Se - _It._Current)) /* strengthened */ { + _NODISCARD friend constexpr difference_type operator-(const _Sent& _Se, const basic_const_iterator& _It) + noexcept(noexcept(_Se - _It._Current)) /* strengthened */ { return _Se - _It._Current; } - _NODISCARD friend constexpr _Rvalue_reference iter_move(const basic_const_iterator& _It) noexcept( - noexcept(static_cast<_Rvalue_reference>(_RANGES iter_move(_It._Current)))) { + _NODISCARD friend constexpr _Rvalue_reference iter_move(const basic_const_iterator& _It) + noexcept(noexcept(static_cast<_Rvalue_reference>(_RANGES iter_move(_It._Current)))) { return static_cast<_Rvalue_reference>(_RANGES iter_move(_It._Current)); } }; @@ -2517,14 +2510,14 @@ struct common_type, basic_const_iterator<_Ty2>> { }; _EXPORT_STD template -_NODISCARD constexpr const_iterator<_Iter> make_const_iterator(_Iter _It) noexcept( - is_nothrow_constructible_v, _Iter&>) /* strengthened */ { +_NODISCARD constexpr const_iterator<_Iter> make_const_iterator(_Iter _It) + noexcept(is_nothrow_constructible_v, _Iter&>) /* strengthened */ { return _It; } _EXPORT_STD template -_NODISCARD constexpr const_sentinel<_Sent> make_const_sentinel(_Sent _Se) noexcept( - is_nothrow_constructible_v, _Sent&>) /* strengthened */ { +_NODISCARD constexpr const_sentinel<_Sent> make_const_sentinel(_Sent _Se) + noexcept(is_nothrow_constructible_v, _Sent&>) /* strengthened */ { return _Se; } #endif // _HAS_CXX23 @@ -2721,8 +2714,8 @@ namespace ranges { }; template - _NODISCARD constexpr decltype(auto) _Unwrap_iter(_Iter&& _It) noexcept( - !_Unwrappable_sentinel_for<_Sent, _Iter> || _Has_nothrow_unwrapped<_Iter>) { + _NODISCARD constexpr decltype(auto) _Unwrap_iter(_Iter&& _It) + noexcept(!_Unwrappable_sentinel_for<_Sent, _Iter> || _Has_nothrow_unwrapped<_Iter>) { _STL_INTERNAL_STATIC_ASSERT(sentinel_for, remove_cvref_t<_Iter>>); if constexpr (is_pointer_v>) { return _It + 0; @@ -2734,8 +2727,8 @@ namespace ranges { } template - _NODISCARD constexpr decltype(auto) _Unwrap_sent(_Sent&& _Se) noexcept( - !_Unwrappable_sentinel_for<_Sent, _Iter> || _Has_nothrow_unwrapped<_Sent>) { + _NODISCARD constexpr decltype(auto) _Unwrap_sent(_Sent&& _Se) + noexcept(!_Unwrappable_sentinel_for<_Sent, _Iter> || _Has_nothrow_unwrapped<_Sent>) { _STL_INTERNAL_STATIC_ASSERT(sentinel_for, remove_cvref_t<_Iter>>); if constexpr (is_pointer_v>) { return _Se + 0; @@ -2747,15 +2740,15 @@ namespace ranges { } template - _NODISCARD constexpr decltype(auto) _Unwrap_range_iter(_Iter&& _It) noexcept( - noexcept(_RANGES _Unwrap_iter>(static_cast<_Iter&&>(_It)))) { + _NODISCARD constexpr decltype(auto) _Unwrap_range_iter(_Iter&& _It) + noexcept(noexcept(_RANGES _Unwrap_iter>(static_cast<_Iter&&>(_It)))) { _STL_INTERNAL_STATIC_ASSERT(same_as, iterator_t<_Rng>>); return _RANGES _Unwrap_iter>(static_cast<_Iter&&>(_It)); } template - _NODISCARD constexpr decltype(auto) _Unwrap_range_sent(_Sent&& _Se) noexcept( - noexcept(_RANGES _Unwrap_sent>(static_cast<_Sent&&>(_Se)))) { + _NODISCARD constexpr decltype(auto) _Unwrap_range_sent(_Sent&& _Se) + noexcept(noexcept(_RANGES _Unwrap_sent>(static_cast<_Sent&&>(_Se)))) { _STL_INTERNAL_STATIC_ASSERT(same_as, sentinel_t<_Rng>>); return _RANGES _Unwrap_sent>(static_cast<_Sent&&>(_Se)); } @@ -3561,8 +3554,8 @@ namespace ranges { private: template - _NODISCARD static constexpr iter_difference_t<_It> _Distance_unchecked(_It _First, const _Se _Last) noexcept( - noexcept(++_First != _Last)) { + _NODISCARD static constexpr iter_difference_t<_It> _Distance_unchecked(_It _First, const _Se _Last) + noexcept(noexcept(++_First != _Last)) { _STL_INTERNAL_STATIC_ASSERT(sentinel_for<_Se, _It>); iter_difference_t<_It> _Count = 0; @@ -4236,8 +4229,8 @@ public: #if _HAS_CXX20 requires (!is_same_v<_Other, _Iter>) && convertible_to #endif // _HAS_CXX20 - _CONSTEXPR17 move_iterator(const move_iterator<_Other>& _Right) noexcept( - is_nothrow_constructible_v<_Iter, const _Other&>) // strengthened + _CONSTEXPR17 move_iterator(const move_iterator<_Other>& _Right) + noexcept(is_nothrow_constructible_v<_Iter, const _Other&>) // strengthened : _Current(_Right.base()) { } @@ -4246,8 +4239,8 @@ public: requires (!is_same_v<_Other, _Iter>) && convertible_to && assignable_from<_Iter&, const _Other&> #endif // _HAS_CXX20 - _CONSTEXPR17 move_iterator& operator=(const move_iterator<_Other>& _Right) noexcept( - is_nothrow_assignable_v<_Iter&, const _Other&>) /* strengthened */ { + _CONSTEXPR17 move_iterator& operator=(const move_iterator<_Other>& _Right) + noexcept(is_nothrow_assignable_v<_Iter&, const _Other&>) /* strengthened */ { _Current = _Right.base(); return *this; } @@ -4331,8 +4324,8 @@ public: return move_iterator(_Current + _Off); } - _CONSTEXPR17 move_iterator& operator+=(const difference_type _Off) noexcept( - noexcept(_Current += _Off)) /* strengthened */ { + _CONSTEXPR17 move_iterator& operator+=(const difference_type _Off) + noexcept(noexcept(_Current += _Off)) /* strengthened */ { _Current += _Off; return *this; } @@ -4342,8 +4335,8 @@ public: return move_iterator(_Current - _Off); } - _CONSTEXPR17 move_iterator& operator-=(const difference_type _Off) noexcept( - noexcept(_Current -= _Off)) /* strengthened */ { + _CONSTEXPR17 move_iterator& operator-=(const difference_type _Off) + noexcept(noexcept(_Current -= _Off)) /* strengthened */ { _Current -= _Off; return *this; } @@ -4360,9 +4353,8 @@ public: #if _HAS_CXX20 template _Sent> - _NODISCARD friend constexpr bool - operator==(const move_iterator& _Left, const move_sentinel<_Sent>& _Right) noexcept( - noexcept(_STD _Fake_copy_init(_Left._Current == _Right._Get_last()))) /* strengthened */ { + _NODISCARD friend constexpr bool operator==(const move_iterator& _Left, const move_sentinel<_Sent>& _Right) + noexcept(noexcept(_STD _Fake_copy_init(_Left._Current == _Right._Get_last()))) /* strengthened */ { return _Left._Current == _Right._Get_last(); } @@ -4378,14 +4370,14 @@ public: return _Left._Current - _Right._Get_last(); } - _NODISCARD friend constexpr reference iter_move(const move_iterator& _It) noexcept( - noexcept(_RANGES iter_move(_It._Current))) { + _NODISCARD friend constexpr reference iter_move(const move_iterator& _It) + noexcept(noexcept(_RANGES iter_move(_It._Current))) { return _RANGES iter_move(_It._Current); } template _Iter2> - friend constexpr void iter_swap(const move_iterator& _Left, const move_iterator<_Iter2>& _Right) noexcept( - noexcept(_RANGES iter_swap(_Left._Current, _Right.base()))) { + friend constexpr void iter_swap(const move_iterator& _Left, const move_iterator<_Iter2>& _Right) + noexcept(noexcept(_RANGES iter_swap(_Left._Current, _Right.base()))) { _RANGES iter_swap(_Left._Current, _Right.base()); } #endif // _HAS_CXX20 @@ -4427,8 +4419,8 @@ public: _Current._Seek_to(_It._Get_current()); } template , int> = 0> - constexpr void _Seek_to(move_iterator<_Src>&& _It) noexcept( - noexcept(_Current._Seek_to(_STD move(_It)._Get_current()))) { + constexpr void _Seek_to(move_iterator<_Src>&& _It) + noexcept(noexcept(_Current._Seek_to(_STD move(_It)._Get_current()))) { _Current._Seek_to(_STD move(_It)._Get_current()); } @@ -4441,9 +4433,8 @@ public: }; _EXPORT_STD template -_NODISCARD _CONSTEXPR17 bool - operator==(const move_iterator<_Iter1>& _Left, const move_iterator<_Iter2>& _Right) noexcept( - noexcept(_STD _Fake_copy_init(_Left.base() == _Right.base()))) /* strengthened */ +_NODISCARD _CONSTEXPR17 bool operator==(const move_iterator<_Iter1>& _Left, const move_iterator<_Iter2>& _Right) + noexcept(noexcept(_STD _Fake_copy_init(_Left.base() == _Right.base()))) /* strengthened */ #if _HAS_CXX20 requires requires { { _Left.base() == _Right.base() } -> _Implicitly_convertible_to; @@ -4455,16 +4446,15 @@ _NODISCARD _CONSTEXPR17 bool #if !_HAS_CXX20 template -_NODISCARD _CONSTEXPR17 bool operator!=(const move_iterator<_Iter1>& _Left, - const move_iterator<_Iter2>& _Right) noexcept(noexcept(_Left == _Right)) /* strengthened */ { +_NODISCARD _CONSTEXPR17 bool operator!=(const move_iterator<_Iter1>& _Left, const move_iterator<_Iter2>& _Right) + noexcept(noexcept(_Left == _Right)) /* strengthened */ { return !(_Left == _Right); } #endif // !_HAS_CXX20 _EXPORT_STD template -_NODISCARD _CONSTEXPR17 bool - operator<(const move_iterator<_Iter1>& _Left, const move_iterator<_Iter2>& _Right) noexcept( - noexcept(_STD _Fake_copy_init(_Left.base() < _Right.base()))) /* strengthened */ +_NODISCARD _CONSTEXPR17 bool operator<(const move_iterator<_Iter1>& _Left, const move_iterator<_Iter2>& _Right) + noexcept(noexcept(_STD _Fake_copy_init(_Left.base() < _Right.base()))) /* strengthened */ #if _HAS_CXX20 requires requires { { _Left.base() < _Right.base() } -> _Implicitly_convertible_to; @@ -4475,8 +4465,8 @@ _NODISCARD _CONSTEXPR17 bool } _EXPORT_STD template -_NODISCARD _CONSTEXPR17 bool operator>(const move_iterator<_Iter1>& _Left, - const move_iterator<_Iter2>& _Right) noexcept(noexcept(_Right < _Left)) /* strengthened */ +_NODISCARD _CONSTEXPR17 bool operator>(const move_iterator<_Iter1>& _Left, const move_iterator<_Iter2>& _Right) + noexcept(noexcept(_Right < _Left)) /* strengthened */ #if _HAS_CXX20 requires requires { _Right < _Left; } #endif // _HAS_CXX20 @@ -4485,8 +4475,8 @@ _NODISCARD _CONSTEXPR17 bool operator>(const move_iterator<_Iter1>& _Left, } _EXPORT_STD template -_NODISCARD _CONSTEXPR17 bool operator<=(const move_iterator<_Iter1>& _Left, - const move_iterator<_Iter2>& _Right) noexcept(noexcept(_Right < _Left)) /* strengthened */ +_NODISCARD _CONSTEXPR17 bool operator<=(const move_iterator<_Iter1>& _Left, const move_iterator<_Iter2>& _Right) + noexcept(noexcept(_Right < _Left)) /* strengthened */ #if _HAS_CXX20 requires requires { _Right < _Left; } #endif // _HAS_CXX20 @@ -4495,8 +4485,8 @@ _NODISCARD _CONSTEXPR17 bool operator<=(const move_iterator<_Iter1>& _Left, } _EXPORT_STD template -_NODISCARD _CONSTEXPR17 bool operator>=(const move_iterator<_Iter1>& _Left, - const move_iterator<_Iter2>& _Right) noexcept(noexcept(_Left < _Right)) /* strengthened */ +_NODISCARD _CONSTEXPR17 bool operator>=(const move_iterator<_Iter1>& _Left, const move_iterator<_Iter2>& _Right) + noexcept(noexcept(_Left < _Right)) /* strengthened */ #if _HAS_CXX20 requires requires { _Left < _Right; } #endif // _HAS_CXX20 @@ -4513,16 +4503,16 @@ _NODISCARD constexpr compare_three_way_result_t<_Iter1, _Iter2> operator<=>(cons #endif // _HAS_CXX20 _EXPORT_STD template -_NODISCARD _CONSTEXPR17 auto operator-(const move_iterator<_Iter1>& _Left, - const move_iterator<_Iter2>& _Right) noexcept(noexcept(_Left.base() - _Right.base())) /* strengthened */ +_NODISCARD _CONSTEXPR17 auto operator-(const move_iterator<_Iter1>& _Left, const move_iterator<_Iter2>& _Right) + noexcept(noexcept(_Left.base() - _Right.base())) /* strengthened */ -> decltype(_Left.base() - _Right.base()) { return _Left.base() - _Right.base(); } _EXPORT_STD template -_NODISCARD _CONSTEXPR17 move_iterator<_Iter> - operator+(typename move_iterator<_Iter>::difference_type _Off, const move_iterator<_Iter>& _Right) noexcept( - noexcept(move_iterator<_Iter>(_Right.base() + _Off))) /* strengthened */ +_NODISCARD _CONSTEXPR17 move_iterator<_Iter> operator+( + typename move_iterator<_Iter>::difference_type _Off, const move_iterator<_Iter>& _Right) + noexcept(noexcept(move_iterator<_Iter>(_Right.base() + _Off))) /* strengthened */ #if _HAS_CXX20 requires requires { { _Right.base() + _Off } -> same_as<_Iter>; @@ -4533,8 +4523,8 @@ _NODISCARD _CONSTEXPR17 move_iterator<_Iter> } _EXPORT_STD template -_NODISCARD _CONSTEXPR17 move_iterator<_Iter> make_move_iterator(_Iter _It) noexcept( - is_nothrow_move_constructible_v<_Iter>) /* strengthened */ { +_NODISCARD _CONSTEXPR17 move_iterator<_Iter> make_move_iterator(_Iter _It) + noexcept(is_nothrow_move_constructible_v<_Iter>) /* strengthened */ { return move_iterator<_Iter>(_STD move(_It)); } diff --git a/tests/std/include/range_algorithm_support.hpp b/tests/std/include/range_algorithm_support.hpp index bacd8e809a..3af278dd7e 100644 --- a/tests/std/include/range_algorithm_support.hpp +++ b/tests/std/include/range_algorithm_support.hpp @@ -526,8 +526,8 @@ namespace test { return std::move(*i.ptr_); } - friend constexpr void iter_swap(iterator const& x, iterator const& y) noexcept( - std::is_nothrow_swappable_v) + friend constexpr void iter_swap(iterator const& x, iterator const& y) + noexcept(std::is_nothrow_swappable_v) requires at_least && std::swappable { ranges::swap(*x.ptr_, *y.ptr_); diff --git a/tests/std/tests/P0323R12_expected/test.cpp b/tests/std/tests/P0323R12_expected/test.cpp index 82a8d09d0e..e6cd96833e 100644 --- a/tests/std/tests/P0323R12_expected/test.cpp +++ b/tests/std/tests/P0323R12_expected/test.cpp @@ -475,14 +475,14 @@ namespace test_expected { struct payload_constructors { payload_constructors() = default; // Note clang does not accept local variables in explicit - constexpr explicit(IsYes(explicitConstructible)) - payload_constructors(const convertible&) noexcept(should_be_noexcept) + constexpr explicit(IsYes(explicitConstructible)) payload_constructors(const convertible&) + noexcept(should_be_noexcept) : _val(3) {} - constexpr explicit(IsYes(explicitConstructible)) - payload_constructors(convertible&&) noexcept(should_be_noexcept) + constexpr explicit(IsYes(explicitConstructible)) payload_constructors(convertible&&) + noexcept(should_be_noexcept) : _val(42) {} - constexpr explicit(IsYes(explicitConstructible)) - payload_constructors(initializer_list&, convertible) noexcept(should_be_noexcept) + constexpr explicit(IsYes(explicitConstructible)) payload_constructors(initializer_list&, convertible) + noexcept(should_be_noexcept) : _val(1337) {} [[nodiscard]] constexpr bool operator==(const int val) const noexcept { diff --git a/tests/std/tests/P0768R1_spaceship_cpos/test.cpp b/tests/std/tests/P0768R1_spaceship_cpos/test.cpp index 350f7ec1ec..0ed16e84dc 100644 --- a/tests/std/tests/P0768R1_spaceship_cpos/test.cpp +++ b/tests/std/tests/P0768R1_spaceship_cpos/test.cpp @@ -76,8 +76,8 @@ namespace TestAdl { }; template - [[nodiscard]] constexpr strong_ordering strong_order( - const StrongType& left, const StrongType& right) noexcept(NE) { + [[nodiscard]] constexpr strong_ordering strong_order(const StrongType& left, const StrongType& right) + noexcept(NE) { return left.val <=> right.val; } @@ -97,8 +97,8 @@ namespace TestAdl { }; template - [[nodiscard]] constexpr partial_ordering partial_order( - const PartialType& left, const PartialType& right) noexcept(NE) { + [[nodiscard]] constexpr partial_ordering partial_order(const PartialType& left, const PartialType& right) + noexcept(NE) { return left.val <=> right.val; } } // namespace TestAdl diff --git a/tests/std/tests/P1206R7_ranges_to_misc/test.cpp b/tests/std/tests/P1206R7_ranges_to_misc/test.cpp index 25df9eb68f..23eb2d4dd8 100644 --- a/tests/std/tests/P1206R7_ranges_to_misc/test.cpp +++ b/tests/std/tests/P1206R7_ranges_to_misc/test.cpp @@ -239,8 +239,8 @@ class restricted_vector : private std::vector { constexpr restricted_vector(const size_type n, const T& val, const A& alloc = A()) : base_type(n, val, alloc) {} constexpr restricted_vector(const std::initializer_list il, const A& alloc = A()) : base_type(il, alloc) {} constexpr restricted_vector(const restricted_vector& other, const A& alloc) : base_type(other, alloc) {} - constexpr restricted_vector(restricted_vector&& other, const A& alloc) noexcept( - std::allocator_traits::is_always_equal::value) + constexpr restricted_vector(restricted_vector&& other, const A& alloc) + noexcept(std::allocator_traits::is_always_equal::value) : base_type(std::move(other), alloc) {} using base_type::begin; From fbce5b3652bfe73ed834f53a60425e2103b85151 Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Tue, 10 Sep 2024 17:57:18 -0700 Subject: [PATCH 19/30] LLVM-51935 was fixed, but AlignArrayOfStructures appears to be more trouble than it's worth. --- .clang-format | 1 - 1 file changed, 1 deletion(-) diff --git a/.clang-format b/.clang-format index ef32fa976c..1acd630668 100644 --- a/.clang-format +++ b/.clang-format @@ -22,7 +22,6 @@ AccessModifierOffset: -4 # AlignAfterOpenBracket: Align AlignAfterOpenBracket: DontAlign # AlignArrayOfStructures: None -# TRANSITION, LLVM-51935 (try using AlignArrayOfStructures after this crash is fixed) # AlignConsecutiveAssignments: # Enabled: false # AcrossEmptyLines: false From 6db42b65f4a1210f158eb7f443738617d31c99ba Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Tue, 10 Sep 2024 19:42:56 -0700 Subject: [PATCH 20/30] Manual: Add parens to avoid spaces around arrow operator. --- stl/inc/xlocnum | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stl/inc/xlocnum b/stl/inc/xlocnum index 6cc2d13261..b9085095e0 100644 --- a/stl/inc/xlocnum +++ b/stl/inc/xlocnum @@ -970,7 +970,7 @@ private: *_Ptr++ = '0'; // save at least one leading digit for hex } - const char _Decimal_point = _CSTD localeconv() -> decimal_point[0]; + const char _Decimal_point = (_CSTD localeconv())->decimal_point[0]; if (_First != _Last && *_First == _Punct_fac.decimal_point()) { // add . *_Ptr++ = _Decimal_point; ++_First; @@ -1487,7 +1487,7 @@ private: } const size_t _Eoff = _CSTD strcspn(&_Buf[0], _Exps); // find exponent char _Dp[2] = {"."}; - _Dp[0] = _CSTD localeconv() -> decimal_point[0]; + _Dp[0] = (_CSTD localeconv())->decimal_point[0]; const size_t _Poff = _CSTD strcspn(&_Buf[0], &_Dp[0]); // find decimal point const ctype<_Elem>& _Ctype_fac = _STD use_facet>(_Iosbase.getloc()); From 324ec0c7f312c0a52aafaebbd6cf044f7c1e7c78 Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Tue, 10 Sep 2024 18:57:01 -0700 Subject: [PATCH 21/30] Manual: Detach comment. --- stl/inc/scoped_allocator | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stl/inc/scoped_allocator b/stl/inc/scoped_allocator index 6d5f2c034c..0ad22596af 100644 --- a/stl/inc/scoped_allocator +++ b/stl/inc/scoped_allocator @@ -205,8 +205,8 @@ public: return static_cast(*this); } - _NODISCARD_RAW_PTR_ALLOC __declspec(allocator) pointer allocate( - _CRT_GUARDOVERFLOW size_type _Count) { // allocate array of _Count elements, ignore hint + _NODISCARD_RAW_PTR_ALLOC __declspec(allocator) pointer allocate(_CRT_GUARDOVERFLOW size_type _Count) { + // allocate array of _Count elements, ignore hint return _Outer_traits::allocate(outer_allocator(), _Count); } From 1a6a0eecb54fe294e341bdeafe77142edb22e6c3 Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Tue, 10 Sep 2024 19:23:41 -0700 Subject: [PATCH 22/30] Manual: Add forced wrapping before trailing return types. --- stl/inc/functional | 65 ++++++++++--------- stl/inc/tuple | 4 +- stl/inc/type_traits | 32 ++++----- stl/inc/xutility | 8 +-- .../test.compile.pass.cpp | 24 +++---- .../test.compile.pass.cpp | 4 +- 6 files changed, 72 insertions(+), 65 deletions(-) diff --git a/stl/inc/functional b/stl/inc/functional index be22133b67..d697e49f16 100644 --- a/stl/inc/functional +++ b/stl/inc/functional @@ -146,8 +146,8 @@ struct bit_not { template <> struct divides { template - _NODISCARD constexpr auto operator()( - _Ty1&& _Left, _Ty2&& _Right) const -> decltype(_STD forward<_Ty1>(_Left) / _STD forward<_Ty2>(_Right)) { + _NODISCARD constexpr auto operator()(_Ty1&& _Left, _Ty2&& _Right) const // + -> decltype(_STD forward<_Ty1>(_Left) / _STD forward<_Ty2>(_Right)) { return _STD forward<_Ty1>(_Left) / _STD forward<_Ty2>(_Right); } @@ -157,8 +157,8 @@ struct divides { template <> struct modulus { template - _NODISCARD constexpr auto operator()( - _Ty1&& _Left, _Ty2&& _Right) const -> decltype(_STD forward<_Ty1>(_Left) % _STD forward<_Ty2>(_Right)) { + _NODISCARD constexpr auto operator()(_Ty1&& _Left, _Ty2&& _Right) const // + -> decltype(_STD forward<_Ty1>(_Left) % _STD forward<_Ty2>(_Right)) { return _STD forward<_Ty1>(_Left) % _STD forward<_Ty2>(_Right); } @@ -180,8 +180,8 @@ struct negate { template <> struct logical_and { template - _NODISCARD constexpr auto operator()( - _Ty1&& _Left, _Ty2&& _Right) const -> decltype(_STD forward<_Ty1>(_Left) && _STD forward<_Ty2>(_Right)) { + _NODISCARD constexpr auto operator()(_Ty1&& _Left, _Ty2&& _Right) const // + -> decltype(_STD forward<_Ty1>(_Left) && _STD forward<_Ty2>(_Right)) { return _STD forward<_Ty1>(_Left) && _STD forward<_Ty2>(_Right); } @@ -191,8 +191,8 @@ struct logical_and { template <> struct logical_or { template - _NODISCARD constexpr auto operator()( - _Ty1&& _Left, _Ty2&& _Right) const -> decltype(_STD forward<_Ty1>(_Left) || _STD forward<_Ty2>(_Right)) { + _NODISCARD constexpr auto operator()(_Ty1&& _Left, _Ty2&& _Right) const // + -> decltype(_STD forward<_Ty1>(_Left) || _STD forward<_Ty2>(_Right)) { return _STD forward<_Ty1>(_Left) || _STD forward<_Ty2>(_Right); } @@ -212,8 +212,8 @@ struct logical_not { template <> struct bit_and { template - _NODISCARD constexpr auto operator()( - _Ty1&& _Left, _Ty2&& _Right) const -> decltype(_STD forward<_Ty1>(_Left) & _STD forward<_Ty2>(_Right)) { + _NODISCARD constexpr auto operator()(_Ty1&& _Left, _Ty2&& _Right) const // + -> decltype(_STD forward<_Ty1>(_Left) & _STD forward<_Ty2>(_Right)) { return _STD forward<_Ty1>(_Left) & _STD forward<_Ty2>(_Right); } @@ -223,8 +223,8 @@ struct bit_and { template <> struct bit_or { template - _NODISCARD constexpr auto operator()( - _Ty1&& _Left, _Ty2&& _Right) const -> decltype(_STD forward<_Ty1>(_Left) | _STD forward<_Ty2>(_Right)) { + _NODISCARD constexpr auto operator()(_Ty1&& _Left, _Ty2&& _Right) const // + -> decltype(_STD forward<_Ty1>(_Left) | _STD forward<_Ty2>(_Right)) { return _STD forward<_Ty1>(_Left) | _STD forward<_Ty2>(_Right); } @@ -234,8 +234,8 @@ struct bit_or { template <> struct bit_xor { template - _NODISCARD constexpr auto operator()( - _Ty1&& _Left, _Ty2&& _Right) const -> decltype(_STD forward<_Ty1>(_Left) ^ _STD forward<_Ty2>(_Right)) { + _NODISCARD constexpr auto operator()(_Ty1&& _Left, _Ty2&& _Right) const // + -> decltype(_STD forward<_Ty1>(_Left) ^ _STD forward<_Ty2>(_Right)) { return _STD forward<_Ty1>(_Left) ^ _STD forward<_Ty2>(_Right); } @@ -572,8 +572,9 @@ public: constexpr explicit _Mem_fn(_Memptr _Val) noexcept : _Pm(_Val) {} template - _CONSTEXPR20 auto operator()(_Types&&... _Args) const noexcept(noexcept(_STD invoke( - _Pm, _STD forward<_Types>(_Args)...))) -> decltype(_STD invoke(_Pm, _STD forward<_Types>(_Args)...)) { + _CONSTEXPR20 auto operator()(_Types&&... _Args) const + noexcept(noexcept(_STD invoke(_Pm, _STD forward<_Types>(_Args)...))) // + -> decltype(_STD invoke(_Pm, _STD forward<_Types>(_Args)...)) { return _STD invoke(_Pm, _STD forward<_Types>(_Args)...); } }; @@ -650,26 +651,30 @@ public: void operator()(_Types&&...) const&& = delete; #else // ^^^ _HAS_CXX20 / !_HAS_CXX20 vvv template - auto operator()(_Types&&... _Args) & noexcept(noexcept(!_STD invoke(this->_Get_val(), - _STD forward<_Types>(_Args)...))) -> decltype(!_STD declval>()) { + auto operator()(_Types&&... _Args) & noexcept( + noexcept(!_STD invoke(this->_Get_val(), _STD forward<_Types>(_Args)...))) // + -> decltype(!_STD declval>()) { return !_STD invoke(this->_Get_val(), _STD forward<_Types>(_Args)...); } template - auto operator()(_Types&&... _Args) const& noexcept(noexcept(!_STD invoke(this->_Get_val(), - _STD forward<_Types>(_Args)...))) -> decltype(!_STD declval>()) { + auto operator()(_Types&&... _Args) const& noexcept( + noexcept(!_STD invoke(this->_Get_val(), _STD forward<_Types>(_Args)...))) // + -> decltype(!_STD declval>()) { return !_STD invoke(this->_Get_val(), _STD forward<_Types>(_Args)...); } template - auto operator()(_Types&&... _Args) && noexcept(noexcept(!_STD invoke(_STD move(this->_Get_val()), - _STD forward<_Types>(_Args)...))) -> decltype(!_STD declval>()) { + auto operator()(_Types&&... _Args) && noexcept( + noexcept(!_STD invoke(_STD move(this->_Get_val()), _STD forward<_Types>(_Args)...))) // + -> decltype(!_STD declval>()) { return !_STD invoke(_STD move(this->_Get_val()), _STD forward<_Types>(_Args)...); } template - auto operator()(_Types&&... _Args) const&& noexcept(noexcept(!_STD invoke(_STD move(this->_Get_val()), - _STD forward<_Types>(_Args)...))) -> decltype(!_STD declval>()) { + auto operator()(_Types&&... _Args) const&& noexcept( + noexcept(!_STD invoke(_STD move(this->_Get_val()), _STD forward<_Types>(_Args)...))) // + -> decltype(!_STD declval>()) { return !_STD invoke(_STD move(this->_Get_val()), _STD forward<_Types>(_Args)...); } #endif // ^^^ !_HAS_CXX20 ^^^ @@ -2044,9 +2049,9 @@ struct _Select_fixer<_Cv_TiD, false, false, _Jx> { // placeholder fixer }; template -constexpr auto _Fix_arg(_Cv_TiD& _Tid, _Untuple&& _Ut) noexcept(noexcept( - _Select_fixer<_Cv_TiD>::_Fix(_Tid, _STD move(_Ut)))) -> decltype(_Select_fixer<_Cv_TiD>::_Fix(_Tid, - _STD move(_Ut))) { // translate an argument for bind +constexpr auto _Fix_arg(_Cv_TiD& _Tid, _Untuple&& _Ut) + noexcept(noexcept(_Select_fixer<_Cv_TiD>::_Fix(_Tid, _STD move(_Ut)))) // + -> decltype(_Select_fixer<_Cv_TiD>::_Fix(_Tid, _STD move(_Ut))) { // translate an argument for bind return _Select_fixer<_Cv_TiD>::_Fix(_Tid, _STD move(_Ut)); } @@ -2217,9 +2222,9 @@ namespace placeholders { template constexpr auto _Call_front_binder(index_sequence<_Ix...>, _Cv_FD&& _Obj, _Cv_tuple_TiD&& _Tpl, _Unbound&&... _Unbargs) noexcept(noexcept(_STD invoke(_STD forward<_Cv_FD>(_Obj), _STD get<_Ix>(_STD forward<_Cv_tuple_TiD>(_Tpl))..., - _STD forward<_Unbound>(_Unbargs)...))) -> decltype(_STD invoke(_STD forward<_Cv_FD>(_Obj), - _STD get<_Ix>(_STD forward<_Cv_tuple_TiD>(_Tpl))..., - _STD forward<_Unbound>(_Unbargs)...)) { + _STD forward<_Unbound>(_Unbargs)...))) // + -> decltype(_STD invoke(_STD forward<_Cv_FD>(_Obj), _STD get<_Ix>(_STD forward<_Cv_tuple_TiD>(_Tpl))..., + _STD forward<_Unbound>(_Unbargs)...)) { return _STD invoke(_STD forward<_Cv_FD>(_Obj), _STD get<_Ix>(_STD forward<_Cv_tuple_TiD>(_Tpl))..., _STD forward<_Unbound>(_Unbargs)...); } diff --git a/stl/inc/tuple b/stl/inc/tuple index 720b833129..81e42e4f9c 100644 --- a/stl/inc/tuple +++ b/stl/inc/tuple @@ -785,8 +785,8 @@ public: } 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 { + _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 diff --git a/stl/inc/type_traits b/stl/inc/type_traits index c8a9246f2e..91f78d99c2 100644 --- a/stl/inc/type_traits +++ b/stl/inc/type_traits @@ -1597,8 +1597,8 @@ struct _Invoker_functor { template static constexpr auto _Call(_Callable&& _Obj, _Types&&... _Args) - noexcept(noexcept(static_cast<_Callable&&>(_Obj)(static_cast<_Types&&>( - _Args)...))) -> decltype(static_cast<_Callable&&>(_Obj)(static_cast<_Types&&>(_Args)...)) { + noexcept(noexcept(static_cast<_Callable&&>(_Obj)(static_cast<_Types&&>(_Args)...))) // + -> decltype(static_cast<_Callable&&>(_Obj)(static_cast<_Types&&>(_Args)...)) { return static_cast<_Callable&&>(_Obj)(static_cast<_Types&&>(_Args)...); } }; @@ -1608,8 +1608,8 @@ struct _Invoker_pmf_object { template static constexpr auto _Call(_Decayed _Pmf, _Ty1&& _Arg1, _Types2&&... _Args2) - noexcept(noexcept((static_cast<_Ty1&&>(_Arg1).*_Pmf)(static_cast<_Types2&&>( - _Args2)...))) -> decltype((static_cast<_Ty1&&>(_Arg1).*_Pmf)(static_cast<_Types2&&>(_Args2)...)) { + noexcept(noexcept((static_cast<_Ty1&&>(_Arg1).*_Pmf)(static_cast<_Types2&&>(_Args2)...))) // + -> decltype((static_cast<_Ty1&&>(_Arg1).*_Pmf)(static_cast<_Types2&&>(_Args2)...)) { return (static_cast<_Ty1&&>(_Arg1).*_Pmf)(static_cast<_Types2&&>(_Args2)...); } }; @@ -1618,8 +1618,9 @@ struct _Invoker_pmf_refwrap { static constexpr _Invoker_strategy _Strategy = _Invoker_strategy::_Pmf_refwrap; template - static constexpr auto _Call(_Decayed _Pmf, _Refwrap _Rw, _Types2&&... _Args2) noexcept(noexcept((_Rw.get().*_Pmf)( - static_cast<_Types2&&>(_Args2)...))) -> decltype((_Rw.get().*_Pmf)(static_cast<_Types2&&>(_Args2)...)) { + static constexpr auto _Call(_Decayed _Pmf, _Refwrap _Rw, _Types2&&... _Args2) + noexcept(noexcept((_Rw.get().*_Pmf)(static_cast<_Types2&&>(_Args2)...))) // + -> decltype((_Rw.get().*_Pmf)(static_cast<_Types2&&>(_Args2)...)) { return (_Rw.get().*_Pmf)(static_cast<_Types2&&>(_Args2)...); } }; @@ -1629,8 +1630,8 @@ struct _Invoker_pmf_pointer { template static constexpr auto _Call(_Decayed _Pmf, _Ty1&& _Arg1, _Types2&&... _Args2) - noexcept(noexcept(((*static_cast<_Ty1&&>(_Arg1)).*_Pmf)(static_cast<_Types2&&>( - _Args2)...))) -> decltype(((*static_cast<_Ty1&&>(_Arg1)).*_Pmf)(static_cast<_Types2&&>(_Args2)...)) { + noexcept(noexcept(((*static_cast<_Ty1&&>(_Arg1)).*_Pmf)(static_cast<_Types2&&>(_Args2)...))) // + -> decltype(((*static_cast<_Ty1&&>(_Arg1)).*_Pmf)(static_cast<_Types2&&>(_Args2)...)) { return ((*static_cast<_Ty1&&>(_Arg1)).*_Pmf)(static_cast<_Types2&&>(_Args2)...); } }; @@ -1695,11 +1696,11 @@ constexpr auto invoke(_Callable&& _Obj) } _EXPORT_STD template -constexpr auto invoke(_Callable&& _Obj, _Ty1&& _Arg1, - _Types2&&... _Args2) noexcept(noexcept(_Invoker1<_Callable, _Ty1>::_Call(static_cast<_Callable&&>(_Obj), - static_cast<_Ty1&&>(_Arg1), - static_cast<_Types2&&>(_Args2)...))) -> decltype(_Invoker1<_Callable, _Ty1>::_Call(static_cast<_Callable&&>(_Obj), - static_cast<_Ty1&&>(_Arg1), static_cast<_Types2&&>(_Args2)...)) { +constexpr auto invoke(_Callable&& _Obj, _Ty1&& _Arg1, _Types2&&... _Args2) + noexcept(noexcept(_Invoker1<_Callable, _Ty1>::_Call( + static_cast<_Callable&&>(_Obj), static_cast<_Ty1&&>(_Arg1), static_cast<_Types2&&>(_Args2)...))) // + -> decltype(_Invoker1<_Callable, _Ty1>::_Call( + static_cast<_Callable&&>(_Obj), static_cast<_Ty1&&>(_Arg1), static_cast<_Types2&&>(_Args2)...)) { if constexpr (_Invoker1<_Callable, _Ty1>::_Strategy == _Invoker_strategy::_Functor) { return static_cast<_Callable&&>(_Obj)(static_cast<_Ty1&&>(_Arg1), static_cast<_Types2&&>(_Args2)...); } else if constexpr (_Invoker1<_Callable, _Ty1>::_Strategy == _Invoker_strategy::_Pmf_object) { @@ -2026,8 +2027,9 @@ private: public: template - _CONSTEXPR20 auto operator()(_Types&&... _Args) const noexcept(noexcept(_STD invoke( - *_Ptr, static_cast<_Types&&>(_Args)...))) -> decltype(_STD invoke(*_Ptr, static_cast<_Types&&>(_Args)...)) { + _CONSTEXPR20 auto operator()(_Types&&... _Args) const + noexcept(noexcept(_STD invoke(*_Ptr, static_cast<_Types&&>(_Args)...))) // + -> decltype(_STD invoke(*_Ptr, static_cast<_Types&&>(_Args)...)) { return _STD invoke(*_Ptr, static_cast<_Types&&>(_Args)...); } }; diff --git a/stl/inc/xutility b/stl/inc/xutility index 3cfc072d24..77cd4d57b5 100644 --- a/stl/inc/xutility +++ b/stl/inc/xutility @@ -4308,14 +4308,14 @@ public: } template - _NODISCARD auto operator==( - _Default_sentinel _Sentinel) const noexcept -> decltype(_STD declval() == _Sentinel) { + _NODISCARD auto operator==(_Default_sentinel _Sentinel) const noexcept // + -> decltype(_STD declval() == _Sentinel) { return _Current == _Sentinel; } template - _NODISCARD auto operator!=( - _Default_sentinel _Sentinel) const noexcept -> decltype(_STD declval() != _Sentinel) { + _NODISCARD auto operator!=(_Default_sentinel _Sentinel) const noexcept // + -> decltype(_STD declval() != _Sentinel) { return _Current != _Sentinel; } diff --git a/tests/std/tests/GH_000140_adl_proof_comparison/test.compile.pass.cpp b/tests/std/tests/GH_000140_adl_proof_comparison/test.compile.pass.cpp index 865cfbbac5..4eeea842fd 100644 --- a/tests/std/tests/GH_000140_adl_proof_comparison/test.compile.pass.cpp +++ b/tests/std/tests/GH_000140_adl_proof_comparison/test.compile.pass.cpp @@ -142,34 +142,34 @@ struct validating_iterator_provider::iterator { } template , int> = 0> - friend constexpr auto operator==(iterator i, - OtherIter j) noexcept -> decltype(pointer{} == typename OtherIter::pointer{} ? placeholder_addr : nullptr) { + friend constexpr auto operator==(iterator i, OtherIter j) noexcept // + -> decltype(pointer{} == typename OtherIter::pointer{} ? placeholder_addr : nullptr) { return i.operator->() == j.operator->() ? placeholder_addr : nullptr; } template , int> = 0> - friend constexpr auto operator!=(iterator i, - OtherIter j) noexcept -> decltype(pointer{} != typename OtherIter::pointer{} ? placeholder_addr : nullptr) { + friend constexpr auto operator!=(iterator i, OtherIter j) noexcept // + -> decltype(pointer{} != typename OtherIter::pointer{} ? placeholder_addr : nullptr) { return i.operator->() != j.operator->() ? placeholder_addr : nullptr; } template , int> = 0> - friend constexpr auto operator<(iterator i, - OtherIter j) noexcept -> decltype(pointer{} < typename OtherIter::pointer{} ? placeholder_addr : nullptr) { + friend constexpr auto operator<(iterator i, OtherIter j) noexcept // + -> decltype(pointer{} < typename OtherIter::pointer{} ? placeholder_addr : nullptr) { return i.operator->() < j.operator->() ? placeholder_addr : nullptr; } template , int> = 0> - friend constexpr auto operator>(iterator i, - OtherIter j) noexcept -> decltype(pointer{} > typename OtherIter::pointer{} ? placeholder_addr : nullptr) { + friend constexpr auto operator>(iterator i, OtherIter j) noexcept // + -> decltype(pointer{} > typename OtherIter::pointer{} ? placeholder_addr : nullptr) { return i.operator->() > j.operator->() ? placeholder_addr : nullptr; } template , int> = 0> - friend constexpr auto operator<=(iterator i, - OtherIter j) noexcept -> decltype(pointer{} <= typename OtherIter::pointer{} ? placeholder_addr : nullptr) { + friend constexpr auto operator<=(iterator i, OtherIter j) noexcept // + -> decltype(pointer{} <= typename OtherIter::pointer{} ? placeholder_addr : nullptr) { return i.operator->() <= j.operator->() ? placeholder_addr : nullptr; } template , int> = 0> - friend constexpr auto operator>=(iterator i, - OtherIter j) noexcept -> decltype(pointer{} >= typename OtherIter::pointer{} ? placeholder_addr : nullptr) { + friend constexpr auto operator>=(iterator i, OtherIter j) noexcept // + -> decltype(pointer{} >= typename OtherIter::pointer{} ? placeholder_addr : nullptr) { return i.operator->() >= j.operator->() ? placeholder_addr : nullptr; } diff --git a/tests/std/tests/GH_001596_adl_proof_algorithms/test.compile.pass.cpp b/tests/std/tests/GH_001596_adl_proof_algorithms/test.compile.pass.cpp index e1f614e1b7..4d4ff4c709 100644 --- a/tests/std/tests/GH_001596_adl_proof_algorithms/test.compile.pass.cpp +++ b/tests/std/tests/GH_001596_adl_proof_algorithms/test.compile.pass.cpp @@ -40,8 +40,8 @@ struct tagged_less { template struct tagged_zero_equality { template - constexpr auto operator()( - T&& t) const -> decltype(std::forward(t) == std::remove_cv_t>{}) { + constexpr auto operator()(T&& t) const // + -> decltype(std::forward(t) == std::remove_cv_t>{}) { return std::forward(t) == std::remove_cv_t>{}; } }; From ba89fdd89f2663c06603ec905754d4f1ea6d2a97 Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Tue, 10 Sep 2024 18:57:21 -0700 Subject: [PATCH 23/30] Manual: Remove forced wrapping. --- stl/inc/memory | 2 +- stl/inc/ranges | 48 ++++++++----------- stl/inc/stacktrace | 8 ++-- stl/inc/xutility | 14 +++--- .../P2374R4_views_cartesian_product/test.cpp | 5 +- 5 files changed, 34 insertions(+), 43 deletions(-) diff --git a/stl/inc/memory b/stl/inc/memory index 7d9fc4c7af..7b0f0e54b5 100644 --- a/stl/inc/memory +++ b/stl/inc/memory @@ -4400,7 +4400,7 @@ private: public: explicit inout_ptr_t(_SmartPtr& _Smart_ptr_, _ArgsT... _Args_) - noexcept(is_nothrow_constructible_v, _ArgsT...> // + noexcept(is_nothrow_constructible_v, _ArgsT...> && noexcept(_Get_ptr_from_smart(_Smart_ptr_))) /* strengthened */ : _Smart_ptr(_Smart_ptr_), _Mypair(_One_then_variadic_args_t{}, tuple<_ArgsT...>{_STD forward<_ArgsT>(_Args_)...}, diff --git a/stl/inc/ranges b/stl/inc/ranges index cb77f96469..d1e0fc1c0b 100644 --- a/stl/inc/ranges +++ b/stl/inc/ranges @@ -369,8 +369,7 @@ namespace ranges { template <_Different_from<_Ty> _Uty> requires convertible_to constexpr _Defaultabox(const _Defaultabox<_Uty>& _That) - noexcept(is_nothrow_default_constructible_v<_Ty> // - && noexcept(_Value = static_cast<_Ty>(*_That))) { + noexcept(is_nothrow_default_constructible_v<_Ty> && noexcept(_Value = static_cast<_Ty>(*_That))) { if (_That) { _Value = static_cast<_Ty>(*_That); } @@ -378,9 +377,8 @@ namespace ranges { template <_Different_from<_Ty> _Uty> requires convertible_to<_Uty, _Ty> - constexpr _Defaultabox(_Defaultabox<_Uty>&& _That) - noexcept(is_nothrow_default_constructible_v<_Ty> // - && noexcept(_Value = static_cast<_Ty>(_STD move(*_That)))) { + constexpr _Defaultabox(_Defaultabox<_Uty>&& _That) noexcept( + is_nothrow_default_constructible_v<_Ty> && noexcept(_Value = static_cast<_Ty>(_STD move(*_That)))) { if (_That) { _Value = static_cast<_Ty>(_STD move(*_That)); } @@ -855,24 +853,21 @@ namespace ranges { } _NODISCARD friend constexpr _Ioterator operator+(_Ioterator _It, const difference_type _Off) - noexcept(is_nothrow_move_constructible_v<_Ioterator> // - && noexcept(_It += _Off)) /* strengthened */ + noexcept(is_nothrow_move_constructible_v<_Ioterator> && noexcept(_It += _Off)) /* strengthened */ requires _Advanceable<_Wi> { _It += _Off; return _It; } - _NODISCARD friend constexpr _Ioterator operator+(const difference_type _Off, _Ioterator _It) - noexcept(is_nothrow_move_constructible_v<_Wi> // - && noexcept(static_cast<_Wi>(_It._Current + _Off))) /* strengthened */ + _NODISCARD friend constexpr _Ioterator operator+(const difference_type _Off, _Ioterator _It) noexcept( + is_nothrow_move_constructible_v<_Wi> && noexcept(static_cast<_Wi>(_It._Current + _Off))) /* strengthened */ requires _Advanceable<_Wi> { return _Ioterator{static_cast<_Wi>(_It._Current + _Off)}; } _NODISCARD friend constexpr _Ioterator operator-(_Ioterator _It, const difference_type _Off) - noexcept(is_nothrow_move_constructible_v<_Ioterator> // - && noexcept(_It -= _Off)) /* strengthened */ + noexcept(is_nothrow_move_constructible_v<_Ioterator> && noexcept(_It -= _Off)) /* strengthened */ requires _Advanceable<_Wi> { _It -= _Off; @@ -1268,7 +1263,7 @@ namespace ranges { requires constructible_from<_Ty, _TArgs...> && constructible_from<_Bo, _BArgs...> _NODISCARD_CTOR constexpr explicit repeat_view( piecewise_construct_t, tuple<_TArgs...> _Val_args, tuple<_BArgs...> _Bound_args = tuple<>{}) - noexcept(is_nothrow_constructible_v<_Ty, _TArgs...> // + noexcept(is_nothrow_constructible_v<_Ty, _TArgs...> && noexcept(_STD make_from_tuple<_Bo>(_Bound_args))) // strengthened : repeat_view(_Val_args, index_sequence_for<_TArgs...>{}, _STD make_from_tuple<_Bo>(_Bound_args)) { #if _CONTAINER_DEBUG_LEVEL > 0 @@ -5257,7 +5252,7 @@ namespace ranges { } _NODISCARD friend constexpr _Iterator operator+(const _Iterator& _It, const difference_type _Off) - noexcept(is_nothrow_copy_constructible_v<_Iterator> // + noexcept(is_nothrow_copy_constructible_v<_Iterator> && noexcept(_STD declval<_Iterator&>() += _Off)) // strengthened requires random_access_range<_Base_t> { @@ -5274,7 +5269,7 @@ namespace ranges { } _NODISCARD friend constexpr _Iterator operator-(const _Iterator& _It, const difference_type _Off) - noexcept(is_nothrow_copy_constructible_v<_Iterator> // + noexcept(is_nothrow_copy_constructible_v<_Iterator> && noexcept(_STD declval<_Iterator&>() -= _Off)) // strengthened requires random_access_range<_Base_t> { @@ -5762,9 +5757,9 @@ namespace ranges { _Iterator() = default; constexpr _Iterator(_Iterator _Other) - noexcept(is_nothrow_constructible_v<_Base_iterator, typename _Iterator::_Base_iterator> // - && is_nothrow_constructible_v<_Base_sentinel, typename _Iterator::_Base_sentinel> // - ) /* strengthened */ + noexcept(is_nothrow_constructible_v<_Base_iterator, typename _Iterator::_Base_iterator> + && is_nothrow_constructible_v<_Base_sentinel, + typename _Iterator::_Base_sentinel>) /* strengthened */ requires _Const && convertible_to, _Base_iterator> && convertible_to, _Base_sentinel> : _Current(_STD move(_Other._Current)), _End(_STD move(_Other._End)), _Count(_Other._Count), @@ -5902,7 +5897,7 @@ namespace ranges { } _NODISCARD friend constexpr _Iterator operator+(const _Iterator& _It, const difference_type _Off) - noexcept(is_nothrow_copy_constructible_v<_Iterator> // + noexcept(is_nothrow_copy_constructible_v<_Iterator> && noexcept(_STD declval<_Iterator&>() += _Off)) /* strengthened */ requires random_access_range<_Base> { @@ -5912,7 +5907,7 @@ namespace ranges { } _NODISCARD friend constexpr _Iterator operator+(const difference_type _Off, const _Iterator& _It) - noexcept(is_nothrow_copy_constructible_v<_Iterator> // + noexcept(is_nothrow_copy_constructible_v<_Iterator> && noexcept(_STD declval<_Iterator&>() += _Off)) /* strengthened */ requires random_access_range<_Base> { @@ -5922,7 +5917,7 @@ namespace ranges { } _NODISCARD friend constexpr _Iterator operator-(const _Iterator& _It, const difference_type _Off) - noexcept(is_nothrow_copy_constructible_v<_Iterator> // + noexcept(is_nothrow_copy_constructible_v<_Iterator> && noexcept(_STD declval<_Iterator&>() -= _Off)) /* strengthened */ requires random_access_range<_Base> { @@ -6399,9 +6394,9 @@ namespace ranges { } } - _NODISCARD constexpr auto end() const noexcept(is_nothrow_move_constructible_v> // - && noexcept(_RANGES distance(_Range)) - && noexcept(_RANGES begin(_Range) + _Count)) /* strengthened */ + _NODISCARD constexpr auto end() const + noexcept(is_nothrow_move_constructible_v> && noexcept(_RANGES distance(_Range)) + && noexcept(_RANGES begin(_Range) + _Count)) /* strengthened */ requires _Slide_caches_nothing { const auto _Size = _RANGES distance(_Range) - (_Count - 1); @@ -6722,9 +6717,8 @@ namespace ranges { // clang-format on constexpr _Iterator(_Iterator _Other) - noexcept(is_nothrow_constructible_v<_Base_iterator, iterator_t<_Vw>> // - && is_nothrow_constructible_v<_Base_sentinel, sentinel_t<_Vw>> // - ) /* strengthened */ + noexcept(is_nothrow_constructible_v<_Base_iterator, iterator_t<_Vw>> + && is_nothrow_constructible_v<_Base_sentinel, sentinel_t<_Vw>>) /* strengthened */ requires _Const && convertible_to, _Base_iterator> && convertible_to, _Base_sentinel> : _Current(_STD move(_Other._Current)), _End(_STD move(_Other._End)), _Stride(_Other._Stride), diff --git a/stl/inc/stacktrace b/stl/inc/stacktrace index a4e5e838fc..f48353556b 100644 --- a/stl/inc/stacktrace +++ b/stl/inc/stacktrace @@ -49,11 +49,11 @@ _NODISCARD unsigned short __stdcall __std_stacktrace_capture(unsigned long _Fram void __stdcall __std_stacktrace_address_to_string(const void* _Address, void* _Str, _Stacktrace_string_fill _Fill) noexcept(false); -void __stdcall __std_stacktrace_description( // - const void* _Address, void* _Str, _Stacktrace_string_fill _Fill) noexcept(false); +void __stdcall __std_stacktrace_description(const void* _Address, void* _Str, _Stacktrace_string_fill _Fill) + noexcept(false); -void __stdcall __std_stacktrace_source_file( // - const void* _Address, void* _Str, _Stacktrace_string_fill _Fill) noexcept(false); +void __stdcall __std_stacktrace_source_file(const void* _Address, void* _Str, _Stacktrace_string_fill _Fill) + noexcept(false); _NODISCARD unsigned int __stdcall __std_stacktrace_source_line(const void* _Address) noexcept; diff --git a/stl/inc/xutility b/stl/inc/xutility index 77cd4d57b5..45de1f615e 100644 --- a/stl/inc/xutility +++ b/stl/inc/xutility @@ -1756,15 +1756,14 @@ public: } _NODISCARD _CONSTEXPR17 reference operator*() const - noexcept(is_nothrow_copy_constructible_v<_BidIt> // - && noexcept(*--(_STD declval<_BidIt&>()))) /* strengthened */ { + noexcept(is_nothrow_copy_constructible_v<_BidIt> && noexcept(*--(_STD declval<_BidIt&>()))) /* strengthened */ { _BidIt _Tmp = current; return *--_Tmp; } - _NODISCARD _CONSTEXPR17 pointer operator->() const noexcept( - is_nothrow_copy_constructible_v<_BidIt> // - && noexcept(--(_STD declval<_BidIt&>())) && _Has_nothrow_operator_arrow<_BidIt&, pointer>) /* strengthened */ + _NODISCARD _CONSTEXPR17 pointer operator->() const + noexcept(is_nothrow_copy_constructible_v<_BidIt> && noexcept(--(_STD declval<_BidIt&>())) + && _Has_nothrow_operator_arrow<_BidIt&, pointer>) /* strengthened */ #if _HAS_CXX20 requires (is_pointer_v<_BidIt> || requires(const _BidIt __i) { __i.operator->(); }) #endif @@ -1831,8 +1830,7 @@ public: #if _HAS_CXX20 _NODISCARD friend constexpr iter_rvalue_reference_t<_BidIt> iter_move(const reverse_iterator& _It) - noexcept(is_nothrow_copy_constructible_v<_BidIt> // - && noexcept(_RANGES iter_move(--_STD declval<_BidIt&>()))) { + noexcept(is_nothrow_copy_constructible_v<_BidIt> && noexcept(_RANGES iter_move(--_STD declval<_BidIt&>()))) { auto _Tmp = _It.current; --_Tmp; return _RANGES iter_move(_Tmp); @@ -1840,7 +1838,7 @@ public: template _BidIt2> friend constexpr void iter_swap(const reverse_iterator& _Left, const reverse_iterator<_BidIt2>& _Right) - noexcept(is_nothrow_copy_constructible_v<_BidIt> && is_nothrow_copy_constructible_v<_BidIt2> // + noexcept(is_nothrow_copy_constructible_v<_BidIt> && is_nothrow_copy_constructible_v<_BidIt2> && noexcept(_RANGES iter_swap(--_STD declval<_BidIt&>(), --_STD declval<_BidIt2&>()))) { auto _LTmp = _Left.current; auto _RTmp = _Right.base(); diff --git a/tests/std/tests/P2374R4_views_cartesian_product/test.cpp b/tests/std/tests/P2374R4_views_cartesian_product/test.cpp index 8a63476a84..1356bd4cd3 100644 --- a/tests/std/tests/P2374R4_views_cartesian_product/test.cpp +++ b/tests/std/tests/P2374R4_views_cartesian_product/test.cpp @@ -57,9 +57,8 @@ concept UnsignedIntegerLike = _Integer_like && !_Signed_integer_like; template constexpr bool is_iter_move_nothrow() { - constexpr bool is_inner_iter_move_nothrow = - (noexcept(ranges::iter_move(declval&>())) && ... // - && noexcept(ranges::iter_move(declval&>()))); + constexpr bool is_inner_iter_move_nothrow = (noexcept(ranges::iter_move(declval&>())) && ... + && noexcept(ranges::iter_move(declval&>()))); constexpr bool are_references_nothrow_movable = conjunction_v>, is_nothrow_move_constructible>...>; From 6f8fa6782fb42007be713934d3aff2871b204332 Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Tue, 10 Sep 2024 20:59:04 -0700 Subject: [PATCH 24/30] Manual: Remove lots of clang-format suppression. --- stl/inc/__msvc_iter_core.hpp | 112 ++++----- stl/inc/__msvc_ranges_to.hpp | 88 ++++--- stl/inc/__msvc_string_view.hpp | 19 +- stl/inc/chrono | 18 +- stl/inc/expected | 38 ++-- stl/inc/format | 13 +- stl/inc/functional | 13 +- stl/inc/iterator | 76 +++---- stl/inc/memory | 16 +- stl/inc/ranges | 215 ++++++++---------- stl/inc/span | 25 +- stl/inc/xkeycheck.h | 2 - stl/inc/xutility | 77 +++---- tests/std/include/range_algorithm_support.hpp | 54 +++-- tests/std/tests/P0323R12_expected/test.cpp | 6 +- .../std/tests/P0768R1_spaceship_cpos/test.cpp | 24 +- .../test.cpp | 8 +- .../tests/P0896R4_ranges_to_address/test.cpp | 4 +- .../std/tests/P0896R4_views_counted/test.cpp | 6 +- .../P2286R8_text_formatting_tuple/test.cpp | 12 +- 20 files changed, 369 insertions(+), 457 deletions(-) diff --git a/stl/inc/__msvc_iter_core.hpp b/stl/inc/__msvc_iter_core.hpp index cc52fada0d..619e97aa65 100644 --- a/stl/inc/__msvc_iter_core.hpp +++ b/stl/inc/__msvc_iter_core.hpp @@ -206,38 +206,32 @@ struct _Iter_traits_difference { using _Apply = void; }; -// clang-format off template -concept _Cpp17_iterator = - requires(_It __i) { - { *__i } -> _Can_reference; - { ++__i } -> same_as<_It&>; - { *__i++ } -> _Can_reference; - } - && copyable<_It>; +concept _Cpp17_iterator = requires(_It __i) { + { *__i } -> _Can_reference; + { ++__i } -> same_as<_It&>; + { *__i++ } -> _Can_reference; +} && copyable<_It>; template -concept _Cpp17_input_iterator = _Cpp17_iterator<_It> - && equality_comparable<_It> - && _Has_member_difference_type> - && _Has_member_value_type> - && requires(_It __i) { - typename common_reference_t&&, typename indirectly_readable_traits<_It>::value_type&>; - typename common_reference_t::value_type&>; - requires signed_integral::difference_type>; - }; +concept _Cpp17_input_iterator = + _Cpp17_iterator<_It> && equality_comparable<_It> && _Has_member_difference_type> + && _Has_member_value_type> && requires(_It __i) { + typename common_reference_t&&, typename indirectly_readable_traits<_It>::value_type&>; + typename common_reference_t::value_type&>; + requires signed_integral::difference_type>; + }; template requires (!_Has_iter_types<_It> && _Cpp17_iterator<_It> && !_Cpp17_input_iterator<_It>) struct _Iterator_traits_base<_It> { using iterator_category = output_iterator_tag; - using value_type = void; + using value_type = void; using difference_type = _Iter_traits_difference<_Has_member_difference_type>>::template _Apply<_It>; - using pointer = void; - using reference = void; + using pointer = void; + using reference = void; }; -// clang-format on enum class _Itraits_pointer_strategy { _Use_void, _Use_member, _Use_decltype }; @@ -287,19 +281,17 @@ struct _Iter_traits_category4 { using type = bidirectional_iterator_tag; }; -// clang-format off template -concept _Cpp17_random_delta = totally_ordered<_It> - && requires(_It __i, incrementable_traits<_It>::difference_type __n) { +concept _Cpp17_random_delta = + totally_ordered<_It> && requires(_It __i, incrementable_traits<_It>::difference_type __n) { { __i += __n } -> same_as<_It&>; { __i -= __n } -> same_as<_It&>; - { __i + __n } -> same_as<_It>; - { __n + __i } -> same_as<_It>; - { __i - __n } -> same_as<_It>; - { __i - __i } -> same_as; - { __i[__n] } -> convertible_to>; + { __i + __n } -> same_as<_It>; + { __n + __i } -> same_as<_It>; + { __i - __n } -> same_as<_It>; + { __i - __i } -> same_as; + { __i[__n] } -> convertible_to>; }; -// clang-format on template struct _Iter_traits_category3 { @@ -332,15 +324,14 @@ struct _Iter_traits_category2 { using _Apply = input_iterator_tag; }; -// clang-format off template -concept _Cpp17_forward_delta = constructible_from<_It> && is_reference_v> +concept _Cpp17_forward_delta = + constructible_from<_It> && is_reference_v> && same_as>, typename indirectly_readable_traits<_It>::value_type> && requires(_It __i) { - { __i++ } -> convertible_to; - requires same_as>; - }; -// clang-format on + { __i++ } -> convertible_to; + requires same_as>; + }; template struct _Iter_traits_category { @@ -354,20 +345,18 @@ struct _Iter_traits_category { using _Apply = _Iter_traits_category2<_Cpp17_forward_delta<_It>>::template _Apply<_It>; }; -// clang-format off template requires (!_Has_iter_types<_It> && _Cpp17_input_iterator<_It>) struct _Iterator_traits_base<_It> { using iterator_category = _Iter_traits_category<_Has_member_iterator_category<_It>>::template _Apply<_It>; using value_type = indirectly_readable_traits<_It>::value_type; using difference_type = incrementable_traits<_It>::difference_type; - using pointer = _Iter_traits_pointer<( - _Has_member_pointer<_It> ? _Itraits_pointer_strategy::_Use_member - : _Has_member_arrow<_It&> ? _Itraits_pointer_strategy::_Use_decltype - : _Itraits_pointer_strategy::_Use_void)>::template _Apply<_It>; - using reference = _Iter_traits_reference<_Has_member_reference<_It>>::template _Apply<_It>; + using pointer = + _Iter_traits_pointer<(_Has_member_pointer<_It> ? _Itraits_pointer_strategy::_Use_member + : _Has_member_arrow<_It&> ? _Itraits_pointer_strategy::_Use_decltype + : _Itraits_pointer_strategy::_Use_void)>::template _Apply<_It>; + using reference = _Iter_traits_reference<_Has_member_reference<_It>>::template _Apply<_It>; }; -// clang-format on _EXPORT_STD template struct iterator_traits : _Iterator_traits_base<_Ty> { @@ -397,38 +386,31 @@ concept _Integer_like = _Is_nonbool_integral> || _Integer_class template concept _Signed_integer_like = _Integer_like<_Ty> && static_cast<_Ty>(-1) < static_cast<_Ty>(0); -// clang-format off _EXPORT_STD template -concept weakly_incrementable = movable<_Ty> - && requires(_Ty __i) { - typename iter_difference_t<_Ty>; - requires _Signed_integer_like>; - { ++__i } -> same_as<_Ty&>; - __i++; - }; +concept weakly_incrementable = movable<_Ty> && requires(_Ty __i) { + typename iter_difference_t<_Ty>; + requires _Signed_integer_like>; + { ++__i } -> same_as<_Ty&>; + __i++; +}; _EXPORT_STD template -concept input_or_output_iterator = requires(_It __i) { { *__i } -> _Can_reference; } - && weakly_incrementable<_It>; +concept input_or_output_iterator = requires(_It __i) { + { *__i } -> _Can_reference; +} && weakly_incrementable<_It>; _EXPORT_STD template -concept sentinel_for = semiregular<_Se> - && input_or_output_iterator<_It> - && _Weakly_equality_comparable_with<_Se, _It>; -// clang-format on +concept sentinel_for = semiregular<_Se> && input_or_output_iterator<_It> && _Weakly_equality_comparable_with<_Se, _It>; _EXPORT_STD template constexpr bool disable_sized_sentinel_for = false; -// clang-format off _EXPORT_STD template -concept sized_sentinel_for = sentinel_for<_Se, _It> - && !disable_sized_sentinel_for, remove_cv_t<_It>> - && requires(const _It& __i, const _Se& __s) { - { __s - __i } -> same_as>; - { __i - __s } -> same_as>; - }; -// clang-format on +concept sized_sentinel_for = sentinel_for<_Se, _It> && !disable_sized_sentinel_for, remove_cv_t<_It>> + && requires(const _It& __i, const _Se& __s) { + { __s - __i } -> same_as>; + { __i - __s } -> same_as>; + }; _EXPORT_STD struct default_sentinel_t {}; diff --git a/stl/inc/__msvc_ranges_to.hpp b/stl/inc/__msvc_ranges_to.hpp index 524bb51f1a..e6c76ee1b1 100644 --- a/stl/inc/__msvc_ranges_to.hpp +++ b/stl/inc/__msvc_ranges_to.hpp @@ -33,14 +33,12 @@ namespace ranges { template constexpr bool _Is_initializer_list = _Is_specialization_v, initializer_list>; - // clang-format off _EXPORT_STD template concept viewable_range = range<_Rng> - && ((view> && constructible_from, _Rng>) - || (!view> - && (is_lvalue_reference_v<_Rng> - || (movable> && !_Is_initializer_list<_Rng>)))); - // clang-format on + && ((view> && constructible_from, _Rng>) + || (!view> + && (is_lvalue_reference_v<_Rng> + || (movable> && !_Is_initializer_list<_Rng>) ))); namespace _Pipe { template @@ -157,12 +155,13 @@ namespace ranges { } } - // clang-format off - ~_Movable_box() requires is_trivially_destructible_v<_Ty> = default; + ~_Movable_box() + requires is_trivially_destructible_v<_Ty> + = default; _Movable_box(const _Movable_box&) - requires copy_constructible<_Ty> && is_trivially_copy_constructible_v<_Ty> = default; - // clang-format on + requires copy_constructible<_Ty> && is_trivially_copy_constructible_v<_Ty> + = default; constexpr _Movable_box(const _Movable_box& _That) requires copy_constructible<_Ty> @@ -172,9 +171,9 @@ namespace ranges { } } - // clang-format off - _Movable_box(_Movable_box&&) requires is_trivially_move_constructible_v<_Ty> = default; - // clang-format on + _Movable_box(_Movable_box&&) + requires is_trivially_move_constructible_v<_Ty> + = default; constexpr _Movable_box(_Movable_box&& _That) : _Engaged{_That._Engaged} { if (_That._Engaged) { @@ -182,10 +181,9 @@ namespace ranges { } } - // clang-format off _Movable_box& operator=(const _Movable_box&) noexcept - requires copyable<_Ty> && is_trivially_copy_assignable_v<_Ty> = default; - // clang-format on + requires copyable<_Ty> && is_trivially_copy_assignable_v<_Ty> + = default; constexpr _Movable_box& operator=(const _Movable_box& _That) noexcept(is_nothrow_copy_constructible_v<_Ty> && is_nothrow_copy_assignable_v<_Ty>) // strengthened @@ -230,10 +228,9 @@ namespace ranges { return *this; } - // clang-format off _Movable_box& operator=(_Movable_box&&) noexcept - requires movable<_Ty> && is_trivially_move_assignable_v<_Ty> = default; - // clang-format on + requires movable<_Ty> && is_trivially_move_assignable_v<_Ty> + = default; constexpr _Movable_box& operator=(_Movable_box&& _That) noexcept(is_nothrow_move_constructible_v<_Ty> && is_nothrow_move_assignable_v<_Ty>) // strengthened @@ -314,20 +311,21 @@ namespace ranges { requires _Use_simple_movable_box_wrapper<_Ty> class _Movable_box<_Ty> { // provide the same API more efficiently when we can avoid the disengaged state public: - // clang-format off - _Movable_box() requires default_initializable<_Ty> = default; - // clang-format on + _Movable_box() + requires default_initializable<_Ty> + = default; template constexpr _Movable_box(in_place_t, _Types&&... _Args) noexcept(is_nothrow_constructible_v<_Ty, _Types...>) // strengthened : _Val(_STD forward<_Types>(_Args)...) {} - // clang-format off _Movable_box(const _Movable_box&) - requires _Copy_constructible_for_box<_Ty> && is_trivially_copy_constructible_v<_Ty> = default; - _Movable_box(_Movable_box&&) requires is_trivially_move_constructible_v<_Ty> = default; - // clang-format on + requires _Copy_constructible_for_box<_Ty> && is_trivially_copy_constructible_v<_Ty> + = default; + _Movable_box(_Movable_box&&) + requires is_trivially_move_constructible_v<_Ty> + = default; constexpr _Movable_box(const _Movable_box& _That) noexcept(is_nothrow_copy_constructible_v<_Ty>) requires _Copy_constructible_for_box<_Ty> @@ -336,11 +334,12 @@ namespace ranges { constexpr _Movable_box(_Movable_box&& _That) noexcept(is_nothrow_move_constructible_v<_Ty>) : _Val(static_cast<_Ty&&>(_That._Val)) {} - // clang-format off _Movable_box& operator=(const _Movable_box&) - requires copyable<_Ty> && is_trivially_copy_assignable_v<_Ty> = default; - _Movable_box& operator=(_Movable_box&&) requires movable<_Ty> && is_trivially_move_assignable_v<_Ty> = default; - // clang-format on + requires copyable<_Ty> && is_trivially_copy_assignable_v<_Ty> + = default; + _Movable_box& operator=(_Movable_box&&) + requires movable<_Ty> && is_trivially_move_assignable_v<_Ty> + = default; constexpr _Movable_box& operator=(const _Movable_box& _That) noexcept(is_nothrow_copy_assignable_v<_Ty> || !copyable<_Ty>) // strengthened @@ -459,14 +458,11 @@ namespace ranges { static void _Rvalue_poison(_Rng&&) = delete; public: - // clang-format off template <_Different_from _OtherRng> - constexpr ref_view(_OtherRng&& _Other) noexcept( - noexcept(static_cast<_Rng&>(_STD forward<_OtherRng>(_Other)))) // strengthened - requires convertible_to<_OtherRng, _Rng&> && requires { - _Rvalue_poison(static_cast<_OtherRng&&>(_Other)); - } : _Range{_STD addressof(static_cast<_Rng&>(_STD forward<_OtherRng>(_Other)))} {} - // clang-format on + constexpr ref_view(_OtherRng&& _Other) + noexcept(noexcept(static_cast<_Rng&>(_STD forward<_OtherRng>(_Other)))) // strengthened + requires convertible_to<_OtherRng, _Rng&> && requires { _Rvalue_poison(static_cast<_OtherRng&&>(_Other)); } + : _Range{_STD addressof(static_cast<_Rng&>(_STD forward<_OtherRng>(_Other)))} {} _NODISCARD constexpr _Rng& base() const noexcept /* strengthened */ { return *_Range; @@ -513,9 +509,9 @@ namespace ranges { _Rng _Range{}; public: - // clang-format off - owning_view() requires default_initializable<_Rng> = default; - // clang-format on + owning_view() + requires default_initializable<_Rng> + = default; constexpr owning_view(_Rng&& _Range_) noexcept(is_nothrow_move_constructible_v<_Rng>) // strengthened : _Range(_STD move(_Range_)) {} @@ -700,9 +696,9 @@ namespace ranges { using value_type = remove_cvref_t&, range_reference_t<_Base>>>; using difference_type = range_difference_t<_Base>; - // clang-format off - _Iterator() requires default_initializable> = default; - // clang-format on + _Iterator() + requires default_initializable> + = default; constexpr _Iterator(_Parent_t& _Parent_, iterator_t<_Base> _Current_) noexcept(is_nothrow_move_constructible_v>) // strengthened @@ -981,9 +977,9 @@ namespace ranges { }; public: - // clang-format off - transform_view() requires default_initializable<_Vw> && default_initializable<_Fn> = default; - // clang-format on + transform_view() + requires default_initializable<_Vw> && default_initializable<_Fn> + = default; constexpr explicit transform_view(_Vw _Range_, _Fn _Fun_) noexcept(is_nothrow_move_constructible_v<_Vw> && is_nothrow_move_constructible_v<_Fn>) // strengthened diff --git a/stl/inc/__msvc_string_view.hpp b/stl/inc/__msvc_string_view.hpp index 843c640642..a0f6055a5c 100644 --- a/stl/inc/__msvc_string_view.hpp +++ b/stl/inc/__msvc_string_view.hpp @@ -1240,20 +1240,15 @@ class basic_string_view { // wrapper for any kind of contiguous character buffer : _Mydata(_STD to_address(_First)), _Mysize(static_cast(_Last - _First)) {} #if _HAS_CXX23 - // clang-format off template - requires (!same_as, basic_string_view> - && _RANGES contiguous_range<_Range> - && _RANGES sized_range<_Range> - && same_as<_RANGES range_value_t<_Range>, _Elem> - && !is_convertible_v<_Range, const _Elem*> - && !requires(remove_cvref_t<_Range>& _Rng) { - _Rng.operator _STD basic_string_view<_Elem, _Traits>(); - }) - constexpr explicit basic_string_view(_Range&& _Rng) noexcept( - noexcept(_RANGES data(_Rng)) && noexcept(_RANGES size(_Rng))) // strengthened + requires (!same_as, basic_string_view> && _RANGES contiguous_range<_Range> + && _RANGES sized_range<_Range> && same_as<_RANGES range_value_t<_Range>, _Elem> + && !is_convertible_v<_Range, const _Elem*> + && !requires( + remove_cvref_t<_Range>& _Rng) { _Rng.operator _STD basic_string_view<_Elem, _Traits>(); }) + constexpr explicit basic_string_view(_Range&& _Rng) + noexcept(noexcept(_RANGES data(_Rng)) && noexcept(_RANGES size(_Rng))) // strengthened : _Mydata(_RANGES data(_Rng)), _Mysize(static_cast(_RANGES size(_Rng))) {} - // clang-format on #endif // _HAS_CXX23 #endif // _HAS_CXX20 diff --git a/stl/inc/chrono b/stl/inc/chrono index ff63a35a89..c983d98215 100644 --- a/stl/inc/chrono +++ b/stl/inc/chrono @@ -4671,18 +4671,14 @@ namespace chrono { // [time.format] -// clang-format off template -concept _Chrono_parse_spec_callbacks = _Parse_align_callbacks<_Ty, _CharT> - && _Parse_width_callbacks<_Ty, _CharT> - && _Parse_precision_callbacks<_Ty, _CharT> - && _Width_adapter_callbacks<_Ty, _CharT> - && _Precision_adapter_callbacks<_Ty, _CharT> - && requires(_Ty _At, basic_string_view<_CharT> _Sv, _Fmt_align _Aln) { - { _At._On_conversion_spec(char{}, _CharT{}) } -> same_as; - { _At._On_lit_char(_CharT{}) } -> same_as; -}; -// clang-format on +concept _Chrono_parse_spec_callbacks = + _Parse_align_callbacks<_Ty, _CharT> && _Parse_width_callbacks<_Ty, _CharT> + && _Parse_precision_callbacks<_Ty, _CharT> && _Width_adapter_callbacks<_Ty, _CharT> + && _Precision_adapter_callbacks<_Ty, _CharT> && requires(_Ty _At, basic_string_view<_CharT> _Sv, _Fmt_align _Aln) { + { _At._On_conversion_spec(char{}, _CharT{}) } -> same_as; + { _At._On_lit_char(_CharT{}) } -> same_as; + }; template concept _Has_ok = requires(_Ty _At) { diff --git a/stl/inc/expected b/stl/inc/expected index 610a1840a7..82c6d61269 100644 --- a/stl/inc/expected +++ b/stl/inc/expected @@ -253,10 +253,9 @@ public: } } - // clang-format off - expected(const expected&) requires - is_trivially_copy_constructible_v<_Ty> && is_trivially_copy_constructible_v<_Err> = default; - // clang-format on + expected(const expected&) + requires is_trivially_copy_constructible_v<_Ty> && is_trivially_copy_constructible_v<_Err> + = default; expected(const expected&) = delete; @@ -272,10 +271,9 @@ public: } } - // clang-format off - expected(expected&&) requires - is_trivially_move_constructible_v<_Ty> && is_trivially_move_constructible_v<_Err> = default; - // clang-format on + expected(expected&&) + requires is_trivially_move_constructible_v<_Ty> && is_trivially_move_constructible_v<_Err> + = default; template requires _Different_from, expected> && is_constructible_v<_Ty, const _Uty&> @@ -375,9 +373,9 @@ public: } } - // clang-format off - ~expected() requires is_trivially_destructible_v<_Ty> && is_trivially_destructible_v<_Err> = default; - // clang-format on + ~expected() + requires is_trivially_destructible_v<_Ty> && is_trivially_destructible_v<_Err> + = default; // [expected.object.assign] template @@ -1244,9 +1242,9 @@ public: } } - // clang-format off - expected(const expected&) requires is_trivially_copy_constructible_v<_Err> = default; - // clang-format on + expected(const expected&) + requires is_trivially_copy_constructible_v<_Err> + = default; expected(const expected&) = delete; @@ -1258,9 +1256,9 @@ public: } } - // clang-format off - expected(expected&&) requires is_trivially_move_constructible_v<_Err> = default; - // clang-format on + expected(expected&&) + requires is_trivially_move_constructible_v<_Err> + = default; template requires _Different_from, expected> && is_void_v<_Uty> @@ -1321,9 +1319,9 @@ public: } } - // clang-format off - ~expected() requires is_trivially_destructible_v<_Err> = default; - // clang-format on + ~expected() + requires is_trivially_destructible_v<_Err> + = default; // [expected.void.assign] constexpr expected& operator=(const expected& _Other) diff --git a/stl/inc/format b/stl/inc/format index 9e2ce6e57a..a40951eec2 100644 --- a/stl/inc/format +++ b/stl/inc/format @@ -149,21 +149,16 @@ concept _Precision_adapter_callbacks = requires(_Ty _At) { { _At._On_dynamic_precision(size_t{}) } -> same_as; }; -// clang-format off template -concept _Parse_spec_callbacks = _Parse_align_callbacks<_Ty, _CharT> - && _Parse_width_callbacks<_Ty, _CharT> - && _Parse_precision_callbacks<_Ty, _CharT> - && _Width_adapter_callbacks<_Ty, _CharT> - && _Precision_adapter_callbacks<_Ty, _CharT> - && requires(_Ty _At, _Fmt_sign _Sgn) { +concept _Parse_spec_callbacks = _Parse_align_callbacks<_Ty, _CharT> && _Parse_width_callbacks<_Ty, _CharT> + && _Parse_precision_callbacks<_Ty, _CharT> && _Width_adapter_callbacks<_Ty, _CharT> + && _Precision_adapter_callbacks<_Ty, _CharT> && requires(_Ty _At, _Fmt_sign _Sgn) { { _At._On_sign(_Sgn) } -> same_as; { _At._On_hash() } -> same_as; { _At._On_zero() } -> same_as; { _At._On_localized() } -> same_as; { _At._On_type(_CharT{}) } -> same_as; -}; -// clang-format on + }; template struct _Decode_result { diff --git a/stl/inc/functional b/stl/inc/functional index d697e49f16..1115020987 100644 --- a/stl/inc/functional +++ b/stl/inc/functional @@ -1836,23 +1836,20 @@ class move_only_function : private _Move_only_function_call<_Signature...> { private: using _Call = _Move_only_function_call<_Signature...>; - // clang-format off template - static constexpr bool _Enable_one_arg_constructor = - !is_same_v, move_only_function> - && !_Is_specialization_v, in_place_type_t> - && _Call::template _Is_callable_from>; + static constexpr bool _Enable_one_arg_constructor = !is_same_v, move_only_function> + && !_Is_specialization_v, in_place_type_t> + && _Call::template _Is_callable_from>; template static constexpr bool _Enable_in_place_constructor = - is_constructible_v, _CTypes...> - && _Call::template _Is_callable_from>; + is_constructible_v, _CTypes...> && _Call::template _Is_callable_from>; template static constexpr bool _Enable_in_place_list_constructor = is_constructible_v, initializer_list<_Ux>&, _CTypes...> && _Call::template _Is_callable_from>; - // clang-format on + public: using typename _Call::result_type; diff --git a/stl/inc/iterator b/stl/inc/iterator index d6926e5df8..941a80264c 100644 --- a/stl/inc/iterator +++ b/stl/inc/iterator @@ -602,10 +602,9 @@ public: } } - // clang-format off - constexpr _Variantish(const _Variantish&) requires is_trivially_copy_constructible_v<_Ty1> - && is_trivially_copy_constructible_v<_Ty2> = default; - // clang-format on + constexpr _Variantish(const _Variantish&) + requires is_trivially_copy_constructible_v<_Ty1> && is_trivially_copy_constructible_v<_Ty2> + = default; constexpr _Variantish(const _Variantish& _That) noexcept(is_nothrow_copy_constructible_v<_Ty1> && is_nothrow_copy_constructible_v<_Ty2>) @@ -622,10 +621,9 @@ public: } } - // clang-format off - constexpr _Variantish(_Variantish&&) requires is_trivially_move_constructible_v<_Ty1> - && is_trivially_move_constructible_v<_Ty2> = default; - // clang-format on + constexpr _Variantish(_Variantish&&) + requires is_trivially_move_constructible_v<_Ty1> && is_trivially_move_constructible_v<_Ty2> + = default; constexpr _Variantish(_Variantish&& _That) noexcept(is_nothrow_move_constructible_v<_Ty1> && is_nothrow_move_constructible_v<_Ty2>) @@ -646,16 +644,15 @@ public: _Raw_clear(); } - // clang-format off - constexpr ~_Variantish() requires is_trivially_destructible_v<_Ty1> && is_trivially_destructible_v<_Ty2> = default; + constexpr ~_Variantish() + requires is_trivially_destructible_v<_Ty1> && is_trivially_destructible_v<_Ty2> + = default; - constexpr _Variantish& operator=(const _Variantish&) requires is_trivially_destructible_v<_Ty1> - && is_trivially_destructible_v<_Ty2> - && is_trivially_copy_constructible_v<_Ty1> - && is_trivially_copy_constructible_v<_Ty2> - && is_trivially_copy_assignable_v<_Ty1> - && is_trivially_copy_assignable_v<_Ty2> = default; - // clang-format on + constexpr _Variantish& operator=(const _Variantish&) + requires is_trivially_destructible_v<_Ty1> && is_trivially_destructible_v<_Ty2> + && is_trivially_copy_constructible_v<_Ty1> && is_trivially_copy_constructible_v<_Ty2> + && is_trivially_copy_assignable_v<_Ty1> && is_trivially_copy_assignable_v<_Ty2> + = default; constexpr _Variantish& operator=(const _Variantish& _That) noexcept(is_nothrow_copy_constructible_v<_Ty1> && is_nothrow_copy_constructible_v<_Ty2> @@ -693,14 +690,11 @@ public: return *this; } - // clang-format off - constexpr _Variantish& operator=(_Variantish&&) requires is_trivially_destructible_v<_Ty1> - && is_trivially_destructible_v<_Ty2> - && is_trivially_move_constructible_v<_Ty1> - && is_trivially_move_constructible_v<_Ty2> - && is_trivially_move_assignable_v<_Ty1> - && is_trivially_move_assignable_v<_Ty2> = default; - // clang-format on + constexpr _Variantish& operator=(_Variantish&&) + requires is_trivially_destructible_v<_Ty1> && is_trivially_destructible_v<_Ty2> + && is_trivially_move_constructible_v<_Ty1> && is_trivially_move_constructible_v<_Ty2> + && is_trivially_move_assignable_v<_Ty1> && is_trivially_move_assignable_v<_Ty2> + = default; constexpr _Variantish& operator=(_Variantish&& _That) noexcept(is_nothrow_move_constructible_v<_Ty1> && is_nothrow_move_constructible_v<_Ty2> @@ -776,12 +770,11 @@ public: return *this; } - // clang-format off - friend constexpr void swap(_Variantish& _Left, _Variantish& _Right) noexcept( - is_nothrow_move_constructible_v<_Ty1> && is_nothrow_move_constructible_v<_Ty2> - && is_nothrow_swappable_v<_Ty1> && is_nothrow_swappable_v<_Ty2>) - requires (!_Is_trivially_swappable_v<_Ty1> || !_Is_trivially_swappable_v<_Ty2>) { - // clang-format on + friend constexpr void swap(_Variantish& _Left, _Variantish& _Right) + noexcept(is_nothrow_move_constructible_v<_Ty1> && is_nothrow_move_constructible_v<_Ty2> + && is_nothrow_swappable_v<_Ty1> && is_nothrow_swappable_v<_Ty2>) + requires (!_Is_trivially_swappable_v<_Ty1> || !_Is_trivially_swappable_v<_Ty2>) + { if (_Left._Contains == _Right._Contains) { switch (_Left._Contains) { case _Variantish_state::_Holds_first: @@ -858,13 +851,12 @@ public: _Variantish_state _Contains; }; -// clang-format off template -concept _Use_postfix_proxy = !requires(_Iter& __it) { { *__it++ } -> _Can_reference; } - && indirectly_readable<_Iter> - && constructible_from, iter_reference_t<_Iter>> +concept _Use_postfix_proxy = + !requires(_Iter& __it) { + { *__it++ } -> _Can_reference; + } && indirectly_readable<_Iter> && constructible_from, iter_reference_t<_Iter>> && move_constructible>; -// clang-format on _EXPORT_STD template _Se> requires (!same_as<_Iter, _Se> && copyable<_Iter>) @@ -879,9 +871,9 @@ private: }; public: - // clang-format off - constexpr common_iterator() requires default_initializable<_Iter> = default; - // clang-format on + constexpr common_iterator() + requires default_initializable<_Iter> + = default; constexpr common_iterator(_Iter _Right) noexcept(is_nothrow_move_constructible_v<_Iter>) // strengthened : _Val{in_place_type<_Iter>, _STD move(_Right)} {} @@ -1156,9 +1148,9 @@ public: using difference_type = iter_difference_t<_Iter>; // [counted.iter.const] - // clang-format off - constexpr counted_iterator() requires default_initializable<_Iter> = default; - // clang-format on + constexpr counted_iterator() + requires default_initializable<_Iter> + = default; constexpr counted_iterator(_Iter _Right, const iter_difference_t<_Iter> _Diff) noexcept(is_nothrow_move_constructible_v<_Iter>) // strengthened diff --git a/stl/inc/memory b/stl/inc/memory index 7b0f0e54b5..e5272c95e8 100644 --- a/stl/inc/memory +++ b/stl/inc/memory @@ -529,10 +529,8 @@ namespace ranges { ::new (static_cast(_Ptr)) _Ty(static_cast<_Types&&>(_Args)...); // per LWG-3888 } _STATIC_CALL_OPERATOR constexpr _Ty* operator()(_Ty* _Location, _Types&&... _Args) _CONST_CALL_OPERATOR - // clang-format off noexcept(noexcept( - ::new(static_cast(_Location)) _Ty(_STD forward<_Types>(_Args)...))) /* strengthened */ { - // clang-format on + ::new (static_cast(_Location)) _Ty(_STD forward<_Types>(_Args)...))) /* strengthened */ { #ifdef __EDG__ return _STD construct_at(_Location, _STD forward<_Types>(_Args)...); #else // ^^^ EDG / Other vvv @@ -3665,14 +3663,12 @@ _NODISCARD bool operator<=(const unique_ptr<_Ty1, _Dx1>& _Left, const unique_ptr } #if _HAS_CXX20 -// clang-format off _EXPORT_STD template requires three_way_comparable_with::pointer, typename unique_ptr<_Ty2, _Dx2>::pointer> -_NODISCARD compare_three_way_result_t::pointer, - typename unique_ptr<_Ty2, _Dx2>::pointer> +_NODISCARD + compare_three_way_result_t::pointer, typename unique_ptr<_Ty2, _Dx2>::pointer> operator<=>(const unique_ptr<_Ty1, _Dx1>& _Left, const unique_ptr<_Ty2, _Dx2>& _Right) { - // clang-format on return _Left.get() <=> _Right.get(); } #endif // _HAS_CXX20 @@ -4278,14 +4274,12 @@ struct _Pointer_of_helper<_Ty> { using type = _Ty::element_type*; }; -// clang-format off template - requires (!_Has_member_element_type<_Ty> && !_Has_member_pointer<_Ty> - && _Has_member_element_type>) + requires ( + !_Has_member_element_type<_Ty> && !_Has_member_pointer<_Ty> && _Has_member_element_type>) struct _Pointer_of_helper<_Ty> { using type = pointer_traits<_Ty>::element_type*; }; -// clang-format on template using _Pointer_of = _Pointer_of_helper<_Ty>::type; diff --git a/stl/inc/ranges b/stl/inc/ranges index d1e0fc1c0b..372a301441 100644 --- a/stl/inc/ranges +++ b/stl/inc/ranges @@ -84,12 +84,9 @@ namespace ranges { constexpr auto _Compile_time_max_size> = _Extent; #endif // _HAS_CXX23 - // clang-format off template - concept _Simple_view = view<_Rng> && range - && same_as, iterator_t> - && same_as, sentinel_t>; - // clang-format on + concept _Simple_view = view<_Rng> && range && same_as, iterator_t> + && same_as, sentinel_t>; template concept _Has_arrow = input_iterator<_It> && (is_pointer_v<_It> || _Has_member_arrow<_It&>); @@ -203,12 +200,13 @@ namespace ranges { } } - // clang-format off - ~_Defaultabox() requires is_trivially_destructible_v<_Ty> = default; + ~_Defaultabox() + requires is_trivially_destructible_v<_Ty> + = default; _Defaultabox(const _Defaultabox&) - requires copy_constructible<_Ty> && is_trivially_copy_constructible_v<_Ty> = default; - // clang-format on + requires copy_constructible<_Ty> && is_trivially_copy_constructible_v<_Ty> + = default; constexpr _Defaultabox(const _Defaultabox& _That) noexcept(is_nothrow_copy_constructible_v<_Ty>) requires copy_constructible<_Ty> @@ -218,9 +216,9 @@ namespace ranges { } } - // clang-format off - _Defaultabox(_Defaultabox&&) requires is_trivially_move_constructible_v<_Ty> = default; - // clang-format on + _Defaultabox(_Defaultabox&&) + requires is_trivially_move_constructible_v<_Ty> + = default; constexpr _Defaultabox(_Defaultabox&& _That) noexcept(is_nothrow_move_constructible_v<_Ty>) : _Engaged{_That._Engaged} { @@ -247,10 +245,9 @@ namespace ranges { } } - // clang-format off _Defaultabox& operator=(const _Defaultabox&) noexcept - requires copyable<_Ty> && is_trivially_copy_assignable_v<_Ty> = default; - // clang-format on + requires copyable<_Ty> && is_trivially_copy_assignable_v<_Ty> + = default; constexpr _Defaultabox& operator=(const _Defaultabox& _That) noexcept(is_nothrow_copy_constructible_v<_Ty> && is_nothrow_copy_assignable_v<_Ty>) @@ -275,9 +272,9 @@ namespace ranges { return *this; } - // clang-format off - _Defaultabox& operator=(_Defaultabox&&) noexcept requires is_trivially_move_assignable_v<_Ty> = default; - // clang-format on + _Defaultabox& operator=(_Defaultabox&&) noexcept + requires is_trivially_move_assignable_v<_Ty> + = default; constexpr _Defaultabox& operator=(_Defaultabox&& _That) noexcept(is_nothrow_move_constructible_v<_Ty> && is_nothrow_move_assignable_v<_Ty>) { @@ -427,9 +424,9 @@ namespace ranges { } } - // clang-format off - ~_Non_propagating_cache() requires is_trivially_destructible_v<_Ty> = default; - // clang-format on + ~_Non_propagating_cache() + requires is_trivially_destructible_v<_Ty> + = default; constexpr _Non_propagating_cache(const _Non_propagating_cache&) noexcept {} @@ -584,9 +581,9 @@ namespace ranges { _EXPORT_STD template <_Valid_movable_box_object _Ty> class single_view : public view_interface> { public: - // clang-format off - single_view() requires default_initializable<_Ty> = default; - // clang-format on + single_view() + requires default_initializable<_Ty> + = default; constexpr explicit single_view(const _Ty& _Val_) noexcept(is_nothrow_copy_constructible_v<_Ty>) // strengthened requires copy_constructible<_Ty> @@ -696,9 +693,9 @@ namespace ranges { using value_type = _Wi; using difference_type = _Iota_diff_t<_Wi>; - // clang-format off - _Ioterator() requires default_initializable<_Wi> = default; - // clang-format on + _Ioterator() + requires default_initializable<_Wi> + = default; constexpr explicit _Ioterator(_Wi _Val) noexcept(is_nothrow_move_constructible_v<_Wi>) /* strengthened */ : _Current(_STD move(_Val)) {} @@ -955,9 +952,9 @@ namespace ranges { } public: - // clang-format off - iota_view() requires default_initializable<_Wi> = default; - // clang-format on + iota_view() + requires default_initializable<_Wi> + = default; constexpr explicit iota_view(_Wi _Value_) noexcept(is_nothrow_move_constructible_v<_Wi> && is_nothrow_default_constructible_v<_Bo>) // strengthened @@ -1027,12 +1024,10 @@ namespace ranges { #pragma warning(pop) }; - // clang-format off template requires (!_Integer_like<_Wi> || !_Integer_like<_Bo> - || (_Signed_integer_like<_Wi> == _Signed_integer_like<_Bo>)) + || (_Signed_integer_like<_Wi> == _Signed_integer_like<_Bo>) ) iota_view(_Wi, _Bo) -> iota_view<_Wi, _Bo>; - // clang-format on template constexpr bool enable_borrowed_range> = true; @@ -1236,9 +1231,9 @@ namespace ranges { : _Value(in_place, _Tuple_get<_Indices>(_STD move(_Val))...), _Bound(_STD move(_Bound_)) {} public: - // clang-format off - repeat_view() requires default_initializable<_Ty> = default; - // clang-format on + repeat_view() + requires default_initializable<_Ty> + = default; _NODISCARD_CTOR constexpr explicit repeat_view(const _Ty& _Value_, _Bo _Bound_ = _Bo{}) noexcept(is_nothrow_copy_constructible_v<_Ty>) // strengthened @@ -1448,9 +1443,9 @@ namespace ranges { static constexpr bool _Is_end_nothrow_v<_Rng> = noexcept(move_iterator{_RANGES end(_STD declval<_Rng&>())}); public: - // clang-format off - as_rvalue_view() requires default_initializable<_Vw> = default; - // clang-format on + as_rvalue_view() + requires default_initializable<_Vw> + = default; constexpr explicit as_rvalue_view(_Vw _Range_) noexcept(is_nothrow_move_constructible_v<_Vw>) // strengthened : _Range(_STD move(_Range_)) {} @@ -1603,9 +1598,9 @@ namespace ranges { using value_type = range_value_t<_Vw>; using difference_type = range_difference_t<_Vw>; - // clang-format off - _Iterator() requires default_initializable> = default; - // clang-format on + _Iterator() + requires default_initializable> + = default; constexpr _Iterator(filter_view& _Parent_, iterator_t<_Vw> _Current_) noexcept(is_nothrow_move_constructible_v>) // strengthened @@ -1746,9 +1741,9 @@ namespace ranges { }; public: - // clang-format off - filter_view() requires default_initializable<_Vw> && default_initializable<_Pr> = default; - // clang-format on + filter_view() + requires default_initializable<_Vw> && default_initializable<_Pr> + = default; constexpr explicit filter_view(_Vw _Range_, _Pr _Pred_) noexcept(is_nothrow_move_constructible_v<_Vw> && is_nothrow_move_constructible_v<_Pr>) // strengthened @@ -1913,9 +1908,9 @@ namespace ranges { }; public: - // clang-format off - take_view() requires default_initializable<_Vw> = default; - // clang-format on + take_view() + requires default_initializable<_Vw> + = default; constexpr explicit take_view(_Vw _Range_, const range_difference_t<_Vw> _Count_) noexcept(is_nothrow_move_constructible_v<_Vw>) // strengthened @@ -2210,9 +2205,9 @@ namespace ranges { }; public: - // clang-format off - take_while_view() requires default_initializable<_Vw> && default_initializable<_Pr> = default; - // clang-format on + take_while_view() + requires default_initializable<_Vw> && default_initializable<_Pr> + = default; constexpr explicit take_while_view(_Vw _Range_, _Pr _Pred_) noexcept(is_nothrow_move_constructible_v<_Vw> && is_nothrow_move_constructible_v<_Pr>) // strengthened @@ -2333,9 +2328,9 @@ namespace ranges { } public: - // clang-format off - drop_view() requires default_initializable<_Vw> = default; - // clang-format on + drop_view() + requires default_initializable<_Vw> + = default; constexpr explicit drop_view(_Vw _Range_, const range_difference_t<_Vw> _Count_) noexcept(is_nothrow_move_constructible_v<_Vw>) // strengthened @@ -2544,9 +2539,9 @@ namespace ranges { /* [[no_unique_address]] */ _Movable_box<_Pr> _Pred{}; public: - // clang-format off - drop_while_view() requires default_initializable<_Vw> && default_initializable<_Pr> = default; - // clang-format on + drop_while_view() + requires default_initializable<_Vw> && default_initializable<_Pr> + = default; constexpr explicit drop_while_view(_Vw _Range_, _Pr _Pred_) noexcept(is_nothrow_move_constructible_v<_Vw> && is_nothrow_move_constructible_v<_Pr>) // strengthened @@ -2955,9 +2950,9 @@ namespace ranges { }; public: - // clang-format off - join_view() requires default_initializable<_Vw> = default; - // clang-format on + join_view() + requires default_initializable<_Vw> + = default; constexpr explicit join_view(_Vw _Range_) noexcept(is_nothrow_move_constructible_v<_Vw>) // strengthened : _Range(_STD move(_Range_)) {} @@ -3490,9 +3485,9 @@ namespace ranges { }; public: - // clang-format off - join_with_view() requires default_initializable<_Vw> && default_initializable<_Pat> = default; - // clang-format on + join_with_view() + requires default_initializable<_Vw> && default_initializable<_Pat> + = default; constexpr explicit join_with_view(_Vw _Range_, _Pat _Pattern_) noexcept(is_nothrow_move_constructible_v<_Vw> && is_nothrow_move_constructible_v<_Pat>) // strengthened @@ -3613,18 +3608,14 @@ namespace ranges { } // namespace views #endif // _HAS_CXX23 - // clang-format off template - concept _Tiny_range = sized_range<_Ty> - && requires { typename _Require_constant::size()>; } - && (remove_reference_t<_Ty>::size() <= 1); + concept _Tiny_range = sized_range<_Ty> && requires { typename _Require_constant::size()>; } + && (remove_reference_t<_Ty>::size() <= 1); _EXPORT_STD template - requires (view<_Vw> && view<_Pat> - && indirectly_comparable, iterator_t<_Pat>, _RANGES equal_to> - && (forward_range<_Vw> || _Tiny_range<_Pat>)) + requires (view<_Vw> && view<_Pat> && indirectly_comparable, iterator_t<_Pat>, _RANGES equal_to> + && (forward_range<_Vw> || _Tiny_range<_Pat>) ) class lazy_split_view; - // clang-format on template class _Lazy_split_view_base : public view_interface> { @@ -3937,9 +3928,9 @@ namespace ranges { }; public: - // clang-format off - lazy_split_view() requires default_initializable<_Vw> && default_initializable<_Pat> = default; - // clang-format on + lazy_split_view() + requires default_initializable<_Vw> && default_initializable<_Pat> + = default; constexpr explicit lazy_split_view(_Vw _Range_, _Pat _Pattern_) noexcept(is_nothrow_move_constructible_v<_Vw> && is_nothrow_move_constructible_v<_Pat>) // strengthened @@ -4141,9 +4132,9 @@ namespace ranges { } public: - // clang-format off - split_view() requires default_initializable<_Vw> && default_initializable<_Pat> = default; - // clang-format on + split_view() + requires default_initializable<_Vw> && default_initializable<_Pat> + = default; constexpr explicit split_view(_Vw _Range_, _Pat _Pattern_) noexcept(is_nothrow_move_constructible_v<_Vw> && is_nothrow_move_constructible_v<_Pat>) // strengthened @@ -4272,9 +4263,9 @@ namespace ranges { /* [[no_unique_address]] */ _Vw _Base{}; public: - // clang-format off - common_view() requires default_initializable<_Vw> = default; - // clang-format on + common_view() + requires default_initializable<_Vw> + = default; constexpr explicit common_view(_Vw _Base_) noexcept(is_nothrow_move_constructible_v<_Vw>) // strengthened : _Base(_STD move(_Base_)) {} @@ -4405,9 +4396,9 @@ namespace ranges { using _Rev_iter = reverse_iterator>; public: - // clang-format off - reverse_view() requires default_initializable<_Vw> = default; - // clang-format on + reverse_view() + requires default_initializable<_Vw> + = default; constexpr explicit reverse_view(_Vw _Range_) noexcept(is_nothrow_move_constructible_v<_Vw>) // strengthened : _Range(_STD move(_Range_)) {} @@ -4562,9 +4553,9 @@ namespace ranges { /* [[no_unique_address]] */ _Vw _Range{}; public: - // clang-format off - as_const_view() requires default_initializable<_Vw> = default; - // clang-format on + as_const_view() + requires default_initializable<_Vw> + = default; constexpr explicit as_const_view(_Vw _Range_) noexcept(is_nothrow_move_constructible_v<_Vw>) // strengthened : _Range(_STD move(_Range_)) {} @@ -4749,9 +4740,9 @@ namespace ranges { using value_type = remove_cvref_t>>; using difference_type = range_difference_t<_Base>; - // clang-format off - _Iterator() requires default_initializable> = default; - // clang-format on + _Iterator() + requires default_initializable> + = default; constexpr explicit _Iterator(iterator_t<_Base> _Current_) noexcept(is_nothrow_move_constructible_v>) // strengthened @@ -5018,9 +5009,9 @@ namespace ranges { }; public: - // clang-format off - elements_view() requires default_initializable<_Vw> = default; - // clang-format on + elements_view() + requires default_initializable<_Vw> + = default; constexpr explicit elements_view(_Vw _Range_) noexcept(is_nothrow_move_constructible_v<_Vw>) // strengthened : _Range(_STD move(_Range_)) {} @@ -5154,9 +5145,9 @@ namespace ranges { using difference_type = range_difference_t<_Base_t>; using value_type = tuple>; - // clang-format off - _Iterator() requires default_initializable<_Base_iterator> = default; - // clang-format on + _Iterator() + requires default_initializable<_Base_iterator> + = default; constexpr _Iterator(_Iterator _Other) noexcept(is_nothrow_constructible_v<_Base_iterator, iterator_t<_Vw>>) // strengthened @@ -5367,9 +5358,9 @@ namespace ranges { && noexcept(_RANGES distance(_STD declval<_Rng&>())); public: - // clang-format off - constexpr enumerate_view() requires default_initializable<_Vw> = default; - // clang-format on + constexpr enumerate_view() + requires default_initializable<_Vw> + = default; constexpr explicit enumerate_view(_Vw _Range_) noexcept(is_nothrow_move_constructible_v<_Vw>) // strengthened : _Range(_STD move(_Range_)) {} @@ -6587,9 +6578,9 @@ namespace ranges { } public: - // clang-format off - chunk_by_view() requires default_initializable<_Vw> && default_initializable<_Pr> = default; - // clang-format on + chunk_by_view() + requires default_initializable<_Vw> && default_initializable<_Pr> + = default; constexpr explicit chunk_by_view(_Vw _Range_, _Pr _Pred_) noexcept(is_nothrow_move_constructible_v<_Vw> && is_nothrow_move_constructible_v<_Pr>) // strengthened @@ -6712,9 +6703,9 @@ namespace ranges { conditional_t, bidirectional_iterator_tag, conditional_t, forward_iterator_tag, input_iterator_tag>>>; - // clang-format off - _Iterator() requires default_initializable<_Base_iterator> = default; - // clang-format on + _Iterator() + requires default_initializable<_Base_iterator> + = default; constexpr _Iterator(_Iterator _Other) noexcept(is_nothrow_constructible_v<_Base_iterator, iterator_t<_Vw>> @@ -7131,9 +7122,7 @@ namespace ranges { requires (sizeof...(_LHSTupleTypes) == sizeof...(_RHSTupleTypes)) _NODISCARD constexpr bool _Zip_iterator_sentinel_equal( const tuple<_LHSTupleTypes...>& _Lhs_tuple, const tuple<_RHSTupleTypes...>& _Rhs_tuple) - // clang-format off noexcept((noexcept(_STD declval() == _STD declval()) && ...)) { - // clang-format on const auto _Evaluate_equality_closure = [&_Lhs_tuple, &_Rhs_tuple](index_sequence<_Indices...>) noexcept( (noexcept(_STD declval() == _STD declval())&&...)) { @@ -7359,14 +7348,12 @@ namespace ranges { return _Tuple_transform(_RANGES iter_move, _Itr._Current); } - // clang-format off friend constexpr void iter_swap(const _Iterator& _Lhs, const _Iterator& _Rhs) - noexcept((noexcept(_RANGES iter_swap( - _STD declval>&>(), - _STD declval>&>())) && ...)) + noexcept((noexcept(_RANGES iter_swap(_STD declval>&>(), + _STD declval>&>())) + && ...)) requires (indirectly_swappable>> && ...) { - // clang-format on const auto _Swap_every_pair_closure = [&_Lhs, &_Rhs](index_sequence<_Indices...>) noexcept(noexcept( ((_RANGES iter_swap(_STD get<_Indices>(_Lhs._Current), _STD get<_Indices>(_Rhs._Current))), @@ -8266,9 +8253,9 @@ namespace ranges { }; public: - // clang-format off - adjacent_view() requires default_initializable<_Vw> = default; - // clang-format on + adjacent_view() + requires default_initializable<_Vw> + = default; constexpr explicit adjacent_view(_Vw _Range_) noexcept(is_nothrow_move_constructible_v<_Vw>) // strengthened : _Range(_STD move(_Range_)) {} diff --git a/stl/inc/span b/stl/inc/span index de9d6909bf..bae1370bff 100644 --- a/stl/inc/span +++ b/stl/inc/span @@ -241,25 +241,18 @@ constexpr bool _Is_std_array_v = false; template constexpr bool _Is_std_array_v> = true; -// clang-format off template -concept _Span_compatible_iterator = contiguous_iterator<_It> - && is_convertible_v>(*)[], _Ty(*)[]>; +concept _Span_compatible_iterator = + contiguous_iterator<_It> && is_convertible_v> (*)[], _Ty (*)[]>; template -concept _Span_compatible_sentinel = sized_sentinel_for<_Sentinel, _It> - && !is_convertible_v<_Sentinel, size_t>; +concept _Span_compatible_sentinel = sized_sentinel_for<_Sentinel, _It> && !is_convertible_v<_Sentinel, size_t>; template concept _Span_compatible_range = - !is_array_v> - && !_Is_span_v> - && !_Is_std_array_v> - && _RANGES contiguous_range<_Rng> - && _RANGES sized_range<_Rng> - && (_RANGES borrowed_range<_Rng> || is_const_v<_Ty>) - && is_convertible_v>(*)[], _Ty(*)[]>; -// clang-format on + !is_array_v> && !_Is_span_v> && !_Is_std_array_v> + && _RANGES contiguous_range<_Rng> && _RANGES sized_range<_Rng> && (_RANGES borrowed_range<_Rng> || is_const_v<_Ty>) + && is_convertible_v> (*)[], _Ty (*)[]>; // [views.span] _EXPORT_STD template @@ -288,9 +281,9 @@ public: static constexpr size_type extent = _Extent; // [span.cons] Constructors, copy, and assignment - // clang-format off - constexpr span() noexcept requires (_Extent == 0 || _Extent == dynamic_extent) = default; - // clang-format on + constexpr span() noexcept + requires (_Extent == 0 || _Extent == dynamic_extent) + = default; template <_Span_compatible_iterator _It> constexpr explicit(_Extent != dynamic_extent) span(_It _First, size_type _Count) noexcept // strengthened diff --git a/stl/inc/xkeycheck.h b/stl/inc/xkeycheck.h index 24c0d0c15f..96a83a5001 100644 --- a/stl/inc/xkeycheck.h +++ b/stl/inc/xkeycheck.h @@ -13,13 +13,11 @@ #if !defined(_ALLOW_KEYWORD_MACROS) && !defined(__INTELLISENSE__) -// clang-format off // #if defined($KEYWORD) // #define $KEYWORD EMIT WARNING C4005 // #error The C++ Standard Library forbids macroizing the keyword "$KEYWORD". \ // Enable warning C4005 to find the forbidden define. // #endif // $KEYWORD -// clang-format on // *don't* check the "alternative token representations" diff --git a/stl/inc/xutility b/stl/inc/xutility index 45de1f615e..6e791d549a 100644 --- a/stl/inc/xutility +++ b/stl/inc/xutility @@ -967,50 +967,45 @@ struct _Iter_concept_impl1 { template >, _It, iterator_traits<_It>>> using _Iter_concept = _Iter_concept_impl1<_Has_member_iterator_concept<_Traits>>::template _Apply<_It, _Traits>; -// clang-format off _EXPORT_STD template -concept input_iterator = input_or_output_iterator<_It> && indirectly_readable<_It> - && requires { typename _Iter_concept<_It>; } - && derived_from<_Iter_concept<_It>, input_iterator_tag>; +concept input_iterator = input_or_output_iterator<_It> && indirectly_readable<_It> && requires { + typename _Iter_concept<_It>; +} && derived_from<_Iter_concept<_It>, input_iterator_tag>; _EXPORT_STD template concept output_iterator = input_or_output_iterator<_It> && indirectly_writable<_It, _Ty> - && requires(_It __i, _Ty&& __t) { - *__i++ = static_cast<_Ty&&>(__t); - }; + && requires(_It __i, _Ty&& __t) { *__i++ = static_cast<_Ty&&>(__t); }; _EXPORT_STD template concept forward_iterator = input_iterator<_It> && derived_from<_Iter_concept<_It>, forward_iterator_tag> - && incrementable<_It> && sentinel_for<_It, _It>; + && incrementable<_It> && sentinel_for<_It, _It>; _EXPORT_STD template -concept bidirectional_iterator = forward_iterator<_It> && derived_from<_Iter_concept<_It>, bidirectional_iterator_tag> - && requires(_It __i) { +concept bidirectional_iterator = + forward_iterator<_It> && derived_from<_Iter_concept<_It>, bidirectional_iterator_tag> && requires(_It __i) { { --__i } -> same_as<_It&>; { __i-- } -> same_as<_It>; }; _EXPORT_STD template -concept random_access_iterator = bidirectional_iterator<_It> - && derived_from<_Iter_concept<_It>, random_access_iterator_tag> && totally_ordered<_It> +concept random_access_iterator = + bidirectional_iterator<_It> && derived_from<_Iter_concept<_It>, random_access_iterator_tag> && totally_ordered<_It> && sized_sentinel_for<_It, _It> && requires(_It __i, const _It __j, const iter_difference_t<_It> __n) { - { __i += __n } -> same_as<_It&>; - { __j + __n } -> same_as<_It>; - { __n + __j } -> same_as<_It>; - { __i -= __n } -> same_as<_It&>; - { __j - __n } -> same_as<_It>; - { __j[__n] } -> same_as>; - }; + { __i += __n } -> same_as<_It&>; + { __j + __n } -> same_as<_It>; + { __n + __j } -> same_as<_It>; + { __i -= __n } -> same_as<_It&>; + { __j - __n } -> same_as<_It>; + { __j[__n] } -> same_as>; + }; _EXPORT_STD template -concept contiguous_iterator = random_access_iterator<_It> - && derived_from<_Iter_concept<_It>, contiguous_iterator_tag> - && is_lvalue_reference_v> - && same_as, remove_cvref_t>> +concept contiguous_iterator = + random_access_iterator<_It> && derived_from<_Iter_concept<_It>, contiguous_iterator_tag> + && is_lvalue_reference_v> && same_as, remove_cvref_t>> && requires(const _It& __i) { - { _STD to_address(__i) } -> same_as>>; - }; -// clang-format on + { _STD to_address(__i) } -> same_as>>; + }; _EXPORT_STD template concept indirectly_unary_invocable = indirectly_readable<_It> && copy_constructible<_Fn> @@ -1103,30 +1098,24 @@ concept indirectly_movable_storable = _EXPORT_STD template concept indirectly_copyable = indirectly_readable<_In> && indirectly_writable<_Out, iter_reference_t<_In>>; -// clang-format off _EXPORT_STD template -concept indirectly_copyable_storable = indirectly_copyable<_In, _Out> - && indirectly_writable<_Out, iter_value_t<_In>&> - && indirectly_writable<_Out, const iter_value_t<_In>&> - && indirectly_writable<_Out, iter_value_t<_In>&&> - && indirectly_writable<_Out, const iter_value_t<_In>&&> - && copyable> +concept indirectly_copyable_storable = + indirectly_copyable<_In, _Out> && indirectly_writable<_Out, iter_value_t<_In>&> + && indirectly_writable<_Out, const iter_value_t<_In>&> && indirectly_writable<_Out, iter_value_t<_In>&&> + && indirectly_writable<_Out, const iter_value_t<_In>&&> && copyable> && constructible_from, iter_reference_t<_In>> && assignable_from&, iter_reference_t<_In>>; -// clang-format on namespace ranges { namespace _Iter_swap { template void iter_swap(_Ty1, _Ty2) = delete; - // clang-format off template - concept _Has_ADL = (_Has_class_or_enum_type<_Ty1> || _Has_class_or_enum_type<_Ty2>) - && requires(_Ty1&& __t1, _Ty2&& __t2) { + concept _Has_ADL = + (_Has_class_or_enum_type<_Ty1> || _Has_class_or_enum_type<_Ty2>) && requires(_Ty1&& __t1, _Ty2&& __t2) { iter_swap(static_cast<_Ty1&&>(__t1), static_cast<_Ty2&&>(__t2)); // intentional ADL }; - // clang-format on template concept _Can_swap_references = @@ -2231,9 +2220,9 @@ public: using value_type = iter_value_t<_Iter>; using difference_type = iter_difference_t<_Iter>; - // clang-format off - basic_const_iterator() requires default_initializable<_Iter> = default; - // clang-format on + basic_const_iterator() + requires default_initializable<_Iter> + = default; constexpr basic_const_iterator(_Iter _Current_) noexcept(is_nothrow_move_constructible_v<_Iter>) // strengthened : _Current(_STD move(_Current_)) {} @@ -3967,9 +3956,9 @@ namespace ranges { } public: - // clang-format off - subrange() requires default_initializable<_It> = default; - // clang-format on + subrange() + requires default_initializable<_It> + = default; template <_Convertible_to_non_slicing<_It> _It2> constexpr subrange(_It2 _First_, _Se _Last_) diff --git a/tests/std/include/range_algorithm_support.hpp b/tests/std/include/range_algorithm_support.hpp index 3af278dd7e..a94ef4ba0b 100644 --- a/tests/std/include/range_algorithm_support.hpp +++ b/tests/std/include/range_algorithm_support.hpp @@ -257,56 +257,66 @@ namespace test { return {ref_ >= that.peek()}; } - // clang-format off [[nodiscard]] friend constexpr boolish operator==(proxy_reference r, Value const& val) - requires CanEq { + requires CanEq + { return {r.ref_ == val}; } [[nodiscard]] friend constexpr boolish operator==(Value const& val, proxy_reference r) - requires CanEq { + requires CanEq + { return {r.ref_ == val}; } [[nodiscard]] friend constexpr boolish operator!=(proxy_reference r, Value const& val) - requires CanNEq { + requires CanNEq + { return {r.ref_ != val}; } [[nodiscard]] friend constexpr boolish operator!=(Value const& val, proxy_reference r) - requires CanNEq { + requires CanNEq + { return {r.ref_ != val}; } [[nodiscard]] friend constexpr boolish operator<(Value const& val, proxy_reference r) - requires CanLt { + requires CanLt + { return {val < r.ref_}; } [[nodiscard]] friend constexpr boolish operator<(proxy_reference r, Value const& val) - requires CanLt { + requires CanLt + { return {r.ref_ < val}; } [[nodiscard]] friend constexpr boolish operator>(Value const& val, proxy_reference r) - requires CanGt { + requires CanGt + { return {val > r.ref_}; } [[nodiscard]] friend constexpr boolish operator>(proxy_reference r, Value const& val) - requires CanGt { + requires CanGt + { return {r.ref_ > val}; } [[nodiscard]] friend constexpr boolish operator<=(Value const& val, proxy_reference r) - requires CanLtE { + requires CanLtE + { return {val <= r.ref_}; } [[nodiscard]] friend constexpr boolish operator<=(proxy_reference r, Value const& val) - requires CanLtE { + requires CanLtE + { return {r.ref_ <= val}; } [[nodiscard]] friend constexpr boolish operator>=(Value const& val, proxy_reference r) - requires CanGtE { + requires CanGtE + { return {val >= r.ref_}; } [[nodiscard]] friend constexpr boolish operator>=(proxy_reference r, Value const& val) - requires CanGtE { + requires CanGtE + { return {r.ref_ >= val}; } - // clang-format on [[nodiscard]] constexpr Element& peek() const noexcept { return ref_; @@ -420,9 +430,9 @@ namespace test { using Consterator = iterator; // output iterator operations - // clang-format off - iterator() requires at_least || (Eq == CanCompare::yes) = default; - // clang-format on + iterator() + requires at_least || (Eq == CanCompare::yes) + = default; constexpr explicit iterator(Element* ptr) noexcept : ptr_{ptr} {} @@ -543,10 +553,12 @@ namespace test { } // sentinel operations (implied by forward iterator): - // clang-format off - iterator(iterator const&) requires (to_bool(Eq)) = default; - iterator& operator=(iterator const&) requires (to_bool(Eq)) = default; - // clang-format on + iterator(iterator const&) + requires (to_bool(Eq)) + = default; + iterator& operator=(iterator const&) + requires (to_bool(Eq)) + = default; constexpr operator Consterator() const& noexcept requires (to_bool(Eq)) diff --git a/tests/std/tests/P0323R12_expected/test.cpp b/tests/std/tests/P0323R12_expected/test.cpp index e6cd96833e..bd318ada30 100644 --- a/tests/std/tests/P0323R12_expected/test.cpp +++ b/tests/std/tests/P0323R12_expected/test.cpp @@ -409,9 +409,9 @@ namespace test_expected { template struct payload_destructor { constexpr payload_destructor(bool& destructor_called) : _destructor_called(destructor_called) {} - // clang-format off - constexpr ~payload_destructor() requires (IsYes(triviallyDestructible)) = default; - // clang-format on + constexpr ~payload_destructor() + requires (IsYes(triviallyDestructible)) + = default; constexpr ~payload_destructor() { _destructor_called = true; } diff --git a/tests/std/tests/P0768R1_spaceship_cpos/test.cpp b/tests/std/tests/P0768R1_spaceship_cpos/test.cpp index 0ed16e84dc..5dab6aa526 100644 --- a/tests/std/tests/P0768R1_spaceship_cpos/test.cpp +++ b/tests/std/tests/P0768R1_spaceship_cpos/test.cpp @@ -173,9 +173,9 @@ struct Fallback { // I == 2: E == F is ill-formed. // I == 3: E == F returns int. // I == 4: E == F returns void. - // clang-format off - constexpr auto operator==(const Fallback& other) const noexcept(I != 1) requires (I != 2) { - // clang-format on + constexpr auto operator==(const Fallback& other) const noexcept(I != 1) + requires (I != 2) + { const bool result{val == other.val && val != UnorderedVal}; if constexpr (I == 3) { @@ -191,9 +191,9 @@ struct Fallback { // I == 6: E < F is ill-formed. // I == 7: E < F returns int. // I == 8: E < F returns void. - // clang-format off - constexpr auto operator<(const Fallback& other) const noexcept(I != 5) requires (I != 6) { - // clang-format on + constexpr auto operator<(const Fallback& other) const noexcept(I != 5) + requires (I != 6) + { const bool result{val < other.val && val != UnorderedVal && other.val != UnorderedVal}; if constexpr (I == 7) { @@ -206,17 +206,17 @@ struct Fallback { } // I == 9: F < E is ill-formed. - // clang-format off - constexpr bool operator<(Fallback&) const noexcept requires (I == 9) = delete; - // clang-format on + constexpr bool operator<(Fallback&) const noexcept + requires (I == 9) + = delete; // I == 10: F < E can throw. // I == 11: F < E returns int. // I == 12: F < E returns void. // I == 13: F < E returns bool. - // clang-format off - constexpr auto operator<(Fallback& other) const noexcept(I != 10) requires (I >= 10 && I <= 13) { - // clang-format on + constexpr auto operator<(Fallback& other) const noexcept(I != 10) + requires (I >= 10 && I <= 13) + { const bool result{val < other.val && val != UnorderedVal && other.val != UnorderedVal}; if constexpr (I == 11) { diff --git a/tests/std/tests/P0896R4_ranges_iterator_machinery/test.cpp b/tests/std/tests/P0896R4_ranges_iterator_machinery/test.cpp index 9814bc4feb..8270624467 100644 --- a/tests/std/tests/P0896R4_ranges_iterator_machinery/test.cpp +++ b/tests/std/tests/P0896R4_ranges_iterator_machinery/test.cpp @@ -1227,13 +1227,11 @@ namespace iterator_cust_swap_test { // N4928 [iterator.cust.swap]/4.3: "Otherwise, if the types T1 and T2 of E1 and E2 model // indirectly_movable_storable and indirectly_movable_storable..." - // clang-format off template - concept bullet3 = !bullet1 && !bullet2 && indirectly_movable_storable - && indirectly_movable_storable; + concept bullet3 = + !bullet1 && !bullet2 && indirectly_movable_storable && indirectly_movable_storable; static_assert(bullet3 && can_iter_swap); - // clang-format on template struct unswap_proxy_ref { @@ -1281,9 +1279,7 @@ namespace iterator_cust_swap_test { static_assert(false); } - // clang-format off static_assert(bullet2 && can_iter_swap); - // clang-format on constexpr bool test() { { diff --git a/tests/std/tests/P0896R4_ranges_to_address/test.cpp b/tests/std/tests/P0896R4_ranges_to_address/test.cpp index 0e737e2286..d0275b434d 100644 --- a/tests/std/tests/P0896R4_ranges_to_address/test.cpp +++ b/tests/std/tests/P0896R4_ranges_to_address/test.cpp @@ -112,10 +112,9 @@ int main(int argc, char* argv[]) { test_positive_cases, false>(); }); - // clang-format off #if _ITERATOR_DEBUG_LEVEL != 0 exec.add_death_tests({ - // Tests for only vector: basic_string doesn't invalidate on element creation/destruction because POD. + // Tests for only vector: basic_string doesn't invalidate on element creation/destruction because POD. #if _ITERATOR_DEBUG_LEVEL == 2 test_invalidated_by_pop_back, false>, test_invalidated_by_pop_back, true>, @@ -134,7 +133,6 @@ int main(int argc, char* argv[]) { test_out_of_range, true>, }); #endif // _ITERATOR_DEBUG_LEVEL != 0 - // clang-format on return exec.run(argc, argv); } diff --git a/tests/std/tests/P0896R4_views_counted/test.cpp b/tests/std/tests/P0896R4_views_counted/test.cpp index c1ee0c5f49..a033fb7264 100644 --- a/tests/std/tests/P0896R4_views_counted/test.cpp +++ b/tests/std/tests/P0896R4_views_counted/test.cpp @@ -10,13 +10,9 @@ using namespace std; -// clang-format off template concept Countable = requires { typename iter_difference_t>; } - && requires(I&& i, iter_difference_t> n) { - views::counted(forward(i), n); - }; -// clang-format on + && requires(I&& i, iter_difference_t> n) { views::counted(forward(i), n); }; template struct convertible_difference { diff --git a/tests/std/tests/P2286R8_text_formatting_tuple/test.cpp b/tests/std/tests/P2286R8_text_formatting_tuple/test.cpp index 40e2c366df..d5d1189578 100644 --- a/tests/std/tests/P2286R8_text_formatting_tuple/test.cpp +++ b/tests/std/tests/P2286R8_text_formatting_tuple/test.cpp @@ -379,17 +379,15 @@ void run_tests(TestFunction check, ExceptionTest check_exception) { test_escaping(check, make_tuple(CharT('*'), STR(""))); // Test const ref-qualified types. - // clang-format off - check(SV("(42)"), SV("{}"), tuple< int >{42}); - check(SV("(42)"), SV("{}"), tuple{42}); + check(SV("(42)"), SV("{}"), tuple{42}); + check(SV("(42)"), SV("{}"), tuple{42}); int answer = 42; - check(SV("(42)"), SV("{}"), tuple< int& >{answer}); - check(SV("(42)"), SV("{}"), tuple{answer}); + check(SV("(42)"), SV("{}"), tuple{answer}); + check(SV("(42)"), SV("{}"), tuple{answer}); - check(SV("(42)"), SV("{}"), tuple< int&&>{42}); + check(SV("(42)"), SV("{}"), tuple{42}); check(SV("(42)"), SV("{}"), tuple{42}); - // clang-format on } template From 16131a0990de166b35d98b6c007ff852bb75bb3a Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Tue, 10 Sep 2024 21:17:01 -0700 Subject: [PATCH 25/30] Manual: Remove clang-format suppression and introduce parens. --- stl/inc/iterator | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/stl/inc/iterator b/stl/inc/iterator index 941a80264c..564bc7d023 100644 --- a/stl/inc/iterator +++ b/stl/inc/iterator @@ -212,18 +212,16 @@ public: using _Prevent_inheriting_unwrap = move_sentinel; - // clang-format off - _NODISCARD constexpr move_sentinel<_Unwrapped_t> _Unwrapped() const& - noexcept(noexcept(move_sentinel<_Unwrapped_t>{_Last._Unwrapped()})) - requires _RANGES _Weakly_unwrappable_sentinel<_Se> { - // clang-format on + _NODISCARD constexpr move_sentinel<_Unwrapped_t> _Unwrapped() const& noexcept( + noexcept(move_sentinel<_Unwrapped_t>{_Last._Unwrapped()})) + requires (_RANGES _Weakly_unwrappable_sentinel<_Se>) + { return move_sentinel<_Unwrapped_t>{_Last._Unwrapped()}; } - // clang-format off - _NODISCARD constexpr move_sentinel<_Unwrapped_t<_Se>> _Unwrapped() && - noexcept(noexcept(move_sentinel<_Unwrapped_t<_Se>>{_STD move(_Last)._Unwrapped()})) - requires _RANGES _Weakly_unwrappable_sentinel<_Se> { - // clang-format on + _NODISCARD constexpr move_sentinel<_Unwrapped_t<_Se>> _Unwrapped() && noexcept( + noexcept(move_sentinel<_Unwrapped_t<_Se>>{_STD move(_Last)._Unwrapped()})) + requires (_RANGES _Weakly_unwrappable_sentinel<_Se>) + { return move_sentinel<_Unwrapped_t<_Se>>{_STD move(_Last)._Unwrapped()}; } From 63bcdbba600b0c15e423ed3e82d2d299cbddf006 Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Tue, 10 Sep 2024 21:20:45 -0700 Subject: [PATCH 26/30] Manual: Shrink clang-format suppression in `` down to `concept common_with`. --- stl/inc/concepts | 134 ++++++++++++++++++++--------------------------- 1 file changed, 56 insertions(+), 78 deletions(-) diff --git a/stl/inc/concepts b/stl/inc/concepts index a219f4fbe4..b16d6b1c58 100644 --- a/stl/inc/concepts +++ b/stl/inc/concepts @@ -22,7 +22,6 @@ _STL_DISABLE_CLANG_WARNINGS #undef new _STD_BEGIN -// clang-format off template concept _Same_impl = // Must be a distinct concept to provide symmetric subsumption for same_as #ifdef __clang__ @@ -35,8 +34,8 @@ _EXPORT_STD template concept same_as = _Same_impl<_Ty1, _Ty2> && _Same_impl<_Ty2, _Ty1>; _EXPORT_STD template -concept derived_from = __is_base_of(_Base, _Derived) - && __is_convertible_to(const volatile _Derived*, const volatile _Base*); +concept derived_from = + __is_base_of(_Base, _Derived) && __is_convertible_to(const volatile _Derived*, const volatile _Base*); template concept _Implicitly_convertible_to = is_convertible_v<_From, _To>; @@ -46,11 +45,10 @@ concept common_reference_with = requires { typename common_reference_t<_Ty1, _Ty2>; typename common_reference_t<_Ty2, _Ty1>; - } - && same_as, common_reference_t<_Ty2, _Ty1>> - && convertible_to<_Ty1, common_reference_t<_Ty1, _Ty2>> - && convertible_to<_Ty2, common_reference_t<_Ty1, _Ty2>>; + } && same_as, common_reference_t<_Ty2, _Ty1>> + && convertible_to<_Ty1, common_reference_t<_Ty1, _Ty2>> && convertible_to<_Ty2, common_reference_t<_Ty1, _Ty2>>; +// clang-format off _EXPORT_STD template concept common_with = requires { @@ -65,6 +63,7 @@ concept common_with = && common_reference_with, add_lvalue_reference_t> && common_reference_with>, common_reference_t, add_lvalue_reference_t>>; +// clang-format on _EXPORT_STD template concept integral = is_integral_v<_Ty>; @@ -80,10 +79,10 @@ concept floating_point = is_floating_point_v<_Ty>; _EXPORT_STD template concept assignable_from = is_lvalue_reference_v<_LTy> - && common_reference_with&, const remove_reference_t<_RTy>&> - && requires(_LTy _Left, _RTy&& _Right) { - { _Left = static_cast<_RTy&&>(_Right) } -> same_as<_LTy>; - }; + && common_reference_with&, const remove_reference_t<_RTy>&> + && requires(_LTy _Left, _RTy&& _Right) { + { _Left = static_cast<_RTy&&>(_Right) } -> same_as<_LTy>; + }; // swappable and swappable_with are defined below, since they depend on move_constructible. @@ -91,22 +90,20 @@ _EXPORT_STD template concept destructible = __is_nothrow_destructible(_Ty); _EXPORT_STD template -concept constructible_from = destructible<_Ty> - && __is_constructible(_Ty, _ArgTys...); +concept constructible_from = destructible<_Ty> && __is_constructible(_Ty, _ArgTys...); _EXPORT_STD template -concept default_initializable = constructible_from<_Ty> - && requires { - _Ty{}; - ::new (static_cast(nullptr)) _Ty; // is-default-initializable<_Ty> - }; +concept default_initializable = constructible_from<_Ty> && requires { + _Ty{}; + ::new (static_cast(nullptr)) _Ty; // is-default-initializable<_Ty> +}; _EXPORT_STD template concept move_constructible = constructible_from<_Ty, _Ty> && convertible_to<_Ty, _Ty>; template -concept _Has_class_or_enum_type = __is_class(remove_reference_t<_Ty>) || __is_enum(remove_reference_t<_Ty>) - || __is_union(remove_reference_t<_Ty>); +concept _Has_class_or_enum_type = + __is_class(remove_reference_t<_Ty>) || __is_enum(remove_reference_t<_Ty>) || __is_union(remove_reference_t<_Ty>); namespace ranges { namespace _Swap { @@ -114,8 +111,8 @@ namespace ranges { void swap(_Ty&, _Ty&) = delete; template - concept _Use_ADL_swap = (_Has_class_or_enum_type<_Ty1> || _Has_class_or_enum_type<_Ty2>) - && requires(_Ty1&& __t, _Ty2&& __u) { + concept _Use_ADL_swap = + (_Has_class_or_enum_type<_Ty1> || _Has_class_or_enum_type<_Ty2>) && requires(_Ty1&& __t, _Ty2&& __u) { swap(static_cast<_Ty1&&>(__t), static_cast<_Ty2&&>(__u)); // intentional ADL }; @@ -139,7 +136,8 @@ namespace ranges { template _STATIC_CALL_OPERATOR constexpr void operator()(_Ty1 (&__t)[_Size], _Ty2 (&__u)[_Size]) _CONST_CALL_OPERATOR noexcept(noexcept(operator()(__t[0], __u[0]))) - requires requires(_Cpo __fn) { __fn(__t[0], __u[0]); } { + requires requires(_Cpo __fn) { __fn(__t[0], __u[0]); } + { for (size_t __i = 0; __i < _Size; ++__i) { operator()(__t[__i], __u[__i]); } @@ -153,40 +151,34 @@ namespace ranges { } // namespace ranges _EXPORT_STD template -concept swappable = requires(_Ty& __x, _Ty& __y) { - _RANGES swap(__x, __y); -}; +concept swappable = requires(_Ty& __x, _Ty& __y) { _RANGES swap(__x, __y); }; _EXPORT_STD template -concept swappable_with = common_reference_with<_Ty1, _Ty2> - && requires(_Ty1&& __t, _Ty2&& __u) { - _RANGES swap(static_cast<_Ty1&&>(__t), static_cast<_Ty1&&>(__t)); - _RANGES swap(static_cast<_Ty2&&>(__u), static_cast<_Ty2&&>(__u)); - _RANGES swap(static_cast<_Ty1&&>(__t), static_cast<_Ty2&&>(__u)); - _RANGES swap(static_cast<_Ty2&&>(__u), static_cast<_Ty1&&>(__t)); - }; +concept swappable_with = common_reference_with<_Ty1, _Ty2> && requires(_Ty1&& __t, _Ty2&& __u) { + _RANGES swap(static_cast<_Ty1&&>(__t), static_cast<_Ty1&&>(__t)); + _RANGES swap(static_cast<_Ty2&&>(__u), static_cast<_Ty2&&>(__u)); + _RANGES swap(static_cast<_Ty1&&>(__t), static_cast<_Ty2&&>(__u)); + _RANGES swap(static_cast<_Ty2&&>(__u), static_cast<_Ty1&&>(__t)); +}; _EXPORT_STD template -concept copy_constructible = move_constructible<_Ty> - && constructible_from<_Ty, _Ty&> && convertible_to<_Ty&, _Ty> - && constructible_from<_Ty, const _Ty&> && convertible_to - && constructible_from<_Ty, const _Ty> && convertible_to; +concept copy_constructible = move_constructible<_Ty> && constructible_from<_Ty, _Ty&> && convertible_to<_Ty&, _Ty> + && constructible_from<_Ty, const _Ty&> && convertible_to + && constructible_from<_Ty, const _Ty> && convertible_to; template concept _Boolean_testable_impl = convertible_to<_Ty, bool>; template -concept _Boolean_testable = _Boolean_testable_impl<_Ty> - && requires(_Ty&& __t) { - { !static_cast<_Ty&&>(__t) } -> _Boolean_testable_impl; - }; +concept _Boolean_testable = _Boolean_testable_impl<_Ty> && requires(_Ty&& __t) { + { !static_cast<_Ty&&>(__t) } -> _Boolean_testable_impl; +}; template -concept _Half_equality_comparable = - requires(const remove_reference_t<_Ty1>& __x, const remove_reference_t<_Ty2>& __y) { - { __x == __y } -> _Boolean_testable; - { __x != __y } -> _Boolean_testable; - }; +concept _Half_equality_comparable = requires(const remove_reference_t<_Ty1>& __x, const remove_reference_t<_Ty2>& __y) { + { __x == __y } -> _Boolean_testable; + { __x != __y } -> _Boolean_testable; +}; template concept _Weakly_equality_comparable_with = @@ -197,19 +189,18 @@ concept equality_comparable = _Half_equality_comparable<_Ty, _Ty>; #if _HAS_CXX23 template > -concept _Comparison_common_type_with_impl = - same_as<_Ref, common_reference_t> - && requires { - requires convertible_to || convertible_to<_Ty1, const _Ref&>; - requires convertible_to || convertible_to<_Ty2, const _Ref&>; - }; +concept _Comparison_common_type_with_impl = same_as<_Ref, common_reference_t> && requires { + requires convertible_to || convertible_to<_Ty1, const _Ref&>; + requires convertible_to || convertible_to<_Ty2, const _Ref&>; +}; template concept _Comparison_common_type_with = _Comparison_common_type_with_impl, remove_cvref_t<_Ty2>>; #endif // _HAS_CXX23 _EXPORT_STD template -concept equality_comparable_with = equality_comparable<_Ty1> && equality_comparable<_Ty2> +concept equality_comparable_with = + equality_comparable<_Ty1> && equality_comparable<_Ty2> #if _HAS_CXX23 && _Comparison_common_type_with<_Ty1, _Ty2> #else // ^^^ _HAS_CXX23 / !_HAS_CXX23 vvv @@ -220,8 +211,8 @@ concept equality_comparable_with = equality_comparable<_Ty1> && equality_compara template concept _Half_ordered = requires(const remove_reference_t<_Ty1>& __t, const remove_reference_t<_Ty2>& __u) { - { __t < __u } -> _Boolean_testable; - { __t > __u } -> _Boolean_testable; + { __t < __u } -> _Boolean_testable; + { __t > __u } -> _Boolean_testable; { __t <= __u } -> _Boolean_testable; { __t >= __u } -> _Boolean_testable; }; @@ -233,23 +224,17 @@ _EXPORT_STD template concept totally_ordered = equality_comparable<_Ty> && _Half_ordered<_Ty, _Ty>; _EXPORT_STD template -concept totally_ordered_with = totally_ordered<_Ty1> && totally_ordered<_Ty2> - && equality_comparable_with<_Ty1, _Ty2> +concept totally_ordered_with = + totally_ordered<_Ty1> && totally_ordered<_Ty2> && equality_comparable_with<_Ty1, _Ty2> && totally_ordered&, const remove_reference_t<_Ty2>&>> && _Partially_ordered_with<_Ty1, _Ty2>; _EXPORT_STD template -concept movable = is_object_v<_Ty> - && move_constructible<_Ty> - && assignable_from<_Ty&, _Ty> - && swappable<_Ty>; +concept movable = is_object_v<_Ty> && move_constructible<_Ty> && assignable_from<_Ty&, _Ty> && swappable<_Ty>; _EXPORT_STD template -concept copyable = copy_constructible<_Ty> - && movable<_Ty> - && assignable_from<_Ty&, _Ty&> - && assignable_from<_Ty&, const _Ty&> - && assignable_from<_Ty&, const _Ty>; +concept copyable = copy_constructible<_Ty> && movable<_Ty> && assignable_from<_Ty&, _Ty&> + && assignable_from<_Ty&, const _Ty&> && assignable_from<_Ty&, const _Ty>; _EXPORT_STD template concept semiregular = copyable<_Ty> && default_initializable<_Ty>; @@ -258,23 +243,18 @@ _EXPORT_STD template concept regular = semiregular<_Ty> && equality_comparable<_Ty>; _EXPORT_STD template -concept invocable = requires(_FTy&& _Fn, _ArgTys&&... _Args) { - _STD invoke(static_cast<_FTy&&>(_Fn), static_cast<_ArgTys&&>(_Args)...); -}; +concept invocable = requires( + _FTy&& _Fn, _ArgTys&&... _Args) { _STD invoke(static_cast<_FTy&&>(_Fn), static_cast<_ArgTys&&>(_Args)...); }; _EXPORT_STD template concept regular_invocable = invocable<_FTy, _ArgTys...>; _EXPORT_STD template -concept predicate = regular_invocable<_FTy, _ArgTys...> - && _Boolean_testable>; +concept predicate = regular_invocable<_FTy, _ArgTys...> && _Boolean_testable>; _EXPORT_STD template -concept relation = - predicate<_FTy, _Ty1, _Ty1> - && predicate<_FTy, _Ty2, _Ty2> - && predicate<_FTy, _Ty1, _Ty2> - && predicate<_FTy, _Ty2, _Ty1>; +concept relation = predicate<_FTy, _Ty1, _Ty1> && predicate<_FTy, _Ty2, _Ty2> && predicate<_FTy, _Ty1, _Ty2> + && predicate<_FTy, _Ty2, _Ty1>; _EXPORT_STD template concept equivalence_relation = relation<_FTy, _Ty1, _Ty2>; @@ -282,8 +262,6 @@ concept equivalence_relation = relation<_FTy, _Ty1, _Ty2>; _EXPORT_STD template concept strict_weak_order = relation<_FTy, _Ty1, _Ty2>; -// clang-format on - template struct _Choice_t { _Ty _Strategy = _Ty{}; From b2e9e03d304775de8685496392a68566bfc01eb7 Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Tue, 10 Sep 2024 21:34:37 -0700 Subject: [PATCH 27/30] Comment: Mention `` with correct capitalization. --- .../test.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/std/tests/VSO_0121275_filesystem_canonical_should_handle_many_double_dots/test.cpp b/tests/std/tests/VSO_0121275_filesystem_canonical_should_handle_many_double_dots/test.cpp index f219b21a6d..f5012baa30 100644 --- a/tests/std/tests/VSO_0121275_filesystem_canonical_should_handle_many_double_dots/test.cpp +++ b/tests/std/tests/VSO_0121275_filesystem_canonical_should_handle_many_double_dots/test.cpp @@ -24,7 +24,7 @@ namespace fs = std::experimental::filesystem; bool path_names_equal(const wstring& lhs, const wstring& rhs) { // This isn't strictly the same as NTFS's rules; but getting NTFS rules would - // require , and it's "close enough" as far as these tests care + // require , and it's "close enough" as far as these tests care return equal(lhs.begin(), lhs.end(), rhs.begin(), rhs.end(), [](wchar_t lhs, wchar_t rhs) { return towupper(lhs) == towupper(rhs); }); } From 7b5f243e4a122729e1fd06cb014450e9af6628d9 Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Tue, 10 Sep 2024 22:02:53 -0700 Subject: [PATCH 28/30] Overhaul header sorting. Use BASIC-style priorities: 10 for yvals/yvals_core, 20 for normal headers, 30 for Windows headers (with fine-grained SortPriority), and 40 for test headers. Mention (yvals|yvals_core) to be more searchable. userenv.h wasn't being included (anymore?). winioctl.h should be spelled lowercase. Make the regex for __msvc_MEOW.hpp clearer (we have no other double-underscore headers) and mention it in priority order as there's no chance it'll grab matches first. Add a rule to sort initguid.h first, similar to how winioctl.h sorts last. --- .clang-format | 27 +++++++++++++++------------ stl/src/stacktrace.cpp | 4 +--- 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/.clang-format b/.clang-format index 1acd630668..0ffd390f78 100644 --- a/.clang-format +++ b/.clang-format @@ -157,20 +157,23 @@ IncludeBlocks: Regroup # SortPriority: 0 # CaseSensitive: false IncludeCategories: - - Regex: '^$' - Priority: 1 - - Regex: '^<(Windows|userenv)\.h>$' - Priority: 3 - SortPriority: 3 - - Regex: '^$' - Priority: 3 - SortPriority: 4 - - Regex: '^<__.*\.hpp>$' - Priority: 2 + - Regex: '^<(yvals|yvals_core)\.h>$' + Priority: 10 + - Regex: '^<__msvc_.*\.hpp>$' + Priority: 20 + - Regex: '^$' # should be included before any header that includes + Priority: 30 + SortPriority: 30 + - Regex: '^<(DbgEng|DbgHelp|Shlwapi|Windows)\.h>$' + Priority: 30 + SortPriority: 31 + - Regex: '^$' + Priority: 30 + SortPriority: 32 - Regex: '\.hpp[>"]$' - Priority: 5 + Priority: 40 - Regex: '.*' - Priority: 2 + Priority: 20 # IncludeIsMainRegex: '(Test)?$' # IncludeIsMainSourceRegex: '' # IndentAccessModifiers: false diff --git a/stl/src/stacktrace.cpp b/stl/src/stacktrace.cpp index 3ba9652b51..3a67e4c957 100644 --- a/stl/src/stacktrace.cpp +++ b/stl/src/stacktrace.cpp @@ -4,12 +4,10 @@ #include #include -// clang-format off -#include // should be before any header that includes +#include #include #include #include -// clang-format on // The below function pointer types must be in sync with From 92043868cafcef424bcb768eee99188d9c603cb5 Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Tue, 10 Sep 2024 16:06:11 -0700 Subject: [PATCH 29/30] Clang 18 didn't fix the bug affecting `_Zip_transform_constraints` and `_Adjacent_transform_constraints` that we thought was LLVM-61763. --- stl/inc/ranges | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/stl/inc/ranges b/stl/inc/ranges index 372a301441..38e3e08377 100644 --- a/stl/inc/ranges +++ b/stl/inc/ranges @@ -7158,7 +7158,7 @@ namespace ranges { private: friend zip_view; -#ifdef __clang__ // TRANSITION, LLVM-61763 +#ifdef __clang__ // TRANSITION, need to reduce and report (was thought to be LLVM-61763) public: #else // ^^^ workaround / no workaround vvv template @@ -7983,13 +7983,14 @@ namespace ranges { private: friend adjacent_view; -#ifdef __clang__ // TRANSITION, LLVM-61763 +#ifdef __clang__ // TRANSITION, need to reduce and report (was thought to be LLVM-61763) public: #else // ^^^ workaround / no workaround vvv template requires _Adjacent_transform_constraints<_Vw2, _Fn, _Nx2> friend class adjacent_transform_view; #endif // ^^^ no workaround ^^^ + using _Base = _Maybe_const<_Const, _Vw>; using _Base_iterator = iterator_t<_Base>; From 4b3fbb9321ed7bdc545d91bb643fa76ff87792a2 Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Wed, 11 Sep 2024 02:29:06 -0700 Subject: [PATCH 30/30] Add newlines to save one column and stay within 120. --- stl/inc/ranges | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/stl/inc/ranges b/stl/inc/ranges index 38e3e08377..bb5eca79ce 100644 --- a/stl/inc/ranges +++ b/stl/inc/ranges @@ -8942,11 +8942,13 @@ namespace ranges { public: using iterator_category = input_iterator_tag; - using iterator_concept = conditional_t<_Cartesian_product_is_random_access<_Const, _First, _Rest...>, - random_access_iterator_tag, - conditional_t<_Cartesian_product_is_bidirectional<_Const, _First, _Rest...>, bidirectional_iterator_tag, - conditional_t>, forward_iterator_tag, - input_iterator_tag>>>; + + using iterator_concept = conditional_t<_Cartesian_product_is_random_access<_Const, _First, _Rest...>, + random_access_iterator_tag, + conditional_t<_Cartesian_product_is_bidirectional<_Const, _First, _Rest...>, bidirectional_iterator_tag, + conditional_t>, forward_iterator_tag, + input_iterator_tag>>>; + using value_type = tuple>, range_value_t<_Maybe_const<_Const, _Rest>>...>; using reference = tuple>,