From e07796484db4e86d76f94d499bc8d94b51b75248 Mon Sep 17 00:00:00 2001 From: Jakub Mazurkiewicz Date: Tue, 23 Apr 2024 16:21:59 +0200 Subject: [PATCH] ``: Don't include `` --- stl/inc/generator | 2 +- stl/inc/ranges | 18 ------------------ stl/inc/xmemory | 22 ++++++++++++++++++++++ 3 files changed, 23 insertions(+), 19 deletions(-) diff --git a/stl/inc/generator b/stl/inc/generator index 0df72ea1c9d..e8cd5d54503 100644 --- a/stl/inc/generator +++ b/stl/inc/generator @@ -15,7 +15,7 @@ _EMIT_STL_WARNING(STL4038, "The contents of are available only with #include #include -#include +#include #pragma pack(push, _CRT_PACKING) #pragma warning(push, _STL_WARNING_LEVEL) diff --git a/stl/inc/ranges b/stl/inc/ranges index 1f73c77549b..d639701ec76 100644 --- a/stl/inc/ranges +++ b/stl/inc/ranges @@ -84,24 +84,6 @@ namespace ranges { template requires (_Extent != dynamic_extent) constexpr auto _Compile_time_max_size> = _Extent; - -#if defined(__cpp_lib_byte) - _EXPORT_STD template > -#else // ^^^ defined(__cpp_lib_byte) / !defined(__cpp_lib_byte) vvv - _EXPORT_STD template -#endif // ^^^ !defined(__cpp_lib_byte) ^^^ - struct elements_of { - /* [[no_unique_address]] */ _Rng range; - /* [[no_unique_address]] */ _Alloc allocator{}; - }; - -#if defined(__cpp_lib_byte) - template > - elements_of(_Rng&&, _Alloc = {}) -> elements_of<_Rng&&, _Alloc>; -#else // ^^^ defined(__cpp_lib_byte) / !defined(__cpp_lib_byte) vvv - template - elements_of(_Rng&&, _Alloc) -> elements_of<_Rng&&, _Alloc>; -#endif // ^^^ !defined(__cpp_lib_byte) ^^^ #endif // _HAS_CXX23 // clang-format off diff --git a/stl/inc/xmemory b/stl/inc/xmemory index 2580027193f..6ced9914baa 100644 --- a/stl/inc/xmemory +++ b/stl/inc/xmemory @@ -2587,6 +2587,28 @@ template concept _Transparent = _Is_transparent_v<_Ty>; #endif // _HAS_CXX20 +#if _HAS_CXX23 +namespace ranges { +#if defined(__cpp_lib_byte) + _EXPORT_STD template > +#else // ^^^ defined(__cpp_lib_byte) / !defined(__cpp_lib_byte) vvv + _EXPORT_STD template +#endif // ^^^ !defined(__cpp_lib_byte) ^^^ + struct elements_of { + /* [[no_unique_address]] */ _Rng range; + /* [[no_unique_address]] */ _Alloc allocator{}; + }; + +#if defined(__cpp_lib_byte) + template > + elements_of(_Rng&&, _Alloc = {}) -> elements_of<_Rng&&, _Alloc>; +#else // ^^^ defined(__cpp_lib_byte) / !defined(__cpp_lib_byte) vvv + template + elements_of(_Rng&&, _Alloc) -> elements_of<_Rng&&, _Alloc>; +#endif // ^^^ !defined(__cpp_lib_byte) ^^^ +} // namespace ranges +#endif // _HAS_CXX23 + template _NODISCARD _Elem* _UIntegral_to_buff(_Elem* _RNext, _UTy _UVal) { // used by both to_string and thread::id output // format _UVal into buffer *ending at* _RNext