microsoft / STL

MSVC's implementation of the C++ Standard Library.
Other
9.88k stars 1.45k forks source link

`<ranges>`: Remove redundant `_HAS_CXX23` guards #4724

Closed StephanTLavavej closed 1 week ago

StephanTLavavej commented 2 weeks ago

This removes redundant _HAS_CXX23 guards around _Compile_time_max_size specializations, for views that are already guarded for C++23.

Note that these changes are very low risk because the primary template for _Compile_time_max_size is guarded for C++23. If we attempted to specialize it in C++20 mode, we'd get instant errors:

https://github.com/microsoft/STL/blob/e36ee6c2b9bc6f5b1f70776c18cf5d3a93a69798/stl/inc/ranges#L44-L55

This also adds a couple of #endif comments; they aren't strictly necessary but they helped me ripgrep for the redundant guards.

Noticed while reviewing #4707.

StephanTLavavej commented 2 weeks ago

I'm speculatively mirroring this to the MSVC-internal repo - please notify me if any further changes are pushed.