diff --git a/stl/inc/any b/stl/inc/any index faaa26d96..66896cd95 100644 --- a/stl/inc/any +++ b/stl/inc/any @@ -9,7 +9,9 @@ #include #if _STL_COMPILER_PREPROCESSOR -#if _HAS_CXX17 +#if !_HAS_CXX17 +#pragma message("The contents of are available only with C++17 or later.") +#else // ^^^ !_HAS_CXX17 / _HAS_CXX17 vvv #include #include #include @@ -441,8 +443,6 @@ _STD_END _STL_RESTORE_CLANG_WARNINGS #pragma warning(pop) #pragma pack(pop) -#else // ^^^ _HAS_CXX17 / !_HAS_CXX17 vvv -#pragma message("class any is only available with C++17 or later.") #endif // _HAS_CXX17 #endif // _STL_COMPILER_PREPROCESSOR diff --git a/stl/inc/charconv b/stl/inc/charconv index 2c6aa3311..d038e666a 100644 --- a/stl/inc/charconv +++ b/stl/inc/charconv @@ -9,7 +9,9 @@ #include #if _STL_COMPILER_PREPROCESSOR -#if _HAS_CXX17 +#if !_HAS_CXX17 +#pragma message("The contents of are available only with C++17 or later.") +#else // ^^^ !_HAS_CXX17 / _HAS_CXX17 vvv #include #include #include @@ -3097,8 +3099,6 @@ _STD_END _STL_RESTORE_CLANG_WARNINGS #pragma warning(pop) #pragma pack(pop) -#else // ^^^ _HAS_CXX17 / !_HAS_CXX17 vvv -#pragma message("The contents of are only available with C++17 or later.") #endif // _HAS_CXX17 #endif // _STL_COMPILER_PREPROCESSOR #endif // _CHARCONV_ diff --git a/stl/inc/compare b/stl/inc/compare index f78c80635..25afa907b 100644 --- a/stl/inc/compare +++ b/stl/inc/compare @@ -9,7 +9,9 @@ #include #if _STL_COMPILER_PREPROCESSOR -#if _HAS_CXX20 +#if !_HAS_CXX20 +#pragma message("The contents of are available only with C++20 or later.") +#else // ^^^ !_HAS_CXX20 / _HAS_CXX20 vvv #include #pragma pack(push, _CRT_PACKING) @@ -475,8 +477,6 @@ _STD_END _STL_RESTORE_CLANG_WARNINGS #pragma warning(pop) #pragma pack(pop) -#else // ^^^ C++20 / not C++20 vvv -#pragma message("The contents of are only available with C++20 or later.") #endif // _HAS_CXX20 #endif // _STL_COMPILER_PREPROCESSOR diff --git a/stl/inc/concepts b/stl/inc/concepts index 185243a63..7d507516c 100644 --- a/stl/inc/concepts +++ b/stl/inc/concepts @@ -9,7 +9,9 @@ #include #if _STL_COMPILER_PREPROCESSOR -#ifdef __cpp_lib_concepts +#ifndef __cpp_lib_concepts +#pragma message("The contents of are available only with C++20 concepts support.") +#else // ^^^ !defined(__cpp_lib_concepts) / defined(__cpp_lib_concepts) vvv #if defined(__clang__) && !defined(_SILENCE_CLANG_CONCEPTS_MESSAGE) #error Despite the presence of some Clang-related bits, this header currently does not support Clang. \ You can define _SILENCE_CLANG_CONCEPTS_MESSAGE to silence this message and acknowledge that this is unsupported. @@ -364,8 +366,6 @@ _STD_END _STL_RESTORE_CLANG_WARNINGS #pragma warning(pop) #pragma pack(pop) -#else // ^^^ supported / not supported vvv -#pragma message("The contents of are only available with C++20 concepts support.") #endif // __cpp_lib_concepts #endif // _STL_COMPILER_PREPROCESSOR #endif // _CONCEPTS_ diff --git a/stl/inc/execution b/stl/inc/execution index 5762f83ef..81ae2d6aa 100644 --- a/stl/inc/execution +++ b/stl/inc/execution @@ -9,7 +9,9 @@ #include #if _STL_COMPILER_PREPROCESSOR -#if _HAS_CXX17 +#if !_HAS_CXX17 +#pragma message("The contents of are available only with C++17 or later.") +#else // ^^^ !_HAS_CXX17 / _HAS_CXX17 vvv #include #include #include @@ -2839,10 +2841,10 @@ inline size_t _Get_stable_sort_tree_height(const size_t _Count, const size_t _Hw // go to the next smaller power of 2 const auto _Count_max_tree_height = _Log_count_max_chunks & ~static_cast(1); - const auto _Ideal_chunks = _Hw_threads * _Oversubscription_multiplier; - const size_t _Log_ideal_chunks = _Floor_of_log_2(_Ideal_chunks); + const auto _Ideal_chunks = _Hw_threads * _Oversubscription_multiplier; + const size_t _Log_ideal_chunks = _Floor_of_log_2(_Ideal_chunks); #ifdef _WIN64 - const size_t _Max_tree_height = 62; // to avoid ptrdiff_t overflow + const size_t _Max_tree_height = 62; // to avoid ptrdiff_t overflow #else // ^^^ _WIN64 ^^^ // vvv !_WIN64 vvv const size_t _Max_tree_height = 30; #endif // _WIN64 @@ -5137,8 +5139,6 @@ _STD_END _STL_RESTORE_CLANG_WARNINGS #pragma warning(pop) #pragma pack(pop) -#else // ^^^ _HAS_CXX17 / !_HAS_CXX17 vvv -#pragma message("Parallel algorithms are only available with C++17 or later.") #endif // _HAS_CXX17 #endif // _STL_COMPILER_PREPROCESSOR #endif // _EXECUTION_ diff --git a/stl/inc/filesystem b/stl/inc/filesystem index ea4d09b01..e2f7ecc43 100644 --- a/stl/inc/filesystem +++ b/stl/inc/filesystem @@ -9,7 +9,9 @@ #include #if _STL_COMPILER_PREPROCESSOR -#if _HAS_CXX17 +#if !_HAS_CXX17 +#pragma message("The contents of are available only with C++17 or later.") +#else // ^^^ !_HAS_CXX17 / _HAS_CXX17 vvv #include #include #include @@ -4330,8 +4332,6 @@ _STD_END _STL_RESTORE_CLANG_WARNINGS #pragma warning(pop) #pragma pack(pop) -#else // ^^^ _HAS_CXX17 / !_HAS_CXX17 vvv -#pragma message("The contents of are only available with C++17 or later.") #endif // _HAS_CXX17 #endif // _STL_COMPILER_PREPROCESSOR #endif // _FILESYSTEM_ diff --git a/stl/inc/memory_resource b/stl/inc/memory_resource index ddbb84a7a..8efe9f682 100644 --- a/stl/inc/memory_resource +++ b/stl/inc/memory_resource @@ -9,7 +9,9 @@ #include #if _STL_COMPILER_PREPROCESSOR -#if _HAS_CXX17 +#if !_HAS_CXX17 +#pragma message("The contents of are available only with C++17 or later.") +#else // ^^^ !_HAS_CXX17 / _HAS_CXX17 vvv #include #include #include @@ -755,8 +757,6 @@ _STD_END _STL_RESTORE_CLANG_WARNINGS #pragma warning(pop) #pragma pack(pop) -#else // ^^^ _HAS_CXX17 / !_HAS_CXX17 vvv -#pragma message("The contents of are only available with C++17 or later.") #endif // _HAS_CXX17 #endif // _STL_COMPILER_PREPROCESSOR #endif // _MEMORY_RESOURCE_ diff --git a/stl/inc/optional b/stl/inc/optional index 3d5708bc6..7b1aa33cc 100644 --- a/stl/inc/optional +++ b/stl/inc/optional @@ -8,7 +8,9 @@ #define _OPTIONAL_ #include #if _STL_COMPILER_PREPROCESSOR -#if _HAS_CXX17 +#if !_HAS_CXX17 +#pragma message("The contents of are available only with C++17 or later.") +#else // ^^^ !_HAS_CXX17 / _HAS_CXX17 vvv #include #include #include @@ -637,8 +639,6 @@ _STD_END _STL_RESTORE_CLANG_WARNINGS #pragma warning(pop) #pragma pack(pop) -#else // ^^^ _HAS_CXX17 / !_HAS_CXX17 vvv -#pragma message("class template optional is only available with C++17 or later.") #endif // _HAS_CXX17 #endif // _STL_COMPILER_PREPROCESSOR #endif // _OPTIONAL_ diff --git a/stl/inc/ranges b/stl/inc/ranges index d40da8562..9f63a30e0 100644 --- a/stl/inc/ranges +++ b/stl/inc/ranges @@ -8,7 +8,9 @@ #define _RANGES_ #include #if _STL_COMPILER_PREPROCESSOR -#ifdef __cpp_lib_concepts +#ifndef __cpp_lib_concepts +#pragma message("The contents of are available only with C++20 concepts support.") +#else // ^^^ !defined(__cpp_lib_concepts) / defined(__cpp_lib_concepts) vvv #include #pragma pack(push, _CRT_PACKING) @@ -34,8 +36,6 @@ _STD_END _STL_RESTORE_CLANG_WARNINGS #pragma warning(pop) #pragma pack(pop) -#else // ^^^ Concepts support / no Concepts vvv -#pragma message("The contents of are only available with C++20 concepts support.") #endif // __cpp_lib_concepts #endif // _STL_COMPILER_PREPROCESSOR #endif // _RANGES_ diff --git a/stl/inc/string_view b/stl/inc/string_view index 6acf42305..ff23b4096 100644 --- a/stl/inc/string_view +++ b/stl/inc/string_view @@ -9,10 +9,10 @@ #include #if _STL_COMPILER_PREPROCESSOR -#if _HAS_CXX17 +#if !_HAS_CXX17 +#pragma message("The contents of are available only with C++17 or later.") +#else // ^^^ !_HAS_CXX17 / _HAS_CXX17 vvv #include -#else // ^^^ _HAS_CXX17 / !_HAS_CXX17 vvv -#pragma message("string_view is only available with C++17 or later.") #endif // _HAS_CXX17 #endif // _STL_COMPILER_PREPROCESSOR #endif // _STRING_VIEW_ diff --git a/stl/inc/variant b/stl/inc/variant index a34234077..d23ff08f4 100644 --- a/stl/inc/variant +++ b/stl/inc/variant @@ -9,7 +9,9 @@ #include #if _STL_COMPILER_PREPROCESSOR -#if _HAS_CXX17 +#if !_HAS_CXX17 +#pragma message("The contents of are available only with C++17 or later.") +#else // ^^^ !_HAS_CXX17 / _HAS_CXX17 vvv #include #include #include @@ -1156,7 +1158,7 @@ public: (void) _That_ref; // TRANSITION, VSO-486357 constexpr size_t _That_idx = decltype(_That_ref)::_Idx; #ifdef __EDG__ // TRANSITION, VSO-657455 - constexpr size_t _My_idx = decltype(_My_ref)::_Idx + 0 * _That_idx; + constexpr size_t _My_idx = decltype(_My_ref)::_Idx + 0 * _That_idx; #else // ^^^ workaround ^^^ / vvv no workaround vvv constexpr size_t _My_idx = decltype(_My_ref)::_Idx; #endif // TRANSITION, VSO-657455 @@ -1749,9 +1751,6 @@ _STD_END _STL_RESTORE_CLANG_WARNINGS #pragma warning(pop) #pragma pack(pop) - -#else // ^^^ _HAS_CXX17 ^^^ / vvv !_HAS_CXX17 vvv -#pragma message("class template variant is only available with C++17 or later.") #endif // _HAS_CXX17 #endif // _STL_COMPILER_PREPROCESSOR #endif // _VARIANT_