diff --git a/stl/inc/__msvc_bit_utils.hpp b/stl/inc/__msvc_bit_utils.hpp index 9b09cf86e32..4d29b905e1e 100644 --- a/stl/inc/__msvc_bit_utils.hpp +++ b/stl/inc/__msvc_bit_utils.hpp @@ -88,9 +88,9 @@ _NODISCARD int _Countl_zero_lzcnt(const _Ty _Val) noexcept { } else { return _Countl_zero_lzcnt(_High); } -#else // ^^^ _M_IX86 / !_M_IX86 vvv +#else // ^^^ defined(_M_IX86) / !defined(_M_IX86) vvv return static_cast(__lzcnt64(_Val)); -#endif // _M_IX86 +#endif // ^^^ !defined(_M_IX86) ^^^ } } @@ -114,11 +114,11 @@ _NODISCARD int _Countl_zero_bsr(const _Ty _Val) noexcept { if (!_BitScanReverse(&_Result, _Low)) { return _Digits; } -#else // ^^^ _M_IX86 / !_M_IX86 vvv +#else // ^^^ defined(_M_IX86) / !defined(_M_IX86) vvv if (!_BitScanReverse64(&_Result, _Val)) { return _Digits; } -#endif // _M_IX86 +#endif // ^^^ !defined(_M_IX86) ^^^ } return static_cast(_Digits - 1 - _Result); } @@ -127,14 +127,14 @@ template _NODISCARD int _Checked_x86_x64_countl_zero(const _Ty _Val) noexcept { #ifdef __AVX2__ return _Countl_zero_lzcnt(_Val); -#else // __AVX2__ +#else // ^^^ defined(__AVX2__) / !defined(__AVX2__) vvv const bool _Definitely_have_lzcnt = __isa_available >= _Stl_isa_available_avx2; if (_Definitely_have_lzcnt) { return _Countl_zero_lzcnt(_Val); } else { return _Countl_zero_bsr(_Val); } -#endif // __AVX2__ +#endif // ^^^ !defined(__AVX2__) ^^^ } #endif // defined(_M_IX86) || (defined(_M_X64) && !defined(_M_ARM64EC)) @@ -250,9 +250,9 @@ _NODISCARD int _Countr_zero_tzcnt(const _Ty _Val) noexcept { } else { return static_cast(_TZCNT_U32(_Low)); } -#else // ^^^ _M_IX86 / !_M_IX86 vvv +#else // ^^^ defined(_M_IX86) / !defined(_M_IX86) vvv return static_cast(_TZCNT_U64(_Val)); -#endif // _M_IX86 +#endif // ^^^ !defined(_M_IX86) ^^^ } } @@ -285,11 +285,11 @@ _NODISCARD int _Countr_zero_bsf(const _Ty _Val) noexcept { } else { return static_cast(_Result + 32); } -#else // ^^^ _M_IX86 / !_M_IX86 vvv +#else // ^^^ defined(_M_IX86) / !defined(_M_IX86) vvv if (!_BitScanForward64(&_Result, _Val)) { return _Digits; } -#endif // _M_IX86 +#endif // ^^^ !defined(_M_IX86) ^^^ } return static_cast(_Result); } @@ -298,14 +298,14 @@ template _NODISCARD int _Checked_x86_x64_countr_zero(const _Ty _Val) noexcept { #ifdef __AVX2__ return _Countr_zero_tzcnt(_Val); -#else // __AVX2__ +#else // ^^^ defined(__AVX2__) / !defined(__AVX2__) vvv const bool _Definitely_have_tzcnt = __isa_available >= _Stl_isa_available_avx2; if (_Definitely_have_tzcnt) { return _Countr_zero_tzcnt(_Val); } else { return _Countr_zero_bsf(_Val); } -#endif // __AVX2__ +#endif // ^^^ !defined(__AVX2__) ^^^ } #endif // _HAS_TZCNT_BSF_INTRINSICS @@ -328,9 +328,9 @@ _NODISCARD int _Unchecked_x86_x64_popcount(const _Ty _Val) noexcept { } else { #ifdef _M_IX86 return static_cast(__popcnt(_Val >> 32) + __popcnt(static_cast(_Val))); -#else // ^^^ _M_IX86 / !_M_IX86 vvv +#else // ^^^ defined(_M_IX86) / !defined(_M_IX86) vvv return static_cast(__popcnt64(_Val)); -#endif // _M_IX86 +#endif // ^^^ !defined(_M_IX86) ^^^ } } diff --git a/stl/inc/__msvc_cxx_stdatomic.hpp b/stl/inc/__msvc_cxx_stdatomic.hpp index 72087cb7834..f6874f70a22 100644 --- a/stl/inc/__msvc_cxx_stdatomic.hpp +++ b/stl/inc/__msvc_cxx_stdatomic.hpp @@ -12,13 +12,13 @@ // provide a specific error message for C compilers, before the general error message in yvals_core.h #ifndef __cplusplus #error <__msvc_cxx_stdatomic.hpp> is an internal header. It is incompatible with C and should not be directly included. -#endif // __cplusplus +#endif // !defined(__cplusplus) #include #ifdef _M_CEE_PURE #error is not supported when compiling with /clr:pure. -#endif // _M_CEE_PURE +#endif // defined(_M_CEE_PURE) #if !_HAS_CXX23 _EMIT_STL_WARNING(STL4038, "The contents of are available only with C++23 or later."); @@ -63,7 +63,7 @@ using _STD atomic_ullong; #ifdef __cpp_lib_char8_t using _STD atomic_char8_t; -#endif // __cpp_lib_char8_t +#endif // defined(__cpp_lib_char8_t) using _STD atomic_char16_t; using _STD atomic_char32_t; diff --git a/stl/inc/__msvc_filebuf.hpp b/stl/inc/__msvc_filebuf.hpp index 0700f3842ab..8270909dd3e 100644 --- a/stl/inc/__msvc_filebuf.hpp +++ b/stl/inc/__msvc_filebuf.hpp @@ -66,7 +66,7 @@ extern "C++" _CRTIMP2_PURE FILE* __CLRCALL_PURE_OR_CDECL _Fiopen(const wchar_t*, #ifdef _CRTBLD extern "C++" _CRTIMP2_PURE FILE* __CLRCALL_PURE_OR_CDECL _Fiopen(const unsigned short*, ios_base::openmode, int); -#endif // _CRTBLD +#endif // defined(_CRTBLD) template bool _Fgetc(_Elem& _Ch, FILE* _File) { // get an element from a C stream @@ -106,7 +106,7 @@ inline bool _Fgetc(unsigned short& _Wchar, FILE* _File) { // get an unsigned sho return true; } } -#endif // _CRTBLD +#endif // defined(_CRTBLD) template bool _Fputc(_Elem _Ch, FILE* _File) { // put an element to a C stream @@ -128,7 +128,7 @@ template <> inline bool _Fputc(unsigned short _Wchar, FILE* _File) { // put an unsigned short element to a C stream return _CSTD fputwc(_Wchar, _File) != WEOF; } -#endif // _CRTBLD +#endif // defined(_CRTBLD) template bool _Ungetc(const _Elem&, FILE*) { // put back an arbitrary element to a C stream (always fail) @@ -160,7 +160,7 @@ template <> inline bool _Ungetc(const unsigned short& _Wchar, FILE* _File) { // put back an unsigned short element to a C stream return _CSTD ungetwc(_Wchar, _File) != WEOF; } -#endif // _CRTBLD +#endif // defined(_CRTBLD) _EXPORT_STD template class basic_filebuf : public basic_streambuf<_Elem, _Traits> { // stream buffer associated with a C stream @@ -378,7 +378,7 @@ class basic_filebuf : public basic_streambuf<_Elem, _Traits> { // stream buffer return open(_Filename, static_cast(_Mode)); } #endif // _HAS_OLD_IOSTREAMS_MEMBERS -#endif // _CRTBLD +#endif // defined(_CRTBLD) basic_filebuf* close() { basic_filebuf* _Ans; diff --git a/stl/inc/__msvc_iter_core.hpp b/stl/inc/__msvc_iter_core.hpp index 1a9b378261e..e0d383213a1 100644 --- a/stl/inc/__msvc_iter_core.hpp +++ b/stl/inc/__msvc_iter_core.hpp @@ -476,7 +476,7 @@ template struct tuple_element<1, const ranges::subrange<_It, _Se, _Ki>> { using type = _Se; }; -#else // ^^^ __cpp_lib_concepts / !__cpp_lib_concepts vvv +#else // ^^^ defined(__cpp_lib_concepts) / !defined(__cpp_lib_concepts) vvv template struct _Iterator_traits_base {}; // empty for non-iterators @@ -509,7 +509,7 @@ struct iterator_traits : _Iterator_traits_base<_Iter> {}; // get traits from ite template struct iterator_traits<_Ty*> : _Iterator_traits_pointer_base<_Ty> {}; // get traits from pointer, if possible -#endif // __cpp_lib_concepts +#endif // ^^^ !defined(__cpp_lib_concepts) ^^^ _STD_END #pragma pop_macro("new") diff --git a/stl/inc/algorithm b/stl/inc/algorithm index c72b4042ce2..a00976f2d62 100644 --- a/stl/inc/algorithm +++ b/stl/inc/algorithm @@ -247,7 +247,7 @@ namespace ranges { }; #endif // _HAS_CXX23 } // namespace ranges -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) _EXPORT_STD template _CONSTEXPR20 _Fn for_each(_InIt _First, _InIt _Last, _Fn _Func) { // perform function for each element [_First, _Last) @@ -366,7 +366,7 @@ namespace ranges { _EXPORT_STD inline constexpr _For_each_n_fn for_each_n{_Not_quite_object::_Construct_tag{}}; } // namespace ranges -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) #if _HAS_CXX17 _EXPORT_STD template = 0> @@ -487,7 +487,7 @@ namespace ranges { _EXPORT_STD inline constexpr _Count_fn count{_Not_quite_object::_Construct_tag{}}; } // namespace ranges -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) _EXPORT_STD template _NODISCARD _CONSTEXPR20 _Iter_diff_t<_InIt> count_if(_InIt _First, _InIt _Last, _Pr _Pred) { @@ -551,7 +551,7 @@ namespace ranges { _EXPORT_STD inline constexpr _Count_if_fn count_if{_Not_quite_object::_Construct_tag{}}; } // namespace ranges -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) _EXPORT_STD template _NODISCARD _CONSTEXPR20 pair<_InIt1, _InIt2> mismatch(_InIt1 _First1, const _InIt1 _Last1, _InIt2 _First2, _Pr _Pred) { @@ -743,7 +743,7 @@ namespace ranges { _EXPORT_STD inline constexpr _Equal_fn equal{_Not_quite_object::_Construct_tag{}}; } // namespace ranges -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) _EXPORT_STD template _NODISCARD _CONSTEXPR20 bool is_permutation(_FwdIt1 _First1, _FwdIt1 _Last1, _FwdIt2 _First2, _Pr _Pred) { @@ -1111,7 +1111,7 @@ namespace ranges { _EXPORT_STD inline constexpr _Is_permutation_fn is_permutation{_Not_quite_object::_Construct_tag{}}; } // namespace ranges -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) _EXPORT_STD template _NODISCARD _CONSTEXPR20 bool all_of(_InIt _First, _InIt _Last, _Pr _Pred) { // test if all elements satisfy _Pred @@ -1172,7 +1172,7 @@ namespace ranges { _EXPORT_STD inline constexpr _All_of_fn all_of{_Not_quite_object::_Construct_tag{}}; } // namespace ranges -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) _EXPORT_STD template _NODISCARD _CONSTEXPR20 bool any_of(const _InIt _First, const _InIt _Last, _Pr _Pred) { @@ -1234,7 +1234,7 @@ namespace ranges { _EXPORT_STD inline constexpr _Any_of_fn any_of{_Not_quite_object::_Construct_tag{}}; } // namespace ranges -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) _EXPORT_STD template _NODISCARD _CONSTEXPR20 bool none_of(const _InIt _First, const _InIt _Last, _Pr _Pred) { @@ -1420,7 +1420,7 @@ namespace ranges { _EXPORT_STD inline constexpr _Copy_backward_fn copy_backward{_Not_quite_object::_Construct_tag{}}; } // namespace ranges -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) _EXPORT_STD template _CONSTEXPR20 _OutIt copy_if(_InIt _First, _InIt _Last, _OutIt _Dest, _Pr _Pred) { // copy each satisfying _Pred @@ -1601,7 +1601,7 @@ namespace ranges { _EXPORT_STD inline constexpr _Move_backward_fn move_backward{_Not_quite_object::_Construct_tag{}}; } // namespace ranges -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) _EXPORT_STD template _CONSTEXPR20 pair<_OutIt1, _OutIt2> partition_copy( @@ -1706,7 +1706,7 @@ namespace ranges { _EXPORT_STD inline constexpr _Partition_copy_fn partition_copy{_Not_quite_object::_Construct_tag{}}; } // namespace ranges -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) #endif // _HAS_CXX17 _EXPORT_STD template @@ -1790,7 +1790,7 @@ namespace ranges { _EXPORT_STD inline constexpr _Is_partitioned_fn is_partitioned{_Not_quite_object::_Construct_tag{}}; } // namespace ranges -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) _EXPORT_STD template _NODISCARD _CONSTEXPR20 _FwdIt partition_point(_FwdIt _First, _FwdIt _Last, _Pr _Pred) { @@ -1912,7 +1912,7 @@ namespace ranges { _EXPORT_STD inline constexpr _Partition_point_fn partition_point{_Not_quite_object::_Construct_tag{}}; } // namespace ranges -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) template _NODISCARD _CONSTEXPR20 bool _Equal_rev_pred_unchecked(_InIt1 _First1, _InIt2 _First2, const _InIt2 _Last2, _Pr _Pred) { @@ -2957,7 +2957,7 @@ namespace ranges { _EXPORT_STD inline constexpr _Find_last_if_fn find_last_if_not{_Not_quite_object::_Construct_tag{}}; #endif // _HAS_CXX23 } // namespace ranges -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) _EXPORT_STD template _NODISCARD _CONSTEXPR20 _FwdIt1 find_end( @@ -3220,7 +3220,7 @@ namespace ranges { _EXPORT_STD inline constexpr _Find_end_fn find_end{_Not_quite_object::_Construct_tag{}}; } // namespace ranges -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) _EXPORT_STD template _NODISCARD _CONSTEXPR20 _FwdIt1 find_first_of( @@ -3415,7 +3415,7 @@ namespace ranges { _EXPORT_STD inline constexpr _Swap_ranges_fn swap_ranges{_Not_quite_object::_Construct_tag{}}; } // namespace ranges -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) _EXPORT_STD template _CONSTEXPR20 _FwdIt2 swap_ranges(const _FwdIt1 _First1, const _FwdIt1 _Last1, _FwdIt2 _First2) { @@ -3597,7 +3597,7 @@ namespace ranges { _EXPORT_STD inline constexpr _Transform_fn transform{_Not_quite_object::_Construct_tag{}}; } // namespace ranges -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) _EXPORT_STD template _CONSTEXPR20 void replace(const _FwdIt _First, const _FwdIt _Last, const _Ty& _Oldval, const _Ty& _Newval) { @@ -3672,7 +3672,7 @@ namespace ranges { _EXPORT_STD inline constexpr _Replace_fn replace{_Not_quite_object::_Construct_tag{}}; } // namespace ranges -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) _EXPORT_STD template _CONSTEXPR20 void replace_if(const _FwdIt _First, const _FwdIt _Last, _Pr _Pred, const _Ty& _Val) { @@ -3745,7 +3745,7 @@ namespace ranges { _EXPORT_STD inline constexpr _Replace_if_fn replace_if{_Not_quite_object::_Construct_tag{}}; } // namespace ranges -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) _EXPORT_STD template _CONSTEXPR20 _OutIt replace_copy(_InIt _First, _InIt _Last, _OutIt _Dest, const _Ty& _Oldval, const _Ty& _Newval) { @@ -3839,7 +3839,7 @@ namespace ranges { _EXPORT_STD inline constexpr _Replace_copy_fn replace_copy{_Not_quite_object::_Construct_tag{}}; } // namespace ranges -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) _EXPORT_STD template _CONSTEXPR20 _OutIt replace_copy_if(_InIt _First, _InIt _Last, _OutIt _Dest, _Pr _Pred, const _Ty& _Val) { @@ -4042,7 +4042,7 @@ namespace ranges { _EXPORT_STD inline constexpr _Generate_n_fn generate_n{_Not_quite_object::_Construct_tag{}}; } // namespace ranges -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) _EXPORT_STD template _CONSTEXPR20 void generate(_FwdIt _First, _FwdIt _Last, _Fn _Func) { // replace [_First, _Last) with _Func() @@ -4386,7 +4386,7 @@ namespace ranges { _EXPORT_STD inline constexpr _Remove_copy_if_fn remove_copy_if{_Not_quite_object::_Construct_tag{}}; } // namespace ranges -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) _EXPORT_STD template _NODISCARD_UNIQUE_ALG _CONSTEXPR20 _FwdIt unique(_FwdIt _First, _FwdIt _Last, _Pr _Pred) { @@ -4501,7 +4501,7 @@ namespace ranges { _EXPORT_STD inline constexpr _Unique_fn unique{_Not_quite_object::_Construct_tag{}}; } // namespace ranges -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) template #ifdef __cpp_lib_concepts @@ -4759,7 +4759,7 @@ namespace ranges { _EXPORT_STD inline constexpr _Reverse_fn reverse{_Not_quite_object::_Construct_tag{}}; } // namespace ranges -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) _EXPORT_STD template _CONSTEXPR20 _OutIt reverse_copy(_BidIt _First, _BidIt _Last, _OutIt _Dest) { @@ -4897,7 +4897,7 @@ namespace ranges { _EXPORT_STD inline constexpr _Reverse_copy_fn reverse_copy{_Not_quite_object::_Construct_tag{}}; } // namespace ranges -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) #endif // _HAS_CXX17 #ifdef __cpp_lib_concepts @@ -5007,7 +5007,7 @@ namespace ranges { _EXPORT_STD inline constexpr _Rotate_fn rotate{_Not_quite_object::_Construct_tag{}}; } // namespace ranges -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) _EXPORT_STD template _CONSTEXPR20 _OutIt rotate_copy(_FwdIt _First, _FwdIt _Mid, _FwdIt _Last, _OutIt _Dest) { @@ -5084,7 +5084,7 @@ namespace ranges { _EXPORT_STD inline constexpr _Rotate_copy_fn rotate_copy{_Not_quite_object::_Construct_tag{}}; } // namespace ranges -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) #endif // _HAS_CXX17 template @@ -5346,7 +5346,7 @@ namespace ranges { _EXPORT_STD inline constexpr _Sample_fn sample{_Not_quite_object::_Construct_tag{}}; } // namespace ranges -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) #endif // _HAS_CXX17 template @@ -5434,7 +5434,7 @@ namespace ranges { _EXPORT_STD inline constexpr _Shuffle_fn shuffle{_Not_quite_object::_Construct_tag{}}; } // namespace ranges -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) #if _HAS_AUTO_PTR_ETC _EXPORT_STD template @@ -5962,7 +5962,7 @@ namespace ranges { _EXPORT_STD inline constexpr _Partition_fn partition{_Not_quite_object::_Construct_tag{}}; } // namespace ranges -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) #endif // _HAS_CXX17 template @@ -6332,7 +6332,7 @@ namespace ranges { _EXPORT_STD inline constexpr _Stable_partition_fn stable_partition{_Not_quite_object::_Construct_tag{}}; } // namespace ranges -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) template _CONSTEXPR20 void _Push_heap_by_index( @@ -6439,7 +6439,7 @@ namespace ranges { _EXPORT_STD inline constexpr _Push_heap_fn push_heap{_Not_quite_object::_Construct_tag{}}; } // namespace ranges -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) template _CONSTEXPR20 void _Pop_heap_hole_by_index( @@ -6601,7 +6601,7 @@ namespace ranges { _EXPORT_STD inline constexpr _Pop_heap_fn pop_heap{_Not_quite_object::_Construct_tag{}}; } // namespace ranges -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) template _CONSTEXPR20 void _Make_heap_unchecked(_RanIt _First, _RanIt _Last, _Pr _Pred) { @@ -6675,7 +6675,7 @@ namespace ranges { _EXPORT_STD inline constexpr _Make_heap_fn make_heap{_Not_quite_object::_Construct_tag{}}; } // namespace ranges -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) template _CONSTEXPR20 _RanIt _Is_heap_until_unchecked(_RanIt _First, _RanIt _Last, _Pr _Pred) { @@ -6823,7 +6823,7 @@ namespace ranges { _EXPORT_STD inline constexpr _Is_heap_until_fn is_heap_until{_Not_quite_object::_Construct_tag{}}; } // namespace ranges -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) #endif // _HAS_CXX17 template @@ -7001,7 +7001,7 @@ namespace ranges { _EXPORT_STD inline constexpr _Upper_bound_fn upper_bound{_Not_quite_object::_Construct_tag{}}; } // namespace ranges -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) _EXPORT_STD template _NODISCARD _CONSTEXPR20 pair<_FwdIt, _FwdIt> equal_range(_FwdIt _First, _FwdIt _Last, const _Ty& _Val, _Pr _Pred) { @@ -7107,7 +7107,7 @@ namespace ranges { _EXPORT_STD inline constexpr _Equal_range_fn equal_range{_Not_quite_object::_Construct_tag{}}; } // namespace ranges -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) _EXPORT_STD template _NODISCARD _CONSTEXPR20 bool binary_search(_FwdIt _First, _FwdIt _Last, const _Ty& _Val, _Pr _Pred) { @@ -7156,7 +7156,7 @@ namespace ranges { _EXPORT_STD inline constexpr _Binary_search_fn binary_search{_Not_quite_object::_Construct_tag{}}; } // namespace ranges -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) _NODISCARD constexpr _Distance_unknown _Idl_dist_add(_Distance_unknown, _Distance_unknown) { return {}; @@ -7326,7 +7326,7 @@ namespace ranges { _EXPORT_STD inline constexpr _Merge_fn merge{_Not_quite_object::_Construct_tag{}}; } // namespace ranges -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) #endif // _HAS_CXX17 // The "usual invariants" for the inplace_merge helpers below are: @@ -7915,7 +7915,7 @@ namespace ranges { _EXPORT_STD inline constexpr _Inplace_merge_fn inplace_merge{_Not_quite_object::_Construct_tag{}}; } // namespace ranges -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) template _CONSTEXPR20 _BidIt _Insertion_sort_unchecked(const _BidIt _First, const _BidIt _Last, _Pr _Pred) { @@ -8313,7 +8313,7 @@ namespace ranges { _EXPORT_STD inline constexpr _Sort_fn sort{_Not_quite_object::_Construct_tag{}}; } // namespace ranges -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) template _Ty* _Uninitialized_merge_move(_FwdIt _First, const _FwdIt _Mid, const _FwdIt _Last, _Ty* const _Dest, _Pr _Pred) { @@ -8759,7 +8759,7 @@ namespace ranges { _EXPORT_STD inline constexpr _Stable_sort_fn stable_sort{_Not_quite_object::_Construct_tag{}}; } // namespace ranges -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) _EXPORT_STD template _CONSTEXPR20 void partial_sort(_RanIt _First, _RanIt _Mid, _RanIt _Last, _Pr _Pred) { @@ -8880,7 +8880,7 @@ namespace ranges { _EXPORT_STD inline constexpr _Partial_sort_fn partial_sort{_Not_quite_object::_Construct_tag{}}; } // namespace ranges -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) #endif // _HAS_CXX17 _EXPORT_STD template @@ -9028,7 +9028,7 @@ namespace ranges { _EXPORT_STD inline constexpr _Partial_sort_copy_fn partial_sort_copy{_Not_quite_object::_Construct_tag{}}; } // namespace ranges -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) #endif // _HAS_CXX17 _EXPORT_STD template @@ -9152,7 +9152,7 @@ namespace ranges { _EXPORT_STD inline constexpr _Nth_element_fn nth_element{_Not_quite_object::_Construct_tag{}}; } // namespace ranges -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) #endif // _HAS_CXX17 _EXPORT_STD template @@ -9276,7 +9276,7 @@ namespace ranges { _EXPORT_STD inline constexpr _Includes_fn includes{_Not_quite_object::_Construct_tag{}}; } // namespace ranges -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) #endif // _HAS_CXX17 _EXPORT_STD template @@ -9415,7 +9415,7 @@ namespace ranges { _EXPORT_STD inline constexpr _Set_union_fn set_union{_Not_quite_object::_Construct_tag{}}; } // namespace ranges -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) #endif // _HAS_CXX17 _EXPORT_STD template @@ -9548,7 +9548,7 @@ namespace ranges { _EXPORT_STD inline constexpr _Set_intersection_fn set_intersection{_Not_quite_object::_Construct_tag{}}; } // namespace ranges -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) #endif // _HAS_CXX17 _EXPORT_STD template @@ -9678,7 +9678,7 @@ namespace ranges { _EXPORT_STD inline constexpr _Set_difference_fn set_difference{_Not_quite_object::_Construct_tag{}}; } // namespace ranges -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) #endif // _HAS_CXX17 _EXPORT_STD template @@ -9831,7 +9831,7 @@ namespace ranges { _EXPORT_STD inline constexpr _Set_symmetric_difference_fn set_symmetric_difference{ _Not_quite_object::_Construct_tag{}}; } // namespace ranges -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) #endif // _HAS_CXX17 template @@ -10023,7 +10023,7 @@ namespace ranges { _EXPORT_STD inline constexpr _Minmax_element_fn minmax_element{_Not_quite_object::_Construct_tag{}}; } // namespace ranges -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) #endif // _HAS_CXX17 _EXPORT_STD template @@ -10225,7 +10225,7 @@ namespace ranges { _EXPORT_STD inline constexpr _Minmax_fn minmax{_Not_quite_object::_Construct_tag{}}; } // namespace ranges -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) _EXPORT_STD template _CONSTEXPR20 bool next_permutation(_BidIt _First, _BidIt _Last, _Pr _Pred) { @@ -10329,7 +10329,7 @@ namespace ranges { _EXPORT_STD inline constexpr _Next_permutation_fn next_permutation{_Not_quite_object::_Construct_tag{}}; } // namespace ranges -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) _EXPORT_STD template _CONSTEXPR20 bool prev_permutation(_BidIt _First, _BidIt _Last, _Pr _Pred) { @@ -10433,7 +10433,7 @@ namespace ranges { _EXPORT_STD inline constexpr _Prev_permutation_fn prev_permutation{_Not_quite_object::_Construct_tag{}}; } // namespace ranges -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) _EXPORT_STD template _NODISCARD _CONSTEXPR20 _FwdIt is_sorted_until(const _FwdIt _First, _FwdIt _Last, _Pr _Pred) { @@ -10549,7 +10549,7 @@ namespace ranges { _EXPORT_STD inline constexpr _Is_sorted_until_fn is_sorted_until{_Not_quite_object::_Construct_tag{}}; } // namespace ranges -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) _EXPORT_STD template _NODISCARD constexpr const _Ty& clamp(const _Ty& _Val, const _Ty& _Min_val, const _Ty& _Max_val, _Pr _Pred) { @@ -10694,7 +10694,7 @@ namespace ranges { _EXPORT_STD inline constexpr _Lexicographical_compare_fn lexicographical_compare{ _Not_quite_object::_Construct_tag{}}; } // namespace ranges -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) #endif // _HAS_CXX17 #undef _REQUIRE_BIDIRECTIONAL_ITERATOR diff --git a/stl/inc/array b/stl/inc/array index f08d7026d9e..7cd41156dbe 100644 --- a/stl/inc/array +++ b/stl/inc/array @@ -33,7 +33,7 @@ class _Array_const_iterator public: #ifdef __cpp_lib_concepts using iterator_concept = contiguous_iterator_tag; -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) using iterator_category = random_access_iterator_tag; using value_type = _Ty; using difference_type = ptrdiff_t; @@ -306,7 +306,7 @@ public: #ifdef __cpp_lib_concepts using iterator_concept = contiguous_iterator_tag; -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) using iterator_category = random_access_iterator_tag; using value_type = _Ty; using difference_type = ptrdiff_t; diff --git a/stl/inc/atomic b/stl/inc/atomic index a91cea74940..4ed3c3ccd21 100644 --- a/stl/inc/atomic +++ b/stl/inc/atomic @@ -69,7 +69,7 @@ extern "C" _NODISCARD char __stdcall __std_atomic_has_cmpxchg16b() noexcept; #define ATOMIC_CHAR_LOCK_FREE 2 #ifdef __cpp_lib_char8_t #define ATOMIC_CHAR8_T_LOCK_FREE 2 -#endif // __cpp_lib_char8_t +#endif // defined(__cpp_lib_char8_t) #define ATOMIC_CHAR16_T_LOCK_FREE 2 #define ATOMIC_CHAR32_T_LOCK_FREE 2 #define ATOMIC_WCHAR_T_LOCK_FREE 2 @@ -95,9 +95,9 @@ enum { #ifndef _INVALID_MEMORY_ORDER #ifdef _DEBUG #define _INVALID_MEMORY_ORDER _STL_REPORT_ERROR("Invalid memory order") -#else // ^^^ _DEBUG / !_DEBUG vvv +#else // ^^^ defined(_DEBUG) / !defined(_DEBUG) vvv #define _INVALID_MEMORY_ORDER -#endif // _DEBUG +#endif // ^^^ !defined(_DEBUG) ^^^ #endif // _INVALID_MEMORY_ORDER extern "C" inline void _Check_memory_order(const unsigned int _Order) noexcept { @@ -186,7 +186,7 @@ extern "C" inline void _Check_memory_order(const unsigned int _Order) noexcept { __stlr##_Width( \ reinterpret_cast(_Ptr), static_cast(_Desired)); -#else // ^^^ _STD_ATOMIC_USE_ARM64_LDAR_STLR == 1 ^^^ / vvv _STD_ATOMIC_USE_ARM64_LDAR_STLR == 0 vvv +#else // ^^^ _STD_ATOMIC_USE_ARM64_LDAR_STLR == 1 / _STD_ATOMIC_USE_ARM64_LDAR_STLR == 0 vvv #define __STORE_RELEASE(_Width, _Ptr, _Desired) \ _Compiler_or_memory_barrier(); \ @@ -669,9 +669,9 @@ struct _Atomic_storage { } else { _Result = _CSTD memcmp(_Storage_ptr, _Expected_ptr, sizeof(_TVal)) == 0; } -#else // _CMPXCHG_MASK_OUT_PADDING_BITS +#else // ^^^ _CMPXCHG_MASK_OUT_PADDING_BITS / !_CMPXCHG_MASK_OUT_PADDING_BITS vvv _Result = _CSTD memcmp(_Storage_ptr, _Expected_ptr, sizeof(_TVal)) == 0; -#endif // _CMPXCHG_MASK_OUT_PADDING_BITS +#endif // ^^^ !_CMPXCHG_MASK_OUT_PADDING_BITS ^^^ if (_Result) { _CSTD memcpy(_Storage_ptr, _STD addressof(_Desired), sizeof(_TVal)); } else { @@ -1135,7 +1135,7 @@ struct _Atomic_storage<_Ty, 8> { // lock-free using 8-byte intrinsics return _Temp; } -#else // ^^^ _M_IX86 / !_M_IX86 vvv +#else // ^^^ defined(_M_IX86) / !defined(_M_IX86) vvv _TVal exchange(const _TVal _Value, const memory_order _Order = memory_order_seq_cst) noexcept { // exchange with given memory order long long _As_bytes; @@ -1143,7 +1143,7 @@ struct _Atomic_storage<_Ty, 8> { // lock-free using 8-byte intrinsics _Atomic_address_as(_Storage), _Atomic_reinterpret_as(_Value)); return reinterpret_cast<_TVal&>(_As_bytes); } -#endif // _M_IX86 +#endif // ^^^ !defined(_M_IX86) ^^^ bool compare_exchange_strong(_TVal& _Expected, const _TVal _Desired, const memory_order _Order = memory_order_seq_cst) noexcept { // CAS with given memory order @@ -1374,7 +1374,7 @@ struct _Atomic_storage<_Ty&, 16> { // lock-free using 16-byte intrinsics typename _Atomic_storage_types<_Ty&>::_TStorage _Storage; }; -#endif // _WIN64 +#endif // defined(_WIN64) template struct _Atomic_integral; // not defined @@ -1613,7 +1613,7 @@ struct _Atomic_integral<_Ty, 8> : _Atomic_storage<_Ty> { // atomic integral oper return fetch_add(static_cast<_TVal>(-1)) - static_cast<_TVal>(1); } -#else // ^^^ _M_IX86 / !_M_IX86 vvv +#else // ^^^ defined(_M_IX86) / !defined(_M_IX86) vvv _TVal fetch_add(const _TVal _Operand, const memory_order _Order = memory_order_seq_cst) noexcept { long long _Result; _ATOMIC_CHOOSE_INTRINSIC(static_cast(_Order), _Result, _InterlockedExchangeAdd64, @@ -1663,7 +1663,7 @@ struct _Atomic_integral<_Ty, 8> : _Atomic_storage<_Ty> { // atomic integral oper _TVal operator--() noexcept { return static_cast<_TVal>(_InterlockedDecrement64(_Atomic_address_as(this->_Storage))); } -#endif // _M_IX86 +#endif // ^^^ !defined(_M_IX86) ^^^ }; #if 1 // TRANSITION, ABI @@ -2777,7 +2777,7 @@ _EXPORT_STD using atomic_ullong = atomic; #ifdef __cpp_lib_char8_t _EXPORT_STD using atomic_char8_t = atomic; -#endif // __cpp_lib_char8_t +#endif // defined(__cpp_lib_char8_t) _EXPORT_STD using atomic_char16_t = atomic; _EXPORT_STD using atomic_char32_t = atomic; _EXPORT_STD using atomic_wchar_t = atomic; diff --git a/stl/inc/barrier b/stl/inc/barrier index abca6abf8f4..2f6fbeab428 100644 --- a/stl/inc/barrier +++ b/stl/inc/barrier @@ -10,7 +10,7 @@ #ifdef _M_CEE_PURE #error is not supported when compiling with /clr:pure. -#endif // _M_CEE_PURE +#endif // defined(_M_CEE_PURE) #if !_HAS_CXX20 _EMIT_STL_WARNING(STL4038, "The contents of are available only with C++20 or later."); @@ -71,7 +71,7 @@ public: static_assert( #ifndef __cpp_noexcept_function_type is_function_v> || -#endif // __cpp_noexcept_function_type +#endif // !defined(__cpp_noexcept_function_type) is_nothrow_invocable_v<_Completion_function&>, "N4950 [thread.barrier.class]/5: is_nothrow_invocable_v shall be true"); diff --git a/stl/inc/chrono b/stl/inc/chrono index ec561176a27..f8cb5a98746 100644 --- a/stl/inc/chrono +++ b/stl/inc/chrono @@ -35,7 +35,7 @@ #include #include #include -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) #endif // _HAS_CXX20 #pragma pack(push, _CRT_PACKING) @@ -1917,7 +1917,7 @@ namespace chrono { const time_zone& _Left, const time_zone& _Right) noexcept { return _Left.name() <=> _Right.name(); } -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) // [time.zone.leap] @@ -2008,7 +2008,7 @@ namespace chrono { const leap_second& _Left, const leap_second& _Right) noexcept { return _Left.date() <=> _Right.date(); } -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) // [time.zone.link] @@ -2041,7 +2041,7 @@ namespace chrono { const time_zone_link& _Left, const time_zone_link& _Right) noexcept { return _Left.name() <=> _Right.name(); } -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) // [time.zone.db] @@ -5987,7 +5987,7 @@ namespace chrono { return _STD move(_Os).str(); } } // namespace chrono -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) inline namespace literals { inline namespace chrono_literals { diff --git a/stl/inc/compare b/stl/inc/compare index 484e1aa7fb2..e35d1a3a4d0 100644 --- a/stl/inc/compare +++ b/stl/inc/compare @@ -13,9 +13,9 @@ _EMIT_STL_WARNING(STL4038, "The contents of are available only with C+ #else // ^^^ !_HAS_CXX20 / _HAS_CXX20 vvv #ifdef __cpp_lib_concepts #include -#else // ^^^ __cpp_lib_concepts / !__cpp_lib_concepts vvv +#else // ^^^ defined(__cpp_lib_concepts) / !defined(__cpp_lib_concepts) vvv #include -#endif // !__cpp_lib_concepts +#endif // ^^^ !defined(__cpp_lib_concepts) ^^^ #pragma pack(push, _CRT_PACKING) #pragma warning(push, _STL_WARNING_LEVEL) @@ -843,7 +843,7 @@ inline namespace _Cpos { _EXPORT_STD inline constexpr _Compare_partial_order_fallback::_Cpo compare_partial_order_fallback; } -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) _STD_END #pragma pop_macro("new") diff --git a/stl/inc/complex b/stl/inc/complex index 3ce60aa2ce1..1042faaeff6 100644 --- a/stl/inc/complex +++ b/stl/inc/complex @@ -157,13 +157,13 @@ namespace _Float_multi_prec { _mm_store_sd(&_Result, _Mresult); return _Result; } -#endif // _FMP_USING_X86_X64_INTRINSICS +#endif // defined(_FMP_USING_X86_X64_INTRINSICS) #ifdef _FMP_USING_STD_FMA _NODISCARD inline double _Sqr_error_std_fma(const double _Xval, const double _Prod0) noexcept { return _STD fma(_Xval, _Xval, -_Prod0); } -#endif // _FMP_USING_STD_FMA +#endif // defined(_FMP_USING_STD_FMA) // square(1x precision) -> 2x precision // the result is exact when no internal overflow or underflow occurs diff --git a/stl/inc/concepts b/stl/inc/concepts index 702c0da7e6b..c377e117b19 100644 --- a/stl/inc/concepts +++ b/stl/inc/concepts @@ -29,7 +29,7 @@ concept _Same_impl = // Must be a distinct concept to provide symmetric subsumpt __is_same(_Ty1, _Ty2); #else // ^^^ use intrinsic / no intrinsic vvv is_same_v<_Ty1, _Ty2>; -#endif // __clang__ +#endif // ^^^ no intrinsic ^^^ _EXPORT_STD template concept same_as = _Same_impl<_Ty1, _Ty2> && _Same_impl<_Ty2, _Ty1>; @@ -296,6 +296,6 @@ _STD_END _STL_RESTORE_CLANG_WARNINGS #pragma warning(pop) #pragma pack(pop) -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) #endif // _STL_COMPILER_PREPROCESSOR #endif // _CONCEPTS_ diff --git a/stl/inc/coroutine b/stl/inc/coroutine index 8049f8bda2f..b6c95113f45 100644 --- a/stl/inc/coroutine +++ b/stl/inc/coroutine @@ -18,7 +18,7 @@ _EMIT_STL_WARNING(STL4038, "The contents of are available only with #else // ^^^ is not available / is available vvv #ifndef _ALLOW_COROUTINE_ABI_MISMATCH #pragma detect_mismatch("_COROUTINE_ABI", "2") -#endif // _ALLOW_COROUTINE_ABI_MISMATCH +#endif // !defined(_ALLOW_COROUTINE_ABI_MISMATCH) #if _HAS_CXX20 #include @@ -164,9 +164,9 @@ _EXPORT_STD _NODISCARD constexpr strong_ordering operator<=>( return compare_three_way{}(_Left.address(), _Right.address()); #else // ^^^ no workaround / workaround vvv return _Left.address() <=> _Right.address(); -#endif // __cpp_lib_concepts +#endif // ^^^ workaround ^^^ } -#else // ^^^ <=> exists / <=> does not exist vvv +#else // ^^^ _HAS_CXX20 / !_HAS_CXX20 vvv _NODISCARD constexpr bool operator!=(const coroutine_handle<> _Left, const coroutine_handle<> _Right) noexcept { return !(_Left == _Right); } @@ -186,7 +186,7 @@ _NODISCARD constexpr bool operator<=(const coroutine_handle<> _Left, const corou _NODISCARD constexpr bool operator>=(const coroutine_handle<> _Left, const coroutine_handle<> _Right) noexcept { return !(_Left < _Right); } -#endif // _HAS_CXX20 +#endif // ^^^ !_HAS_CXX20 ^^^ template struct hash> { @@ -264,6 +264,6 @@ _STL_RESTORE_CLANG_WARNINGS #pragma pack(pop) #endif // is available -#endif // _RESUMABLE_FUNCTIONS_SUPPORTED +#endif // ^^^ no /await ^^^ #endif // _STL_COMPILER_PREPROCESSOR #endif // _COROUTINE_ diff --git a/stl/inc/csignal b/stl/inc/csignal index 94ad3200449..db46c9c353a 100644 --- a/stl/inc/csignal +++ b/stl/inc/csignal @@ -22,7 +22,7 @@ _EXPORT_STD using _CSTD sig_atomic_t; _EXPORT_STD using _CSTD raise; #ifndef _M_CEE_PURE _EXPORT_STD using _CSTD signal; -#endif // _M_CEE_PURE +#endif // !defined(_M_CEE_PURE) _STD_END #pragma pop_macro("new") diff --git a/stl/inc/cstddef b/stl/inc/cstddef index 623ac78bd42..857e8a30c65 100644 --- a/stl/inc/cstddef +++ b/stl/inc/cstddef @@ -94,7 +94,7 @@ _EXPORT_STD template , int> _NODISCARD _MSVC_INTRINSIC constexpr _IntType to_integer(const byte _Arg) noexcept { return static_cast<_IntType>(_Arg); } -#endif // __cpp_lib_byte +#endif // defined(__cpp_lib_byte) _STD_END diff --git a/stl/inc/deque b/stl/inc/deque index 3a42d090fca..2800f211443 100644 --- a/stl/inc/deque +++ b/stl/inc/deque @@ -388,9 +388,9 @@ public: void _Compat(const _Deque_const_iterator& _Right) const noexcept { // test for compatible iterator pair #if _ITERATOR_DEBUG_LEVEL == 0 (void) _Right; -#else // _ITERATOR_DEBUG_LEVEL == 0 +#else _STL_VERIFY(this->_Getcont() == _Right._Getcont(), "deque iterators incompatible"); -#endif // _ITERATOR_DEBUG_LEVEL == 0 +#endif } void _Setcont(const _Mydeque* _Pdeque) noexcept { // set container pointer @@ -1133,7 +1133,7 @@ public: } } -#else // _ITERATOR_DEBUG_LEVEL == 2 +#else // ^^^ _ITERATOR_DEBUG_LEVEL == 2 / _ITERATOR_DEBUG_LEVEL < 2 vvv size_type _Block = _Getblock(_Myoff()); _Alty_traits::destroy(_Getal(), _Unfancy(_Map()[_Block] + _Myoff() % _Block_size)); if (--_Mysize() == 0) { @@ -1141,7 +1141,7 @@ public: } else { ++_Myoff(); } -#endif // _ITERATOR_DEBUG_LEVEL == 2 +#endif // ^^^ _ITERATOR_DEBUG_LEVEL < 2 ^^^ } private: @@ -1202,14 +1202,14 @@ public: } } -#else // _ITERATOR_DEBUG_LEVEL == 2 +#else // ^^^ _ITERATOR_DEBUG_LEVEL == 2 / _ITERATOR_DEBUG_LEVEL < 2 vvv size_type _Newoff = _Myoff() + _Mysize() - 1; size_type _Block = _Getblock(_Newoff); _Alty_traits::destroy(_Getal(), _Unfancy(_Map()[_Block] + _Newoff % _Block_size)); if (--_Mysize() == 0) { _Myoff() = 0; } -#endif // _ITERATOR_DEBUG_LEVEL == 2 +#endif // ^^^ _ITERATOR_DEBUG_LEVEL < 2 ^^^ } private: @@ -1413,10 +1413,10 @@ public: auto _Count = static_cast(_Last - _First); bool _Moved = _Off > 0 && _Off + _Count < _Mysize(); -#else // _ITERATOR_DEBUG_LEVEL == 2 +#else // ^^^ _ITERATOR_DEBUG_LEVEL == 2 / _ITERATOR_DEBUG_LEVEL < 2 vvv auto _Off = static_cast(_First - begin()); auto _Count = static_cast(_Last - _First); -#endif // _ITERATOR_DEBUG_LEVEL == 2 +#endif // ^^^ _ITERATOR_DEBUG_LEVEL < 2 ^^^ if (_Count == 0) { return _First; diff --git a/stl/inc/exception b/stl/inc/exception index 16b5fac54bc..f6df092e1e5 100644 --- a/stl/inc/exception +++ b/stl/inc/exception @@ -48,7 +48,7 @@ _EXPORT_STD _NODISCARD inline terminate_handler __CRTDECL get_terminate() noexce // get current terminate handler return _get_terminate(); } -#endif // _M_CEE_PURE +#endif // !defined(_M_CEE_PURE) #if _HAS_UNEXPECTED using ::unexpected; @@ -61,12 +61,12 @@ _NODISCARD inline unexpected_handler __CRTDECL get_unexpected() noexcept { // get current unexpected handler return _get_unexpected(); } -#endif // _M_CEE_PURE +#endif // !defined(_M_CEE_PURE) #endif // _HAS_UNEXPECTED _STD_END -#else // _HAS_EXCEPTIONS +#else // ^^^ _HAS_EXCEPTIONS / !_HAS_EXCEPTIONS vvv _STDEXT_BEGIN class exception; @@ -303,12 +303,12 @@ private: #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wunused-private-field" -#endif // __clang__ +#endif // defined(__clang__) void* _Data1{}; void* _Data2{}; #ifdef __clang__ #pragma clang diagnostic pop -#endif // __clang__ +#endif // defined(__clang__) }; _EXPORT_STD _NODISCARD inline exception_ptr current_exception() noexcept { @@ -391,10 +391,10 @@ void rethrow_if_nested(const _Ty& _Arg) { } } } -#else // _CPPRTTI +#else // ^^^ defined(_CPPRTTI) / !defined(_CPPRTTI) vvv _EXPORT_STD template void rethrow_if_nested(const _Ty&) = delete; // requires /GR option -#endif // _CPPRTTI +#endif // ^^^ !defined(_CPPRTTI) ^^^ _EXPORT_STD class bad_variant_access : public exception { // exception for visit of a valueless variant or get on a variant with index() != I @@ -410,7 +410,7 @@ protected: void _Doraise() const override { // perform class-specific exception handling _RAISE(*this); } -#endif // !_HAS_EXCEPTIONS +#endif // ^^^ !_HAS_EXCEPTIONS ^^^ }; [[noreturn]] inline void _Throw_bad_variant_access() { diff --git a/stl/inc/execution b/stl/inc/execution index 35314d3e4b1..ee31dac657e 100644 --- a/stl/inc/execution +++ b/stl/inc/execution @@ -32,11 +32,11 @@ _EXTERN_C using __std_TP_WORK = void; using __std_TP_CALLBACK_INSTANCE = void; using __std_TP_CALLBACK_ENVIRON = void; -#else // ^^^ _M_CEE / !_M_CEE vvv +#else // ^^^ defined(_M_CEE) / !defined(_M_CEE) vvv struct __std_TP_WORK; // not defined struct __std_TP_CALLBACK_INSTANCE; // not defined struct __std_TP_CALLBACK_ENVIRON; // not defined -#endif // _M_CEE +#endif // ^^^ !defined(_M_CEE) ^^^ using __std_PTP_WORK = __std_TP_WORK*; using __std_PTP_CALLBACK_INSTANCE = __std_TP_CALLBACK_INSTANCE*; @@ -276,7 +276,7 @@ struct _Parallelism_allocate_traits { return _Result; } -#endif // __cpp_aligned_new +#endif // defined(__cpp_aligned_new) }; template @@ -2817,9 +2817,9 @@ inline size_t _Get_stable_sort_tree_height(const size_t _Count, const size_t _Hw const size_t _Log_ideal_chunks = _Floor_of_log_2(_Ideal_chunks); #ifdef _WIN64 constexpr size_t _Max_tree_height = 62; // to avoid ptrdiff_t overflow -#else // ^^^ _WIN64 / !_WIN64 vvv +#else // ^^^ defined(_WIN64) / !defined(_WIN64) vvv constexpr size_t _Max_tree_height = 30; -#endif // _WIN64 +#endif // ^^^ !defined(_WIN64) ^^^ const size_t _Clamped_ideal_chunks = (_STD min)(_Max_tree_height, _Log_ideal_chunks); // similarly, if _Clamped_ideal_chunks is odd, that would break our 2 to even power invariant, diff --git a/stl/inc/expected b/stl/inc/expected index 4a853c2e23d..465a1616e96 100644 --- a/stl/inc/expected +++ b/stl/inc/expected @@ -328,7 +328,7 @@ public: constexpr ~expected() #ifndef __clang__ // TRANSITION, LLVM-59854 noexcept -#endif // __clang__ +#endif // !defined(__clang__) { if (_Has_value) { if constexpr (!is_trivially_destructible_v<_Ty>) { @@ -1257,7 +1257,7 @@ public: constexpr ~expected() #ifndef __clang__ // TRANSITION, LLVM-59854 noexcept -#endif // __clang__ +#endif // !defined(__clang__) { if (!_Has_value) { _Unexpected.~_Err(); diff --git a/stl/inc/experimental/coroutine b/stl/inc/experimental/coroutine index 248c28baaf6..0758b0b3d8b 100644 --- a/stl/inc/experimental/coroutine +++ b/stl/inc/experimental/coroutine @@ -33,7 +33,7 @@ headers do not support Clang, but the C++20 header does. #ifdef __cpp_impl_coroutine #error The and headers are only supported with \ /await and implement pre-C++20 coroutine support. Use for standard C++20 coroutines. -#endif // __cpp_impl_coroutine +#endif // defined(__cpp_impl_coroutine) // intrinsics used in implementation of coroutine_handle extern "C" size_t _coro_resume(void*); diff --git a/stl/inc/experimental/filesystem b/stl/inc/experimental/filesystem index 5d685b73619..63a34466157 100644 --- a/stl/inc/experimental/filesystem +++ b/stl/inc/experimental/filesystem @@ -27,13 +27,13 @@ _STL_DISABLE_CLANG_WARNINGS #error The header providing std::experimental::filesystem is deprecated by Microsoft \ and will be REMOVED. It is superseded by the C++17 header providing std::filesystem. \ You can define _SILENCE_EXPERIMENTAL_FILESYSTEM_DEPRECATION_WARNING to suppress this error. -#endif // _SILENCE_EXPERIMENTAL_FILESYSTEM_DEPRECATION_WARNING +#endif // !defined(_SILENCE_EXPERIMENTAL_FILESYSTEM_DEPRECATION_WARNING) #pragma warning(disable : 4365) // conversion from 'type_1' to 'type_2', signed/unsigned mismatch (/Wall) #ifndef _FS_DLL #define _FS_DLL extern "C" _CRTIMP2_PURE -#endif // _FS_DLL +#endif // !defined(_FS_DLL) #define _MAX_FILESYS_NAME 260 // longest Windows or Posix filename + 1 diff --git a/stl/inc/experimental/generator b/stl/inc/experimental/generator index d5b6ba4ad82..fcc1d2ba4d9 100644 --- a/stl/inc/experimental/generator +++ b/stl/inc/experimental/generator @@ -38,7 +38,7 @@ namespace experimental { const _Ty* _Value; #ifdef _CPPUNWIND exception_ptr _Exception; -#endif // _CPPUNWIND +#endif // defined(_CPPUNWIND) generator get_return_object() noexcept { return generator{*this}; @@ -59,8 +59,8 @@ namespace experimental { } #else // ^^^ defined(_CPPUNWIND) / !defined(_CPPUNWIND) vvv void unhandled_exception() noexcept {} -#endif // _CPPUNWIND -#endif // _KERNEL_MODE +#endif // ^^^ !defined(_CPPUNWIND) ^^^ +#endif // !defined(_KERNEL_MODE) #ifdef _CPPUNWIND void _Rethrow_if_exception() { @@ -68,7 +68,7 @@ namespace experimental { _STD rethrow_exception(_Exception); } } -#endif // _CPPUNWIND +#endif // defined(_CPPUNWIND) suspend_always yield_value(const _Ty& _Val) noexcept { _Value = _STD addressof(_Val); diff --git a/stl/inc/filesystem b/stl/inc/filesystem index 098ac8dbf62..6675bc94f40 100644 --- a/stl/inc/filesystem +++ b/stl/inc/filesystem @@ -153,7 +153,7 @@ namespace filesystem { else if constexpr (is_same_v<_EcharT, char8_t>) { return _Convert_wide_to_narrow<_Traits>(__std_code_page::_Utf8, _Input, _Al); } -#endif // __cpp_char8_t +#endif // defined(__cpp_char8_t) else if constexpr (is_same_v<_EcharT, char32_t>) { return _Convert_wide_to_utf32<_Traits>(_Input, _Al); } else { // wchar_t, char16_t @@ -215,7 +215,7 @@ namespace filesystem { const string_view _Input_as_char{reinterpret_cast(_Input.data()), _Input.size()}; return _Convert_narrow_to_wide(__std_code_page::_Utf8, _Input_as_char); } -#endif // __cpp_char8_t +#endif // defined(__cpp_char8_t) template _NODISCARD wstring _Convert_stringoid_to_wide(const u16string_view _Input, _Conversion) { @@ -947,9 +947,9 @@ namespace filesystem { _NODISCARD auto u8string() const { // convert the native path from this instance into a UTF-8 string #ifdef __cpp_lib_char8_t using _U8Ty = char8_t; -#else // ^^^ __cpp_lib_char8_t / !__cpp_lib_char8_t vvv +#else // ^^^ defined(__cpp_lib_char8_t) / !defined(__cpp_lib_char8_t) vvv using _U8Ty = char; -#endif // __cpp_lib_char8_t +#endif // ^^^ !defined(__cpp_lib_char8_t) ^^^ return _Convert_wide_to_narrow>(__std_code_page::_Utf8, _Text, allocator<_U8Ty>{}); } @@ -2700,7 +2700,7 @@ namespace filesystem { _NODISCARD bool operator==(default_sentinel_t) const noexcept { return !_Impl; } -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) _Directory_entry_proxy operator++(int) { _Directory_entry_proxy _Proxy(**this); @@ -2956,7 +2956,7 @@ namespace filesystem { _NODISCARD bool operator==(default_sentinel_t) const noexcept { return !_Impl; } -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) _Directory_entry_proxy operator++(int) { _Directory_entry_proxy _Proxy(**this); @@ -4422,7 +4422,7 @@ namespace ranges { template <> inline constexpr bool enable_view = true; } // namespace ranges -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) _STD_END diff --git a/stl/inc/format b/stl/inc/format index a4bac258ed8..2375581f50e 100644 --- a/stl/inc/format +++ b/stl/inc/format @@ -4048,6 +4048,6 @@ _STL_RESTORE_CLANG_WARNINGS #pragma warning(pop) #pragma pack(pop) -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) #endif // _STL_COMPILER_PREPROCESSOR #endif // _FORMAT_ diff --git a/stl/inc/forward_list b/stl/inc/forward_list index 77625e6b950..da850f2803f 100644 --- a/stl/inc/forward_list +++ b/stl/inc/forward_list @@ -1227,9 +1227,9 @@ public: #if _HAS_CXX20 return _Removed; -#else // _HAS_CXX20 +#else (void) _Removed; -#endif // _HAS_CXX20 +#endif } auto unique() { // erase each element matching previous @@ -1257,9 +1257,9 @@ public: #if _HAS_CXX20 return _Removed; -#else // _HAS_CXX20 +#else (void) _Removed; -#endif // _HAS_CXX20 +#endif } void merge(forward_list& _Right) { // merge in elements from _Right, both ordered by operator< diff --git a/stl/inc/fstream b/stl/inc/fstream index 89d16c28142..96b0a585cfb 100644 --- a/stl/inc/fstream +++ b/stl/inc/fstream @@ -68,7 +68,7 @@ public: _Myios::setstate(ios_base::failbit); } } -#endif // _CRTBLD +#endif // defined(_CRTBLD) explicit basic_ifstream(FILE* _File) : _Mybase(_STD addressof(_Filebuffer)), _Filebuffer(_File) {} // extension @@ -155,7 +155,7 @@ public: open(_Filename, static_cast(_Mode)); } #endif // _HAS_OLD_IOSTREAMS_MEMBERS -#endif // _CRTBLD +#endif // defined(_CRTBLD) __CLR_OR_THIS_CALL ~basic_ifstream() noexcept override {} @@ -251,7 +251,7 @@ public: _Myios::setstate(ios_base::failbit); } } -#endif // _CRTBLD +#endif // defined(_CRTBLD) explicit basic_ofstream(FILE* _File) : _Mybase(_STD addressof(_Filebuffer)), _Filebuffer(_File) {} // extension @@ -338,7 +338,7 @@ public: open(_Filename, static_cast(_Mode)); } #endif // _HAS_OLD_IOSTREAMS_MEMBERS -#endif // _CRTBLD +#endif // defined(_CRTBLD) __CLR_OR_THIS_CALL ~basic_ofstream() noexcept override {} @@ -439,7 +439,7 @@ public: _Myios::setstate(ios_base::failbit); } } -#endif // _CRTBLD +#endif // defined(_CRTBLD) explicit basic_fstream(FILE* _File) : _Mybase(_STD addressof(_Filebuffer)), _Filebuffer(_File) {} // extension @@ -527,7 +527,7 @@ public: open(_Filename, static_cast(_Mode)); } #endif // _HAS_OLD_IOSTREAMS_MEMBERS -#endif // _CRTBLD +#endif // defined(_CRTBLD) __CLR_OR_THIS_CALL ~basic_fstream() noexcept override {} diff --git a/stl/inc/functional b/stl/inc/functional index 859303c2f62..a0c97586e40 100644 --- a/stl/inc/functional +++ b/stl/inc/functional @@ -14,12 +14,12 @@ #if _HAS_CXX17 #ifdef _LEGACY_CODE_ASSUMES_FUNCTIONAL_INCLUDES_MEMORY #include -#endif // _LEGACY_CODE_ASSUMES_FUNCTIONAL_INCLUDES_MEMORY +#endif // defined(_LEGACY_CODE_ASSUMES_FUNCTIONAL_INCLUDES_MEMORY) #include #endif // _HAS_CXX17 #ifdef __cpp_lib_concepts #include -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) #pragma pack(push, _CRT_PACKING) #pragma warning(push, _STL_WARNING_LEVEL) @@ -1002,7 +1002,7 @@ _NON_MEMBER_CALL(_GET_FUNCTION_IMPL, X1, X2, X3) }; _NON_MEMBER_CALL(_GET_FUNCTION_IMPL_NOEXCEPT, X1, X2, X3) #undef _GET_FUNCTION_IMPL_NOEXCEPT -#endif // __cpp_noexcept_function_type +#endif // defined(__cpp_noexcept_function_type) _EXPORT_STD template class function : public _Get_function_impl<_Fty>::type { // wrapper for callable objects @@ -1120,7 +1120,7 @@ public: return reinterpret_cast(this->_Target(typeid(_Fx))); } } -#else // _HAS_STATIC_RTTI +#else // ^^^ _HAS_STATIC_RTTI / !_HAS_STATIC_RTTI vvv const type_info& target_type() const noexcept = delete; // requires static RTTI template @@ -1128,7 +1128,7 @@ public: template const _Fx* target() const noexcept = delete; // requires static RTTI -#endif // _HAS_STATIC_RTTI +#endif // ^^^ !_HAS_STATIC_RTTI ^^^ }; #if _HAS_CXX17 @@ -1280,9 +1280,9 @@ void __stdcall _Function_deallocate_large_overaligned(_Move_only_function_data& _STL_INTERNAL_STATIC_ASSERT(_Align > __STDCPP_DEFAULT_NEW_ALIGNMENT__); #ifdef __cpp_aligned_new ::operator delete(_Self._Large_fn_ptr(), align_val_t{_Align}); -#else // ^^^ __cpp_aligned_new / !__cpp_aligned_new vvv +#else // ^^^ defined(__cpp_aligned_new) / !defined(__cpp_aligned_new) vvv ::operator delete(_Self._Large_fn_ptr()); -#endif // __cpp_aligned_new +#endif // ^^^ !defined(__cpp_aligned_new) ^^^ } template @@ -1293,7 +1293,7 @@ void __stdcall _Function_destroy_large(_Move_only_function_data& _Self) noexcept if constexpr (alignof(_Vt) > __STDCPP_DEFAULT_NEW_ALIGNMENT__) { ::operator delete(static_cast(_Pfn), align_val_t{alignof(_Vt)}); } else -#endif // __cpp_aligned_new +#endif // defined(__cpp_aligned_new) { ::operator delete(static_cast(_Pfn)); } @@ -1317,7 +1317,7 @@ _NODISCARD void* _Function_new_large(_CTypes&&... _Args) { if constexpr (alignof(_Vt) > __STDCPP_DEFAULT_NEW_ALIGNMENT__) { ::operator delete(_Ptr, align_val_t{alignof(_Vt)}); } else -#endif // __cpp_aligned_new +#endif // defined(__cpp_aligned_new) { ::operator delete(_Ptr); } @@ -1330,7 +1330,7 @@ _NODISCARD void* _Function_new_large(_CTypes&&... _Args) { if constexpr (alignof(_Vt) > __STDCPP_DEFAULT_NEW_ALIGNMENT__) { _Ptr = ::operator new(sizeof(_Vt), align_val_t{alignof(_Vt)}); } else -#endif // __cpp_aligned_new +#endif // defined(__cpp_aligned_new) { _Ptr = ::operator new(sizeof(_Vt)); } @@ -1740,7 +1740,7 @@ public: return this->_Get_invoke()(this->_Data, _STD forward<_Types>(_Args)...); } }; -#endif // __cpp_noexcept_function_type +#endif // defined(__cpp_noexcept_function_type) _EXPORT_STD template class move_only_function : private _Move_only_function_call<_Signature...> { @@ -3119,7 +3119,7 @@ namespace ranges { using is_transparent = int; }; } // namespace ranges -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) #if _HAS_TR1_NAMESPACE namespace _DEPRECATE_TR1_NAMESPACE tr1 { diff --git a/stl/inc/ios b/stl/inc/ios index 16a743bbbd7..86b54450d14 100644 --- a/stl/inc/ios +++ b/stl/inc/ios @@ -178,7 +178,7 @@ template class _CRTIMP2_PURE_IMPORT basic_ios>; #ifdef __FORCE_INSTANCE template class _CRTIMP2_PURE_IMPORT basic_ios>; -#endif // __FORCE_INSTANCE +#endif // defined(__FORCE_INSTANCE) #endif // defined(_DLL_CPPLIB) _EXPORT_STD inline ios_base& __CLRCALL_OR_CDECL boolalpha(ios_base& _Iosbase) { // set boolalpha diff --git a/stl/inc/iosfwd b/stl/inc/iosfwd index 22dcbe1028e..871ab02ec1e 100644 --- a/stl/inc/iosfwd +++ b/stl/inc/iosfwd @@ -36,11 +36,11 @@ _STD_BEGIN .setstate(xtype::badbit, true); /* set badbit and rethrow */ \ _CATCH_END -#else // _HAS_EXCEPTIONS +#else // ^^^ _HAS_EXCEPTIONS / !_HAS_EXCEPTIONS vvv #define _TRY_IO_BEGIN { // begin try block #define _CATCH_IO_END } // catch block for _Myios #define _CATCH_IO_(xtype, x) } // catch block for basic_ios x -#endif // _HAS_EXCEPTIONS +#endif // ^^^ !_HAS_EXCEPTIONS ^^^ // from _EXPORT_STD using streamoff = long long; @@ -71,7 +71,7 @@ public: _DEPRECATE_FPOS_SEEKPOS fpos_t seekpos() const noexcept { return {}; } -#endif // _REMOVE_FPOS_SEEKPOS +#endif // !defined(_REMOVE_FPOS_SEEKPOS) _NODISCARD streamoff operator-(const fpos& _Right) const noexcept /* strengthened */ { return static_cast(*this) - static_cast(_Right); @@ -139,7 +139,7 @@ _EXPORT_STD using streampos = fpos<_Mbstatet>; _EXPORT_STD using wstreampos = streampos; #ifdef __cpp_lib_char8_t _EXPORT_STD using u8streampos = streampos; -#endif // __cpp_lib_char8_t +#endif // defined(__cpp_lib_char8_t) _EXPORT_STD using u16streampos = streampos; _EXPORT_STD using u32streampos = streampos; @@ -154,7 +154,7 @@ struct char_traits; #ifdef __cpp_char8_t template <> struct char_traits; -#endif // __cpp_char8_t +#endif // defined(__cpp_char8_t) template <> struct char_traits; template <> @@ -164,7 +164,7 @@ struct char_traits; #ifdef _CRTBLD template <> struct char_traits; -#endif // _CRTBLD +#endif // defined(_CRTBLD) _EXPORT_STD template class allocator; diff --git a/stl/inc/iostream b/stl/inc/iostream index 0ab6b195ad5..d911968f885 100644 --- a/stl/inc/iostream +++ b/stl/inc/iostream @@ -34,7 +34,7 @@ __PURE_APPDOMAIN_GLOBAL extern wistream* _Ptr_wcin; __PURE_APPDOMAIN_GLOBAL extern wostream* _Ptr_wcout; __PURE_APPDOMAIN_GLOBAL extern wostream* _Ptr_wcerr; __PURE_APPDOMAIN_GLOBAL extern wostream* _Ptr_wclog; -#else // _M_CEE_PURE +#else // ^^^ defined(_M_CEE_PURE) / !defined(_M_CEE_PURE) vvv _EXPORT_STD extern "C++" __PURE_APPDOMAIN_GLOBAL _CRTDATA2_IMPORT istream cin; _EXPORT_STD extern "C++" __PURE_APPDOMAIN_GLOBAL _CRTDATA2_IMPORT ostream cout; _EXPORT_STD extern "C++" __PURE_APPDOMAIN_GLOBAL _CRTDATA2_IMPORT ostream cerr; @@ -62,9 +62,9 @@ public: private: __PURE_APPDOMAIN_GLOBAL static int _Init_cnt; }; -#endif // _CRTBLD +#endif // defined(_CRTBLD) -#endif // _M_CEE_PURE +#endif // ^^^ !defined(_M_CEE_PURE) ^^^ _STD_END #pragma pop_macro("new") _STL_RESTORE_CLANG_WARNINGS diff --git a/stl/inc/istream b/stl/inc/istream index 2db973e0851..df59f875cc2 100644 --- a/stl/inc/istream +++ b/stl/inc/istream @@ -170,7 +170,7 @@ public: _Pfn(*this); return *this; } -#endif // _M_CEE_PURE +#endif // defined(_M_CEE_PURE) basic_istream& __CLR_OR_THIS_CALL operator>>(basic_istream&(__cdecl* _Pfn)(basic_istream&) ) { // call basic_istream manipulator @@ -707,7 +707,7 @@ inline basic_istream>& __CLR_OR_THIS char_traits>::operator>>(unsigned short& _Ch) { // extract a character return _STD operator>>(*this, _Ch); } -#endif // _NATIVE_WCHAR_T_DEFINED +#endif // !defined(_NATIVE_WCHAR_T_DEFINED) #if defined(_DLL_CPPLIB) @@ -718,7 +718,7 @@ template class _CRTIMP2_PURE_IMPORT basic_istream> #ifdef __FORCE_INSTANCE template class _CRTIMP2_PURE_IMPORT basic_istream>; -#endif // __FORCE_INSTANCE +#endif // defined(__FORCE_INSTANCE) #endif // defined(_DLL_CPPLIB) _EXPORT_STD extern "C++" template @@ -771,7 +771,7 @@ template class _CRTIMP2_PURE_IMPORT basic_iostream #ifdef __FORCE_INSTANCE template class _CRTIMP2_PURE_IMPORT basic_iostream>; -#endif // __FORCE_INSTANCE +#endif // defined(__FORCE_INSTANCE) #endif // defined(_DLL_CPPLIB) template @@ -839,7 +839,7 @@ basic_istream& operator>>( return _Istream_extract_into_buffer(_Istr, _Size, reinterpret_cast(_Str)); } #pragma warning(pop) -#else // _HAS_CXX20 +#else // ^^^ _HAS_CXX20 / !_HAS_CXX20 vvv template basic_istream<_Elem, _Traits>& operator>>(basic_istream<_Elem, _Traits>& _Istr, _Elem* _Str) { return _Istream_extract_into_buffer(_Istr, SIZE_MAX, _Str); @@ -854,7 +854,7 @@ template basic_istream& operator>>(basic_istream& _Istr, unsigned char* _Str) { return _Istream_extract_into_buffer(_Istr, SIZE_MAX, reinterpret_cast(_Str)); } -#endif // _HAS_CXX20 +#endif // ^^^ !_HAS_CXX20 ^^^ _EXPORT_STD template basic_istream<_Elem, _Traits>& operator>>(basic_istream<_Elem, _Traits>& _Istr, _Elem& _Ch) { // extract a character diff --git a/stl/inc/iterator b/stl/inc/iterator index 3d35b6dbbbe..eb496572d4d 100644 --- a/stl/inc/iterator +++ b/stl/inc/iterator @@ -30,9 +30,9 @@ public: #ifdef __cpp_lib_concepts using difference_type = ptrdiff_t; -#else +#else // ^^^ defined(__cpp_lib_concepts) / !defined(__cpp_lib_concepts) vvv using difference_type = void; -#endif // __cpp_lib_concepts +#endif // ^^^ !defined(__cpp_lib_concepts) ^^^ _CONSTEXPR20 explicit back_insert_iterator(_Container& _Cont) noexcept /* strengthened */ : container(_STD addressof(_Cont)) {} @@ -81,9 +81,9 @@ public: #ifdef __cpp_lib_concepts using difference_type = ptrdiff_t; -#else +#else // ^^^ defined(__cpp_lib_concepts) / !defined(__cpp_lib_concepts) vvv using difference_type = void; -#endif // __cpp_lib_concepts +#endif // ^^^ !defined(__cpp_lib_concepts) ^^^ _CONSTEXPR20 explicit front_insert_iterator(_Container& _Cont) : container(_STD addressof(_Cont)) {} @@ -134,7 +134,7 @@ public: #else // ^^^ implementing Ranges / no Ranges vvv using difference_type = void; using _Wrapped_iter = typename _Container::iterator; -#endif // __cpp_lib_concepts +#endif // ^^^ no Ranges ^^^ _CONSTEXPR20 insert_iterator(_Container& _Cont, _Wrapped_iter _Where) : container(_STD addressof(_Cont)), iter(_STD move(_Where)) {} @@ -230,7 +230,7 @@ public: private: _Se _Last{}; }; -#endif // __cpp_lib_concepts +#endif // ^^^ Ranges ^^^ _EXPORT_STD template , class _Diff = ptrdiff_t> class istream_iterator { @@ -253,7 +253,7 @@ public: #ifdef __cpp_lib_concepts constexpr istream_iterator(default_sentinel_t) noexcept( is_nothrow_default_constructible_v<_Ty>) /* strengthened */ {} -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) istream_iterator(istream_type& _Istr) : _Myistr(_STD addressof(_Istr)) { _Getval(); @@ -288,7 +288,7 @@ public: _NODISCARD_FRIEND bool operator==(const istream_iterator& _Left, default_sentinel_t) noexcept /* strengthened */ { return !_Left._Myistr; } -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) private: void _Getval() { // get a _Ty value if possible @@ -378,7 +378,7 @@ public: constexpr istreambuf_iterator() noexcept : _Strbuf(nullptr), _Got(true), _Val() {} #ifdef __cpp_lib_concepts constexpr istreambuf_iterator(default_sentinel_t) noexcept : _Strbuf(nullptr), _Got(true), _Val() {} -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) istreambuf_iterator(istream_type& _Istr) noexcept : _Strbuf(_Istr.rdbuf()), _Got(!_Strbuf), _Val() {} @@ -455,7 +455,7 @@ public: return !_Left._Strbuf; } -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) private: void _Inc() { // skip to next input element @@ -1461,7 +1461,7 @@ template struct iterator_traits> : iterator_traits<_Iter> { using pointer = conditional_t, add_pointer_t>, void>; }; -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) _STD_END @@ -1483,7 +1483,7 @@ public: using reference = _Pointee_type&; #ifdef __cpp_lib_concepts using iterator_concept = _STD contiguous_iterator_tag; -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) constexpr checked_array_iterator() = default; @@ -1697,7 +1697,7 @@ public: using reference = _Pointee_type&; #ifdef __cpp_lib_concepts using iterator_concept = _STD contiguous_iterator_tag; -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) constexpr unchecked_array_iterator() = default; diff --git a/stl/inc/limits b/stl/inc/limits index 0c2300df11f..45c31971403 100644 --- a/stl/inc/limits +++ b/stl/inc/limits @@ -358,7 +358,7 @@ public: static constexpr int digits = 8; static constexpr int digits10 = 2; }; -#endif // __cpp_char8_t +#endif // defined(__cpp_char8_t) template <> class numeric_limits : public _Num_int_base { diff --git a/stl/inc/list b/stl/inc/list index 6e7077ac2e7..169d126468d 100644 --- a/stl/inc/list +++ b/stl/inc/list @@ -1680,9 +1680,9 @@ public: #if _HAS_CXX20 return _Oldsize - _My_data._Mysize; -#else // _HAS_CXX20 +#else (void) _Oldsize; -#endif // _HAS_CXX20 +#endif } auto unique() { // erase each element matching previous @@ -1707,9 +1707,9 @@ public: #if _HAS_CXX20 return _Oldsize - _Mypair._Myval2._Mysize; -#else // _HAS_CXX20 +#else (void) _Oldsize; -#endif // _HAS_CXX20 +#endif } void merge(list& _Right) { // merge in elements from _Right, both ordered by operator< diff --git a/stl/inc/locale b/stl/inc/locale index ce085438aeb..74394242588 100644 --- a/stl/inc/locale +++ b/stl/inc/locale @@ -118,7 +118,7 @@ private: #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdllimport-static-field-def" -#endif // __clang__ +#endif // defined(__clang__) template __PURE_APPDOMAIN_GLOBAL locale::id collate<_Elem>::id; @@ -132,12 +132,12 @@ template __PURE_APPDOMAIN_GLOBAL locale::id collate::id; #ifdef __FORCE_INSTANCE template __PURE_APPDOMAIN_GLOBAL locale::id collate::id; -#endif // __FORCE_INSTANCE +#endif // defined(__FORCE_INSTANCE) #endif // defined(_DLL_CPPLIB) #ifdef __clang__ #pragma clang diagnostic pop -#endif // __clang__ +#endif // defined(__clang__) _EXPORT_STD template class collate_byname : public collate<_Elem> { // collate for named locale diff --git a/stl/inc/memory b/stl/inc/memory index 550ee7ca218..8fdade31164 100644 --- a/stl/inc/memory +++ b/stl/inc/memory @@ -122,7 +122,7 @@ namespace ranges { _EXPORT_STD inline constexpr _Uninitialized_copy_fn uninitialized_copy{_Not_quite_object::_Construct_tag{}}; } // namespace ranges -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) _EXPORT_STD template _NoThrowFwdIt uninitialized_copy_n(const _InIt _First, const _Diff _Count_raw, _NoThrowFwdIt _Dest) { @@ -216,7 +216,7 @@ namespace ranges { _EXPORT_STD inline constexpr _Uninitialized_copy_n_fn uninitialized_copy_n{_Not_quite_object::_Construct_tag{}}; } // namespace ranges -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) #if _HAS_CXX17 _EXPORT_STD template @@ -277,7 +277,7 @@ namespace ranges { _EXPORT_STD inline constexpr _Uninitialized_move_fn uninitialized_move{_Not_quite_object::_Construct_tag{}}; } // namespace ranges -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) _EXPORT_STD template pair<_InIt, _NoThrowFwdIt> uninitialized_move_n(_InIt _First, const _Diff _Count_raw, _NoThrowFwdIt _Dest) { @@ -436,7 +436,7 @@ namespace ranges { _EXPORT_STD inline constexpr _Uninitialized_fill_fn uninitialized_fill{_Not_quite_object::_Construct_tag{}}; } // namespace ranges -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) _EXPORT_STD template _NoThrowFwdIt uninitialized_fill_n(_NoThrowFwdIt _First, const _Diff _Count_raw, const _Tval& _Val) { @@ -566,7 +566,7 @@ namespace ranges { _EXPORT_STD inline constexpr _Destroy_at_fn destroy_at{_Not_quite_object::_Construct_tag{}}; } // namespace ranges -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) #if _HAS_CXX17 _EXPORT_STD template @@ -620,7 +620,7 @@ namespace ranges { _EXPORT_STD inline constexpr _Destroy_fn destroy{_Not_quite_object::_Construct_tag{}}; } // namespace ranges -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) _EXPORT_STD template _CONSTEXPR20 _NoThrowFwdIt destroy_n(_NoThrowFwdIt _First, const _Diff _Count_raw) { @@ -678,7 +678,7 @@ namespace ranges { _EXPORT_STD inline constexpr _Destroy_n_fn destroy_n{_Not_quite_object::_Construct_tag{}}; } // namespace ranges -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) _EXPORT_STD template void uninitialized_default_construct(const _NoThrowFwdIt _First, const _NoThrowFwdIt _Last) { @@ -750,7 +750,7 @@ namespace ranges { _EXPORT_STD inline constexpr _Uninitialized_default_construct_fn uninitialized_default_construct{ _Not_quite_object::_Construct_tag{}}; } // namespace ranges -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) _EXPORT_STD template _NoThrowFwdIt uninitialized_default_construct_n(_NoThrowFwdIt _First, const _Diff _Count_raw) { @@ -811,7 +811,7 @@ namespace ranges { _EXPORT_STD inline constexpr _Uninitialized_default_construct_n_fn uninitialized_default_construct_n{ _Not_quite_object::_Construct_tag{}}; } // namespace ranges -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) _EXPORT_STD template void uninitialized_value_construct(const _NoThrowFwdIt _First, const _NoThrowFwdIt _Last) { @@ -884,7 +884,7 @@ namespace ranges { _EXPORT_STD inline constexpr _Uninitialized_value_construct_fn uninitialized_value_construct{ _Not_quite_object::_Construct_tag{}}; } // namespace ranges -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) _EXPORT_STD template _NoThrowFwdIt uninitialized_value_construct_n(_NoThrowFwdIt _First, const _Diff _Count_raw) { @@ -934,7 +934,7 @@ namespace ranges { _EXPORT_STD inline constexpr _Uninitialized_value_construct_n_fn uninitialized_value_construct_n{ _Not_quite_object::_Construct_tag{}}; } // namespace ranges -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) #endif // _HAS_CXX17 #if _HAS_CXX20 @@ -956,9 +956,9 @@ public: using value_type = void; #ifdef __cpp_lib_concepts using difference_type = ptrdiff_t; -#else +#else // ^^^ defined(__cpp_lib_concepts) / !defined(__cpp_lib_concepts) vvv using difference_type = void; -#endif // __cpp_lib_concepts +#endif // ^^^ !defined(__cpp_lib_concepts) ^^^ using pointer = void; using reference = void; @@ -1132,10 +1132,10 @@ private: virtual void _Delete_this() noexcept { _CSTD abort(); } -#else // ^^^ _M_CEE_PURE / !_M_CEE_PURE vvv +#else // ^^^ defined(_M_CEE_PURE) / !defined(_M_CEE_PURE) vvv virtual void _Destroy() noexcept = 0; // destroy managed resource virtual void _Delete_this() noexcept = 0; // destroy self -#endif // _M_CEE_PURE +#endif // ^^^ !defined(_M_CEE_PURE) ^^^ _Atomic_counter_t _Uses = 1; _Atomic_counter_t _Weaks = 1; @@ -1228,9 +1228,9 @@ public: if (_Typeid == typeid(_Dx)) { return const_cast<_Dx*>(_STD addressof(_Mypair._Get_first())); } -#else // _HAS_STATIC_RTTI +#else // ^^^ _HAS_STATIC_RTTI / !_HAS_STATIC_RTTI vvv (void) _Typeid; -#endif // _HAS_STATIC_RTTI +#endif // ^^^ !_HAS_STATIC_RTTI ^^^ return nullptr; } @@ -1262,9 +1262,9 @@ public: if (_Typeid == typeid(_Dx)) { return const_cast<_Dx*>(_STD addressof(_Mypair._Get_first())); } -#else // _HAS_STATIC_RTTI +#else // ^^^ _HAS_STATIC_RTTI / !_HAS_STATIC_RTTI vvv (void) _Typeid; -#endif // _HAS_STATIC_RTTI +#endif // ^^^ !_HAS_STATIC_RTTI ^^^ return nullptr; } @@ -2051,12 +2051,12 @@ _NODISCARD shared_ptr<_Ty1> dynamic_pointer_cast(shared_ptr<_Ty2>&& _Other) noex return {}; } -#else // _CPPRTTI +#else // ^^^ defined(_CPPRTTI) / !defined(_CPPRTTI) vvv _EXPORT_STD template shared_ptr<_Ty1> dynamic_pointer_cast(const shared_ptr<_Ty2>&) noexcept = delete; // requires /GR option _EXPORT_STD template shared_ptr<_Ty1> dynamic_pointer_cast(shared_ptr<_Ty2>&&) noexcept = delete; // requires /GR option -#endif // _CPPRTTI +#endif // ^^^ !defined(_CPPRTTI) ^^^ #if _HAS_STATIC_RTTI _EXPORT_STD template @@ -2068,10 +2068,10 @@ _NODISCARD _Dx* get_deleter(const shared_ptr<_Ty>& _Sx) noexcept { return nullptr; } -#else // _HAS_STATIC_RTTI +#else // ^^^ _HAS_STATIC_RTTI / !_HAS_STATIC_RTTI vvv _EXPORT_STD template _Dx* get_deleter(const shared_ptr<_Ty>&) noexcept = delete; // requires static RTTI -#endif // _HAS_STATIC_RTTI +#endif // ^^^ !_HAS_STATIC_RTTI ^^^ #if _HAS_CXX20 struct _For_overwrite_tag { @@ -2167,7 +2167,7 @@ _NODISCARD _Refc* _Allocate_flexible_array(const size_t _Count) { if constexpr (_Align > __STDCPP_DEFAULT_NEW_ALIGNMENT__) { return static_cast<_Refc*>(::operator new(_Bytes, align_val_t{_Align})); } else -#endif // __cpp_aligned_new +#endif // defined(__cpp_aligned_new) { return static_cast<_Refc*>(::operator new(_Bytes)); } @@ -2180,7 +2180,7 @@ void _Deallocate_flexible_array(_Refc* const _Ptr) noexcept { if constexpr (_Align > __STDCPP_DEFAULT_NEW_ALIGNMENT__) { ::operator delete(static_cast(_Ptr), align_val_t{_Align}); } else -#endif // __cpp_aligned_new +#endif // defined(__cpp_aligned_new) { ::operator delete(static_cast(_Ptr)); } @@ -2762,9 +2762,9 @@ _EXPORT_STD template _NODISCARD_SMART_PTR_ALLOC #if _HAS_CXX20 enable_if_t, shared_ptr<_Ty>> -#else // _HAS_CXX20 +#else shared_ptr<_Ty> -#endif // _HAS_CXX20 +#endif make_shared(_Types&&... _Args) { // make a shared_ptr to non-array object const auto _Rx = new _Ref_count_obj2<_Ty>(_STD forward<_Types>(_Args)...); shared_ptr<_Ty> _Ret; @@ -2857,9 +2857,9 @@ _EXPORT_STD template _NODISCARD_SMART_PTR_ALLOC #if _HAS_CXX20 enable_if_t, shared_ptr<_Ty>> -#else // _HAS_CXX20 +#else shared_ptr<_Ty> -#endif // _HAS_CXX20 +#endif allocate_shared(const _Alloc& _Al, _Types&&... _Args) { // make a shared_ptr to non-array object // Note: As of 2019-05-28, this implements the proposed resolution of LWG-3210 (which controls whether // allocator::construct sees T or const T when _Ty is const qualified) @@ -3026,9 +3026,9 @@ public: weak_ptr(const weak_ptr<_Ty2>& _Other) noexcept { #ifdef _M_CEE_PURE constexpr bool _Avoid_expired_conversions = true; // slow, but always safe; avoids error LNK1179 -#else // _M_CEE_PURE +#else constexpr bool _Avoid_expired_conversions = _Must_avoid_expired_conversions_from<_Ty2>; -#endif // _M_CEE_PURE +#endif if constexpr (_Avoid_expired_conversions) { this->_Weakly_convert_lvalue_avoiding_expired_conversions(_Other); @@ -3045,9 +3045,9 @@ public: weak_ptr(weak_ptr<_Ty2>&& _Other) noexcept { #ifdef _M_CEE_PURE constexpr bool _Avoid_expired_conversions = true; // slow, but always safe; avoids error LNK1179 -#else // _M_CEE_PURE +#else constexpr bool _Avoid_expired_conversions = _Must_avoid_expired_conversions_from<_Ty2>; -#endif // _M_CEE_PURE +#endif if constexpr (_Avoid_expired_conversions) { this->_Weakly_convert_rvalue_avoiding_expired_conversions(_STD move(_Other)); @@ -3543,7 +3543,7 @@ _NODISCARD compare_three_way_result_t::pointer, // clang-format on return _Left.get() <=> _Right.get(); } -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) _EXPORT_STD template _NODISCARD _CONSTEXPR23 bool operator==(const unique_ptr<_Ty, _Dx>& _Left, nullptr_t) noexcept { @@ -3616,7 +3616,7 @@ _NODISCARD _CONSTEXPR23 compare_three_way_result_t const unique_ptr<_Ty, _Dx>& _Left, nullptr_t) { return _Left.get() <=> static_cast::pointer>(nullptr); } -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) template struct _Can_stream_unique_ptr : false_type {}; diff --git a/stl/inc/memory_resource b/stl/inc/memory_resource index 2eb439b372a..415994c6d0c 100644 --- a/stl/inc/memory_resource +++ b/stl/inc/memory_resource @@ -18,7 +18,7 @@ _EMIT_STL_WARNING(STL4038, "The contents of are available only #ifndef _M_CEE_PURE #include -#endif // _M_CEE_PURE +#endif // !defined(_M_CEE_PURE) #pragma pack(push, _CRT_PACKING) #pragma warning(push, _STL_WARNING_LEVEL) @@ -37,9 +37,9 @@ namespace pmr { _EXPORT_STD inline memory_resource* set_default_resource(memory_resource* const _Resource) noexcept { #ifdef __cpp_aligned_new return _Aligned_set_default_resource(_Resource); -#else // ^^^ __cpp_aligned_new / !__cpp_aligned_new vvv +#else // ^^^ defined(__cpp_aligned_new) / !defined(__cpp_aligned_new) vvv return _Unaligned_set_default_resource(_Resource); -#endif // __cpp_aligned_new +#endif // ^^^ !defined(__cpp_aligned_new) ^^^ } _EXPORT_STD extern "C" _NODISCARD _CRT_SATELLITE_1 memory_resource* __cdecl null_memory_resource() noexcept; @@ -95,12 +95,12 @@ namespace pmr { return _Aligned_new_delete_resource(); } -#else // ^^^ __cpp_aligned_new / !__cpp_aligned_new vvv +#else // ^^^ defined(__cpp_aligned_new) / !defined(__cpp_aligned_new) vvv _EXPORT_STD _NODISCARD inline memory_resource* new_delete_resource() noexcept { return _Unaligned_new_delete_resource(); } -#endif // __cpp_aligned_new +#endif // ^^^ !defined(__cpp_aligned_new) ^^^ template struct _Double_link { // base class for intrusive doubly-linked structures @@ -366,7 +366,7 @@ namespace pmr { // no room for header + alignment padding; this memory WAS NOT allocated by this pool resource #ifdef _DEBUG _STL_REPORT_ERROR("Cannot deallocate memory not allocated by this memory pool."); -#endif // _DEBUG +#endif // defined(_DEBUG) } _Oversized_header* _Hdr = reinterpret_cast<_Oversized_header*>(static_cast(_Ptr) + _Bytes) - 1; @@ -590,7 +590,7 @@ namespace pmr { private: mutable mutex _Mtx; }; -#endif // _M_CEE_PURE +#endif // !defined(_M_CEE_PURE) _EXPORT_STD class monotonic_buffer_resource : public _Identity_equal_resource { public: diff --git a/stl/inc/new b/stl/inc/new index ff44edab5b0..2165ca81e1c 100644 --- a/stl/inc/new +++ b/stl/inc/new @@ -64,7 +64,7 @@ _EXPORT_STD extern "C++" void __CRTDECL operator delete(void*, _STD align_val_t, _EXPORT_STD extern "C++" void __CRTDECL operator delete[](void*, _STD align_val_t) noexcept; _EXPORT_STD extern "C++" void __CRTDECL operator delete[](void*, size_t, _STD align_val_t) noexcept; _EXPORT_STD extern "C++" void __CRTDECL operator delete[](void*, _STD align_val_t, const _STD nothrow_t&) noexcept; -#endif // __cpp_aligned_new +#endif // defined(__cpp_aligned_new) _EXPORT_STD extern "C++" _NODISCARD void* __CRTDECL operator new(size_t, void*) noexcept; _EXPORT_STD extern "C++" _NODISCARD void* __CRTDECL operator new[](size_t, void*) noexcept; @@ -72,7 +72,7 @@ _EXPORT_STD extern "C++" void __CRTDECL operator delete(void*, void*) noexcept; _EXPORT_STD extern "C++" void __CRTDECL operator delete[](void*, void*) noexcept; #pragma warning(pop) -#endif // _BUILD_STD_MODULE +#endif // defined(_BUILD_STD_MODULE) _STD_BEGIN #if _HAS_EXCEPTIONS diff --git a/stl/inc/optional b/stl/inc/optional index a83b1924679..060960a6503 100644 --- a/stl/inc/optional +++ b/stl/inc/optional @@ -612,7 +612,7 @@ public: return _STD forward<_Fn>(_Func)(); } } -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) #endif // _HAS_CXX23 using _Mybase::reset; @@ -628,7 +628,7 @@ _NODISCARD constexpr bool operator==(const optional<_Ty1>& _Left, const optional requires requires { { *_Left == *_Right } -> _Implicitly_convertible_to; } -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) { const bool _Left_has_value = _Left.has_value(); const bool _Right_has_value = _Right.has_value(); @@ -645,7 +645,7 @@ _NODISCARD constexpr bool operator!=(const optional<_Ty1>& _Left, const optional requires requires { { *_Left != *_Right } -> _Implicitly_convertible_to; } -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) { const bool _Left_has_value = _Left.has_value(); const bool _Right_has_value = _Right.has_value(); @@ -662,7 +662,7 @@ _NODISCARD constexpr bool operator<(const optional<_Ty1>& _Left, const optional< requires requires { { *_Left < *_Right } -> _Implicitly_convertible_to; } -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) { const bool _Left_has_value = _Left.has_value(); const bool _Right_has_value = _Right.has_value(); @@ -679,7 +679,7 @@ _NODISCARD constexpr bool operator>(const optional<_Ty1>& _Left, const optional< requires requires { { *_Left > *_Right } -> _Implicitly_convertible_to; } -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) { const bool _Left_has_value = _Left.has_value(); const bool _Right_has_value = _Right.has_value(); @@ -696,7 +696,7 @@ _NODISCARD constexpr bool operator<=(const optional<_Ty1>& _Left, const optional requires requires(const _Ty1& _Elem1, const _Ty2& _Elem2) { { *_Left <= *_Right } -> _Implicitly_convertible_to; } -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) { const bool _Left_has_value = _Left.has_value(); const bool _Right_has_value = _Right.has_value(); @@ -713,7 +713,7 @@ _NODISCARD constexpr bool operator>=(const optional<_Ty1>& _Left, const optional requires requires { { *_Left >= *_Right } -> _Implicitly_convertible_to; } -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) { const bool _Left_has_value = _Left.has_value(); const bool _Right_has_value = _Right.has_value(); @@ -735,7 +735,7 @@ _NODISCARD constexpr compare_three_way_result_t<_Ty1, _Ty2> operator<=>(const op return _Left_has_value <=> _Right_has_value; } -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) _EXPORT_STD template _NODISCARD constexpr bool operator==(const optional<_Ty>& _Left, nullopt_t) noexcept { @@ -944,7 +944,7 @@ _NODISCARD constexpr compare_three_way_result_t<_Ty1, _Ty2> return strong_ordering::less; } -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) _EXPORT_STD template && is_swappable_v<_Ty>, int> = 0> _CONSTEXPR20 void swap(optional<_Ty>& _Left, optional<_Ty>& _Right) noexcept(noexcept(_Left.swap(_Right))) { diff --git a/stl/inc/ostream b/stl/inc/ostream index abd4a9ec541..246bf0857c0 100644 --- a/stl/inc/ostream +++ b/stl/inc/ostream @@ -679,7 +679,7 @@ template class _CRTIMP2_PURE_IMPORT basic_ostream> #ifdef __FORCE_INSTANCE template class _CRTIMP2_PURE_IMPORT basic_ostream>; -#endif // __FORCE_INSTANCE +#endif // defined(__FORCE_INSTANCE) #endif // defined(_DLL_CPPLIB) _EXPORT_STD template @@ -959,7 +959,7 @@ _EXPORT_STD template basic_ostream& operator<<(basic_ostream&, char8_t) = delete; _EXPORT_STD template basic_ostream& operator<<(basic_ostream&, char8_t) = delete; -#endif // __cpp_char8_t +#endif // defined(__cpp_char8_t) #if !_HAS_STREAM_INSERTION_OPERATORS_DELETED_IN_CXX20 #ifdef _NATIVE_WCHAR_T_DEFINED @@ -1066,14 +1066,14 @@ basic_ostream<_Elem, _Traits>& flush_emit(basic_ostream<_Elem, _Traits>& _Ostr) } return _Ostr; } -#else // _CPPRTTI +#else // ^^^ defined(_CPPRTTI) / !defined(_CPPRTTI) vvv _EXPORT_STD template basic_ostream<_Elem, _Traits>& emit_on_flush(basic_ostream<_Elem, _Traits>&) = delete; // requires /GR option _EXPORT_STD template basic_ostream<_Elem, _Traits>& noemit_on_flush(basic_ostream<_Elem, _Traits>&) = delete; // requires /GR option _EXPORT_STD template basic_ostream<_Elem, _Traits>& flush_emit(basic_ostream<_Elem, _Traits>&) = delete; // requires /GR option -#endif // _CPPRTTI +#endif // ^^^ !defined(_CPPRTTI) ^^^ #endif // _HAS_CXX20 _EXPORT_STD template @@ -1275,7 +1275,7 @@ _EXPORT_STD template // improves throughput, see GH-2329 void vprint_nonunicode(ostream& _Ostr, const string_view _Fmt_str, const format_args _Fmt_args) { _STD _Vprint_nonunicode_impl(_Add_newline::_Nope, _Ostr, _Fmt_str, _Fmt_args); } -#else // ^^^ _CPPRTTI / !_CPPRTTI vvv +#else // ^^^ defined(_CPPRTTI) / !defined(_CPPRTTI) vvv _EXPORT_STD template void print(ostream&, format_string<_Types...>, _Types&&...) = delete; // requires /GR option @@ -1284,8 +1284,8 @@ void println(ostream&, format_string<_Types...>, _Types&&...) = delete; // requi _EXPORT_STD void vprint_unicode(ostream&, string_view, format_args) = delete; // requires /GR option _EXPORT_STD void vprint_nonunicode(ostream&, string_view, format_args) = delete; // requires /GR option -#endif // !_CPPRTTI -#endif // __cpp_lib_print +#endif // ^^^ !defined(_CPPRTTI) ^^^ +#endif // defined(__cpp_lib_print) _STD_END diff --git a/stl/inc/print b/stl/inc/print index 778c64a3ca6..dabc8c4a0f1 100644 --- a/stl/inc/print +++ b/stl/inc/print @@ -165,6 +165,6 @@ _STL_RESTORE_CLANG_WARNINGS #pragma warning(pop) #pragma pack(pop) -#endif // __cpp_lib_print +#endif // defined(__cpp_lib_print) #endif // _STL_COMPILER_PREPROCESSOR #endif // _PRINT_ diff --git a/stl/inc/queue b/stl/inc/queue index 566f66cc82f..4ea1df73500 100644 --- a/stl/inc/queue +++ b/stl/inc/queue @@ -51,7 +51,7 @@ public: #ifdef __cpp_lib_concepts template <_Container_compatible_range<_Ty> _Rng> queue(from_range_t, _Rng&& _Range) : c(_RANGES to<_Container>(_STD forward<_Rng>(_Range))) {} -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) #endif // _HAS_CXX23 template , int> = 0> @@ -85,7 +85,7 @@ public: template <_Container_compatible_range<_Ty> _Rng, class _Alloc> queue(from_range_t, _Rng&& _Range, const _Alloc& _Al) : c(_RANGES to<_Container>(_STD forward<_Rng>(_Range), _Al)) {} -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) #endif // _HAS_CXX23 _NODISCARD_EMPTY_ADAPTOR_MEMBER bool empty() const noexcept(noexcept(c.empty())) /* strengthened */ { @@ -176,7 +176,7 @@ template <_RANGES input_range _Rng, class _Alloc = allocator<_RANGES range_value enable_if_t<_Is_allocator<_Alloc>::value, int> = 0> queue(from_range_t, _Rng&&, _Alloc = _Alloc()) -> queue<_RANGES range_value_t<_Rng>, deque<_RANGES range_value_t<_Rng>, _Alloc>>; -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) #endif // _HAS_CXX23 _EXPORT_STD template @@ -215,7 +215,7 @@ _NODISCARD compare_three_way_result_t<_Container> operator<=>( const queue<_Ty, _Container>& _Left, const queue<_Ty, _Container>& _Right) { return _Left._Get_container() <=> _Right._Get_container(); } -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) _EXPORT_STD template ::value, int> = 0> void swap(queue<_Ty, _Container>& _Left, queue<_Ty, _Container>& _Right) noexcept(noexcept(_Left.swap(_Right))) { diff --git a/stl/inc/random b/stl/inc/random index 393b3ba7f93..6f61fbc6ef2 100644 --- a/stl/inc/random +++ b/stl/inc/random @@ -2187,9 +2187,9 @@ _NODISCARD _Flt _Float_upper_bound(_Ty _Val) noexcept { #ifdef _M_CEE_PURE constexpr auto _Ty_32or64_digits = numeric_limits<_Ty_32or64>::digits; const auto _Log_plus1 = _Ty_32or64_digits - _Countl_zero_internal(static_cast<_Ty_32or64>(_Val | _Ty{1})); -#else // _M_CEE_PURE +#else // ^^^ defined(_M_CEE_PURE) / !defined(_M_CEE_PURE) vvv const auto _Log_plus1 = _Bit_scan_reverse(static_cast<_Ty_32or64>(_Val | _Ty{1})); -#endif // _M_CEE_PURE +#endif // ^^^ !defined(_M_CEE_PURE) ^^^ const auto _Shifted_mask = _Mask >> (_Ty_digits - _Log_plus1); const auto _Ceil_ulp = _Shifted_mask & -_Shifted_mask; _Val &= _Shifted_mask; diff --git a/stl/inc/ranges b/stl/inc/ranges index fc77d11ae8c..cca384b1fdf 100644 --- a/stl/inc/ranges +++ b/stl/inc/ranges @@ -10483,7 +10483,7 @@ namespace ranges { _NODISCARD constexpr auto to(_Types&&... _Args) { return _Range_closure<_To_template_fn<_Container>, decay_t<_Types>...>{_STD forward<_Types>(_Args)...}; } -#endif // __cpp_lib_ranges_to_container +#endif // defined(__cpp_lib_ranges_to_container) #endif // _HAS_CXX23 } // namespace ranges @@ -10495,6 +10495,6 @@ _STD_END _STL_RESTORE_CLANG_WARNINGS #pragma warning(pop) #pragma pack(pop) -#endif // __cpp_lib_ranges +#endif // defined(__cpp_lib_ranges) #endif // _STL_COMPILER_PREPROCESSOR #endif // _RANGES_ diff --git a/stl/inc/regex b/stl/inc/regex index ae7a45355a0..4d893eee77b 100644 --- a/stl/inc/regex +++ b/stl/inc/regex @@ -46,10 +46,8 @@ _STL_DISABLE_CLANG_WARNINGS #endif // _REGEX_MAX_STACK_COUNT #ifndef _ENHANCED_REGEX_VISUALIZER - #ifdef _DEBUG #define _ENHANCED_REGEX_VISUALIZER 1 - #else // _DEBUG #define _ENHANCED_REGEX_VISUALIZER 0 #endif // _DEBUG @@ -1870,9 +1868,9 @@ public: basic_regex(const basic_regex& _Right) #if _ENHANCED_REGEX_VISUALIZER : _Rep(nullptr), _Traits(_Right._Traits), _Visualization(_Right._Visualization) -#else // _ENHANCED_REGEX_VISUALIZER +#else : _Rep(nullptr), _Traits(_Right._Traits) -#endif // _ENHANCED_REGEX_VISUALIZER +#endif { // construct copy of _Right _Reset(_Right._Rep); } @@ -2469,7 +2467,7 @@ public: _NODISCARD bool operator==(default_sentinel_t) const { return !_MyRe; } -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) _NODISCARD const value_type& operator*() const { #if _ITERATOR_DEBUG_LEVEL != 0 @@ -2662,7 +2660,7 @@ public: _NODISCARD bool operator==(default_sentinel_t) const { return !_Res; } -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) _NODISCARD const value_type& operator*() const { #if _ITERATOR_DEBUG_LEVEL != 0 diff --git a/stl/inc/semaphore b/stl/inc/semaphore index fedb1a91808..9f1d11055cb 100644 --- a/stl/inc/semaphore +++ b/stl/inc/semaphore @@ -10,7 +10,7 @@ #ifdef _M_CEE_PURE #error is not supported when compiling with /clr:pure. -#endif // _M_CEE_PURE +#endif // defined(_M_CEE_PURE) #if !_HAS_CXX20 _EMIT_STL_WARNING(STL4038, "The contents of are available only with C++20 or later."); diff --git a/stl/inc/shared_mutex b/stl/inc/shared_mutex index c58611b042b..b8c088b2af5 100644 --- a/stl/inc/shared_mutex +++ b/stl/inc/shared_mutex @@ -10,7 +10,7 @@ #ifdef _M_CEE_PURE #error is not supported when compiling with /clr:pure. -#endif // _M_CEE_PURE +#endif // defined(_M_CEE_PURE) #include #include diff --git a/stl/inc/span b/stl/inc/span index 725b8ddc7a2..3f8cb1861c9 100644 --- a/stl/inc/span +++ b/stl/inc/span @@ -31,7 +31,7 @@ template struct _Span_iterator { #ifdef __cpp_lib_concepts using iterator_concept = contiguous_iterator_tag; -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) using iterator_category = random_access_iterator_tag; using value_type = remove_cv_t<_Ty>; using difference_type = ptrdiff_t; @@ -257,7 +257,7 @@ concept _Span_compatible_range = && (_RANGES borrowed_range<_Rng> || is_const_v<_Ty>) && is_convertible_v>(*)[], _Ty(*)[]>; // clang-format on -#else // ^^^ __cpp_lib_concepts / !__cpp_lib_concepts vvv +#else // ^^^ defined(__cpp_lib_concepts) / !defined(__cpp_lib_concepts) vvv template struct _Is_span : false_type {}; @@ -290,7 +290,7 @@ inline constexpr bool _Is_span_compatible_range = conjunction_v< // _Has_container_interface<_Rng>, // _Is_span_convertible_range<_Rng, _Ty>>; -#endif // !__cpp_lib_concepts +#endif // ^^^ !defined(__cpp_lib_concepts) ^^^ // [views.span] _EXPORT_STD template @@ -388,7 +388,7 @@ public: } // clang-format on -#else // ^^^ __cpp_lib_concepts / !__cpp_lib_concepts vvv +#else // ^^^ defined(__cpp_lib_concepts) / !defined(__cpp_lib_concepts) vvv template = 0> constexpr span() noexcept {} @@ -467,7 +467,7 @@ public: #endif // _CONTAINER_DEBUG_LEVEL > 0 } -#endif // !__cpp_lib_concepts +#endif // ^^^ !defined(__cpp_lib_concepts) ^^^ // [span.sub] Subviews template @@ -664,7 +664,7 @@ span(_It, _End) -> span>>; template <_RANGES contiguous_range _Rng> span(_Rng&&) -> span>>; -#else // ^^^ __cpp_lib_concepts / !__cpp_lib_concepts vvv +#else // ^^^ defined(__cpp_lib_concepts) / !defined(__cpp_lib_concepts) vvv template span(_Rng&) -> span; @@ -672,7 +672,7 @@ span(_Rng&) -> span; template span(const _Rng&) -> span; -#endif // !__cpp_lib_concepts +#endif // ^^^ !defined(__cpp_lib_concepts) ^^^ #ifdef __cpp_lib_byte // [span.objectrep] Views of object representation @@ -687,7 +687,7 @@ _NODISCARD auto as_writable_bytes(span<_Ty, _Extent> _Sp) noexcept { using _ReturnType = span; return _ReturnType{reinterpret_cast(_Sp.data()), _Sp.size_bytes()}; } -#endif // __cpp_lib_byte +#endif // defined(__cpp_lib_byte) _STD_END diff --git a/stl/inc/spanstream b/stl/inc/spanstream index 0fd93411877..3c572019aee 100644 --- a/stl/inc/spanstream +++ b/stl/inc/spanstream @@ -12,7 +12,7 @@ _EMIT_STL_WARNING(STL4038, "The contents of are available only with #else // ^^^ !_HAS_CXX23 / _HAS_CXX23 vvv #ifdef __cpp_lib_concepts #include -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) #include #include #include @@ -224,7 +224,7 @@ public: : basic_ispanstream( _STD span<_Elem>{const_cast<_Elem*>(_RANGES data(_Range)), static_cast(_RANGES size(_Range))}) {} // clang-format on -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) basic_ispanstream& operator=(const basic_ispanstream&) = delete; @@ -263,7 +263,7 @@ public: _STD span<_Elem>{const_cast<_Elem*>(_RANGES data(_Range)), static_cast(_RANGES size(_Range))}); } // clang-format on -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) private: _Mysb _Buf; diff --git a/stl/inc/stack b/stl/inc/stack index c4a5378538f..29c51ea484f 100644 --- a/stl/inc/stack +++ b/stl/inc/stack @@ -49,7 +49,7 @@ public: #ifdef __cpp_lib_concepts template <_Container_compatible_range<_Ty> _Rng> stack(from_range_t, _Rng&& _Range) : c(_RANGES to<_Container>(_STD forward<_Rng>(_Range))) {} -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) #endif // _HAS_CXX23 template , int> = 0> @@ -83,7 +83,7 @@ public: template <_Container_compatible_range<_Ty> _Rng, class _Alloc> stack(from_range_t, _Rng&& _Range, const _Alloc& _Al) : c(_RANGES to<_Container>(_STD forward<_Rng>(_Range), _Al)) {} -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) #endif // _HAS_CXX23 _NODISCARD_EMPTY_ADAPTOR_MEMBER bool empty() const noexcept(noexcept(c.empty())) /* strengthened */ { @@ -167,7 +167,7 @@ stack(from_range_t, _Rng&&) -> stack<_RANGES range_value_t<_Rng>>; template <_RANGES input_range _Rng, class _Alloc, enable_if_t<_Is_allocator<_Alloc>::value, int> = 0> stack(from_range_t, _Rng&&, _Alloc) -> stack<_RANGES range_value_t<_Rng>, deque<_RANGES range_value_t<_Rng>, _Alloc>>; -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) #endif // _HAS_CXX23 _EXPORT_STD template @@ -206,7 +206,7 @@ _NODISCARD compare_three_way_result_t<_Container> operator<=>( const stack<_Ty, _Container>& _Left, const stack<_Ty, _Container>& _Right) { return _Left._Get_container() <=> _Right._Get_container(); } -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) _EXPORT_STD template ::value, int> = 0> void swap(stack<_Ty, _Container>& _Left, stack<_Ty, _Container>& _Right) noexcept(noexcept(_Left.swap(_Right))) { diff --git a/stl/inc/stacktrace b/stl/inc/stacktrace index 43182d0ddf8..36491311950 100644 --- a/stl/inc/stacktrace +++ b/stl/inc/stacktrace @@ -267,7 +267,7 @@ public: #ifdef __cpp_lib_concepts return _STD lexicographical_compare_three_way(_Lhs.begin(), _Lhs.end(), _Rhs.begin(), _Rhs.end()); -#else // ^^^ __cpp_lib_concepts / !__cpp_lib_concepts vvv +#else // ^^^ defined(__cpp_lib_concepts) / !defined(__cpp_lib_concepts) vvv for (size_t _Ix = 0, _Mx = _Lhs._Frames.size(); _Ix != _Mx; ++_Ix) { if (_Lhs._Frames[_Ix] != _Rhs._Frames[_Ix]) { return _Lhs._Frames[_Ix] <=> _Rhs._Frames[_Ix]; @@ -275,7 +275,7 @@ public: } return strong_ordering::equal; -#endif // ^^^ !__cpp_lib_concepts ^^^ +#endif // ^^^ !defined(__cpp_lib_concepts) ^^^ } void swap(basic_stacktrace& _Other) noexcept(allocator_traits<_Alloc>::propagate_on_container_swap::value diff --git a/stl/inc/streambuf b/stl/inc/streambuf index 3239ff4d262..92ad96cbfb1 100644 --- a/stl/inc/streambuf +++ b/stl/inc/streambuf @@ -407,7 +407,7 @@ template class _CRTIMP2_PURE_IMPORT basic_streambuf>; -#endif // __FORCE_INSTANCE +#endif // defined(__FORCE_INSTANCE) #endif // defined(_DLL_CPPLIB) _STD_END diff --git a/stl/inc/thread b/stl/inc/thread index 932cc1cf4d9..0b66acf2964 100644 --- a/stl/inc/thread +++ b/stl/inc/thread @@ -25,7 +25,7 @@ #ifdef _M_CEE_PURE #error is not supported when compiling with /clr:pure. -#endif // _M_CEE_PURE +#endif // defined(_M_CEE_PURE) #pragma pack(push, _CRT_PACKING) #pragma warning(push, _STL_WARNING_LEVEL) diff --git a/stl/inc/tuple b/stl/inc/tuple index 4b048d91989..021c6b057a4 100644 --- a/stl/inc/tuple +++ b/stl/inc/tuple @@ -9,7 +9,7 @@ #if _STL_COMPILER_PREPROCESSOR #ifdef __cpp_lib_concepts #include -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) #include <__msvc_iter_core.hpp> #include @@ -195,7 +195,7 @@ concept _Can_construct_from_tuple_like = && (tuple_size_v<_Tuple> != 1 || (!is_convertible_v<_TupleLike, tuple_element_t<0, _Tuple>> && !is_constructible_v, _TupleLike>) ); -#endif // __clang__ +#endif // defined(__clang__) template >> struct _Three_way_comparison_result_with_tuple_like {}; @@ -204,7 +204,7 @@ template requires #ifndef __clang__ // TRANSITION, DevCom-10265237 (sizeof...(_TTypes) == sizeof...(_Indices)) && -#endif // __clang__ +#endif // !defined(__clang__) (requires { typename _Synth_three_way_result<_TTypes, tuple_element_t<_Indices, _UTuple>>; } && ...) struct _Three_way_comparison_result_with_tuple_like, _UTuple, index_sequence<_Indices...>> { using type = common_comparison_category_t<_Synth_three_way_result<_TTypes, tuple_element_t<_Indices, _UTuple>>...>; @@ -267,7 +267,7 @@ public: constexpr const tuple& operator=(_Other&&) const noexcept /* strengthened */ { return *this; } -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) #endif // _HAS_CXX23 _CONSTEXPR20 void swap(tuple&) noexcept {} @@ -440,11 +440,11 @@ public: && (1 + sizeof...(_Rest) == tuple_size_v>) && _Can_construct_values_from_tuple_like_v && (sizeof...(_Rest) != 0 || (!is_convertible_v<_Other, _This> && !is_constructible_v<_This, _Other>) ) -#endif // __clang__ +#endif // ^^^ no workaround ^^^ constexpr explicit(_Is_tuple_like_constructor_explicit_v<_Other>) tuple(_Other&& _Right) : tuple(_Unpack_tuple_t{}, _STD forward<_Other>(_Right)) { } -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) #endif // _HAS_CXX23 template >) && _Can_construct_values_from_tuple_like_v && (sizeof...(_Rest) != 0 || (!is_convertible_v<_Other, _This> && !is_constructible_v<_This, _Other>) ) -#endif // __clang__ +#endif // ^^^ no workaround ^^^ constexpr explicit(_Is_tuple_like_constructor_explicit_v<_Other>) tuple(allocator_arg_t, const _Alloc& _Al, _Other&& _Right) : tuple(_Alloc_unpack_tuple_t{}, _Al, _STD forward<_Other>(_Right)) { } -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) #endif // _HAS_CXX23 tuple& operator=(const volatile tuple&) = delete; @@ -730,7 +730,7 @@ public: _Assign_tuple_like(_STD forward<_Other>(_Right), make_index_sequence<1 + sizeof...(_Rest)>{}); return *this; } -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) #endif // _HAS_CXX23 _CONSTEXPR20 void swap(tuple& _Right) noexcept( diff --git a/stl/inc/type_traits b/stl/inc/type_traits index dafb8d29915..2f1741396ed 100644 --- a/stl/inc/type_traits +++ b/stl/inc/type_traits @@ -377,10 +377,9 @@ _INLINE_VAR constexpr bool is_compound_v = !is_fundamental_v<_Ty>; #ifdef _M_CEE #define _EMIT_CLRCALL(FUNC, OPT1, OPT2, OPT3) FUNC(__clrcall, OPT1, OPT2, OPT3) - -#else // _M_CEE +#else // ^^^ defined(_M_CEE) / !defined(_M_CEE) vvv #define _EMIT_CLRCALL(FUNC, OPT1, OPT2, OPT3) -#endif // _M_CEE +#endif // ^^^ !defined(_M_CEE) ^^^ #if defined(_M_IX86) && !defined(_M_CEE) #define _EMIT_FASTCALL(FUNC, OPT1, OPT2, OPT3) FUNC(__fastcall, OPT1, OPT2, OPT3) @@ -392,11 +391,10 @@ _INLINE_VAR constexpr bool is_compound_v = !is_fundamental_v<_Ty>; #ifdef _M_IX86 #define _EMIT_STDCALL(FUNC, OPT1, OPT2, OPT3) FUNC(__stdcall, OPT1, OPT2, OPT3) #define _EMIT_THISCALL(FUNC, OPT1, OPT2, OPT3) FUNC(__thiscall, OPT1, OPT2, OPT3) - -#else // _M_IX86 +#else // ^^^ defined(_M_IX86) / !defined(_M_IX86) vvv #define _EMIT_STDCALL(FUNC, OPT1, OPT2, OPT3) #define _EMIT_THISCALL(FUNC, OPT1, OPT2, OPT3) -#endif // _M_IX86 +#endif // ^^^ !defined(_M_IX86) ^^^ #if ((defined(_M_IX86) && _M_IX86_FP >= 2) || defined(_M_X64)) && !defined(_M_CEE) #define _EMIT_VECTORCALL(FUNC, OPT1, OPT2, OPT3) FUNC(__vectorcall, OPT1, OPT2, OPT3) @@ -427,9 +425,9 @@ _INLINE_VAR constexpr bool is_compound_v = !is_fundamental_v<_Ty>; #define _NON_MEMBER_CALL_CV_REF_NOEXCEPT(FUNC) \ _NON_MEMBER_CALL_CV_REF(FUNC, ) \ _NON_MEMBER_CALL_CV_REF(FUNC, noexcept) -#else // __cpp_noexcept_function_type +#else // ^^^ defined(__cpp_noexcept_function_type) / !defined(__cpp_noexcept_function_type) vvv #define _NON_MEMBER_CALL_CV_REF_NOEXCEPT(FUNC) _NON_MEMBER_CALL_CV_REF(FUNC, ) -#endif // __cpp_noexcept_function_type +#endif // ^^^ !defined(__cpp_noexcept_function_type) ^^^ #define _MEMBER_CALL(FUNC, CV_OPT, REF_OPT, NOEXCEPT_OPT) \ _EMIT_CDECL(FUNC, CV_OPT, REF_OPT, NOEXCEPT_OPT) \ @@ -454,9 +452,9 @@ _INLINE_VAR constexpr bool is_compound_v = !is_fundamental_v<_Ty>; #define _MEMBER_CALL_CV_REF_NOEXCEPT(FUNC) \ _MEMBER_CALL_CV_REF(FUNC, ) \ _MEMBER_CALL_CV_REF(FUNC, noexcept) -#else // __cpp_noexcept_function_type +#else // ^^^ defined(__cpp_noexcept_function_type) / !defined(__cpp_noexcept_function_type) vvv #define _MEMBER_CALL_CV_REF_NOEXCEPT(FUNC) _MEMBER_CALL_CV_REF(FUNC, ) -#endif // __cpp_noexcept_function_type +#endif // ^^^ !defined(__cpp_noexcept_function_type) ^^^ #ifdef __cpp_noexcept_function_type #define _CLASS_DEFINE_CV_REF_NOEXCEPT(CLASS) \ @@ -484,7 +482,7 @@ _INLINE_VAR constexpr bool is_compound_v = !is_fundamental_v<_Ty>; CLASS(const&& noexcept) \ CLASS(volatile&& noexcept) \ CLASS(const volatile&& noexcept) -#else // __cpp_noexcept_function_type +#else // ^^^ defined(__cpp_noexcept_function_type) / !defined(__cpp_noexcept_function_type) vvv #define _CLASS_DEFINE_CV_REF_NOEXCEPT(CLASS) \ CLASS(_EMPTY_ARGUMENT) \ CLASS(const) \ @@ -498,7 +496,7 @@ _INLINE_VAR constexpr bool is_compound_v = !is_fundamental_v<_Ty>; CLASS(const&&) \ CLASS(volatile&&) \ CLASS(const volatile&&) -#endif // __cpp_noexcept_function_type +#endif // ^^^ !defined(__cpp_noexcept_function_type) ^^^ template struct _Arg_types {}; // provide argument_type, etc. when sizeof...(_Types) is 1 or 2 @@ -556,7 +554,7 @@ _CLASS_DEFINE_CV_REF_NOEXCEPT(_IS_MEMFUNPTR_ELLIPSIS) _NON_MEMBER_CALL(_IS_MEMFUNPTR_EXPLICIT_THIS_GUIDES, , , ) #ifdef __cpp_noexcept_function_type _NON_MEMBER_CALL(_IS_MEMFUNPTR_EXPLICIT_THIS_GUIDES, , , noexcept) -#endif // __cpp_noexcept_function_type +#endif // defined(__cpp_noexcept_function_type) #undef _IS_MEMFUNPTR_EXPLICIT_THIS_GUIDES #endif // _HAS_CXX23 && !defined(__clang__) @@ -1600,7 +1598,7 @@ const _Ty* addressof(const _Ty&&) = delete; #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdeprecated-volatile" -#endif // __clang__ +#endif // defined(__clang__) template _NODISCARD _Ty _Fake_copy_init(_Ty) noexcept; @@ -1611,7 +1609,7 @@ _NODISCARD _Ty _Fake_copy_init(_Ty) noexcept; #ifdef __clang__ #pragma clang diagnostic pop -#endif // __clang__ +#endif // defined(__clang__) #pragma warning(pop) @@ -1954,7 +1952,7 @@ _EXPORT_STD template @@ -2230,7 +2228,7 @@ _INLINE_VAR constexpr bool _Is_trivially_swappable_v = conjunction_v inline constexpr bool _Is_trivially_swappable_v = true; -#endif // __cpp_lib_byte +#endif // defined(__cpp_lib_byte) template struct _Is_trivially_swappable : bool_constant<_Is_trivially_swappable_v<_Ty>> { @@ -2265,7 +2263,7 @@ template class _TyQual, template { using type = common_reference_t>; }; -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) #define _BITMASK_OPS(_MAYBE_EXPORT, _BITMASK) \ _MAYBE_EXPORT _NODISCARD constexpr _BITMASK operator&(_BITMASK _Left, _BITMASK _Right) noexcept { \ @@ -2315,10 +2313,10 @@ _NODISCARD constexpr bool _Bitmask_includes_all(_Bitmask _Left, _Bitmask _Elemen #if defined(_WIN64) _INLINE_VAR constexpr size_t _FNV_offset_basis = 14695981039346656037ULL; _INLINE_VAR constexpr size_t _FNV_prime = 1099511628211ULL; -#else // defined(_WIN64) +#else // ^^^ defined(_WIN64) / !defined(_WIN64) vvv _INLINE_VAR constexpr size_t _FNV_offset_basis = 2166136261U; _INLINE_VAR constexpr size_t _FNV_prime = 16777619U; -#endif // defined(_WIN64) +#endif // ^^^ !defined(_WIN64) ^^^ _NODISCARD inline size_t _Fnv1a_append_bytes(size_t _Val, const unsigned char* const _First, const size_t _Count) noexcept { // accumulate range [_First, _First + _Count) into partial FNV-1a hash _Val diff --git a/stl/inc/utility b/stl/inc/utility index 9b276828f3d..cadbcb51e2f 100644 --- a/stl/inc/utility +++ b/stl/inc/utility @@ -12,7 +12,7 @@ #ifdef __cpp_lib_concepts #include -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) #if _HAS_CXX20 #include @@ -214,9 +214,9 @@ template concept _Can_construct_from_pair_like = _Pair_like<_PairLike> && !_Is_subrange_v> && is_constructible_v<_Ty1, decltype(_STD get<0>(_STD declval<_PairLike>()))> && is_constructible_v<_Ty2, decltype(_STD get<1>(_STD declval<_PairLike>()))>; -#endif // __clang__ +#endif // defined(__clang__) #endif // _HAS_CXX23 -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) _EXPORT_STD template struct pair { // store a pair of values @@ -294,14 +294,14 @@ struct pair { // store a pair of values requires conjunction_v>>, is_constructible<_Ty1, decltype(_STD get<0>(_STD declval<_Other>()))>, is_constructible<_Ty2, decltype(_STD get<1>(_STD declval<_Other>()))>> -#endif // __clang__ +#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 : first(_STD get<0>(_STD forward<_Other>(_Right))), second(_STD get<1>(_STD forward<_Other>(_Right))) { } -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) #endif // _HAS_CXX23 template @@ -438,7 +438,7 @@ struct pair { // store a pair of values second = _STD get<1>(_STD forward<_Other>(_Right)); return *this; } -#endif // __cpp_lib_concepts +#endif // defined(__cpp_lib_concepts) #endif // _HAS_CXX23 _CONSTEXPR20 void swap(pair& _Right) noexcept( @@ -802,7 +802,7 @@ inline constexpr bool _Is_standard_integer = is_integral_v<_Ty> #endif // _NATIVE_WCHAR_T_DEFINED #ifdef __cpp_char8_t char8_t, -#endif // __cpp_char8_t +#endif // defined(__cpp_char8_t) char16_t, char32_t>; _EXPORT_STD template @@ -905,13 +905,13 @@ using _With_reference = _Ty&; template concept _Can_reference = requires { typename _With_reference<_Ty>; }; -#else // __cpp_lib_concepts +#else // ^^^ defined(__cpp_lib_concepts) / !defined(__cpp_lib_concepts) vvv template inline constexpr bool _Can_reference = false; template inline constexpr bool _Can_reference<_Ty, void_t<_Ty&>> = true; -#endif // __cpp_lib_concepts +#endif // ^^^ !defined(__cpp_lib_concepts) ^^^ #endif // _HAS_CXX20 #if _HAS_CXX23 @@ -924,7 +924,7 @@ _EXPORT_STD [[noreturn]] __forceinline void unreachable() noexcept /* strengthen _STL_UNREACHABLE; #ifdef _DEBUG _CSTD abort(); // likely to be called in debug mode, but can't be relied upon - already entered the UB territory -#endif // _DEBUG +#endif // defined(_DEBUG) } _EXPORT_STD template diff --git a/stl/inc/valarray b/stl/inc/valarray index a871212f858..cb360998f34 100644 --- a/stl/inc/valarray +++ b/stl/inc/valarray @@ -45,7 +45,7 @@ _Ty* _Allocate_for_op_delete(size_t _Count) { if constexpr (_Extended_alignment) { return static_cast<_Ty*>(::operator new(_Bytes, align_val_t{alignof(_Ty)})); } else -#endif // __cpp_aligned_new +#endif // defined(__cpp_aligned_new) { return static_cast<_Ty*>(::operator new(_Bytes)); } @@ -564,7 +564,7 @@ private: if constexpr (_Extended_alignment) { ::operator delete(static_cast(_Myptr), align_val_t{alignof(_Ty)}); } else -#endif // __cpp_aligned_new +#endif // defined(__cpp_aligned_new) { ::operator delete(static_cast(_Myptr)); } diff --git a/stl/inc/variant b/stl/inc/variant index a5202cfcaae..b1da693c42d 100644 --- a/stl/inc/variant +++ b/stl/inc/variant @@ -149,7 +149,7 @@ template