-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Changelog
Stephan T. Lavavej edited this page Dec 13, 2024
·
2202 revisions
- VC Redist Lockdown
- Expected in VS 2022 17.14 Preview 1
- Expected in VS 2022 17.13 Preview 3
- VS 2022 17.13 Preview 2 - latest preview version with STL changes, see the VS 2022 Preview Release Notes
- VS 2022 17.13 Preview 1
- VS 2022 17.12 - latest production version, see the VS 2022 Release Notes
- VS 2022 17.11
- VS 2022 17.10
- VS 2022 17.9
- VS 2022 17.8
- VS 2022 Changelog
- VS 2019 Changelog
C++20 and C++23 features generally require the /std:c++20
and /std:c++latest
compiler options, respectively.
To reduce the frequency of required reboots when updating VS (and VS Previews), we "lock down" the Visual C++ Redistributable containing the STL's msvcp140.dll
. (Most of the STL is header-only, so most changes are unaffected.) Approximately twice a year, specific VS Previews will be "unlocked", so the VC Redist will contain updated DLLs. VS 2022 17.12 was unlocked.
- Merged LWG issue resolutions:
- LWG-3133 #5157 Modernizing numeric type requirements
-
LWG-3918 #5135 #5170
std::uninitialized_move/_n
and guaranteed copy elision -
LWG-4014 #5132 LWG-3809 changes behavior of some existing
std::subtract_with_carry_engine
code -
LWG-4084 #5151
std::fixed
ignoresstd::uppercase
-
LWG-4112 #5152
has-arrow
should requireoperator->()
to beconst
-qualified -
LWG-4124 #5155 Cannot format
zoned_time
with resolution coarser than seconds -
LWG-4135 #5131 The helper lambda of
std::erase
forlist
should specify return type asbool
- LWG-4140 #5129 Useless default constructors for bit reference types
-
LWG-4169 #5128
std::atomic<T>
's default constructor should be constrained
- Fixed bugs:
- Fixed
system_category().message()
to prefer US English, followed by the system locale, with an ultimate fallback ofFormatMessageA
's behavior fordwLanguageId == 0
. #5104- This is consistent with
generic_category().message()
(which always returns US English in our implementation) and has the best chance of returning something intelligible instead of"unknown error"
or"???"
. - This fixed a regression that was introduced by #2669 in VS 2022 17.3.
- This is consistent with
- Fixed
filesystem::equivalent()
to return correct results when shared folders are involved. #5130 - Fixed
chrono::weekday
's constructor to avoid integer overflow for extreme inputs. #5156 - Fixed
regex
to reject bogus character class ranges likeR"([\d-e])"
. #5158 - Fixed
wregex
to correctly handle negated character class escapes (\D
for non-digits,\S
for non-whitespace,\W
for non-words) when matching against Unicode characters. #5160- This fix is limited to negated character class escapes outside of square-bracket character classes.
- Fixed
push_range()
forstack
,queue
, andpriority_queue
to forward the range toc.append_range()
when possible, exactly as depicted in the Standard. #5168 - Fixed code to call
ranges::begin
andranges::end
exactly as depicted in the Standard:
- Fixed
- Improved performance:
- Enhanced behavior:
-
std::expected
,std::unexpected
, and all STL exception types are now marked[[nodiscard]]
. #5174- This affects all user-defined functions returning these types by value. It also affects any directly constructed temporaries that are immediately discarded.
- Enabled
/ALTERNATENAME
machinery for Clang, slightly improving performance and simplifying test coverage. #5098
-
- Improved debugger visualization:
- Improved test coverage:
- Simplified the test harness by dropping
ctest
. Now we always directly invokestl-lit.py
. #5169
- Simplified the test harness by dropping
- Code cleanups:
- Removed compiler bug workarounds. #5186
- Infrastructure improvements:
- Updated
_MSVC_STL_UPDATE
. #5162
- Fixed bugs:
- Fixed
ranges::copy_n
to properly handle negative values of n (as a no-op) when activating ourmemmove()
optimization. #5046- Also fixed our
memmove()
optimization (used bycopy_n()
,ranges::copy_n
, and more) to avoid emitting compiler warnings with certain iterators.
- Also fixed our
- Fixed
filesystem::directory_entry::refresh
for nonexistent network paths to avoid sporadically failing on Windows 11 24H2. #5077 - Fixed
basic_istream::get()
andbasic_istream::getline()
to never write a null terminator into zero-sized buffers, and to always write a null terminator otherwise. #5073 - Fixed
assign_range()
for sequence containers tostatic_assert
that the container elements are assignable from the range's reference type. #5086 - Fixed compiler errors in various ranges algorithms when used with
views::iota
in certain scenarios. #5091
- Fixed
- Improved performance:
- Added vectorized implementations of:
- Helped the compiler auto-vectorize:
- Updated
array
andvector
's spaceship comparison operators to take advantage of the vectorized implementation oflexicographical_compare_three_way()
. #5078 - Extended the "key extraction" optimization in the unique associative containers (both ordered and unordered) to handle more types. #5050
- Optimized
filesystem::symlink_status()
by avoiding unnecessary Windows API calls. #5071
- Improved throughput:
- Moved
system_clock
,high_resolution_clock
, andchrono_literals
from a commonly-included internal header to<chrono>
. #5105- This has source-breaking impact. If you see compiler errors complaining that it doesn't recognize
chrono
types likesystem_clock
or UDLs like1729ms
, you need to include<chrono>
specifically, instead of assuming that headers like<thread>
will drag it in.
- This has source-breaking impact. If you see compiler errors complaining that it doesn't recognize
- Moved
- Enhanced behavior:
- Improved
optional<T>::swap()
'sstatic_assert
messages whenT
isn't both move constructible and swappable. #5065 - Removed
locale::id
's non-Standard constructor fromsize_t
and implicit conversion operator tosize_t
. #5067- For user-visible headers, at least. They remain dllexported for binary compatibility.
- Silenced CodeQL warnings. #5072
- Improved
mutex
assertions to distinguish "unlock of unowned mutex" from "unlock of mutex not owned by the current thread". #5099
- Improved
- Improved test coverage:
- Increased the consistency of the
swap_ranges()
benchmark by adding allocators to control alignment. #5043 - Updated our LLVM submodule, including new tests. #5038
- Divided the increasingly large test for vectorized algorithms into smaller parts, extracting
mismatch()
,lexicographical_compare()
, andlexicographical_compare_three_way()
into a separate test. #5063
- Increased the consistency of the
- Code cleanups:
- Infrastructure improvements:
- Updated dependencies. #5082
- Updated build compiler to VS 2022 17.13 Preview 1.
- Updated CMake to 3.30 (now required).
- Updated the PR/CI system to Windows Server 2025.
- Updated dependencies. #5082
- Updated
_MSVC_STL_UPDATE
. #5064
- Fixed bugs:
- Improved performance:
- Added vectorized implementations of:
- Improved the vectorized implementations of:
- Helped the compiler auto-vectorize:
-
swap()
andranges::swap
for arrays. #4991
-
-
ranges
algorithms now unwrap output iterators, avoiding unnecessary checking. #5015 #5027 - Optimized
bitset
's streaming operators. #5008 - Optimized the newline-printing overloads
println(FILE*)
,println(ostream&)
, and nullaryprintln()
. #4672
- Improved throughput:
- Improved C++23 throughput of
<queue>
,<stack>
,<stacktrace>
, and<thread>
by not including all of<format>
. #5003
- Improved C++23 throughput of
- Enhanced behavior:
- Improved test coverage:
- When Python
psutil
is installed, the test harness now supports apriority
parameter, defaulting toidle
. #5032
- When Python
- Code cleanups:
- Refactored internal usage of the
tuple-like
andpair-like
concepts. #4983 - Used
if constexpr
to simplifyeldritch horrors from beyond spacetimelocale facets. #5001 - Simplified control flow in
basic_string::find_first_not_of()
/find_last_not_of()
. #5006 - Various cleanups (described in detail in the PRs, not repeated here). #5014
- Refactored the vectorized implementation of
bitset::to_string()
. #5013 - Removed compiler bug workarounds. #5017
- Refactored internal usage of the
- Improved documentation:
- Removed an inaccurate comment in
list
's move assignment operator. #5024
- Removed an inaccurate comment in
- Infrastructure improvements:
- Updated dependencies. #5017
- Updated build compiler to VS 2022 17.12 Preview 3 (now required).
- Updated Python to 3.13.0 (now required).
- Updated dependencies. #5017
- Updated
_MSVC_STL_UPDATE
. #4994
- Merged C++23 features:
- Merged C++23 Defect Reports:
- Fixed bugs:
- Fixed an infinite loop in
deque::shrink_to_fit()
. #4955- This fixed a regression that was introduced by #4091 in VS 2022 17.10.
- Fixed compiler errors when constructing highly unusual
unique_ptr
s (storing fancy pointers) from unspeakably evil relics of the forgotten past. #4922 - Fixed compiler errors when calling
ranges::inplace_merge
with certain combinations of elements, projections, and comparisons. #4927 - Fixed compiler errors in
basic_ispanstream
's constructor andspan
member function takingReadOnlyRange&&
with highly unusual types. #4938 - Fixed compiler errors in the highly unusual scenario of calling
basic_string
andbasic_string_view
'sfind_first_of()
family of member functions for program-defined "unicorn" character types. #4951 - Fixed compiler errors when constructing
optional
from highly unusual types. #4961 - Fixed sequence container emplacement functions (e.g.
vector::emplace_back()
) to avoid emitting "warning C5046: Symbol involving type with internal linkage not defined" for highly unusual types. #4963 #4980- This also fixed ODR violations when mixing C++14 with C++17-and-later translation units calling sequence container emplacement functions for any types.
- Fixed ODR violations when mixing C++17 with C++20-and-later translation units calling
list/forward_list::remove/remove_if/unique()
. #4975 - Fixed compiler errors in
variant
's converting constructor and converting assignment operator for certain types. #4966 - Fixed
bitset
's streaming operatoroperator>>(basic_istream<CharT, Traits>&, bitset<N>&)
to use the stream'sTraits
to compare characters. #4970 - Fixed
basic_string
andlist
's internal constructors to avoid disrupting highly unusual scenarios. #4976
- Fixed an infinite loop in
- Improved performance:
- Improved throughput:
- Improved C++23 throughput by not including all of
<ostream>
(which drags in<format>
) unless the Standard requires it. #4936
- Improved C++23 throughput by not including all of
- Enhanced behavior:
- Changed an internal
pair
constructor to beprivate
. #4979 - Fixed a CodeQL warning by replacing a squirrelly
memcpy()
call in thefilesystem
implementation (that was intentionally performing a read overrun) with two cromulentmemcpy()
calls. #4933 - Silenced CodeQL warnings. #4942 #4985
- Added a visualizer for
system_clock::time_point
. #5005
- Changed an internal
- Improved test coverage:
- Code cleanups:
- Infrastructure improvements:
- Updated dependencies. #4947
- Updated build compiler to VS 2022 17.12 Preview 2.
- Updated Clang to 18.1.8 (now required).
- Updated Python to 3.12.6.
- Updated dependencies. #4947
- Build system improvements:
- Removed a workaround in the benchmark build. #4928
- Updated
_MSVC_STL_UPDATE
. #4926
- Merged C++26 features:
-
P0952R2 #4740 #4850 A New Specification For
generate_canonical()
- P2407R5 #4743 Freestanding Library: Partial Classes
-
P2833R2 #4743 Freestanding Library:
inout
expected
span
-
P2968R2 #4777 Make
std::ignore
A First-Class Object - P2997R1 #4816 Removing The Common Reference Requirement From The Indirectly Invocable Concepts
-
P0952R2 #4740 #4850 A New Specification For
- Merged C++23 features:
- Merged LWG issue resolutions:
-
LWG-3944 #4784 Formatters converting sequences of
char
to sequences ofwchar_t
-
LWG-4061 #4758 Should
std::basic_format_context
be default-constructible/copyable/movable? -
LWG-4074 #4814
compatible-joinable-ranges
is underconstrained -
LWG-4083 #4786
views::as_rvalue
should reject non-input ranges -
LWG-4096 #4785
views::iota(views::iota(0))
should be rejected -
LWG-4098 #4815
views::adjacent<0>
should reject non-forward ranges -
LWG-4106 #4757
basic_format_args
should not be default-constructible
-
LWG-3944 #4784 Formatters converting sequences of
- Merged proposed resolutions for LWG issues (not yet accepted for the C++ Working Draft, but we've chosen to implement this speculatively):
- Fixed bugs:
- Fixed static analysis warning C26818 "Switch statement does not cover all cases. Consider adding a 'default' label (es.79)." #4715
-
Note: The STL has always attempted to be
/W4 /analyze
clean, but does not yet attempt to be clean with respect to all additional static analysis rulesets.
-
Note: The STL has always attempted to be
- Fixed
atomic_ref::is_lock_free()
on x64 to returntrue
for 1, 2, 4, 8, and 16 bytes only. #4729 - Fixed
uniform_real_distribution<RealType>{min, max}
to stay within the inclusive-exclusive range[min, max)
and never generate themax
value exactly. #4740 - Fixed
filesystem::weakly_canonical()
to avoid failing on Windows 11 24H2 in certain scenarios. #4844 - Fixed
condition_variable_any::wait_for()
to consistently usesteady_clock
. #4755 - Removed a broken and useless visualizer for
ranges::view_interface
. #4835 - Fixed the visualizer for
move_iterator
to use the updated name of its internal data member. #4836- This fixed a regression that was introduced by #1080 in VS 2019 16.8.
- Fixed
expected
to conditionally delete its copy constructor and copy assignment operator as depicted in the Standard, which affects overload resolution in unusual scenarios. #4837 - Fixed
time_put
/put_time()
to avoid crashing for: - Fixed compiler errors in
ranges::inplace_merge
andranges::minmax
in unusual scenarios. #4841 - Fixed truncation warnings when:
- Improved
array::size()
and<mdspan>
static analysis annotations, fixing warnings in some scenarios. #4856 - Fixed
lexicographical_compare_three_way()
to enforce the Standard's mandate that the comparison returns a comparison category type. #4878 - Fixed compiler errors in the parallel scan algorithms
inclusive_scan()
,exclusive_scan()
,transform_inclusive_scan()
, andtransform_exclusive_scan()
when the intermediate and output types are different. #4701 - Fixed the vectorized implementation of floating-point
ranges::min
,ranges::max
, andranges::minmax
to return correct results for negative zeros. #4734 - Fixed Clang compiler errors for certain
constexpr
variant
scenarios by adding a compiler bug workaround. #4903 - Fixed compiler errors when using
<random>
machinery (e.g.generate_canonical()
,uniform_real_distribution
) via Standard Library Modules or Standard Library Header Units by adding compiler bug workarounds. #4906 - Fixed compiler errors when using
<format>
machinery in user-defined modules by adding compiler bug workarounds. #4919 - Fixed
<format>
to avoid crashing when formatting floating-point values with large precisions combined with the#
(alternate form) orL
(locale-specific form) options. #4907
- Fixed static analysis warning C26818 "Switch statement does not cover all cases. Consider adding a 'default' label (es.79)." #4715
- Improved performance:
- Overhauled
condition_variable
andcondition_variable_any
, improving their performance and simplifying their implementation. #4720- As a result,
condition_variable
,timed_mutex
, andrecursive_timed_mutex
are now trivially destructible.
- As a result,
- Improved the performance of
search()
,find_end()
, and theirranges
forms by removing calls tomemcmp()
that were surprisingly harmful. #4654 #4753 - Improved the ARM64 performance of
popcount()
by using new compiler intrinsics. #4695 #4733 - Further improved the vectorized implementations of:
- Slightly improved the performance of
ranges::min
,ranges::max
, andranges::minmax
for certain iterator types. #4775 - On x86, the STL is now built with
/arch:SSE2
(which is the default) instead of/arch:IA32
. #4741- See
/arch
(x86) on Microsoft Learn.
- See
- Used Clang builtins to improve the performance of
<cmath>
's floating-point comparison functions for mixed types. #4648 - On x64,
atomic_ref<16 bytes>
now always uses the cmpxchg16b instruction. #4751 - Streaming a small
bitset
to abasic_ostream
now avoids dynamically allocating memory. #4818 - Slightly improved performance for Clang ARM64
<atomic>
. #4870 - Updated
char_traits<wchar_t/char16_t>::compare/find/length
,find
, andranges::find
to callwmemcmp/wmemchr/wcslen
when possible, which will improve performance after a future UCRT header update. #4873 #4894 - Optimized equality comparisons for empty
string
s andstring_view
s. #4904
- Overhauled
- Improved throughput:
- Improved
<queue>
and<stack>
throughput by dragging in fewer headers. #4707
- Improved
- Enhanced behavior:
-
P0608R3 Improving
variant
's Converting Constructor/Assignment is now unconditionally active (i.e. in C++17 mode and above), instead of being restricted to C++20 mode and above. #4713- This C++20 behavioral change was originally implemented by #1629 in VS 2019 16.10. While it can have source-breaking impact, it generally has highly desirable effects.
- Changed the machinery for copying
map
/set
nodes to use scope guards instead ofthrow;
, making debugging easier when exceptions are thrown. #4749 - Added debug checks to
gcd()
andlcm()
for precondition violations. #4776 - Added "lifetimebound" attributes to
min
,max
,clamp
,ranges::min
,ranges::max
, andranges::clamp
, allowing MSVC code analysis and Clang-Wdangling
to detect dangling references in improper usage. #4838 - Updated the precondition check in
vector::pop_back()
to be guarded by_CONTAINER_DEBUG_LEVEL
. #4849 - Renamed the parameters of
views::iota
andviews::repeat
to provide better IDE guidance. #4908 - Simplified internal locale facet machinery to use class-specific
operator new
andoperator delete
overloads in both release and debug mode. #4916
-
P0608R3 Improving
- Improved debugger visualization:
- Improved test coverage:
- Updated LLVM-derived test coverage for
<any>
,<optional>
, and<variant>
. #4713 - Properly tested the resolution of LWG-4053 "Unary call to
std::views::repeat
does not decay the argument". #4748 - Improved the benchmarks for
bitset::to_string()
. #4817 - Updated our LLVM submodule, including new tests. #4862 #4910
- Re-enabled tests that were previously skipped in the
libcxx
test suite. #4721 #4732 #4911 - Skipped tests that were sporadically failing due to incorrect timing assumptions. #4885
- Added compiler bug workarounds. #4895
- Tested the resolution of LWG-4105 "
ranges::ends_with
's Returns misses difference casting". #4897 - Updated tests to work with Clang 19. #4912
- Avoided unnecessary usage of
rand()
, which is considered harmful. #4921
- Updated LLVM-derived test coverage for
- Code cleanups:
- Removed compiler bug workarounds. #4725 #4782 #4889
- Various cleanups (described in detail in the PRs, not repeated here). #4724 #4900 #4920
- Replaced SFINAE with concepts in C++20-and-later code. #4718 #4819
- Removed a significant amount of unused code calling
GetCurrentPackageId
. #4742 - Simplified how
ranges::equal
compares sizes. #4864
- Reverted change:
- Infrastructure improvements:
- Build system improvements:
- Added
/Zc:preprocessor
to build the STL with the conformant preprocessor. #4886 - Improved how CMake searches for the clang-format executable. #4888
- Added
- Updated
_MSVC_STL_UPDATE
. #4706 #4708 #4754 #4872
- Merged C++26 features:
- Merged partial C++23 features:
- Merged LWG issue resolutions:
-
LWG-3767 #4542
codecvt<charN_t, char8_t, mbstate_t>
incorrectly added to locale -
LWG-3919 #4526
enumerate_view
may invoke UB for sized common non-forward underlying ranges -
LWG-3950 #4510
std::basic_string_view
comparison operators are overspecified -
LWG-3984 #4543
ranges::to
's recursion branch may be ill-formed -
LWG-4012 #4529
common_view::begin
/end
are missing thesimple-view
check -
LWG-4013 #4530
lazy_split_view::
outer-iterator
::value_type
should not provide default constructor -
LWG-4016 #4539
container-insertable
checks do not match whatcontainer-inserter
does -
LWG-4035 #4525
single_view
should provideempty
-
LWG-4053 #4685 Unary call to
std::views::repeat
does not decay the argument -
LWG-4054 #4540 Repeating a
repeat_view
should repeat the view
-
LWG-3767 #4542
- Fixed bugs:
- Fixed
condition_variable::wait_until()
andcondition_variable_any::wait_until()
to consistently use the giventime_point
's clock type, instead of also depending on the system clock. This also fixedcondition_variable::wait_for()
to consistently usesteady_clock
. #4457 - Fixed
<format>
to always perform compile-time format string checking forwchar_t
, even when the narrow execution character set doesn't support it. #4459 - Fixed compiler errors when
constexpr basic_string
interacted with the undocumented compiler option/d1initall
. #4474 - Fixed
atomic_ref
for 16-byte objects to correctly reportis_lock_free()
andis_always_lock_free
on x64 (when the optional mode_STD_ATOMIC_ALWAYS_USE_CMPXCHG16B
is defined to be1
) and ARM64 (always). #4478 - Removed the vectorized implementation of
ranges::find
withunreachable_sentinel
as it was fundamentally incompatible with ASan (Address Sanitizer). #4486- This was introduced by #2434 in VS 2022 17.3.
- Fixed incorrect results from the vectorized implementation of
ranges::find_last
for certain combinations of value and element types. #4561- This fixed a regression that was introduced by #3925 in VS 2022 17.9.
- Fixed the STL to avoid emitting the off-by-default warning C4365 (signed/unsigned mismatch) when the
/ZI
compiler option (debug info for Edit and Continue) is used. #4487- These warnings were most noticeable when building the Standard Library Modules, but they were also emitted by classic includes.
- Fixed the STL to avoid emitting the off-by-default warning C5246 (brace elision). #4527
- Fixed compiler errors involving incomplete types in:
-
pair
andtuple
machinery. #4488
-
- Fixed
make_from_tuple()
to properly implement LWG-3528 with a constraint instead of astatic_assert
. #4528 - Added integral overloads for
<cmath>
's classification functionsfpclassify()
,isfinite()
,isinf()
,isnan()
,isnormal()
, andsignbit()
. #4537 - Fixed
is_trivial
to correctly handle unusual types. #4576 - Avoided mentioning
__vectorcall
for ARM64EC, where it is not yet supported. #4600 - Fixed
std.ixx
to include<intrin.h>
in the Global Module Fragment, fixing compiler errors withimport std;
in certain scenarios. #4626 - Fixed compiler errors when a user-defined
formatter
callsbasic_format_parse_context::next_arg_id()
with an empty format-spec. #4640 - Fixed compiler errors when using
<expected>
in/permissive
mode. #4658-
Note: While
/permissive
mode is discouraged, it's currently supported for most STL components.
-
Note: While
- Fixed compiler errors when inheriting
expected
's constructors in certain scenarios. #4664 - Fixed
pair
's self-swap()
behavior to follow the Standard by self-swapping its elements. #4674 - Fixed
atomic<void*>
andatomic_ref<void*>
to providedifference_type
. #4689
- Fixed
- Improved performance:
- Helped the compiler auto-vectorize:
- Added vectorized implementations of:
-
find_first_of()
andranges::find_first_of
. #4466 #4557 #4563 #4587 #4623 -
mismatch()
andranges::mismatch
. #4495 #4538 #4584 -
replace()
andranges::replace
for 32-bit and 64-bit elements. #4554 #4584 -
lexicographical_compare()
,ranges::lexicographical_compare
, andlexicographical_compare_three_way()
. #4552
-
- Further improved the vectorized implementations of:
- Used Clang builtins to improve the performance of
<cmath>
's floating-point classification and comparison functions: #4612- Classification:
isfinite()
,isinf()
,isnan()
,isnormal()
- Comparison:
isgreater()
,isgreaterequal()
,isless()
,islessequal()
,islessgreater()
,isunordered()
- Classification:
- Improved
normal_distribution::operator()(engine, param)
by avoiding unnecessarily recomputing coefficients. #4618
- Improved throughput:
- Slightly improved
<mdspan>
throughput by using short-circuitingconjunction_v
instead of fold expressions. #4559 - Refactored floating-point machinery, improving throughput by reducing inclusion of various headers. #4615
- Improved
<string_view>
throughput by no longer dragging in most of<string>
's contents. #4633
- Slightly improved
- Improved diagnostics:
- Improved compiler error messages when
formatter<UDT>::format()
isn'tconst
. #4461 - Massively improved the compiler error messages for
get<T>(tuple<Types...>)
whenT
doesn't occur exactly once inTypes
. #4578 - Significantly improved compiler error messages when
ranges::to
is unable to construct the requested result. #4608
- Improved compiler error messages when
- Enhanced behavior:
- To reduce risk, the STL no longer attempts to activate vectorized implementations of algorithms for ancient processors that support SSE2 but not SSE4.2. #4550
- This consolidated the STL's levels of vectorization to none, SSE4.2, and AVX2.
- This also slightly improved performance (for non-ancient processors) by taking advantage of newer instructions in codepaths that previously restricted themselves to SSE2.
- Added precondition checking in debug mode to:
- Improved the wording of
[[nodiscard("reason")]]
messages forempty()
. #4572 - Extended C++20's
static_assert(is_clock_v<Clock>)
enforcement for various codepaths to C++14/17 (with internal machinery;is_clock_v
itself remains guarded by C++20 mode). #4585 - Changed the internal constructors of
basic_format_arg::handle
andbasic_format_context
to beprivate
. #4489 - Deprecation warnings for several non-Standard extensions are now emitted in all Standard modes, not just C++17 and later. These extensions will be removed in the future; you have been warned: #4605
-
stdext::checked_array_iterator
,stdext::make_checked_array_iterator()
,stdext::unchecked_array_iterator
, andstdext::make_unchecked_array_iterator()
. -
basic_istream
'sipfx()
/isfx()
andbasic_ostream
'sopfx()
/osfx()
member functions. -
discard_block
,linear_congruential
,mersenne_twister
,subtract_with_carry
,uniform_int
, anduniform_real
.
-
- To reduce risk, the STL no longer attempts to activate vectorized implementations of algorithms for ancient processors that support SSE2 but not SSE4.2. #4550
- Removed non-Standard code:
- Deleted the
<cvt/meow>
subdirectory of headers, shrinking VS installations by 4.8 MB across 78 files. #4458 - Deleted the
<experimental/meow>
headers that providedstd::experimental::erase()/erase_if()
. #4470 - Removed the non-Standard
_FPOSOFF
macro and the non-Standardstd::fpos::seekpos()
member function. #4606 - Removed the non-Standard
lower_bound()
/upper_bound()
member functions from the unordered associative containers. #4607
- Deleted the
- Improved test coverage:
- Added benchmarks for vectorized
swap_ranges()
. #4589 - Added a workaround for an ASan failure in an ancient STL test. #4652
- Reduced the execution time of the vectorized algorithms test by using the result of
mismatch()
when testinglexicographical_compare()
andlexicographical_compare_three_way()
. #4656 - Improved the
<filesystem>
test, including its coverage ofrename()
and how it generates names for temporary files and directories. #4665 - Re-enabled tests that were previously skipped in the
libcxx
test suite. #4698 - Updated our LLVM submodule, including new tests. #4702
- Added benchmarks for vectorized
- Code cleanups:
- Removed compiler bug workarounds. #4475 #4576
- Various cleanups (described in detail in the PRs, not repeated here). #4465 #4490 #4493
- Improved the script for downloading Unicode data files when updating
<format>
. #4469 - Consistently centralized how algorithms invoke their vectorized implementations. #4544
- Simplified how
condition_variable
is implemented as a wrapper around the Windows APICONDITION_VARIABLE
. #4545 - Removed
inline
fromconstexpr
variable templates. #4546- This became possible after all of our supported compilers implemented CWG-2387. Note that for
constexpr
variables, only primary templates and partial specializations no longer need to be marked asinline
; explicit specializations and ordinary non-templates still need to be marked asinline
.
- This became possible after all of our supported compilers implemented CWG-2387. Note that for
- Changed machinery for updating
chrono::tzdb::version
to activate the Named Return Value Optimization. #4577 - Updated tests to use C++17 terse
static_assert
. #4588 - Simplified function templates to use
static_assert(false)
as permitted by CWG-2518. #4591 - Simplified debug checks for comparison function objects by using
if constexpr
. #4610 - Simplified
char_traits::assign()
by removing unnecessary codepaths for constant evaluation. #4613 - Changed checks for damaged logic in the STL itself to use internal
static_assert
macros, which expand to nothing outside of the STL's test suites. #4624 - Simplified
ranges::stable_sort
to useiter_value_t
instead of an internal helper. #4628 - Changed the STL to use
in_range<T>()
more andnumeric_limits<T>::min()
/max()
less. #4634 - Replaced SFINAE with concepts in C++20-and-later code. #4637
- Simplified the vectorized implementation of the
minmax()
family for 64-bit elements. #4661 - Modernized our usage of Google Benchmark. #4662
- Infrastructure improvements:
- Overhauled our Azure Pipelines machinery: #4594 #4687
- Introduced "Early Build" stages to quickly find compiler errors when building the STL.
- Improved the reliability of the submodule checkout task.
- Improved how clang-format diffs are uploaded and logged.
- Updated dependencies. #4475 #4492 #4576 #4568 #4594 #4687
- Updated build compiler to VS 2022 17.11 Preview 1.
- Updated to Windows 11 SDK 22621. This is now required for building and testing the STL, but not for using it.
- Updated CUDA to 12.4.0 (now required).
- Updated Python to 3.12.3.
- Updated Boost.Math to 1.85.0. #4599
- Updated Google Benchmark to 1.8.4. #4694
- Overhauled our Azure Pipelines machinery: #4594 #4687
- Updated
_MSVC_STL_UPDATE
. #4467 #4556 #4655
- Merged C++26 features:
- Merged C++23 Defect Reports:
- Merged partial C++23 features:
- Merged C++20 Defect Reports:
- Merged LWG issue resolutions:
-
LWG-3749 #4190
common_iterator
should handle integer-class difference types -
LWG-3809 #4194 Is
subtract_with_carry_engine<uint16_t>
supposed to work? -
LWG-3897 #4186
inout_ptr
will not update raw pointer to null -
LWG-3946 #4187 The definition of
const_iterator_t
should be reworked -
LWG-3947 #4195 Unexpected constraints on
adjacent_transform_view::base()
-
LWG-3949 #4204
atomic<bool>
's trivial destructor dropped in C++17 spec wording -
LWG-3953 #4167
iter_move
forcommon_iterator
andcounted_iterator
should returndecltype(auto)
-
LWG-3974 #4214
mdspan::operator[]
should not copyOtherIndexTypes
-
LWG-4001 #4193
iota_view
should provideempty
-
LWG-3749 #4190
- Fixed bugs:
- Fixed
mutex
's constructor to beconstexpr
. #3824 #4000 #4339-
Note: Programs that aren't following the documented restrictions on binary compatibility may encounter null dereferences in
mutex
machinery. You must follow this rule:When you mix binaries built by different supported versions of the toolset, the Redistributable version must be at least as new as the latest toolset used by any app component.
- You can define
_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR
as an escape hatch.
-
Note: Programs that aren't following the documented restrictions on binary compatibility may encounter null dereferences in
- Fixed
<format>
's compile-time format string checking: - Fixed how
format()
handles empty strings likeformat("{:a<10}", "")
. #4243 - Fixed
<format>
to properly handle floating-point values in a specific situation. When a format-specifier appears without any precision or type, shortest round-trip formatting should be used instead ofchars_format::general
. #4327- Example format strings:
"{:}"
and"{0:}"
were affected, as they have an optional arg-id (0
) followed by a format-specifier (:
) with an empty format-spec (nothing after the:
). - More common format strings like
"{}"
and"{0}"
were unaffected, as they entirely lack a format-specifier. - Example value: For
12345678.0
, the shortest round-trip rules produce"12345678"
, while thechars_format::general
rules produce"1.2345678e+07"
.
- Example format strings:
- Fixed
<format>
to properly handle locale-specific floating-point formatting with a minimum field width, taking digit separators into account. #4421 - Fixed
format()
to accept%X
and%EX
forchrono::duration
andchrono::hh_mm_ss
. #4250 - Fixed
chrono::duration
formatting to respect dynamically provided widths. #4283 - Fixed crashes and incorrect results in the vectorized implementation of
ranges::find
withunreachable_sentinel
. #4450- This fixed regressions that were introduced by #2434 in VS 2022 17.3.
- Fixed
ranges::to
to properly reject certain invalid uses with compiler errors, instead of trapping compilers in infinite loops of doom. #4142 - Fixed
ranges::to
to accept certain container constructors taking a range followed by more than one argument. #4218 - Fixed compiler errors involving range adaptor closure objects in unusual scenarios. #4211
- Fixed
ranges::ssize
to be conditionallynoexcept
as required by the Standard. #4231 - Fixed
join_view
andjoin_with_view
's iterators to be default constructible. #4264 - Fixed truncation warnings when using
views::repeat
. #4255 - Fixed compiler errors when using
views::zip_transform
with ranges that must be non-const
to be iterated through, such asviews::filter
. #4416 - Fixed compiler errors when using
views::pairwise_transform
andviews::adjacent_transform
via Standard Library Modules. #4420 - Fixed incorrect output from iostreams (like
"i.nf"
) when printing infinity and NaN values withsetprecision(0) << showpoint << fixed
. #4212 - Fixed problems involving unusual allocators with size types other than
size_t
: - Fixed
<atomic>
correctness issues for ARM64 CHPE (_M_HYBRID_X86_ARM64
). #4222 - Fixed
atomic
by addingatomic& operator=(const atomic&) volatile = delete;
as required by the Standard. #4287 - Fixed
atomic<shared_ptr>::wait()
andatomic<weak_ptr>::wait()
to properly detect equivalent smart pointers. #3655 - Fixed sign-compare warnings in
<mdspan>
when usingextents
with different index types. #4227 - Fixed compiler errors in
<mdspan>
when constructing unusual mappings. #4236 - Fixed bugs specific to extremely unusual fancy pointers:
- Fixed compiler errors when constructing
locale{nullptr}
. #4245- Rejoice, for now you can get a guaranteed
runtime_error
!
- Rejoice, for now you can get a guaranteed
- Fixed compiler errors when overloading
next()
,prev()
,shift_left()
, andshift_right()
with concept-constrained functions that should be preferred during overload resolution. #4249 - Fixed compiler errors when comparing a
sub_match
with the spaceship operator<=>
to abasic_string
with a custom traits and/or allocator type. #4253 - Fixed sequence container constructors to avoid interfering with CTAD (class template argument deduction) for
(Iter, Iter, BadAlloc)
; now this will SFINAE away instead of emitting a hard compiler error. #4254 - Fixed compiler errors in parallel
transform_reduce()
when performing narrowing conversions. #4260- As usual, asking the STL to perform conversions on your behalf may emit sign/truncation compiler warnings; this is by design.
- Fixed compiler errors during
constexpr
evaluation ofvector<bool>
caused by improper casting in iterator debugging machinery. #4276 - Fixed compiler errors (by adding a compiler bug workaround) when using
constexpr
invoke()
to call pointers to data members withreference_wrapper
arguments. #4277 - Added macroization defenses for the STL's non-Standard extensions (e.g.
type_info
'sraw_name
member function). #4285 - Fixed floating-point
to_chars()
on ARM64 to return correct results. #4304 - Fixed compiler errors when defining variadic alias templates for
is_nothrow_convertible
. #4318 - Fixed
filesystem::is_empty()
andfilesystem::directory_iterator
to handle empty volumes (before they've been assigned a drive letter). #4311 - Fixed compiler errors in algorithms involving highly unusual types. #4233 #4419
- Fixed
basic_stringbuf
to avoid implementing moving with swapping, which is a correctness issue for unusual custom allocators. #4239 - Fixed
deque::shrink_to_fit()
to follow the Standard instead of unconditionally moving elements. #4091 - Fixed
allocate_shared_for_overwrite()
to directly destroy objects, instead of usingAlloc::destroy()
. #4274 - Removed
ios_base::hexfloat
, a non-Standard bitmask element. #4345- The Standard ways to request hexadecimal floating-point output are to use the
ios_base::fixed | ios_base::scientific
bitmask elements together or to use thestd::hexfloat
manipulator.
- The Standard ways to request hexadecimal floating-point output are to use the
- Fixed
std.ixx
to export VCRuntime machinery with Standard-conforming techniques. #4375- This affects things like
std::exception
,std::type_info
, and::operator new
. The MSVC compiler currently doesn't enforce the rule in question here, but stricter tools might notice this.
- This affects things like
- Fixed
basic_ostream::operator<<(basic_streambuf*)
to rethrow caught exceptions only whenfailbit
is set inexceptions()
. #4372 - Fixed
unordered_map
andunordered_set
's equality operators to test elements for equality (via theiroperator==
), not just equivalence (via the container's predicate for keys). #4406-
unordered_multimap
andunordered_multiset
already behaved correctly.
-
- Silenced "warning C4324: structure was padded due to alignment specifier" in all STL headers. #4426
- This was spuriously emitted by certain combinations of code, e.g.
views::cartesian_product
withviews::filter
.
- This was spuriously emitted by certain combinations of code, e.g.
- Fixed
time_get::date_order()
to correctly returntime_base::mdy
for the "C" locale, instead of picking up the date order for the current user locale. #4437 - Fixed
seed_seq::generate(RanIt, RanIt)
tostatic_assert
that the iterator's value type is at least a 32-bit unsigned integer type. #4447 - Fixed compiler errors involving incomplete types in:
- Non-modifying algorithms. #4138
-
erase()
,erase_if()
,remove()
,remove_if()
. #4217 - [alg.min.max], [alg.clamp], [alg.lex.comparison], [alg.three.way] algorithms. #4216
-
atomic
andatomic_ref
. #4221 - Modifying algorithms. #4256
- Container operations taking iterator pairs. #4258
-
is_nothrow_convertible
. #4318 - Comparison operators. #4334
- Merge algorithms, set operations, heap operations, and permutation generators. #4347
- Sorting and related algorithms. #4367
-
vector
's destructor and other member functions. #4373 - Uninitialized memory algorithms. #4374
-
default_searcher
. #4379 -
<ranges>
views. #4389 - Numeric algorithms. #4391
-
ranges::advance
,ranges::distance
,span
constructors, andcondition_variable::wait_for
. #4402 -
shared_ptr
creation functions andatomic
smart pointers. #4403 -
function
,move_only_function
,packaged_task
,promise
, andoptional
. #4430
- Fixed
- Improved performance:
- Improved
<atomic>
performance: #4222- For ARM64, significantly improved the performance of
atomic<T>::load()
(taking no arguments, requesting sequential consistency), matching how #3399 in VS 2022 17.6 improvedatomic<T>::load(memory_order_seq_cst)
. - For ARM64 CHPE (
_M_HYBRID_X86_ARM64
),atomic<T>
'sexchange
/compare_exchange_MEOW
/fetch_MEOW
now respectmemory_order
arguments instead of always providing sequential consistency. Also, ARM64 CHPE now benefits from all of #3399's major improvements.
- For ARM64, significantly improved the performance of
- Improved
atomic::wait
family performance by internally usingmemory_order_acq_rel
instead ofmemory_order_seq_cst
when initializing OS support functions. #4288 - Slightly improved the codegen for
uniform_int_distribution
. #4234 - Optimized
filesystem::path
'soperator/
to perform a single memory allocation for common cases. #4136 - Slightly improved performance by taking advantage of P1169R4
static operator()
in the STL's stateless function objects and lambdas. #4358- This is conditional on compiler feature availability (currently implemented by Clang), but not on Standard mode. Like C++17
if constexpr
and C++20explicit(bool)
, compilers will support C++23static operator()
in earlier Standard modes (emitting warnings that Future Technology is being used, which the STL internally suppresses).
- This is conditional on compiler feature availability (currently implemented by Clang), but not on Standard mode. Like C++17
- Added a vectorized implementation of
bitset::to_string()
. #3960 #4382 #4422 - Improved the vectorized implementations of
min_element()
,max_element()
,minmax_element()
, and related algorithms: - Improved the vectorized implementations of
ranges::min
,ranges::max
,ranges::minmax
, and themin()
,max()
, andminmax()
overloads forinitializer_list
. #4384- These algorithms only need to track values, not locations.
- Changed the destructors of
mutex
andrecursive_mutex
to be trivial. #4390- This especially benefits variables with static storage duration, as they no longer need "dynamic
atexit
destructors".
- This especially benefits variables with static storage duration, as they no longer need "dynamic
- Slightly improved performance by replacing
CRITICAL_SECTION
withSRWLOCK
in:
- Improved
- Enhanced behavior:
- Wrapped the STL in
extern "C++"
as a temporary workaround to allow#include <meow>
to coexist withimport std;
in the same translation unit, in that order. #4154- The other order,
import std;
before#include <meow>
, will still cause compiler errors. We're working on a long-term solution.
- The other order,
- The C++17 Standard added
invoke()
and the C++20 Standard made itconstexpr
. Previously, MSVC made non-constexpr
invoke()
unconditionally available, andconstexpr
invoke()
available in C++17 mode, as minor extensions. Now,constexpr
invoke()
is unconditionally available. #4080 - Improved
shared_ptr
constructor constraints to avoid forming invalid types. #4290 - Updated
<charconv>
to use the__umulh
intrinsic for ARM64 CHPE (_M_HYBRID_X86_ARM64
). #4330 - Improved
expected
's copy/move assignment operators to be trivial when possible, like howoptional
andvariant
already behave. #4271 - Improved
<random>
's TR1 legacy code: #4284- Deprecated the non-Standard engines (
discard_block
,linear_congruential
,mersenne_twister
,subtract_with_carry
) and distributions (uniform_int
,uniform_real
) that are still provided in thestd
namespace. - Removed non-Standard machinery from Standard engines and distributions. (For example, certain
static constexpr
data members inmersenne_twister_engine
and an extra function call operator overload inuniform_int_distribution
.)
- Deprecated the non-Standard engines (
- Changed
basic_regex
's constructor to throw an exception instead of stack overflowing when the pattern contains an excessive number of capture groups. #4451- Currently, this arbitrarily limits the number of capture groups to 1000.
- Wrapped the STL in
- Improved test coverage:
- Updated the STL-ASan-CI pipeline. #4240 #4295
- Added support for building the STL's separately compiled code with ASan instrumentation and enabled this in the STL-ASan-CI pipeline. #4313
- Updated our LLVM submodule, including new tests. #4263 #4267 #4270 #4272 #4328 #4336 #4348 #4355
- Minor test improvements, including printing exit codes in both decimal and hex. #4309
- Improved output for "unresolved" test failures. #4323
- Fixed sporadic "unresolved" test failures. #4366
- Updated CTest to avoid running 2N tests in parallel, where N is the number of cores available. #4335
- Enabled
__cpp_lib_concepts
for our command-line test coverage of the EDG compiler front-end. #4296 #4297 #4440-
__cpp_lib_concepts
was already enabled for EDG-powered IntelliSense in the VS IDE, so this change isn't directly observable by users, it'll just help the STL work better with IntelliSense in the future.
-
- Enabled compiler warnings when building the STL's benchmarks. #4356
- Added benchmarks for vectorized
ranges::find
andranges::count
. #4387- This also covers classic
find()
andcount()
, which share the same vectorized implementation.
- This also covers classic
- Fixed the test harness to handle paths case-insensitively. #4395
- Updated tests to work with Clang 18. #4452
- Enabled more test coverage for the off-by-default warning C4668 "
'MEOW'
is not defined as a preprocessor macro, replacing with'0'
for'#if/#elif'
". #4441
- Code cleanups:
- Various cleanups (described in detail in the PRs, not repeated here). #4143 #4145 #4146 #4147 #4149 #4151 #4192 #4229 #4230 #4362 #4439 #4442 #4443 #4444 #4445
- Removed unnecessary
typename
keywords in C++20 mode and later. #4191 - Removed compiler bug workarounds. #4197 #4259 #4340 #4392
- Removed an enormous amount of code that was dealing with
__cpp_lib_concepts
missing in C++20 mode. #4298 #4364- Now, the STL's product and test code assumes that concepts are always available in C++20 mode, with targeted workarounds for reported compiler bugs.
- Unified our internal stringizing macros. #4405
- Added top-level
const
to function parameters in the vectorized implementations of algorithms. #4410 - Added a script to download Unicode data files when updating
<format>
. #4435 - Simplified how we handle Unicode field widths when updating
<format>
. Now we use a single script to process all Unicode data files, emitting tables into a single generated header. #4446 - Used
if constexpr
to simplify helper functions for allocating and deallocating memory. #4432
- Infrastructure improvements:
- Updated
_MSVC_STL_UPDATE
. #4213 #4226 #4293 #4361
- Merged C++23 features:
-
P0009R18 #3972 #4037
<mdspan>
-
P1169R4 #4053
static operator()
- This updates CTAD (class template argument deduction) for
std::function
andpackaged_task
to work with a C++23 Core Language feature, currently supported for Clang only. When MSVC and IntelliSense implement this Core feature, this will automatically "light up" the STL's CTAD for them too.
- This updates CTAD (class template argument deduction) for
-
P0009R18 #3972 #4037
- Merged partial C++23 features:
- Merged LWG issue resolutions:
- Fixed bugs:
- Fixed incorrect results from iostreams floating-point parsing (e.g.
"1e-07"
was incorrectly parsed as1e-06
). #3982- This fixed a regression that was introduced by #3364 in VS 2022 17.7.
- We backported this fix to VS 2022 17.8.
- Fixed compiler errors when using
expected
together withany
. #4013 - Fixed incorrect behavior when self-move-assigning
any
, and fixed compiler errors inany
involving incomplete types. #3965 - Fixed bugs in
basic_string
's copy assignment operator, specific to non-equalpropagate_on_container_copy_assignment
allocators, involving ASan annotations or fancy pointers. #4031 - Fixed
get()
and comparison operators to handle program-defined specializations ofarray
. #4041 - Fixed compiler errors in
to_array()
involving incomplete types. #4042 - Fixed linker errors involving
stl_asan.lib
by disabling ASan annotations in the STL for unsupported platforms (e.g. ARM, ARM64, ARM64EC). #4058 - Fixed
not_fn()
to return a perfect forwarding call wrapper in C++20 mode as required by P0356R5. #4057 - Fixed
deque
to preserve its internal invariants when taking advantage of allocators that provideallocate_at_least()
. #4017 - Fixed
deque
emplace()
andinsert()
to not require elements to be swappable; this change also improved performance. #4022 - Fixed
deque
to handle highly unusual fancy pointers. #4049 - Fixed
deque::shrink_to_fit()
to avoid requiring the allocator to be default constructible. #4071 - Fixed
allocate_shared()
for unbounded arrays to handle fancy pointers. #4074 - Fixed the implementation of P0408R7 Efficient Access To
basic_stringbuf
's Buffer to properly destroy fancy pointers. #4047 - Fixed
this_thread::sleep_until()
to consistently use the giventime_point
's clock type, instead of also depending on the system clock. This also fixedthis_thread::sleep_for()
to consistently usesteady_clock
. #3914 - Fixed minor conformance issues in
<random>
: #4120- Removed non-Standard
base_type
typedefs fromdiscard_block_engine
,independent_bits_engine
, andshuffle_order_engine
. - Fixed
discard_block_engine(Engine&&)
to move-construct the base engine instead of copying it.
- Removed non-Standard
- Fixed incorrect results from iostreams floating-point parsing (e.g.
- Improved performance:
- Optimized the
copy()
,copy_n()
, andmove()
algorithms forvector<bool>
iterators, with speedups varying from 1.8x (times, not percent) to an incredible 3200x, depending on the size and alignment of the bits being copied. #3353 #4045 - Optimized
priority_queue::push_range()
for small ranges. #4025 - Improved debug codegen for
deque
by using unchecked iterators internally. #4071 - Optimized
basic_string
's range constructors to usememmove()
for contiguous ranges when possible. #4073 - Added a vectorized implementation of
ranges::find_last
. #3925
- Optimized the
- Enhanced behavior:
- Added debug checks to
<valarray>
binary operations, verifying that the operands have the same size. #3911 - Deprecated
basic_istream
'sipfx()
/isfx()
andbasic_ostream
'sopfx()
/osfx()
member functions as they're non-Standard extensions. #4006 - Added compiler bug workarounds for the upcoming Clang 17 release. #4014
- Improved the STL's error messages so that error logs will record specific
static_assert
s like "error STL1000: Unexpected compiler version, expected Clang 16.0.0 or newer." instead of just "Error in C++ Standard Library usage." #4020 - Silenced
/Wall
warnings:- When building the Standard Library Modules. #4026
- Warning C4868 "compiler may not enforce left-to-right evaluation order in braced initializer list" throughout the STL. #4067
-
Note:
/Wall
is not intended for regular production use, as it contains a large number of extremely noisy and low-value warnings. In general, the STL does not attempt to be/Wall
clean.
- Changed
num_get::do_get()
to tolerate 80-bitlong double
by removing astatic_assert
that was added in 2018. #4032-
Note: 80-bit
long double
remains unsupported by MSVC.
-
Note: 80-bit
- Improved
source_location::function_name()
: #4055- It will return detailed information for Clang 17.
- Added an "escape hatch" for all compilers: define
_USE_DETAILED_FUNCTION_NAME_IN_SOURCE_LOCATION
to0
. - For example, given
template <typename T> void cats()
called withcats<vector<int>>()
, MSVC's detailed info (implemented in VS 2022 17.6) is"void __cdecl cats<class std::vector<int,class std::allocator<int> >>(void)"
. Clang 17's detailed info is"void __cdecl cats(void) [T = std::vector<int>]"
. The escape hatch will return the basic info"cats"
.
- Changed the
ranges
algorithms to be ordinary function objects. #4098- For example, this allows code like
views::transform(ranges::distance)
to compile.
- For example, this allows code like
- Marked internal
extern "C"
functions asnoexcept
. #4106 #4150- This improves codegen for
/EHs
(versus/EHsc
, whereextern "C"
already impliesnoexcept
).
- This improves codegen for
- Added debug checks to
- Improved test coverage:
- Added an STL-ASan-CI pipeline. #3987 #3989 #4029 #4052 #4068 #4069 #4075
- The test harness now cleans up emitted files as it runs. #4086
- Simplified the feature-test macro test. #4103
- Enabled test coverage for
basic_string
's ASan annotations when exception handling interacts with the Small String Optimization. #4118
- Code cleanups:
- Removed unused code. #3964 #4005
- Removed compiler bug workarounds. #4012 #4028 #4039 #4083
- Various cleanups (described in detail in the PRs, not repeated here). #3940 #3973 #3974 #3984 #4015 #4016 #4036 #4087 #4111 #4113 #4117 #4119 #4121 #4122 #4123 #4124 #4125
- Ported a
<format>
table generator script from C++ to Python. #3994 - Improved how
<format>
uses the compiler macro_MSVC_EXECUTION_CHARACTER_SET
. #4076
- Improved documentation:
- Improved the consistency of preprocessor comments. #3950
- Infrastructure improvements:
- Updated
_MSVC_STL_UPDATE
. #4003 #4062
- Merged C++26 features:
- Merged C++23 features:
- Merged C++20 extension:
- The C++23 named modules
std
andstd.compat
are now available when compiling in C++20 mode. #3977- This extension should eventually be portable to the major Standard Library implementations via an informal agreement between implementers.
- Build systems - including the Visual Studio IDE - will need changes to support
import std
in C++20. This change makes it possible for them to do so.
- The C++23 named modules
- Merged LWG issue resolutions:
-
LWG-3631 #3745
basic_format_arg(T&&)
should useremove_cvref_t<T>
throughout -
LWG-3843 #3737
std::expected<T, E>::value() &
assumesE
is copy constructible -
LWG-3893 #3782 LWG-3661 broke
atomic<shared_ptr<T>> a; a = nullptr;
-
LWG-3904 #3781
lazy_split_view::
outer-iterator
'sconst
-converting constructor isn't settingtrailing_empty_
-
LWG-3631 #3745
- Fixed bugs:
- Fixed the
deque(size_type)
constructor to properly destroy elements when constructing one of them throws an exception. #3720 - Removed a non-Standard operator
basic_istream >> setfill(c)
. #3725 - Fixed linker errors when linking x64 object files into ARM64EC programs. #3732
- We backported this fix to VS 2022 17.6.6 and VS 2022 17.7.
- Fixed the debug mode check in
cartesian_product_view::size()
to always accept empty views. #3733 - Fixed
formatter<char, wchar_t>
to format thechar
as a character instead of an integer. #3723 - The STL now avoids dragging in the non-reserved name
ISA_AVAILABILITY
. #3721 - Fixed
chrono::hh_mm_ss
formatting to accept values of 24 hours or more. #3727 - Changed the STL's usage of compiler-specific custom attributes to further defend against macros. #3760
- Fixed
condition_variable_any::wait_until()
to handletime_point
s with unsigned representations instead of waiting forever. #3761 - Fixed
counting_semaphore
to add compile-time enforcement of the Standard's mandates. #3747 - Fixed a bug, affecting UWP apps only, where locking a
mutex
could throw a bogus exception. #3763 - Fixed the signatures of
char_traits
member functions to exactly match the Standard. #3739- This Standardese was updated by N2349 in C++11.
- Fixed compiler errors when
visit_format_arg()
is called with highly unusual visitors. #3787 - Fixed incorrect output when
format()
is asked to format a floating-point value in the alternate form without a type specifier. #3815 - Added a compiler bug workaround for MSVC modules, allowing
<format>
machinery to work with/utf-8
viaimport std;
. #3816 - Fixed a subtle bug affecting
constexpr basic_string
's copy assignment operator, where it wasn't starting element lifetimes for the unused capacity. #3712 #3819 - Fixed Clang compiler errors when calling
function::target<FunctionType>()
onconst function
objects. #3844- This is an obscure corner case, because such calls are guaranteed to return null.
- Fixed compiler errors when using
array<T, 0>
inconstexpr
contexts. #3863 - Improved function call operator overload resolution for the
bind()
,bind_front()
, andbind_back()
function objects. #3775 - Fixed iostreams with imbued locales to print infinities and NaNs correctly. #3868 #3877
- Fixed incorrect
noexcept
s within the implementations offilesystem::current_path()
,filesystem::current_path(error_code&)
,read_symlink(const path&)
, andread_symlink(const path&, error_code&)
. #3869 #3881 - Fixed
shared_ptr<void>
to not be constructible fromvoid*
. #3873 - Fixed a complicated modules scenario by removing
#pragma once
from all STL headers. #3895-
#pragma once
is no longer needed to improve throughput because modern compilers automatically detect the idempotency guard idiom.
-
- Fixed
<stacktrace>
's internal use ofsnprintf()
in extreme situations. #3916 - Fixed an extremely obscure runtime correctness bug in
basic_string
's copy assignment operator, specific to non-equalpropagate_on_container_copy_assignment
allocators. #3862 - Fixed ASan annotations in
basic_string::replace()
. #3884 - Fixed ASan annotations in
basic_string::assign()
andbasic_string::resize_and_overwrite()
. #3956
- Fixed the
- Improved performance:
- Changed some helper member functions to be
static
, slightly improving debug codegen. #3755 -
mutex
andcondition_variable
now avoid virtual function calls within their implementations. #3770 - Optimized
steady_clock::now()
whenQueryPerformanceFrequency()
is exactly 24 MHz, which is very common for ARM64. #3832 - Optimized
filesystem::path::lexically_normal()
. #3850 -
basic_string
,basic_stringbuf
,basic_syncbuf
,deque
, andvector
now take advantage of allocators that provideallocate_at_least()
. #3864 #3891 - Optimized
<format>
slightly. #3826 - Optimized
bitset::to_string()
. #3838 #3904 - Added an attribute to
as_const()
,to_integer()
, andto_underlying()
that allows the MSVC compiler to intrinsically implement them without emitting function calls. #3664 - Made a tiny tweak to
valarray
(access the stored size directly instead of via callingsize()
) to improve debug codegen. #3968
- Changed some helper member functions to be
- Improved throughput:
- Moved machinery: #3719
- Moved
integer_sequence
,make_integer_sequence
,index_sequence
,make_index_sequence
, andindex_sequence_for
from<type_traits>
to<utility>
, which is where the Standard provides them. - Moved
allocator_arg
,allocator_arg_t
,uses_allocator
, anduses_allocator_v
so that they're dragged in by slightly fewer headers. (The Standard provides them in<memory>
.)
- Moved
- Some headers now avoid including
<limits>
. #3777 - In C++17 mode and later, improved Clang throughput for an internal helper wrapping
is_same_v
. #3933
- Moved machinery: #3719
- Enhanced behavior:
- Added precondition checking in debug mode to the
iota_view(value)
constructor. #3731 - Improved precondition checking in debug mode for
barrier
. #3757 - Fixed static analysis warnings. #3734 #3743
-
Note: The STL has always attempted to be
/W4 /analyze
clean, but does not yet attempt to be clean with respect to all additional static analysis rulesets.
-
Note: The STL has always attempted to be
- Strengthened the exception specifications for:
- Internal
<ranges>
machinery used injoin_view
iterators andlazy_split_view
. #3762 -
basic_string_view::compare(const charT*)
. #3738 - Constructors of
locale::facet
and related base classes. #3855 - Many functions in
<complex>
. #3880 - Many functions in
<random>
, some functions in<valarray>
, and 3-arghypot()
in<cmath>
. #3887
- Internal
- The STL now avoids conflicting with non-Standard macros of reserved names that were defined by old versions of the ICU library. #3776
- Updated
stdext::checked_array_iterator
andstdext::unchecked_array_iterator
: #3818- Added
const
ness conversions. - Deprecated these iterators, which have been superseded by
std::span
andgsl::span
.
- Added
- Added "lifetimebound" attributes to
minmax
andranges::minmax
, allowing MSVC code analysis and Clang-Wdangling
to detect dangling references in improper usage. #3831 - Improved how
views::cartesian_product
detects ranges with maximum sizes that are known at compile time. #3839 - Improved how parallel algorithms perform compile-time iterator type checking. #3899
- The STL now calls
abort()
instead ofterminate()
for unrecoverable conditions, when the Standard doesn't requireterminate()
to be called. #3906 #3909 - Improved the visualizer for
vector<char>
and the other character types. #3772 - Improved the visualizer for
mutex
andrecursive_mutex
. #3848 - Updated
chrono::duration_cast()
to useif constexpr
, improving debug codegen. #3958
- Added precondition checking in debug mode to the
- Improved test coverage:
- Added properly functioning test coverage for
ranges::owning_view
. #3753 - Added test coverage for calling
tellg()
while reading an LF file in text mode. #3773 #3841 - Added test coverage for LWG-2295 Locale name when the provided
Facet
is anullptr
. #3823 - Added test coverage for LWG-2682
filesystem::copy()
won't create a symlink to a directory. #3827 - Updated tests to use lvalue references for the LHS of
is_assignable_v
andis_nothrow_assignable_v
. #3898 - Added more tests for
views::as_const
,views::stride
, andviews::zip
. #3920 - Test code now consistently uses
override
to avoid mistakes, following the same convention as product code. #3934 - Fixed precondition violations in
is_permutation()
tests. #3967 - Fixed precondition violations in
regex_iterator
andregex_token_iterator
tests. #3990
- Added properly functioning test coverage for
- Code cleanups:
- Removed compiler bug workarounds. #3722 #3769 #3866 #3939
- Improved SFINAE to follow modern conventions. #3736
- Various cleanups (described in detail in the PRs, not repeated here). #3758 #3759 #3765 #3768 #3912 #3927 #3935
- Removed comments that were citing proposed resolutions for LWG issues, now that those issues have been officially resolved by the June 2023 meeting. #3784 #3785
- Marked internal machinery as
[[noreturn]]
. #3865 #3882 - Removed unnecessary
typename
keywords in C++20 mode and later. #3892 #3893 #3894 - Improved type safety by using an
enum class
for internal machinery within<condition_variable>
,<mutex>
, and<thread>
. #3897 - Improved the consistency of code that should never be called. #3905
- Removed unused code. #3936
- Improved the clarity and maintainability of
basic_string
's implementation. #3862 - Deprecated the non-standard
<cvt/meow>
headers and their provided character encoding conversion machinery. #3924- Users should prefer to call
MultiByteToWideChar()
andWideCharToMultiByte()
.
- Users should prefer to call
- Improved documentation:
- Infrastructure improvements:
- Build system improvements:
- Updated
_MSVC_STL_UPDATE
. #3742 #3851 #3918