From 317e909b7e9f403cf3a615adb0083957dccf3a84 Mon Sep 17 00:00:00 2001 From: cpplearner Date: Tue, 1 Feb 2022 19:55:43 +0800 Subject: [PATCH 1/4] Split --- stl/inc/yvals_core.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/stl/inc/yvals_core.h b/stl/inc/yvals_core.h index 98896926d32..2b7c0d6287a 100644 --- a/stl/inc/yvals_core.h +++ b/stl/inc/yvals_core.h @@ -1365,10 +1365,14 @@ #if _HAS_CXX20 #define __cpp_lib_optional 202106L // P2231R1 Completing constexpr In optional And variant -#define __cpp_lib_variant 202106L // P2231R1 Completing constexpr In optional And variant #elif _HAS_CXX17 // ^^^ _HAS_CXX20 / _HAS_CXX17 vvv #define __cpp_lib_optional 201606L // P0307R2 Making Optional Greater Equal Again -#define __cpp_lib_variant 202102L // P2162R2 Inheriting From variant +#endif // _HAS_CXX17 + +#if _HAS_CXX20 +#define __cpp_lib_variant 202106L // P2231R1 Completing constexpr In optional And variant +#elif _HAS_CXX17 // ^^^ _HAS_CXX20 / _HAS_CXX17 vvv +#define __cpp_lib_variant 202102L // P2162R2 Inheriting From variant #endif // _HAS_CXX17 #if _HAS_CXX20 && defined(__cpp_lib_concepts) // TRANSITION, GH-395 From 9a90df8fdf76997dec9d635f416b663200795b03 Mon Sep 17 00:00:00 2001 From: cpplearner Date: Tue, 1 Feb 2022 19:59:43 +0800 Subject: [PATCH 2/4] Reorder --- stl/inc/yvals_core.h | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/stl/inc/yvals_core.h b/stl/inc/yvals_core.h index 2b7c0d6287a..44dc1181e38 100644 --- a/stl/inc/yvals_core.h +++ b/stl/inc/yvals_core.h @@ -1349,32 +1349,12 @@ #define __cpp_lib_unwrap_ref 201811L #endif // _HAS_CXX20 -#ifndef _M_CEE -#if _HAS_CXX20 -#define __cpp_lib_execution 201902L // P1001R2 execution::unseq -#elif _HAS_CXX17 -#define __cpp_lib_execution 201603L // P0024R2 Parallel Algorithms -#endif // language mode -#endif // _M_CEE - #if _HAS_CXX20 #define __cpp_lib_array_constexpr 201811L // P1032R1 Miscellaneous constexpr #elif _HAS_CXX17 // ^^^ _HAS_CXX20 / _HAS_CXX17 vvv #define __cpp_lib_array_constexpr 201803L // P0858R0 Constexpr Iterator Requirements #endif // _HAS_CXX17 -#if _HAS_CXX20 -#define __cpp_lib_optional 202106L // P2231R1 Completing constexpr In optional And variant -#elif _HAS_CXX17 // ^^^ _HAS_CXX20 / _HAS_CXX17 vvv -#define __cpp_lib_optional 201606L // P0307R2 Making Optional Greater Equal Again -#endif // _HAS_CXX17 - -#if _HAS_CXX20 -#define __cpp_lib_variant 202106L // P2231R1 Completing constexpr In optional And variant -#elif _HAS_CXX17 // ^^^ _HAS_CXX20 / _HAS_CXX17 vvv -#define __cpp_lib_variant 202102L // P2162R2 Inheriting From variant -#endif // _HAS_CXX17 - #if _HAS_CXX20 && defined(__cpp_lib_concepts) // TRANSITION, GH-395 #define __cpp_lib_chrono 201907L // P1466R3 Miscellaneous Minor Fixes For #elif _HAS_CXX17 @@ -1383,12 +1363,32 @@ #define __cpp_lib_chrono 201510L // P0092R1 floor(), ceil(), round(), abs() #endif // _HAS_CXX17 +#ifndef _M_CEE +#if _HAS_CXX20 +#define __cpp_lib_execution 201902L // P1001R2 execution::unseq +#elif _HAS_CXX17 +#define __cpp_lib_execution 201603L // P0024R2 Parallel Algorithms +#endif // language mode +#endif // _M_CEE + +#if _HAS_CXX20 +#define __cpp_lib_optional 202106L // P2231R1 Completing constexpr In optional And variant +#elif _HAS_CXX17 // ^^^ _HAS_CXX20 / _HAS_CXX17 vvv +#define __cpp_lib_optional 201606L // P0307R2 Making Optional Greater Equal Again +#endif // _HAS_CXX17 + #if _HAS_CXX20 #define __cpp_lib_shared_ptr_arrays 201707L // P0674R1 make_shared() For Arrays #else // _HAS_CXX20 #define __cpp_lib_shared_ptr_arrays 201611L // P0497R0 Fixing shared_ptr For Arrays #endif // _HAS_CXX20 +#if _HAS_CXX20 +#define __cpp_lib_variant 202106L // P2231R1 Completing constexpr In optional And variant +#elif _HAS_CXX17 // ^^^ _HAS_CXX20 / _HAS_CXX17 vvv +#define __cpp_lib_variant 202102L // P2162R2 Inheriting From variant +#endif // _HAS_CXX17 + #if defined(__cpp_impl_coroutine) || defined(_DOWNLEVEL_COROUTINES_SUPPORTED) // TRANSITION, Clang coroutine support #define __cpp_lib_coroutine 201902L #endif // __cpp_impl_coroutine From fe201c70fed8c1c659233ed8529a135b321a57f0 Mon Sep 17 00:00:00 2001 From: cpplearner Date: Tue, 1 Feb 2022 20:03:22 +0800 Subject: [PATCH 3/4] Move down --- stl/inc/yvals_core.h | 71 ++++++++++++++++++++++---------------------- 1 file changed, 36 insertions(+), 35 deletions(-) diff --git a/stl/inc/yvals_core.h b/stl/inc/yvals_core.h index 44dc1181e38..600716b439c 100644 --- a/stl/inc/yvals_core.h +++ b/stl/inc/yvals_core.h @@ -1349,6 +1349,42 @@ #define __cpp_lib_unwrap_ref 201811L #endif // _HAS_CXX20 +#if defined(__cpp_impl_coroutine) || defined(_DOWNLEVEL_COROUTINES_SUPPORTED) // TRANSITION, Clang coroutine support +#define __cpp_lib_coroutine 201902L +#endif // __cpp_impl_coroutine + +// C++23 +#if _HAS_CXX23 +#define __cpp_lib_adaptor_iterator_pair_constructor 202106L + +#ifdef __cpp_lib_concepts +#define __cpp_lib_allocate_at_least 202106L +#endif // __cpp_lib_concepts + +#define __cpp_lib_associative_heterogeneous_erasure 202110L +#define __cpp_lib_byteswap 202110L +#define __cpp_lib_invoke_r 202106L +#define __cpp_lib_is_scoped_enum 202011L + +#ifdef __cpp_lib_concepts +#define __cpp_lib_monadic_optional 202110L +#endif // __cpp_lib_concepts + +#define __cpp_lib_move_only_function 202110L + +#ifdef __cpp_lib_concepts +#define __cpp_lib_out_ptr 202106L +#define __cpp_lib_ranges_starts_ends_with 202106L +#endif // __cpp_lib_concepts + +#define __cpp_lib_spanstream 202106L +#define __cpp_lib_stdatomic_h 202011L +#define __cpp_lib_string_contains 202011L +#define __cpp_lib_string_resize_and_overwrite 202110L +#define __cpp_lib_to_underlying 202102L +#endif // _HAS_CXX23 + +// macros with language mode sensitivity #if _HAS_CXX20 #define __cpp_lib_array_constexpr 201811L // P1032R1 Miscellaneous constexpr #elif _HAS_CXX17 // ^^^ _HAS_CXX20 / _HAS_CXX17 vvv @@ -1389,41 +1425,6 @@ #define __cpp_lib_variant 202102L // P2162R2 Inheriting From variant #endif // _HAS_CXX17 -#if defined(__cpp_impl_coroutine) || defined(_DOWNLEVEL_COROUTINES_SUPPORTED) // TRANSITION, Clang coroutine support -#define __cpp_lib_coroutine 201902L -#endif // __cpp_impl_coroutine - -// C++23 -#if _HAS_CXX23 -#define __cpp_lib_adaptor_iterator_pair_constructor 202106L - -#ifdef __cpp_lib_concepts -#define __cpp_lib_allocate_at_least 202106L -#endif // __cpp_lib_concepts - -#define __cpp_lib_associative_heterogeneous_erasure 202110L -#define __cpp_lib_byteswap 202110L -#define __cpp_lib_invoke_r 202106L -#define __cpp_lib_is_scoped_enum 202011L - -#ifdef __cpp_lib_concepts -#define __cpp_lib_monadic_optional 202110L -#endif // __cpp_lib_concepts - -#define __cpp_lib_move_only_function 202110L - -#ifdef __cpp_lib_concepts -#define __cpp_lib_out_ptr 202106L -#define __cpp_lib_ranges_starts_ends_with 202106L -#endif // __cpp_lib_concepts - -#define __cpp_lib_spanstream 202106L -#define __cpp_lib_stdatomic_h 202011L -#define __cpp_lib_string_contains 202011L -#define __cpp_lib_string_resize_and_overwrite 202110L -#define __cpp_lib_to_underlying 202102L -#endif // _HAS_CXX23 - #define __cpp_lib_experimental_erase_if 201411L #define __cpp_lib_experimental_filesystem 201406L From 78ba33d79167d1d14517c53734a5efd742dc5b34 Mon Sep 17 00:00:00 2001 From: cpplearner Date: Tue, 1 Feb 2022 20:11:19 +0800 Subject: [PATCH 4/4] `__cpp_lib_coroutine` --- stl/inc/yvals_core.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/stl/inc/yvals_core.h b/stl/inc/yvals_core.h index 600716b439c..27062bd3a5a 100644 --- a/stl/inc/yvals_core.h +++ b/stl/inc/yvals_core.h @@ -1253,6 +1253,10 @@ // C++20 #define __cpp_lib_atomic_value_initialization 201911L +#ifdef __cpp_impl_coroutine +#define __cpp_lib_coroutine 201902L +#endif // __cpp_impl_coroutine + #if _HAS_CXX20 #define __cpp_lib_assume_aligned 201811L #define __cpp_lib_atomic_flag_test 201907L @@ -1349,10 +1353,6 @@ #define __cpp_lib_unwrap_ref 201811L #endif // _HAS_CXX20 -#if defined(__cpp_impl_coroutine) || defined(_DOWNLEVEL_COROUTINES_SUPPORTED) // TRANSITION, Clang coroutine support -#define __cpp_lib_coroutine 201902L -#endif // __cpp_impl_coroutine - // C++23 #if _HAS_CXX23 #define __cpp_lib_adaptor_iterator_pair_constructor 202106L