-
Notifications
You must be signed in to change notification settings - Fork 1.6k
VS 2022 Changelog
Stephan T. Lavavej edited this page Nov 11, 2025
·
8 revisions
For newer releases, see the current Changelog.
- VS 2022 17.14 - see the VS 2022 Release History
- VS 2022 17.13
- VS 2022 17.12
- VS 2022 17.11
- VS 2022 17.10
- VS 2022 17.9
- VS 2022 17.8
- VS 2022 17.7
- VS 2022 17.6
- VS 2022 17.5
- VS 2022 17.4
- VS 2022 17.3
- VS 2022 17.2
- VS 2022 17.1
- VS 2022 17.0
C++20 and C++23 features generally require the /std:c++20 and /std:c++latest compiler options, respectively.
- Merged C++26 features:
- Merged partial C++26 features:
-
P3471R4 #5274 Standard Library Hardening
- Currently disabled by default.
- This can be enabled (for any Standard mode) by defining
_MSVC_STL_HARDENINGto1project-wide. - As C++26 Contracts are not yet implemented, this defaults to calling
__fastfail()for hardened precondition violations.
-
P3471R4 #5274 Standard Library Hardening
- Related behavior enhancement:
- Implemented "destructor tombstones" to mitigate use-after-free mistakes. #5318
- Currently disabled by default.
- This can be enabled by defining
_MSVC_STL_DESTRUCTOR_TOMBSTONESto1project-wide.
- Implemented "destructor tombstones" to mitigate use-after-free mistakes. #5318
- Merged LWG issue resolutions:
- LWG-3133 #5157 Modernizing numeric type requirements
-
LWG-3886 #5232 Monad mo' problems (in
optionalandexpected) -
LWG-3899 #5303
co_yielding elements of an lvaluegeneratoris unnecessarily inefficient -
LWG-3900 #5150 The
allocator_arg_toverloads ofgenerator::promise_type::operator newshould not be constrained -
LWG-3918 #5135 #5170
std::uninitialized_move/_nand guaranteed copy elision -
LWG-3956 #5334
chrono::parseusesfrom_streamas a customization point -
LWG-4014 #5132 LWG-3809 changes behavior of some existing
std::subtract_with_carry_enginecode -
LWG-4027 #5221
possibly-const-rangeshould prefer returningconst R& -
LWG-4084 #5151
std::fixedignoresstd::uppercase -
LWG-4112 #5152
has-arrowshould requireoperator->()to beconst-qualified -
LWG-4119 #5220
generator::promise_type::yield_value(ranges::elements_of<R, Alloc>)'s nestedgeneratormay be ill-formed -
LWG-4124 #5155 Cannot format
zoned_timewith resolution coarser than seconds -
LWG-4135 #5131 The helper lambda of
std::eraseforlistshould specify return type asbool - LWG-4140 #5129 Useless default constructors for bit reference types
-
LWG-4144 #5201 Disallow
unique_ptr<T&, D> -
LWG-4169 #5128
std::atomic<T>'s default constructor should be constrained -
LWG-4172 #5337
unique_lockself-move-assignment is broken
- 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
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
regex's behavior:- To reject bogus character class ranges like
R"([\d-e])". #5158 - For negated character class escapes (
\Dfor non-digits,\Sfor non-whitespace,\Wfor non-words) when matching against Unicode characters: - For character ranges in case-insensitive mode. #5164
- For the
basicgrammar to parse a single digit for backreferences. #5167 - For its internal buffers to grow geometrically. #5175
- For the special character
.(dot). #5192 - For its constructor to accept (null, zero) arguments. #5211
- To reject bogus character class ranges like
- 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
push_range()forstack,queue, andpriority_queueto forward the range toc.append_range()when possible, exactly as depicted in the Standard. #5168 - Fixed code to call
ranges::beginandranges::endexactly as depicted in the Standard: - Fixed compiler errors in
range_formatterinvolving highly unusual contiguous ranges. #5187 - Fixed heterogeneous lookup for unordered containers to follow the Standard, allowing braced initializer lists to be used as arguments. #5208
- Fixed compiler errors in
views::countedinvolving highly unusual types. #5223 - Fixed integer overflow in
this_thread::sleep_for()with extremely small units (e.g. picoseconds). #5237 - Fixed
basic_string::reserve()'s ASan annotations to detect writes to its unused capacity. #5252 - Fixed how
<format>handles field width for alternate form general floating-point. #5261 - Fixed compiler errors when constructing a
basic_ispanstreamfrom a modifiablebasic_string. #5309- This fixed a regression that was introduced by #4938 in VS 2022 17.13.
- Fixed compiler errors when using
<format>in a CUDA project, by adding a compiler bug workaround. #5335 - Fixed compiler errors when converting between different specializations of
basic_const_iterator. #5325
- Fixed
- Improved performance:
- Added vectorized implementations of:
-
basic_string::find()for a character. #5101
-
- Improved the vectorized implementations of:
-
basic_string::find_first_of()andbasic_string::find_last_of(). #5029
-
-
regex_traits::translate()is now an identity function, as required by the Standard, instead of an expensive locale operation. #5209 - The STL now takes advantage of compiler support for C++23 P1169R4
static operator()in earlier Standard modes, slightly improving codegen. #5284 #5312 - Optimized the
minstd_randandminstd_rand0random number engines by avoiding constant divisions. #5256 - Slightly improved
move_only_function's constructors to do less work when setting the object to be empty. #5328
- Added vectorized implementations of:
- 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.
- Deprecated the non-Standard
locale::empty()static member function. #5197 - Changed the STL to avoid using
is_trivial, which is being deprecated in C++26. #5202 - Improved the STL's debug checks with better messages and fewer branches. #5270
-
- Improved debugger visualization:
- Improved test coverage:
- Simplified the test harness by dropping
ctest. Now we always directly invokestl-lit.py. #5169 - Improved the test harness to warn only once when a compiler is missing. #5199
- Categorized libcxx test failures. #5231
- Updated our LLVM submodule, including new tests. #5235
- Added test coverage for the ASan annotations in
basic_string::reserve()andvector::reserve(). #5241 - Skipped
libcxxtests in response to a new compiler warning C5321, which warns when the resolution to CWG-1656 affects au8string literal. #5283
- Simplified the test harness by dropping
- Code cleanups:
- Infrastructure improvements:
- Updated
_MSVC_STL_UPDATE. #5162 #5217 #5264 #5323
- 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_ptrs (storing fancy pointers) from unspeakably evil relics of the forgotten past. #4922 - Fixed compiler errors when calling
ranges::inplace_mergewith certain combinations of elements, projections, and comparisons. #4927 - Fixed compiler errors in
basic_ispanstream's constructor andbasic_ispanstream::span()takingReadOnlyRange&&with highly unusual types. #4938 - Fixed compiler errors in the highly unusual scenario of calling
basic_stringandbasic_string_view'sfind_first_of()family of member functions for program-defined "unicorn" character types. #4951 - Fixed compiler errors when constructing
optionalfrom 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'sTraitsto compare characters. #4970 - Fixed
basic_stringandlist's internal constructors to avoid disrupting highly unusual scenarios. #4976 - Fixed compiler errors when constructing a
packaged_taskfrom a move-only function object. #4946 - For Clang
/fp:fast, fixed<cmath>and<limits>to avoid emitting-Wnan-infinity-disabledwarnings, except whennumeric_limits::infinity()/quiet_NaN()/signaling_NaN()are specifically called. #4990 - Fixed
ranges::copy_nto 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()to avoid sporadically failing for nonexistent network paths 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_assertthat the container elements are assignable from the range's reference type. #5086 - Fixed compiler errors in various ranges algorithms when used with
views::iotain certain scenarios. #5091
- Fixed an infinite loop in
- Improved performance:
- Added vectorized implementations of:
-
basic_string::find_first_of(). #4744 -
basic_string::find_last_of(). #4934 -
basic_string::find()for a substring. #5048 -
basic_string::rfind()for a substring. #5057 -
basic_string::rfind()for a single character. #5087 -
search(),ranges::search, anddefault_searcher, for 1-byte and 2-byte elements. #4745 -
find_end()andranges::find_end, for 1-byte and 2-byte elements. #4943 #5041 #5042 -
bitset's constructors from strings. #4839 -
remove()andranges::remove. #4987
-
- Improved the vectorized implementations of:
- Helped the compiler auto-vectorize:
-
rangesalgorithms 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 - Updated
arrayandvector'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
- Added vectorized implementations of:
- 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 of
<queue>,<stack>,<stacktrace>, and<thread>by not including all of<format>. #5003 - Moved
system_clock,high_resolution_clock, andchrono_literalsfrom a commonly-included internal header to<chrono>. #5105- This has source-breaking impact. If you see compiler errors complaining that it doesn't recognize
chronotypes likesystem_clockor 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
- Improved C++23 throughput by not including all of
- Enhanced behavior:
- Changed an internal
pairconstructor to beprivate. #4979 - Fixed a CodeQL warning by replacing a squirrelly
memcpy()call in thefilesystemimplementation (that was intentionally performing a read overrun) with two cromulentmemcpy()calls. #4933 - Silenced CodeQL warnings. #4942 #4985 #5072
- Added a visualizer for
system_clock::time_point. #5005 - Changed some
vectormachinery to use scope guards instead ofthrow;, making debugging easier when exceptions are thrown. #4977 - Improved
regex_error::what()'s message forregex_constants::error_badbrace. #5025 - Improved
optional<T>::swap()'sstatic_assertmessages whenTisn't both move constructible and swappable. #5065 - Removed
locale::id's non-Standard constructor fromsize_tand implicit conversion operator tosize_t. #5067- For user-visible headers, at least. They remain dllexported for binary compatibility.
- Improved
mutexassertions to distinguish "unlock of unowned mutex" from "unlock of mutex not owned by the current thread". #5099
- Changed an internal
- Improved test coverage:
- Updated tests to work with Clang 18. #4932 #4937
- Fixed sporadic failures in a
timed_mutextest. #4973 - Extended CUDA test coverage beyond C++14, adding C++17 and C++20. #4974
- When Python
psutilis installed, the test harness now supports apriorityparameter, defaulting toidle. #5032 - 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
- Code cleanups:
- Removed compiler bug workarounds. #4939 #4944 #4947 #5017 #5103
- Explicitly marked
packaged_task's defaulted move constructor and move assignment operator asnoexcept. #4940 - Various cleanups (described in detail in the PRs, not repeated here). #4945 #5014 #5058
- Refactored internal usage of the
tuple-likeandpair-likeconcepts. #4983 - Used
if constexprto simplifyeldritch horrors from beyond spacetimelocale facets. #5001 - Simplified control flow in
basic_string::find_first_not_of()/find_last_not_of(). #5006 - Refactored the vectorized implementation of
bitset::to_string(). #5013 - Replaced SFINAE with concepts in C++20-and-later code. #5044
- Improved documentation:
- Removed an inaccurate comment in
list's move assignment operator. #5024
- Removed an inaccurate comment in
- Infrastructure improvements:
- Build system improvements:
- Removed a workaround in the benchmark build. #4928
- Updated
_MSVC_STL_UPDATE. #4926 #4994 #5064
- Merged C++26 features:
-
P0952R2 #4740 #4850 A New Specification For
generate_canonical() - P2407R5 #4743 Freestanding Library: Partial Classes
-
P2833R2 #4743 Freestanding Library:
inoutexpectedspan -
P2968R2 #4777 Make
std::ignoreA 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
charto sequences ofwchar_t -
LWG-4061 #4758 Should
std::basic_format_contextbe default-constructible/copyable/movable? -
LWG-4074 #4814
compatible-joinable-rangesis underconstrained -
LWG-4083 #4786
views::as_rvalueshould 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_argsshould 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 /analyzeclean, 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 returntruefor 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 themaxvalue 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_iteratorto 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
expectedto 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_mergeandranges::minmaxin 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::minmaxto return correct results for negative zeros. #4734 - Fixed Clang compiler errors for certain
constexprvariantscenarios 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_variableandcondition_variable_any, improving their performance and simplifying their implementation. #4720- As a result,
condition_variable,timed_mutex, andrecursive_timed_mutexare now trivially destructible.
- As a result,
- Improved the performance of
search(),find_end(), and theirrangesforms 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::minmaxfor 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
bitsetto abasic_ostreamnow 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::findto callwmemcmp/wmemchr/wcslenwhen possible, which will improve performance after a future UCRT header update. #4873 #4894 - Optimized equality comparisons for empty
strings andstring_views. #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/setnodes 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-Wdanglingto 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::iotaandviews::repeatto provide better IDE guidance. #4908 - Simplified internal locale facet machinery to use class-specific
operator newandoperator deleteoverloads 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::repeatdoes 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
libcxxtest 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::equalcompares sizes. #4864
- Reverted change:
- Infrastructure improvements:
- Build system improvements:
- Added
/Zc:preprocessorto 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_viewmay invoke UB for sized common non-forward underlying ranges -
LWG-3950 #4510
std::basic_string_viewcomparison operators are overspecified -
LWG-3984 #4543
ranges::to's recursion branch may be ill-formed -
LWG-4012 #4529
common_view::begin/endare missing thesimple-viewcheck -
LWG-4013 #4530
lazy_split_view::outer-iterator::value_typeshould not provide default constructor -
LWG-4016 #4539
container-insertablechecks do not match whatcontainer-inserterdoes -
LWG-4035 #4525
single_viewshould provideempty -
LWG-4053 #4685 Unary call to
std::views::repeatdoes not decay the argument -
LWG-4054 #4540 Repeating a
repeat_viewshould 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_stringinteracted with the undocumented compiler option/d1initall. #4474 - Fixed
atomic_reffor 16-byte objects to correctly reportis_lock_free()andis_always_lock_freeon x64 (when the optional mode_STD_ATOMIC_ALWAYS_USE_CMPXCHG16Bis defined to be1) and ARM64 (always). #4478 - Removed the vectorized implementation of
ranges::findwithunreachable_sentinelas 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_lastfor 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
/ZIcompiler 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:
-
pairandtuplemachinery. #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_trivialto correctly handle unusual types. #4576 - Avoided mentioning
__vectorcallfor ARM64EC, where it is not yet supported. #4600 - Fixed
std.ixxto include<intrin.h>in the Global Module Fragment, fixing compiler errors withimport std;in certain scenarios. #4626 - Fixed compiler errors when a user-defined
formattercallsbasic_format_parse_context::next_arg_id()with an empty format-spec. #4640 - Fixed compiler errors when using
<expected>in/permissivemode. #4658-
Note: While
/permissivemode 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::replacefor 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_vinstead 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...>)whenTdoesn't occur exactly once inTypes. #4578 - Significantly improved compiler error messages when
ranges::tois 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_vitself remains guarded by C++20 mode). #4585 - Changed the internal constructors of
basic_format_arg::handleandbasic_format_contextto 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
_FPOSOFFmacro 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
libcxxtest 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_variableis implemented as a wrapper around the Windows APICONDITION_VARIABLE. #4545 - Removed
inlinefromconstexprvariable templates. #4546- This became possible after all of our supported compilers implemented CWG-2387. Note that for
constexprvariables, 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::versionto 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_assertmacros, which expand to nothing outside of the STL's test suites. #4624 - Simplified
ranges::stable_sortto useiter_value_tinstead 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_iteratorshould handle integer-class difference types -
LWG-3809 #4194 Is
subtract_with_carry_engine<uint16_t>supposed to work? -
LWG-3897 #4186
inout_ptrwill not update raw pointer to null -
LWG-3946 #4187 The definition of
const_iterator_tshould 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_moveforcommon_iteratorandcounted_iteratorshould returndecltype(auto) -
LWG-3974 #4214
mdspan::operator[]should not copyOtherIndexTypes -
LWG-4001 #4193
iota_viewshould 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
mutexmachinery. 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_CONSTRUCTORas 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::generalrules 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%Xand%EXforchrono::durationandchrono::hh_mm_ss. #4250 - Fixed
chrono::durationformatting to respect dynamically provided widths. #4283 - Fixed crashes and incorrect results in the vectorized implementation of
ranges::findwithunreachable_sentinel. #4450- This fixed regressions that were introduced by #2434 in VS 2022 17.3.
- Fixed
ranges::toto properly reject certain invalid uses with compiler errors, instead of trapping compilers in infinite loops of doom. #4142 - Fixed
ranges::toto 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::ssizeto be conditionallynoexceptas required by the Standard. #4231 - Fixed
join_viewandjoin_with_view's iterators to be default constructible. #4264 - Fixed truncation warnings when using
views::repeat. #4255 - Fixed compiler errors when using
views::zip_transformwith ranges that must be non-constto be iterated through, such asviews::filter. #4416 - Fixed compiler errors when using
views::pairwise_transformandviews::adjacent_transformvia 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
atomicby 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 usingextentswith 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_matchwith the spaceship operator<=>to abasic_stringwith 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
constexprevaluation ofvector<bool>caused by improper casting in iterator debugging machinery. #4276 - Fixed compiler errors (by adding a compiler bug workaround) when using
constexprinvoke()to call pointers to data members withreference_wrapperarguments. #4277 - Added macroization defenses for the STL's non-Standard extensions (e.g.
type_info'sraw_namemember 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_iteratorto 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_stringbufto 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::scientificbitmask elements together or to use thestd::hexfloatmanipulator.
- The Standard ways to request hexadecimal floating-point output are to use the
- Fixed
std.ixxto 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 whenfailbitis set inexceptions(). #4372 - Fixed
unordered_mapandunordered_set's equality operators to test elements for equality (via theiroperator==), not just equivalence (via the container's predicate for keys). #4406-
unordered_multimapandunordered_multisetalready 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_productwithviews::filter.
- This was spuriously emitted by certain combinations of code, e.g.
- Fixed
time_get::date_order()to correctly returntime_base::mdyfor the "C" locale, instead of picking up the date order for the current user locale. #4437 - Fixed
seed_seq::generate(RanIt, RanIt)tostatic_assertthat 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
-
atomicandatomic_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,spanconstructors, andcondition_variable::wait_for. #4402 -
shared_ptrcreation functions andatomicsmart 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_MEOWnow respectmemory_orderarguments 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::waitfamily performance by internally usingmemory_order_acq_relinstead ofmemory_order_seq_cstwhen 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 constexprand 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
mutexandrecursive_mutexto be trivial. #4390- This especially benefits variables with static storage duration, as they no longer need "dynamic
atexitdestructors".
- This especially benefits variables with static storage duration, as they no longer need "dynamic
- Slightly improved performance by replacing
CRITICAL_SECTIONwithSRWLOCKin:
- 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-constexprinvoke()unconditionally available, andconstexprinvoke()available in C++17 mode, as minor extensions. Now,constexprinvoke()is unconditionally available. #4080 - Improved
shared_ptrconstructor constraints to avoid forming invalid types. #4290 - Updated
<charconv>to use the__umulhintrinsic for ARM64 CHPE (_M_HYBRID_X86_ARM64). #4330 - Improved
expected's copy/move assignment operators to be trivial when possible, like howoptionalandvariantalready 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 thestdnamespace. - Removed non-Standard machinery from Standard engines and distributions. (For example, certain
static constexprdata members inmersenne_twister_engineand 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_conceptsfor our command-line test coverage of the EDG compiler front-end. #4296 #4297 #4440-
__cpp_lib_conceptswas 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::findandranges::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
typenamekeywords 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_conceptsmissing 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
constto 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 constexprto 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::functionandpackaged_taskto 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
expectedtogether withany. #4013 - Fixed incorrect behavior when self-move-assigning
any, and fixed compiler errors inanyinvolving incomplete types. #3965 - Fixed bugs in
basic_string's copy assignment operator, specific to non-equalpropagate_on_container_copy_assignmentallocators, 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.libby 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
dequeto preserve its internal invariants when taking advantage of allocators that provideallocate_at_least(). #4017 - Fixed
dequeemplace()andinsert()to not require elements to be swappable; this change also improved performance. #4022 - Fixed
dequeto 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_typetypedefs 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
dequeby 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_asserts like "error STL1000: Unexpected compiler version, expected Clang 16.0.0 or newer." instead of just "Error in C++ Standard Library usage." #4020 - Silenced
/Wallwarnings:- 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:
/Wallis 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/Wallclean.
- Changed
num_get::do_get()to tolerate 80-bitlong doubleby removing astatic_assertthat was added in 2018. #4032-
Note: 80-bit
long doubleremains 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_LOCATIONto0. - 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
rangesalgorithms 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
stdandstd.compatare 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 stdin 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() &assumesEis 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 thecharas a character instead of an integer. #3723 - The STL now avoids dragging in the non-reserved name
ISA_AVAILABILITY. #3721 - Fixed
chrono::hh_mm_ssformatting 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_points with unsigned representations instead of waiting forever. #3761 - Fixed
counting_semaphoreto add compile-time enforcement of the Standard's mandates. #3747 - Fixed a bug, affecting UWP apps only, where locking a
mutexcould throw a bogus exception. #3763 - Fixed the signatures of
char_traitsmember 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-8viaimport 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 functionobjects. #3844- This is an obscure corner case, because such calls are guaranteed to return null.
- Fixed compiler errors when using
array<T, 0>inconstexprcontexts. #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
noexcepts 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 oncefrom all STL headers. #3895-
#pragma onceis 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_assignmentallocators. #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 -
mutexandcondition_variablenow 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, andvectornow 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_forfrom<type_traits>to<utility>, which is where the Standard provides them. - Moved
allocator_arg,allocator_arg_t,uses_allocator, anduses_allocator_vso 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 /analyzeclean, 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_viewiterators andlazy_split_view. #3762 -
basic_string_view::compare(const charT*). #3738 - Constructors of
locale::facetand 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_iteratorandstdext::unchecked_array_iterator: #3818- Added
constness conversions. - Deprecated these iterators, which have been superseded by
std::spanandgsl::span.
- Added
- Added "lifetimebound" attributes to
minmaxandranges::minmax, allowing MSVC code analysis and Clang-Wdanglingto detect dangling references in improper usage. #3831 - Improved how
views::cartesian_productdetects 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
mutexandrecursive_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
Facetis 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_vandis_nothrow_assignable_v. #3898 - Added more tests for
views::as_const,views::stride, andviews::zip. #3920 - Test code now consistently uses
overrideto avoid mistakes, following the same convention as product code. #3934 - Fixed precondition violations in
is_permutation()tests. #3967 - Fixed precondition violations in
regex_iteratorandregex_token_iteratortests. #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
typenamekeywords in C++20 mode and later. #3892 #3893 #3894 - Improved type safety by using an
enum classfor 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
- Merged C++23 features:
-
P1467R9 #3583 Extended Floating-Point Types
-
Note: This means that we provide the
<stdfloat>header containing an emptynamespace std {}, as we don't support any optional extended floating-point types.
-
Note: This means that we provide the
-
P2093R14 #3337
<print>: Formatted Output-
P2539R4 Synchronizing
print()With The Underlying Stream
-
P2539R4 Synchronizing
-
P2164R9 #3472
views::enumerate -
P2165R4 #3372 Compatibility Between
tuple,pair, And tuple-like Objects -
P2321R2
zip, completed by implementing: -
P2374R4 #3561
views::cartesian_product- P2540R1 Empty Product For Certain Views
-
P2572R1 #3629
std::formatFill Character Allowances - P2609R3 #3486 Relaxing Ranges Just A Smidge
-
P2614R2 #3482 Deprecating
float_denorm_style,numeric_limits::has_denorm,numeric_limits::has_denorm_loss -
P2652R2 #3542 Disallowing User Specialization Of
allocator_traits -
P2655R3 #3513
common_reference_tOfreference_wrapperShould Be A Reference Type -
P2736R2 #3556 Referencing The Unicode Standard
-
<format>now understands Unicode 15.
-
- P2770R0 #3466 Stashing Stashing Iterators For Proper Flattening
-
P1467R9 #3583 Extended Floating-Point Types
- Merged partial C++23 features:
- Merged LWG issue resolutions:
-
LWG-2195 #3506 Missing constructors for
match_results -
LWG-2309 #3469
mutex::lock()should not throwdevice_or_resource_busy - LWG-2381 #3364 Inconsistency in parsing floating point numbers
-
LWG-3204 #3494
sub_match::swaponly swaps the base class -
LWG-3655 #3495 The
INVOKEoperation anduniontypes -
LWG-3677 #3396 Is a cv-qualified
pairspecially handled in uses-allocator construction? - LWG-3720 #3511 Restrict the valid types of arg-id for width and precision in std-format-spec
-
LWG-3733 #3496
ranges::tomisusescpp17-input-iterator -
LWG-3734 #3503 Inconsistency in
inout_ptrandout_ptrfor empty case -
LWG-3821 #3509
uses_allocator_construction_argsshould have overload forpair-like -
LWG-3833 #3477 Remove specialization
template<size_t N> struct formatter<const charT[N], charT> -
LWG-3836 #3587
std::expected<bool, E1>conversion constructorexpected(const expected<U, G>&)should take precedence overexpected(U&&)withoperator bool -
LWG-3847 #3479
ranges::tocan still return views -
LWG-3851 #3517
chunk_view::inner-iteratormissing customiter_moveanditer_swap -
LWG-3860 #3480
range_common_reference_tis missing -
LWG-3862 #3471
basic_const_iterator'scommon_typespecialization is underconstrained -
LWG-3865 #3476 Sorting a range of
pairs- This can be a source-breaking change in unusual scenarios.
-
LWG-3869 #3487 Deprecate
std::errcconstants related to UNIX STREAMS -
LWG-3870 #3475 Remove
voidify -
LWG-3872 #3470
basic_const_iteratorshould have customiter_move -
LWG-3875 #3485
std::ranges::repeat_view<T, IntegerClass>::iteratormay be ill-formed -
LWG-3877 #3504 Incorrect constraints on
const-qualified monadic overloads forstd::expected -
LWG-3887 #3589 Version macro for
allocate_at_least
-
LWG-2195 #3506 Missing constructors for
- Fixed bugs:
- Fixed the
ios_baseconstants (e.g.ios_base::binary,ios_base::failbit,ios_base::hex) to have the correct bitmask types. #3405 - Fixed compiler errors found with Clang 16. #3483
- Fixed
<ranges>to avoid using list-initialization when the difference between braces and parentheses is observable. #3493 - Fixed
pmr::unsynchronized_pool_resourceto respectpmr::pool_options::max_blocks_per_chunkwhen it's smaller than the default initial number of blocks per chunk. #3510 - Fixed technically undefined behavior in
<regex>and<sstream>found by Clang/LLVM's Undefined Behavior Sanitizer (UBSan). #3452 - Fixed compiler errors when calling
ranges::equalwith ranges involvingviews::iota. #3551 - Fixed the STL's iterator unwrapping machinery to avoid requiring a
_Prevent_inheriting_unwraptypedef. #3566 - Fixed spurious warnings from Clang's
-Wzero-as-null-pointer-constantwhen comparing the spaceship operator's return types (partial_ordering,weak_ordering,strong_ordering) with literal0. #3581 - Fixed
bind()function objects to have constrained function call operators, so they interact properly withis_invocableand related scenarios. #3577 - Reverted #2654 (which affected
<future>'s use of<ppltasks.h>in Desktop XAML apps) because it introduced anole32.dlldependency that broke multiple scenarios. #3607- We backported this revert to VS 2022 17.6.
- Fixed
views::cartesian_productto avoid compiler errors in pathological scenarios. #3609 - Fixed incorrect results for ranges larger than 4 GB passed to the vectorized implementations of
min_element(),max_element(), andminmax_element(). #3619 - Added a compiler bug workaround for MSVC in
shared_ptr'soperator<=>. #3647- This avoids compiler errors when comparing
shared_ptr<const int>toshared_ptr<void>.
- This avoids compiler errors when comparing
- Added a space to
chrono::ambiguous_local_time's message to exactly match the Standard. #3650 - Fixed compiler errors when formatting unusual
chrono::durationtypes. #3649 - Fixed
optional::transform()to avoid terminating when the callable object throws an exception. #3668 - Fixed
<charconv>floating-pointfrom_chars()to correctly handle two scenarios involving exponents with large absolute values. #3670 - Fixed iostreams floating-point parsing to produce correct results for many different scenarios. #3364
- Fixed compiler errors when importing the Standard Library Modules and calling
typeid(T).name(). #3677 - Fixed some nasty corner cases in
cartesian_product_view. #3678 - Fixed some issues with parsing numbers with grouping separators. #3684
- Fixed a bug that could result in
unordered_meowcontainers allocating too few buckets. #3687
- Fixed the
- Improved performance:
- Slightly optimized
mutexandrecursive_mutexconstruction by avoiding a Windows API call. #3522 - Slightly optimized
unique_ptrmove assignment by avoiding an unnecessary branch. #3540 - Optimized
chrono::time_zone::to_sysandchrono::time_zone::to_local, with a speedup of approximately 3x (times, not percent). #3579 - Optimized
type_index::operator<=>to avoid calling the comparison function twice. #3600 - Inserted the
VZEROUPPERinstruction at the end of every AVX2 codepath in the STL's vectorized algorithms, improving performance in non-optimized debug mode when the compiler doesn't automatically insert this instruction. #3630 - Optimized the constructors
system_error(error_code)andsystem_error(int, const error_category&). #3635
- Slightly optimized
- Improved throughput:
-
<optional>and<variant>now include fewer headers. #3624 - Moved internal machinery into
<regex>where it's needed. #3625 - C++20
<chrono>now avoids including<algorithm>. #3626 -
<compare>now avoids including<bit>. #3627 - Refactored a central internal header so that the rest of the STL includes fewer headers and provides less machinery beyond what's required. #3623 #3654
- Common source-breaking impact:
- Need to include
<cstdlib>forexit,quick_exit, etc. - Need to include
<initializer_list>forinitializer_list.- Sometimes
initializer_listis used implicitly when only braces appear in the source code.
- Sometimes
- Need to include
<functional>forunary_functionandbinary_function.- Note that
unary_functionandbinary_functionwere deprecated in C++11 and removed in C++17, so it's best to stop using them completely.
- Note that
- Need to include
- Uncommon source-breaking impact:
- Need to include
<memory>foraddressof. - Need to include
<functional>forless,less_equal,greater,greater_equal,equal_to,not_equal_to,plus,minus, andmultiplies.
- Need to include
- Common source-breaking impact:
- When the STL needs to call
swapvia Argument-Dependent Lookup, it now does so directly; the internal helper function_Swap_adlhas been removed. #3700
-
- Enhanced behavior:
- Silenced CodeQL warnings. #3489 #3585
- Silenced occurrences (in
bitset::referenceand test code) of MSVC's new off-by-default warning C5267 for deprecated implicit copy constructors/assignment operators. #3497 - Enabled
<source_location>for Clang. #3584 - Removed the non-Standard
xtimetype from<chrono>. #3594 - Added
static_asserts to containers, container adaptors, andallocatorto improve the error messages when they're given non-object types. #2436 #3660-
allocator<void>is still permitted as a special case.
-
- Improved test coverage:
- Added test coverage with Clang/LLVM's Undefined Behavior Sanitizer (UBSan). #3452
- Added more tests for
views::empty,views::iota,views::istream,views::repeat, andviews::single. #3553 - Fixed nonconformant code in the test for Standard Library Header Units and Modules. #3588
- Added test coverage for C++23's customization point objects. #3610
- Added more tests for
ranges::ref_view,ranges::subrange,views::common,views::filter,views::join,views::reverse, andviews::transform. #3612
- Code cleanups:
- Removed many compiler (and CMake) bug workarounds. #3490 #3499 #3651 #3711
- Various cleanups (described in detail in the PRs, not repeated here). #2116 #3406 #3523 #3524 #3525 #3526 #3527 #3528 #3529 #3530 #3531 #3532 #3533 #3539 #3543 #3547 #3598 #3633 #3639 #3658
- Removed comments that were citing proposed resolutions for LWG issues, now that those issues have been officially resolved by the February 2023 meeting. #3554
- Simplified code by calling
fill_n()instead offill()when possible. #3578
- Improved documentation:
- Added documentation about the STL's import library. #2141
- Infrastructure improvements:
- The internal test runner now understands compile-only tests and
libcxx/expected_results.txt. Consequently, (1) compile-only tests (test.compile.pass.cpp) no longer need a redundantint main() {} // COMPILE-ONLY, and (2) we no longer need to redundantly updatelibcxx/skipped_tests.txt(which has been removed) identically tolibcxx/expected_results.txt. #3484 - Enforced the usage of only core headers when building the STL's import library. #3621
- Updated dependencies. #3490 #3651 #3711
- Updated build compiler to VS 2022 17.7 Preview 1 (17.6 now required).
- Updated Clang to 16.0.1 (now required).
- Updated CMake to 3.26.0 (now required).
- Updated Python to 3.11.3.
- Updated Boost.Math to 1.82.0. #3657
- The internal test runner now understands compile-only tests and
- Updated
_MSVC_STL_UPDATE. #3518 #3643 #3680
- Merged C++23 features:
-
P1223R5 #3268
ranges::find_last,ranges::find_last_if,ranges::find_last_if_not -
P2167R3 #3258 Improving
boolean-testableUsage -
P2278R4 #3187 #3234
cbeginShould Always Return A Constant Iterator - P2404R3 #3345 Move-Only Types For Comparison Concepts
-
P2467R1 #3065
ios_base::noreplace: Exclusive Mode Forfstreams -
P2474R2 #3142
views::repeat -
P2505R5 #3361 Monadic Functions For
expected -
P2588R3 #3455
barrier's Phase Completion Guarantees - P2602R2 #3215 Poison Pills Are Too Toxic
-
P2711R1 #3451 Making Multi-Param Constructors Of Views
explicit
-
P1223R5 #3268
- Merged partial C++23 features:
- Merged LWG issue resolutions:
-
LWG-3515 #3236 [stacktrace.basic.nonmem]:
operator<<should be less templatized -
LWG-3545 #3242
std::pointer_traitsshould be SFINAE-friendly -
LWG-3594 #3276
inout_ptr- inconsistentrelease()in destructor -
LWG-3629 #3272
make_error_codeandmake_error_conditionare customization points -
LWG-3646 #3261
std::ranges::view_interface::sizereturns a signed type -
LWG-3717 #3266
common_view::endshould improverandom_access_rangecase -
LWG-3736 #3318
move_iteratormissingdisable_sized_sentinel_forspecialization -
LWG-3737 #3320
take_view::sentinelshould provideoperator- -
LWG-3743 #3269
ranges::to'sreservemay be ill-formed -
LWG-3746 #3265
optional's spaceship withUwith a type derived fromoptionalcauses infinite constraint meta-recursion -
LWG-3769 #3459
basic_const_iterator::operator==causes infinite constraint recursion -
LWG-3772 #3462
repeat_view's piecewise constructor is missing preconditions -
LWG-3778 #3332
vector<bool>missing exception specifications -
LWG-3785 #3319
ranges::tois over-constrained on the destination type being a range -
LWG-3798 #3359 Rvalue reference and
iterator_category -
LWG-3810 #3421 CTAD for
std::basic_format_args -
LWG-3823 #3231 Unnecessary precondition for
is_aggregate -
LWG-3848 #3410
slide_viewmissingbaseaccessor -
LWG-3850 #3423
views::as_constonempty_view<T>should returnempty_view<const T> -
LWG-3853 #3468
basic_const_iterator<volatile int*>::operator->is ill-formed
-
LWG-3515 #3236 [stacktrace.basic.nonmem]:
- 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 linker errors when using
time_put<wchar_t>from the Standard Library Modules. #3232 - Fixed another unintentionally dllexported symbol in the import library. #3233
- This would emit a spurious message "Creating library
meow.liband objectmeow.exp" (while buildingmeow.exe) when using<stacktrace>or importing the Standard Library Modules.
- This would emit a spurious message "Creating library
- Fixed a binary compatibility break in
basic_string, which could lead to missing null terminators causing crashes and other runtime misbehavior, when linking code that was built with different versions of the STL. #3235- This ABI break was introduced by #1735 activating the Small String Optimization for
constexprbasic_stringin VS 2022 17.4. - The affected scenarios involved mixing VS 2022 17.3 (or earlier) with VS 2022 17.4 (or later, until this fix).
- We backported this fix to VS 2022 17.4.5 and VS 2022 17.5.
- This ABI break was introduced by #1735 activating the Small String Optimization for
- Fixed a binary compatibility break in
ppltasks.cpppoweringstd::async(), which could lead to crashes caused by aninvalid_operationexception slamming intonoexcept. #3255- This ABI break was introduced by #2654, and appeared in VS 2022 17.4 when the VCRedist was "unlocked".
- The affected scenarios involved building with VS 2015 (or possibly early versions of VS 2017), using "Single-Threaded Apartments", and running on an end user's machine with the VS 2022 17.4 VCRedist installed.
- We backported this fix to VS 2022 17.4.5 and VS 2022 17.5.
- Fixed incorrect results from
find(),count(),ranges::find(), andranges::count(). #3247- This fixed a regression that was introduced by #2434 in VS 2022 17.3.
- The affected scenarios involved mixing certain signed and unsigned types; for example, finding/counting occurrences of the
int-1in a range ofunsigned intelements should consider the element0xFFFF'FFFFuto be equal (due to C++'s usual arithmetic conversions), but it was incorrectly considered to be non-equal. - We backported this fix to VS 2022 17.4.5 and VS 2022 17.5.
- Fixed the visualizer for
optional<T>to work whenThas a custom visualizer. #3243 - Fixed compiler warnings when passing
long doubletocopysign(). #3253 - Re-enabled ASan (Address Sanitizer) annotations in
<string>after fixing significant bugs. #3164- Also fixed ASan annotations in
<vector>that were failing whenpmr::vectorwas used withpmr::monotonic_buffer_resourceon x86.
- Also fixed ASan annotations in
- Fixed compiler errors when passing
rangestypes tostd::copy(). #3270 - Fixed
shared_future<void>'s move assignment operator to benoexceptas required by the Standard. #3284 - Fixed Clang compiler errors involving intrinsics by including
<intrin.h>, which is a header that Clang recognizes and supports. #3285 - Fixed
numeric_limitsto correctly report thatis_signedistruefor the STL's internal 128-bit signed-integer-class type. #3291 - Fixed
<stacktrace>to correctly passSYMOPT_FAIL_CRITICAL_ERRORSto the Windows API. #3292 - Fixed
<charconv>(and headers that include it, like<chrono>and<format>) to avoid emitting warning C4365 "signed/unsigned mismatch" when being compiled with/J. #3295-
Note: We strongly discourage any use of the
/Jcompiler option, as it's a recipe for One Definition Rule violations and it doesn't improve Standard conformance.
-
Note: We strongly discourage any use of the
- Fixed
ranges::cbegin,ranges::cend,ranges::crbegin,ranges::crend, andranges::cdatato behave like their non-constcounterparts when given array rvalues. #3316 - Added compiler bug workarounds:
- Fixed
constexprbasic_stringto correctly start the lifetimes of its elements, avoiding compiler errors. #3334 - Fixed
views::istreamconstraints to precisely follow the Standard. #3335 - Implemented C++17's parallel specialized
<memory>algorithms. #3145 - Fixed
vector<bool, Alloc>on 32-bit platforms with 64-bitdifference_types to support storing more than 232 bits. #3342 - Fixed a compiler error when calling
ranges::prevon aniota_viewiterator in debug mode. #3356 - Fixed
ranges::minmaxto avoid moving from an element twice when called with a single-element range ofmove_iterators. #3366 - Fixed a minor conformance issue in the
std.ixxStandard Library Module. #3373- When
module;introduces a global module fragment, it is required to be the first thing in the file other than comments, although MSVC doesn't enforce this rule yet.
- When
- Changed the STL's usage of a compiler-specific custom attribute to defend against macros. #3380
- Fixed Clang
-Wdeprecatedwarnings that said "out-of-line definition of constexpr static data member is redundant in C++17 and is deprecated". #3381 - Changed
vformat_to()to instantiate its machinery in a lazier way. #3403- When merely including
<format>or<chrono>, this avoids instantiating dynamic initializers for facet IDs, and improves throughput slightly.
- When merely including
- Fixed linker errors when using
- Improved performance:
- Avoided constructing unnecessary
strings inlocale::operator==(). #3250 - Activated
count()'s vectorized implementation for more eligible iterators in C++14/17 modes. #3262 - Activated the vectorized implementations of
find(),count(),ranges::find(), andranges::count()for more scenarios involving pointer elements. #3267 - Optimized
<atomic>for ARM64, massively improving load-acquire and store-release (measured 14.1x to 23.8x speedups - times, not percent) and significantly improving sequentially consistent stores (measured 1.58x speedup). #3399 -
ranges::findnow callsmemchr()in more situations (when the vectorized implementation isn't available). #3386
- Avoided constructing unnecessary
- Improved throughput:
- Enhanced behavior:
- The STL now supports
/clrfor C++11 multithreading (mutex,condition_variable,future, etc.) and C++17 parallel algorithms. Additionally, the STL now allows/clrto be used in C++20 mode. #3194 #3201- See tracking issue #3193 for a list of compiler bugs that affect these newly enabled
/clrscenarios.
- See tracking issue #3193 for a list of compiler bugs that affect these newly enabled
- Added visualizers for
error_categoryanderror_code. #3204 - Improved the output of
source_location::function_name(). #3206- For example, it now returns
"int __cdecl square(int)"instead of"square".
- For example, it now returns
- When iterator debugging detects bogus usage of an invalidated
vectoriterator, it now displays an assertion message instead of abruptly crashing. #3282 - Changed
<mutex>to use scope guards instead ofthrow;, making debugging easier when exceptions are thrown. #3321 - Strengthened the exception specifications for:
- Added
modules/modules.jsonto support build systems. #3358 #3488 - Refactored
ranges::minmaxandranges::minmax_elementto detect the single-element case naturally. #3384 - Changed the STL's user-defined literals to be consistently defined as
operator""meowwithout a space, because CWG-2521 is deprecating the formoperator"" woofwith a space. #3453
- The STL now supports
- Improved documentation:
- Clarified the error message when including the internal header
<__msvc_cxx_stdatomic.hpp>in C mode. #3192
- Clarified the error message when including the internal header
- Improved test coverage:
- Enabled
<stdatomic.h>test coverage for Clang. #3186 - Updated the modules tests after a compiler bugfix for
source_location. #3339 - Added more tests for
views::elements. #3350 - Updated our LLVM submodule reference, including new tests. #3344 #3357
- Added more tests for
views::drop,views::drop_while,views::take, andviews::take_while. #3390
- Enabled
- Code cleanups:
- Removed compiler bug workarounds. #3202 #3288 #3351 #3350
- Removed comments that were citing proposed resolutions for LWG issues, now that those issues have been officially resolved by the November 2022 and February 2023 meetings. #3238 #3461
- Improved consistency in preprocessor comments. #3208
- Simplified a line in
experimental::filesystem::recursive_directory_iterator::operator++(). #3279 - Various cleanups (described in detail in the PRs, not repeated here). #3293 #3300
- Removed unused internal machinery. #3299
- Simplified types by defaulting some of their special member functions:
- Changed more temporary objects to be constructed with braces instead of parentheses. #3277
- Updated comments after a compiler bug was fixed. #3394
- Updated tests and separately compiled sources to directly use the
[[nodiscard]]attribute. #3397 - Updated notes for skipped tests in the
libcxxtest suite. #3464
- Infrastructure improvements:
- Added GitHub Actions to automatically add PR cards to the Code Reviews project. #3393
- Fixed the build system to properly pass options when assembling the "alias objects". #3402
- Updated dependencies. #3202 #3288 #3340 #3351 #3467
- Updated build compiler to VS 2022 17.5 Preview 6 (now required).
- Updated CMake to 3.25 (now required).
- Updated Python to 3.11.2.
- Updated Boost.Math to 1.81.0. #3312
- Updated
_MSVC_STL_UPDATE. #3191 #3264 #3362 #3395
- Merged C++23 features:
-
P2322R6 #3099
ranges::fold_left,ranges::fold_right, etc. -
P2465R3 #3108 Standard Library Modules
stdAndstd.compat- Initially supported for MSVC only; see tracking issue #1694 for lists of known compiler bugs and upcoming fixes.
- Build system support is a work in progress; currently, build systems must be manually taught to compile
std.ixxso you can referencestd.ifcand linkstd.obj. (Similarly for buildingstd.compat.ixxintostd.compat.ifcandstd.compat.obj.) - IntelliSense support is a work in progress; STL test coverage is not yet enabled.
- Will be supported for Clang after compiler support for modules is available; see Clang's C++20 implementation status.
-
P2508R1 #3074
basic_format_string,format_string,wformat_string
-
P2322R6 #3099
- Merged partial C++23 features:
-
P2278R4
cbeginShould Always Return A Constant Iterator:- The "Iterators" section, including
basic_const_iterator,make_const_iterator(), andmake_const_sentinel(). #3043
- The "Iterators" section, including
-
P2321R2
zip:-
views::zip. #3035 -
Note:
views::zip_transform,views::adjacent, andviews::adjacent_transformare the parts that remain to be implemented.
-
-
P2278R4
- Merged LWG issue resolutions:
- Fixed bugs:
- Fixed compiler warnings when using Standard Library Header Units. #3069
- Removed a non-Standard member function
locale::c_str(). #3088 - Fixed narrowing warnings when calling
piecewise_constant_distribution<float>::densities()andpiecewise_linear_distribution<float>::densities(). #3107 - Fixed compiler errors when calling
ranges::is_permutationwith predicates that return highly unusual boolean-testable types. #3113 - Fixed compiler errors when building the Standard Library Modules with static RTTI disabled. #3115
- Now, building
std.ixxwith/GR- /D_HAS_STATIC_RTTI=0will succeed, andstd::anywill simply be unavailable (as it inherently requires static RTTI). - Additionally, including
<any>with static RTTI disabled will emit a warning message but not an error, and the feature-test macro__cpp_lib_anywill indicate (by its absence) that the feature is unavailable.
- Now, building
- Fixed compiler errors in
reference_wrapper,thread, andvariantinvolving incomplete types. #3101 #3148 - When
chrono::time_zone::get_info()throws an exception, fixed it to reportGetLastError()as intended, instead of"The operation completed successfully."#3122 - Fixed incorrect results returned by
ellint_2(). #3077 - Fixed
error_category's default constructor to beconstexpr. #3139 #3176 - Fixed all headers to avoid emitting the off-by-default "warning C5262: implicit fall-through occurs here; are you missing a
breakstatement? Use[[fallthrough]]when abreakstatement is intentionally omitted betweencases". #3162 - Fixed compiler errors in certain
<ranges>scenarios by properly constrainingmovable-box's copy constructors. #3171
- Improved performance:
- Added support for unwrapping to
move_sentinel. #3098 - Improved the performance of
uniform_int_distributionby implementing Daniel Lemire's algorithm Fast Random Integer Generation in an Interval. #3012 - Optimized
gcd()to avoid a redundant shift. #3127 - Optimized
locale::classic()for a 10x speedup (times, not percent). #3048 - Added an attribute to
move(),forward(),move_if_noexcept(), andforward_like()that will allow the MSVC compiler to intrinsically implement them without emitting function calls. #3182
- Added support for unwrapping to
- Improved throughput:
- Enhanced behavior:
- Clarified
get_future()'s[[nodiscard("message")]]. #3068 - The internal headers
<xatomic.h>,<xbit_ops.h>, and<xerrc.h>are now core headers. #3116 - Improved
<format>'s compiler error messages for unformattable types. #3080
- Clarified
- Improved test coverage:
- Added test coverage for
<variant>visit()invoking pointers to members. #3070 - Expanded test coverage for
forward_like(). #3072 - Updated test coverage for
views::as_rvalue. #3089 - Expanded test coverage for
bind_front()andbind_back(). #3117 - Updated our LLVM submodule reference, including new tests, and updates to the
any/optional/variantshared test code. #2976 - Fixed bogus test code discovered by Clang 15. #3135
- Fixed the off-by-default "exhaustive" mode of the parallel
is_partitioned()test. #3174
- Added test coverage for
- Code cleanups:
- Various cleanups (described in detail in the PRs, not repeated here). #3082 #3083 #3084 #3085 #3086 #3090 #3091 #3092 #3093 #3177 #3178
- Improved Python scripts. #3123
- Removed compiler bug workarounds. #3155
- Moved
<atomic>implementation details, preparing for later changes. #3124 - Removed unnecessary partial specializations of
common_typefor the STL's internal 128-bit integer-class types. #3153
- Infrastructure improvements:
- Updated
_MSVC_STL_UPDATE. #3073 #3147
- Merged C++23 features:
-
P0849R8 #2808
auto(x):decay-copyIn The Language- The compiler part is not yet implemented; the library part was implemented in C++20 mode when Ranges were initially implemented.
-
P0881R7 #2502
<stacktrace>-
P2301R1 Add A
pmrAlias Forstd::stacktrace
-
P2301R1 Add A
- P1206R7 #2806 #3026 #3028 Conversions From Ranges To Containers
-
P1328R1 #2793
constexprtype_info::operator==() -
P1899R3 #2981
views::stride -
P2291R3 #3049
constexprIntegral<charconv> -
P2302R4 #2911
ranges::contains,ranges::contains_subrange - P2387R3 #2661 Pipe Support For User-Defined Range Adaptors
- P2408R5 #2960 #3056 Ranges Iterators As Inputs To Non-Ranges Algorithms
-
P2417R2 #2972 More
constexprbitset -
P2419R2 #2977 Clarify Handling Of Encodings In Localized Formatting Of
chronoTypes -
P2438R2 #3057
string::substr() && -
P2440R1 #2580
ranges::iota,ranges::shift_left,ranges::shift_right -
P2441R2 #2619
views::join_with -
P2445R1 #2974
forward_like() -
P2446R2 #3008
views::as_rvalue - P2494R2 #2965 Relaxing Range Adaptors To Allow Move-Only Types
-
P2499R0 #2947
string_viewRange Constructor Should Beexplicit -
P2517R1 #2959 Conditional
noexceptForapply() -
P2520R0 #2958 #2994
move_iterator<T*>Should Be A Random-Access Iterator
-
P0849R8 #2808
- Merged LWG issue resolutions:
-
LWG-3564 #2961
transform_view::iterator<true>::value_typeanditerator_categoryshould useconst F& -
LWG-3617 #2966
function/packaged_taskdeduction guides and deducingthis - LWG-3656 #2880 Inconsistent bit operations returning a count
-
LWG-3671 #2905
atomic_fetch_xormissing fromstdatomic.h -
LWG-3672 #2907
common_iterator::operator->()should return by value -
LWG-3683 #2879
operator==forpolymorphic_allocatorcannot deduce template argument in common cases -
LWG-3701 #2957 Make
formatter<remove_cvref_t<const charT[N]>, charT>requirement explicit -
LWG-3707 #2883
chunk_view::outer-iterator::value_type::sizeshould return unsigned type -
LWG-3710 #2878 The
endofchunk_viewfor input ranges can beconst -
LWG-3712 #2943
chunk_viewandslide_viewshould not bedefault_initializable -
LWG-3715 #2946
view_interface::emptyis overconstrained - LWG-3719 #2902 Directory iterators should be usable with default sentinel
- LWG-3721 #2906 Allow an arg-id with a value of zero for width in std-format-spec
-
LWG-3724 #2903
decay-copyshould be constrained
-
LWG-3564 #2961
- 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 linker errors when using
<any>with our unofficially supported mode to disable exceptions. #2193 - Fixed compiler errors when using
<format>with the new compiler option/presetPaddingby adding a compiler bug workaround. #2746 - Fixed division by
complexzero to behave consistently with other implementations. #2758 - Fixed a memory leak in
<syncstream>. #2763 - Fixed compiler errors when formatting
longorunsigned longvalues withformatter. #2768 - Fixed a binary compatibility break in the unordered associative containers, which could cause memory corruption when linking code that was built with different versions of the STL. #2774
- Original Versions: VS 2015 through VS 2019 16.2 inclusive.
- Modified Versions: VS 2019 16.3 through VS 2022 17.3 inclusive.
- Fixed Versions: VS 2022 17.4 and later.
- The bincompat break happened when mixing Original with Modified code. All other mixing is safe: Original with Original, Modified with Modified, Fixed with Fixed, Original with Fixed, and Modified with Fixed.
- Fixed a bug in the unordered associative containers, specific to user-defined allocators, where the containers sometimes called
deallocate()with null pointers. User-defined allocators aren't required to tolerate that, so the containers now avoid such calls. #2790 - Fixed a bug in
deque, specific to rarely-used fancy pointers, where some fancy pointers weren't being destroyed. #2775 -
<chrono>formatting now accepts%x("The locale's date representation") foryear_month_day,year_month_day_last,year_month_weekday, andyear_month_weekday_last. #2762 -
std::filesystem::directory_entry's constructors,assign(), andreplace_filename()now callrefresh()as required by the Standard and will propagate any errors (via exceptions orerror_codes), except that "file not found" is not considered an error. #1343 - Added a compiler bug workaround to
construct_at(), allowing immovable objects to be emplaced via copy elision. #2624 - Fixed leap second validation when parsing
time_points. #2705 -
lerp()now avoids overflowing to infinity when it can calculate the correct result with a fallback approach. #1918 - Fixed a debugger visualization issue, specific to Clang in C++20 mode (or later), where the debugger wouldn't display the contents of a
list,forward_list, or ordered/unordered associative container. #2782 - Fixed the visualizers for the non-Standard
stdext::hash_mapcontainer family. #2784 - Fixed the visualizers for
make_shared()andallocate_shared(). #2811 -
put_time()(and thetime_put::do_put()machinery powering it) now avoids modifyingerrnowhen it succeeds. #2049 - Added a compiler bug workaround to fix compiler errors with
source_location::current()in certain scenarios. #2824 - Fixed compiler errors when using
<format>to printdurations with extremely small periods (e.g. femtoseconds, attoseconds). #2814 - Fixed "
istreambuf_iteratoris not dereferenceable" assertions when attempting to usetime_get::get()orget_time()to parse certain formats when there's insufficient input. #2851- For example, with the format
"%X", the input"3:04:05"succeeds. The input"3:04"previously asserted/crashed; now it setsios_base::failbit | ios_base::eofbitas required by the Standard.
- For example, with the format
- Removed
std::filesystem::directory_entry::clear_cache(), which was a non-Standard extension. #2854 - Fixed incorrect results from
<complex>log()/log10()/pow()on ARM64. #2870 - Fixed
path::lexically_relative()to handle UNC drive paths like\\?\C:\meow.txt. #2867 - Fixed
filesystem::read_symlink()andfilesystem::copy()to handle junctions. #2877 - Fixed compiler errors in
ranges::uninitialized_copy_nandranges::uninitialized_move_nwith certain input iterators. #2964 - Fixed
ranges::enable_viewto properly reject references and to avoid compiler errors in certain unusual situations. #2978 - Temporarily disabled ASan (Address Sanitizer) annotations in
<string>while significant bugs are under investigation. #2990 - Fixed compiler errors in
views::chunk_bywith unusual predicates returning non-booltypes. #2890 - Fixed compiler errors in
visit<R>()involving conversions to immovable types. #2971 #2999 - Fixed compiler errors in
chrono::abs()in certain unusual situations. #2988 - Fixed
<format>to always print NaNs as"nan","-nan", or uppercase versions as required by the Standard, never"-nan(ind)". #3001 - Fixed
ranges::shuffleandranges::sampleto acceptuniform_random_bit_generators that don't provideresult_type. #3002 - Fixed
vector<bool>::insert(where, first, last)andvector<bool>::insert_range(where, range)to meet the Standard's complexity requirements. #3021 - Fixed how
chunk_viewandstride_viewiterators validate their preconditions. #3023 - Fixed a compiler warning emitted by the unusual scenario of
basic_string_view<char_like_struct>. #3032 - Fixed
move_only_functionto behave correctly when passed between DLLs. #3038 - Fixed compiler errors when
dllexporting classes derived frompairortuple. #3045 - Fixed
<regex>integer overflows when parsing huge numbers in backreferences, braced repetitions, and decimal escapes. #2169- These will now properly throw
regex_errors with codes oferror_backref,error_badbrace, anderror_escape, respectively.
- These will now properly throw
- Fixed
ranges::distanceto follow the Standard, which depicts two overloads (for sized and unsized sentinels). #2987 - Overhauled how the STL unwraps iterators and sentinels, fixing various issues. #3024
-
basic_string::substr()now uses a default-constructed allocator as required by the Standard. #3057 - Fixed CUDA compiler errors with
std::_Bit_castby using__builtin_bit_castinstead of amemcpyworkaround. #3066
- Fixed linker errors when using
- Improved performance:
- Improved
clamp()codegen with conditional move instructions. #2336 - Massively improved iostreams performance for
signed char,unsigned char,char8_t, andbyteelements, matching the performance ofcharby avoiding a slow codepath. #2739 -
vector's range constructor,insert(), andassign()now efficiently handle iterators that satisfy theforward_iteratorconcept, even when their classiciterator_categoryisn't convertible toforward_iterator_tag. #1794 - Reduced the size of the lookup tables used for
<format>grapheme clusterization, saving 2670 bytes. #2757 -
std::filesystem::path::lexically_relative()now avoids unnecessary memory allocations. #1915 - Added vectorized implementations of
min_element(),max_element(),minmax_element(),ranges::min_element(),ranges::max_element(), andranges::minmax_element(), with speedups ranging from 1.5x to 26.6x (times, not percent). #2447 #2821 #2825 - Reduced binary size for programs using
atomic::wait. #2781 - Avoided an unnecessary OS call in
thread::join(). #2820 - VS 2022 doesn't support targeting Windows Vista and Server 2008, but the STL still had runtime branches for those unsupported OSes. We've removed that code to improve performance, notably in
mutex::try_lock(). #2317- The STL still supports targeting Windows 7 and Server 2008 R2.
- Removed more unused code for Windows XP/Vista, reducing the size of the STL's DLL by 2 KB, and reducing the number of OS calls during STL startup. #2841
- Reduced the number of OS calls in
filesystem::resize_file()andexperimental::filesystem::resize_file(). #2771 - Improved the optimized codegen for
T + complex<T>,T * complex<T>,complex<T> * T, andcomplex<T> / T. Improved the debug codegen forcomplex<T> + Tandcomplex<T> - T. #2855 - Improved the optimized codegen for
unreachable(). #3055
- Improved
- Improved throughput:
- Used
if constexprinstead of tag dispatch in:-
get<I>()andget<T>()forpair. #2756
-
-
optional,pair, andtuplenow use conditionalexplicitinstead of SFINAE in all Standard modes, for all supported compilers. #2796 - The STL now uses "hidden friends" for all operators that are required to exist but aren't required to be namespace-scope functions (e.g.
n + vector::iterator). This improves throughput by not polluting unqualified name lookup. #2797 -
<charconv>'s large lookup tables are now separately compiled, so translation units including<charconv>will emit significantly smaller object files. #2125 - The STL now uses helper function templates for testing bitmask types, replacing a significant number of function overloads. #2865
-
<unordered_map>and<unordered_set>now avoid including most of<string>. #2996- This also improves throughput for
<functional>, which internally uses<unordered_map>to implementboyer_moore_searcher. - Escape hatch: define
_SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS. #3027
- This also improves throughput for
-
<functional>now avoids including<memory>. #2998- Escape hatch: define
_LEGACY_CODE_ASSUMES_FUNCTIONAL_INCLUDES_MEMORY. #3027
- Escape hatch: define
- Used
- Enhanced behavior:
-
<tuple>is now a core header. #2730 - The STL now supports enabling C++20
char8_tin C++14 and C++17 modes via/Zc:char8_t. #2748 -
complex<NonFloating>now emits a deprecation warning explaining that it has unspecified behavior according to the Standard. #2759 - When
wchar_tis a real type, the STL now avoids emitting many specializations forunsigned shortthat are intended for fakewchar_tonly (i.e. the non-Standard/Zc:wchar_t-option). #2164 - The STL now marks all of its namespace-scope
constexprvariables asinlinein C++17-and-later mode. #2792- This consistency improvement will also avoid emitting a new compiler warning that MSVC is implementing for C++20 header units: "warning C5260: the constant variable
'std::_Meow'has internal linkage in an included header file context, but external linkage in imported header unit context; consider declaring it'inline'as well if it will be shared across translation units, or'static'to express intent to use it local to this translation unit".
- This consistency improvement will also avoid emitting a new compiler warning that MSVC is implementing for C++20 header units: "warning C5260: the constant variable
-
constexprbasic_stringnow uses the Small String Optimization. #1735 -
error_codes with0values andfuture_categoryoriostream_categorynow return"success"frommessage(), matching the behavior ofgeneric_category. #2742 -
<system_error>now maps: #2744 #2899-
WAIT_TIMEOUT,ERROR_TIMEOUT, andERROR_SEM_TIMEOUTtoerrc::timed_out -
ERROR_BAD_NET_NAMEtoerrc::no_such_file_or_directory -
ERROR_FILENAME_EXCED_RANGEtoerrc::filename_too_long
-
- Added visualizers for
unique_ptrs andvectors storing character sequences. #2843 - Added more visualizers for
<any>,<format>,<functional>,<mutex>, and<ranges>. #2191 -
<cstdlib>now makes itsusing-declarations forstd::getenv()andstd::system()available to UWP apps. #2850 -
<filesystem>and<experimental/filesystem>now useGetTempPath2W()when it's available on Windows 11. #2302- This is a security improvement for processes running as SYSTEM; there's no behavioral change for ordinary processes.
- Follow-up: Fixed linker errors involving
_Init_locks::operator=in unusual situations. #3011
- Added a couple of warning numbers for easier lookup: #2061
- STL4038 warns "The contents of
<meow>are available only with C++NN or later." - STL4039 warns "The contents of
<coroutine>are not available with/await."
- STL4038 warns "The contents of
-
<unordered_map>and<unordered_set>no longer provide a non-Standardhash_compareclass template innamespace std. #2996 - Improved how STL error messages (like "Unexpected compiler version") are displayed. #2897
- Further improved how STL warnings and errors are displayed. #2973
- Added explanations to the STL's
[[nodiscard]]warnings, when the compiler supports[[nodiscard("message")]]and the reason is more complex than the common/simple scenario of pure observers. #2211- For example, discarding the return value of
std::remove_if()now emits a detailed warning message, explaining the classic erase-remove idiom, and suggesting C++20std::erase_if()instead.
- For example, discarding the return value of
-
vector::assign(num, val)andstd::swap_ranges()now have debug checks for forbidden aliasing. #1263 - Strengthened exception specifications on:
- Added support for defining
_ENFORCE_ONLY_CORE_HEADERS, limiting STL usage to the subset of core headers. #2068 - Updated the STL's internal 128-bit integer-class types for C++14/17 compatibility, which will be useful for future performance work. #3036
-
- Improved test coverage:
- Enabled tests now that Clang 14 supports
<coroutine>. #2861 - Slightly accelerated test runs by running memory leak tests with only debug configurations (where memory leak tracking is available). #2853
- Fixed a test that failed at runtime on ARM64. #2864
- Added
/permissiveconfigurations to tests that can successfully compile in this discouraged-but-supported mode. #3015 - Taught VSCode's Python extension where to find our test support machinery. #3040
- Updated the
<source_location>test for an upcoming compiler fix. #3046 - Added test coverage for a
<string>bug (specific to ASan annotations being enabled) that was fixed. #3039
- Enabled tests now that Clang 14 supports
- Code cleanups:
- Removed compiler bug workarounds. #2791 #2861
- Various cleanups (described in detail in the PRs, not repeated here). #2798 #2801 #2802 #2815 #2766 #2828 #2863 #2950 #3019
- Removed visualizers for VS 2013's binary-incompatible representations of various data structures. #2804
- Simplified
tuple_cat()'s implementation. #2833 - Improved how
<system_error>maps Windows error codes toerrcvalues. #2837 - Refactored
<atomic>to share code with C11 atomics (work in progress). #2846 - Updated most files (with limited exceptions) to consistently include the
<cmeow>wrapper headers instead of the<meow.h>CRT headers. #2852 - Simplified
<random>'sstatic constexprdata members. #3006 - Finished changing all aliases from
typedeftousing. #3018 - Cleaned up several tests to avoid unnecessary dependencies on macros and non-Standard code. #3034
- Updated
<functional>and<memory>to consistently use modernint = 0SFINAE. #2124 - Cleaned up feature-test macro usage to be simpler and more consistent. #3053
- Improved documentation:
- Added a comment explaining why
basic_stringdoesn't use templatedstatic constexprdata members as internal helpers. #2980
- Added a comment explaining why
- Infrastructure improvements:
- Eliminated duplicate builds of the "alias objects". #2743
- Fixed distributed test runs to split up the test suite deterministically, avoiding missed or repeated tests. #2795
- Properly applied
/analyzeto PR/CI builds, and fixed warnings in the STL's separately compiled sources. #2812 - Fixed cross-PR/CI contamination by cleaning both before and after checkout. #2832
- Fixed cross-PR/CI contamination by ignoring submodules during code format validation. #3033
- Added support for writing benchmarks with google/benchmark. #2780
- The PR/CI system now uses "1ES Hosted Pools". #3054
- Updated dependencies. #2754 #2791 #2831 #2861 #3017
- Updated build compiler to VS 2022 17.4 Preview 1 (now required).
- Updated Clang to 14.0.5 (now required).
- Updated CMake to 3.23 (now required).
- Updated Ninja to 1.11.0.
- Updated Python to 3.10.6.
- Updated CUDA to 11.6.0 (now required).
- Updated
_MSVC_STL_UPDATE. #2764 #2840 #3020
- Merged C++23 features:
- Merged partial C++23 features:
- Merged LWG issue resolutions:
-
LWG-3121 #2640
tupleconstructor constraints forUTypes&&...overloads -
LWG-3525 #2639
uses_allocator_construction_argsfails to handle types convertible topair -
LWG-3570 #2418
basic_osyncstream::emitshould be an unformatted output function -
LWG-3571 #2418
flush_emitshould setbadbitif theemitcall fails
-
LWG-3121 #2640
- 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
vector<bool>to properly invalidate iterators during reallocation, which fixes compiler errors withconstexprusage ofvector<bool>. #2441 -
empty_viewrvalues are now consideredborrowed_ranges as required by the Standard. #2576 - Added compiler bug workarounds to
is_convertibleandcommon_reference, socontiguous_iterator<const volatile int*>is nowtrue. #2592 - Added missing constraints to functions that were implied by "Effects: Equivalent to" Standardese:
make_any(),make_optional(),shared_ptr::operator=(),shared_ptr::reset(), andweak_ptr::operator=(). - Fixed
filesystem::path's comparison operators and some other member functions being IF-NDR (ill-formed, no diagnostic required) in C++23 mode. #2457 - Fixed C++20
<chrono>parsing to fail when the input is insufficient to supply the entire format string. #2523- For example, the input
"23:59"is insufficient for the format string"%H:%M:%S".
- For example, the input
- Fixed an out-of-bounds read in
ranges::find()withunreachable_sentinel. #2434 - Added compiler bug workarounds for CUDA (involving
[[nodiscard]] friend) to fix spurious cases of "warning C5240: 'nodiscard': attribute is ignored in this syntactic position". #2622 - Removed
ExecutionPolicyoverloads ofcopy_backward()andmove_backward()that were mistakenly implemented. They don't appear in the Standard because they would be useless. #2627 - Added compiler bug workarounds for Clang (involving the ordering of constrained and unconstrained destructors) to fix compiler errors in
<ranges>machinery. #2630 - Fixed a bug affecting
<future>'s use of<ppltasks.h>in Desktop XAML apps. #2654 - Fixed a bug that prevented C++20
<chrono>from parsing fractional seconds as floating-pointdurations. #2638 - Fixed
<bit>'scountl_zero()returning incorrect results on ARM64 for 8-bit and 16-bit types. #2647 - Added macroization guards to the STL's usage of compiler-specific custom attributes. #2649
- Fixed
get_time()andtime_get's 2-digit year logic. #2666 - Fixed
system_category().message()to behave correctly instead of returning"???"when the user language and system language are different. #2669 - Fixed the ARM64EC implementations of
atomic_thread_fence()andatomic<8-byte type>::store(). #2702 - Fixed compiler errors in
atomic<shared_ptr<T[]>>,atomic<shared_ptr<T[N]>>,atomic<weak_ptr<T[]>>, andatomic<weak_ptr<T[N]>>. #1339 - Added overloads of
<cmath>'slerp()for arithmetic types. #2113 - Fixed
filesystem::directory_entryto work with FAT32 and exFAT. #2373 -
<filesystem>now handles special system files likehiberfil.sys. #2715 -
filesystem::copy_file()now tolerates other processes having opened the source file or the target file for reading or writing (as much as possible, depending on the choice ofcopy_options). #2718 - Fixed the visualizers for
shared_ptr<void>,weak_ptr<void>, andunique_ptr<void, Deleter>. #2706 - Fixed compiler errors in
move_only_functionwhen compiling<functional>in/std:c++latestmode with/Zc:alignedNew-. #2712 - Implemented C++20's removal of the explicit specialization for
allocator<void>. #2726- Note that
allocator<void>is still supported, it just uses the primary template now.
- Note that
- Fixed "unresolved external symbol" linker errors in certain scenarios involving separately compiled third-party libraries. #2734 #2738
- On x64, these errors mentioned
__imp___std_init_once_begin_initializeand__imp___std_init_once_complete. - On x86, these errors mentioned
__imp____std_init_once_begin_initialize@16and__imp____std_init_once_complete@12. - This fixed a regression that was introduced by #2381 in VS 2022 17.2.
- This fix was backported to VS 2022 17.2.5.
- On x64, these errors mentioned
- Fixed
- Improved performance:
- Optimized
rotl()androtr()in<bit>for 8-bit and 16-bit integers by using compiler intrinsics. #2611 - Optimized the vectorized implementation of
reverse()for 32-bit trivial types. #2383 - Improved
<format>performance when the execution character set isn't self-synchronizing, by caching expensive calls to get codepage info. #2600 - Added vectorized implementations of
find(),count(),ranges::find(), andranges::count(), with speedups ranging from 2.0x to 27.6x (times, not percent). #2434 - Slightly improved the performance of
<charconv>floating-pointfrom_chars(). #2623
- Optimized
- Improved throughput:
- Used
if constexprinstead of tag dispatch, overloads, or specializations in:-
is_permutation(),sample(),rethrow_if_nested(), anddefault_searcher. #2219 -
<map>and<set>'s common machinery. #2287 -
polymorphic_allocator. #2471 -
basic_string_viewandbasic_string'sfind_first_of(),find_last_of(),find_first_not_of(), andfind_last_not_of(). #2479 #2660 -
<regex>. #2484 - Parallel
inclusive_scan()andtransform_inclusive_scan(). #2662 -
scoped_allocator_adaptor'soperator==(). #2677 -
function,move_only_function, andbind(). #2668 -
vector<bool>::insert(). #2694
-
- Replaced tag dispatch with SFINAE in
subtract_with_carry_engine's internal machinery. #2693 - Split
<chrono>into a smaller internal header, improving throughput when other headers need only pre-C++20<chrono>machinery. #2604
- Used
- Enhanced behavior:
- Changed
<deque>to use scope guards instead ofthrow;, making debugging easier when exceptions are thrown. #2308 - Merged an MSVC-specific attribute, allowing the compiler to improve its handling of
constexprdynamic allocation andconstexpr unique_ptr. #2658 - Implemented
<format>grapheme clusterization when determining the width of a string for padding and alignment purposes. This is a "quality of implementation" feature recommended by N4910[format.string.std]/11. #2119 - Changed
<strstream>to deprecate its classes instead of the entire header. #2680 - C++98's
unexpected()in<exception>was removed by C++17. As with almost all removals, we support an escape hatch to restoreunexpected(), by defining_HAS_UNEXPECTEDto1. However, this escape hatch conflicts with C++23, which is reusing the identifier forunexpected<E>in<expected>. Therefore, the escape hatch is now blocked with an#errorin C++23 mode. #2709 - Added ASan (Address Sanitizer) annotations to
<string>, allowing additional errors to be detected. #2196 -
<ciso646>now emits a warning in C++20 mode, as it was removed in that Standard. #2710 - Temporarily disabled
join_viewfor non-forward_ranges until LWG-3698 is resolved. #2727 -
<random>distributions now have non-constfunction call operators, making it easier to write portable code. #2732
- Changed
- Improved documentation:
- Improved test coverage:
- Dramatically improved the compiler memory consumption and compile time of two
rangesalgorithm tests. #2657 - Removed
/Zatest coverage. #2714-
/Zais "not recommended" and has been superseded by/permissive-.
-
- Dramatically improved the compiler memory consumption and compile time of two
- Code cleanups:
- Removed compiler bug workarounds. #2611
- Various cleanups (described in detail in the PRs, not repeated here). #2595 #2621 #2656 #2673 #2674 #2675 #2676 #2678 #2679 #2686
- Simplified the preprocessor logic in
<stdatomic.h>for non-compiler tools. #2615 - Removed test workarounds now that VCRuntime properly recognizes Clang's
/std:c++20and/std:c++latestmodes. #2637
- Infrastructure improvements:
- Fixed the build system to avoid relinking any DLLs when rerunning CMake and Ninja with no other changes. #2606
- Added
formatandvalidatetargets to CMake, so it can run clang-format in parallel, and improved how Azure Pipelines runs the Code Format Validation check. #2671 #2697 - Updated dependencies. #2611 #2651 #2714
- Updated build compiler to VS 2022 17.3 Preview 1 (17.2 is now required).
- Updated to Windows 11 SDK 22000. This is now required for building and testing the STL, but not for using it. #2729
- Updated Python to 3.10.4.
- Updated
_MSVC_STL_UPDATE. #2634 #2696
- Merged C++20 Defect Reports:
- Merged C++23 features:
- Merged LWG issue resolutions:
-
LWG-2762 #2376
unique_ptroperator*()should benoexcept -
LWG-2774 #2098
std::functionconstruction vs assignment -
LWG-3146 #2409 Excessive unwrapping in
std::ref/cref -
LWG-3392 #2421
ranges::distance()cannot be used on a move-only iterator with a sized sentinel -
LWG-3470 #2414
convertible-to-non-slicingseems to reject valid case -
LWG-3471 #2567
polymorphic_allocator::allocatedoes not satisfy Cpp17Allocator requirements -
LWG-3480 #2340
directory_iteratorandrecursive_directory_iteratorare not C++20 ranges -
LWG-3519 #2208 Incomplete synopses for
<random>classes -
LWG-3543 #2424 Definition of when
counted_iterators refer to the same sequence isn't quite right -
LWG-3557 #2406 The
static_castexpression inconvertible_tohas the wrong operand -
LWG-3563 #2426
keys_viewexample is broken -
LWG-3574 #2410
common_iteratorshould be completelyconstexpr-able -
LWG-3580 #2417
iota_view'siterator's binaryoperator+should be improved -
LWG-3589 #2425 The
constlvalue reference overload ofgetforsubrangedoes not constrainIto becopyablewhenN == 0 -
LWG-3590 #2404
split_view::base() const &is overconstrained -
LWG-3591 #2411
lazy_split_view<input_view>::inner-iterator::base() &&invalidates outer iterators -
LWG-3592 #2411
lazy_split_viewneeds to check the simpleness ofPattern -
LWG-3593 #2448 Several iterators'
base() const &andlazy_split_view::outer-iterator::value_type::end()missingnoexcept -
LWG-3595 #2410 Exposition-only classes
proxyandpostfix-proxyforcommon_iteratorshould be fullyconstexpr -
LWG-3598 #2560
system_category().default_error_condition(0)is underspecified -
LWG-3610 #2542
iota_view::sizesometimes rejects integer-class types -
LWG-3612 #2586 Inconsistent pointer alignment in
std::format -
LWG-3618 #2566 Unnecessary
iter_movefortransform_view::iterator -
LWG-3621 #2543 Remove feature-test macro
__cpp_lib_monadic_optional -
LWG-3648 #2587
formatshould not printboolwith'c' -
LWG-3654 #2528
basic_format_context::arg(size_t)should benoexcept -
LWG-3657 #2564
std::hash<std::filesystem::path>is not enabled -
LWG-3660 #2549
iterator_traits<common_iterator>::pointershould conform to[iterator.traits] -
LWG-3661 #2544
constinit atomic<shared_ptr<T>> a(nullptr);should work
-
LWG-2762 #2376
- 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 Clang compiler errors when using
ranges::join_view. #2352 - Fixed several runtime correctness bugs in
std::string. #2305 - Fixed a memory leak affecting a specific scenario in P0408R7 Efficient Access To
basic_stringbuf's Buffer. #2361 - Each call to
ranges::clampnow correctly performs at most three projections. #1898 - The STL no longer rejects Clang in CUDA mode, nor the
cl /showIncludes /D__CUDACC__ ...command used by CUDA's msbuild integration to gather dependencies. #2075 - Fixed
allocator::is_always_equalto be deprecated, not removed, in C++20 mode. (It was deprecated by LWG-3170.) #2423 - Fixed
begin()/end()crashing for emptyvalarrays, which also affected range-based for-loops. #2435 - Fixed regression in
ranges::distance(from LWG-3392 which brokeranges::distance(some_array, s)) by speculatively implementing LWG-3664. #2522 - Fixed
basic_string::resize_and_overwrite()to no longer emit "warning C4018: signed/unsigned mismatch" when given certain user-defined function objects. #2525 - Increased
__cpp_lib_conceptsto its final value for C++20,202002L. #2559- It should have been updated in VS 2019 16.6 when P1964R2 "Replacing
booleanWithboolean-testable" was implemented by #565. The presence of that release (or any later release) can be detected by inspecting our implementation-specific macro_MSVC_STL_UPDATE. Coincidentally, the value of_MSVC_STL_UPDATEfor VS 2019 16.6 was also202002L.
- It should have been updated in VS 2019 16.6 when P1964R2 "Replacing
- Fixed numerous tiny bugs discovered by the
libcxxtest suite. #2499 - Fixed a bug in
<format>that sporadically caused incorrect output when formatting floating-point values inhexorscientificnotation with extremely large precisions. #2569 - Fixed a bug in
<charconv>from_chars()floattiebreaking that produced incorrect results. This affected decimal strings that were at the exact midpoint of consecutivefloatvalues, within a narrow range (the smallest and largest affected values were"32768.009765625"and"131071.98828125"), where the tiebreaker rule wanted to round to "even" and "even" happened to be "down", but the implementation incorrectly rounded "up". (doublewas unaffected.) #2366 -
promise<T>now compiles when!is_default_constructible_v<T>. #2568 - Moving from an
optional<const T>now behaves like moving from aconst T: it selectsT's copy constructor. #2460 - Fixed a bug in
<format>that incorrectly acceptedvolatilearguments; the Standard currently says that they should be rejected. #2579
- Fixed Clang compiler errors when using
- Improved performance:
- Optimized
rotl()androtr()in<bit>for 32-bit and 64-bit integers by using compiler intrinsics. #2369 -
reverse_copy()'s vectorized implementation is now activated (for eligible types) in all Standard modes. Previously, only the C++14/17 modes activated this optimization; C++20/23 modes unintentionally used the plain implementation (correct but slower). #2416 - Improved codegen for
gcd()andlcm(). #2343 - Improved
<format>performance when the execution character set is self-synchronizing. For example, code page 1252 "ANSI Latin 1; Western European (Windows)" activates this optimization. The/utf-8compiler option also activates this optimization. #2493 - Improved codegen for
generate_canonical. #2498
- Optimized
- Improved throughput:
- Enhanced behavior:
- Fixed new warnings emitted by Clang 13:
-Wdeprecated-copy(in product and test code) and-Wunused-but-set-variable(in test code only). #2266 - Added ASan (Address Sanitizer) annotations to
<vector>, allowing additional errors to be detected. #2071 #2420 #2464 #2508 - Added a debug assertion to
allocator::deallocate(); passing a null pointer with a non-zero size is an error. #2412 - For supply chain security, replaced checked-in OBJ files (generated by an internal tool
aliasobj) with the linker's/ALTERNATENAMEoption (which is strictly more reproducible, although not officially documented). #2381- In certain scenarios involving separately compiled third-party libraries, this can cause "unresolved external symbol" linker errors. See issue #2655 for an explanation and workarounds.
- Fixed new warnings emitted by Clang 13:
- Improved documentation:
- Improved test coverage:
- Code cleanups:
- Removed compiler bug workarounds. #2338 #2351 #2357 #2474 #2496
- Updated test code to directly pass a format string to
printf(), allowing the compiler to check it. #2346 - Cleaned up clang-formatting. #2356
- Changed the
<charconv>test headers to use include guards, for closer alignment with libc++. #2372 - Improved the clarity of vectorized algorithm implementations by replacing the magic numbers
27and78. #2377 - Improved consistency by always saying
friend constexprinstead of the reverse order. #2419 - Simplified
<ratio>'s implementation by usingconstexprfunctions instead of template metaprogramming. #2450 - Simplified an internal function for opening files. #2095
- Infrastructure improvements:
- Updated dependencies. #2474 #2496 #2514
- Updated build compiler to VS 2022 17.1 Preview 5 (now required).
- Updated Clang to 13.0.0 (now required).
- Updated CMake to 3.22 (now required).
- Updated Python to 3.10.2.
- Added scripts to set
INCLUDE,LIB, andPATHafter building the repo. #2578 - Azure Pipelines now uploads test logs as artifacts, making it easier to investigate test failures when lengthy command lines, compiler output, or runtime output are truncated in the web UI. #2575
- Updated dependencies. #2474 #2496 #2514
- Updated
_MSVC_STL_UPDATE. #2374 #2455 #2519 #2602
- Merged C++20 Defect Reports:
- Merged C++23 features:
-
P0448R4 #2029
<spanstream> -
P0943R6 #2008 Supporting C Atomics In C++
-
Note:
<stdatomic.h>is currently supported when compiling as C++ (/std:c++latest). It is not yet supported when compiling as C (/std:c11and/std:c17), but support for C atomics is planned for a future release. For more info, see the September 2020 blog post "C11 and C17 Standard Support Arriving in MSVC".
-
Note:
-
P1072R10 #2258
basic_string::resize_and_overwrite -
P1147R1 #2262 Printing
volatilePointers -
P1272R4 #2235
byteswap() -
P1425R4 #1994 Iterator Pair Constructors For
stackAndqueue - P1518R2 #2032 Stop Overconstraining Allocators In Container Deduction Guides
-
P1659R3 #1997
ranges::starts_with,ranges::ends_with -
P2136R3 #2019
invoke_r() -
P2251R1 #2259 Require
spanAndbasic_string_viewTo Be Trivially Copyable -
P2401R0 #2263 Conditional
noexceptForexchange()
-
P0448R4 #2029
- Merged LWG issue resolutions:
-
P2259R1 #2059 Repairing Input Range Adaptors And
counted_iterator- Completed by implementing the input range adaptors part.
-
LWG-3422 #2260 Issues of
seed_seq's constructors -
LWG-3506 #1994 Missing allocator-extended constructors for
priority_queue -
LWG-3520 #2200
iter_moveanditer_swapare inconsistent fortransform_view::iterator -
LWG-3522 #1994 Missing requirement on
InputIteratortemplate parameter forpriority_queueconstructors -
LWG-3527 #2194
uses_allocator_construction_argshandles rvalue pairs of rvalue references incorrectly -
LWG-3528 #2160
make_from_tuplecan perform (the equivalent of) a C-style cast -
LWG-3536 #2037 Should
chrono::from_stream()assign zero todurationfor failure? -
LWG-3546 #1991
common_iterator'spostfix-proxyis not quite right -
LWG-3549 #2198
view_interfaceis overspecified to derive fromview_base -
LWG-3554 #2261
chrono::parseneedsconst charT*overloads
-
P2259R1 #2059 Repairing Input Range Adaptors And
- Fixed bugs:
- Fixed
<complex>exp()andpolar()for infinity and NaN inputs. #1584 - Fixed compiler errors when comparing
common_iterators of different types for equality. #2066 - Attempting to actually call
declval()now emits astatic_assertciting the paragraph of the Standard that forbids this. (Previously,declval()was declared but not defined, which was too permissive.) #2101 - Fixed
basic_streambuf::seekoff()andbasic_streambuf::seekpos()to work with custompos_types. #2121 - Restored our guarantee beyond the Standard that
string_viewis trivially move constructible. #2128 - Fixed a bug where
vectorandstringwould terminate vianoexceptinstead of throwinglength_erroras desired when asize_twould be truncated to an allocator's narrowersize_type. #2139 -
<istream>and<ostream>now properly catch and rethrow internal IO exceptions. #2033 - Fixed
<format>to correctly print hexfloats with large precisions. #2157 - Fixed compiler errors when using
constexprvectors with certain user-defined allocators. #2161 - Fixed silent bad codegen in
ranges::stable_sort(), where for certain inputs it would neither sort nor permute the range.ranges::inplace_merge()was also affected. #2188 -
subtract_with_carry_engine's textual representation is now correct. #2088 - Fixed a deadlock in the overload of
condition_variable_any::wait_untiltakingstop_token. #2220 -
u8streampos,u16streampos, andu32streamposare now declared by<iosfwd>as required by the Standard after P0482R6 and P1148R0 were accepted. #2223 - Fixed ARM64EC compiler errors in
<limits>. #2306 - Fixed heap corruption in
fstreamwhen callingputback()followed byclose(). #2189 - Fixed
views::reverseto work properly withranges::reverse_viewlvalues. #2313 - Fixed a bug where the STL's DLL was using Windows Vista's APIs for critical sections and condition variables, instead of the more efficient APIs that were introduced in Windows 7. This was specific to
/MD(dynamic release) and the STL's GitHub CMake build system; it did not affect the legacy build system that's currently used for official builds of the MSVC toolset. #2314 - Fixed a bug affecting older CPUs where the STL generated the newer
tzcntinstruction instead of the fallbackbsfinstruction. This affected<bit>'scountr_zero()andcountr_one(),<numeric>'sgcd()andlcm(), andvector<bool>'s optimized implementations offind()and relational/spaceship operators. #2333 - Fixed minor conformance issues in
basic_string. These changes were specified by P1148R0 "Cleaning Up[strings]", which was almost a pure rewording paper without normative impact. Oops! #2222 - Fixed
ranges::find_end()to return correct values for bidirectional common ranges. #2270 - Fixed compiler errors affecting
ranges::sort(),ranges::search(), and other ranges machinery. #2290 - Fixed
array<T, 0>, allowing it to compile whenTis not default constructible. #2296 - Fixed
allocator::allocate_at_least()which was improperly annotated with__declspec(allocator). #2328
- Fixed
- Improved performance:
- Optimized
steady_clock::now()whenQueryPerformanceFrequency()is exactly 10 MHz, which is very common for modern PCs. #2086 - Improved codegen for x86 atomic loads. #2110
- Optimized the fallback implementation of
popcount(), which is used when compiler intrinsics are unavailable (and is also used at compile time). #2079 - Slightly improved codegen when
<format>prints a pointer in hexadecimal. #2097 - Optimized
<ranges>non-propagating-cachefor trivially destructible types. #2118 - Improved ARM64 codegen for
popcount(), using compiler intrinsics. #2127 - Extended the
memcpy(),memmove(), andmemcmp()optimizations in various algorithms to handle more types. #2158 - Significantly improved the performance of
bitset::count()by using the same machinery aspopcount(). #2201 - Also improved the performance of
std::count()forvector<bool>by usingpopcount()machinery in a more optimizer-friendly way. #2203 -
weak_ptr's converting constructors now avoid locking except when necessary to ensure correctness in virtual inheritance scenarios. #2282- For example, converting
weak_ptr<T>toweak_ptr<const T>now avoids locking.
- For example, converting
- Removed a duplicated assignment in
filesystem::create_directories(). #2304 - Optimized
is_permutation()for reversed sequences. #2043
- Optimized
- Improved throughput:
- Enhanced behavior:
- Changed
numeric_limits<long double>::max_digits10to handle both 64-bit and 80-bitlong double, by restoring the original logic that was used before VS 2017 15.8.-
Note: 80-bit
long doubleremains unsupported by MSVC.
-
Note: 80-bit
- C++ headers now emit clear
#errormessages when they're compiled as C. #2148- This applies to both the "C++ library headers" like
<vector>and the "C++ headers for C library facilities" like<cstdio>.
- This applies to both the "C++ library headers" like
- Improved the wording of
binary_semaphore's debug check messages. #2293
- Changed
- Improved documentation:
- Cited LWG-3581 "The range constructor makes
basic_string_viewnot trivially move constructible" in our implementation of its proposed resolution. #2175 - Removed comments that were citing GH-489, now that LWG-3530 "
BUILTIN-PTR-MEOWshould not opt the type out of syntactic checks" has been officially resolved by the June 2021 virtual plenary meeting. #2186
- Cited LWG-3581 "The range constructor makes
- Improved test coverage:
- Removed a
constructible_fromtest case that was invalidated by recent changes to the Core Language. #2107 - Fixed a test for
next_permutation()andprev_permutation(); the algorithms were fine, but the test never worked and was never called. #2137 - Fixed the test harness to handle non-English Visual Studio installations running on Windows with non-UTF-8 encodings. #2145
- Added
/arch:AVX2to the matrix of compiler options that's used when testing<bit>. #2150 - Skipped more flaky tests in the legacy
tr1test suite. #2202 - Fixed flaky tests in the legacy
tr1test suite that were generating collisions between temporary filenames. #2210 - Fixed test failures on Windows 11. #2265
- Fixed
<chrono>formatting test failures related to locale-dependent time zone abbreviations. #2231
- Removed a
- Code cleanups:
- Moved a helper
structfrom a central internal header to<optional>. #2117 - Cleaned up comments and clang-formatting. #2136
- Removed a spurious overload of
operator>>(basic_istream&&, basic_string&). This didn't affect correctness, but it was neither necessary nor depicted by the Standard. #2138 - Cleaned up various things, notably simplifying
exception_ptr's operators for C++20 and emitting a clear error message when compiling<stdatomic.h>as C. #2140 - Removed unnecessary code in
<cctype>that was attempting to defend against macroizedisalnumetc. #2147 - Removed an unnecessary
reinterpret_cast, and changed somereinterpret_casts fromvoid*toT*to usestatic_castinstead. #2096 - Removed an unnecessary definition of our internal macro
_HAS_CXX23from our central internal headeryvals_core.h. #2226 - Removed comments that were citing proposed resolutions for LWG issues, now that those issues have been officially resolved by the October 2021 virtual plenary meeting. #2269
- Removed unnecessary
(void)casts now that MSVC emits fewer spurious warnings about unreferenced parameters. #2280 - Removed compiler bug workarounds. #2327
- Moved a helper
- Infrastructure improvements:
- Updated
_MSVC_STL_UPDATE. #2183 #2233 #2321
- Merged C++20 Defect Reports:
- Enabled C++20 features for Clang: #2064
- Merged C++23 features:
- P0401R6 #2036 Providing Size Feedback In The Allocator Interface
-
P1048R1 #1950
is_scoped_enum -
P1132R7 #1998
out_ptr(),inout_ptr() -
P1679R3 #1478
contains()Forbasic_string/basic_string_view -
P1682R3 #1828
to_underlying()For Enumerations -
P1951R1 #2009 Default Template Arguments For
pair's Forwarding Constructor -
P1989R2 #2000 Range Constructor For
string_view -
P2162R2 #2006 Inheriting From
variant -
P2166R1 #1995 Prohibiting
basic_stringAndbasic_string_viewConstruction Fromnullptr- This is a common source-breaking change - code that previously had undefined behavior at runtime will now be rejected with compiler errors.
- P2186R2 #2010 Removing Garbage Collection Support
- Merged LWG issue resolutions:
-
LWG-3430 #1968
std::fstream& co. should be constructible fromstring_view - LWG-3494 #1877 Allow ranges to be conditionally borrowed
-
LWG-3502 #1878
elements_viewshould not be allowed to return dangling references - LWG-3518 #2080 Exception requirements on char trait operations unclear
-
LWG-3533 #1993 Make
base() const &consistent across iterator wrappers that supportinput_iterators -
LWG-3541 #1992
indirectly_readable_traitsshould be SFINAE-friendly for all types -
LWG-3548 #2007
shared_ptrconstruction fromunique_ptrshould move (not copy) the deleter -
LWG-3553 #1990 Useless constraint in
split_view::outer-iterator::value_type::begin() -
LWG-3555 #1989
{transform,elements}_view::iterator::iterator_conceptshould considerconst-qualification of the underlying range
-
LWG-3430 #1968
- Merged partial LWG issue resolutions:
- Fixed bugs:
- Fixed
time_put::do_putto avoid crashing when the invalid parameter handler has been changed to not end execution. #1563 - Fixed a compiler error in
ranges::take_view. #1844 - Fixed improper partitioning of forward ranges in the parallel algorithms. #1753
- Fixed an unintentionally dllexported symbol in the import library. #1927
- Fixed a bug in which
ranges::unique_copywould fail to compile with a non-input output iterator. #1933 - Fixed a compiler error when calling
format_to()in a specialization offormatter(see #1961 for an example). #1874 - Fixed compiler errors when calling
views::dropandviews::takewith types that aren't integers, but are convertible to integers (e.g.integral_constant). #1958 - Fixed a compiler error when calling
constexprvector::emplace(position, args...). #1962 - Fixed
jthreadto providenative_handle(). #1966 - Fixed
filesystem::remove()to delete read-only files, as required by the Standard. #1559 - Fixed
mersenne_twister_engine: #1631- Fixed the seeding algorithm to follow N4892 [rand.eng.mers]/8, avoiding an all-zero state. (This is a runtime special case.)
- Fixed the engine's behavior when
m == norn == 1. (This is a compile-time special case, which doesn't affectmt19937andmt19937_64at all.) - Fixed
operator<<()to avoid printing a trailing space after the engine's textual representation.
- Fixed
<chrono>to adjust for leap seconds when formattingfile_time. #1879 - Fixed
chrono::from_stream()to allow a year and a day-of-year to be parsed to atime_point. #1940 - Fixed
filesystem::u8path()to acceptchar8_tsources. #1943 - Fixed
<chrono>to parse subseconds fortime_points. #1987- Also fixed the parsing of
local_timewith a UTC offset.
- Also fixed the parsing of
- Fixed
<chrono>formatting to correctly estimate string widths (see N4892 [format.string.std]/9). #2017 - Fixed a major regression in the
_ITERATOR_DEBUG_LEVEL == 2machinery, where a multithreaded program in debug mode could crash when one thread is modifying a container and another thread is destroying iterators. #2060- This regression affected all Standard modes (C++14/17/20/23) and was introduced by #1546 in VS 2019 16.10.
- Fixed in both VS 2019 16.11.4 and VS 2022 17.0.
- Fixed a compiler error in
pmr::map<K, pair<A, B>>::operator[]. #2023 - Fixed compiler errors in
basic_string'sgetline()andoperator>>()caused by the source-breaking change C++23 P2266R1 "Simpler Implicit Move", first implemented in Clang 13. #2025 -
bit_ceil()now enforces its precondition duringconstexprevaluation, as required by the Standard. #2041 -
clogis no longer tied tocout, and similarly forwclogandwcout, following the Standard. #2056 - In
<ranges>, whenfilter_view,drop_view,drop_while_view, andreverse_viewstore a cached position into an underlying view, they now properly invalidate that cached position when the underlying view is moved from. #1931
- Fixed
- Improved performance:
- Slightly improved debug codegen for
vector<bool>,basic_string, andmap/multimap/set/multiset'sempty()member functions. #1836 - Fixed bloated codegen for
<format>. #1874 - Dramatically improved the performance of
std::find()andstd::count()forvector<bool>, with measured speedups between 19x and 26x (times, not percent). #1131 - Extended our
memcmp/memcpy/memchroptimizations to ranges with contiguous iterators and unreachable sentinels. #1810 -
<format>now detects when it's writing to aback_insert_iteratorfor abasic_stringor avector, and performs a faster call toinsert()at theend()of the container. #1894 -
std::bytenow activates the "trivially swappable" optimization inreverse()andvariant::swap(), so it'll have the same performance asunsigned char. #2044 - Extended the vectorization optimization in
std::swap_ranges()toranges::swap_ranges(), and enhanced it to work for arbitrary contiguous iterators. #2048 - Reduced debug codegen size; an internal assertion macro was emitting completely unused, potentially long strings for function names. #2054
- Slightly improved debug codegen for
- Improved throughput:
-
<format>and<chrono>now avoid including<array>. #2031
-
- Enhanced behavior:
- Added a visualizer for
source_location. #1837 - Added
[[nodiscard]]to thestoi()family of functions in<string>and to various functions in<locale>(collatemember functions,has_facet(), and theisalnum()andtolower()families). #1809 - Added a debug mode precondition check to
forward_list::splice_after(). #2057 - Added visualizers for
bind_front(),u8string(and its iterators),default_sentinel_t,unreachable_sentinel_t,ranges::empty_view,ranges::single_view,ranges::iota_view(and its iterator/sentinel),ranges::ref_view,thread,thread::id,jthread, andfilesystem::path. #1856
- Added a visualizer for
- Improved test coverage:
- Added test coverage for our implementation-specific guarantees that
spanandbasic_string_vieware trivially copyable; P2251 may eventually Standardize these guarantees. #2015 - Fixed the ranges test machinery to properly specialize
std::basic_common_reference; it was unintentionally relying on identical bugs in MSVC and Clang, but EDG correctly diagnosed that the code was non-Standard. #2013 - Fixed a test (for the
abs()overloads in<cmath>and<cstdlib>) that unintentionally hadn't been running in our new GitHub test harness. #2070
- Added test coverage for our implementation-specific guarantees that
- Code cleanups:
- Removed compiler bug workarounds. #1759 #1778 #1920
- Removed unnecessary C casts. #1843
- The STL now uses Standard
_Pragmainstead of non-Standard__pragma(when possible) to internally suppress warnings. #1342 -
<format>now uses_First/_Lastparameter names (instead of_Begin/_End) to be consistent with the rest of the STL. (The connotations are that first/last refers to an arbitrary range that might be a subrange, while begin/end refers to an entire container/view.) #1951 - Removed comments that were citing proposed resolutions for LWG issues, now that those issues have been officially resolved by the June 2021 virtual plenary meeting. #1967
- Improved
vector's implementation, also usingif constexprto simplify code. #1771 - Simplified
<format>'s implementation of type-erased argument storage. #1907 - Filed LWG-3566 "Constraint recursion for
operator<=>(optional<T>, U)" and updated our implementation's comment accordingly. #2011 - Simplified the backwards loop in
char_traits::move(). #2055 - Marked all overriding functions with
override, and removed redundantvirtualkeywords. #2069 - REMOVED THE "SHOUTY COMMENT BANNERS" LIKE
// CLASS TEMPLATE vector; SEE #306 FOR THE RATIONALE. #2074 - Removed an unnecessary check for self-assignment in the compile-time implementation of
char_traits::move(). #2083
- Infrastructure improvements:
- Build system improvements:
- The STL is now built with MSVC's
/ZH:SHA_256switch to improve supply chain integrity. #1829
- The STL is now built with MSVC's
- Updated
_MSVC_STL_UPDATE. Also updated_MSVC_STL_VERSIONto143for the VS 2022 release series. #1897 #1955 #2035 #2091