Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
6c32079
Fix `filesystem::weakly_canonical()` on Win11 24H2 (#4844)
StephanTLavavej Jul 21, 2024
d2fa3a3
Temporarily restore support for Win7 / Server 2008 R2 (#4857)
StephanTLavavej Jul 24, 2024
8657d15
llvm-project Mid-Year Update (#4862)
StephanTLavavej Jul 25, 2024
a357ff1
Improve ARM64 atomics for Clang (#4870)
StephanTLavavej Jul 31, 2024
eaf7b31
Update google-benchmark to 1.8.5. (#4851)
fsb4000 Aug 6, 2024
2f5b967
Wait `condition_variable_any` for `steady_clock` (#4755)
AlexGuteniev Aug 8, 2024
5573054
Remove `std::ranges::view_interface` visualizer. (#4835)
fsb4000 Aug 8, 2024
85a4a5f
`move_iterator` visualizer should use `_Current` (#4836)
fsb4000 Aug 8, 2024
ed7ed96
`<expected>`: Add deleted copy function overloads (#4837)
frederick-vs-ja Aug 8, 2024
c4d0517
Add `[[msvc::lifetimebound]]` to more min/max functions (#4838)
statementreply Aug 8, 2024
0f0f3aa
Fix `put_time()` crash on invalid format specifier (#4840)
TheStormN Aug 8, 2024
a537ec5
Don't use `auto` in some ranges algos. (#4841)
fsb4000 Aug 8, 2024
4122957
Fix truncation warnings in `conjunction`/`disjunction` (#4846)
StephanTLavavej Aug 8, 2024
877717a
Verify in vector::pop_back if _CONTAINER_DEBUG_LEVEL > 0 (#4849)
vasama Aug 8, 2024
3bc0f3e
Avoid using wider types in `generate_canonical` when the range of the…
statementreply Aug 8, 2024
3edd71e
Update `README.md` working draft revision to N4986 (#4854)
ofAlpaca Aug 8, 2024
0f8f6be
Fix and improve `array` and `mdspan` static analysis warnings (#4856)
StephanTLavavej Aug 8, 2024
dc1b46c
`README.md`: Add instructions for building ARM and ARM64. (#4859)
fsb4000 Aug 8, 2024
bdcd8ea
Simplify the comparison of sizes of different ranges (#4864)
hewillk Aug 8, 2024
d47747c
Update _MSVC_STL_UPDATE to August 2024 (#4872)
Damien-Chen Aug 8, 2024
b5285d1
Call CRT `wmemcmp`/`wmemchr` when possible in `char_traits` for bette…
mcfi Aug 8, 2024
938bd59
Enforce [alg.three.way]/2 mandate (#4878)
CaseyCarter Aug 8, 2024
6c94f4e
Build with the conformant preprocessor, improve validator (#4886)
StephanTLavavej Aug 12, 2024
0619755
Skip libcxx tests with timing assumptions (#4885)
CaseyCarter Aug 15, 2024
7f0f35d
Toolset update: VS 2022 17.12 Preview 1 (#4889)
StephanTLavavej Aug 15, 2024
041f584
`<execution>`: parallel scans should avoid passing output values to t…
Andor233 Aug 15, 2024
3c75f79
Implement `formatter` specializations for container adaptors (#4825)
frederick-vs-ja Aug 15, 2024
0e98f35
Updated C++ latest working draft to N4988 (#4884)
shaikhmudassir0 Aug 15, 2024
b191409
Overhaul how we search for clang-format (#4888)
StephanTLavavej Aug 15, 2024
c5704d3
Merge branch 'main' into merge-flat_map
StephanTLavavej Aug 15, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 38 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ issue. The [bug tag][] and [enhancement tag][] are being populated.

# Goals

We're implementing the latest C++ Working Draft, currently [N4981][], which will eventually become the next C++
We're implementing the latest C++ Working Draft, currently [N4988][], which will eventually become the next C++
International Standard. The terms Working Draft (WD) and Working Paper (WP) are interchangeable; we often
informally refer to these drafts as "the Standard" while being aware of the difference. (There are other relevant
Standards; for example, supporting `/std:c++14` and `/std:c++17` involves understanding how the C++14 and C++17
Expand Down Expand Up @@ -141,11 +141,15 @@ Just try to follow these rules, so we can spend more time fixing bugs and implem

# How To Build With The Visual Studio IDE

1. Install Visual Studio 2022 17.11 Preview 3 or later.
1. Install Visual Studio 2022 17.12 Preview 1 or later.
* Select "Windows 11 SDK (10.0.22621.0)" in the VS Installer.
* Select "MSVC v143 - VS 2022 C++ ARM64/ARM64EC build tools (Latest)" in the VS Installer
if you would like to build the ARM64/ARM64EC target.
* Select "MSVC v143 - VS 2022 C++ ARM build tools (Latest)" in the VS Installer
if you would like to build the ARM target.
* We recommend selecting "C++ CMake tools for Windows" in the VS Installer.
This will ensure that you're using supported versions of CMake and Ninja.
* Otherwise, install [CMake][] 3.29.0 or later, and [Ninja][] 1.11.0 or later.
* Otherwise, install [CMake][] 3.29.0 or later, and [Ninja][] 1.12.1 or later.
* Make sure [Python][] 3.12 or later is available to CMake.
2. Open Visual Studio, and choose the "Clone or check out code" option. Enter the URL of this repository,
`https://github.com/microsoft/STL`.
Expand All @@ -156,11 +160,15 @@ Just try to follow these rules, so we can spend more time fixing bugs and implem

# How To Build With A Native Tools Command Prompt

1. Install Visual Studio 2022 17.11 Preview 3 or later.
1. Install Visual Studio 2022 17.12 Preview 1 or later.
* Select "Windows 11 SDK (10.0.22621.0)" in the VS Installer.
* Select "MSVC v143 - VS 2022 C++ ARM64/ARM64EC build tools (Latest)" in the VS Installer
if you would like to build the ARM64/ARM64EC target.
* Select "MSVC v143 - VS 2022 C++ ARM build tools (Latest)" in the VS Installer
if you would like to build the ARM target.
* We recommend selecting "C++ CMake tools for Windows" in the VS Installer.
This will ensure that you're using supported versions of CMake and Ninja.
* Otherwise, install [CMake][] 3.29.0 or later, and [Ninja][] 1.11.0 or later.
* Otherwise, install [CMake][] 3.29.0 or later, and [Ninja][] 1.12.1 or later.
* Make sure [Python][] 3.12 or later is available to CMake.
2. Open a command prompt.
3. Change directories to a location where you'd like a clone of this STL repository.
Expand All @@ -180,6 +188,30 @@ To build the x64 target (recommended):
3. `cmake --preset x64`
4. `cmake --build --preset x64`

To build the ARM target:

1. `"C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Auxiliary\Build\vcvarsall.bat" x64_arm`
* If you installed VS to a non-default location, change this path accordingly.
2. Change directories to the previously cloned `STL` directory.
3. `cmake --preset ARM`
4. `cmake --build --preset ARM`

To build the ARM64 target:

1. `"C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Auxiliary\Build\vcvarsall.bat" x64_arm64`
* If you installed VS to a non-default location, change this path accordingly.
2. Change directories to the previously cloned `STL` directory.
3. `cmake --preset ARM64`
4. `cmake --build --preset ARM64`

To build the ARM64EC target:

1. `"C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Auxiliary\Build\vcvarsall.bat" x64_arm64`
* If you installed VS to a non-default location, change this path accordingly.
2. Change directories to the previously cloned `STL` directory.
3. `cmake --preset ARM64EC`
4. `cmake --build --preset ARM64EC`

# How To Consume

Consumption of the built library is largely based on the build system you're using. There are at least 2 directories
Expand Down Expand Up @@ -537,7 +569,7 @@ SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
[LWG issues]: https://cplusplus.github.io/LWG/lwg-toc.html
[LWG tag]: https://github.com/microsoft/STL/issues?q=is%3Aopen+is%3Aissue+label%3ALWG
[Microsoft Open Source Code of Conduct]: https://opensource.microsoft.com/codeofconduct/
[N4981]: https://wg21.link/N4981
[N4988]: https://wg21.link/N4988
[NOTICE.txt]: NOTICE.txt
[Ninja]: https://ninja-build.org
[STL-CI-badge]: https://dev.azure.com/vclibs/STL/_apis/build/status%2FSTL-CI?branchName=main "STL-CI"
Expand Down
2 changes: 1 addition & 1 deletion azure-devops/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

variables:
- name: poolName
value: 'StlBuild-2024-07-09T1614-Pool'
value: 'StlBuild-2024-08-14T0018-Pool'
readonly: true
- name: poolDemands
value: 'EnableSpotVM -equals false'
Expand Down
4 changes: 2 additions & 2 deletions azure-devops/provision-image.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ foreach ($workload in $VisualStudioWorkloads) {
}

# https://github.com/PowerShell/PowerShell/releases/latest
$PowerShellUrl = 'https://github.com/PowerShell/PowerShell/releases/download/v7.4.3/PowerShell-7.4.3-win-x64.msi'
$PowerShellUrl = 'https://github.com/PowerShell/PowerShell/releases/download/v7.4.4/PowerShell-7.4.4-win-x64.msi'
$PowerShellArgs = @('/quiet', '/norestart')

$PythonUrl = 'https://www.python.org/ftp/python/3.12.4/python-3.12.4-amd64.exe'
$PythonUrl = 'https://www.python.org/ftp/python/3.12.5/python-3.12.5-amd64.exe'
$PythonArgs = @('/quiet', 'InstallAllUsers=1', 'PrependPath=1', 'CompileAll=1', 'Include_doc=0')

$CudaUrl = 'https://developer.download.nvidia.com/compute/cuda/12.4.0/local_installers/cuda_12.4.0_551.61_windows.exe'
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ endif()
set(CMAKE_BUILD_TYPE RelWithDebInfo)

# /utf-8 affects <format>.
add_compile_options("$<$<COMPILE_LANGUAGE:CXX>:/diagnostics:caret;/W4;/WX;/w14265;/w15038;/w15262;/utf-8>")
add_compile_options("$<$<COMPILE_LANGUAGE:CXX>:/diagnostics:caret;/W4;/WX;/w14265;/w15038;/w15262;/utf-8;/Zc:preprocessor>")

if(NOT EXISTS "${CMAKE_CURRENT_LIST_DIR}/google-benchmark/.git")
message(FATAL_ERROR "google-benchmark is not checked out; make sure to run\n git submodule update --init benchmarks/google-benchmark")
Expand Down
2 changes: 1 addition & 1 deletion llvm-project
Submodule llvm-project updated 16505 files
4 changes: 2 additions & 2 deletions stl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ add_compile_definitions(_CRTBLD _VCRT_ALLOW_INTERNALS _HAS_OLD_IOSTREAMS_MEMBERS
set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "Embedded")

add_compile_options(/WX /Gy
"$<$<COMPILE_LANGUAGE:CXX>:/diagnostics:caret;/W4;/w14265;/w15038;/fastfail;/guard:cf;/Zp8;/std:c++latest;/permissive-;/Zc:threadSafeInit-;/Zl>"
"$<$<COMPILE_LANGUAGE:CXX>:/diagnostics:caret;/W4;/w14265;/w15038;/fastfail;/guard:cf;/Zp8;/std:c++latest;/permissive-;/Zc:preprocessor;/Zc:threadSafeInit-;/Zl>"
"$<$<COMPILE_LANGUAGE:ASM_MASM>:/W3;/nologo;/quiet>"
)

Expand Down Expand Up @@ -557,7 +557,7 @@ function(add_stl_dlls D_SUFFIX REL_OR_DBG)
generate_satellite_def("atomic_wait" "${D_SUFFIX}")

add_library(msvcp${D_SUFFIX}_atomic_wait SHARED "${CMAKE_BINARY_DIR}/msvcp_atomic_wait${D_SUFFIX}.def")
target_link_libraries(msvcp${D_SUFFIX}_atomic_wait PRIVATE msvcp${D_SUFFIX}_atomic_wait_objects msvcp${D_SUFFIX}_satellite_objects msvcp${D_SUFFIX}_implib_objects "msvcp${D_SUFFIX}" "${TOOLSET_LIB}/vcruntime${D_SUFFIX}.lib" "${TOOLSET_LIB}/msvcrt${D_SUFFIX}.lib" "ucrt${D_SUFFIX}.lib" "advapi32.lib" "synchronization.lib")
target_link_libraries(msvcp${D_SUFFIX}_atomic_wait PRIVATE msvcp${D_SUFFIX}_atomic_wait_objects msvcp${D_SUFFIX}_satellite_objects msvcp${D_SUFFIX}_implib_objects "msvcp${D_SUFFIX}" "${TOOLSET_LIB}/vcruntime${D_SUFFIX}.lib" "${TOOLSET_LIB}/msvcrt${D_SUFFIX}.lib" "ucrt${D_SUFFIX}.lib" "advapi32.lib")
set_target_properties(msvcp${D_SUFFIX}_atomic_wait PROPERTIES ARCHIVE_OUTPUT_NAME "msvcp140_atomic_wait${D_SUFFIX}${VCLIBS_SUFFIX}")
set_target_properties(msvcp${D_SUFFIX}_atomic_wait PROPERTIES ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")
set_target_properties(msvcp${D_SUFFIX}_atomic_wait PROPERTIES OUTPUT_NAME "msvcp140${D_SUFFIX}_atomic_wait${VCLIBS_SUFFIX}")
Expand Down
14 changes: 2 additions & 12 deletions stl/debugger/STL.natvis
Original file line number Diff line number Diff line change
Expand Up @@ -1520,9 +1520,9 @@ SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception


<Type Name="std::move_iterator&lt;*&gt;">
<DisplayString>move_iterator {current}</DisplayString>
<DisplayString>move_iterator {_Current}</DisplayString>
<Expand>
<Item Name="current">current</Item>
<Item Name="[current]">_Current</Item>
</Expand>
</Type>

Expand Down Expand Up @@ -2001,16 +2001,6 @@ SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
</Expand>
</Type>

<Type Name="std::ranges::view_interface&lt;*&gt;">
<DisplayString>{{ size={size()} }}</DisplayString>
<Expand>
<Item Optional="true" Name="empty">empty()</Item>
<Item Optional="true" Name="front">front()</Item>
<Item Optional="true" Name="back">back()</Item>
<Item Optional="true" Name="data">data()</Item>
</Expand>
</Type>

<Type Name="std::ranges::dangling">
<DisplayString>dangling</DisplayString>
</Type>
Expand Down
42 changes: 24 additions & 18 deletions stl/inc/__msvc_string_view.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -220,42 +220,48 @@ struct _WChar_traits : private _Char_traits<_Elem, unsigned short> {
_In_reads_(_Count) const _Elem* const _First2, const size_t _Count) noexcept /* strengthened */ {
// compare [_First1, _First1 + _Count) with [_First2, ...)
#if _HAS_CXX17
if constexpr (is_same_v<_Elem, wchar_t>) {
return __builtin_wmemcmp(_First1, _First2, _Count);
} else {
return _Primary_char_traits::compare(_First1, _First2, _Count);
if (_STD _Is_constant_evaluated()) {
if constexpr (is_same_v<_Elem, wchar_t>) {
return __builtin_wmemcmp(_First1, _First2, _Count);
} else {
return _Primary_char_traits::compare(_First1, _First2, _Count);
}
}
#else // ^^^ _HAS_CXX17 / !_HAS_CXX17 vvv
#endif // _HAS_CXX17

return _CSTD wmemcmp(
reinterpret_cast<const wchar_t*>(_First1), reinterpret_cast<const wchar_t*>(_First2), _Count);
#endif // ^^^ !_HAS_CXX17 ^^^
}

_NODISCARD static _CONSTEXPR17 size_t length(_In_z_ const _Elem* _First) noexcept /* strengthened */ {
// find length of null-terminated sequence
#if _HAS_CXX17
if constexpr (is_same_v<_Elem, wchar_t>) {
return __builtin_wcslen(_First);
} else {
return _Primary_char_traits::length(_First);
if (_STD _Is_constant_evaluated()) {
if constexpr (is_same_v<_Elem, wchar_t>) {
return __builtin_wcslen(_First);
} else {
return _Primary_char_traits::length(_First);
}
}
#else // ^^^ _HAS_CXX17 / !_HAS_CXX17 vvv
#endif // _HAS_CXX17

return _CSTD wcslen(reinterpret_cast<const wchar_t*>(_First));
#endif // ^^^ !_HAS_CXX17 ^^^
}

_NODISCARD static _CONSTEXPR17 const _Elem* find(
_In_reads_(_Count) const _Elem* _First, const size_t _Count, const _Elem& _Ch) noexcept /* strengthened */ {
// look for _Ch in [_First, _First + _Count)
#if _HAS_CXX17
if constexpr (is_same_v<_Elem, wchar_t>) {
return __builtin_wmemchr(_First, _Ch, _Count);
} else {
return _Primary_char_traits::find(_First, _Count, _Ch);
if (_STD _Is_constant_evaluated()) {
if constexpr (is_same_v<_Elem, wchar_t>) {
return __builtin_wmemchr(_First, _Ch, _Count);
} else {
return _Primary_char_traits::find(_First, _Count, _Ch);
}
}
#else // ^^^ _HAS_CXX17 / !_HAS_CXX17 vvv
#endif // _HAS_CXX17

return reinterpret_cast<const _Elem*>(_CSTD wmemchr(reinterpret_cast<const wchar_t*>(_First), _Ch, _Count));
#endif // ^^^ !_HAS_CXX17 ^^^
}

static _CONSTEXPR20 _Elem* assign(
Expand Down
23 changes: 12 additions & 11 deletions stl/inc/algorithm
Original file line number Diff line number Diff line change
Expand Up @@ -933,10 +933,8 @@ namespace ranges {
_NODISCARD _STATIC_CALL_OPERATOR constexpr bool operator()(
_Rng1&& _Range1, _Rng2&& _Range2, _Pr _Pred = {}, _Pj1 _Proj1 = {}, _Pj2 _Proj2 = {}) _CONST_CALL_OPERATOR {
if constexpr (sized_range<_Rng1> && sized_range<_Rng2>) {
using _Size1 = _Make_unsigned_like_t<range_size_t<_Rng1>>;
const auto _Count = static_cast<_Size1>(_RANGES size(_Range1));
using _Size2 = _Make_unsigned_like_t<range_size_t<_Rng2>>;
if (_Count != static_cast<_Size2>(_RANGES size(_Range2))) {
const auto _Count = _RANGES distance(_Range1);
if (_Count != _RANGES distance(_Range2)) {
return false;
}
return _RANGES _Equal_count(_Ubegin(_Range1), _Ubegin(_Range2), _Count, _STD _Pass_fn(_Pred),
Expand Down Expand Up @@ -7781,7 +7779,7 @@ namespace ranges {
void _Rotate_one_right(_It _First, _It _Mid, _It _Last) {
// exchanges the range [_First, _Mid) with [_Mid, _Last)
_STL_INTERNAL_CHECK(_RANGES next(_Mid) == _Last);
auto _Temp = _RANGES iter_move(_Mid);
iter_value_t<_It> _Temp(_RANGES iter_move(_Mid));
_RANGES _Move_backward_common(_First, _STD move(_Mid), _STD move(_Last));
*_First = _STD move(_Temp);
}
Expand All @@ -7790,7 +7788,7 @@ namespace ranges {
void _Rotate_one_left(_It _First, _It _Mid, _It _Last) {
// exchanges the range [_First, _Mid) with [_Mid, _Last)
_STL_INTERNAL_CHECK(_RANGES next(_First) == _Mid);
auto _Temp = _RANGES iter_move(_First);
iter_value_t<_It> _Temp(_RANGES iter_move(_First));
auto _Result = _RANGES _Move_unchecked(_STD move(_Mid), _STD move(_Last), _STD move(_First));
*_Result.out = _STD move(_Temp);
}
Expand Down Expand Up @@ -10286,7 +10284,7 @@ namespace ranges {
}

while (++_UFirst != _ULast) { // process one or two elements
auto _Prev = *_UFirst;
_Vty _Prev(*_UFirst);
if (++_UFirst == _ULast) { // process last element
if (_STD invoke(_Pred, _STD invoke(_Proj, _Prev), _STD invoke(_Proj, _Found.min))) {
_Found.min = _STD move(_Prev);
Expand Down Expand Up @@ -10723,7 +10721,8 @@ namespace ranges {
#endif // _HAS_CXX20

_EXPORT_STD template <class _Ty, class _Pr>
_NODISCARD constexpr const _Ty& clamp(const _Ty& _Val, const _Ty& _Min_val, const _Ty& _Max_val, _Pr _Pred) {
_NODISCARD constexpr const _Ty& clamp(const _Ty& _Val _MSVC_LIFETIMEBOUND, const _Ty& _Min_val _MSVC_LIFETIMEBOUND,
const _Ty& _Max_val _MSVC_LIFETIMEBOUND, _Pr _Pred) {
// returns _Val constrained to [_Min_val, _Max_val]
#if _ITERATOR_DEBUG_LEVEL == 2
if (_DEBUG_LT_PRED(_Pred, _Max_val, _Min_val)) {
Expand All @@ -10750,7 +10749,8 @@ _NODISCARD constexpr const _Ty& clamp(const _Ty& _Val, const _Ty& _Min_val, cons
}

_EXPORT_STD template <class _Ty>
_NODISCARD constexpr const _Ty& clamp(const _Ty& _Val, const _Ty& _Min_val, const _Ty& _Max_val) {
_NODISCARD constexpr const _Ty& clamp(const _Ty& _Val _MSVC_LIFETIMEBOUND, const _Ty& _Min_val _MSVC_LIFETIMEBOUND,
const _Ty& _Max_val _MSVC_LIFETIMEBOUND) {
// returns _Val constrained to [_Min_val, _Max_val]
return _STD clamp(_Val, _Min_val, _Max_val, less{});
}
Expand All @@ -10761,8 +10761,9 @@ namespace ranges {
public:
template <class _Ty, class _Pj = identity,
indirect_strict_weak_order<projected<const _Ty*, _Pj>> _Pr = ranges::less>
_NODISCARD _STATIC_CALL_OPERATOR constexpr const _Ty& operator()(
const _Ty& _Val, const _Ty& _Lo, const _Ty& _Hi, _Pr _Pred = {}, _Pj _Proj = {}) _CONST_CALL_OPERATOR {
_NODISCARD _STATIC_CALL_OPERATOR constexpr const _Ty& operator()(const _Ty& _Val _MSVC_LIFETIMEBOUND,
const _Ty& _Lo _MSVC_LIFETIMEBOUND, const _Ty& _Hi _MSVC_LIFETIMEBOUND, _Pr _Pred = {},
_Pj _Proj = {}) _CONST_CALL_OPERATOR {
_STL_ASSERT(!_STD invoke(_Pred, _STD invoke(_Proj, _Hi), _STD invoke(_Proj, _Lo)),
"The lower bound cannot be greater than the upper bound in a call to std::ranges::clamp "
"(N4950 [alg.clamp]/2).");
Expand Down
6 changes: 3 additions & 3 deletions stl/inc/array
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@ public:
return _Elems + _Size;
}

_NODISCARD constexpr size_type size() const noexcept {
_NODISCARD _Ret_range_(==, _Size) constexpr size_type size() const noexcept {
return _Size;
}

Expand Down Expand Up @@ -528,15 +528,15 @@ public:
return _Elems[_Pos];
}

_NODISCARD _CONSTEXPR17 reference operator[](_In_range_(0, _Size - 1) size_type _Pos) noexcept /* strengthened */ {
_NODISCARD _CONSTEXPR17 reference operator[](_In_range_(<, _Size) size_type _Pos) noexcept /* strengthened */ {
#if _CONTAINER_DEBUG_LEVEL > 0
_STL_VERIFY(_Pos < _Size, "array subscript out of range");
#endif // _CONTAINER_DEBUG_LEVEL > 0

return _Elems[_Pos];
}

_NODISCARD constexpr const_reference operator[](_In_range_(0, _Size - 1) size_type _Pos) const noexcept
_NODISCARD constexpr const_reference operator[](_In_range_(<, _Size) size_type _Pos) const noexcept
/* strengthened */ {
#if _CONTAINER_DEBUG_LEVEL > 0
_STL_VERIFY(_Pos < _Size, "array subscript out of range");
Expand Down
Loading