Skip to content

Changelog

Stephan T. Lavavej edited this page May 28, 2025 · 2393 revisions

Table of Contents

C++23 features generally require the /std:c++23preview or /std:c++latest compiler options.

Upcoming Changes

  • The STL no longer supports targeting Windows 7 / Server 2008 R2, Windows 8 / Server 2012, and Windows 8.1 / Server 2012 R2:
    • Improved the performance of system_clock::now() and atomic::wait() by directly calling APIs that were added in Windows 8. #5432 #5496
    • Improved the performance of STL Hardening by using the MSVC __fastfail intrinsic that was added in Windows 8, and the Clang __builtin_verbose_trap intrinsic. #5433 #5458
    • Simplified the <filesystem> implementation by unconditionally calling APIs that were added in Windows 8. #5434
    • Windows 10 / Server 2016 are our minimum supported operating systems. #5510
  • Merged C++26 features:
  • Merged LWG issue resolutions:
    • LWG-4186 #5444 regex_traits::transform_primary mistakenly detects typeid of a function
  • Fixed bugs:
    • Fixed regex's behavior:
      • For the basic and grep grammars to properly handle ^ caret characters. #5165
      • For the basic and grep grammars to properly handle $ dollar characters. #5362
      • For the basic and grep grammars to make backreferences to unmatched capture groups fail to match anything, instead of matching the empty string "". #5376
      • For the basic and grep grammars to properly handle backslashes inside square-bracket character classes. #5523
      • For POSIX grammars to allow a ] right square bracket at the beginning of a character range. #5364
      • For POSIX grammars to avoid resetting matched capture groups. #5377
      • For the ECMAScript grammar's (?!pattern) negative lookahead assertions to make capture groups within them always match nothing after the assertions succeed. #5366
      • For the ECMAScript grammar's \b word boundary assertion to not match the empty string "" (and inversely for the \B negative word boundary assertion). #5375
      • For the ECMAScript grammar's \c escapes to require the following ControlLetter to be an ASCII alphabetic character. #5524
        • That is, only \ca through \cz and \cA through \cZ are allowed.
      • For the ECMAScript grammar to reset all capture groups to "unmatched" at the start of each repetition of a loop. #5456
      • For the ECMAScript grammar to reject bogus groups by throwing a regex_error with the code regex_constants::error_badrepeat, removing the non-Standard code regex_constants::error_syntax that was previously used. #5542
        • That is, only non-capture groups (?:meow) and positive/negative lookahead assertions (?=meow)/(?!meow) are allowed; other characters following (? are bogus. Notably, the C++ Standard doesn't support the lookbehind assertions (?<=meow)/(?<!meow) that were added in later versions of ECMAScript.
      • For the ECMAScript, basic, grep, and awk grammars to properly handle escape sequences. #5380
        • POSIX grammars now accept \] as an identity escape for a right square bracket. #5399
      • For capture groups to follow ECMAScript's depth-first and POSIX's leftmost-longest matching rules. #5218
        • Removed unnecessary code for POSIX's leftmost-longest rule, reducing stack space consumption. #5405
      • For empty matches to follow ECMAScript's and POSIX's slightly different rules. #5494
      • For negated character class escapes (\D for non-digits, \S for non-whitespace, \W for non-words) inside square-bracket character classes when matching against Unicode characters. #5403 #5487
        • This completes a series of fixes started by #5160 and #5214 in VS 2022 17.14.
      • For combinations of character class escapes inside square-bracket character classes (like [\w\s] for words and whitespace) when matching against Unicode characters. #5438
      • For character ranges with regex_constants::collate to follow the locale's collation order. #5238
      • For collating symbols and equivalence classes. #5392 #5444
      • For small character ranges containing U+00FF and U+0100. #5437
    • Fixed collate<wchar_t> to follow the locale's collation order when compiling with /Zc:wchar_t- (making wchar_t a non-Standard typedef for unsigned short) and linking to the STL dynamically (with /MD or /MDd). #5361
    • Fixed how collate::do_transform() handles wrongly encoded input. #5431
    • Fixed collate::do_hash() to return equal hashes for strings that collate as equivalent. #5469
    • Fixed ranges::enable_view to correctly report false for ranges::view_interface itself. #5369 #5407
    • Fixed <filesystem> status functions to avoid failing for invalid paths when the current directory is a network path. #5381
    • Fixed compiler errors in repeat_view's piecewise constructor for certain scenarios. #5388
    • Fixed compiler errors in constexpr copy() for vector<bool>. #5347
      • This fixed a regression that was introduced by #3353 in VS 2022 17.9.
    • Fixed the barrier constructor's exception specification to be conditionally "strengthened", instead of unconditionally. #5398
    • Fixed heap-use-after-free bugs in our undocumented/quasi-supported _HAS_EXCEPTIONS=0 mode when constructing system_error, chrono::ambiguous_local_time, and chrono::nonexistent_local_time. #5406
    • Fixed compiler errors when passing volatile ranges to basic_string's from_range constructor and append_range(), assign_range(), insert_range(), and replace_with_range() member functions. #5409
    • Fixed nth_element() and ranges::nth_element to have worst-case linear complexity, instead of quadratic. #5100
    • Fixed compiler errors when passing iterators with unusual integer-class difference types to vectorized algorithms. #5471
    • Fixed destroy(), destroy_at(), destroy_n(), ranges::destroy, ranges::destroy_at, and ranges::destroy_n to destroy objects during constant evaluation even when they're trivially destructible. #5449
    • Fixed num_get::do_get() for bool to properly handle bad digit groupings. #5476
    • Fixed thread::hardware_concurrency() to correctly report the total number of logical processors when more than 64 are available, for both single-socket and multi-socket machines. #5459
    • Fixed <mdspan>'s layout_stride::mapping<E>::is_exhaustive() to correctly handle unusual extents. #5477
    • Fixed reverse_copy() and ranges::reverse_copy being improperly vectorized for pair<T&, U&> on 32-bit targets (where such pairs are 8 bytes). #5528
      • This fixed a regression that was introduced by #804 in VS 2019 16.8.
  • Improved performance:
    • Started using [[msvc::no_unique_address]] as a space optimization in several C++23 components. #4960
    • Added vectorized implementations of:
      • basic_string::find_first_not_of() and basic_string::find_last_not_of() for one character. #5102
      • basic_string::find_first_not_of() and basic_string::find_last_not_of() for multiple characters. #5206
      • adjacent_find() and ranges::adjacent_find. #5331
      • unique() and ranges::unique. #5092 #5363
      • search_n() and ranges::search_n for small values of n. #5352
      • remove_copy(), ranges::remove_copy, unique_copy(), and ranges::unique_copy. #5355
      • is_sorted_until() and ranges::is_sorted_until. #5420 #5540
      • search(), ranges::search, default_searcher, find_end(), and ranges::find_end, for 4-byte and 8-byte elements. #5484 #5519
        • They were vectorized for 1-byte and 2-byte elements in VS 2022 17.13.
      • rotate() and ranges::rotate. #5502 #5525
    • Improved the vectorized implementations of:
      • reverse_copy() and ranges::reverse_copy. #5493
    • Used Clang's builtin __is_trivially_equality_comparable to improve the performance of equal(), ranges::equal, and many vectorized algorithms for more types. #5527
    • Optimized search_n() and ranges::search_n for n=1 to internally call find() and ranges::find. #5346
    • Improved codegen for has_single_bit(), especially when popcount() intrinsics are unconditionally available. #5367 #5534
      • For example, x86/x64 with /arch:AVX and ARM64 can unconditionally use popcount() intrinsics.
    • Optimized poisson_distribution's constructor by avoiding unnecessary work. #5411
    • Implemented an exponential speedup (yes, literally) for minstd_rand and minstd_rand0's discard() member function. #5412
    • Improved linear_congruential_engine performance by using our modern internal implementation of 128-bit integers. #5436 #5473
    • Improved performance for regex matching:
      • Avoided quadratic complexity when a regex starts with a ? question mark quantifier or several alternatives. #5457
      • Significantly improved performance when a regex starts with a + plus quantifier (or {min,} or {min,max} quantifiers requiring at least 1 repetition). #5509
      • Avoided unnecessary allocations when a regex contains no capture groups. #5518
      • Avoided generating unnecessary "if" nodes with a single branch, improving performance for all regex patterns. #5539
    • Significantly improved performance for chrono::tzdb::locate_zone() by using binary searches for time zone names. #5548
  • Enhanced behavior:
    • Used a new Clang compiler intrinsic to implement is_scoped_enum. #5358
    • Added debug checks for overlapping ranges in replace_copy(), replace_copy_if(), reverse_copy(), rotate_copy(), and their ranges counterparts. #5495
    • Improved <mdspan>'s debug checks in layout_stride::mapping<E>'s constructor. #5505
    • Avoided compiler warnings in vector<bool>::max_size() with the compiler's upcoming implementation of Defect Report P2280R4. #5550
  • Improved debugger visualization:
    • Fixed an off-by-one mistake in the displayed year for system_clock::time_point. #5389
    • Updated the visualizer for system_clock::time_point to recognize the synonymous but slightly different type name emitted by Clang. #5390
  • Improved test coverage:
    • Updated our LLVM submodule, including new tests. #5349 #5467
    • Updated an iter_rvalue_reference_t test in response to a compiler change. #5378
    • Changed the benchmark build from /O2 /Ob1 to /O2 /Ob2, producing more realistic and useful results. #5370
    • Fixed sporadic test failures by avoiding excessive compiler memory consumption. #5383
    • Added benchmarks for:
      • fill() and fill_n(). #5400
      • reverse() and reverse_copy(). #5493
    • Improved the consistency of how normal_distribution is used in benchmarks and tests. #5404
    • Improved the runtime performance of the major test for vectorized algorithms. #5425
    • Added more test coverage for search_n() and ranges::search_n. #5439 #5440
    • Increased the consistency of several benchmarks by adding allocators to control alignment. #5443
    • Updated the test harness to properly detect the locale name "Czech_Czechia.1250". #5480
    • Updated source_location test coverage to handle upcoming changes in the EDG front-end used for IntelliSense. #5551
  • Improved documentation:
    • Clarified our machine-searchable SPDX-License-Identifier comments to properly describe how we used Ryu to implement <charconv>. #5401
    • Fixed confusing comments around the control macro for vectorizing algorithms with floating-point types. #5417
  • Code cleanups:
    • Simplified the control flow in ranges::search_n. #5343
    • Simplified the implementation of regex quantifiers. #5253
    • Removed comments that were citing proposed resolutions for LWG issues, now that those issues have been officially resolved by the November 2024 meeting. #5360
    • Removed compiler bug workarounds. #5410
    • Significantly cleaned up the implementation of vectorized algorithms. #5429 #5450 #5485 #5532
    • Removed an unnecessarily verbose internal macro. #5475
    • Removed unnecessary code for constant evaluation in char_traits::assign(). #5488
    • Various cleanups (described in detail in the PRs, not repeated here). #5498 #5500 #5541
  • Infrastructure improvements:
    • Added ARM64EC stages to Azure Pipelines. #5492 #5517 #5521
      • Including an Early Build, benchmarks, and tests.
    • Updated dependencies. #5370 #5410 #5478 #5512 #5530
      • Updated build compiler to VS 2022 17.14 Preview 7.
      • Updated CMake to 3.31 (now required).
      • Updated Google Benchmark to 1.9.4.
      • Updated Python to 3.13.3.
  • Updated _MSVC_STL_UPDATE and _MSVC_STL_VERSION. #5385 #5464

VS 2022 17.14

  • Merged C++26 features:
    • P3323R1 #5213 Forbid atomic<cv T>, Specify atomic_ref<cv T>
  • 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_HARDENING to 1 project-wide.
      • As C++26 Contracts are not yet implemented, this defaults to calling __fastfail() for hardened precondition violations.
  • 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_TOMBSTONES to 1 project-wide.
  • Merged LWG issue resolutions:
    • LWG-3133 #5157 Modernizing numeric type requirements
    • LWG-3886 #5232 Monad mo' problems (in optional and expected)
    • LWG-3899 #5303 co_yielding elements of an lvalue generator is unnecessarily inefficient
    • LWG-3900 #5150 The allocator_arg_t overloads of generator::promise_type::operator new should not be constrained
    • LWG-3918 #5135 #5170 std::uninitialized_move/_n and guaranteed copy elision
    • LWG-3956 #5334 chrono::parse uses from_stream as a customization point
    • LWG-4014 #5132 LWG-3809 changes behavior of some existing std::subtract_with_carry_engine code
    • LWG-4027 #5221 possibly-const-range should prefer returning const R&
    • LWG-4084 #5151 std::fixed ignores std::uppercase
    • LWG-4112 #5152 has-arrow should require operator->() to be const-qualified
    • LWG-4119 #5220 generator::promise_type::yield_value(ranges::elements_of<R, Alloc>)'s nested generator may be ill-formed
    • LWG-4124 #5155 Cannot format zoned_time with resolution coarser than seconds
    • LWG-4135 #5131 The helper lambda of std::erase for list should specify return type as bool
    • 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_lock self-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):
    • LWG-3424 #5232 optional::value_or should never return a cv-qualified type
  • Fixed bugs:
    • Fixed system_category().message() to prefer US English, followed by the system locale, with an ultimate fallback of FormatMessageA's behavior for dwLanguageId == 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.
    • Fixed regex's behavior:
      • To reject bogus character class ranges like R"([\d-e])". #5158
      • For negated character class escapes (\D for non-digits, \S for non-whitespace, \W for non-words) when matching against Unicode characters:
        • Outside square-bracket character classes. #5160
        • Inside square-bracket character classes (partially fixed). #5214
      • For character ranges in case-insensitive mode. #5164
      • For the basic grammar 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
    • 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() for stack, queue, and priority_queue to forward the range to c.append_range() when possible, exactly as depicted in the Standard. #5168
    • Fixed code to call ranges::begin and ranges::end exactly as depicted in the Standard:
    • Fixed compiler errors in range_formatter involving 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::counted involving 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_ispanstream from a modifiable basic_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
  • Improved performance:
    • Added vectorized implementations of:
      • basic_string::find() for a character. #5101
    • Improved the vectorized implementations of:
      • basic_string::find_first_of() and basic_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_rand and minstd_rand0 random 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
  • 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 the visualizers for basic_string_view and its iterators by suppressing irrelevant pointer values. #5176
    • Dramatically simplified how the visualizers for basic_string and its iterators are implemented. #5177
  • Improved test coverage:
    • Simplified the test harness by dropping ctest. Now we always directly invoke stl-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() and vector::reserve(). #5241
    • Skipped libcxx tests in response to a new compiler warning C5321, which warns when the resolution to CWG-1656 affects a u8 string literal. #5283
  • Code cleanups:
    • Removed compiler bug workarounds. #5186 #5247 #5257 #5284 #5335
    • Removed usage of [[likely]] and [[unlikely]], which are discouraged by the compiler team. #5255
    • Various cleanups (described in detail in the PRs, not repeated here). #5336
  • Infrastructure improvements:
    • Updated dependencies. #5186 #5247 #5257 #5284 #5335
      • Updated build compiler to VS 2022 17.14 Preview 2 (now required).
      • Updated Clang to 19.1.5 (now required).
      • Updated Google Benchmark to 1.9.1.
      • Updated Python to 3.13.2.
      • Updated VMs to compute-optimized F32as_v6.
  • Updated _MSVC_STL_UPDATE. #5162 #5217 #5264 #5323

VS 2022 17.13

  • Merged C++23 features:
  • Merged C++23 Defect Reports:
    • P3107R5 #4821 Permit An Efficient Implementation Of <print>
      • P3235R3 std::print More Types Faster With Less Memory
  • 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_merge with certain combinations of elements, projections, and comparisons. #4927
    • Fixed compiler errors in basic_ispanstream's constructor and basic_ispanstream::span() taking ReadOnlyRange&& with highly unusual types. #4938
    • Fixed compiler errors in the highly unusual scenario of calling basic_string and basic_string_view's find_first_of() family of member functions for program-defined "unicorn" character types. #4951
    • Fixed compiler errors when constructing optional from highly unusual types. #4961
    • Fixed sequence container emplacement functions (e.g. vector::emplace_back()) to avoid emitting "warning C5046: Symbol involving type with internal linkage not defined" for highly unusual types. #4963 #4980
      • This also fixed ODR violations when mixing C++14 with C++17-and-later translation units calling sequence container emplacement functions for any types.
    • Fixed ODR violations when mixing C++17 with C++20-and-later translation units calling list/forward_list::remove/remove_if/unique(). #4975
    • Fixed compiler errors in variant's converting constructor and converting assignment operator for certain types. #4966
    • Fixed bitset's streaming operator operator>>(basic_istream<CharT, Traits>&, bitset<N>&) to use the stream's Traits to compare characters. #4970
    • Fixed basic_string and list's internal constructors to avoid disrupting highly unusual scenarios. #4976
    • Fixed compiler errors when constructing a packaged_task from a move-only function object. #4946
    • For Clang /fp:fast, fixed <cmath> and <limits> to avoid emitting -Wnan-infinity-disabled warnings, except when numeric_limits::infinity()/quiet_NaN()/signaling_NaN() are specifically called. #4990
    • Fixed ranges::copy_n to properly handle negative values of n (as a no-op) when activating our memmove() optimization. #5046
      • Also fixed our memmove() optimization (used by copy_n(), ranges::copy_n, and more) to avoid emitting compiler warnings with certain iterators.
    • Fixed filesystem::directory_entry::refresh() to avoid sporadically failing for nonexistent network paths on Windows 11 24H2. #5077
    • Fixed basic_istream::get() and basic_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 to static_assert that the container elements are assignable from the range's reference type. #5086
    • Fixed compiler errors in various ranges algorithms when used with views::iota in certain scenarios. #5091
  • 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, and default_searcher, for 1-byte and 2-byte elements. #4745
      • find_end() and ranges::find_end, for 1-byte and 2-byte elements. #4943 #5041 #5042
      • bitset's constructors from strings. #4839
      • remove() and ranges::remove. #4987
    • Improved the vectorized implementations of:
      • ranges::minmax, now activated for 1-byte and 2-byte elements. #4913
      • The minmax_element() and minmax() algorithm families. #4917 #5016
    • Helped the compiler auto-vectorize:
    • ranges algorithms now unwrap output iterators, avoiding unnecessary checking. #5015 #5027
    • Optimized bitset's streaming operators. #5008
    • Optimized the newline-printing overloads println(FILE*), println(ostream&), and nullary println(). #4672
    • Updated array and vector's spaceship comparison operators to take advantage of the vectorized implementation of lexicographical_compare_three_way(). #5078
    • Extended the "key extraction" optimization in the unique associative containers (both ordered and unordered) to handle more types. #5050
    • Optimized filesystem::symlink_status() by avoiding unnecessary Windows API calls. #5071
  • Improved throughput:
    • 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, and chrono_literals from a commonly-included internal header to <chrono>. #5105
      • This has source-breaking impact. If you see compiler errors complaining that it doesn't recognize chrono types like system_clock or UDLs like 1729ms, you need to include <chrono> specifically, instead of assuming that headers like <thread> will drag it in.
  • Enhanced behavior:
    • Changed an internal pair constructor to be private. #4979
    • Fixed a CodeQL warning by replacing a squirrelly memcpy() call in the filesystem implementation (that was intentionally performing a read overrun) with two cromulent memcpy() calls. #4933
    • Silenced CodeQL warnings. #4942 #4985 #5072
    • Added a visualizer for system_clock::time_point. #5005
    • Changed some vector machinery to use scope guards instead of throw;, making debugging easier when exceptions are thrown. #4977
    • Improved regex_error::what()'s message for regex_constants::error_badbrace. #5025
    • Improved optional<T>::swap()'s static_assert messages when T isn't both move constructible and swappable. #5065
    • Removed locale::id's non-Standard constructor from size_t and implicit conversion operator to size_t. #5067
      • For user-visible headers, at least. They remain dllexported for binary compatibility.
    • Improved mutex assertions to distinguish "unlock of unowned mutex" from "unlock of mutex not owned by the current thread". #5099
  • Improved test coverage:
    • Updated tests to work with Clang 18. #4932 #4937
    • Fixed sporadic failures in a timed_mutex test. #4973
    • Extended CUDA test coverage beyond C++14, adding C++17 and C++20. #4974
    • When Python psutil is installed, the test harness now supports a priority parameter, defaulting to idle. #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(), and lexicographical_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 as noexcept. #4940
    • Various cleanups (described in detail in the PRs, not repeated here). #4945 #5014 #5058
    • Refactored internal usage of the tuple-like and pair-like concepts. #4983
    • Used if constexpr to simplify eldritch horrors from beyond spacetime locale 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
  • Infrastructure improvements:
    • Updated dependencies. #4947 #5017 #5082
      • Updated build compiler to VS 2022 17.13 Preview 1 (and 17.12 is now required).
      • Updated Clang to 18.1.8 (now required).
      • Updated CMake to 3.30 (now required).
      • Updated Python to 3.13.0 (now required).
      • Updated the PR/CI system to Windows Server 2025.
  • Build system improvements:
    • Removed a workaround in the benchmark build. #4928
  • Updated _MSVC_STL_UPDATE. #4926 #4994 #5064

VS 2022 17.12

  • Merged C++26 features:
  • Merged C++23 features:
    • P2286R8 Formatting Ranges, completed by:
      • Implemented range-default-formatter. #4716
      • Implemented formatter for the container adaptors stack, queue, and priority_queue. #4825
  • Merged LWG issue resolutions:
    • LWG-3944 #4784 Formatters converting sequences of char to sequences of wchar_t
    • LWG-4061 #4758 Should std::basic_format_context be default-constructible/copyable/movable?
    • LWG-4074 #4814 compatible-joinable-ranges is underconstrained
    • LWG-4083 #4786 views::as_rvalue should reject non-input ranges
    • LWG-4096 #4785 views::iota(views::iota(0)) should be rejected
    • LWG-4098 #4815 views::adjacent<0> should reject non-forward ranges
    • LWG-4106 #4757 basic_format_args should not be default-constructible
  • Merged proposed resolutions for LWG issues (not yet accepted for the C++ Working Draft, but we've chosen to implement this speculatively):
  • Fixed bugs:
    • Fixed static analysis warning C26818 "Switch statement does not cover all cases. Consider adding a 'default' label (es.79)." #4715
      • Note: The STL has always attempted to be /W4 /analyze clean, but does not yet attempt to be clean with respect to all additional static analysis rulesets.
    • Fixed atomic_ref::is_lock_free() on x64 to return true for 1, 2, 4, 8, and 16 bytes only. #4729
    • Fixed uniform_real_distribution<RealType>{min, max} to stay within the inclusive-exclusive range [min, max) and never generate the max value exactly. #4740
    • Fixed filesystem::weakly_canonical() to avoid failing on Windows 11 24H2 in certain scenarios. #4844
    • Fixed condition_variable_any::wait_for() to consistently use steady_clock. #4755
    • Removed a broken and useless visualizer for ranges::view_interface. #4835
    • Fixed the visualizer for move_iterator to use the updated name of its internal data member. #4836
      • This fixed a regression that was introduced by #1080 in VS 2019 16.8.
    • Fixed expected to conditionally delete its copy constructor and copy assignment operator as depicted in the Standard, which affects overload resolution in unusual scenarios. #4837
    • Fixed time_put/put_time() to avoid crashing for:
      • Unknown conversion specifiers. (Now they're copied unchanged.) #4840
      • Out-of-range tm fields. (Now they're replaced with a ? character.) #4883
    • Fixed compiler errors in ranges::inplace_merge and ranges::minmax in unusual scenarios. #4841
    • Fixed truncation warnings when:
      • Using conjunction and disjunction with non-bool_constant arguments. #4846
      • Calling algorithms with contiguous iterators whose difference types are narrower than ptrdiff_t. #4898
    • 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(), and transform_exclusive_scan() when the intermediate and output types are different. #4701
    • Fixed the vectorized implementation of floating-point ranges::min, ranges::max, and ranges::minmax to return correct results for negative zeros. #4734
    • Fixed Clang compiler errors for certain constexpr variant scenarios by adding a compiler bug workaround. #4903
    • Fixed compiler errors when using <random> machinery (e.g. generate_canonical(), uniform_real_distribution) via Standard Library Modules or Standard Library Header Units by adding compiler bug workarounds. #4906
    • Fixed compiler errors when using <format> machinery in user-defined modules by adding compiler bug workarounds. #4919
    • Fixed <format> to avoid crashing when formatting floating-point values with large precisions combined with the # (alternate form) or L (locale-specific form) options. #4907
  • Improved performance:
    • Overhauled condition_variable and condition_variable_any, improving their performance and simplifying their implementation. #4720
      • As a result, condition_variable, timed_mutex, and recursive_timed_mutex are now trivially destructible.
    • Improved the performance of search(), find_end(), and their ranges forms by removing calls to memcmp() 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:
      • The minmax_element() and minmax() algorithm families. #4659 #4739
    • Slightly improved the performance of ranges::min, ranges::max, and ranges::minmax for certain iterator types. #4775
    • On x86, the STL is now built with /arch:SSE2 (which is the default) instead of /arch:IA32. #4741
    • Used Clang builtins to improve the performance of <cmath>'s floating-point comparison functions for mixed types. #4648
    • On x64, atomic_ref<16 bytes> now always uses the cmpxchg16b instruction. #4751
    • Streaming a small bitset to a basic_ostream now avoids dynamically allocating memory. #4818
    • Slightly improved performance for Clang ARM64 <atomic>. #4870
    • Updated char_traits<wchar_t/char16_t>::compare/find/length, find, and ranges::find to call wmemcmp/wmemchr/wcslen when possible, which will improve performance after a future UCRT header update. #4873 #4894
    • Optimized equality comparisons for empty strings and string_views. #4904
  • Improved throughput:
    • Improved <queue> and <stack> throughput by dragging in fewer headers. #4707
  • Enhanced behavior:
    • P0608R3 Improving variant's Converting Constructor/Assignment is now unconditionally active (i.e. in C++17 mode and above), instead of being restricted to C++20 mode and above. #4713
      • This C++20 behavioral change was originally implemented by #1629 in VS 2019 16.10. While it can have source-breaking impact, it generally has highly desirable effects.
    • Changed the machinery for copying map/set nodes to use scope guards instead of throw;, making debugging easier when exceptions are thrown. #4749
    • Added debug checks to gcd() and lcm() for precondition violations. #4776
    • Added "lifetimebound" attributes to min, max, clamp, ranges::min, ranges::max, and ranges::clamp, allowing MSVC code analysis and Clang -Wdangling to detect dangling references in improper usage. #4838
    • Updated the precondition check in vector::pop_back() to be guarded by _CONTAINER_DEBUG_LEVEL. #4849
    • Renamed the parameters of views::iota and views::repeat to provide better IDE guidance. #4908
    • Simplified internal locale facet machinery to use class-specific operator new and operator delete overloads in both release and debug mode. #4916
  • Improved debugger visualization:
    • Inserted the debug visualizer changes from #3848, #4274, #4835, and #4836 in the VS repo so they'll finally ship.
  • Improved test coverage:
    • Updated LLVM-derived test coverage for <any>, <optional>, and <variant>. #4713
    • Properly tested the resolution of LWG-4053 "Unary call to std::views::repeat does not decay the argument". #4748
    • Improved the benchmarks for bitset::to_string(). #4817
    • Updated our LLVM submodule, including new tests. #4862 #4910
    • Re-enabled tests that were previously skipped in the libcxx test suite. #4721 #4732 #4911
    • Skipped tests that were sporadically failing due to incorrect timing assumptions. #4885
    • Added compiler bug workarounds. #4895
    • Tested the resolution of LWG-4105 "ranges::ends_with's Returns misses difference casting". #4897
    • Updated tests to work with Clang 19. #4912
    • Avoided unnecessary usage of rand(), which is considered harmful. #4921
  • Code cleanups:
    • Removed compiler bug workarounds. #4725 #4782 #4889
    • Various cleanups (described in detail in the PRs, not repeated here). #4724 #4900 #4920
    • Replaced SFINAE with concepts in C++20-and-later code. #4718 #4819
    • Removed a significant amount of unused code calling GetCurrentPackageId. #4742
    • Simplified how ranges::equal compares sizes. #4864
  • Reverted change:
    • Removed then temporarily restored support for targeting Windows 7 and Server 2008 R2. This will be permanently removed in the future. #4742 #4857
  • Infrastructure improvements:
    • The STL now clearly rejects attempts to:
      • Build a preset whose architecture doesn't match the compiler command prompt. #4709
      • Test a build whose architecture doesn't match the compiler command prompt. #4717
    • Updated dependencies. #4725 #4824 #4889
      • Updated build compiler to VS 2022 17.12 Preview 1 (and 17.11 is now required).
      • Updated CMake to 3.29 (now required).
      • Updated Ninja to 1.12.1.
      • Updated Python to 3.12.5.
      • Updated Google Benchmark to 1.8.5. #4851
  • Build system improvements:
    • Added /Zc:preprocessor to build the STL with the conformant preprocessor. #4886
    • Improved how CMake searches for the clang-format executable. #4888
  • Updated _MSVC_STL_UPDATE. #4706 #4708 #4754 #4872

Older Versions

Clone this wiki locally