Tags: NylteJ/STL
Tags
VS 2022 17.14 - Merged C++26 features: * [P3323R1](https://wg21.link/P3323R1) [microsoft#5213](microsoft#5213) Forbid `atomic<cv T>`, Specify `atomic_ref<cv T>` - Merged *partial* C++26 features: * [P3471R4](https://wg21.link/P3471R4) [microsoft#5274](microsoft#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](microsoft#5286) are not yet implemented, this defaults to calling [`__fastfail()`](https://learn.microsoft.com/en-us/cpp/intrinsics/fastfail?view=msvc-170) for hardened precondition violations. - Related behavior enhancement: * Implemented "destructor tombstones" to mitigate use-after-free mistakes. [microsoft#5318](microsoft#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](https://cplusplus.github.io/LWG/issue3133) [microsoft#5157](microsoft#5157) Modernizing numeric type requirements * [LWG-3886](https://cplusplus.github.io/LWG/issue3886) [microsoft#5232](microsoft#5232) Monad mo' problems (in `optional` and `expected`) * [LWG-3899](https://cplusplus.github.io/LWG/issue3899) [microsoft#5303](microsoft#5303) `co_yield`ing elements of an lvalue `generator` is unnecessarily inefficient * [LWG-3900](https://cplusplus.github.io/LWG/issue3900) [microsoft#5150](microsoft#5150) The `allocator_arg_t` overloads of `generator::promise_type::operator new` should not be constrained * [LWG-3918](https://cplusplus.github.io/LWG/issue3918) [microsoft#5135](microsoft#5135) [microsoft#5170](microsoft#5170) `std::uninitialized_move/_n` and guaranteed copy elision * [LWG-3956](https://cplusplus.github.io/LWG/issue3956) [microsoft#5334](microsoft#5334) `chrono::parse` uses `from_stream` as a customization point * [LWG-4014](https://cplusplus.github.io/LWG/issue4014) [microsoft#5132](microsoft#5132) [LWG-3809](https://cplusplus.github.io/LWG/issue3809) changes behavior of some existing `std::subtract_with_carry_engine` code * [LWG-4027](https://cplusplus.github.io/LWG/issue4027) [microsoft#5221](microsoft#5221) *`possibly-const-range`* should prefer returning `const R&` * [LWG-4084](https://cplusplus.github.io/LWG/issue4084) [microsoft#5151](microsoft#5151) `std::fixed` ignores `std::uppercase` * [LWG-4112](https://cplusplus.github.io/LWG/issue4112) [microsoft#5152](microsoft#5152) *`has-arrow`* should require `operator->()` to be `const`-qualified * [LWG-4119](https://cplusplus.github.io/LWG/issue4119) [microsoft#5220](microsoft#5220) `generator::promise_type::yield_value(ranges::elements_of<R, Alloc>)`'s nested `generator` may be ill-formed * [LWG-4124](https://cplusplus.github.io/LWG/issue4124) [microsoft#5155](microsoft#5155) Cannot format `zoned_time` with resolution coarser than seconds * [LWG-4135](https://cplusplus.github.io/LWG/issue4135) [microsoft#5131](microsoft#5131) The helper lambda of `std::erase` for `list` should specify return type as `bool` * [LWG-4140](https://cplusplus.github.io/LWG/issue4140) [microsoft#5129](microsoft#5129) Useless default constructors for bit reference types * [LWG-4144](https://cplusplus.github.io/LWG/issue4144) [microsoft#5201](microsoft#5201) Disallow `unique_ptr<T&, D>` * [LWG-4169](https://cplusplus.github.io/LWG/issue4169) [microsoft#5128](microsoft#5128) `std::atomic<T>`'s default constructor should be constrained * [LWG-4172](https://cplusplus.github.io/LWG/issue4172) [microsoft#5337](microsoft#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](https://cplusplus.github.io/LWG/issue3424) [microsoft#5232](microsoft#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`](https://learn.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-formatmessagea#parameters)'s behavior for `dwLanguageId == 0`. [microsoft#5104](microsoft#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 [microsoft#2669](microsoft#2669) in VS 2022 17.3. * Fixed `regex`'s behavior: + To reject bogus character class ranges like `R"([\d-e])"`. [microsoft#5158](microsoft#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. [microsoft#5160](microsoft#5160) - Inside square-bracket character classes (partially fixed). [microsoft#5214](microsoft#5214) + For character ranges in case-insensitive mode. [microsoft#5164](microsoft#5164) + For the `basic` grammar to parse a single digit for backreferences. [microsoft#5167](microsoft#5167) + For its internal buffers to grow geometrically. [microsoft#5175](microsoft#5175) + For the special character `.` (dot). [microsoft#5192](microsoft#5192) + For its constructor to accept (null, zero) arguments. [microsoft#5211](microsoft#5211) * Fixed `filesystem::equivalent()` to return correct results when shared folders are involved. [microsoft#5130](microsoft#5130) * Fixed `chrono::weekday`'s constructor to avoid integer overflow for extreme inputs. [microsoft#5156](microsoft#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. [microsoft#5168](microsoft#5168) * Fixed code to call `ranges::begin` and `ranges::end` exactly as depicted in the Standard: + `ranges::to`. [microsoft#5173](microsoft#5173) + `range_formatter`. [microsoft#5178](microsoft#5178) * Fixed compiler errors in `range_formatter` involving highly unusual contiguous ranges. [microsoft#5187](microsoft#5187) * Fixed heterogeneous lookup for unordered containers to follow the Standard, allowing braced initializer lists to be used as arguments. [microsoft#5208](microsoft#5208) * Fixed compiler errors in `views::counted` involving highly unusual types. [microsoft#5223](microsoft#5223) * Fixed integer overflow in `this_thread::sleep_for()` with extremely small units (e.g. picoseconds). [microsoft#5237](microsoft#5237) * Fixed `basic_string::reserve()`'s ASan annotations to detect writes to its unused capacity. [microsoft#5252](microsoft#5252) * Fixed how `<format>` handles field width for alternate form general floating-point. [microsoft#5261](microsoft#5261) * Fixed compiler errors when constructing a `basic_ispanstream` from a modifiable `basic_string`. [microsoft#5309](microsoft#5309) + This fixed a regression that was introduced by [microsoft#4938](microsoft#4938) in VS 2022 17.13. * Fixed compiler errors when using `<format>` in a CUDA project, by adding a compiler bug workaround. [microsoft#5335](microsoft#5335) * Fixed compiler errors when converting between different specializations of `basic_const_iterator`. [microsoft#5325](microsoft#5325) - Improved performance: * Added vectorized implementations of: + `basic_string::find()` for a character. [microsoft#5101](microsoft#5101) * Improved the vectorized implementations of: + `basic_string::find_first_of()` and `basic_string::find_last_of()`. [microsoft#5029](microsoft#5029) * `regex_traits::translate()` is now an identity function, as required by the Standard, instead of an expensive locale operation. [microsoft#5209](microsoft#5209) * The STL now takes advantage of compiler support for C++23 [P1169R4](https://wg21.link/P1169R4) `static operator()` in earlier Standard modes, slightly improving codegen. [microsoft#5284](microsoft#5284) [microsoft#5312](microsoft#5312) * Optimized the `minstd_rand` and `minstd_rand0` random number engines by avoiding constant divisions. [microsoft#5256](microsoft#5256) * Slightly improved `move_only_function`'s constructors to do less work when setting the object to be empty. [microsoft#5328](microsoft#5328) - Enhanced behavior: * `std::expected`, `std::unexpected`, and all STL exception types are now marked `[[nodiscard]]`. [microsoft#5174](microsoft#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. [microsoft#5197](microsoft#5197) * Changed the STL to avoid using `is_trivial`, which is being deprecated in C++26. [microsoft#5202](microsoft#5202) * Improved the STL's debug checks with better messages and fewer branches. [microsoft#5270](microsoft#5270) - Improved debugger visualization: * Improved the visualizers for `basic_string_view` and its iterators by suppressing irrelevant pointer values. [microsoft#5176](microsoft#5176) * Dramatically simplified how the visualizers for `basic_string` and its iterators are implemented. [microsoft#5177](microsoft#5177) - Improved test coverage: * Simplified the test harness by dropping `ctest`. Now we always directly invoke `stl-lit.py`. [microsoft#5169](microsoft#5169) * Improved the test harness to warn only once when a compiler is missing. [microsoft#5199](microsoft#5199) * Categorized libcxx test failures. [microsoft#5231](microsoft#5231) * Updated our LLVM submodule, including new tests. [microsoft#5235](microsoft#5235) * Added test coverage for the ASan annotations in `basic_string::reserve()` and `vector::reserve()`. [microsoft#5241](microsoft#5241) * Skipped `libcxx` tests in response to a new compiler warning C5321, which warns when the resolution to [CWG-1656](https://cplusplus.github.io/CWG/issues/1656.html) affects a `u8` string literal. [microsoft#5283](microsoft#5283) - Code cleanups: * Removed compiler bug workarounds. [microsoft#5186](microsoft#5186) [microsoft#5247](microsoft#5247) [microsoft#5257](microsoft#5257) [microsoft#5284](microsoft#5284) [microsoft#5335](microsoft#5335) * Removed usage of `[[likely]]` and `[[unlikely]]`, which are discouraged by the compiler team. [microsoft#5255](microsoft#5255) * Various cleanups (described in detail in the PRs, not repeated here). [microsoft#5336](microsoft#5336) - Infrastructure improvements: * Updated dependencies. [microsoft#5186](microsoft#5186) [microsoft#5247](microsoft#5247) [microsoft#5257](microsoft#5257) [microsoft#5284](microsoft#5284) [microsoft#5335](microsoft#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](https://learn.microsoft.com/en-us/azure/virtual-machines/sizes/compute-optimized/fasv6-series). - Updated `_MSVC_STL_UPDATE`. [microsoft#5162](microsoft#5162) [microsoft#5217](microsoft#5217) [microsoft#5264](microsoft#5264) [microsoft#5323](microsoft#5323)
VS 2022 17.13 - Merged C++23 features: * [P2502R2](https://wg21.link/P2502R2) [microsoft#4953](microsoft#4953) `<generator>`: Synchronous Coroutine Generator For Ranges + [P2787R1](https://wg21.link/P2787R1) `pmr::generator` - Merged C++23 Defect Reports: * [P3107R5](https://wg21.link/P3107R5) [microsoft#4821](microsoft#4821) Permit An Efficient Implementation Of `<print>` + [P3235R3](https://wg21.link/P3235R3) `std::print` More Types Faster With Less Memory - Fixed bugs: * Fixed an infinite loop in `deque::shrink_to_fit()`. [microsoft#4955](microsoft#4955) + This fixed a regression that was introduced by [microsoft#4091](microsoft#4091) in VS 2022 17.10. * Fixed compiler errors when constructing highly unusual `unique_ptr`s (storing fancy pointers) from unspeakably evil relics of the forgotten past. [microsoft#4922](microsoft#4922) * Fixed compiler errors when calling `ranges::inplace_merge` with certain combinations of elements, projections, and comparisons. [microsoft#4927](microsoft#4927) * Fixed compiler errors in `basic_ispanstream`'s constructor and `basic_ispanstream::span()` taking `ReadOnlyRange&&` with highly unusual types. [microsoft#4938](microsoft#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. [microsoft#4951](microsoft#4951) * Fixed compiler errors when constructing `optional` from highly unusual types. [microsoft#4961](microsoft#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. [microsoft#4963](microsoft#4963) [microsoft#4980](microsoft#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()`. [microsoft#4975](microsoft#4975) * Fixed compiler errors in `variant`'s converting constructor and converting assignment operator for certain types. [microsoft#4966](microsoft#4966) * Fixed `bitset`'s streaming operator `operator>>(basic_istream<CharT, Traits>&, bitset<N>&)` to use the stream's `Traits` to compare characters. [microsoft#4970](microsoft#4970) * Fixed `basic_string` and `list`'s internal constructors to avoid disrupting highly unusual scenarios. [microsoft#4976](microsoft#4976) * Fixed compiler errors when constructing a `packaged_task` from a move-only function object. [microsoft#4946](microsoft#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. [microsoft#4990](microsoft#4990) * Fixed `ranges::copy_n` to properly handle negative values of n (as a no-op) when activating our `memmove()` optimization. [microsoft#5046](microsoft#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. [microsoft#5077](microsoft#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. [microsoft#5073](microsoft#5073) * Fixed `assign_range()` for sequence containers to `static_assert` that the container elements are assignable from the range's reference type. [microsoft#5086](microsoft#5086) * Fixed compiler errors in various ranges algorithms when used with `views::iota` in certain scenarios. [microsoft#5091](microsoft#5091) - Improved performance: * Added vectorized implementations of: + `basic_string::find_first_of()`. [microsoft#4744](microsoft#4744) + `basic_string::find_last_of()`. [microsoft#4934](microsoft#4934) + `basic_string::find()` for a substring. [microsoft#5048](microsoft#5048) + `basic_string::rfind()` for a substring. [microsoft#5057](microsoft#5057) + `basic_string::rfind()` for a single character. [microsoft#5087](microsoft#5087) + `search()`, `ranges::search`, and `default_searcher`, for 1-byte and 2-byte elements. [microsoft#4745](microsoft#4745) + `find_end()` and `ranges::find_end`, for 1-byte and 2-byte elements. [microsoft#4943](microsoft#4943) [microsoft#5041](microsoft#5041) [microsoft#5042](microsoft#5042) + `bitset`'s constructors from strings. [microsoft#4839](microsoft#4839) + `remove()` and `ranges::remove`. [microsoft#4987](microsoft#4987) * Improved the vectorized implementations of: + `ranges::minmax`, now activated for 1-byte and 2-byte elements. [microsoft#4913](microsoft#4913) + The `minmax_element()` and `minmax()` algorithm families. [microsoft#4917](microsoft#4917) [microsoft#5016](microsoft#5016) * Helped the compiler auto-vectorize: + `swap()` and `ranges::swap` for arrays. [microsoft#4991](microsoft#4991) + `adjacent_difference()`. [microsoft#4958](microsoft#4958) [microsoft#5061](microsoft#5061) [microsoft#5079](microsoft#5079) [microsoft#5097](microsoft#5097) * `ranges` algorithms now unwrap output iterators, avoiding unnecessary checking. [microsoft#5015](microsoft#5015) [microsoft#5027](microsoft#5027) * Optimized `bitset`'s streaming operators. [microsoft#5008](microsoft#5008) * Optimized the newline-printing overloads `println(FILE*)`, `println(ostream&)`, and nullary `println()`. [microsoft#4672](microsoft#4672) * Updated `array` and `vector`'s spaceship comparison operators to take advantage of the vectorized implementation of `lexicographical_compare_three_way()`. [microsoft#5078](microsoft#5078) * Extended the "key extraction" optimization in the unique associative containers (both ordered and unordered) to handle more types. [microsoft#5050](microsoft#5050) * Optimized `filesystem::symlink_status()` by avoiding unnecessary Windows API calls. [microsoft#5071](microsoft#5071) - Improved throughput: * Improved C++23 throughput by not including all of `<ostream>` (which drags in `<format>`) unless the Standard requires it. [microsoft#4936](microsoft#4936) * Improved C++23 throughput of `<queue>`, `<stack>`, `<stacktrace>`, and `<thread>` by not including all of `<format>`. [microsoft#5003](microsoft#5003) * Moved `system_clock`, `high_resolution_clock`, and `chrono_literals` from a commonly-included internal header to `<chrono>`. [microsoft#5105](microsoft#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`. [microsoft#4979](microsoft#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. [microsoft#4933](microsoft#4933) * Silenced CodeQL warnings. [microsoft#4942](microsoft#4942) [microsoft#4985](microsoft#4985) [microsoft#5072](microsoft#5072) * Added a visualizer for `system_clock::time_point`. [microsoft#5005](microsoft#5005) * Changed some `vector` machinery to use scope guards instead of `throw;`, making debugging easier when exceptions are thrown. [microsoft#4977](microsoft#4977) * Improved `regex_error::what()`'s message for `regex_constants::error_badbrace`. [microsoft#5025](microsoft#5025) * Improved `optional<T>::swap()`'s `static_assert` messages when `T` isn't both move constructible and swappable. [microsoft#5065](microsoft#5065) * Removed `locale::id`'s non-Standard constructor from `size_t` and implicit conversion operator to `size_t`. [microsoft#5067](microsoft#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". [microsoft#5099](microsoft#5099) - Improved test coverage: * Updated tests to work with Clang 18. [microsoft#4932](microsoft#4932) [microsoft#4937](microsoft#4937) * Fixed sporadic failures in a `timed_mutex` test. [microsoft#4973](microsoft#4973) * Extended CUDA test coverage beyond C++14, adding C++17 and C++20. [microsoft#4974](microsoft#4974) * When Python `psutil` is installed, the test harness now supports a `priority` parameter, defaulting to `idle`. [microsoft#5032](microsoft#5032) * Increased the consistency of the `swap_ranges()` benchmark by adding allocators to control alignment. [microsoft#5043](microsoft#5043) * Updated our LLVM submodule, including new tests. [microsoft#5038](microsoft#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. [microsoft#5063](microsoft#5063) - Code cleanups: * Removed compiler bug workarounds. [microsoft#4939](microsoft#4939) [microsoft#4944](microsoft#4944) [microsoft#4947](microsoft#4947) [microsoft#5017](microsoft#5017) [microsoft#5103](microsoft#5103) * Explicitly marked `packaged_task`'s defaulted move constructor and move assignment operator as `noexcept`. [microsoft#4940](microsoft#4940) * Various cleanups (described in detail in the PRs, not repeated here). [microsoft#4945](microsoft#4945) [microsoft#5014](microsoft#5014) [microsoft#5058](microsoft#5058) * Refactored internal usage of the *`tuple-like`* and *`pair-like`* concepts. [microsoft#4983](microsoft#4983) * Used `if constexpr` to simplify ~~eldritch horrors from beyond spacetime~~ locale facets. [microsoft#5001](microsoft#5001) * Simplified control flow in `basic_string::find_first_not_of()`/`find_last_not_of()`. [microsoft#5006](microsoft#5006) * Refactored the vectorized implementation of `bitset::to_string()`. [microsoft#5013](microsoft#5013) * Replaced SFINAE with concepts in C++20-and-later code. [microsoft#5044](microsoft#5044) - Improved documentation: * Removed an inaccurate comment in `list`'s move assignment operator. [microsoft#5024](microsoft#5024) - Infrastructure improvements: * Updated dependencies. [microsoft#4947](microsoft#4947) [microsoft#5017](microsoft#5017) [microsoft#5082](microsoft#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. [microsoft#4928](microsoft#4928) - Updated `_MSVC_STL_UPDATE`. [microsoft#4926](microsoft#4926) [microsoft#4994](microsoft#4994) [microsoft#5064](microsoft#5064)
VS 2022 17.12 - Merged C++26 features: * [P0952R2](https://wg21.link/P0952R2) [microsoft#4740](microsoft#4740) [microsoft#4850](microsoft#4850) A New Specification For `generate_canonical()` * [P2407R5](https://wg21.link/P2407R5) [microsoft#4743](microsoft#4743) Freestanding Library: Partial Classes * [P2833R2](https://wg21.link/P2833R2) [microsoft#4743](microsoft#4743) Freestanding Library: `inout` `expected` `span` * [P2968R2](https://wg21.link/P2968R2) [microsoft#4777](microsoft#4777) Make `std::ignore` A First-Class Object * [P2997R1](https://wg21.link/P2997R1) [microsoft#4816](microsoft#4816) Removing The Common Reference Requirement From The Indirectly Invocable Concepts - Merged C++23 features: * [P2286R8](https://wg21.link/P2286R8) Formatting Ranges, completed by: + Implemented *`range-default-formatter`*. [microsoft#4716](microsoft#4716) + Implemented `formatter` for the container adaptors `stack`, `queue`, and `priority_queue`. [microsoft#4825](microsoft#4825) - Merged LWG issue resolutions: * [LWG-3944](https://cplusplus.github.io/LWG/issue3944) [microsoft#4784](microsoft#4784) Formatters converting sequences of `char` to sequences of `wchar_t` * [LWG-4061](https://cplusplus.github.io/LWG/issue4061) [microsoft#4758](microsoft#4758) Should `std::basic_format_context` be default-constructible/copyable/movable? * [LWG-4074](https://cplusplus.github.io/LWG/issue4074) [microsoft#4814](microsoft#4814) *`compatible-joinable-ranges`* is underconstrained * [LWG-4083](https://cplusplus.github.io/LWG/issue4083) [microsoft#4786](microsoft#4786) `views::as_rvalue` should reject non-input ranges * [LWG-4096](https://cplusplus.github.io/LWG/issue4096) [microsoft#4785](microsoft#4785) `views::iota(views::iota(0))` should be rejected * [LWG-4098](https://cplusplus.github.io/LWG/issue4098) [microsoft#4815](microsoft#4815) `views::adjacent<0>` should reject non-forward ranges * [LWG-4106](https://cplusplus.github.io/LWG/issue4106) [microsoft#4757](microsoft#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): * [LWG-4139](https://cplusplus.github.io/LWG/issue4139) [microsoft#4902](microsoft#4902) \[time.zone.leap\] recursive constraint in `<=>` - Fixed bugs: * Fixed static analysis warning [C26818](https://learn.microsoft.com/en-us/cpp/code-quality/c26818?view=msvc-170) "Switch statement does not cover all cases. Consider adding a 'default' label (es.79)." [microsoft#4715](microsoft#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. [microsoft#4729](microsoft#4729) * Fixed `uniform_real_distribution<RealType>{min, max}` to stay within the inclusive-exclusive range `[min, max)` and never generate the `max` value exactly. [microsoft#4740](microsoft#4740) * Fixed `filesystem::weakly_canonical()` to avoid failing on Windows 11 24H2 in certain scenarios. [microsoft#4844](microsoft#4844) * Fixed `condition_variable_any::wait_for()` to consistently use `steady_clock`. [microsoft#4755](microsoft#4755) * Removed a broken and useless visualizer for `ranges::view_interface`. [microsoft#4835](microsoft#4835) * Fixed the visualizer for `move_iterator` to use the updated name of its internal data member. [microsoft#4836](microsoft#4836) + This fixed a regression that was introduced by [microsoft#1080](microsoft#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. [microsoft#4837](microsoft#4837) * Fixed `time_put`/`put_time()` to avoid crashing for: + Unknown conversion specifiers. (Now they're copied unchanged.) [microsoft#4840](microsoft#4840) + Out-of-range `tm` fields. (Now they're replaced with a `?` character.) [microsoft#4883](microsoft#4883) * Fixed compiler errors in `ranges::inplace_merge` and `ranges::minmax` in unusual scenarios. [microsoft#4841](microsoft#4841) * Fixed truncation warnings when: + Using `conjunction` and `disjunction` with non-`bool_constant` arguments. [microsoft#4846](microsoft#4846) + Calling algorithms with contiguous iterators whose difference types are narrower than `ptrdiff_t`. [microsoft#4898](microsoft#4898) * Improved `array::size()` and `<mdspan>` static analysis annotations, fixing warnings in some scenarios. [microsoft#4856](microsoft#4856) * Fixed `lexicographical_compare_three_way()` to enforce the Standard's mandate that the comparison returns a comparison category type. [microsoft#4878](microsoft#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. [microsoft#4701](microsoft#4701) * Fixed the vectorized implementation of floating-point `ranges::min`, `ranges::max`, and `ranges::minmax` to return correct results for negative zeros. [microsoft#4734](microsoft#4734) * Fixed Clang compiler errors for certain `constexpr` `variant` scenarios by adding a compiler bug workaround. [microsoft#4903](microsoft#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. [microsoft#4906](microsoft#4906) * Fixed compiler errors when using `<format>` machinery in user-defined modules by adding compiler bug workarounds. [microsoft#4919](microsoft#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. [microsoft#4907](microsoft#4907) - Improved performance: * Overhauled `condition_variable` and `condition_variable_any`, improving their performance and simplifying their implementation. [microsoft#4720](microsoft#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. [microsoft#4654](microsoft#4654) [microsoft#4753](microsoft#4753) * Improved the ARM64 performance of `popcount()` by using new compiler intrinsics. [microsoft#4695](microsoft#4695) [microsoft#4733](microsoft#4733) * Further improved the vectorized implementations of: + The `minmax_element()` and `minmax()` algorithm families. [microsoft#4659](microsoft#4659) [microsoft#4739](microsoft#4739) * Slightly improved the performance of `ranges::min`, `ranges::max`, and `ranges::minmax` for certain iterator types. [microsoft#4775](microsoft#4775) * On x86, the STL is now built with `/arch:SSE2` (which is the default) instead of `/arch:IA32`. [microsoft#4741](microsoft#4741) + See [`/arch` (x86)](https://learn.microsoft.com/en-us/cpp/build/reference/arch-x86?view=msvc-170) on Microsoft Learn. * Used Clang builtins to improve the performance of `<cmath>`'s floating-point comparison functions for mixed types. [microsoft#4648](microsoft#4648) * On x64, `atomic_ref<16 bytes>` now always uses the cmpxchg16b instruction. [microsoft#4751](microsoft#4751) * Streaming a small `bitset` to a `basic_ostream` now avoids dynamically allocating memory. [microsoft#4818](microsoft#4818) * Slightly improved performance for Clang ARM64 `<atomic>`. [microsoft#4870](microsoft#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. [microsoft#4873](microsoft#4873) [microsoft#4894](microsoft#4894) * Optimized equality comparisons for empty `string`s and `string_view`s. [microsoft#4904](microsoft#4904) - Improved throughput: * Improved `<queue>` and `<stack>` throughput by dragging in fewer headers. [microsoft#4707](microsoft#4707) - Enhanced behavior: * [P0608R3](https://wg21.link/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. [microsoft#4713](microsoft#4713) + This C++20 behavioral change was originally implemented by [microsoft#1629](microsoft#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. [microsoft#4749](microsoft#4749) * Added debug checks to `gcd()` and `lcm()` for precondition violations. [microsoft#4776](microsoft#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. [microsoft#4838](microsoft#4838) * Updated the precondition check in `vector::pop_back()` to be guarded by `_CONTAINER_DEBUG_LEVEL`. [microsoft#4849](microsoft#4849) * Renamed the parameters of `views::iota` and `views::repeat` to provide better IDE guidance. [microsoft#4908](microsoft#4908) * Simplified internal locale facet machinery to use class-specific `operator new` and `operator delete` overloads in both release and debug mode. [microsoft#4916](microsoft#4916) - Improved debugger visualization: * Inserted the debug visualizer changes from [microsoft#3848](microsoft#3848), [microsoft#4274](microsoft#4274), [microsoft#4835](microsoft#4835), and [microsoft#4836](microsoft#4836) in the VS repo so they'll finally ship. - Improved test coverage: * Updated LLVM-derived test coverage for `<any>`, `<optional>`, and `<variant>`. [microsoft#4713](microsoft#4713) * Properly tested the resolution of [LWG-4053](https://cplusplus.github.io/LWG/issue4053) "Unary call to `std::views::repeat` does not decay the argument". [microsoft#4748](microsoft#4748) * Improved the benchmarks for `bitset::to_string()`. [microsoft#4817](microsoft#4817) * Updated our LLVM submodule, including new tests. [microsoft#4862](microsoft#4862) [microsoft#4910](microsoft#4910) * Re-enabled tests that were previously skipped in the `libcxx` test suite. [microsoft#4721](microsoft#4721) [microsoft#4732](microsoft#4732) [microsoft#4911](microsoft#4911) * Skipped tests that were sporadically failing due to incorrect timing assumptions. [microsoft#4885](microsoft#4885) * Added compiler bug workarounds. [microsoft#4895](microsoft#4895) * Tested the resolution of [LWG-4105](https://cplusplus.github.io/LWG/issue4105) "`ranges::ends_with`'s *Returns* misses difference casting". [microsoft#4897](microsoft#4897) * Updated tests to work with Clang 19. [microsoft#4912](microsoft#4912) * Avoided unnecessary usage of `rand()`, which is considered harmful. [microsoft#4921](microsoft#4921) - Code cleanups: * Removed compiler bug workarounds. [microsoft#4725](microsoft#4725) [microsoft#4782](microsoft#4782) [microsoft#4889](microsoft#4889) * Various cleanups (described in detail in the PRs, not repeated here). [microsoft#4724](microsoft#4724) [microsoft#4900](microsoft#4900) [microsoft#4920](microsoft#4920) * Replaced SFINAE with concepts in C++20-and-later code. [microsoft#4718](microsoft#4718) [microsoft#4819](microsoft#4819) * Removed a significant amount of unused code calling `GetCurrentPackageId`. [microsoft#4742](microsoft#4742) * Simplified how `ranges::equal` compares sizes. [microsoft#4864](microsoft#4864) - Reverted change: * Removed then temporarily restored support for targeting Windows 7 and Server 2008 R2. This will be permanently removed in 18.0 Preview 1. [microsoft#4742](microsoft#4742) [microsoft#4857](microsoft#4857) - Infrastructure improvements: * The STL now clearly rejects attempts to: - Build a preset whose architecture doesn't match the compiler command prompt. [microsoft#4709](microsoft#4709) - Test a build whose architecture doesn't match the compiler command prompt. [microsoft#4717](microsoft#4717) * Updated dependencies. [microsoft#4725](microsoft#4725) [microsoft#4824](microsoft#4824) [microsoft#4889](microsoft#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. [microsoft#4851](microsoft#4851) - Build system improvements: * Added [`/Zc:preprocessor`](https://learn.microsoft.com/en-us/cpp/build/reference/zc-preprocessor?view=msvc-170) to build the STL with the conformant preprocessor. [microsoft#4886](microsoft#4886) * Improved how CMake searches for the clang-format executable. [microsoft#4888](microsoft#4888) - Updated `_MSVC_STL_UPDATE`. [microsoft#4706](microsoft#4706) [microsoft#4708](microsoft#4708) [microsoft#4754](microsoft#4754) [microsoft#4872](microsoft#4872)
VS 2022 17.11 - Merged C++26 features: * [P2875R4](https://wg21.link/P2875R4) [microsoft#4532](microsoft#4532) Undeprecate `polymorphic_allocator::destroy` * [P3142R0](https://wg21.link/P3142R0) [microsoft#4611](microsoft#4611) Printing Blank Lines With `println()` - Merged *partial* C++23 features: * [P2286R8](https://wg21.link/P2286R8) Formatting Ranges: + Implemented `formatter` for `pair` and `tuple`. [microsoft#4438](microsoft#4438) [microsoft#4631](microsoft#4631) [microsoft#4681](microsoft#4681) + Implemented `range_formatter`. [microsoft#4642](microsoft#4642) - Merged LWG issue resolutions: * [LWG-3767](https://cplusplus.github.io/LWG/issue3767) [microsoft#4542](microsoft#4542) `codecvt<charN_t, char8_t, mbstate_t>` incorrectly added to locale * [LWG-3919](https://cplusplus.github.io/LWG/issue3919) [microsoft#4526](microsoft#4526) `enumerate_view` may invoke UB for sized common non-forward underlying ranges * [LWG-3950](https://cplusplus.github.io/LWG/issue3950) [microsoft#4510](microsoft#4510) `std::basic_string_view` comparison operators are overspecified * [LWG-3984](https://cplusplus.github.io/LWG/issue3984) [microsoft#4543](microsoft#4543) `ranges::to`'s recursion branch may be ill-formed * [LWG-4012](https://cplusplus.github.io/LWG/issue4012) [microsoft#4529](microsoft#4529) `common_view::begin`/`end` are missing the *`simple-view`* check * [LWG-4013](https://cplusplus.github.io/LWG/issue4013) [microsoft#4530](microsoft#4530) `lazy_split_view::`*`outer-iterator`*`::value_type` should not provide default constructor * [LWG-4016](https://cplusplus.github.io/LWG/issue4016) [microsoft#4539](microsoft#4539) *`container-insertable`* checks do not match what *`container-inserter`* does * [LWG-4035](https://cplusplus.github.io/LWG/issue4035) [microsoft#4525](microsoft#4525) `single_view` should provide `empty` * [LWG-4053](https://cplusplus.github.io/LWG/issue4053) [microsoft#4685](microsoft#4685) Unary call to `std::views::repeat` does not decay the argument * [LWG-4054](https://cplusplus.github.io/LWG/issue4054) [microsoft#4540](microsoft#4540) Repeating a `repeat_view` should repeat the view - Fixed bugs: * Fixed `condition_variable::wait_until()` and `condition_variable_any::wait_until()` to consistently use the given `time_point`'s clock type, instead of also depending on the system clock. This also fixed `condition_variable::wait_for()` to consistently use `steady_clock`. [microsoft#4457](microsoft#4457) * Fixed `<format>` to always perform compile-time format string checking for `wchar_t`, even when the narrow execution character set doesn't support it. [microsoft#4459](microsoft#4459) * Fixed compiler errors when `constexpr basic_string` interacted with the undocumented compiler option `/d1initall`. [microsoft#4474](microsoft#4474) * Fixed `atomic_ref` for 16-byte objects to correctly report `is_lock_free()` and `is_always_lock_free` on x64 (when the optional mode `_STD_ATOMIC_ALWAYS_USE_CMPXCHG16B` is defined to be `1`) and ARM64 (always). [microsoft#4478](microsoft#4478) * Removed the vectorized implementation of `ranges::find` with `unreachable_sentinel` as it was fundamentally incompatible with ASan (Address Sanitizer). [microsoft#4486](microsoft#4486) + This was introduced by [microsoft#2434](microsoft#2434) in VS 2022 17.3. * Fixed incorrect results from the vectorized implementation of `ranges::find_last` for certain combinations of value and element types. [microsoft#4561](microsoft#4561) + This fixed a regression that was introduced by [microsoft#3925](microsoft#3925) in VS 2022 17.9. * Fixed the STL to avoid emitting the off-by-default warning C4365 (signed/unsigned mismatch) when the [`/ZI` compiler option](https://learn.microsoft.com/en-us/cpp/build/reference/z7-zi-zi-debug-information-format?view=msvc-170) (debug info for Edit and Continue) is used. [microsoft#4487](microsoft#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). [microsoft#4527](microsoft#4527) * Fixed compiler errors involving incomplete types in: + `pair` and `tuple` machinery. [microsoft#4488](microsoft#4488) * Fixed `make_from_tuple()` to properly implement [LWG-3528](https://wg21.link/lwg3528) with a constraint instead of a `static_assert`. [microsoft#4528](microsoft#4528) * Added integral overloads for `<cmath>`'s classification functions `fpclassify()`, `isfinite()`, `isinf()`, `isnan()`, `isnormal()`, and `signbit()`. [microsoft#4537](microsoft#4537) * Fixed `is_trivial` to correctly handle unusual types. [microsoft#4576](microsoft#4576) * Avoided mentioning `__vectorcall` for ARM64EC, where it is not yet supported. [microsoft#4600](microsoft#4600) * Fixed `std.ixx` to include `<intrin.h>` in the Global Module Fragment, fixing compiler errors with `import std;` in certain scenarios. [microsoft#4626](microsoft#4626) * Fixed compiler errors when a user-defined `formatter` calls `basic_format_parse_context::next_arg_id()` with an empty format-spec. [microsoft#4640](microsoft#4640) * Fixed compiler errors when using `<expected>` in `/permissive` mode. [microsoft#4658](microsoft#4658) + *Note:* While `/permissive` mode is discouraged, it's currently supported for most STL components. * Fixed compiler errors when inheriting `expected`'s constructors in certain scenarios. [microsoft#4664](microsoft#4664) * Fixed `pair`'s self-`swap()` behavior to follow the Standard by self-swapping its elements. [microsoft#4674](microsoft#4674) * Fixed `atomic<void*>` and `atomic_ref<void*>` to provide `difference_type`. [microsoft#4689](microsoft#4689) - Improved performance: * Helped the compiler auto-vectorize: + `replace_copy()`, `replace_copy_if()`, `ranges::replace_copy`, and `ranges::replace_copy_if`. [microsoft#4431](microsoft#4431) + `iota()`. [microsoft#4627](microsoft#4627) + `ranges::iota`. [microsoft#4647](microsoft#4647) * Added vectorized implementations of: + `find_first_of()` and `ranges::find_first_of`. [microsoft#4466](microsoft#4466) [microsoft#4557](microsoft#4557) [microsoft#4563](microsoft#4563) [microsoft#4587](microsoft#4587) [microsoft#4623](microsoft#4623) + `mismatch()` and `ranges::mismatch`. [microsoft#4495](microsoft#4495) [microsoft#4538](microsoft#4538) [microsoft#4584](microsoft#4584) + `replace()` and `ranges::replace` for 32-bit and 64-bit elements. [microsoft#4554](microsoft#4554) [microsoft#4584](microsoft#4584) + `lexicographical_compare()`, `ranges::lexicographical_compare`, and `lexicographical_compare_three_way()`. [microsoft#4552](microsoft#4552) * Further improved the vectorized implementations of: + `count()`, `find()`, `ranges::count`, `ranges::find`, and `ranges::find_last`. [microsoft#4570](microsoft#4570) [microsoft#4614](microsoft#4614) * Used Clang builtins to improve the performance of `<cmath>`'s floating-point classification and comparison functions: [microsoft#4612](microsoft#4612) + Classification: `isfinite()`, `isinf()`, `isnan()`, `isnormal()` + Comparison: `isgreater()`, `isgreaterequal()`, `isless()`, `islessequal()`, `islessgreater()`, `isunordered()` * Improved `normal_distribution::operator()(engine, param)` by avoiding unnecessarily recomputing coefficients. [microsoft#4618](microsoft#4618) - Improved throughput: * Slightly improved `<mdspan>` throughput by using short-circuiting `conjunction_v` instead of fold expressions. [microsoft#4559](microsoft#4559) * Refactored floating-point machinery, improving throughput by reducing inclusion of various headers. [microsoft#4615](microsoft#4615) * Improved `<string_view>` throughput by no longer dragging in most of `<string>`'s contents. [microsoft#4633](microsoft#4633) - Improved diagnostics: * Improved compiler error messages when `formatter<UDT>::format()` isn't `const`. [microsoft#4461](microsoft#4461) * Massively improved the compiler error messages for `get<T>(tuple<Types...>)` when `T` doesn't occur exactly once in `Types`. [microsoft#4578](microsoft#4578) * Significantly improved compiler error messages when `ranges::to` is unable to construct the requested result. [microsoft#4608](microsoft#4608) - 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. [microsoft#4550](microsoft#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: + `views::take`. [microsoft#4551](microsoft#4551) + The `iota_view(first, last)` constructor. [microsoft#4616](microsoft#4616) * Improved the wording of `[[nodiscard("reason")]]` messages for `empty()`. [microsoft#4572](microsoft#4572) * Extended C++20's `static_assert(is_clock_v<Clock>)` enforcement for various codepaths to C++14/17 (with internal machinery; `is_clock_v` itself remains guarded by C++20 mode). [microsoft#4585](microsoft#4585) * Changed the internal constructors of `basic_format_arg::handle` and `basic_format_context` to be `private`. [microsoft#4489](microsoft#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: [microsoft#4605](microsoft#4605) + `stdext::checked_array_iterator`, `stdext::make_checked_array_iterator()`, `stdext::unchecked_array_iterator`, and `stdext::make_unchecked_array_iterator()`. + `basic_istream`'s `ipfx()`/`isfx()` and `basic_ostream`'s `opfx()`/`osfx()` member functions. + `discard_block`, `linear_congruential`, `mersenne_twister`, `subtract_with_carry`, `uniform_int`, and `uniform_real`. - Removed non-Standard code: * Deleted the `<cvt/meow>` subdirectory of headers, shrinking VS installations by 4.8 MB across 78 files. [microsoft#4458](microsoft#4458) * Deleted the `<experimental/meow>` headers that provided `std::experimental::erase()/erase_if()`. [microsoft#4470](microsoft#4470) * Removed the non-Standard `_FPOSOFF` macro and the non-Standard `std::fpos::seekpos()` member function. [microsoft#4606](microsoft#4606) * Removed the non-Standard `lower_bound()`/`upper_bound()` member functions from the unordered associative containers. [microsoft#4607](microsoft#4607) - Improved test coverage: * Added benchmarks for vectorized `swap_ranges()`. [microsoft#4589](microsoft#4589) * Added a workaround for an ASan failure in an ancient STL test. [microsoft#4652](microsoft#4652) * Reduced the execution time of the vectorized algorithms test by using the result of `mismatch()` when testing `lexicographical_compare()` and `lexicographical_compare_three_way()`. [microsoft#4656](microsoft#4656) * Improved the `<filesystem>` test, including its coverage of `rename()` and how it generates names for temporary files and directories. [microsoft#4665](microsoft#4665) * Re-enabled tests that were previously skipped in the `libcxx` test suite. [microsoft#4698](microsoft#4698) * Updated our LLVM submodule, including new tests. [microsoft#4702](microsoft#4702) - Code cleanups: * Removed compiler bug workarounds. [microsoft#4475](microsoft#4475) [microsoft#4576](microsoft#4576) * Various cleanups (described in detail in the PRs, not repeated here). [microsoft#4465](microsoft#4465) [microsoft#4490](microsoft#4490) [microsoft#4493](microsoft#4493) * Improved the script for downloading Unicode data files when updating `<format>`. [microsoft#4469](microsoft#4469) * Consistently centralized how algorithms invoke their vectorized implementations. [microsoft#4544](microsoft#4544) * Simplified how `condition_variable` is implemented as a wrapper around the Windows API `CONDITION_VARIABLE`. [microsoft#4545](microsoft#4545) * Removed `inline` from `constexpr` variable templates. [microsoft#4546](microsoft#4546) + This became possible after all of our supported compilers implemented [CWG-2387](https://wg21.link/cwg2387). Note that for `constexpr` variables, only primary templates and partial specializations no longer need to be marked as `inline`; explicit specializations and ordinary non-templates still need to be marked as `inline`. * Changed machinery for updating `chrono::tzdb::version` to activate the Named Return Value Optimization. [microsoft#4577](microsoft#4577) * Updated tests to use C++17 terse `static_assert`. [microsoft#4588](microsoft#4588) * Simplified function templates to use `static_assert(false)` as permitted by [CWG-2518](https://wg21.link/cwg2518). [microsoft#4591](microsoft#4591) * Simplified debug checks for comparison function objects by using `if constexpr`. [microsoft#4610](microsoft#4610) * Simplified `char_traits::assign()` by removing unnecessary codepaths for constant evaluation. [microsoft#4613](microsoft#4613) * Changed checks for damaged logic in the STL itself to use internal `static_assert` macros, which expand to nothing outside of the STL's test suites. [microsoft#4624](microsoft#4624) * Simplified `ranges::stable_sort` to use `iter_value_t` instead of an internal helper. [microsoft#4628](microsoft#4628) * Changed the STL to use `in_range<T>()` more and `numeric_limits<T>::min()`/`max()` less. [microsoft#4634](microsoft#4634) * Replaced SFINAE with concepts in C++20-and-later code. [microsoft#4637](microsoft#4637) * Simplified the vectorized implementation of the `minmax()` family for 64-bit elements. [microsoft#4661](microsoft#4661) * Modernized our usage of Google Benchmark. [microsoft#4662](microsoft#4662) - Infrastructure improvements: * Overhauled our Azure Pipelines machinery: [microsoft#4594](microsoft#4594) [microsoft#4687](microsoft#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. [microsoft#4475](microsoft#4475) [microsoft#4492](microsoft#4492) [microsoft#4576](microsoft#4576) [microsoft#4568](microsoft#4568) [microsoft#4594](microsoft#4594) [microsoft#4687](microsoft#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. [microsoft#4599](microsoft#4599) + Updated Google Benchmark to 1.8.4. [microsoft#4694](microsoft#4694) - Updated `_MSVC_STL_UPDATE`. [microsoft#4467](microsoft#4467) [microsoft#4556](microsoft#4556) [microsoft#4655](microsoft#4655)
VS 2022 17.10 - Merged C++26 features: * [P2510R3](https://wg21.link/P2510R3) [microsoft#4198](microsoft#4198) Formatting Pointers * [P2937R0](https://wg21.link/P2937R0) [microsoft#4203](microsoft#4203) Freestanding Library: Remove `strtok` - Merged C++23 features: * [P2836R1](https://wg21.link/P2836R1) [microsoft#4188](microsoft#4188) `basic_const_iterator` Should Follow Its Underlying Type's Convertibility - Merged *partial* C++23 features: * [P2286R8](https://wg21.link/P2286R8) Formatting Ranges: + Implemented `formatter<vector<bool>::reference>`. [microsoft#4133](microsoft#4133) - Merged C++20 Defect Reports: * [P2905R2](https://wg21.link/P2905R2) [microsoft#4196](microsoft#4196) Runtime Format Strings * [P2909R4](https://wg21.link/P2909R4) [microsoft#4189](microsoft#4189) Fix Formatting Of Code Units As Integers - Merged LWG issue resolutions: * [LWG-3749](https://wg21.link/lwg3749) [microsoft#4190](microsoft#4190) `common_iterator` should handle integer-class difference types * [LWG-3809](https://wg21.link/lwg3809) [microsoft#4194](microsoft#4194) Is `subtract_with_carry_engine<uint16_t>` supposed to work? * [LWG-3897](https://wg21.link/lwg3897) [microsoft#4186](microsoft#4186) `inout_ptr` will not update raw pointer to null * [LWG-3946](https://wg21.link/lwg3946) [microsoft#4187](microsoft#4187) The definition of `const_iterator_t` should be reworked * [LWG-3947](https://wg21.link/lwg3947) [microsoft#4195](microsoft#4195) Unexpected constraints on `adjacent_transform_view::base()` * [LWG-3949](https://wg21.link/lwg3949) [microsoft#4204](microsoft#4204) `atomic<bool>`'s trivial destructor dropped in C++17 spec wording * [LWG-3953](https://wg21.link/lwg3953) [microsoft#4167](microsoft#4167) `iter_move` for `common_iterator` and `counted_iterator` should return `decltype(auto)` * [LWG-3974](https://wg21.link/lwg3974) [microsoft#4214](microsoft#4214) `mdspan::operator[]` should not copy `OtherIndexTypes` * [LWG-4001](https://wg21.link/lwg4001) [microsoft#4193](microsoft#4193) `iota_view` should provide `empty` - Fixed bugs: * Fixed `mutex`'s constructor to be `constexpr`. [microsoft#3824](microsoft#3824) [microsoft#4000](microsoft#4000) [microsoft#4339](microsoft#4339) + *Note:* Programs that aren't following the documented [restrictions on binary compatibility](https://learn.microsoft.com/en-us/cpp/porting/binary-compat-2015-2017?view=msvc-170) may encounter null dereferences in `mutex` machinery. You **must** follow this rule: > When you mix binaries built by different supported versions of the toolset, the Redistributable version must be at least as new as the latest toolset used by any app component. + You can define `_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR` as an escape hatch. * Fixed `<format>`'s compile-time format string checking: + To detect when user-defined `formatter` specializations reject omitted format specifications like `"{}"`. [microsoft#4078](microsoft#4078) + To require that dynamic width and precision arguments have integral types. [microsoft#4155](microsoft#4155) * Fixed how `format()` handles empty strings like `format("{:a<10}", "")`. [microsoft#4243](microsoft#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 of `chars_format::general`. [microsoft#4327](microsoft#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 the `chars_format::general` rules produce `"1.2345678e+07"`. * Fixed `<format>` to properly handle locale-specific floating-point formatting with a minimum field width, taking digit separators into account. [microsoft#4421](microsoft#4421) * Fixed `format()` to accept `%X` and `%EX` for `chrono::duration` and `chrono::hh_mm_ss`. [microsoft#4250](microsoft#4250) * Fixed `chrono::duration` formatting to respect dynamically provided widths. [microsoft#4283](microsoft#4283) * Fixed crashes and incorrect results in the vectorized implementation of `ranges::find` with `unreachable_sentinel`. [microsoft#4450](microsoft#4450) + This fixed regressions that were introduced by [microsoft#2434](microsoft#2434) in VS 2022 17.3. * Fixed `ranges::to` to properly reject certain invalid uses with compiler errors, instead of trapping compilers in infinite loops of doom. [microsoft#4142](microsoft#4142) * Fixed `ranges::to` to accept certain container constructors taking a range followed by more than one argument. [microsoft#4218](microsoft#4218) * Fixed compiler errors involving range adaptor closure objects in unusual scenarios. [microsoft#4211](microsoft#4211) * Fixed `ranges::ssize` to be conditionally `noexcept` as required by the Standard. [microsoft#4231](microsoft#4231) * Fixed `join_view` and `join_with_view`'s iterators to be default constructible. [microsoft#4264](microsoft#4264) * Fixed truncation warnings when using `views::repeat`. [microsoft#4255](microsoft#4255) * Fixed compiler errors when using `views::zip_transform` with ranges that must be non-`const` to be iterated through, such as `views::filter`. [microsoft#4416](microsoft#4416) * Fixed compiler errors when using `views::pairwise_transform` and `views::adjacent_transform` via Standard Library Modules. [microsoft#4420](microsoft#4420) * Fixed incorrect output from iostreams (like `"i.nf"`) when printing infinity and NaN values with `setprecision(0) << showpoint << fixed`. [microsoft#4212](microsoft#4212) * Fixed problems involving unusual allocators with size types other than `size_t`: + Compiler errors in `basic_stringbuf::overflow()`. [microsoft#4219](microsoft#4219) + Truncation warnings in `basic_stringbuf`'s constructor, `string`/`vector` iterator subtraction, `ranges::is_permutation`, and `allocate_shared()`. [microsoft#4228](microsoft#4228) [microsoft#4237](microsoft#4237) [microsoft#4252](microsoft#4252) * Fixed `<atomic>` correctness issues for ARM64 CHPE (`_M_HYBRID_X86_ARM64`). [microsoft#4222](microsoft#4222) * Fixed `atomic` by adding `atomic& operator=(const atomic&) volatile = delete;` as required by the Standard. [microsoft#4287](microsoft#4287) * Fixed `atomic<shared_ptr>::wait()` and `atomic<weak_ptr>::wait()` to properly detect equivalent smart pointers. [microsoft#3655](microsoft#3655) * Fixed sign-compare warnings in `<mdspan>` when using `extents` with different index types. [microsoft#4227](microsoft#4227) * Fixed compiler errors in `<mdspan>` when constructing unusual mappings. [microsoft#4236](microsoft#4236) * Fixed bugs specific to extremely unusual fancy pointers: + Fixed how such `vector`s interact with ranges algorithms. [microsoft#4244](microsoft#4244) + Fixed how such `vector`s and `basic_string`s interact with classic algorithms and iterator spaceship comparisons. [microsoft#4275](microsoft#4275) * Fixed compiler errors when constructing `locale{nullptr}`. [microsoft#4245](microsoft#4245) + Rejoice, for now you can get a guaranteed `runtime_error`! * Fixed compiler errors when overloading `next()`, `prev()`, `shift_left()`, and `shift_right()` with concept-constrained functions that should be preferred during overload resolution. [microsoft#4249](microsoft#4249) * Fixed compiler errors when comparing a `sub_match` with the spaceship operator `<=>` to a `basic_string` with a custom traits and/or allocator type. [microsoft#4253](microsoft#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. [microsoft#4254](microsoft#4254) * Fixed compiler errors in parallel `transform_reduce()` when performing narrowing conversions. [microsoft#4260](microsoft#4260) + As usual, asking the STL to perform conversions on your behalf may emit sign/truncation compiler warnings; this is by design. * Fixed compiler errors during `constexpr` evaluation of `vector<bool>` caused by improper casting in iterator debugging machinery. [microsoft#4276](microsoft#4276) * Fixed compiler errors (by adding a compiler bug workaround) when using `constexpr` `invoke()` to call pointers to data members with `reference_wrapper` arguments. [microsoft#4277](microsoft#4277) * Added macroization defenses for the STL's non-Standard extensions (e.g. `type_info`'s `raw_name` member function). [microsoft#4285](microsoft#4285) * Fixed floating-point `to_chars()` on ARM64 to return correct results. [microsoft#4304](microsoft#4304) * Fixed compiler errors when defining variadic alias templates for `is_nothrow_convertible`. [microsoft#4318](microsoft#4318) * Fixed `filesystem::is_empty()` and `filesystem::directory_iterator` to handle empty volumes (before they've been assigned a drive letter). [microsoft#4311](microsoft#4311) * Fixed compiler errors in algorithms involving highly unusual types. [microsoft#4233](microsoft#4233) [microsoft#4419](microsoft#4419) * Fixed `basic_stringbuf` to avoid implementing moving with swapping, which is a correctness issue for unusual custom allocators. [microsoft#4239](microsoft#4239) * Fixed `deque::shrink_to_fit()` to follow the Standard instead of unconditionally moving elements. [microsoft#4091](microsoft#4091) * Fixed `allocate_shared_for_overwrite()` to directly destroy objects, instead of using `Alloc::destroy()`. [microsoft#4274](microsoft#4274) * Removed `ios_base::hexfloat`, a non-Standard bitmask element. [microsoft#4345](microsoft#4345) + The Standard ways to request hexadecimal floating-point output are to use the `ios_base::fixed | ios_base::scientific` bitmask elements together or to use the `std::hexfloat` manipulator. * Fixed `std.ixx` to export VCRuntime machinery with Standard-conforming techniques. [microsoft#4375](microsoft#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. * Fixed `basic_ostream::operator<<(basic_streambuf*)` to rethrow caught exceptions only when `failbit` is set in `exceptions()`. [microsoft#4372](microsoft#4372) * Fixed `unordered_map` and `unordered_set`'s equality operators to test elements for equality (via their `operator==`), not just equivalence (via the container's predicate for keys). [microsoft#4406](microsoft#4406) + `unordered_multimap` and `unordered_multiset` already behaved correctly. * Silenced "warning C4324: structure was padded due to alignment specifier" in all STL headers. [microsoft#4426](microsoft#4426) + This was spuriously emitted by certain combinations of code, e.g. `views::cartesian_product` with `views::filter`. * Fixed `time_get::date_order()` to correctly return `time_base::mdy` for the "C" locale, instead of picking up the date order for the current user locale. [microsoft#4437](microsoft#4437) * Fixed `seed_seq::generate(RanIt, RanIt)` to `static_assert` that the iterator's value type is at least a 32-bit unsigned integer type. [microsoft#4447](microsoft#4447) * Fixed compiler errors involving incomplete types in: + Non-modifying algorithms. [microsoft#4138](microsoft#4138) + `erase()`, `erase_if()`, `remove()`, `remove_if()`. [microsoft#4217](microsoft#4217) + \[alg.min.max\], \[alg.clamp\], \[alg.lex.comparison\], \[alg.three.way\] algorithms. [microsoft#4216](microsoft#4216) + `atomic` and `atomic_ref`. [microsoft#4221](microsoft#4221) + Modifying algorithms. [microsoft#4256](microsoft#4256) + Container operations taking iterator pairs. [microsoft#4258](microsoft#4258) + `is_nothrow_convertible`. [microsoft#4318](microsoft#4318) + Comparison operators. [microsoft#4334](microsoft#4334) + Merge algorithms, set operations, heap operations, and permutation generators. [microsoft#4347](microsoft#4347) + Sorting and related algorithms. [microsoft#4367](microsoft#4367) + `vector`'s destructor and other member functions. [microsoft#4373](microsoft#4373) + Uninitialized memory algorithms. [microsoft#4374](microsoft#4374) + `default_searcher`. [microsoft#4379](microsoft#4379) + `<ranges>` views. [microsoft#4389](microsoft#4389) + Numeric algorithms. [microsoft#4391](microsoft#4391) + `ranges::advance`, `ranges::distance`, `span` constructors, and `condition_variable::wait_for`. [microsoft#4402](microsoft#4402) + `shared_ptr` creation functions and `atomic` smart pointers. [microsoft#4403](microsoft#4403) + `function`, `move_only_function`, `packaged_task`, `promise`, and `optional`. [microsoft#4430](microsoft#4430) - Improved performance: * Improved `<atomic>` performance: [microsoft#4222](microsoft#4222) + For ARM64, significantly improved the performance of `atomic<T>::load()` (taking no arguments, requesting sequential consistency), matching how [microsoft#3399](microsoft#3399) in VS 2022 17.6 improved `atomic<T>::load(memory_order_seq_cst)`. + For ARM64 CHPE (`_M_HYBRID_X86_ARM64`), `atomic<T>`'s `exchange`/`compare_exchange_MEOW`/`fetch_MEOW` now respect `memory_order` arguments instead of always providing sequential consistency. Also, ARM64 CHPE now benefits from all of [microsoft#3399](microsoft#3399 major improvements. * Improved `atomic::wait` family performance by internally using `memory_order_acq_rel` instead of `memory_order_seq_cst` when initializing OS support functions. [microsoft#4288](microsoft#4288) * Slightly improved the codegen for `uniform_int_distribution`. [microsoft#4234](microsoft#4234) * Optimized `filesystem::path`'s `operator/` to perform a single memory allocation for common cases. [microsoft#4136](microsoft#4136) * Slightly improved performance by taking advantage of [P1169R4](https://wg21.link/P1169R4) `static operator()` in the STL's stateless function objects and lambdas. [microsoft#4358](microsoft#4358) + This is conditional on compiler feature availability (currently implemented by Clang), but not on Standard mode. Like C++17 `if constexpr` and C++20 `explicit(bool)`, compilers will support C++23 `static operator()` in earlier Standard modes (emitting warnings that Future Technology is being used, which the STL internally suppresses). * Added a vectorized implementation of `bitset::to_string()`. [microsoft#3960](microsoft#3960) [microsoft#4382](microsoft#4382) [microsoft#4422](microsoft#4422) * Improved the vectorized implementations of `min_element()`, `max_element()`, `minmax_element()`, and related algorithms: + Extended them to handle floating-point types. [microsoft#3928](microsoft#3928) + Further improved performance by restructuring control flow. [microsoft#4401](microsoft#4401) * Improved the vectorized implementations of `ranges::min`, `ranges::max`, `ranges::minmax`, and the `min()`, `max()`, and `minmax()` overloads for `initializer_list`. [microsoft#4384](microsoft#4384) + These algorithms only need to track values, not locations. * Changed the destructors of `mutex` and `recursive_mutex` to be trivial. [microsoft#4390](microsoft#4390) + This especially benefits variables with static storage duration, as they no longer need "dynamic `atexit` destructors". * Slightly improved performance by replacing `CRITICAL_SECTION` with `SRWLOCK` in: + `get_new_handler()` and `set_new_handler()`. [microsoft#4407](microsoft#4407) + At-thread-exit machinery. [microsoft#4408](microsoft#4408) - Enhanced behavior: * Wrapped the STL in `extern "C++"` as a temporary workaround to allow `#include <meow>` to coexist with `import std;` in the same translation unit, *in that order*. [microsoft#4154](microsoft#4154) + The other order, `import std;` before `#include <meow>`, will still cause compiler errors. We're working on a long-term solution. * The C++17 Standard added `invoke()` and the C++20 Standard made it `constexpr`. Previously, MSVC made non-`constexpr` `invoke()` unconditionally available, and `constexpr` `invoke()` available in C++17 mode, as minor extensions. Now, `constexpr` `invoke()` is unconditionally available. [microsoft#4080](microsoft#4080) * Improved `shared_ptr` constructor constraints to avoid forming invalid types. [microsoft#4290](microsoft#4290) * Updated `<charconv>` to use the `__umulh` intrinsic for ARM64 CHPE (`_M_HYBRID_X86_ARM64`). [microsoft#4330](microsoft#4330) * Improved `expected`'s copy/move assignment operators to be trivial when possible, like how `optional` and `variant` already behave. [microsoft#4271](microsoft#4271) * Improved `<random>`'s TR1 legacy code: [microsoft#4284](microsoft#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 the `std` namespace. + Removed non-Standard machinery from Standard engines and distributions. (For example, certain `static constexpr` data members in `mersenne_twister_engine` and an extra function call operator overload in `uniform_int_distribution`.) * Changed `basic_regex`'s constructor to throw an exception instead of stack overflowing when the pattern contains an excessive number of capture groups. [microsoft#4451](microsoft#4451) + Currently, this arbitrarily limits the number of capture groups to 1000. - Improved test coverage: * Updated the STL-ASan-CI pipeline. [microsoft#4240](microsoft#4240) [microsoft#4295](microsoft#4295) * Added support for building the STL's separately compiled code with ASan instrumentation and enabled this in the STL-ASan-CI pipeline. [microsoft#4313](microsoft#4313) * Updated our LLVM submodule, including new tests. [microsoft#4263](microsoft#4263) [microsoft#4267](microsoft#4267) [microsoft#4270](microsoft#4270) [microsoft#4272](microsoft#4272) [microsoft#4328](microsoft#4328) [microsoft#4336](microsoft#4336) [microsoft#4348](microsoft#4348) [microsoft#4355](microsoft#4355) * Minor test improvements, including printing exit codes in both decimal and hex. [microsoft#4309](microsoft#4309) * Improved output for "unresolved" test failures. [microsoft#4323](microsoft#4323) * Fixed sporadic "unresolved" test failures. [microsoft#4366](microsoft#4366) * Updated CTest to avoid running 2N tests in parallel, where N is the number of cores available. [microsoft#4335](microsoft#4335) * Enabled `__cpp_lib_concepts` for our command-line test coverage of the EDG compiler front-end. [microsoft#4296](microsoft#4296) [microsoft#4297](microsoft#4297) [microsoft#4440](microsoft#4440) + `__cpp_lib_concepts` was already enabled for EDG-powered IntelliSense in the VS IDE, so this change isn't directly observable by users, it'll just help the STL work better with IntelliSense in the future. * Enabled compiler warnings when building the STL's benchmarks. [microsoft#4356](microsoft#4356) * Added benchmarks for vectorized `ranges::find` and `ranges::count`. [microsoft#4387](microsoft#4387) + This also covers classic `find()` and `count()`, which share the same vectorized implementation. * Fixed the test harness to handle paths case-insensitively. [microsoft#4395](microsoft#4395) * Updated tests to work with Clang 18. [microsoft#4452](microsoft#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'`". [microsoft#4441](microsoft#4441) - Code cleanups: * Various cleanups (described in detail in the PRs, not repeated here). [microsoft#4143](microsoft#4143) [microsoft#4145](microsoft#4145) [microsoft#4146](microsoft#4146) [microsoft#4147](microsoft#4147) [microsoft#4149](microsoft#4149) [microsoft#4151](microsoft#4151) [microsoft#4192](microsoft#4192) [microsoft#4229](microsoft#4229) [microsoft#4230](microsoft#4230) [microsoft#4362](microsoft#4362) [microsoft#4439](microsoft#4439) [microsoft#4442](microsoft#4442) [microsoft#4443](microsoft#4443) [microsoft#4444](microsoft#4444) [microsoft#4445](microsoft#4445) * Removed unnecessary `typename` keywords in C++20 mode and later. [microsoft#4191](microsoft#4191) * Removed compiler bug workarounds. [microsoft#4197](microsoft#4197) [microsoft#4259](microsoft#4259) [microsoft#4340](microsoft#4340) [microsoft#4392](microsoft#4392) * Removed an enormous amount of code that was dealing with `__cpp_lib_concepts` missing in C++20 mode. [microsoft#4298](microsoft#4298) [microsoft#4364](microsoft#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. [microsoft#4405](microsoft#4405) * Added top-level `const` to function parameters in the vectorized implementations of algorithms. [microsoft#4410](microsoft#4410) * Added a script to download Unicode data files when updating `<format>`. [microsoft#4435](microsoft#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. [microsoft#4446](microsoft#4446) * Used `if constexpr` to simplify helper functions for allocating and deallocating memory. [microsoft#4432](microsoft#4432) - Infrastructure improvements: * Updated dependencies. [microsoft#4197](microsoft#4197) [microsoft#4206](microsoft#4206) [microsoft#4259](microsoft#4259) [microsoft#4303](microsoft#4303) [microsoft#4392](microsoft#4392) + Updated build compiler to VS 2022 17.10 Preview 1 (now required). + Updated CMake to 3.28 (now required). + Updated Clang to 17.0.3 (now required). + Updated Python to 3.12.2. + Updated Boost.Math to 1.84.0. [microsoft#4280](microsoft#4280) - Updated `_MSVC_STL_UPDATE`. [microsoft#4213](microsoft#4213) [microsoft#4226](microsoft#4226) [microsoft#4293](microsoft#4293) [microsoft#4361](microsoft#4361)
VS 2022 17.9 - Merged C++23 features: * [P0009R18](https://wg21.link/P0009R18) [microsoft#3972](microsoft#3972) [microsoft#4037](microsoft#4037) `<mdspan>` + [P2599R2](https://wg21.link/P2599R2) `mdspan`: `index_type`, `size_type` + [P2604R0](https://wg21.link/P2604R0) `mdspan`: `data_handle_type`, `data_handle()`, `exhaustive` + [P2613R1](https://wg21.link/P2613R1) `mdspan`: `empty()` + [P2763R1](https://wg21.link/P2763R1) Fixing `layout_stride`'s Default Constructor For Fully Static Extents * [P1169R4](https://wg21.link/P1169R4) [microsoft#4053](microsoft#4053) `static operator()` + This updates CTAD (class template argument deduction) for `std::function` and `packaged_task` to work with a C++23 Core Language feature, currently supported for Clang only. When MSVC and IntelliSense implement this Core feature, this will automatically "light up" the STL's CTAD for them too. - Merged *partial* C++23 features: * [P2286R8](https://wg21.link/P2286R8) Formatting Ranges: + Implemented `formatter::set_debug_format()`. [microsoft#3913](microsoft#3913) + Implemented `formattable`, `range_format`, and `format_kind`. [microsoft#4116](microsoft#4116) - Merged LWG issue resolutions: * [LWG-3561](https://wg21.link/lwg3561) [microsoft#4066](microsoft#4066) Issue with internal counter in `discard_block_engine` - Fixed bugs: * Fixed incorrect results from iostreams floating-point parsing (e.g. `"1e-07"` was incorrectly parsed as `1e-06`). [microsoft#3982](microsoft#3982) + This fixed a regression that was introduced by [microsoft#3364](microsoft#3364) in VS 2022 17.7. + We backported this fix to VS 2022 17.8. * Fixed compiler errors when using `expected` together with `any`. [microsoft#4013](microsoft#4013) * Fixed incorrect behavior when self-move-assigning `any`, and fixed compiler errors in `any` involving incomplete types. [microsoft#3965](microsoft#3965) * Fixed bugs in `basic_string`'s copy assignment operator, specific to non-equal `propagate_on_container_copy_assignment` allocators, involving ASan annotations or fancy pointers. [microsoft#4031](microsoft#4031) * Fixed `get()` and comparison operators to handle program-defined specializations of `array`. [microsoft#4041](microsoft#4041) * Fixed compiler errors in `to_array()` involving incomplete types. [microsoft#4042](microsoft#4042) * Fixed linker errors involving `stl_asan.lib` by disabling ASan annotations in the STL for unsupported platforms (e.g. ARM, ARM64, ARM64EC). [microsoft#4058](microsoft#4058) * Fixed `not_fn()` to return a perfect forwarding call wrapper in C++20 mode as required by [P0356R5](https://wg21.link/P0356R5). [microsoft#4057](microsoft#4057) * Fixed `deque` to preserve its internal invariants when taking advantage of allocators that provide `allocate_at_least()`. [microsoft#4017](microsoft#4017) * Fixed `deque` `emplace()` and `insert()` to not require elements to be swappable; this change also improved performance. [microsoft#4022](microsoft#4022) * Fixed `deque` to handle highly unusual fancy pointers. [microsoft#4049](microsoft#4049) * Fixed `deque::shrink_to_fit()` to avoid requiring the allocator to be default constructible. [microsoft#4071](microsoft#4071) * Fixed `allocate_shared()` for unbounded arrays to handle fancy pointers. [microsoft#4074](microsoft#4074) * Fixed the implementation of [P0408R7](https://wg21.link/P0408R7) Efficient Access To `basic_stringbuf`'s Buffer to properly destroy fancy pointers. [microsoft#4047](microsoft#4047) * Fixed `this_thread::sleep_until()` to consistently use the given `time_point`'s clock type, instead of also depending on the system clock. This also fixed `this_thread::sleep_for()` to consistently use `steady_clock`. [microsoft#3914](microsoft#3914) * Fixed minor conformance issues in `<random>`: [microsoft#4120](microsoft#4120) + Removed non-Standard `base_type` typedefs from `discard_block_engine`, `independent_bits_engine`, and `shuffle_order_engine`. + Fixed `discard_block_engine(Engine&&)` to move-construct the base engine instead of copying it. - Improved performance: * Optimized the `copy()`, `copy_n()`, and `move()` algorithms for `vector<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. [microsoft#3353](microsoft#3353) [microsoft#4045](microsoft#4045) * Optimized `priority_queue::push_range()` for small ranges. [microsoft#4025](microsoft#4025) * Improved debug codegen for `deque` by using unchecked iterators internally. [microsoft#4071](microsoft#4071) * Optimized `basic_string`'s range constructors to use `memmove()` for contiguous ranges when possible. [microsoft#4073](microsoft#4073) * Added a vectorized implementation of `ranges::find_last`. [microsoft#3925](microsoft#3925) - Enhanced behavior: * Added debug checks to `<valarray>` binary operations, verifying that the operands have the same size. [microsoft#3911](microsoft#3911) * Deprecated `basic_istream`'s `ipfx()`/`isfx()` and `basic_ostream`'s `opfx()`/`osfx()` member functions as they're non-Standard extensions. [microsoft#4006](microsoft#4006) * Added compiler bug workarounds for the upcoming Clang 17 release. [microsoft#4014](microsoft#4014) * Improved the STL's error messages so that error logs will record specific `static_assert`s like "error STL1000: Unexpected compiler version, expected Clang 16.0.0 or newer." instead of just "Error in C++ Standard Library usage." [microsoft#4020](microsoft#4020) * Silenced `/Wall` warnings: + When building the Standard Library Modules. [microsoft#4026](microsoft#4026) + Warning C4868 "compiler may not enforce left-to-right evaluation order in braced initializer list" throughout the STL. [microsoft#4067](microsoft#4067) + *Note:* `/Wall` is not intended for regular production use, as it contains a large number of extremely noisy and low-value warnings. In general, the STL does not attempt to be `/Wall` clean. * Changed `num_get::do_get()` to tolerate 80-bit `long double` by removing a `static_assert` that was added in 2018. [microsoft#4032](microsoft#4032) + *Note:* 80-bit `long double` remains unsupported by MSVC. * Improved `source_location::function_name()`: [microsoft#4055](microsoft#4055) + It will return detailed information for Clang 17. + Added an "escape hatch" for all compilers: define `_USE_DETAILED_FUNCTION_NAME_IN_SOURCE_LOCATION` to `0`. + For example, given `template <typename T> void cats()` called with `cats<vector<int>>()`, MSVC's detailed info (implemented in VS 2022 17.6) is `"void __cdecl cats<class std::vector<int,class std::allocator<int> >>(void)"`. Clang 17's detailed info is `"void __cdecl cats(void) [T = std::vector<int>]"`. The escape hatch will return the basic info `"cats"`. * Changed the `ranges` algorithms to be ordinary function objects. [microsoft#4098](microsoft#4098) + For example, this allows code like `views::transform(ranges::distance)` to compile. * Marked internal `extern "C"` functions as `noexcept`. [microsoft#4106](microsoft#4106) [microsoft#4150](microsoft#4150) + This improves codegen for [`/EHs`](https://learn.microsoft.com/en-us/cpp/build/reference/eh-exception-handling-model?view=msvc-170) (versus `/EHsc`, where `extern "C"` already implies `noexcept`). - Improved test coverage: * Added an STL-ASan-CI pipeline. [microsoft#3987](microsoft#3987) [microsoft#3989](microsoft#3989) [microsoft#4029](microsoft#4029) [microsoft#4052](microsoft#4052) [microsoft#4068](microsoft#4068) [microsoft#4069](microsoft#4069) [microsoft#4075](microsoft#4075) * The test harness now cleans up emitted files as it runs. [microsoft#4086](microsoft#4086) * Simplified the feature-test macro test. [microsoft#4103](microsoft#4103) * Enabled test coverage for `basic_string`'s ASan annotations when exception handling interacts with the Small String Optimization. [microsoft#4118](microsoft#4118) - Code cleanups: * Removed unused code. [microsoft#3964](microsoft#3964) [microsoft#4005](microsoft#4005) * Removed compiler bug workarounds. [microsoft#4012](microsoft#4012) [microsoft#4028](microsoft#4028) [microsoft#4039](microsoft#4039) [microsoft#4083](microsoft#4083) * Various cleanups (described in detail in the PRs, not repeated here). [microsoft#3940](microsoft#3940) [microsoft#3973](microsoft#3973) [microsoft#3974](microsoft#3974) [microsoft#3984](microsoft#3984) [microsoft#4015](microsoft#4015) [microsoft#4016](microsoft#4016) [microsoft#4036](microsoft#4036) [microsoft#4087](microsoft#4087) [microsoft#4111](microsoft#4111) [microsoft#4113](microsoft#4113) [microsoft#4117](microsoft#4117) [microsoft#4119](microsoft#4119) [microsoft#4121](microsoft#4121) [microsoft#4122](microsoft#4122) [microsoft#4123](microsoft#4123) [microsoft#4124](microsoft#4124) [microsoft#4125](microsoft#4125) * Ported a `<format>` table generator script from C++ to Python. [microsoft#3994](microsoft#3994) * Improved how `<format>` uses the compiler macro `_MSVC_EXECUTION_CHARACTER_SET`. [microsoft#4076](microsoft#4076) - Improved documentation: * Improved the consistency of preprocessor comments. [microsoft#3950](microsoft#3950) - Infrastructure improvements: * Updated dependencies. [microsoft#4028](microsoft#4028) [microsoft#4039](microsoft#4039) [microsoft#4083](microsoft#4083) + Updated build compiler to VS 2022 17.8 Preview 3 (now required). + Updated CMake to 3.27 (now required). + Updated Python to 3.12.0 (now required). + Updated Google Benchmark to 1.8.3. [microsoft#4021](microsoft#4021) - Updated `_MSVC_STL_UPDATE`. [microsoft#4003](microsoft#4003) [microsoft#4062](microsoft#4062)
VS 2022 17.8 - Merged C++26 features: * [P2013R5](https://wg21.link/P2013R5) [microsoft#3837](microsoft#3837) Freestanding Language: Optional `::operator new` * [P2198R7](https://wg21.link/P2198R7) [microsoft#3837](microsoft#3837) Freestanding Feature-Test Macros And Implementation-Defined Extensions * [P2338R4](https://wg21.link/P2338R4) [microsoft#3837](microsoft#3837) Freestanding Library: Character Primitives And The C Library * [P2538R1](https://wg21.link/P2538R1) [microsoft#3822](microsoft#3822) ADL-Proof `projected` - Merged C++23 features: * [P2675R1](https://wg21.link/P2675R1) [microsoft#3903](microsoft#3903) Improving `std::format`'s Width Estimation * [P2693R1](https://wg21.link/P2693R1) [microsoft#3861](microsoft#3861) Formatting `thread::id` And `stacktrace` - Merged C++20 extension: * The C++23 named modules `std` and `std.compat` are now available when compiling in C++20 mode. [microsoft#3977](microsoft#3977) + This extension should eventually be portable to the major Standard Library implementations via an informal agreement between implementers. + Build systems - including the Visual Studio IDE - will need changes to support `import std` in C++20. This change makes it possible for them to do so. - Merged LWG issue resolutions: * [LWG-3631](https://wg21.link/lwg3631) [microsoft#3745](microsoft#3745) `basic_format_arg(T&&)` should use `remove_cvref_t<T>` throughout * [LWG-3843](https://wg21.link/lwg3843) [microsoft#3737](microsoft#3737) `std::expected<T, E>::value() &` assumes `E` is copy constructible * [LWG-3893](https://wg21.link/lwg3893) [microsoft#3782](microsoft#3782) [LWG-3661](https://wg21.link/lwg3661) broke `atomic<shared_ptr<T>> a; a = nullptr;` * [LWG-3904](https://wg21.link/lwg3904) [microsoft#3781](microsoft#3781) `lazy_split_view::`*`outer-iterator`*'s `const`-converting constructor isn't setting *`trailing_empty_`* - Fixed bugs: * Fixed the `deque(size_type)` constructor to properly destroy elements when constructing one of them throws an exception. [microsoft#3720](microsoft#3720) * Removed a non-Standard operator `basic_istream >> setfill(c)`. [microsoft#3725](microsoft#3725) * Fixed linker errors when linking x64 object files into ARM64EC programs. [microsoft#3732](microsoft#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. [microsoft#3733](microsoft#3733) * Fixed `formatter<char, wchar_t>` to format the `char` as a character instead of an integer. [microsoft#3723](microsoft#3723) * The STL now avoids dragging in the non-reserved name `ISA_AVAILABILITY`. [microsoft#3721](microsoft#3721) * Fixed `chrono::hh_mm_ss` formatting to accept values of 24 hours or more. [microsoft#3727](microsoft#3727) * Changed the STL's usage of compiler-specific custom attributes to further defend against macros. [microsoft#3760](microsoft#3760) * Fixed `condition_variable_any::wait_until()` to handle `time_point`s with unsigned representations instead of waiting forever. [microsoft#3761](microsoft#3761) * Fixed `counting_semaphore` to add compile-time enforcement of the Standard's mandates. [microsoft#3747](microsoft#3747) * Fixed a bug, affecting UWP apps only, where locking a `mutex` could throw a bogus exception. [microsoft#3763](microsoft#3763) * Fixed the signatures of `char_traits` member functions to exactly match the Standard. [microsoft#3739](microsoft#3739) + This Standardese was updated by [N2349](https://wg21.link/N2349) in C++11. * Fixed compiler errors when `visit_format_arg()` is called with highly unusual visitors. [microsoft#3787](microsoft#3787) * Fixed incorrect output when `format()` is asked to format a floating-point value in the alternate form without a type specifier. [microsoft#3815](microsoft#3815) * Added a compiler bug workaround for MSVC modules, allowing `<format>` machinery to work with `/utf-8` via `import std;`. [microsoft#3816](microsoft#3816) * Fixed a subtle bug affecting `constexpr basic_string`'s copy assignment operator, where it wasn't starting element lifetimes for the unused capacity. [microsoft#3712](microsoft#3712) [microsoft#3819](microsoft#3819) * Fixed Clang compiler errors when calling `function::target<FunctionType>()` on `const function` objects. [microsoft#3844](microsoft#3844) + This is an obscure corner case, because such calls are guaranteed to return null. * Fixed compiler errors when using `array<T, 0>` in `constexpr` contexts. [microsoft#3863](microsoft#3863) * Improved function call operator overload resolution for the `bind()`, `bind_front()`, and `bind_back()` function objects. [microsoft#3775](microsoft#3775) * Fixed iostreams with imbued locales to print infinities and NaNs correctly. [microsoft#3868](microsoft#3868) [microsoft#3877](microsoft#3877) * Fixed incorrect `noexcept`s within the implementations of `filesystem::current_path()`, `filesystem::current_path(error_code&)`, `read_symlink(const path&)`, and `read_symlink(const path&, error_code&)`. [microsoft#3869](microsoft#3869) [microsoft#3881](microsoft#3881) * Fixed `shared_ptr<void>` to not be constructible from `void*`. [microsoft#3873](microsoft#3873) * Fixed a complicated modules scenario by removing `#pragma once` from all STL headers. [microsoft#3895](microsoft#3895) + `#pragma once` is no longer needed to improve throughput because modern compilers automatically detect the idempotency guard idiom. * Fixed `<stacktrace>`'s internal use of `snprintf()` in extreme situations. [microsoft#3916](microsoft#3916) * Fixed an extremely obscure runtime correctness bug in `basic_string`'s copy assignment operator, specific to non-equal `propagate_on_container_copy_assignment` allocators. [microsoft#3862](microsoft#3862) * Fixed ASan annotations in `basic_string::replace()`. [microsoft#3884](microsoft#3884) * Fixed ASan annotations in `basic_string::assign()` and `basic_string::resize_and_overwrite()`. [microsoft#3956](microsoft#3956) - Improved performance: * Changed some helper member functions to be `static`, slightly improving debug codegen. [microsoft#3755](microsoft#3755) * `mutex` and `condition_variable` now avoid virtual function calls within their implementations. [microsoft#3770](microsoft#3770) * Optimized `steady_clock::now()` when `QueryPerformanceFrequency()` is exactly 24 MHz, which is very common for ARM64. [microsoft#3832](microsoft#3832) * Optimized `filesystem::path::lexically_normal()`. [microsoft#3850](microsoft#3850) * `basic_string`, `basic_stringbuf`, `basic_syncbuf`, `deque`, and `vector` now take advantage of allocators that provide `allocate_at_least()`. [microsoft#3864](microsoft#3864) [microsoft#3891](microsoft#3891) * Optimized `<format>` slightly. [microsoft#3826](microsoft#3826) * Optimized `bitset::to_string()`. [microsoft#3838](microsoft#3838) [microsoft#3904](microsoft#3904) * Added an attribute to `as_const()`, `to_integer()`, and `to_underlying()` that allows the MSVC compiler to intrinsically implement them without emitting function calls. [microsoft#3664](microsoft#3664) * Made a tiny tweak to `valarray` (access the stored size directly instead of via calling `size()`) to improve debug codegen. [microsoft#3968](microsoft#3968) - Improved throughput: * Moved machinery: [microsoft#3719](microsoft#3719) + Moved `integer_sequence`, `make_integer_sequence`, `index_sequence`, `make_index_sequence`, and `index_sequence_for` from `<type_traits>` to `<utility>`, which is where the Standard provides them. + Moved `allocator_arg`, `allocator_arg_t`, `uses_allocator`, and `uses_allocator_v` so that they're dragged in by slightly fewer headers. (The Standard provides them in `<memory>`.) * Some headers now avoid including `<limits>`. [microsoft#3777](microsoft#3777) * In C++17 mode and later, improved Clang throughput for an internal helper wrapping `is_same_v`. [microsoft#3933](microsoft#3933) - Enhanced behavior: * Added precondition checking in debug mode to the `iota_view(value)` constructor. [microsoft#3731](microsoft#3731) * Improved precondition checking in debug mode for `barrier`. [microsoft#3757](microsoft#3757) * Fixed static analysis warnings. [microsoft#3734](microsoft#3734) [microsoft#3743](microsoft#3743) + *Note:* The STL has always attempted to be `/W4 /analyze` clean, but does not yet attempt to be clean with respect to all additional static analysis rulesets. * Strengthened the exception specifications for: + Internal `<ranges>` machinery used in `join_view` iterators and `lazy_split_view`. [microsoft#3762](microsoft#3762) + `basic_string_view::compare(const charT*)`. [microsoft#3738](microsoft#3738) + Constructors of `locale::facet` and related base classes. [microsoft#3855](microsoft#3855) + Many functions in `<complex>`. [microsoft#3880](microsoft#3880) + Many functions in `<random>`, some functions in `<valarray>`, and 3-arg `hypot()` in `<cmath>`. [microsoft#3887](microsoft#3887) * The STL now avoids conflicting with non-Standard macros of reserved names that were defined by old versions of the ICU library. [microsoft#3776](microsoft#3776) * Updated `stdext::checked_array_iterator` and `stdext::unchecked_array_iterator`: [microsoft#3818](microsoft#3818) + Added `const`ness conversions. + Deprecated these iterators, which have been superseded by `std::span` and `gsl::span`. * Added "lifetimebound" attributes to `minmax` and `ranges::minmax`, allowing MSVC code analysis and Clang `-Wdangling` to detect dangling references in improper usage. [microsoft#3831](microsoft#3831) * Improved how `views::cartesian_product` detects ranges with maximum sizes that are known at compile time. [microsoft#3839](microsoft#3839) * Improved how parallel algorithms perform compile-time iterator type checking. [microsoft#3899](microsoft#3899) * The STL now calls `abort()` instead of `terminate()` for unrecoverable conditions, when the Standard doesn't require `terminate()` to be called. [microsoft#3906](microsoft#3906) [microsoft#3909](microsoft#3909) * Improved the visualizer for `vector<char>` and the other character types. [microsoft#3772](microsoft#3772) * Improved the visualizer for `mutex` and `recursive_mutex`. [microsoft#3848](microsoft#3848) * Updated `chrono::duration_cast()` to use `if constexpr`, improving debug codegen. [microsoft#3958](microsoft#3958) - Improved test coverage: * Added properly functioning test coverage for `ranges::owning_view`. [microsoft#3753](microsoft#3753) * Added test coverage for calling `tellg()` while reading an LF file in text mode. [microsoft#3773](microsoft#3773) [microsoft#3841](microsoft#3841) * Added test coverage for [LWG-2295](https://wg21.link/lwg2295) Locale name when the provided `Facet` is a `nullptr`. [microsoft#3823](microsoft#3823) * Added test coverage for [LWG-2682](https://wg21.link/lwg2682) `filesystem::copy()` won't create a symlink to a directory. [microsoft#3827](microsoft#3827) * Updated tests to use lvalue references for the LHS of `is_assignable_v` and `is_nothrow_assignable_v`. [microsoft#3898](microsoft#3898) * Added more tests for `views::as_const`, `views::stride`, and `views::zip`. [microsoft#3920](microsoft#3920) * Test code now consistently uses `override` to avoid mistakes, following the same convention as product code. [microsoft#3934](microsoft#3934) * Fixed precondition violations in `is_permutation()` tests. [microsoft#3967](microsoft#3967) * Fixed precondition violations in `regex_iterator` and `regex_token_iterator` tests. [microsoft#3990](microsoft#3990) - Code cleanups: * Removed compiler bug workarounds. [microsoft#3722](microsoft#3722) [microsoft#3769](microsoft#3769) [microsoft#3866](microsoft#3866) [microsoft#3939](microsoft#3939) * Improved SFINAE to follow modern conventions. [microsoft#3736](microsoft#3736) * Various cleanups (described in detail in the PRs, not repeated here). [microsoft#3758](microsoft#3758) [microsoft#3759](microsoft#3759) [microsoft#3765](microsoft#3765) [microsoft#3768](microsoft#3768) [microsoft#3912](microsoft#3912) [microsoft#3927](microsoft#3927) [microsoft#3935](microsoft#3935) * Removed comments that were citing proposed resolutions for LWG issues, now that those issues have been officially resolved by the June 2023 meeting. [microsoft#3784](microsoft#3784) [microsoft#3785](microsoft#3785) * Marked internal machinery as `[[noreturn]]`. [microsoft#3865](microsoft#3865) [microsoft#3882](microsoft#3882) * Removed unnecessary `typename` keywords in C++20 mode and later. [microsoft#3892](microsoft#3892) [microsoft#3893](microsoft#3893) [microsoft#3894](microsoft#3894) * Improved type safety by using an `enum class` for internal machinery within `<condition_variable>`, `<mutex>`, and `<thread>`. [microsoft#3897](microsoft#3897) * Improved the consistency of code that should never be called. [microsoft#3905](microsoft#3905) * Removed unused code. [microsoft#3936](microsoft#3936) * Improved the clarity and maintainability of `basic_string`'s implementation. [microsoft#3862](microsoft#3862) * Deprecated the non-standard `<cvt/meow>` headers and their provided character encoding conversion machinery. [microsoft#3924](microsoft#3924) + Users should prefer to call [`MultiByteToWideChar()`](https://learn.microsoft.com/en-us/windows/win32/api/stringapiset/nf-stringapiset-multibytetowidechar) and [`WideCharToMultiByte()`](https://learn.microsoft.com/en-us/windows/win32/api/stringapiset/nf-stringapiset-widechartomultibyte). - Improved documentation: * Added comments where the Standard requires `terminate()` to be called. [microsoft#3907](microsoft#3907) * Improved the consistency of preprocessor comments. [microsoft#3900](microsoft#3900) [microsoft#3951](microsoft#3951) - Infrastructure improvements: * Modernized code format validation to use `<print>`. [microsoft#3919](microsoft#3919) * Updated dependencies. [microsoft#3769](microsoft#3769) [microsoft#3866](microsoft#3866) [microsoft#3939](microsoft#3939) + Updated build compiler to VS 2022 17.8 Preview 1. + Updated Boost.Math to 1.83.0. [microsoft#3952](microsoft#3952) + Updated Clang to 16.0.5. + Updated Python to 3.11.4. - Build system improvements: + Added `CMakePresets.json` to simplify the process of building the repo. [microsoft#3730](microsoft#3730) [microsoft#3930](microsoft#3930) - Updated `_MSVC_STL_UPDATE`. [microsoft#3742](microsoft#3742) [microsoft#3851](microsoft#3851) [microsoft#3918](microsoft#3918)
VS 2022 17.7 - Merged C++23 features: * [P1467R9](https://wg21.link/P1467R9) [microsoft#3583](microsoft#3583) Extended Floating-Point Types + *Note:* This means that we provide the `<stdfloat>` header containing an empty `namespace std {}`, as we don't support any optional extended floating-point types. * [P2093R14](https://wg21.link/P2093R14) [microsoft#3337](microsoft#3337) `<print>`: Formatted Output + [P2539R4](https://wg21.link/P2539R4) Synchronizing `print()` With The Underlying Stream * [P2164R9](https://wg21.link/P2164R9) [microsoft#3472](microsoft#3472) `views::enumerate` * [P2165R4](https://wg21.link/P2165R4) [microsoft#3372](microsoft#3372) Compatibility Between `tuple`, `pair`, And *tuple-like* Objects * [P2321R2](https://wg21.link/P2321R2) `zip`, completed by implementing: + `views::adjacent` and `views::pairwise`. [microsoft#3508](microsoft#3508) + `views::adjacent_transform` and `views::pairwise_transform`. [microsoft#3546](microsoft#3546) * [P2374R4](https://wg21.link/P2374R4) [microsoft#3561](microsoft#3561) `views::cartesian_product` + [P2540R1](https://wg21.link/P2540R1) Empty Product For Certain Views * [P2572R1](https://wg21.link/P2572R1) [microsoft#3629](microsoft#3629) `std::format` Fill Character Allowances * [P2609R3](https://wg21.link/P2609R3) [microsoft#3486](microsoft#3486) Relaxing Ranges Just A Smidge * [P2614R2](https://wg21.link/P2614R2) [microsoft#3482](microsoft#3482) Deprecating `float_denorm_style`, `numeric_limits::has_denorm`, `numeric_limits::has_denorm_loss` * [P2652R2](https://wg21.link/P2652R2) [microsoft#3542](microsoft#3542) Disallowing User Specialization Of `allocator_traits` * [P2655R3](https://wg21.link/P2655R3) [microsoft#3513](microsoft#3513) `common_reference_t` Of `reference_wrapper` Should Be A Reference Type * [P2736R2](https://wg21.link/P2736R2) [microsoft#3556](microsoft#3556) Referencing The Unicode Standard + `<format>` now understands Unicode 15. * [P2770R0](https://wg21.link/P2770R0) [microsoft#3466](microsoft#3466) Stashing Stashing Iterators For Proper Flattening - Merged *partial* C++23 features: * [P2286R8](https://wg21.link/P2286R8) Formatting Ranges: + Implemented the `?` format specifier for strings and characters. [microsoft#3656](microsoft#3656) - Merged LWG issue resolutions: * [LWG-2195](https://wg21.link/lwg2195) [microsoft#3506](microsoft#3506) Missing constructors for `match_results` * [LWG-2309](https://wg21.link/lwg2309) [microsoft#3469](microsoft#3469) `mutex::lock()` should not throw `device_or_resource_busy` * [LWG-2381](https://wg21.link/lwg2381) [microsoft#3364](microsoft#3364) Inconsistency in parsing floating point numbers * [LWG-3204](https://wg21.link/lwg3204) [microsoft#3494](microsoft#3494) `sub_match::swap` only swaps the base class * [LWG-3655](https://wg21.link/lwg3655) [microsoft#3495](microsoft#3495) The *`INVOKE`* operation and `union` types * [LWG-3677](https://wg21.link/lwg3677) [microsoft#3396](microsoft#3396) Is a *cv*-qualified `pair` specially handled in uses-allocator construction? * [LWG-3720](https://wg21.link/lwg3720) [microsoft#3511](microsoft#3511) Restrict the valid types of *arg-id* for *width* and *precision* in *std-format-spec* * [LWG-3733](https://wg21.link/lwg3733) [microsoft#3496](microsoft#3496) `ranges::to` misuses *`cpp17-input-iterator`* * [LWG-3734](https://wg21.link/lwg3734) [microsoft#3503](microsoft#3503) Inconsistency in `inout_ptr` and `out_ptr` for empty case * [LWG-3821](https://wg21.link/lwg3821) [microsoft#3509](microsoft#3509) `uses_allocator_construction_args` should have overload for *`pair-like`* * [LWG-3833](https://wg21.link/lwg3833) [microsoft#3477](microsoft#3477) Remove specialization `template<size_t N> struct formatter<const charT[N], charT>` * [LWG-3836](https://wg21.link/lwg3836) [microsoft#3587](microsoft#3587) `std::expected<bool, E1>` conversion constructor `expected(const expected<U, G>&)` should take precedence over `expected(U&&)` with `operator bool` * [LWG-3847](https://wg21.link/lwg3847) [microsoft#3479](microsoft#3479) `ranges::to` can still return views * [LWG-3851](https://wg21.link/lwg3851) [microsoft#3517](microsoft#3517) `chunk_view::`*`inner-iterator`* missing custom `iter_move` and `iter_swap` * [LWG-3860](https://wg21.link/lwg3860) [microsoft#3480](microsoft#3480) `range_common_reference_t` is missing * [LWG-3862](https://wg21.link/lwg3862) [microsoft#3471](microsoft#3471) `basic_const_iterator`'s `common_type` specialization is underconstrained * [LWG-3865](https://wg21.link/lwg3865) [microsoft#3476](microsoft#3476) Sorting a range of `pair`s + This can be a **source-breaking change** in unusual scenarios. * [LWG-3869](https://wg21.link/lwg3869) [microsoft#3487](microsoft#3487) Deprecate `std::errc` constants related to UNIX STREAMS * [LWG-3870](https://wg21.link/lwg3870) [microsoft#3475](microsoft#3475) Remove *`voidify`* * [LWG-3872](https://wg21.link/lwg3872) [microsoft#3470](microsoft#3470) `basic_const_iterator` should have custom `iter_move` * [LWG-3875](https://wg21.link/lwg3875) [microsoft#3485](microsoft#3485) `std::ranges::repeat_view<T, IntegerClass>::`*`iterator`* may be ill-formed * [LWG-3877](https://wg21.link/lwg3877) [microsoft#3504](microsoft#3504) Incorrect constraints on `const`-qualified monadic overloads for `std::expected` * [LWG-3887](https://wg21.link/lwg3887) [microsoft#3589](microsoft#3589) Version macro for `allocate_at_least` - Fixed bugs: * Fixed the `ios_base` constants (e.g. `ios_base::binary`, `ios_base::failbit`, `ios_base::hex`) to have the correct bitmask types. [microsoft#3405](microsoft#3405) * Fixed compiler errors found with Clang 16. [microsoft#3483](microsoft#3483) * Fixed `<ranges>` to avoid using list-initialization when the difference between braces and parentheses is observable. [microsoft#3493](microsoft#3493) * Fixed `pmr::unsynchronized_pool_resource` to respect `pmr::pool_options::max_blocks_per_chunk` when it's smaller than the default initial number of blocks per chunk. [microsoft#3510](microsoft#3510) * Fixed technically undefined behavior in `<regex>` and `<sstream>` found by Clang/LLVM's Undefined Behavior Sanitizer (UBSan). [microsoft#3452](microsoft#3452) * Fixed compiler errors when calling `ranges::equal` with ranges involving `views::iota`. [microsoft#3551](microsoft#3551) * Fixed the STL's iterator unwrapping machinery to avoid requiring a `_Prevent_inheriting_unwrap` typedef. [microsoft#3566](microsoft#3566) * Fixed spurious warnings from Clang's `-Wzero-as-null-pointer-constant` when comparing the spaceship operator's return types (`partial_ordering`, `weak_ordering`, `strong_ordering`) with literal `0`. [microsoft#3581](microsoft#3581) * Fixed `bind()` function objects to have constrained function call operators, so they interact properly with `is_invocable` and related scenarios. [microsoft#3577](microsoft#3577) * Reverted [microsoft#2654](microsoft#2654) (which affected `<future>`'s use of `<ppltasks.h>` in Desktop XAML apps) because it introduced an `ole32.dll` dependency that broke multiple scenarios. [microsoft#3607](microsoft#3607) + We backported this revert to VS 2022 17.6. * Fixed `views::cartesian_product` to avoid compiler errors in pathological scenarios. [microsoft#3609](microsoft#3609) * Fixed incorrect results for ranges larger than 4 GB passed to the vectorized implementations of `min_element()`, `max_element()`, and `minmax_element()`. [microsoft#3619](microsoft#3619) + This also affected `ranges::min_element`, `ranges::max_element`, `ranges::minmax_element`, `ranges::min`, `ranges::max`, `ranges::minmax`, and the `min()`, `max()`, and `minmax()` overloads for `initializer_list`. + This fixed a regression that was introduced by [microsoft#2447](microsoft#2447) [microsoft#2821](microsoft#2821) [microsoft#2825](microsoft#2825) in VS 2022 17.4. * Added a compiler bug workaround for MSVC in `shared_ptr`'s `operator<=>`. [microsoft#3647](microsoft#3647) + This avoids compiler errors when comparing `shared_ptr<const int>` to `shared_ptr<void>`. * Added a space to `chrono::ambiguous_local_time`'s message to exactly match the Standard. [microsoft#3650](microsoft#3650) * Fixed compiler errors when formatting unusual `chrono::duration` types. [microsoft#3649](microsoft#3649) * Fixed `optional::transform()` to avoid terminating when the callable object throws an exception. [microsoft#3668](microsoft#3668) * Fixed `<charconv>` floating-point `from_chars()` to correctly handle two scenarios involving exponents with large absolute values. [microsoft#3670](microsoft#3670) * Fixed iostreams floating-point parsing to produce correct results for many different scenarios. [microsoft#3364](microsoft#3364) * Fixed compiler errors when importing the Standard Library Modules and calling `typeid(T).name()`. [microsoft#3677](microsoft#3677) * Fixed some nasty corner cases in `cartesian_product_view`. [microsoft#3678](microsoft#3678) * Fixed some issues with parsing numbers with grouping separators. [microsoft#3684](microsoft#3684) * Fixed a bug that could result in `unordered_meow` containers allocating too few buckets. [microsoft#3687](microsoft#3687) - Improved performance: * Slightly optimized `mutex` and `recursive_mutex` construction by avoiding a Windows API call. [microsoft#3522](microsoft#3522) * Slightly optimized `unique_ptr` move assignment by avoiding an unnecessary branch. [microsoft#3540](microsoft#3540) * Optimized `chrono::time_zone::to_sys` and `chrono::time_zone::to_local`, with a speedup of approximately 3x (times, not percent). [microsoft#3579](microsoft#3579) * Optimized `type_index::operator<=>` to avoid calling the comparison function twice. [microsoft#3600](microsoft#3600) * Inserted the `VZEROUPPER` instruction 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. [microsoft#3630](microsoft#3630) * Optimized the constructors `system_error(error_code)` and `system_error(int, const error_category&)`. [microsoft#3635](microsoft#3635) - Improved throughput: * `<optional>` and `<variant>` now include fewer headers. [microsoft#3624](microsoft#3624) * Moved internal machinery into `<regex>` where it's needed. [microsoft#3625](microsoft#3625) * C++20 `<chrono>` now avoids including `<algorithm>`. [microsoft#3626](microsoft#3626) * `<compare>` now avoids including `<bit>`. [microsoft#3627](microsoft#3627) * Refactored a central internal header so that the rest of the STL includes fewer headers and provides less machinery beyond what's required. [microsoft#3623](microsoft#3623) [microsoft#3654](microsoft#3654) + Common **source-breaking** impact: - Need to include `<cstdlib>` for `exit`, `quick_exit`, etc. - Need to include `<initializer_list>` for `initializer_list`. * Sometimes `initializer_list` is used implicitly when only braces appear in the source code. - Need to include `<functional>` for `unary_function` and `binary_function`. * Note that `unary_function` and `binary_function` were deprecated in C++11 and removed in C++17, so it's best to stop using them completely. + Uncommon source-breaking impact: - Need to include `<memory>` for `addressof`. - Need to include `<functional>` for `less`, `less_equal`, `greater`, `greater_equal`, `equal_to`, `not_equal_to`, `plus`, `minus`, and `multiplies`. * When the STL needs to call `swap` via Argument-Dependent Lookup, it now does so directly; the internal helper function `_Swap_adl` has been removed. [microsoft#3700](microsoft#3700) - Enhanced behavior: * Silenced [CodeQL](https://codeql.github.com/) warnings. [microsoft#3489](microsoft#3489) [microsoft#3585](microsoft#3585) * Silenced occurrences (in `bitset::reference` and test code) of MSVC's new off-by-default warning C5267 for deprecated implicit copy constructors/assignment operators. [microsoft#3497](microsoft#3497) * Enabled `<source_location>` for Clang. [microsoft#3584](microsoft#3584) * Removed the non-Standard `xtime` type from `<chrono>`. [microsoft#3594](microsoft#3594) * Added `static_assert`s to containers, container adaptors, and `allocator` to improve the error messages when they're given non-object types. [microsoft#2436](microsoft#2436) [microsoft#3660](microsoft#3660) + `allocator<void>` is still permitted as a special case. - Improved test coverage: * Added test coverage with Clang/LLVM's Undefined Behavior Sanitizer (UBSan). [microsoft#3452](microsoft#3452) * Added more tests for `views::empty`, `views::iota`, `views::istream`, `views::repeat`, and `views::single`. [microsoft#3553](microsoft#3553) * Fixed nonconformant code in the test for Standard Library Header Units and Modules. [microsoft#3588](microsoft#3588) * Added test coverage for C++23's customization point objects. [microsoft#3610](microsoft#3610) * Added more tests for `ranges::ref_view`, `ranges::subrange`, `views::common`, `views::filter`, `views::join`, `views::reverse`, and `views::transform`. [microsoft#3612](microsoft#3612) - Code cleanups: * Removed many compiler (and CMake) bug workarounds. [microsoft#3490](microsoft#3490) [microsoft#3499](microsoft#3499) [microsoft#3651](microsoft#3651) [microsoft#3711](microsoft#3711) * Various cleanups (described in detail in the PRs, not repeated here). [microsoft#2116](microsoft#2116) [microsoft#3406](microsoft#3406) [microsoft#3523](microsoft#3523) [microsoft#3524](microsoft#3524) [microsoft#3525](microsoft#3525) [microsoft#3526](microsoft#3526) [microsoft#3527](microsoft#3527) [microsoft#3528](microsoft#3528) [microsoft#3529](microsoft#3529) [microsoft#3530](microsoft#3530) [microsoft#3531](microsoft#3531) [microsoft#3532](microsoft#3532) [microsoft#3533](microsoft#3533) [microsoft#3539](microsoft#3539) [microsoft#3543](microsoft#3543) [microsoft#3547](microsoft#3547) [microsoft#3598](microsoft#3598) [microsoft#3633](microsoft#3633) [microsoft#3639](microsoft#3639) [microsoft#3658](microsoft#3658) * Removed comments that were citing proposed resolutions for LWG issues, now that those issues have been officially resolved by the February 2023 meeting. [microsoft#3554](microsoft#3554) * Simplified code by calling `fill_n()` instead of `fill()` when possible. [microsoft#3578](microsoft#3578) - Improved documentation: * Added documentation about the STL's import library. [microsoft#2141](microsoft#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 redundant `int main() {} // COMPILE-ONLY`, and (2) we no longer need to redundantly update `libcxx/skipped_tests.txt` (which has been removed) identically to `libcxx/expected_results.txt`. [microsoft#3484](microsoft#3484) * Enforced the usage of only [core headers](https://github.com/microsoft/STL/wiki/The-Difference-Between-Core-And-Non-Core-Headers) when building the STL's import library. [microsoft#3621](microsoft#3621) * Updated dependencies. [microsoft#3490](microsoft#3490) [microsoft#3651](microsoft#3651) [microsoft#3711](microsoft#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. [microsoft#3657](microsoft#3657) - Updated `_MSVC_STL_UPDATE`. [microsoft#3518](microsoft#3518) [microsoft#3643](microsoft#3643) [microsoft#3680](microsoft#3680)
VS 2022 17.6 - Merged C++23 features: * [P1223R5](https://wg21.link/P1223R5) [microsoft#3268](microsoft#3268) `ranges::find_last`, `ranges::find_last_if`, `ranges::find_last_if_not` * [P2167R3](https://wg21.link/P2167R3) [microsoft#3258](microsoft#3258) Improving *`boolean-testable`* Usage * [P2278R4](https://wg21.link/P2278R4) [microsoft#3187](microsoft#3187) [microsoft#3234](microsoft#3234) `cbegin` Should Always Return A Constant Iterator * [P2404R3](https://wg21.link/P2404R3) [microsoft#3345](microsoft#3345) Move-Only Types For Comparison Concepts * [P2467R1](https://wg21.link/P2467R1) [microsoft#3065](microsoft#3065) `ios_base::noreplace`: Exclusive Mode For `fstream`s * [P2474R2](https://wg21.link/P2474R2) [microsoft#3142](microsoft#3142) `views::repeat` * [P2505R5](https://wg21.link/P2505R5) [microsoft#3361](microsoft#3361) Monadic Functions For `expected` * [P2588R3](https://wg21.link/P2588R3) [microsoft#3455](microsoft#3455) `barrier`'s Phase Completion Guarantees * [P2602R2](https://wg21.link/P2602R2) [microsoft#3215](microsoft#3215) Poison Pills Are Too Toxic * [P2711R1](https://wg21.link/P2711R1) [microsoft#3451](microsoft#3451) Making Multi-Param Constructors Of Views `explicit` - Merged *partial* C++23 features: * [P2165R4](https://wg21.link/P2165R4) Compatibility Between `tuple`, `pair`, And *tuple-like* Objects: + Changes to `pair`. [microsoft#3323](microsoft#3323) * [P2321R2](https://wg21.link/P2321R2) `zip`: + `views::zip_transform`. [microsoft#3322](microsoft#3322) + *Note:* `views::adjacent` and `views::adjacent_transform` remain to be implemented. - Merged LWG issue resolutions: * [LWG-3515](https://wg21.link/lwg3515) [microsoft#3236](microsoft#3236) \[stacktrace.basic.nonmem\]: `operator<<` should be less templatized * [LWG-3545](https://wg21.link/lwg3545) [microsoft#3242](microsoft#3242) `std::pointer_traits` should be SFINAE-friendly * [LWG-3594](https://wg21.link/lwg3594) [microsoft#3276](microsoft#3276) `inout_ptr` - inconsistent `release()` in destructor * [LWG-3629](https://wg21.link/lwg3629) [microsoft#3272](microsoft#3272) `make_error_code` and `make_error_condition` are customization points * [LWG-3646](https://wg21.link/lwg3646) [microsoft#3261](microsoft#3261) `std::ranges::view_interface::size` returns a signed type * [LWG-3717](https://wg21.link/lwg3717) [microsoft#3266](microsoft#3266) `common_view::end` should improve `random_access_range` case * [LWG-3736](https://wg21.link/lwg3736) [microsoft#3318](microsoft#3318) `move_iterator` missing `disable_sized_sentinel_for` specialization * [LWG-3737](https://wg21.link/lwg3737) [microsoft#3320](microsoft#3320) `take_view::`*`sentinel`* should provide `operator-` * [LWG-3743](https://wg21.link/lwg3743) [microsoft#3269](microsoft#3269) `ranges::to`'s `reserve` may be ill-formed * [LWG-3746](https://wg21.link/lwg3746) [microsoft#3265](microsoft#3265) `optional`'s spaceship with `U` with a type derived from `optional` causes infinite constraint meta-recursion * [LWG-3769](https://wg21.link/lwg3769) [microsoft#3459](microsoft#3459) `basic_const_iterator::operator==` causes infinite constraint recursion * [LWG-3772](https://wg21.link/lwg3772) [microsoft#3462](microsoft#3462) `repeat_view`'s piecewise constructor is missing preconditions * [LWG-3778](https://wg21.link/lwg3778) [microsoft#3332](microsoft#3332) `vector<bool>` missing exception specifications * [LWG-3785](https://wg21.link/lwg3785) [microsoft#3319](microsoft#3319) `ranges::to` is over-constrained on the destination type being a range * [LWG-3798](https://wg21.link/lwg3798) [microsoft#3359](microsoft#3359) Rvalue reference and `iterator_category` * [LWG-3810](https://wg21.link/lwg3810) [microsoft#3421](microsoft#3421) CTAD for `std::basic_format_args` * [LWG-3823](https://wg21.link/lwg3823) [microsoft#3231](microsoft#3231) Unnecessary precondition for `is_aggregate` * [LWG-3848](https://wg21.link/lwg3848) [microsoft#3410](microsoft#3410) `slide_view` missing `base` accessor * [LWG-3850](https://wg21.link/lwg3850) [microsoft#3423](microsoft#3423) `views::as_const` on `empty_view<T>` should return `empty_view<const T>` * [LWG-3853](https://wg21.link/lwg3853) [microsoft#3468](microsoft#3468) `basic_const_iterator<volatile int*>::operator->` is ill-formed - Merged *proposed* resolutions for LWG issues (not yet accepted for the C++ Working Draft, but we've chosen to implement this speculatively): * [LWG-3857](https://wg21.link/lwg3857) [microsoft#3348](microsoft#3348) `basic_string_view` should allow explicit conversion when only traits vary * [LWG-3867](https://wg21.link/lwg3867) [microsoft#3367](microsoft#3367) Should `std::basic_osyncstream`'s move assignment operator be `noexcept`? - Fixed bugs: * Fixed linker errors when using `time_put<wchar_t>` from the Standard Library Modules. [microsoft#3232](microsoft#3232) * Fixed another unintentionally dllexported symbol in the import library. [microsoft#3233](microsoft#3233) + This would emit a spurious message "Creating library `meow.lib` and object `meow.exp`" (while building `meow.exe`) when using `<stacktrace>` or importing the Standard Library Modules. * 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. [microsoft#3235](microsoft#3235) + This ABI break was introduced by [microsoft#1735](microsoft#1735) activating the Small String Optimization for `constexpr` `basic_string` in 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. * Fixed a binary compatibility break in `ppltasks.cpp` powering `std::async()`, which could lead to crashes caused by an `invalid_operation` exception slamming into `noexcept`. [microsoft#3255](microsoft#3255) + This ABI break was introduced by [microsoft#2654](microsoft#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()`, and `ranges::count()`. [microsoft#3247](microsoft#3247) + This fixed a regression that was introduced by [microsoft#2434](microsoft#2434) in VS 2022 17.3. + The affected scenarios involved mixing certain signed and unsigned types; for example, finding/counting occurrences of the `int` `-1` in a range of `unsigned int` elements should consider the element `0xFFFF'FFFFu` to 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 when `T` has a custom visualizer. [microsoft#3243](microsoft#3243) * Fixed compiler warnings when passing `long double` to `copysign()`. [microsoft#3253](microsoft#3253) * Re-enabled ASan (Address Sanitizer) annotations in `<string>` after fixing significant bugs. [microsoft#3164](microsoft#3164) + Also fixed ASan annotations in `<vector>` that were failing when `pmr::vector` was used with `pmr::monotonic_buffer_resource` on x86. * Fixed compiler errors when passing `ranges` types to `std::copy()`. [microsoft#3270](microsoft#3270) * Fixed `shared_future<void>`'s move assignment operator to be `noexcept` as required by the Standard. [microsoft#3284](microsoft#3284) * Fixed Clang compiler errors involving intrinsics by including `<intrin.h>`, which is a header that Clang recognizes and supports. [microsoft#3285](microsoft#3285) * Fixed `numeric_limits` to correctly report that `is_signed` is `true` for the STL's internal 128-bit signed-integer-class type. [microsoft#3291](microsoft#3291) * Fixed `<stacktrace>` to correctly pass `SYMOPT_FAIL_CRITICAL_ERRORS` to the Windows API. [microsoft#3292](microsoft#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`. [microsoft#3295](microsoft#3295) + *Note:* We strongly discourage any use of the [`/J` compiler option](https://learn.microsoft.com/en-us/cpp/build/reference/j-default-char-type-is-unsigned?view=msvc-170), as it's a recipe for One Definition Rule violations and it doesn't improve Standard conformance. * Fixed `ranges::cbegin`, `ranges::cend`, `ranges::crbegin`, `ranges::crend`, and `ranges::cdata` to behave like their non-`const` counterparts when given array rvalues. [microsoft#3316](microsoft#3316) * Added compiler bug workarounds: + For Clang in `<expected>`. [microsoft#3326](microsoft#3326) + For Clang in `<ranges>`. [microsoft#3328](microsoft#3328) + For MSVC modules in `<filesystem>`. [microsoft#3331](microsoft#3331) * Fixed `constexpr` `basic_string` to correctly start the lifetimes of its elements, avoiding compiler errors. [microsoft#3334](microsoft#3334) * Fixed `views::istream` constraints to precisely follow the Standard. [microsoft#3335](microsoft#3335) * Implemented C++17's parallel specialized `<memory>` algorithms. [microsoft#3145](microsoft#3145) + These were mistakenly omitted when [P0040R3](https://wg21.link/P0040R3) Extending Memory Management Tools and [P0024R2](https://wg21.link/P0024R2) Parallel Algorithms were implemented (in VS 2017 15.3 and 15.7, respectively). * Fixed `vector<bool, Alloc>` on 32-bit platforms with 64-bit `difference_type`s to support storing more than 2<sup>32</sup> bits. [microsoft#3342](microsoft#3342) * Fixed a compiler error when calling `ranges::prev` on an `iota_view` iterator in debug mode. [microsoft#3356](microsoft#3356) * Fixed `ranges::minmax` to avoid moving from an element twice when called with a single-element range of `move_iterator`s. [microsoft#3366](microsoft#3366) * Fixed a minor conformance issue in the `std.ixx` Standard Library Module. [microsoft#3373](microsoft#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. * Changed the STL's usage of a compiler-specific custom attribute to defend against macros. [microsoft#3380](microsoft#3380) * Fixed Clang `-Wdeprecated` warnings that said "out-of-line definition of constexpr static data member is redundant in C++17 and is deprecated". [microsoft#3381](microsoft#3381) * Changed `vformat_to()` to instantiate its machinery in a lazier way. [microsoft#3403](microsoft#3403) + When merely including `<format>` or `<chrono>`, this avoids instantiating dynamic initializers for facet IDs, and improves throughput slightly. - Improved performance: * Avoided constructing unnecessary `string`s in `locale::operator==()`. [microsoft#3250](microsoft#3250) * Activated `count()`'s vectorized implementation for more eligible iterators in C++14/17 modes. [microsoft#3262](microsoft#3262) * Activated the vectorized implementations of `find()`, `count()`, `ranges::find()`, and `ranges::count()` for more scenarios involving pointer elements. [microsoft#3267](microsoft#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). [microsoft#3399](microsoft#3399) * `ranges::find` now calls `memchr()` in more situations (when the vectorized implementation isn't available). [microsoft#3386](microsoft#3386) - Improved throughput: * Moved user-defined literals for the STL's internal 128-bit integer-class types from product code to test code. [microsoft#3252](microsoft#3252) * Removed unnecessary `operator==` and `operator!=` overloads for internal types in C++20 mode. [microsoft#3256](microsoft#3256) * Used `if constexpr` instead of overloads in internal machinery. [microsoft#3389](microsoft#3389) - Enhanced behavior: * The STL now supports `/clr` for C++11 multithreading (`mutex`, `condition_variable`, `future`, etc.) and C++17 parallel algorithms. Additionally, the STL now allows `/clr` to be used in C++20 mode. [microsoft#3194](microsoft#3194) [microsoft#3201](microsoft#3201) + See tracking issue [microsoft#3193](microsoft#3193) for a list of compiler bugs that affect these newly enabled `/clr` scenarios. * Added visualizers for `error_category` and `error_code`. [microsoft#3204](microsoft#3204) * Improved the output of `source_location::function_name()`. [microsoft#3206](microsoft#3206) + For example, it now returns `"int __cdecl square(int)"` instead of `"square"`. * When iterator debugging detects bogus usage of an invalidated `vector` iterator, it now displays an assertion message instead of abruptly crashing. [microsoft#3282](microsoft#3282) * Changed `<mutex>` to use scope guards instead of `throw;`, making debugging easier when exceptions are thrown. [microsoft#3321](microsoft#3321) * Strengthened the exception specifications for: + `mutex::unlock()`, `recursive_mutex::unlock()`, and `unique_lock`'s move assignment operator. [microsoft#3321](microsoft#3321) + Various member functions and `swap()` overloads for stream types. [microsoft#3314](microsoft#3314) + Various non-member and member functions in `<condition_variable>`, `<mutex>`, `<shared_mutex>`, and `<thread>`. [microsoft#3388](microsoft#3388) * Added `modules/modules.json` to support build systems. [microsoft#3358](microsoft#3358) [microsoft#3488](microsoft#3488) * Refactored `ranges::minmax` and `ranges::minmax_element` to detect the single-element case naturally. [microsoft#3384](microsoft#3384) * Changed the STL's user-defined literals to be consistently defined as `operator""meow` without a space, because [CWG-2521](https://wg21.link/cwg2521) is deprecating the form `operator"" woof` with a space. [microsoft#3453](microsoft#3453) - Improved documentation: * Clarified the error message when including the internal header `<__msvc_cxx_stdatomic.hpp>` in C mode. [microsoft#3192](microsoft#3192) - Improved test coverage: * Enabled `<stdatomic.h>` test coverage for Clang. [microsoft#3186](microsoft#3186) * Updated the modules tests after a compiler bugfix for `source_location`. [microsoft#3339](microsoft#3339) * Added more tests for `views::elements`. [microsoft#3350](microsoft#3350) * Updated our LLVM submodule reference, including new tests. [microsoft#3344](microsoft#3344) [microsoft#3357](microsoft#3357) * Added more tests for `views::drop`, `views::drop_while`, `views::take`, and `views::take_while`. [microsoft#3390](microsoft#3390) - Code cleanups: * Removed compiler bug workarounds. [microsoft#3202](microsoft#3202) [microsoft#3288](microsoft#3288) [microsoft#3351](microsoft#3351) [microsoft#3350](microsoft#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. [microsoft#3238](microsoft#3238) [microsoft#3461](microsoft#3461) * Improved consistency in preprocessor comments. [microsoft#3208](microsoft#3208) * Simplified a line in `experimental::filesystem::recursive_directory_iterator::operator++()`. [microsoft#3279](microsoft#3279) * Various cleanups (described in detail in the PRs, not repeated here). [microsoft#3293](microsoft#3293) [microsoft#3300](microsoft#3300) * Removed unused internal machinery. [microsoft#3299](microsoft#3299) * Simplified types by defaulting some of their special member functions: + `promise` and `packaged_task`. [microsoft#3315](microsoft#3315) + `shared_mutex`, `shared_timed_mutex`, and `shared_lock`. [microsoft#3352](microsoft#3352) * Changed more temporary objects to be constructed with braces instead of parentheses. [microsoft#3277](microsoft#3277) * Updated comments after a compiler bug was fixed. [microsoft#3394](microsoft#3394) * Updated tests and separately compiled sources to directly use the `[[nodiscard]]` attribute. [microsoft#3397](microsoft#3397) * Updated notes for skipped tests in the `libcxx` test suite. [microsoft#3464](microsoft#3464) - Infrastructure improvements: * Added GitHub Actions to automatically add PR cards to the Code Reviews project. [microsoft#3393](microsoft#3393) * Fixed the build system to properly pass options when assembling the "alias objects". [microsoft#3402](microsoft#3402) * Updated dependencies. [microsoft#3202](microsoft#3202) [microsoft#3288](microsoft#3288) [microsoft#3340](microsoft#3340) [microsoft#3351](microsoft#3351) [microsoft#3467](microsoft#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. [microsoft#3312](microsoft#3312) - Updated `_MSVC_STL_UPDATE`. [microsoft#3191](microsoft#3191) [microsoft#3264](microsoft#3264) [microsoft#3362](microsoft#3362) [microsoft#3395](microsoft#3395)
VS 2022 17.5 - Merged C++23 features: * [P2322R6](https://wg21.link/P2322R6) [microsoft#3099](microsoft#3099) `ranges::fold_left`, `ranges::fold_right`, etc. * [P2465R3](https://wg21.link/P2465R3) [microsoft#3108](microsoft#3108) Standard Library Modules `std` And `std.compat` + Initially supported for MSVC only; see tracking issue [microsoft#1694](microsoft#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.ixx` so you can reference `std.ifc` and link `std.obj`. (Similarly for building `std.compat.ixx` into `std.compat.ifc` and `std.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](https://clang.llvm.org/cxx_status.html#cxx20). * [P2508R1](https://wg21.link/P2508R1) [microsoft#3074](microsoft#3074) `basic_format_string`, `format_string`, `wformat_string` - Merged *partial* C++23 features: * [P2278R4](https://wg21.link/P2278R4) `cbegin` Should Always Return A Constant Iterator: + The "Iterators" section, including `basic_const_iterator`, `make_const_iterator()`, and `make_const_sentinel()`. [microsoft#3043](microsoft#3043) * [P2321R2](https://wg21.link/P2321R2) `zip`: + `views::zip`. [microsoft#3035](microsoft#3035) + *Note:* `views::zip_transform`, `views::adjacent`, and `views::adjacent_transform` are the parts that remain to be implemented. - Merged LWG issue resolutions: * [LWG-3711](https://wg21.link/lwg3711) [microsoft#2949](microsoft#2949) Missing preconditions for `slide_view` constructor * [LWG-3788](https://wg21.link/lwg3788) [microsoft#3130](microsoft#3130) `jthread::operator=(jthread&&)` postconditions are unimplementable under self-assignment - Fixed bugs: * Fixed compiler warnings when using Standard Library Header Units. [microsoft#3069](microsoft#3069) * Removed a non-Standard member function `locale::c_str()`. [microsoft#3088](microsoft#3088) * Fixed narrowing warnings when calling `piecewise_constant_distribution<float>::densities()` and `piecewise_linear_distribution<float>::densities()`. [microsoft#3107](microsoft#3107) * Fixed compiler errors when calling `ranges::is_permutation` with predicates that return highly unusual boolean-testable types. [microsoft#3113](microsoft#3113) * Fixed compiler errors when building the Standard Library Modules with static RTTI disabled. [microsoft#3115](microsoft#3115) + Now, building `std.ixx` with `/GR- /D_HAS_STATIC_RTTI=0` will succeed, and `std::any` will 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_any` will indicate (by its absence) that the feature is unavailable. * Fixed compiler errors in `reference_wrapper`, `thread`, and `variant` involving incomplete types. [microsoft#3101](microsoft#3101) [microsoft#3148](microsoft#3148) * When `chrono::time_zone::get_info()` throws an exception, fixed it to report `GetLastError()` as intended, instead of `"The operation completed successfully."` [microsoft#3122](microsoft#3122) * Fixed incorrect results returned by `ellint_2()`. [microsoft#3077](microsoft#3077) * Fixed `error_category`'s default constructor to be `constexpr`. [microsoft#3139](microsoft#3139) [microsoft#3176](microsoft#3176) * Fixed all headers to avoid emitting the off-by-default "warning C5262: implicit fall-through occurs here; are you missing a `break` statement? Use `[[fallthrough]]` when a `break` statement is intentionally omitted between `case`s". [microsoft#3162](microsoft#3162) * Fixed compiler errors in certain `<ranges>` scenarios by properly constraining *`movable-box`*'s copy constructors. [microsoft#3171](microsoft#3171) - Improved performance: * Added support for unwrapping to `move_sentinel`. [microsoft#3098](microsoft#3098) * Improved the performance of `uniform_int_distribution` by implementing Daniel Lemire's algorithm [Fast Random Integer Generation in an Interval](https://arxiv.org/abs/1805.10941). [microsoft#3012](microsoft#3012) * Optimized `gcd()` to avoid a redundant shift. [microsoft#3127](microsoft#3127) * Optimized `locale::classic()` for a 10x speedup (times, not percent). [microsoft#3048](microsoft#3048) * Added an attribute to `move()`, `forward()`, `move_if_noexcept()`, and `forward_like()` that will allow the MSVC compiler to intrinsically implement them without emitting function calls. [microsoft#3182](microsoft#3182) - Improved throughput: * Significantly improved compile times for `<variant>` `visit()`. [microsoft#3070](microsoft#3070) * `<format>` now includes fewer headers. [microsoft#3128](microsoft#3128) * Moved random number generator machinery out of `<xutility>`, one of the STL's central internal headers. [microsoft#3157](microsoft#3157) - Enhanced behavior: * Clarified `get_future()`'s `[[nodiscard("message")]]`. [microsoft#3068](microsoft#3068) * The internal headers `<xatomic.h>`, `<xbit_ops.h>`, and `<xerrc.h>` are now [core headers](https://github.com/microsoft/STL/wiki/The-Difference-Between-Core-And-Non-Core-Headers). [microsoft#3116](microsoft#3116) * Improved `<format>`'s compiler error messages for unformattable types. [microsoft#3080](microsoft#3080) - Improved test coverage: * Added test coverage for `<variant>` `visit()` invoking pointers to members. [microsoft#3070](microsoft#3070) * Expanded test coverage for `forward_like()`. [microsoft#3072](microsoft#3072) * Updated test coverage for `views::as_rvalue`. [microsoft#3089](microsoft#3089) * Expanded test coverage for `bind_front()` and `bind_back()`. [microsoft#3117](microsoft#3117) * Updated our LLVM submodule reference, including new tests, and updates to the `any`/`optional`/`variant` shared test code. [microsoft#2976](microsoft#2976) * Fixed bogus test code discovered by Clang 15. [microsoft#3135](microsoft#3135) * Fixed the off-by-default "exhaustive" mode of the parallel `is_partitioned()` test. [microsoft#3174](microsoft#3174) - Code cleanups: * Various cleanups (described in detail in the PRs, not repeated here). [microsoft#3082](microsoft#3082) [microsoft#3083](microsoft#3083) [microsoft#3084](microsoft#3084) [microsoft#3085](microsoft#3085) [microsoft#3086](microsoft#3086) [microsoft#3090](microsoft#3090) [microsoft#3091](microsoft#3091) [microsoft#3092](microsoft#3092) [microsoft#3093](microsoft#3093) [microsoft#3177](microsoft#3177) [microsoft#3178](microsoft#3178) * Improved Python scripts. [microsoft#3123](microsoft#3123) * Removed compiler bug workarounds. [microsoft#3155](microsoft#3155) * Moved `<atomic>` implementation details, preparing for later changes. [microsoft#3124](microsoft#3124) * Removed unnecessary partial specializations of `common_type` for the STL's internal 128-bit integer-class types. [microsoft#3153](microsoft#3153) - Infrastructure improvements: * The PR/CI system now uses spot VMs again. [microsoft#3071](microsoft#3071) * Configured Azure Pipelines to avoid running checks for draft PRs. [microsoft#3078](microsoft#3078) * Added GitHub Actions to allow contributors to move their PR cards in the Code Reviews project. [microsoft#2584](microsoft#2584) * Updated dependencies. [microsoft#3104](microsoft#3104) [microsoft#3155](microsoft#3155) + Updated build compiler to VS 2022 17.4 Preview 3. + Updated Boost.Math to 1.80.0 (now also used by the MSVC-internal build). [microsoft#3077](microsoft#3077) + Updated Clang to 15.0.1 (now required). + Updated CMake to 3.24 (now required). + Updated Google Benchmark to 1.7.0. [microsoft#3151](microsoft#3151) + Updated Python to 3.10.8. - Updated `_MSVC_STL_UPDATE`. [microsoft#3073](microsoft#3073) [microsoft#3147](microsoft#3147)
PreviousNext