SIGN IN SIGN UP
microsoft / STL UNCLAIMED

MSVC's implementation of the C++ Standard Library.

0 0 0 C++

TAGS

20 tags
msvc-build-tools-14.50

MSVC Build Tools 14.50 This shipped in VS 2026 18.0. - The STL no longer supports targeting Windows 7 / Server 2008 R2, Windows 8 / Server 2012, and Windows 8.1 / Server 2012 R2: * Improved the performance of `system_clock::now()` and `atomic::wait()` by directly calling APIs that were added in Windows 8. [#5432](https://github.com/microsoft/STL/pull/5432) [#5496](https://github.com/microsoft/STL/pull/5496) * Improved the performance of STL Hardening by using the MSVC [`__fastfail`](https://learn.microsoft.com/en-us/cpp/intrinsics/fastfail?view=msvc-170) intrinsic that was added in Windows 8, and the Clang [`__builtin_verbose_trap`](https://clang.llvm.org/docs/LanguageExtensions.html#builtin-verbose-trap) intrinsic. [#5433](https://github.com/microsoft/STL/pull/5433) [#5458](https://github.com/microsoft/STL/pull/5458) * Simplified the `<filesystem>` implementation by unconditionally calling APIs that were added in Windows 8. [#5434](https://github.com/microsoft/STL/pull/5434) * Windows 10 / Server 2016 are our minimum supported operating systems. [#5510](https://github.com/microsoft/STL/pull/5510) - The STL no longer supports targeting 32-bit ARM. [#5594](https://github.com/microsoft/STL/pull/5594) - Merged C++26 features: * [P0472R3](https://wg21.link/P0472R3) [#5382](https://github.com/microsoft/STL/pull/5382) Put `monostate` In `<utility>` * [P3223R2](https://wg21.link/P3223R2) [#5604](https://github.com/microsoft/STL/pull/5604) Making `istream::ignore()` Less Surprising - Merged *partial* C++26 features: * [P3697R1](https://wg21.link/P3697R1) [#5650](https://github.com/microsoft/STL/pull/5650) Minor Additions To Standard Library Hardening - Merged LWG issue resolutions: * [LWG-2503](https://cplusplus.github.io/LWG/issue2503) [#5535](https://github.com/microsoft/STL/pull/5535) `multiline` option should be added to `syntax_option_type` + For us, this is a `regex` behavioral change, so we added an escape hatch. By default, we define `_REGEX_LEGACY_MULTILINE_MODE` to `0`, which requests Standard behavior: - For ECMAScript, matching is non-multiline by default, but `regex_constants::multiline` can be requested. - For POSIX grammars, matching is non-multiline, and `regex_constants::multiline` is ignored; see [N5008](https://wg21.link/N5008) \[tab:re.synopt\]. + Defining `_REGEX_LEGACY_MULTILINE_MODE` to `1` requests legacy behavior: - For all grammars, matching is multiline, and `regex_constants::multiline` is redundant. * [LWG-4186](https://cplusplus.github.io/LWG/issue4186) [#5444](https://github.com/microsoft/STL/pull/5444) `regex_traits::transform_primary` mistakenly detects `typeid` of a function * [LWG-4222](https://cplusplus.github.io/LWG/issue4222) [#5602](https://github.com/microsoft/STL/pull/5602) `expected` constructor from a single value missing a constraint * [LWG-4242](https://cplusplus.github.io/LWG/issue4242) [#5603](https://github.com/microsoft/STL/pull/5603) `ranges::distance` does not work with volatile iterators - Merged *proposed* resolutions for LWG issues (not yet accepted for the C++ Working Draft, but we've chosen to implement this speculatively): * [LWG-4270](https://cplusplus.github.io/LWG/issue4270) [#5572](https://github.com/microsoft/STL/pull/5572) Diagnose misuse of `std::projected::operator*` * [LWG-4273](https://cplusplus.github.io/LWG/issue4273) [#5578](https://github.com/microsoft/STL/pull/5578) Standard execution policy types should be conventional tag class types * [LWG-4303](https://cplusplus.github.io/LWG/issue4303) [#5603](https://github.com/microsoft/STL/pull/5603) `std::decay_t` in the specification of `ranges::distance` is problematic - Fixed bugs: * Fixed `regex`'s behavior: + For the `basic` and `grep` grammars to properly handle `^` caret characters. [#5165](https://github.com/microsoft/STL/pull/5165) + For the `basic` and `grep` grammars to properly handle `$` dollar characters. [#5362](https://github.com/microsoft/STL/pull/5362) + For the `basic` and `grep` grammars to make backreferences to unmatched capture groups fail to match anything, instead of matching the empty string `""`. [#5376](https://github.com/microsoft/STL/pull/5376) + For the `basic` and `grep` grammars to properly handle backslashes inside square-bracket character classes. [#5523](https://github.com/microsoft/STL/pull/5523) + For POSIX grammars to allow a `]` right square bracket at the beginning of a character range. [#5364](https://github.com/microsoft/STL/pull/5364) + For POSIX grammars to avoid resetting matched capture groups. [#5377](https://github.com/microsoft/STL/pull/5377) + For the `ECMAScript` grammar's `(?!pattern)` negative lookahead assertions to make capture groups within them always match nothing after the assertions succeed. [#5366](https://github.com/microsoft/STL/pull/5366) + For the `ECMAScript` grammar's `\b` word boundary assertion to not match the empty string `""` (and inversely for the `\B` negative word boundary assertion). [#5375](https://github.com/microsoft/STL/pull/5375) + For the `ECMAScript` grammar's `\c` escapes to require the following ControlLetter to be an ASCII alphabetic character. [#5524](https://github.com/microsoft/STL/pull/5524) - That is, only `\ca` through `\cz` and `\cA` through `\cZ` are allowed. + For the `ECMAScript` grammar to reset all capture groups to "unmatched" at the start of each repetition of a loop. [#5456](https://github.com/microsoft/STL/pull/5456) + For the `ECMAScript` grammar to reject bogus groups by throwing a `regex_error` with the code `regex_constants::error_badrepeat`, removing the non-Standard code `regex_constants::error_syntax` that was previously used. [#5542](https://github.com/microsoft/STL/pull/5542) - That is, only non-capture groups `(?:meow)` and positive/negative lookahead assertions `(?=meow)`/`(?!meow)` are allowed; other characters following `(?` are bogus. Notably, the C++ Standard doesn't support the lookbehind assertions `(?<=meow)`/`(?<!meow)` that were added in later versions of ECMAScript. + For the `ECMAScript`, `basic`, `grep`, and `awk` grammars to properly handle escape sequences. [#5380](https://github.com/microsoft/STL/pull/5380) - POSIX grammars now accept `\]` as an identity escape for a right square bracket. [#5399](https://github.com/microsoft/STL/pull/5399) + For capture groups to follow ECMAScript's depth-first and POSIX's leftmost-longest matching rules. [#5218](https://github.com/microsoft/STL/pull/5218) - Removed unnecessary code for POSIX's leftmost-longest rule, reducing stack space consumption. [#5405](https://github.com/microsoft/STL/pull/5405) + For empty matches to follow ECMAScript's and POSIX's slightly different rules. [#5494](https://github.com/microsoft/STL/pull/5494) + For negated character class escapes (`\D` for non-digits, `\S` for non-whitespace, `\W` for non-words) inside square-bracket character classes when matching against Unicode characters. [#5403](https://github.com/microsoft/STL/pull/5403) [#5487](https://github.com/microsoft/STL/pull/5487) - This completes a series of fixes started by [#5160](https://github.com/microsoft/STL/pull/5160) and [#5214](https://github.com/microsoft/STL/pull/5214) in VS 2022 17.14. + For combinations of character class escapes inside square-bracket character classes (like `[\w\s]` for words and whitespace) when matching against Unicode characters. [#5438](https://github.com/microsoft/STL/pull/5438) + For character ranges with `regex_constants::collate` to follow the locale's collation order. [#5238](https://github.com/microsoft/STL/pull/5238) + For collating symbols and equivalence classes. [#5392](https://github.com/microsoft/STL/pull/5392) [#5444](https://github.com/microsoft/STL/pull/5444) + For small character ranges containing U+00FF and U+0100. [#5437](https://github.com/microsoft/STL/pull/5437) + For `regex_constants::icase` and `regex_constants::collate` to translate each character exactly once before any comparisons. [#5553](https://github.com/microsoft/STL/pull/5553) + For extremely unusual user-defined character types. [#5592](https://github.com/microsoft/STL/pull/5592) [#5675](https://github.com/microsoft/STL/pull/5675) + To avoid requiring non-Standard typedefs in custom regex traits classes. [#5671](https://github.com/microsoft/STL/pull/5671) * Fixed `collate<wchar_t>` to follow the locale's collation order when compiling with [`/Zc:wchar_t-`](https://learn.microsoft.com/en-us/cpp/build/reference/zc-wchar-t-wchar-t-is-native-type?view=msvc-170) (making `wchar_t` a non-Standard typedef for `unsigned short`) and linking to the STL dynamically (with `/MD` or `/MDd`). [#5361](https://github.com/microsoft/STL/pull/5361) * Fixed how `collate::do_transform()` handles wrongly encoded input. [#5431](https://github.com/microsoft/STL/pull/5431) * Fixed `collate::do_hash()` to return equal hashes for strings that collate as equivalent. [#5469](https://github.com/microsoft/STL/pull/5469) * Fixed `ranges::enable_view` to correctly report `false` for `ranges::view_interface` itself. [#5369](https://github.com/microsoft/STL/pull/5369) [#5407](https://github.com/microsoft/STL/pull/5407) * Fixed `<filesystem>` status functions to avoid failing for invalid paths when the current directory is a network path. [#5381](https://github.com/microsoft/STL/pull/5381) * Fixed compiler errors in `repeat_view`'s piecewise constructor for certain scenarios. [#5388](https://github.com/microsoft/STL/pull/5388) * Fixed compiler errors in `constexpr` `copy()` for `vector<bool>`. [#5347](https://github.com/microsoft/STL/pull/5347) + This fixed a regression that was introduced by [#3353](https://github.com/microsoft/STL/pull/3353) in VS 2022 17.9. * Fixed the `barrier` constructor's exception specification to be conditionally "strengthened", instead of unconditionally. [#5398](https://github.com/microsoft/STL/pull/5398) * Fixed heap-use-after-free bugs in our undocumented/quasi-supported `_HAS_EXCEPTIONS=0` mode when constructing `system_error`, `chrono::ambiguous_local_time`, and `chrono::nonexistent_local_time`. [#5406](https://github.com/microsoft/STL/pull/5406) * Fixed compiler errors when passing `volatile` ranges to `basic_string`'s `from_range` constructor and `append_range()`, `assign_range()`, `insert_range()`, and `replace_with_range()` member functions. [#5409](https://github.com/microsoft/STL/pull/5409) * Fixed `nth_element()` and `ranges::nth_element` to have worst-case linear complexity, instead of quadratic. [#5100](https://github.com/microsoft/STL/pull/5100) * Fixed compiler errors when passing iterators with unusual integer-class difference types to vectorized algorithms. [#5471](https://github.com/microsoft/STL/pull/5471) * Fixed `destroy()`, `destroy_at()`, `destroy_n()`, `ranges::destroy`, `ranges::destroy_at`, and `ranges::destroy_n` to destroy objects during constant evaluation even when they're trivially destructible. [#5449](https://github.com/microsoft/STL/pull/5449) * Fixed `num_get::do_get()` for `bool` to properly handle bad digit groupings. [#5476](https://github.com/microsoft/STL/pull/5476) * Fixed `thread::hardware_concurrency()` to correctly report the total number of logical processors when more than 64 are available, for both single-socket and multi-socket machines. [#5459](https://github.com/microsoft/STL/pull/5459) * Fixed `<mdspan>`'s `layout_stride::mapping<E>::is_exhaustive()` to correctly handle unusual extents. [#5477](https://github.com/microsoft/STL/pull/5477) * Fixed `reverse_copy()` and `ranges::reverse_copy` being improperly vectorized for `pair<T&, U&>` on x86 (where such `pair`s are 8 bytes). [#5528](https://github.com/microsoft/STL/pull/5528) + This fixed a regression that was introduced by [#804](https://github.com/microsoft/STL/pull/804) in VS 2019 16.8. * Fixed `chrono::zoned_time` to provide a fallback time zone abbreviation (of the form `"-05"` or `"+0530"`) when the system's code page can't represent the localized abbreviation that would normally be returned. [#5558](https://github.com/microsoft/STL/pull/5558) * Fixed `counting_semaphore::try_acquire_for()` to consistently use `steady_clock`. [#5575](https://github.com/microsoft/STL/pull/5575) * Silenced a static analysis warning C6510 emitted by the extremely unusual scenario of `basic_string<char_like_struct>`. [#5563](https://github.com/microsoft/STL/pull/5563) * Fixed compiler errors involving incomplete types in `<chrono>`. [#5629](https://github.com/microsoft/STL/pull/5629) * Fixed occurrences of Clang 21's new `-Wcharacter-conversion` warning in `<locale>` by avoiding implicit conversions between `charN_t` types. [#5653](https://github.com/microsoft/STL/pull/5653) * Fixed integer overflow in `stable_sort()` and `ranges::stable_sort` when sorting huge inputs on x86. [#5677](https://github.com/microsoft/STL/pull/5677) + This affected 32-bit architectures with over a billion 1-byte elements. 64-bit architectures were immune. + This fix was backported to VS 2022 17.14.20. * Fixed `filesystem::temp_directory_path(error_code&)` to return an empty `filesystem::path` when an error is encountered. [#5570](https://github.com/microsoft/STL/pull/5570) - Improved performance: * Improved performance for `regex` matching: + When a `regex` starts with a `?` question mark quantifier or several alternatives, by avoiding quadratic complexity. [#5457](https://github.com/microsoft/STL/pull/5457) + When a `regex` starts with a `+` plus quantifier (or `{min,}` or `{min,max}` quantifiers requiring at least 1 repetition). [#5509](https://github.com/microsoft/STL/pull/5509) + When a `regex` contains no capture groups, by avoiding unnecessary allocations. [#5518](https://github.com/microsoft/STL/pull/5518) + For all `regex` patterns, by not generating unnecessary "if" nodes with a single branch. [#5539](https://github.com/microsoft/STL/pull/5539) + When a `regex` starts with positive/negative word boundary assertions `\b`/`\B` and lookahead assertions `(?=meow)`/`(?!meow)`. [#5576](https://github.com/microsoft/STL/pull/5576) + By calling `std::search()` internally. [#5586](https://github.com/microsoft/STL/pull/5586) + By avoiding unnecessary work in `regex_constants::collate` mode. [#5672](https://github.com/microsoft/STL/pull/5672) * Started using `[[msvc::no_unique_address]]` as a space optimization in several C++23 components. [#4960](https://github.com/microsoft/STL/pull/4960) * Added x64/x86 vectorized implementations of: + `basic_string::find_first_not_of()` and `basic_string::find_last_not_of()` for one character. [#5102](https://github.com/microsoft/STL/pull/5102) + `basic_string::find_first_not_of()` and `basic_string::find_last_not_of()` for multiple characters. [#5206](https://github.com/microsoft/STL/pull/5206) + `adjacent_find()` and `ranges::adjacent_find`. [#5331](https://github.com/microsoft/STL/pull/5331) + `unique()` and `ranges::unique`. [#5092](https://github.com/microsoft/STL/pull/5092) [#5363](https://github.com/microsoft/STL/pull/5363) + `search_n()` and `ranges::search_n` for small values of n. [#5352](https://github.com/microsoft/STL/pull/5352) + `remove_copy()`, `ranges::remove_copy`, `unique_copy()`, and `ranges::unique_copy`. [#5355](https://github.com/microsoft/STL/pull/5355) + `is_sorted_until()` and `ranges::is_sorted_until`. [#5420](https://github.com/microsoft/STL/pull/5420) [#5540](https://github.com/microsoft/STL/pull/5540) + `search()`, `ranges::search`, `default_searcher`, `find_end()`, and `ranges::find_end`, for 4-byte and 8-byte elements. [#5484](https://github.com/microsoft/STL/pull/5484) [#5519](https://github.com/microsoft/STL/pull/5519) - They were vectorized for 1-byte and 2-byte elements in VS 2022 17.13. + `rotate()` and `ranges::rotate`. [#5502](https://github.com/microsoft/STL/pull/5502) [#5525](https://github.com/microsoft/STL/pull/5525) * Improved the x64/x86 vectorized implementations of: + `reverse_copy()` and `ranges::reverse_copy`. [#5493](https://github.com/microsoft/STL/pull/5493) * Improved the ARM64EC vectorized implementations of: + `find()` and `ranges::find`. [#5597](https://github.com/microsoft/STL/pull/5597) * Improved the performance of `ranges::find` for 2-byte elements on ARM64, matching `find()`'s behavior. [#5628](https://github.com/microsoft/STL/pull/5628) * Used Clang's builtin `__is_trivially_equality_comparable` to improve the performance of `equal()`, `ranges::equal`, and many vectorized algorithms for more types. [#5527](https://github.com/microsoft/STL/pull/5527) * Optimized `search_n()` and `ranges::search_n` for n=1 to internally call `find()` and `ranges::find`. [#5346](https://github.com/microsoft/STL/pull/5346) * Improved codegen for `has_single_bit()`, especially when `popcount()` intrinsics are unconditionally available. [#5367](https://github.com/microsoft/STL/pull/5367) [#5534](https://github.com/microsoft/STL/pull/5534) + For example, x86/x64 with [`/arch:AVX`](https://learn.microsoft.com/en-us/cpp/build/reference/arch-x64?view=msvc-170) and ARM64 can unconditionally use `popcount()` intrinsics. * Optimized `poisson_distribution`'s constructor by avoiding unnecessary work. [#5411](https://github.com/microsoft/STL/pull/5411) * Implemented an exponential speedup (yes, literally) for `minstd_rand` and `minstd_rand0`'s `discard()` member function. [#5412](https://github.com/microsoft/STL/pull/5412) * Improved `linear_congruential_engine` performance by using our modern internal implementation of 128-bit integers. [#5436](https://github.com/microsoft/STL/pull/5436) [#5473](https://github.com/microsoft/STL/pull/5473) * Significantly improved performance for `chrono::tzdb::locate_zone()` by using binary searches for time zone names. [#5548](https://github.com/microsoft/STL/pull/5548) * Improved `std::includes()` to have the same performance as `ranges::includes`. [#5543](https://github.com/microsoft/STL/pull/5543) [#5595](https://github.com/microsoft/STL/pull/5595) * Improved the performance of `count()` for `vector<bool>`. [#5640](https://github.com/microsoft/STL/pull/5640) - Enhanced behavior: * Used a new Clang compiler intrinsic to implement `is_scoped_enum`. [#5358](https://github.com/microsoft/STL/pull/5358) * Added debug checks for overlapping ranges in `replace_copy()`, `replace_copy_if()`, `reverse_copy()`, `rotate_copy()`, and their `ranges` counterparts. [#5495](https://github.com/microsoft/STL/pull/5495) * Improved `<mdspan>`'s debug checks in `layout_stride::mapping<E>`'s constructor. [#5505](https://github.com/microsoft/STL/pull/5505) * Avoided compiler warnings in `vector<bool>::max_size()` with the compiler's upcoming implementation of Defect Report [P2280R4](https://wg21.link/P2280R4). [#5550](https://github.com/microsoft/STL/pull/5550) [#5566](https://github.com/microsoft/STL/pull/5566) * Updated several checks for precondition violations and impossible situations to use the STL's usual error reporting mechanism. [#5560](https://github.com/microsoft/STL/pull/5560) * Improved `regex` parsing to detect excessive recursion (caused by extreme numbers of non-capturing groups or lookahead assertions) and throw a `regex_error` with the code `regex_constants::error_stack`. [#5588](https://github.com/microsoft/STL/pull/5588) * Changed `<regex>` matching to use heap allocations for saved match state, slightly reducing stack pressure. [#5682](https://github.com/microsoft/STL/pull/5682) * Silenced CodeQL warnings. [#5625](https://github.com/microsoft/STL/pull/5625) * Silenced a new compiler warning C5291 throughout the STL. [#5645](https://github.com/microsoft/STL/pull/5645) - Improved debugger visualization: * Fixed an off-by-one mistake in the displayed year for `system_clock::time_point`. [#5389](https://github.com/microsoft/STL/pull/5389) * Updated the visualizer for `system_clock::time_point` to recognize the synonymous but slightly different type name emitted by Clang. [#5390](https://github.com/microsoft/STL/pull/5390) - Improved test coverage: * Updated our LLVM submodule, including new tests. [#5349](https://github.com/microsoft/STL/pull/5349) [#5467](https://github.com/microsoft/STL/pull/5467) [#5688](https://github.com/microsoft/STL/pull/5688) * Changed the benchmark build from `/O2 /Ob1` to [`/O2 /Ob2`](https://learn.microsoft.com/en-us/cpp/build/reference/ob-inline-function-expansion?view=msvc-170), producing more realistic and useful results. [#5370](https://github.com/microsoft/STL/pull/5370) * Added benchmarks for: + `fill()` and `fill_n()`. [#5400](https://github.com/microsoft/STL/pull/5400) + `reverse()` and `reverse_copy()`. [#5493](https://github.com/microsoft/STL/pull/5493) + The `count()` optimization for `vector<bool>`. [#5684](https://github.com/microsoft/STL/pull/5684) * Improved the consistency of how `normal_distribution` is used in benchmarks and tests. [#5404](https://github.com/microsoft/STL/pull/5404) * Increased the consistency of several benchmarks by adding allocators to control alignment. [#5443](https://github.com/microsoft/STL/pull/5443) * Updated the benchmarks to support being built with Clang. [#5533](https://github.com/microsoft/STL/pull/5533) * Updated an `iter_rvalue_reference_t` test in response to a compiler change. [#5378](https://github.com/microsoft/STL/pull/5378) * Fixed sporadic test failures by avoiding excessive compiler memory consumption. [#5383](https://github.com/microsoft/STL/pull/5383) * Improved the runtime performance of the major test for vectorized algorithms. [#5425](https://github.com/microsoft/STL/pull/5425) * Added more test coverage for `search_n()` and `ranges::search_n`. [#5439](https://github.com/microsoft/STL/pull/5439) [#5440](https://github.com/microsoft/STL/pull/5440) * Updated the test harness to properly detect the locale name `"Czech_Czechia.1250"`. [#5480](https://github.com/microsoft/STL/pull/5480) * Updated `source_location` test coverage to handle upcoming changes in the EDG front-end used for IntelliSense. [#5551](https://github.com/microsoft/STL/pull/5551) * Categorized the remaining `<regex>` test failures in the libcxx suite. [#5587](https://github.com/microsoft/STL/pull/5587) * Avoided/suppressed compiler warnings in tests. [#5654](https://github.com/microsoft/STL/pull/5654) [#5655](https://github.com/microsoft/STL/pull/5655) [#5656](https://github.com/microsoft/STL/pull/5656) [#5657](https://github.com/microsoft/STL/pull/5657) [#5676](https://github.com/microsoft/STL/pull/5676) * Worked around assertions in the `lerp()` test on ARM64. [#5687](https://github.com/microsoft/STL/pull/5687) - Improved documentation: * Clarified our machine-searchable SPDX-License-Identifier comments to properly describe how we used [Ryu](https://github.com/ulfjack/ryu) to implement `<charconv>`. [#5401](https://github.com/microsoft/STL/pull/5401) * Fixed confusing comments around the control macro for vectorizing algorithms with floating-point types. [#5417](https://github.com/microsoft/STL/pull/5417) - Code cleanups: * Simplified the control flow in `ranges::search_n`. [#5343](https://github.com/microsoft/STL/pull/5343) * Simplified the implementation of `regex` quantifiers. [#5253](https://github.com/microsoft/STL/pull/5253) * Removed comments that were citing proposed resolutions for LWG issues, now that those issues have been officially resolved by the November 2024 and June 2025 meetings. [#5360](https://github.com/microsoft/STL/pull/5360) [#5584](https://github.com/microsoft/STL/pull/5584) * Removed compiler bug workarounds. [#5410](https://github.com/microsoft/STL/pull/5410) [#5580](https://github.com/microsoft/STL/pull/5580) [#5634](https://github.com/microsoft/STL/pull/5634) [#5661](https://github.com/microsoft/STL/pull/5661) [#5674](https://github.com/microsoft/STL/pull/5674) * Significantly cleaned up the implementation of x64/x86 vectorized algorithms. [#5429](https://github.com/microsoft/STL/pull/5429) [#5450](https://github.com/microsoft/STL/pull/5450) [#5485](https://github.com/microsoft/STL/pull/5485) [#5532](https://github.com/microsoft/STL/pull/5532) * Removed an unnecessarily verbose internal macro. [#5475](https://github.com/microsoft/STL/pull/5475) * Removed unnecessary code for constant evaluation in `char_traits::assign()`. [#5488](https://github.com/microsoft/STL/pull/5488) * Various cleanups (described in detail in the PRs, not repeated here). [#5498](https://github.com/microsoft/STL/pull/5498) [#5500](https://github.com/microsoft/STL/pull/5500) [#5541](https://github.com/microsoft/STL/pull/5541) [#5565](https://github.com/microsoft/STL/pull/5565) [#5636](https://github.com/microsoft/STL/pull/5636) * Restructured code to `if constexpr (condition) { ... } else { ... }`, improving clarity and avoiding unreachable code. [#5643](https://github.com/microsoft/STL/pull/5643) * Simplified how `<chrono>` initializes a `tm` struct. [#5662](https://github.com/microsoft/STL/pull/5662) - Infrastructure improvements: * Added ARM64EC stages to Azure Pipelines. [#5492](https://github.com/microsoft/STL/pull/5492) [#5517](https://github.com/microsoft/STL/pull/5517) [#5521](https://github.com/microsoft/STL/pull/5521) + Including an Early Build, benchmarks, and tests. * Improved code format validation to report line numbers in error messages. [#5559](https://github.com/microsoft/STL/pull/5559) * Updated dependencies. [#5370](https://github.com/microsoft/STL/pull/5370) [#5410](https://github.com/microsoft/STL/pull/5410) [#5478](https://github.com/microsoft/STL/pull/5478) [#5512](https://github.com/microsoft/STL/pull/5512) [#5530](https://github.com/microsoft/STL/pull/5530) [#5580](https://github.com/microsoft/STL/pull/5580) [#5641](https://github.com/microsoft/STL/pull/5641) [#5659](https://github.com/microsoft/STL/pull/5659) [#5674](https://github.com/microsoft/STL/pull/5674) + Updated build compiler to VS 2022 17.14.12 Preview 1. + Updated CMake to 3.31 (now required). + Updated Google Benchmark to 1.9.4. + Updated Python to 3.13.6. + Updated to Windows 11 SDK 26100. This is now required for building and testing the STL, but not for using it. - Updated `_MSVC_STL_UPDATE` and `_MSVC_STL_VERSION`. [#5385](https://github.com/microsoft/STL/pull/5385) [#5464](https://github.com/microsoft/STL/pull/5464) [#5568](https://github.com/microsoft/STL/pull/5568) [#5633](https://github.com/microsoft/STL/pull/5633) [#5664](https://github.com/microsoft/STL/pull/5664)

vs-2022-17.14

VS 2022 17.14 - Merged C++26 features: * [P3323R1](https://wg21.link/P3323R1) [#5213](https://github.com/microsoft/STL/pull/5213) Forbid `atomic<cv T>`, Specify `atomic_ref<cv T>` - Merged *partial* C++26 features: * [P3471R4](https://wg21.link/P3471R4) [#5274](https://github.com/microsoft/STL/pull/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](https://github.com/microsoft/STL/issues/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. [#5318](https://github.com/microsoft/STL/pull/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) [#5157](https://github.com/microsoft/STL/pull/5157) Modernizing numeric type requirements * [LWG-3886](https://cplusplus.github.io/LWG/issue3886) [#5232](https://github.com/microsoft/STL/pull/5232) Monad mo' problems (in `optional` and `expected`) * [LWG-3899](https://cplusplus.github.io/LWG/issue3899) [#5303](https://github.com/microsoft/STL/pull/5303) `co_yield`ing elements of an lvalue `generator` is unnecessarily inefficient * [LWG-3900](https://cplusplus.github.io/LWG/issue3900) [#5150](https://github.com/microsoft/STL/pull/5150) The `allocator_arg_t` overloads of `generator::promise_type::operator new` should not be constrained * [LWG-3918](https://cplusplus.github.io/LWG/issue3918) [#5135](https://github.com/microsoft/STL/pull/5135) [#5170](https://github.com/microsoft/STL/pull/5170) `std::uninitialized_move/_n` and guaranteed copy elision * [LWG-3956](https://cplusplus.github.io/LWG/issue3956) [#5334](https://github.com/microsoft/STL/pull/5334) `chrono::parse` uses `from_stream` as a customization point * [LWG-4014](https://cplusplus.github.io/LWG/issue4014) [#5132](https://github.com/microsoft/STL/pull/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) [#5221](https://github.com/microsoft/STL/pull/5221) *`possibly-const-range`* should prefer returning `const R&` * [LWG-4084](https://cplusplus.github.io/LWG/issue4084) [#5151](https://github.com/microsoft/STL/pull/5151) `std::fixed` ignores `std::uppercase` * [LWG-4112](https://cplusplus.github.io/LWG/issue4112) [#5152](https://github.com/microsoft/STL/pull/5152) *`has-arrow`* should require `operator->()` to be `const`-qualified * [LWG-4119](https://cplusplus.github.io/LWG/issue4119) [#5220](https://github.com/microsoft/STL/pull/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) [#5155](https://github.com/microsoft/STL/pull/5155) Cannot format `zoned_time` with resolution coarser than seconds * [LWG-4135](https://cplusplus.github.io/LWG/issue4135) [#5131](https://github.com/microsoft/STL/pull/5131) The helper lambda of `std::erase` for `list` should specify return type as `bool` * [LWG-4140](https://cplusplus.github.io/LWG/issue4140) [#5129](https://github.com/microsoft/STL/pull/5129) Useless default constructors for bit reference types * [LWG-4144](https://cplusplus.github.io/LWG/issue4144) [#5201](https://github.com/microsoft/STL/pull/5201) Disallow `unique_ptr<T&, D>` * [LWG-4169](https://cplusplus.github.io/LWG/issue4169) [#5128](https://github.com/microsoft/STL/pull/5128) `std::atomic<T>`'s default constructor should be constrained * [LWG-4172](https://cplusplus.github.io/LWG/issue4172) [#5337](https://github.com/microsoft/STL/pull/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) [#5232](https://github.com/microsoft/STL/pull/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`. [#5104](https://github.com/microsoft/STL/pull/5104) + This is consistent with `generic_category().message()` (which always returns US English in our implementation) and has the best chance of returning something intelligible instead of `"unknown error"` or `"???"`. + This fixed a regression that was introduced by [#2669](https://github.com/microsoft/STL/pull/2669) in VS 2022 17.3. * Fixed `regex`'s behavior: + To reject bogus character class ranges like `R"([\d-e])"`. [#5158](https://github.com/microsoft/STL/pull/5158) + For negated character class escapes (`\D` for non-digits, `\S` for non-whitespace, `\W` for non-words) when matching against Unicode characters: - Outside square-bracket character classes. [#5160](https://github.com/microsoft/STL/pull/5160) - Inside square-bracket character classes (partially fixed). [#5214](https://github.com/microsoft/STL/pull/5214) + For character ranges in case-insensitive mode. [#5164](https://github.com/microsoft/STL/pull/5164) + For the `basic` grammar to parse a single digit for backreferences. [#5167](https://github.com/microsoft/STL/pull/5167) + For its internal buffers to grow geometrically. [#5175](https://github.com/microsoft/STL/pull/5175) + For the special character `.` (dot). [#5192](https://github.com/microsoft/STL/pull/5192) + For its constructor to accept (null, zero) arguments. [#5211](https://github.com/microsoft/STL/pull/5211) * Fixed `filesystem::equivalent()` to return correct results when shared folders are involved. [#5130](https://github.com/microsoft/STL/pull/5130) * Fixed `chrono::weekday`'s constructor to avoid integer overflow for extreme inputs. [#5156](https://github.com/microsoft/STL/pull/5156) * Fixed `push_range()` for `stack`, `queue`, and `priority_queue` to forward the range to `c.append_range()` when possible, exactly as depicted in the Standard. [#5168](https://github.com/microsoft/STL/pull/5168) * Fixed code to call `ranges::begin` and `ranges::end` exactly as depicted in the Standard: + `ranges::to`. [#5173](https://github.com/microsoft/STL/pull/5173) + `range_formatter`. [#5178](https://github.com/microsoft/STL/pull/5178) * Fixed compiler errors in `range_formatter` involving highly unusual contiguous ranges. [#5187](https://github.com/microsoft/STL/pull/5187) * Fixed heterogeneous lookup for unordered containers to follow the Standard, allowing braced initializer lists to be used as arguments. [#5208](https://github.com/microsoft/STL/pull/5208) * Fixed compiler errors in `views::counted` involving highly unusual types. [#5223](https://github.com/microsoft/STL/pull/5223) * Fixed integer overflow in `this_thread::sleep_for()` with extremely small units (e.g. picoseconds). [#5237](https://github.com/microsoft/STL/pull/5237) * Fixed `basic_string::reserve()`'s ASan annotations to detect writes to its unused capacity. [#5252](https://github.com/microsoft/STL/pull/5252) * Fixed how `<format>` handles field width for alternate form general floating-point. [#5261](https://github.com/microsoft/STL/pull/5261) * Fixed compiler errors when constructing a `basic_ispanstream` from a modifiable `basic_string`. [#5309](https://github.com/microsoft/STL/pull/5309) + This fixed a regression that was introduced by [#4938](https://github.com/microsoft/STL/pull/4938) in VS 2022 17.13. * Fixed compiler errors when using `<format>` in a CUDA project, by adding a compiler bug workaround. [#5335](https://github.com/microsoft/STL/pull/5335) * Fixed compiler errors when converting between different specializations of `basic_const_iterator`. [#5325](https://github.com/microsoft/STL/pull/5325) - Improved performance: * Added vectorized implementations of: + `basic_string::find()` for a character. [#5101](https://github.com/microsoft/STL/pull/5101) * Improved the vectorized implementations of: + `basic_string::find_first_of()` and `basic_string::find_last_of()`. [#5029](https://github.com/microsoft/STL/pull/5029) * `regex_traits::translate()` is now an identity function, as required by the Standard, instead of an expensive locale operation. [#5209](https://github.com/microsoft/STL/pull/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. [#5284](https://github.com/microsoft/STL/pull/5284) [#5312](https://github.com/microsoft/STL/pull/5312) * Optimized the `minstd_rand` and `minstd_rand0` random number engines by avoiding constant divisions. [#5256](https://github.com/microsoft/STL/pull/5256) * Slightly improved `move_only_function`'s constructors to do less work when setting the object to be empty. [#5328](https://github.com/microsoft/STL/pull/5328) - Enhanced behavior: * `std::expected`, `std::unexpected`, and all STL exception types are now marked `[[nodiscard]]`. [#5174](https://github.com/microsoft/STL/pull/5174) + This affects all user-defined functions returning these types by value. It also affects any directly constructed temporaries that are immediately discarded. * Deprecated the non-Standard `locale::empty()` static member function. [#5197](https://github.com/microsoft/STL/pull/5197) * Changed the STL to avoid using `is_trivial`, which is being deprecated in C++26. [#5202](https://github.com/microsoft/STL/pull/5202) * Improved the STL's debug checks with better messages and fewer branches. [#5270](https://github.com/microsoft/STL/pull/5270) - Improved debugger visualization: * Improved the visualizers for `basic_string_view` and its iterators by suppressing irrelevant pointer values. [#5176](https://github.com/microsoft/STL/pull/5176) * Dramatically simplified how the visualizers for `basic_string` and its iterators are implemented. [#5177](https://github.com/microsoft/STL/pull/5177) - Improved test coverage: * Simplified the test harness by dropping `ctest`. Now we always directly invoke `stl-lit.py`. [#5169](https://github.com/microsoft/STL/pull/5169) * Improved the test harness to warn only once when a compiler is missing. [#5199](https://github.com/microsoft/STL/pull/5199) * Categorized libcxx test failures. [#5231](https://github.com/microsoft/STL/pull/5231) * Updated our LLVM submodule, including new tests. [#5235](https://github.com/microsoft/STL/pull/5235) * Added test coverage for the ASan annotations in `basic_string::reserve()` and `vector::reserve()`. [#5241](https://github.com/microsoft/STL/pull/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. [#5283](https://github.com/microsoft/STL/pull/5283) - Code cleanups: * Removed compiler bug workarounds. [#5186](https://github.com/microsoft/STL/pull/5186) [#5247](https://github.com/microsoft/STL/pull/5247) [#5257](https://github.com/microsoft/STL/pull/5257) [#5284](https://github.com/microsoft/STL/pull/5284) [#5335](https://github.com/microsoft/STL/pull/5335) * Removed usage of `[[likely]]` and `[[unlikely]]`, which are discouraged by the compiler team. [#5255](https://github.com/microsoft/STL/pull/5255) * Various cleanups (described in detail in the PRs, not repeated here). [#5336](https://github.com/microsoft/STL/pull/5336) - Infrastructure improvements: * Updated dependencies. [#5186](https://github.com/microsoft/STL/pull/5186) [#5247](https://github.com/microsoft/STL/pull/5247) [#5257](https://github.com/microsoft/STL/pull/5257) [#5284](https://github.com/microsoft/STL/pull/5284) [#5335](https://github.com/microsoft/STL/pull/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`. [#5162](https://github.com/microsoft/STL/pull/5162) [#5217](https://github.com/microsoft/STL/pull/5217) [#5264](https://github.com/microsoft/STL/pull/5264) [#5323](https://github.com/microsoft/STL/pull/5323)

vs-2022-17.13

VS 2022 17.13 - Merged C++23 features: * [P2502R2](https://wg21.link/P2502R2) [#4953](https://github.com/microsoft/STL/pull/4953) `<generator>`: Synchronous Coroutine Generator For Ranges + [P2787R1](https://wg21.link/P2787R1) `pmr::generator` - Merged C++23 Defect Reports: * [P3107R5](https://wg21.link/P3107R5) [#4821](https://github.com/microsoft/STL/pull/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()`. [#4955](https://github.com/microsoft/STL/pull/4955) + This fixed a regression that was introduced by [#4091](https://github.com/microsoft/STL/pull/4091) in VS 2022 17.10. * Fixed compiler errors when constructing highly unusual `unique_ptr`s (storing fancy pointers) from unspeakably evil relics of the forgotten past. [#4922](https://github.com/microsoft/STL/pull/4922) * Fixed compiler errors when calling `ranges::inplace_merge` with certain combinations of elements, projections, and comparisons. [#4927](https://github.com/microsoft/STL/pull/4927) * Fixed compiler errors in `basic_ispanstream`'s constructor and `basic_ispanstream::span()` taking `ReadOnlyRange&&` with highly unusual types. [#4938](https://github.com/microsoft/STL/pull/4938) * Fixed compiler errors in the highly unusual scenario of calling `basic_string` and `basic_string_view`'s `find_first_of()` family of member functions for program-defined "unicorn" character types. [#4951](https://github.com/microsoft/STL/pull/4951) * Fixed compiler errors when constructing `optional` from highly unusual types. [#4961](https://github.com/microsoft/STL/pull/4961) * Fixed sequence container emplacement functions (e.g. `vector::emplace_back()`) to avoid emitting "warning C5046: Symbol involving type with internal linkage not defined" for highly unusual types. [#4963](https://github.com/microsoft/STL/pull/4963) [#4980](https://github.com/microsoft/STL/pull/4980) + This also fixed ODR violations when mixing C++14 with C++17-and-later translation units calling sequence container emplacement functions for any types. * Fixed ODR violations when mixing C++17 with C++20-and-later translation units calling `list/forward_list::remove/remove_if/unique()`. [#4975](https://github.com/microsoft/STL/pull/4975) * Fixed compiler errors in `variant`'s converting constructor and converting assignment operator for certain types. [#4966](https://github.com/microsoft/STL/pull/4966) * Fixed `bitset`'s streaming operator `operator>>(basic_istream<CharT, Traits>&, bitset<N>&)` to use the stream's `Traits` to compare characters. [#4970](https://github.com/microsoft/STL/pull/4970) * Fixed `basic_string` and `list`'s internal constructors to avoid disrupting highly unusual scenarios. [#4976](https://github.com/microsoft/STL/pull/4976) * Fixed compiler errors when constructing a `packaged_task` from a move-only function object. [#4946](https://github.com/microsoft/STL/pull/4946) * For Clang `/fp:fast`, fixed `<cmath>` and `<limits>` to avoid emitting `-Wnan-infinity-disabled` warnings, except when `numeric_limits::infinity()`/`quiet_NaN()`/`signaling_NaN()` are specifically called. [#4990](https://github.com/microsoft/STL/pull/4990) * Fixed `ranges::copy_n` to properly handle negative values of n (as a no-op) when activating our `memmove()` optimization. [#5046](https://github.com/microsoft/STL/pull/5046) + Also fixed our `memmove()` optimization (used by `copy_n()`, `ranges::copy_n`, and more) to avoid emitting compiler warnings with certain iterators. * Fixed `filesystem::directory_entry::refresh()` to avoid sporadically failing for nonexistent network paths on Windows 11 24H2. [#5077](https://github.com/microsoft/STL/pull/5077) * Fixed `basic_istream::get()` and `basic_istream::getline()` to never write a null terminator into zero-sized buffers, and to always write a null terminator otherwise. [#5073](https://github.com/microsoft/STL/pull/5073) * Fixed `assign_range()` for sequence containers to `static_assert` that the container elements are assignable from the range's reference type. [#5086](https://github.com/microsoft/STL/pull/5086) * Fixed compiler errors in various ranges algorithms when used with `views::iota` in certain scenarios. [#5091](https://github.com/microsoft/STL/pull/5091) - Improved performance: * Added vectorized implementations of: + `basic_string::find_first_of()`. [#4744](https://github.com/microsoft/STL/pull/4744) + `basic_string::find_last_of()`. [#4934](https://github.com/microsoft/STL/pull/4934) + `basic_string::find()` for a substring. [#5048](https://github.com/microsoft/STL/pull/5048) + `basic_string::rfind()` for a substring. [#5057](https://github.com/microsoft/STL/pull/5057) + `basic_string::rfind()` for a single character. [#5087](https://github.com/microsoft/STL/pull/5087) + `search()`, `ranges::search`, and `default_searcher`, for 1-byte and 2-byte elements. [#4745](https://github.com/microsoft/STL/pull/4745) + `find_end()` and `ranges::find_end`, for 1-byte and 2-byte elements. [#4943](https://github.com/microsoft/STL/pull/4943) [#5041](https://github.com/microsoft/STL/pull/5041) [#5042](https://github.com/microsoft/STL/pull/5042) + `bitset`'s constructors from strings. [#4839](https://github.com/microsoft/STL/pull/4839) + `remove()` and `ranges::remove`. [#4987](https://github.com/microsoft/STL/pull/4987) * Improved the vectorized implementations of: + `ranges::minmax`, now activated for 1-byte and 2-byte elements. [#4913](https://github.com/microsoft/STL/pull/4913) + The `minmax_element()` and `minmax()` algorithm families. [#4917](https://github.com/microsoft/STL/pull/4917) [#5016](https://github.com/microsoft/STL/pull/5016) * Helped the compiler auto-vectorize: + `swap()` and `ranges::swap` for arrays. [#4991](https://github.com/microsoft/STL/pull/4991) + `adjacent_difference()`. [#4958](https://github.com/microsoft/STL/pull/4958) [#5061](https://github.com/microsoft/STL/pull/5061) [#5079](https://github.com/microsoft/STL/pull/5079) [#5097](https://github.com/microsoft/STL/pull/5097) * `ranges` algorithms now unwrap output iterators, avoiding unnecessary checking. [#5015](https://github.com/microsoft/STL/pull/5015) [#5027](https://github.com/microsoft/STL/pull/5027) * Optimized `bitset`'s streaming operators. [#5008](https://github.com/microsoft/STL/pull/5008) * Optimized the newline-printing overloads `println(FILE*)`, `println(ostream&)`, and nullary `println()`. [#4672](https://github.com/microsoft/STL/pull/4672) * Updated `array` and `vector`'s spaceship comparison operators to take advantage of the vectorized implementation of `lexicographical_compare_three_way()`. [#5078](https://github.com/microsoft/STL/pull/5078) * Extended the "key extraction" optimization in the unique associative containers (both ordered and unordered) to handle more types. [#5050](https://github.com/microsoft/STL/pull/5050) * Optimized `filesystem::symlink_status()` by avoiding unnecessary Windows API calls. [#5071](https://github.com/microsoft/STL/pull/5071) - Improved throughput: * Improved C++23 throughput by not including all of `<ostream>` (which drags in `<format>`) unless the Standard requires it. [#4936](https://github.com/microsoft/STL/pull/4936) * Improved C++23 throughput of `<queue>`, `<stack>`, `<stacktrace>`, and `<thread>` by not including all of `<format>`. [#5003](https://github.com/microsoft/STL/pull/5003) * Moved `system_clock`, `high_resolution_clock`, and `chrono_literals` from a commonly-included internal header to `<chrono>`. [#5105](https://github.com/microsoft/STL/pull/5105) + This has source-breaking impact. If you see compiler errors complaining that it doesn't recognize `chrono` types like `system_clock` or UDLs like `1729ms`, you need to include `<chrono>` specifically, instead of assuming that headers like `<thread>` will drag it in. - Enhanced behavior: * Changed an internal `pair` constructor to be `private`. [#4979](https://github.com/microsoft/STL/pull/4979) * Fixed a CodeQL warning by replacing a squirrelly `memcpy()` call in the `filesystem` implementation (that was intentionally performing a read overrun) with two cromulent `memcpy()` calls. [#4933](https://github.com/microsoft/STL/pull/4933) * Silenced CodeQL warnings. [#4942](https://github.com/microsoft/STL/pull/4942) [#4985](https://github.com/microsoft/STL/pull/4985) [#5072](https://github.com/microsoft/STL/pull/5072) * Added a visualizer for `system_clock::time_point`. [#5005](https://github.com/microsoft/STL/pull/5005) * Changed some `vector` machinery to use scope guards instead of `throw;`, making debugging easier when exceptions are thrown. [#4977](https://github.com/microsoft/STL/pull/4977) * Improved `regex_error::what()`'s message for `regex_constants::error_badbrace`. [#5025](https://github.com/microsoft/STL/pull/5025) * Improved `optional<T>::swap()`'s `static_assert` messages when `T` isn't both move constructible and swappable. [#5065](https://github.com/microsoft/STL/pull/5065) * Removed `locale::id`'s non-Standard constructor from `size_t` and implicit conversion operator to `size_t`. [#5067](https://github.com/microsoft/STL/pull/5067) + For user-visible headers, at least. They remain dllexported for binary compatibility. * Improved `mutex` assertions to distinguish "unlock of unowned mutex" from "unlock of mutex not owned by the current thread". [#5099](https://github.com/microsoft/STL/pull/5099) - Improved test coverage: * Updated tests to work with Clang 18. [#4932](https://github.com/microsoft/STL/pull/4932) [#4937](https://github.com/microsoft/STL/pull/4937) * Fixed sporadic failures in a `timed_mutex` test. [#4973](https://github.com/microsoft/STL/pull/4973) * Extended CUDA test coverage beyond C++14, adding C++17 and C++20. [#4974](https://github.com/microsoft/STL/pull/4974) * When Python `psutil` is installed, the test harness now supports a `priority` parameter, defaulting to `idle`. [#5032](https://github.com/microsoft/STL/pull/5032) * Increased the consistency of the `swap_ranges()` benchmark by adding allocators to control alignment. [#5043](https://github.com/microsoft/STL/pull/5043) * Updated our LLVM submodule, including new tests. [#5038](https://github.com/microsoft/STL/pull/5038) * Divided the increasingly large test for vectorized algorithms into smaller parts, extracting `mismatch()`, `lexicographical_compare()`, and `lexicographical_compare_three_way()` into a separate test. [#5063](https://github.com/microsoft/STL/pull/5063) - Code cleanups: * Removed compiler bug workarounds. [#4939](https://github.com/microsoft/STL/pull/4939) [#4944](https://github.com/microsoft/STL/pull/4944) [#4947](https://github.com/microsoft/STL/pull/4947) [#5017](https://github.com/microsoft/STL/pull/5017) [#5103](https://github.com/microsoft/STL/pull/5103) * Explicitly marked `packaged_task`'s defaulted move constructor and move assignment operator as `noexcept`. [#4940](https://github.com/microsoft/STL/pull/4940) * Various cleanups (described in detail in the PRs, not repeated here). [#4945](https://github.com/microsoft/STL/pull/4945) [#5014](https://github.com/microsoft/STL/pull/5014) [#5058](https://github.com/microsoft/STL/pull/5058) * Refactored internal usage of the *`tuple-like`* and *`pair-like`* concepts. [#4983](https://github.com/microsoft/STL/pull/4983) * Used `if constexpr` to simplify ~~eldritch horrors from beyond spacetime~~ locale facets. [#5001](https://github.com/microsoft/STL/pull/5001) * Simplified control flow in `basic_string::find_first_not_of()`/`find_last_not_of()`. [#5006](https://github.com/microsoft/STL/pull/5006) * Refactored the vectorized implementation of `bitset::to_string()`. [#5013](https://github.com/microsoft/STL/pull/5013) * Replaced SFINAE with concepts in C++20-and-later code. [#5044](https://github.com/microsoft/STL/pull/5044) - Improved documentation: * Removed an inaccurate comment in `list`'s move assignment operator. [#5024](https://github.com/microsoft/STL/pull/5024) - Infrastructure improvements: * Updated dependencies. [#4947](https://github.com/microsoft/STL/pull/4947) [#5017](https://github.com/microsoft/STL/pull/5017) [#5082](https://github.com/microsoft/STL/pull/5082) + Updated build compiler to VS 2022 17.13 Preview 1 (and 17.12 is now required). + Updated Clang to 18.1.8 (now required). + Updated CMake to 3.30 (now required). + Updated Python to 3.13.0 (now required). + Updated the PR/CI system to Windows Server 2025. - Build system improvements: * Removed a workaround in the benchmark build. [#4928](https://github.com/microsoft/STL/pull/4928) - Updated `_MSVC_STL_UPDATE`. [#4926](https://github.com/microsoft/STL/pull/4926) [#4994](https://github.com/microsoft/STL/pull/4994) [#5064](https://github.com/microsoft/STL/pull/5064)

vs-2022-17.12

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

vs-2022-17.11

VS 2022 17.11 - Merged C++26 features: * [P2875R4](https://wg21.link/P2875R4) [#4532](https://github.com/microsoft/STL/pull/4532) Undeprecate `polymorphic_allocator::destroy` * [P3142R0](https://wg21.link/P3142R0) [#4611](https://github.com/microsoft/STL/pull/4611) Printing Blank Lines With `println()` - Merged *partial* C++23 features: * [P2286R8](https://wg21.link/P2286R8) Formatting Ranges: + Implemented `formatter` for `pair` and `tuple`. [#4438](https://github.com/microsoft/STL/pull/4438) [#4631](https://github.com/microsoft/STL/pull/4631) [#4681](https://github.com/microsoft/STL/pull/4681) + Implemented `range_formatter`. [#4642](https://github.com/microsoft/STL/pull/4642) - Merged LWG issue resolutions: * [LWG-3767](https://cplusplus.github.io/LWG/issue3767) [#4542](https://github.com/microsoft/STL/pull/4542) `codecvt<charN_t, char8_t, mbstate_t>` incorrectly added to locale * [LWG-3919](https://cplusplus.github.io/LWG/issue3919) [#4526](https://github.com/microsoft/STL/pull/4526) `enumerate_view` may invoke UB for sized common non-forward underlying ranges * [LWG-3950](https://cplusplus.github.io/LWG/issue3950) [#4510](https://github.com/microsoft/STL/pull/4510) `std::basic_string_view` comparison operators are overspecified * [LWG-3984](https://cplusplus.github.io/LWG/issue3984) [#4543](https://github.com/microsoft/STL/pull/4543) `ranges::to`'s recursion branch may be ill-formed * [LWG-4012](https://cplusplus.github.io/LWG/issue4012) [#4529](https://github.com/microsoft/STL/pull/4529) `common_view::begin`/`end` are missing the *`simple-view`* check * [LWG-4013](https://cplusplus.github.io/LWG/issue4013) [#4530](https://github.com/microsoft/STL/pull/4530) `lazy_split_view::`*`outer-iterator`*`::value_type` should not provide default constructor * [LWG-4016](https://cplusplus.github.io/LWG/issue4016) [#4539](https://github.com/microsoft/STL/pull/4539) *`container-insertable`* checks do not match what *`container-inserter`* does * [LWG-4035](https://cplusplus.github.io/LWG/issue4035) [#4525](https://github.com/microsoft/STL/pull/4525) `single_view` should provide `empty` * [LWG-4053](https://cplusplus.github.io/LWG/issue4053) [#4685](https://github.com/microsoft/STL/pull/4685) Unary call to `std::views::repeat` does not decay the argument * [LWG-4054](https://cplusplus.github.io/LWG/issue4054) [#4540](https://github.com/microsoft/STL/pull/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`. [#4457](https://github.com/microsoft/STL/pull/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. [#4459](https://github.com/microsoft/STL/pull/4459) * Fixed compiler errors when `constexpr basic_string` interacted with the undocumented compiler option `/d1initall`. [#4474](https://github.com/microsoft/STL/pull/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). [#4478](https://github.com/microsoft/STL/pull/4478) * Removed the vectorized implementation of `ranges::find` with `unreachable_sentinel` as it was fundamentally incompatible with ASan (Address Sanitizer). [#4486](https://github.com/microsoft/STL/pull/4486) + This was introduced by [#2434](https://github.com/microsoft/STL/pull/2434) in VS 2022 17.3. * Fixed incorrect results from the vectorized implementation of `ranges::find_last` for certain combinations of value and element types. [#4561](https://github.com/microsoft/STL/pull/4561) + This fixed a regression that was introduced by [#3925](https://github.com/microsoft/STL/pull/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. [#4487](https://github.com/microsoft/STL/pull/4487) + These warnings were most noticeable when building the Standard Library Modules, but they were also emitted by classic includes. * Fixed the STL to avoid emitting the off-by-default warning C5246 (brace elision). [#4527](https://github.com/microsoft/STL/pull/4527) * Fixed compiler errors involving incomplete types in: + `pair` and `tuple` machinery. [#4488](https://github.com/microsoft/STL/pull/4488) * Fixed `make_from_tuple()` to properly implement [LWG-3528](https://wg21.link/lwg3528) with a constraint instead of a `static_assert`. [#4528](https://github.com/microsoft/STL/pull/4528) * Added integral overloads for `<cmath>`'s classification functions `fpclassify()`, `isfinite()`, `isinf()`, `isnan()`, `isnormal()`, and `signbit()`. [#4537](https://github.com/microsoft/STL/pull/4537) * Fixed `is_trivial` to correctly handle unusual types. [#4576](https://github.com/microsoft/STL/pull/4576) * Avoided mentioning `__vectorcall` for ARM64EC, where it is not yet supported. [#4600](https://github.com/microsoft/STL/pull/4600) * Fixed `std.ixx` to include `<intrin.h>` in the Global Module Fragment, fixing compiler errors with `import std;` in certain scenarios. [#4626](https://github.com/microsoft/STL/pull/4626) * Fixed compiler errors when a user-defined `formatter` calls `basic_format_parse_context::next_arg_id()` with an empty format-spec. [#4640](https://github.com/microsoft/STL/pull/4640) * Fixed compiler errors when using `<expected>` in `/permissive` mode. [#4658](https://github.com/microsoft/STL/pull/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. [#4664](https://github.com/microsoft/STL/pull/4664) * Fixed `pair`'s self-`swap()` behavior to follow the Standard by self-swapping its elements. [#4674](https://github.com/microsoft/STL/pull/4674) * Fixed `atomic<void*>` and `atomic_ref<void*>` to provide `difference_type`. [#4689](https://github.com/microsoft/STL/pull/4689) - Improved performance: * Helped the compiler auto-vectorize: + `replace_copy()`, `replace_copy_if()`, `ranges::replace_copy`, and `ranges::replace_copy_if`. [#4431](https://github.com/microsoft/STL/pull/4431) + `iota()`. [#4627](https://github.com/microsoft/STL/pull/4627) + `ranges::iota`. [#4647](https://github.com/microsoft/STL/pull/4647) * Added vectorized implementations of: + `find_first_of()` and `ranges::find_first_of`. [#4466](https://github.com/microsoft/STL/pull/4466) [#4557](https://github.com/microsoft/STL/pull/4557) [#4563](https://github.com/microsoft/STL/pull/4563) [#4587](https://github.com/microsoft/STL/pull/4587) [#4623](https://github.com/microsoft/STL/pull/4623) + `mismatch()` and `ranges::mismatch`. [#4495](https://github.com/microsoft/STL/pull/4495) [#4538](https://github.com/microsoft/STL/pull/4538) [#4584](https://github.com/microsoft/STL/pull/4584) + `replace()` and `ranges::replace` for 32-bit and 64-bit elements. [#4554](https://github.com/microsoft/STL/pull/4554) [#4584](https://github.com/microsoft/STL/pull/4584) + `lexicographical_compare()`, `ranges::lexicographical_compare`, and `lexicographical_compare_three_way()`. [#4552](https://github.com/microsoft/STL/pull/4552) * Further improved the vectorized implementations of: + `count()`, `find()`, `ranges::count`, `ranges::find`, and `ranges::find_last`. [#4570](https://github.com/microsoft/STL/pull/4570) [#4614](https://github.com/microsoft/STL/pull/4614) * Used Clang builtins to improve the performance of `<cmath>`'s floating-point classification and comparison functions: [#4612](https://github.com/microsoft/STL/pull/4612) + Classification: `isfinite()`, `isinf()`, `isnan()`, `isnormal()` + Comparison: `isgreater()`, `isgreaterequal()`, `isless()`, `islessequal()`, `islessgreater()`, `isunordered()` * Improved `normal_distribution::operator()(engine, param)` by avoiding unnecessarily recomputing coefficients. [#4618](https://github.com/microsoft/STL/pull/4618) - Improved throughput: * Slightly improved `<mdspan>` throughput by using short-circuiting `conjunction_v` instead of fold expressions. [#4559](https://github.com/microsoft/STL/pull/4559) * Refactored floating-point machinery, improving throughput by reducing inclusion of various headers. [#4615](https://github.com/microsoft/STL/pull/4615) * Improved `<string_view>` throughput by no longer dragging in most of `<string>`'s contents. [#4633](https://github.com/microsoft/STL/pull/4633) - Improved diagnostics: * Improved compiler error messages when `formatter<UDT>::format()` isn't `const`. [#4461](https://github.com/microsoft/STL/pull/4461) * Massively improved the compiler error messages for `get<T>(tuple<Types...>)` when `T` doesn't occur exactly once in `Types`. [#4578](https://github.com/microsoft/STL/pull/4578) * Significantly improved compiler error messages when `ranges::to` is unable to construct the requested result. [#4608](https://github.com/microsoft/STL/pull/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. [#4550](https://github.com/microsoft/STL/pull/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`. [#4551](https://github.com/microsoft/STL/pull/4551) + The `iota_view(first, last)` constructor. [#4616](https://github.com/microsoft/STL/pull/4616) * Improved the wording of `[[nodiscard("reason")]]` messages for `empty()`. [#4572](https://github.com/microsoft/STL/pull/4572) * Extended C++20's `static_assert(is_clock_v<Clock>)` enforcement for various codepaths to C++14/17 (with internal machinery; `is_clock_v` itself remains guarded by C++20 mode). [#4585](https://github.com/microsoft/STL/pull/4585) * Changed the internal constructors of `basic_format_arg::handle` and `basic_format_context` to be `private`. [#4489](https://github.com/microsoft/STL/pull/4489) * Deprecation warnings for several non-Standard extensions are now emitted in all Standard modes, not just C++17 and later. These extensions will be removed in the future; you have been warned: [#4605](https://github.com/microsoft/STL/pull/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. [#4458](https://github.com/microsoft/STL/pull/4458) * Deleted the `<experimental/meow>` headers that provided `std::experimental::erase()/erase_if()`. [#4470](https://github.com/microsoft/STL/pull/4470) * Removed the non-Standard `_FPOSOFF` macro and the non-Standard `std::fpos::seekpos()` member function. [#4606](https://github.com/microsoft/STL/pull/4606) * Removed the non-Standard `lower_bound()`/`upper_bound()` member functions from the unordered associative containers. [#4607](https://github.com/microsoft/STL/pull/4607) - Improved test coverage: * Added benchmarks for vectorized `swap_ranges()`. [#4589](https://github.com/microsoft/STL/pull/4589) * Added a workaround for an ASan failure in an ancient STL test. [#4652](https://github.com/microsoft/STL/pull/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()`. [#4656](https://github.com/microsoft/STL/pull/4656) * Improved the `<filesystem>` test, including its coverage of `rename()` and how it generates names for temporary files and directories. [#4665](https://github.com/microsoft/STL/pull/4665) * Re-enabled tests that were previously skipped in the `libcxx` test suite. [#4698](https://github.com/microsoft/STL/pull/4698) * Updated our LLVM submodule, including new tests. [#4702](https://github.com/microsoft/STL/pull/4702) - Code cleanups: * Removed compiler bug workarounds. [#4475](https://github.com/microsoft/STL/pull/4475) [#4576](https://github.com/microsoft/STL/pull/4576) * Various cleanups (described in detail in the PRs, not repeated here). [#4465](https://github.com/microsoft/STL/pull/4465) [#4490](https://github.com/microsoft/STL/pull/4490) [#4493](https://github.com/microsoft/STL/pull/4493) * Improved the script for downloading Unicode data files when updating `<format>`. [#4469](https://github.com/microsoft/STL/pull/4469) * Consistently centralized how algorithms invoke their vectorized implementations. [#4544](https://github.com/microsoft/STL/pull/4544) * Simplified how `condition_variable` is implemented as a wrapper around the Windows API `CONDITION_VARIABLE`. [#4545](https://github.com/microsoft/STL/pull/4545) * Removed `inline` from `constexpr` variable templates. [#4546](https://github.com/microsoft/STL/pull/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. [#4577](https://github.com/microsoft/STL/pull/4577) * Updated tests to use C++17 terse `static_assert`. [#4588](https://github.com/microsoft/STL/pull/4588) * Simplified function templates to use `static_assert(false)` as permitted by [CWG-2518](https://wg21.link/cwg2518). [#4591](https://github.com/microsoft/STL/pull/4591) * Simplified debug checks for comparison function objects by using `if constexpr`. [#4610](https://github.com/microsoft/STL/pull/4610) * Simplified `char_traits::assign()` by removing unnecessary codepaths for constant evaluation. [#4613](https://github.com/microsoft/STL/pull/4613) * Changed checks for damaged logic in the STL itself to use internal `static_assert` macros, which expand to nothing outside of the STL's test suites. [#4624](https://github.com/microsoft/STL/pull/4624) * Simplified `ranges::stable_sort` to use `iter_value_t` instead of an internal helper. [#4628](https://github.com/microsoft/STL/pull/4628) * Changed the STL to use `in_range<T>()` more and `numeric_limits<T>::min()`/`max()` less. [#4634](https://github.com/microsoft/STL/pull/4634) * Replaced SFINAE with concepts in C++20-and-later code. [#4637](https://github.com/microsoft/STL/pull/4637) * Simplified the vectorized implementation of the `minmax()` family for 64-bit elements. [#4661](https://github.com/microsoft/STL/pull/4661) * Modernized our usage of Google Benchmark. [#4662](https://github.com/microsoft/STL/pull/4662) - Infrastructure improvements: * Overhauled our Azure Pipelines machinery: [#4594](https://github.com/microsoft/STL/pull/4594) [#4687](https://github.com/microsoft/STL/pull/4687) + Introduced "Early Build" stages to quickly find compiler errors when building the STL. + Improved the reliability of the submodule checkout task. + Improved how clang-format diffs are uploaded and logged. * Updated dependencies. [#4475](https://github.com/microsoft/STL/pull/4475) [#4492](https://github.com/microsoft/STL/pull/4492) [#4576](https://github.com/microsoft/STL/pull/4576) [#4568](https://github.com/microsoft/STL/pull/4568) [#4594](https://github.com/microsoft/STL/pull/4594) [#4687](https://github.com/microsoft/STL/pull/4687) + Updated build compiler to VS 2022 17.11 Preview 1. + Updated to Windows 11 SDK 22621. This is now required for building and testing the STL, but not for using it. + Updated CUDA to 12.4.0 (now required). + Updated Python to 3.12.3. + Updated Boost.Math to 1.85.0. [#4599](https://github.com/microsoft/STL/pull/4599) + Updated Google Benchmark to 1.8.4. [#4694](https://github.com/microsoft/STL/pull/4694) - Updated `_MSVC_STL_UPDATE`. [#4467](https://github.com/microsoft/STL/pull/4467) [#4556](https://github.com/microsoft/STL/pull/4556) [#4655](https://github.com/microsoft/STL/pull/4655)

vs-2022-17.10

VS 2022 17.10 - Merged C++26 features: * [P2510R3](https://wg21.link/P2510R3) [#4198](https://github.com/microsoft/STL/pull/4198) Formatting Pointers * [P2937R0](https://wg21.link/P2937R0) [#4203](https://github.com/microsoft/STL/pull/4203) Freestanding Library: Remove `strtok` - Merged C++23 features: * [P2836R1](https://wg21.link/P2836R1) [#4188](https://github.com/microsoft/STL/pull/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>`. [#4133](https://github.com/microsoft/STL/pull/4133) - Merged C++20 Defect Reports: * [P2905R2](https://wg21.link/P2905R2) [#4196](https://github.com/microsoft/STL/pull/4196) Runtime Format Strings * [P2909R4](https://wg21.link/P2909R4) [#4189](https://github.com/microsoft/STL/pull/4189) Fix Formatting Of Code Units As Integers - Merged LWG issue resolutions: * [LWG-3749](https://wg21.link/lwg3749) [#4190](https://github.com/microsoft/STL/pull/4190) `common_iterator` should handle integer-class difference types * [LWG-3809](https://wg21.link/lwg3809) [#4194](https://github.com/microsoft/STL/pull/4194) Is `subtract_with_carry_engine<uint16_t>` supposed to work? * [LWG-3897](https://wg21.link/lwg3897) [#4186](https://github.com/microsoft/STL/pull/4186) `inout_ptr` will not update raw pointer to null * [LWG-3946](https://wg21.link/lwg3946) [#4187](https://github.com/microsoft/STL/pull/4187) The definition of `const_iterator_t` should be reworked * [LWG-3947](https://wg21.link/lwg3947) [#4195](https://github.com/microsoft/STL/pull/4195) Unexpected constraints on `adjacent_transform_view::base()` * [LWG-3949](https://wg21.link/lwg3949) [#4204](https://github.com/microsoft/STL/pull/4204) `atomic<bool>`'s trivial destructor dropped in C++17 spec wording * [LWG-3953](https://wg21.link/lwg3953) [#4167](https://github.com/microsoft/STL/pull/4167) `iter_move` for `common_iterator` and `counted_iterator` should return `decltype(auto)` * [LWG-3974](https://wg21.link/lwg3974) [#4214](https://github.com/microsoft/STL/pull/4214) `mdspan::operator[]` should not copy `OtherIndexTypes` * [LWG-4001](https://wg21.link/lwg4001) [#4193](https://github.com/microsoft/STL/pull/4193) `iota_view` should provide `empty` - Fixed bugs: * Fixed `mutex`'s constructor to be `constexpr`. [#3824](https://github.com/microsoft/STL/pull/3824) [#4000](https://github.com/microsoft/STL/pull/4000) [#4339](https://github.com/microsoft/STL/pull/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 `"{}"`. [#4078](https://github.com/microsoft/STL/pull/4078) + To require that dynamic width and precision arguments have integral types. [#4155](https://github.com/microsoft/STL/pull/4155) * Fixed how `format()` handles empty strings like `format("{:a<10}", "")`. [#4243](https://github.com/microsoft/STL/pull/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`. [#4327](https://github.com/microsoft/STL/pull/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. [#4421](https://github.com/microsoft/STL/pull/4421) * Fixed `format()` to accept `%X` and `%EX` for `chrono::duration` and `chrono::hh_mm_ss`. [#4250](https://github.com/microsoft/STL/pull/4250) * Fixed `chrono::duration` formatting to respect dynamically provided widths. [#4283](https://github.com/microsoft/STL/pull/4283) * Fixed crashes and incorrect results in the vectorized implementation of `ranges::find` with `unreachable_sentinel`. [#4450](https://github.com/microsoft/STL/pull/4450) + This fixed regressions that were introduced by [#2434](https://github.com/microsoft/STL/pull/2434) in VS 2022 17.3. * Fixed `ranges::to` to properly reject certain invalid uses with compiler errors, instead of trapping compilers in infinite loops of doom. [#4142](https://github.com/microsoft/STL/pull/4142) * Fixed `ranges::to` to accept certain container constructors taking a range followed by more than one argument. [#4218](https://github.com/microsoft/STL/pull/4218) * Fixed compiler errors involving range adaptor closure objects in unusual scenarios. [#4211](https://github.com/microsoft/STL/pull/4211) * Fixed `ranges::ssize` to be conditionally `noexcept` as required by the Standard. [#4231](https://github.com/microsoft/STL/pull/4231) * Fixed `join_view` and `join_with_view`'s iterators to be default constructible. [#4264](https://github.com/microsoft/STL/pull/4264) * Fixed truncation warnings when using `views::repeat`. [#4255](https://github.com/microsoft/STL/pull/4255) * Fixed compiler errors when using `views::zip_transform` with ranges that must be non-`const` to be iterated through, such as `views::filter`. [#4416](https://github.com/microsoft/STL/pull/4416) * Fixed compiler errors when using `views::pairwise_transform` and `views::adjacent_transform` via Standard Library Modules. [#4420](https://github.com/microsoft/STL/pull/4420) * Fixed incorrect output from iostreams (like `"i.nf"`) when printing infinity and NaN values with `setprecision(0) << showpoint << fixed`. [#4212](https://github.com/microsoft/STL/pull/4212) * Fixed problems involving unusual allocators with size types other than `size_t`: + Compiler errors in `basic_stringbuf::overflow()`. [#4219](https://github.com/microsoft/STL/pull/4219) + Truncation warnings in `basic_stringbuf`'s constructor, `string`/`vector` iterator subtraction, `ranges::is_permutation`, and `allocate_shared()`. [#4228](https://github.com/microsoft/STL/pull/4228) [#4237](https://github.com/microsoft/STL/pull/4237) [#4252](https://github.com/microsoft/STL/pull/4252) * Fixed `<atomic>` correctness issues for ARM64 CHPE (`_M_HYBRID_X86_ARM64`). [#4222](https://github.com/microsoft/STL/pull/4222) * Fixed `atomic` by adding `atomic& operator=(const atomic&) volatile = delete;` as required by the Standard. [#4287](https://github.com/microsoft/STL/pull/4287) * Fixed `atomic<shared_ptr>::wait()` and `atomic<weak_ptr>::wait()` to properly detect equivalent smart pointers. [#3655](https://github.com/microsoft/STL/pull/3655) * Fixed sign-compare warnings in `<mdspan>` when using `extents` with different index types. [#4227](https://github.com/microsoft/STL/pull/4227) * Fixed compiler errors in `<mdspan>` when constructing unusual mappings. [#4236](https://github.com/microsoft/STL/pull/4236) * Fixed bugs specific to extremely unusual fancy pointers: + Fixed how such `vector`s interact with ranges algorithms. [#4244](https://github.com/microsoft/STL/pull/4244) + Fixed how such `vector`s and `basic_string`s interact with classic algorithms and iterator spaceship comparisons. [#4275](https://github.com/microsoft/STL/pull/4275) * Fixed compiler errors when constructing `locale{nullptr}`. [#4245](https://github.com/microsoft/STL/pull/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. [#4249](https://github.com/microsoft/STL/pull/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. [#4253](https://github.com/microsoft/STL/pull/4253) * Fixed sequence container constructors to avoid interfering with CTAD (class template argument deduction) for `(Iter, Iter, BadAlloc)`; now this will SFINAE away instead of emitting a hard compiler error. [#4254](https://github.com/microsoft/STL/pull/4254) * Fixed compiler errors in parallel `transform_reduce()` when performing narrowing conversions. [#4260](https://github.com/microsoft/STL/pull/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. [#4276](https://github.com/microsoft/STL/pull/4276) * Fixed compiler errors (by adding a compiler bug workaround) when using `constexpr` `invoke()` to call pointers to data members with `reference_wrapper` arguments. [#4277](https://github.com/microsoft/STL/pull/4277) * Added macroization defenses for the STL's non-Standard extensions (e.g. `type_info`'s `raw_name` member function). [#4285](https://github.com/microsoft/STL/pull/4285) * Fixed floating-point `to_chars()` on ARM64 to return correct results. [#4304](https://github.com/microsoft/STL/pull/4304) * Fixed compiler errors when defining variadic alias templates for `is_nothrow_convertible`. [#4318](https://github.com/microsoft/STL/pull/4318) * Fixed `filesystem::is_empty()` and `filesystem::directory_iterator` to handle empty volumes (before they've been assigned a drive letter). [#4311](https://github.com/microsoft/STL/pull/4311) * Fixed compiler errors in algorithms involving highly unusual types. [#4233](https://github.com/microsoft/STL/pull/4233) [#4419](https://github.com/microsoft/STL/pull/4419) * Fixed `basic_stringbuf` to avoid implementing moving with swapping, which is a correctness issue for unusual custom allocators. [#4239](https://github.com/microsoft/STL/pull/4239) * Fixed `deque::shrink_to_fit()` to follow the Standard instead of unconditionally moving elements. [#4091](https://github.com/microsoft/STL/pull/4091) * Fixed `allocate_shared_for_overwrite()` to directly destroy objects, instead of using `Alloc::destroy()`. [#4274](https://github.com/microsoft/STL/pull/4274) * Removed `ios_base::hexfloat`, a non-Standard bitmask element. [#4345](https://github.com/microsoft/STL/pull/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. [#4375](https://github.com/microsoft/STL/pull/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()`. [#4372](https://github.com/microsoft/STL/pull/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). [#4406](https://github.com/microsoft/STL/pull/4406) + `unordered_multimap` and `unordered_multiset` already behaved correctly. * Silenced "warning C4324: structure was padded due to alignment specifier" in all STL headers. [#4426](https://github.com/microsoft/STL/pull/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. [#4437](https://github.com/microsoft/STL/pull/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. [#4447](https://github.com/microsoft/STL/pull/4447) * Fixed compiler errors involving incomplete types in: + Non-modifying algorithms. [#4138](https://github.com/microsoft/STL/pull/4138) + `erase()`, `erase_if()`, `remove()`, `remove_if()`. [#4217](https://github.com/microsoft/STL/pull/4217) + \[alg.min.max\], \[alg.clamp\], \[alg.lex.comparison\], \[alg.three.way\] algorithms. [#4216](https://github.com/microsoft/STL/pull/4216) + `atomic` and `atomic_ref`. [#4221](https://github.com/microsoft/STL/pull/4221) + Modifying algorithms. [#4256](https://github.com/microsoft/STL/pull/4256) + Container operations taking iterator pairs. [#4258](https://github.com/microsoft/STL/pull/4258) + `is_nothrow_convertible`. [#4318](https://github.com/microsoft/STL/pull/4318) + Comparison operators. [#4334](https://github.com/microsoft/STL/pull/4334) + Merge algorithms, set operations, heap operations, and permutation generators. [#4347](https://github.com/microsoft/STL/pull/4347) + Sorting and related algorithms. [#4367](https://github.com/microsoft/STL/pull/4367) + `vector`'s destructor and other member functions. [#4373](https://github.com/microsoft/STL/pull/4373) + Uninitialized memory algorithms. [#4374](https://github.com/microsoft/STL/pull/4374) + `default_searcher`. [#4379](https://github.com/microsoft/STL/pull/4379) + `<ranges>` views. [#4389](https://github.com/microsoft/STL/pull/4389) + Numeric algorithms. [#4391](https://github.com/microsoft/STL/pull/4391) + `ranges::advance`, `ranges::distance`, `span` constructors, and `condition_variable::wait_for`. [#4402](https://github.com/microsoft/STL/pull/4402) + `shared_ptr` creation functions and `atomic` smart pointers. [#4403](https://github.com/microsoft/STL/pull/4403) + `function`, `move_only_function`, `packaged_task`, `promise`, and `optional`. [#4430](https://github.com/microsoft/STL/pull/4430) - Improved performance: * Improved `<atomic>` performance: [#4222](https://github.com/microsoft/STL/pull/4222) + For ARM64, significantly improved the performance of `atomic<T>::load()` (taking no arguments, requesting sequential consistency), matching how [#3399](https://github.com/microsoft/STL/pull/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 [#3399](https://github.com/microsoft/STL/pull/3399)'s 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. [#4288](https://github.com/microsoft/STL/pull/4288) * Slightly improved the codegen for `uniform_int_distribution`. [#4234](https://github.com/microsoft/STL/pull/4234) * Optimized `filesystem::path`'s `operator/` to perform a single memory allocation for common cases. [#4136](https://github.com/microsoft/STL/pull/4136) * Slightly improved performance by taking advantage of [P1169R4](https://wg21.link/P1169R4) `static operator()` in the STL's stateless function objects and lambdas. [#4358](https://github.com/microsoft/STL/pull/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()`. [#3960](https://github.com/microsoft/STL/pull/3960) [#4382](https://github.com/microsoft/STL/pull/4382) [#4422](https://github.com/microsoft/STL/pull/4422) * Improved the vectorized implementations of `min_element()`, `max_element()`, `minmax_element()`, and related algorithms: + Extended them to handle floating-point types. [#3928](https://github.com/microsoft/STL/pull/3928) + Further improved performance by restructuring control flow. [#4401](https://github.com/microsoft/STL/pull/4401) * Improved the vectorized implementations of `ranges::min`, `ranges::max`, `ranges::minmax`, and the `min()`, `max()`, and `minmax()` overloads for `initializer_list`. [#4384](https://github.com/microsoft/STL/pull/4384) + These algorithms only need to track values, not locations. * Changed the destructors of `mutex` and `recursive_mutex` to be trivial. [#4390](https://github.com/microsoft/STL/pull/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()`. [#4407](https://github.com/microsoft/STL/pull/4407) + At-thread-exit machinery. [#4408](https://github.com/microsoft/STL/pull/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*. [#4154](https://github.com/microsoft/STL/pull/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. [#4080](https://github.com/microsoft/STL/issues/4080) * Improved `shared_ptr` constructor constraints to avoid forming invalid types. [#4290](https://github.com/microsoft/STL/pull/4290) * Updated `<charconv>` to use the `__umulh` intrinsic for ARM64 CHPE (`_M_HYBRID_X86_ARM64`). [#4330](https://github.com/microsoft/STL/pull/4330) * Improved `expected`'s copy/move assignment operators to be trivial when possible, like how `optional` and `variant` already behave. [#4271](https://github.com/microsoft/STL/pull/4271) * Improved `<random>`'s TR1 legacy code: [#4284](https://github.com/microsoft/STL/pull/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. [#4451](https://github.com/microsoft/STL/pull/4451) + Currently, this arbitrarily limits the number of capture groups to 1000. - Improved test coverage: * Updated the STL-ASan-CI pipeline. [#4240](https://github.com/microsoft/STL/pull/4240) [#4295](https://github.com/microsoft/STL/pull/4295) * Added support for building the STL's separately compiled code with ASan instrumentation and enabled this in the STL-ASan-CI pipeline. [#4313](https://github.com/microsoft/STL/pull/4313) * Updated our LLVM submodule, including new tests. [#4263](https://github.com/microsoft/STL/pull/4263) [#4267](https://github.com/microsoft/STL/pull/4267) [#4270](https://github.com/microsoft/STL/pull/4270) [#4272](https://github.com/microsoft/STL/pull/4272) [#4328](https://github.com/microsoft/STL/pull/4328) [#4336](https://github.com/microsoft/STL/pull/4336) [#4348](https://github.com/microsoft/STL/pull/4348) [#4355](https://github.com/microsoft/STL/pull/4355) * Minor test improvements, including printing exit codes in both decimal and hex. [#4309](https://github.com/microsoft/STL/pull/4309) * Improved output for "unresolved" test failures. [#4323](https://github.com/microsoft/STL/pull/4323) * Fixed sporadic "unresolved" test failures. [#4366](https://github.com/microsoft/STL/pull/4366) * Updated CTest to avoid running 2N tests in parallel, where N is the number of cores available. [#4335](https://github.com/microsoft/STL/pull/4335) * Enabled `__cpp_lib_concepts` for our command-line test coverage of the EDG compiler front-end. [#4296](https://github.com/microsoft/STL/pull/4296) [#4297](https://github.com/microsoft/STL/pull/4297) [#4440](https://github.com/microsoft/STL/pull/4440) + `__cpp_lib_concepts` was already enabled for EDG-powered IntelliSense in the VS IDE, so this change isn't directly observable by users, it'll just help the STL work better with IntelliSense in the future. * Enabled compiler warnings when building the STL's benchmarks. [#4356](https://github.com/microsoft/STL/pull/4356) * Added benchmarks for vectorized `ranges::find` and `ranges::count`. [#4387](https://github.com/microsoft/STL/pull/4387) + This also covers classic `find()` and `count()`, which share the same vectorized implementation. * Fixed the test harness to handle paths case-insensitively. [#4395](https://github.com/microsoft/STL/pull/4395) * Updated tests to work with Clang 18. [#4452](https://github.com/microsoft/STL/pull/4452) * Enabled more test coverage for the off-by-default warning C4668 "`'MEOW'` is not defined as a preprocessor macro, replacing with `'0'` for `'#if/#elif'`". [#4441](https://github.com/microsoft/STL/pull/4441) - Code cleanups: * Various cleanups (described in detail in the PRs, not repeated here). [#4143](https://github.com/microsoft/STL/pull/4143) [#4145](https://github.com/microsoft/STL/pull/4145) [#4146](https://github.com/microsoft/STL/pull/4146) [#4147](https://github.com/microsoft/STL/pull/4147) [#4149](https://github.com/microsoft/STL/pull/4149) [#4151](https://github.com/microsoft/STL/pull/4151) [#4192](https://github.com/microsoft/STL/pull/4192) [#4229](https://github.com/microsoft/STL/pull/4229) [#4230](https://github.com/microsoft/STL/pull/4230) [#4362](https://github.com/microsoft/STL/pull/4362) [#4439](https://github.com/microsoft/STL/pull/4439) [#4442](https://github.com/microsoft/STL/pull/4442) [#4443](https://github.com/microsoft/STL/pull/4443) [#4444](https://github.com/microsoft/STL/pull/4444) [#4445](https://github.com/microsoft/STL/pull/4445) * Removed unnecessary `typename` keywords in C++20 mode and later. [#4191](https://github.com/microsoft/STL/pull/4191) * Removed compiler bug workarounds. [#4197](https://github.com/microsoft/STL/pull/4197) [#4259](https://github.com/microsoft/STL/pull/4259) [#4340](https://github.com/microsoft/STL/pull/4340) [#4392](https://github.com/microsoft/STL/pull/4392) * Removed an enormous amount of code that was dealing with `__cpp_lib_concepts` missing in C++20 mode. [#4298](https://github.com/microsoft/STL/pull/4298) [#4364](https://github.com/microsoft/STL/pull/4364) + Now, the STL's product and test code assumes that concepts are always available in C++20 mode, with targeted workarounds for reported compiler bugs. * Unified our internal stringizing macros. [#4405](https://github.com/microsoft/STL/pull/4405) * Added top-level `const` to function parameters in the vectorized implementations of algorithms. [#4410](https://github.com/microsoft/STL/pull/4410) * Added a script to download Unicode data files when updating `<format>`. [#4435](https://github.com/microsoft/STL/pull/4435) * Simplified how we handle Unicode field widths when updating `<format>`. Now we use a single script to process all Unicode data files, emitting tables into a single generated header. [#4446](https://github.com/microsoft/STL/pull/4446) * Used `if constexpr` to simplify helper functions for allocating and deallocating memory. [#4432](https://github.com/microsoft/STL/pull/4432) - Infrastructure improvements: * Updated dependencies. [#4197](https://github.com/microsoft/STL/pull/4197) [#4206](https://github.com/microsoft/STL/pull/4206) [#4259](https://github.com/microsoft/STL/pull/4259) [#4303](https://github.com/microsoft/STL/pull/4303) [#4392](https://github.com/microsoft/STL/pull/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. [#4280](https://github.com/microsoft/STL/pull/4280) - Updated `_MSVC_STL_UPDATE`. [#4213](https://github.com/microsoft/STL/pull/4213) [#4226](https://github.com/microsoft/STL/pull/4226) [#4293](https://github.com/microsoft/STL/pull/4293) [#4361](https://github.com/microsoft/STL/pull/4361)

vs-2022-17.9

VS 2022 17.9 - Merged C++23 features: * [P0009R18](https://wg21.link/P0009R18) [#3972](https://github.com/microsoft/STL/pull/3972) [#4037](https://github.com/microsoft/STL/pull/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) [#4053](https://github.com/microsoft/STL/pull/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()`. [#3913](https://github.com/microsoft/STL/pull/3913) + Implemented `formattable`, `range_format`, and `format_kind`. [#4116](https://github.com/microsoft/STL/pull/4116) - Merged LWG issue resolutions: * [LWG-3561](https://wg21.link/lwg3561) [#4066](https://github.com/microsoft/STL/pull/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`). [#3982](https://github.com/microsoft/STL/pull/3982) + This fixed a regression that was introduced by [#3364](https://github.com/microsoft/STL/pull/3364) in VS 2022 17.7. + We backported this fix to VS 2022 17.8. * Fixed compiler errors when using `expected` together with `any`. [#4013](https://github.com/microsoft/STL/pull/4013) * Fixed incorrect behavior when self-move-assigning `any`, and fixed compiler errors in `any` involving incomplete types. [#3965](https://github.com/microsoft/STL/pull/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. [#4031](https://github.com/microsoft/STL/pull/4031) * Fixed `get()` and comparison operators to handle program-defined specializations of `array`. [#4041](https://github.com/microsoft/STL/pull/4041) * Fixed compiler errors in `to_array()` involving incomplete types. [#4042](https://github.com/microsoft/STL/pull/4042) * Fixed linker errors involving `stl_asan.lib` by disabling ASan annotations in the STL for unsupported platforms (e.g. ARM, ARM64, ARM64EC). [#4058](https://github.com/microsoft/STL/pull/4058) * Fixed `not_fn()` to return a perfect forwarding call wrapper in C++20 mode as required by [P0356R5](https://wg21.link/P0356R5). [#4057](https://github.com/microsoft/STL/pull/4057) * Fixed `deque` to preserve its internal invariants when taking advantage of allocators that provide `allocate_at_least()`. [#4017](https://github.com/microsoft/STL/pull/4017) * Fixed `deque` `emplace()` and `insert()` to not require elements to be swappable; this change also improved performance. [#4022](https://github.com/microsoft/STL/pull/4022) * Fixed `deque` to handle highly unusual fancy pointers. [#4049](https://github.com/microsoft/STL/pull/4049) * Fixed `deque::shrink_to_fit()` to avoid requiring the allocator to be default constructible. [#4071](https://github.com/microsoft/STL/pull/4071) * Fixed `allocate_shared()` for unbounded arrays to handle fancy pointers. [#4074](https://github.com/microsoft/STL/pull/4074) * Fixed the implementation of [P0408R7](https://wg21.link/P0408R7) Efficient Access To `basic_stringbuf`'s Buffer to properly destroy fancy pointers. [#4047](https://github.com/microsoft/STL/pull/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`. [#3914](https://github.com/microsoft/STL/pull/3914) * Fixed minor conformance issues in `<random>`: [#4120](https://github.com/microsoft/STL/pull/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. [#3353](https://github.com/microsoft/STL/pull/3353) [#4045](https://github.com/microsoft/STL/pull/4045) * Optimized `priority_queue::push_range()` for small ranges. [#4025](https://github.com/microsoft/STL/pull/4025) * Improved debug codegen for `deque` by using unchecked iterators internally. [#4071](https://github.com/microsoft/STL/pull/4071) * Optimized `basic_string`'s range constructors to use `memmove()` for contiguous ranges when possible. [#4073](https://github.com/microsoft/STL/pull/4073) * Added a vectorized implementation of `ranges::find_last`. [#3925](https://github.com/microsoft/STL/pull/3925) - Enhanced behavior: * Added debug checks to `<valarray>` binary operations, verifying that the operands have the same size. [#3911](https://github.com/microsoft/STL/pull/3911) * Deprecated `basic_istream`'s `ipfx()`/`isfx()` and `basic_ostream`'s `opfx()`/`osfx()` member functions as they're non-Standard extensions. [#4006](https://github.com/microsoft/STL/pull/4006) * Added compiler bug workarounds for the upcoming Clang 17 release. [#4014](https://github.com/microsoft/STL/pull/4014) * Improved the STL's error messages so that error logs will record specific `static_assert`s like "error STL1000: Unexpected compiler version, expected Clang 16.0.0 or newer." instead of just "Error in C++ Standard Library usage." [#4020](https://github.com/microsoft/STL/pull/4020) * Silenced `/Wall` warnings: + When building the Standard Library Modules. [#4026](https://github.com/microsoft/STL/pull/4026) + Warning C4868 "compiler may not enforce left-to-right evaluation order in braced initializer list" throughout the STL. [#4067](https://github.com/microsoft/STL/pull/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. [#4032](https://github.com/microsoft/STL/pull/4032) + *Note:* 80-bit `long double` remains unsupported by MSVC. * Improved `source_location::function_name()`: [#4055](https://github.com/microsoft/STL/pull/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. [#4098](https://github.com/microsoft/STL/pull/4098) + For example, this allows code like `views::transform(ranges::distance)` to compile. * Marked internal `extern "C"` functions as `noexcept`. [#4106](https://github.com/microsoft/STL/pull/4106) [#4150](https://github.com/microsoft/STL/pull/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. [#3987](https://github.com/microsoft/STL/pull/3987) [#3989](https://github.com/microsoft/STL/pull/3989) [#4029](https://github.com/microsoft/STL/pull/4029) [#4052](https://github.com/microsoft/STL/pull/4052) [#4068](https://github.com/microsoft/STL/pull/4068) [#4069](https://github.com/microsoft/STL/pull/4069) [#4075](https://github.com/microsoft/STL/pull/4075) * The test harness now cleans up emitted files as it runs. [#4086](https://github.com/microsoft/STL/pull/4086) * Simplified the feature-test macro test. [#4103](https://github.com/microsoft/STL/pull/4103) * Enabled test coverage for `basic_string`'s ASan annotations when exception handling interacts with the Small String Optimization. [#4118](https://github.com/microsoft/STL/pull/4118) - Code cleanups: * Removed unused code. [#3964](https://github.com/microsoft/STL/pull/3964) [#4005](https://github.com/microsoft/STL/pull/4005) * Removed compiler bug workarounds. [#4012](https://github.com/microsoft/STL/pull/4012) [#4028](https://github.com/microsoft/STL/pull/4028) [#4039](https://github.com/microsoft/STL/pull/4039) [#4083](https://github.com/microsoft/STL/pull/4083) * Various cleanups (described in detail in the PRs, not repeated here). [#3940](https://github.com/microsoft/STL/pull/3940) [#3973](https://github.com/microsoft/STL/pull/3973) [#3974](https://github.com/microsoft/STL/pull/3974) [#3984](https://github.com/microsoft/STL/pull/3984) [#4015](https://github.com/microsoft/STL/pull/4015) [#4016](https://github.com/microsoft/STL/pull/4016) [#4036](https://github.com/microsoft/STL/pull/4036) [#4087](https://github.com/microsoft/STL/pull/4087) [#4111](https://github.com/microsoft/STL/pull/4111) [#4113](https://github.com/microsoft/STL/pull/4113) [#4117](https://github.com/microsoft/STL/pull/4117) [#4119](https://github.com/microsoft/STL/pull/4119) [#4121](https://github.com/microsoft/STL/pull/4121) [#4122](https://github.com/microsoft/STL/pull/4122) [#4123](https://github.com/microsoft/STL/pull/4123) [#4124](https://github.com/microsoft/STL/pull/4124) [#4125](https://github.com/microsoft/STL/pull/4125) * Ported a `<format>` table generator script from C++ to Python. [#3994](https://github.com/microsoft/STL/pull/3994) * Improved how `<format>` uses the compiler macro `_MSVC_EXECUTION_CHARACTER_SET`. [#4076](https://github.com/microsoft/STL/pull/4076) - Improved documentation: * Improved the consistency of preprocessor comments. [#3950](https://github.com/microsoft/STL/pull/3950) - Infrastructure improvements: * Updated dependencies. [#4028](https://github.com/microsoft/STL/pull/4028) [#4039](https://github.com/microsoft/STL/pull/4039) [#4083](https://github.com/microsoft/STL/pull/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. [#4021](https://github.com/microsoft/STL/pull/4021) - Updated `_MSVC_STL_UPDATE`. [#4003](https://github.com/microsoft/STL/pull/4003) [#4062](https://github.com/microsoft/STL/pull/4062)

vs-2022-17.8

VS 2022 17.8 - Merged C++26 features: * [P2013R5](https://wg21.link/P2013R5) [#3837](https://github.com/microsoft/STL/pull/3837) Freestanding Language: Optional `::operator new` * [P2198R7](https://wg21.link/P2198R7) [#3837](https://github.com/microsoft/STL/pull/3837) Freestanding Feature-Test Macros And Implementation-Defined Extensions * [P2338R4](https://wg21.link/P2338R4) [#3837](https://github.com/microsoft/STL/pull/3837) Freestanding Library: Character Primitives And The C Library * [P2538R1](https://wg21.link/P2538R1) [#3822](https://github.com/microsoft/STL/pull/3822) ADL-Proof `projected` - Merged C++23 features: * [P2675R1](https://wg21.link/P2675R1) [#3903](https://github.com/microsoft/STL/pull/3903) Improving `std::format`'s Width Estimation * [P2693R1](https://wg21.link/P2693R1) [#3861](https://github.com/microsoft/STL/pull/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. [#3977](https://github.com/microsoft/STL/pull/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) [#3745](https://github.com/microsoft/STL/pull/3745) `basic_format_arg(T&&)` should use `remove_cvref_t<T>` throughout * [LWG-3843](https://wg21.link/lwg3843) [#3737](https://github.com/microsoft/STL/pull/3737) `std::expected<T, E>::value() &` assumes `E` is copy constructible * [LWG-3893](https://wg21.link/lwg3893) [#3782](https://github.com/microsoft/STL/pull/3782) [LWG-3661](https://wg21.link/lwg3661) broke `atomic<shared_ptr<T>> a; a = nullptr;` * [LWG-3904](https://wg21.link/lwg3904) [#3781](https://github.com/microsoft/STL/pull/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. [#3720](https://github.com/microsoft/STL/pull/3720) * Removed a non-Standard operator `basic_istream >> setfill(c)`. [#3725](https://github.com/microsoft/STL/pull/3725) * Fixed linker errors when linking x64 object files into ARM64EC programs. [#3732](https://github.com/microsoft/STL/pull/3732) + We backported this fix to VS 2022 17.6.6 and VS 2022 17.7. * Fixed the debug mode check in `cartesian_product_view::size()` to always accept empty views. [#3733](https://github.com/microsoft/STL/pull/3733) * Fixed `formatter<char, wchar_t>` to format the `char` as a character instead of an integer. [#3723](https://github.com/microsoft/STL/pull/3723) * The STL now avoids dragging in the non-reserved name `ISA_AVAILABILITY`. [#3721](https://github.com/microsoft/STL/pull/3721) * Fixed `chrono::hh_mm_ss` formatting to accept values of 24 hours or more. [#3727](https://github.com/microsoft/STL/pull/3727) * Changed the STL's usage of compiler-specific custom attributes to further defend against macros. [#3760](https://github.com/microsoft/STL/pull/3760) * Fixed `condition_variable_any::wait_until()` to handle `time_point`s with unsigned representations instead of waiting forever. [#3761](https://github.com/microsoft/STL/pull/3761) * Fixed `counting_semaphore` to add compile-time enforcement of the Standard's mandates. [#3747](https://github.com/microsoft/STL/pull/3747) * Fixed a bug, affecting UWP apps only, where locking a `mutex` could throw a bogus exception. [#3763](https://github.com/microsoft/STL/pull/3763) * Fixed the signatures of `char_traits` member functions to exactly match the Standard. [#3739](https://github.com/microsoft/STL/pull/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. [#3787](https://github.com/microsoft/STL/pull/3787) * Fixed incorrect output when `format()` is asked to format a floating-point value in the alternate form without a type specifier. [#3815](https://github.com/microsoft/STL/pull/3815) * Added a compiler bug workaround for MSVC modules, allowing `<format>` machinery to work with `/utf-8` via `import std;`. [#3816](https://github.com/microsoft/STL/pull/3816) * Fixed a subtle bug affecting `constexpr basic_string`'s copy assignment operator, where it wasn't starting element lifetimes for the unused capacity. [#3712](https://github.com/microsoft/STL/pull/3712) [#3819](https://github.com/microsoft/STL/pull/3819) * Fixed Clang compiler errors when calling `function::target<FunctionType>()` on `const function` objects. [#3844](https://github.com/microsoft/STL/pull/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. [#3863](https://github.com/microsoft/STL/pull/3863) * Improved function call operator overload resolution for the `bind()`, `bind_front()`, and `bind_back()` function objects. [#3775](https://github.com/microsoft/STL/pull/3775) * Fixed iostreams with imbued locales to print infinities and NaNs correctly. [#3868](https://github.com/microsoft/STL/pull/3868) [#3877](https://github.com/microsoft/STL/pull/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&)`. [#3869](https://github.com/microsoft/STL/pull/3869) [#3881](https://github.com/microsoft/STL/pull/3881) * Fixed `shared_ptr<void>` to not be constructible from `void*`. [#3873](https://github.com/microsoft/STL/pull/3873) * Fixed a complicated modules scenario by removing `#pragma once` from all STL headers. [#3895](https://github.com/microsoft/STL/pull/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. [#3916](https://github.com/microsoft/STL/pull/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. [#3862](https://github.com/microsoft/STL/pull/3862) * Fixed ASan annotations in `basic_string::replace()`. [#3884](https://github.com/microsoft/STL/pull/3884) * Fixed ASan annotations in `basic_string::assign()` and `basic_string::resize_and_overwrite()`. [#3956](https://github.com/microsoft/STL/pull/3956) - Improved performance: * Changed some helper member functions to be `static`, slightly improving debug codegen. [#3755](https://github.com/microsoft/STL/pull/3755) * `mutex` and `condition_variable` now avoid virtual function calls within their implementations. [#3770](https://github.com/microsoft/STL/pull/3770) * Optimized `steady_clock::now()` when `QueryPerformanceFrequency()` is exactly 24 MHz, which is very common for ARM64. [#3832](https://github.com/microsoft/STL/pull/3832) * Optimized `filesystem::path::lexically_normal()`. [#3850](https://github.com/microsoft/STL/pull/3850) * `basic_string`, `basic_stringbuf`, `basic_syncbuf`, `deque`, and `vector` now take advantage of allocators that provide `allocate_at_least()`. [#3864](https://github.com/microsoft/STL/pull/3864) [#3891](https://github.com/microsoft/STL/pull/3891) * Optimized `<format>` slightly. [#3826](https://github.com/microsoft/STL/pull/3826) * Optimized `bitset::to_string()`. [#3838](https://github.com/microsoft/STL/pull/3838) [#3904](https://github.com/microsoft/STL/pull/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. [#3664](https://github.com/microsoft/STL/pull/3664) * Made a tiny tweak to `valarray` (access the stored size directly instead of via calling `size()`) to improve debug codegen. [#3968](https://github.com/microsoft/STL/pull/3968) - Improved throughput: * Moved machinery: [#3719](https://github.com/microsoft/STL/pull/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>`. [#3777](https://github.com/microsoft/STL/pull/3777) * In C++17 mode and later, improved Clang throughput for an internal helper wrapping `is_same_v`. [#3933](https://github.com/microsoft/STL/pull/3933) - Enhanced behavior: * Added precondition checking in debug mode to the `iota_view(value)` constructor. [#3731](https://github.com/microsoft/STL/pull/3731) * Improved precondition checking in debug mode for `barrier`. [#3757](https://github.com/microsoft/STL/pull/3757) * Fixed static analysis warnings. [#3734](https://github.com/microsoft/STL/pull/3734) [#3743](https://github.com/microsoft/STL/pull/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`. [#3762](https://github.com/microsoft/STL/pull/3762) + `basic_string_view::compare(const charT*)`. [#3738](https://github.com/microsoft/STL/pull/3738) + Constructors of `locale::facet` and related base classes. [#3855](https://github.com/microsoft/STL/pull/3855) + Many functions in `<complex>`. [#3880](https://github.com/microsoft/STL/pull/3880) + Many functions in `<random>`, some functions in `<valarray>`, and 3-arg `hypot()` in `<cmath>`. [#3887](https://github.com/microsoft/STL/pull/3887) * The STL now avoids conflicting with non-Standard macros of reserved names that were defined by old versions of the ICU library. [#3776](https://github.com/microsoft/STL/pull/3776) * Updated `stdext::checked_array_iterator` and `stdext::unchecked_array_iterator`: [#3818](https://github.com/microsoft/STL/pull/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. [#3831](https://github.com/microsoft/STL/pull/3831) * Improved how `views::cartesian_product` detects ranges with maximum sizes that are known at compile time. [#3839](https://github.com/microsoft/STL/pull/3839) * Improved how parallel algorithms perform compile-time iterator type checking. [#3899](https://github.com/microsoft/STL/pull/3899) * The STL now calls `abort()` instead of `terminate()` for unrecoverable conditions, when the Standard doesn't require `terminate()` to be called. [#3906](https://github.com/microsoft/STL/pull/3906) [#3909](https://github.com/microsoft/STL/pull/3909) * Improved the visualizer for `vector<char>` and the other character types. [#3772](https://github.com/microsoft/STL/pull/3772) * Improved the visualizer for `mutex` and `recursive_mutex`. [#3848](https://github.com/microsoft/STL/pull/3848) * Updated `chrono::duration_cast()` to use `if constexpr`, improving debug codegen. [#3958](https://github.com/microsoft/STL/pull/3958) - Improved test coverage: * Added properly functioning test coverage for `ranges::owning_view`. [#3753](https://github.com/microsoft/STL/pull/3753) * Added test coverage for calling `tellg()` while reading an LF file in text mode. [#3773](https://github.com/microsoft/STL/pull/3773) [#3841](https://github.com/microsoft/STL/pull/3841) * Added test coverage for [LWG-2295](https://wg21.link/lwg2295) Locale name when the provided `Facet` is a `nullptr`. [#3823](https://github.com/microsoft/STL/pull/3823) * Added test coverage for [LWG-2682](https://wg21.link/lwg2682) `filesystem::copy()` won't create a symlink to a directory. [#3827](https://github.com/microsoft/STL/pull/3827) * Updated tests to use lvalue references for the LHS of `is_assignable_v` and `is_nothrow_assignable_v`. [#3898](https://github.com/microsoft/STL/pull/3898) * Added more tests for `views::as_const`, `views::stride`, and `views::zip`. [#3920](https://github.com/microsoft/STL/pull/3920) * Test code now consistently uses `override` to avoid mistakes, following the same convention as product code. [#3934](https://github.com/microsoft/STL/pull/3934) * Fixed precondition violations in `is_permutation()` tests. [#3967](https://github.com/microsoft/STL/pull/3967) * Fixed precondition violations in `regex_iterator` and `regex_token_iterator` tests. [#3990](https://github.com/microsoft/STL/pull/3990) - Code cleanups: * Removed compiler bug workarounds. [#3722](https://github.com/microsoft/STL/pull/3722) [#3769](https://github.com/microsoft/STL/pull/3769) [#3866](https://github.com/microsoft/STL/pull/3866) [#3939](https://github.com/microsoft/STL/pull/3939) * Improved SFINAE to follow modern conventions. [#3736](https://github.com/microsoft/STL/pull/3736) * Various cleanups (described in detail in the PRs, not repeated here). [#3758](https://github.com/microsoft/STL/pull/3758) [#3759](https://github.com/microsoft/STL/pull/3759) [#3765](https://github.com/microsoft/STL/pull/3765) [#3768](https://github.com/microsoft/STL/pull/3768) [#3912](https://github.com/microsoft/STL/pull/3912) [#3927](https://github.com/microsoft/STL/pull/3927) [#3935](https://github.com/microsoft/STL/pull/3935) * Removed comments that were citing proposed resolutions for LWG issues, now that those issues have been officially resolved by the June 2023 meeting. [#3784](https://github.com/microsoft/STL/pull/3784) [#3785](https://github.com/microsoft/STL/pull/3785) * Marked internal machinery as `[[noreturn]]`. [#3865](https://github.com/microsoft/STL/pull/3865) [#3882](https://github.com/microsoft/STL/pull/3882) * Removed unnecessary `typename` keywords in C++20 mode and later. [#3892](https://github.com/microsoft/STL/pull/3892) [#3893](https://github.com/microsoft/STL/pull/3893) [#3894](https://github.com/microsoft/STL/pull/3894) * Improved type safety by using an `enum class` for internal machinery within `<condition_variable>`, `<mutex>`, and `<thread>`. [#3897](https://github.com/microsoft/STL/pull/3897) * Improved the consistency of code that should never be called. [#3905](https://github.com/microsoft/STL/pull/3905) * Removed unused code. [#3936](https://github.com/microsoft/STL/pull/3936) * Improved the clarity and maintainability of `basic_string`'s implementation. [#3862](https://github.com/microsoft/STL/pull/3862) * Deprecated the non-standard `<cvt/meow>` headers and their provided character encoding conversion machinery. [#3924](https://github.com/microsoft/STL/pull/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. [#3907](https://github.com/microsoft/STL/pull/3907) * Improved the consistency of preprocessor comments. [#3900](https://github.com/microsoft/STL/pull/3900) [#3951](https://github.com/microsoft/STL/pull/3951) - Infrastructure improvements: * Modernized code format validation to use `<print>`. [#3919](https://github.com/microsoft/STL/pull/3919) * Updated dependencies. [#3769](https://github.com/microsoft/STL/pull/3769) [#3866](https://github.com/microsoft/STL/pull/3866) [#3939](https://github.com/microsoft/STL/pull/3939) + Updated build compiler to VS 2022 17.8 Preview 1. + Updated Boost.Math to 1.83.0. [#3952](https://github.com/microsoft/STL/pull/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. [#3730](https://github.com/microsoft/STL/pull/3730) [#3930](https://github.com/microsoft/STL/pull/3930) - Updated `_MSVC_STL_UPDATE`. [#3742](https://github.com/microsoft/STL/pull/3742) [#3851](https://github.com/microsoft/STL/pull/3851) [#3918](https://github.com/microsoft/STL/pull/3918)

vs-2022-17.7

VS 2022 17.7 - Merged C++23 features: * [P1467R9](https://wg21.link/P1467R9) [#3583](https://github.com/microsoft/STL/pull/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) [#3337](https://github.com/microsoft/STL/pull/3337) `<print>`: Formatted Output + [P2539R4](https://wg21.link/P2539R4) Synchronizing `print()` With The Underlying Stream * [P2164R9](https://wg21.link/P2164R9) [#3472](https://github.com/microsoft/STL/pull/3472) `views::enumerate` * [P2165R4](https://wg21.link/P2165R4) [#3372](https://github.com/microsoft/STL/pull/3372) Compatibility Between `tuple`, `pair`, And *tuple-like* Objects * [P2321R2](https://wg21.link/P2321R2) `zip`, completed by implementing: + `views::adjacent` and `views::pairwise`. [#3508](https://github.com/microsoft/STL/pull/3508) + `views::adjacent_transform` and `views::pairwise_transform`. [#3546](https://github.com/microsoft/STL/pull/3546) * [P2374R4](https://wg21.link/P2374R4) [#3561](https://github.com/microsoft/STL/pull/3561) `views::cartesian_product` + [P2540R1](https://wg21.link/P2540R1) Empty Product For Certain Views * [P2572R1](https://wg21.link/P2572R1) [#3629](https://github.com/microsoft/STL/pull/3629) `std::format` Fill Character Allowances * [P2609R3](https://wg21.link/P2609R3) [#3486](https://github.com/microsoft/STL/pull/3486) Relaxing Ranges Just A Smidge * [P2614R2](https://wg21.link/P2614R2) [#3482](https://github.com/microsoft/STL/pull/3482) Deprecating `float_denorm_style`, `numeric_limits::has_denorm`, `numeric_limits::has_denorm_loss` * [P2652R2](https://wg21.link/P2652R2) [#3542](https://github.com/microsoft/STL/pull/3542) Disallowing User Specialization Of `allocator_traits` * [P2655R3](https://wg21.link/P2655R3) [#3513](https://github.com/microsoft/STL/pull/3513) `common_reference_t` Of `reference_wrapper` Should Be A Reference Type * [P2736R2](https://wg21.link/P2736R2) [#3556](https://github.com/microsoft/STL/pull/3556) Referencing The Unicode Standard + `<format>` now understands Unicode 15. * [P2770R0](https://wg21.link/P2770R0) [#3466](https://github.com/microsoft/STL/pull/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. [#3656](https://github.com/microsoft/STL/pull/3656) - Merged LWG issue resolutions: * [LWG-2195](https://wg21.link/lwg2195) [#3506](https://github.com/microsoft/STL/pull/3506) Missing constructors for `match_results` * [LWG-2309](https://wg21.link/lwg2309) [#3469](https://github.com/microsoft/STL/pull/3469) `mutex::lock()` should not throw `device_or_resource_busy` * [LWG-2381](https://wg21.link/lwg2381) [#3364](https://github.com/microsoft/STL/pull/3364) Inconsistency in parsing floating point numbers * [LWG-3204](https://wg21.link/lwg3204) [#3494](https://github.com/microsoft/STL/pull/3494) `sub_match::swap` only swaps the base class * [LWG-3655](https://wg21.link/lwg3655) [#3495](https://github.com/microsoft/STL/pull/3495) The *`INVOKE`* operation and `union` types * [LWG-3677](https://wg21.link/lwg3677) [#3396](https://github.com/microsoft/STL/pull/3396) Is a *cv*-qualified `pair` specially handled in uses-allocator construction? * [LWG-3720](https://wg21.link/lwg3720) [#3511](https://github.com/microsoft/STL/pull/3511) Restrict the valid types of *arg-id* for *width* and *precision* in *std-format-spec* * [LWG-3733](https://wg21.link/lwg3733) [#3496](https://github.com/microsoft/STL/pull/3496) `ranges::to` misuses *`cpp17-input-iterator`* * [LWG-3734](https://wg21.link/lwg3734) [#3503](https://github.com/microsoft/STL/pull/3503) Inconsistency in `inout_ptr` and `out_ptr` for empty case * [LWG-3821](https://wg21.link/lwg3821) [#3509](https://github.com/microsoft/STL/pull/3509) `uses_allocator_construction_args` should have overload for *`pair-like`* * [LWG-3833](https://wg21.link/lwg3833) [#3477](https://github.com/microsoft/STL/pull/3477) Remove specialization `template<size_t N> struct formatter<const charT[N], charT>` * [LWG-3836](https://wg21.link/lwg3836) [#3587](https://github.com/microsoft/STL/pull/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) [#3479](https://github.com/microsoft/STL/pull/3479) `ranges::to` can still return views * [LWG-3851](https://wg21.link/lwg3851) [#3517](https://github.com/microsoft/STL/pull/3517) `chunk_view::`*`inner-iterator`* missing custom `iter_move` and `iter_swap` * [LWG-3860](https://wg21.link/lwg3860) [#3480](https://github.com/microsoft/STL/pull/3480) `range_common_reference_t` is missing * [LWG-3862](https://wg21.link/lwg3862) [#3471](https://github.com/microsoft/STL/pull/3471) `basic_const_iterator`'s `common_type` specialization is underconstrained * [LWG-3865](https://wg21.link/lwg3865) [#3476](https://github.com/microsoft/STL/pull/3476) Sorting a range of `pair`s + This can be a **source-breaking change** in unusual scenarios. * [LWG-3869](https://wg21.link/lwg3869) [#3487](https://github.com/microsoft/STL/pull/3487) Deprecate `std::errc` constants related to UNIX STREAMS * [LWG-3870](https://wg21.link/lwg3870) [#3475](https://github.com/microsoft/STL/pull/3475) Remove *`voidify`* * [LWG-3872](https://wg21.link/lwg3872) [#3470](https://github.com/microsoft/STL/pull/3470) `basic_const_iterator` should have custom `iter_move` * [LWG-3875](https://wg21.link/lwg3875) [#3485](https://github.com/microsoft/STL/pull/3485) `std::ranges::repeat_view<T, IntegerClass>::`*`iterator`* may be ill-formed * [LWG-3877](https://wg21.link/lwg3877) [#3504](https://github.com/microsoft/STL/pull/3504) Incorrect constraints on `const`-qualified monadic overloads for `std::expected` * [LWG-3887](https://wg21.link/lwg3887) [#3589](https://github.com/microsoft/STL/pull/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. [#3405](https://github.com/microsoft/STL/pull/3405) * Fixed compiler errors found with Clang 16. [#3483](https://github.com/microsoft/STL/pull/3483) * Fixed `<ranges>` to avoid using list-initialization when the difference between braces and parentheses is observable. [#3493](https://github.com/microsoft/STL/pull/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. [#3510](https://github.com/microsoft/STL/pull/3510) * Fixed technically undefined behavior in `<regex>` and `<sstream>` found by Clang/LLVM's Undefined Behavior Sanitizer (UBSan). [#3452](https://github.com/microsoft/STL/pull/3452) * Fixed compiler errors when calling `ranges::equal` with ranges involving `views::iota`. [#3551](https://github.com/microsoft/STL/pull/3551) * Fixed the STL's iterator unwrapping machinery to avoid requiring a `_Prevent_inheriting_unwrap` typedef. [#3566](https://github.com/microsoft/STL/pull/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`. [#3581](https://github.com/microsoft/STL/pull/3581) * Fixed `bind()` function objects to have constrained function call operators, so they interact properly with `is_invocable` and related scenarios. [#3577](https://github.com/microsoft/STL/pull/3577) * Reverted [#2654](https://github.com/microsoft/STL/pull/2654) (which affected `<future>`'s use of `<ppltasks.h>` in Desktop XAML apps) because it introduced an `ole32.dll` dependency that broke multiple scenarios. [#3607](https://github.com/microsoft/STL/pull/3607) + We backported this revert to VS 2022 17.6. * Fixed `views::cartesian_product` to avoid compiler errors in pathological scenarios. [#3609](https://github.com/microsoft/STL/pull/3609) * Fixed incorrect results for ranges larger than 4 GB passed to the vectorized implementations of `min_element()`, `max_element()`, and `minmax_element()`. [#3619](https://github.com/microsoft/STL/pull/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 [#2447](https://github.com/microsoft/STL/pull/2447) [#2821](https://github.com/microsoft/STL/pull/2821) [#2825](https://github.com/microsoft/STL/pull/2825) in VS 2022 17.4. * Added a compiler bug workaround for MSVC in `shared_ptr`'s `operator<=>`. [#3647](https://github.com/microsoft/STL/pull/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. [#3650](https://github.com/microsoft/STL/pull/3650) * Fixed compiler errors when formatting unusual `chrono::duration` types. [#3649](https://github.com/microsoft/STL/pull/3649) * Fixed `optional::transform()` to avoid terminating when the callable object throws an exception. [#3668](https://github.com/microsoft/STL/pull/3668) * Fixed `<charconv>` floating-point `from_chars()` to correctly handle two scenarios involving exponents with large absolute values. [#3670](https://github.com/microsoft/STL/pull/3670) * Fixed iostreams floating-point parsing to produce correct results for many different scenarios. [#3364](https://github.com/microsoft/STL/pull/3364) * Fixed compiler errors when importing the Standard Library Modules and calling `typeid(T).name()`. [#3677](https://github.com/microsoft/STL/pull/3677) * Fixed some nasty corner cases in `cartesian_product_view`. [#3678](https://github.com/microsoft/STL/pull/3678) * Fixed some issues with parsing numbers with grouping separators. [#3684](https://github.com/microsoft/STL/pull/3684) * Fixed a bug that could result in `unordered_meow` containers allocating too few buckets. [#3687](https://github.com/microsoft/STL/pull/3687) - Improved performance: * Slightly optimized `mutex` and `recursive_mutex` construction by avoiding a Windows API call. [#3522](https://github.com/microsoft/STL/pull/3522) * Slightly optimized `unique_ptr` move assignment by avoiding an unnecessary branch. [#3540](https://github.com/microsoft/STL/pull/3540) * Optimized `chrono::time_zone::to_sys` and `chrono::time_zone::to_local`, with a speedup of approximately 3x (times, not percent). [#3579](https://github.com/microsoft/STL/pull/3579) * Optimized `type_index::operator<=>` to avoid calling the comparison function twice. [#3600](https://github.com/microsoft/STL/pull/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. [#3630](https://github.com/microsoft/STL/pull/3630) * Optimized the constructors `system_error(error_code)` and `system_error(int, const error_category&)`. [#3635](https://github.com/microsoft/STL/pull/3635) - Improved throughput: * `<optional>` and `<variant>` now include fewer headers. [#3624](https://github.com/microsoft/STL/pull/3624) * Moved internal machinery into `<regex>` where it's needed. [#3625](https://github.com/microsoft/STL/pull/3625) * C++20 `<chrono>` now avoids including `<algorithm>`. [#3626](https://github.com/microsoft/STL/pull/3626) * `<compare>` now avoids including `<bit>`. [#3627](https://github.com/microsoft/STL/pull/3627) * Refactored a central internal header so that the rest of the STL includes fewer headers and provides less machinery beyond what's required. [#3623](https://github.com/microsoft/STL/pull/3623) [#3654](https://github.com/microsoft/STL/pull/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. [#3700](https://github.com/microsoft/STL/pull/3700) - Enhanced behavior: * Silenced [CodeQL](https://codeql.github.com/) warnings. [#3489](https://github.com/microsoft/STL/pull/3489) [#3585](https://github.com/microsoft/STL/pull/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. [#3497](https://github.com/microsoft/STL/pull/3497) * Enabled `<source_location>` for Clang. [#3584](https://github.com/microsoft/STL/pull/3584) * Removed the non-Standard `xtime` type from `<chrono>`. [#3594](https://github.com/microsoft/STL/pull/3594) * Added `static_assert`s to containers, container adaptors, and `allocator` to improve the error messages when they're given non-object types. [#2436](https://github.com/microsoft/STL/pull/2436) [#3660](https://github.com/microsoft/STL/pull/3660) + `allocator<void>` is still permitted as a special case. - Improved test coverage: * Added test coverage with Clang/LLVM's Undefined Behavior Sanitizer (UBSan). [#3452](https://github.com/microsoft/STL/pull/3452) * Added more tests for `views::empty`, `views::iota`, `views::istream`, `views::repeat`, and `views::single`. [#3553](https://github.com/microsoft/STL/pull/3553) * Fixed nonconformant code in the test for Standard Library Header Units and Modules. [#3588](https://github.com/microsoft/STL/pull/3588) * Added test coverage for C++23's customization point objects. [#3610](https://github.com/microsoft/STL/pull/3610) * Added more tests for `ranges::ref_view`, `ranges::subrange`, `views::common`, `views::filter`, `views::join`, `views::reverse`, and `views::transform`. [#3612](https://github.com/microsoft/STL/pull/3612) - Code cleanups: * Removed many compiler (and CMake) bug workarounds. [#3490](https://github.com/microsoft/STL/pull/3490) [#3499](https://github.com/microsoft/STL/pull/3499) [#3651](https://github.com/microsoft/STL/pull/3651) [#3711](https://github.com/microsoft/STL/pull/3711) * Various cleanups (described in detail in the PRs, not repeated here). [#2116](https://github.com/microsoft/STL/pull/2116) [#3406](https://github.com/microsoft/STL/pull/3406) [#3523](https://github.com/microsoft/STL/pull/3523) [#3524](https://github.com/microsoft/STL/pull/3524) [#3525](https://github.com/microsoft/STL/pull/3525) [#3526](https://github.com/microsoft/STL/pull/3526) [#3527](https://github.com/microsoft/STL/pull/3527) [#3528](https://github.com/microsoft/STL/pull/3528) [#3529](https://github.com/microsoft/STL/pull/3529) [#3530](https://github.com/microsoft/STL/pull/3530) [#3531](https://github.com/microsoft/STL/pull/3531) [#3532](https://github.com/microsoft/STL/pull/3532) [#3533](https://github.com/microsoft/STL/pull/3533) [#3539](https://github.com/microsoft/STL/pull/3539) [#3543](https://github.com/microsoft/STL/pull/3543) [#3547](https://github.com/microsoft/STL/pull/3547) [#3598](https://github.com/microsoft/STL/pull/3598) [#3633](https://github.com/microsoft/STL/pull/3633) [#3639](https://github.com/microsoft/STL/pull/3639) [#3658](https://github.com/microsoft/STL/pull/3658) * Removed comments that were citing proposed resolutions for LWG issues, now that those issues have been officially resolved by the February 2023 meeting. [#3554](https://github.com/microsoft/STL/pull/3554) * Simplified code by calling `fill_n()` instead of `fill()` when possible. [#3578](https://github.com/microsoft/STL/pull/3578) - Improved documentation: * Added documentation about the STL's import library. [#2141](https://github.com/microsoft/STL/pull/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`. [#3484](https://github.com/microsoft/STL/pull/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. [#3621](https://github.com/microsoft/STL/pull/3621) * Updated dependencies. [#3490](https://github.com/microsoft/STL/pull/3490) [#3651](https://github.com/microsoft/STL/pull/3651) [#3711](https://github.com/microsoft/STL/pull/3711) + Updated build compiler to VS 2022 17.7 Preview 1 (17.6 now required). + Updated Clang to 16.0.1 (now required). + Updated CMake to 3.26.0 (now required). + Updated Python to 3.11.3. + Updated Boost.Math to 1.82.0. [#3657](https://github.com/microsoft/STL/pull/3657) - Updated `_MSVC_STL_UPDATE`. [#3518](https://github.com/microsoft/STL/pull/3518) [#3643](https://github.com/microsoft/STL/pull/3643) [#3680](https://github.com/microsoft/STL/pull/3680)

vs-2022-17.6

VS 2022 17.6 - Merged C++23 features: * [P1223R5](https://wg21.link/P1223R5) [#3268](https://github.com/microsoft/STL/pull/3268) `ranges::find_last`, `ranges::find_last_if`, `ranges::find_last_if_not` * [P2167R3](https://wg21.link/P2167R3) [#3258](https://github.com/microsoft/STL/pull/3258) Improving *`boolean-testable`* Usage * [P2278R4](https://wg21.link/P2278R4) [#3187](https://github.com/microsoft/STL/pull/3187) [#3234](https://github.com/microsoft/STL/pull/3234) `cbegin` Should Always Return A Constant Iterator * [P2404R3](https://wg21.link/P2404R3) [#3345](https://github.com/microsoft/STL/pull/3345) Move-Only Types For Comparison Concepts * [P2467R1](https://wg21.link/P2467R1) [#3065](https://github.com/microsoft/STL/pull/3065) `ios_base::noreplace`: Exclusive Mode For `fstream`s * [P2474R2](https://wg21.link/P2474R2) [#3142](https://github.com/microsoft/STL/pull/3142) `views::repeat` * [P2505R5](https://wg21.link/P2505R5) [#3361](https://github.com/microsoft/STL/pull/3361) Monadic Functions For `expected` * [P2588R3](https://wg21.link/P2588R3) [#3455](https://github.com/microsoft/STL/pull/3455) `barrier`'s Phase Completion Guarantees * [P2602R2](https://wg21.link/P2602R2) [#3215](https://github.com/microsoft/STL/pull/3215) Poison Pills Are Too Toxic * [P2711R1](https://wg21.link/P2711R1) [#3451](https://github.com/microsoft/STL/pull/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`. [#3323](https://github.com/microsoft/STL/pull/3323) * [P2321R2](https://wg21.link/P2321R2) `zip`: + `views::zip_transform`. [#3322](https://github.com/microsoft/STL/pull/3322) + *Note:* `views::adjacent` and `views::adjacent_transform` remain to be implemented. - Merged LWG issue resolutions: * [LWG-3515](https://wg21.link/lwg3515) [#3236](https://github.com/microsoft/STL/pull/3236) \[stacktrace.basic.nonmem\]: `operator<<` should be less templatized * [LWG-3545](https://wg21.link/lwg3545) [#3242](https://github.com/microsoft/STL/pull/3242) `std::pointer_traits` should be SFINAE-friendly * [LWG-3594](https://wg21.link/lwg3594) [#3276](https://github.com/microsoft/STL/pull/3276) `inout_ptr` - inconsistent `release()` in destructor * [LWG-3629](https://wg21.link/lwg3629) [#3272](https://github.com/microsoft/STL/pull/3272) `make_error_code` and `make_error_condition` are customization points * [LWG-3646](https://wg21.link/lwg3646) [#3261](https://github.com/microsoft/STL/pull/3261) `std::ranges::view_interface::size` returns a signed type * [LWG-3717](https://wg21.link/lwg3717) [#3266](https://github.com/microsoft/STL/pull/3266) `common_view::end` should improve `random_access_range` case * [LWG-3736](https://wg21.link/lwg3736) [#3318](https://github.com/microsoft/STL/pull/3318) `move_iterator` missing `disable_sized_sentinel_for` specialization * [LWG-3737](https://wg21.link/lwg3737) [#3320](https://github.com/microsoft/STL/pull/3320) `take_view::`*`sentinel`* should provide `operator-` * [LWG-3743](https://wg21.link/lwg3743) [#3269](https://github.com/microsoft/STL/pull/3269) `ranges::to`'s `reserve` may be ill-formed * [LWG-3746](https://wg21.link/lwg3746) [#3265](https://github.com/microsoft/STL/pull/3265) `optional`'s spaceship with `U` with a type derived from `optional` causes infinite constraint meta-recursion * [LWG-3769](https://wg21.link/lwg3769) [#3459](https://github.com/microsoft/STL/pull/3459) `basic_const_iterator::operator==` causes infinite constraint recursion * [LWG-3772](https://wg21.link/lwg3772) [#3462](https://github.com/microsoft/STL/pull/3462) `repeat_view`'s piecewise constructor is missing preconditions * [LWG-3778](https://wg21.link/lwg3778) [#3332](https://github.com/microsoft/STL/pull/3332) `vector<bool>` missing exception specifications * [LWG-3785](https://wg21.link/lwg3785) [#3319](https://github.com/microsoft/STL/pull/3319) `ranges::to` is over-constrained on the destination type being a range * [LWG-3798](https://wg21.link/lwg3798) [#3359](https://github.com/microsoft/STL/pull/3359) Rvalue reference and `iterator_category` * [LWG-3810](https://wg21.link/lwg3810) [#3421](https://github.com/microsoft/STL/pull/3421) CTAD for `std::basic_format_args` * [LWG-3823](https://wg21.link/lwg3823) [#3231](https://github.com/microsoft/STL/pull/3231) Unnecessary precondition for `is_aggregate` * [LWG-3848](https://wg21.link/lwg3848) [#3410](https://github.com/microsoft/STL/pull/3410) `slide_view` missing `base` accessor * [LWG-3850](https://wg21.link/lwg3850) [#3423](https://github.com/microsoft/STL/pull/3423) `views::as_const` on `empty_view<T>` should return `empty_view<const T>` * [LWG-3853](https://wg21.link/lwg3853) [#3468](https://github.com/microsoft/STL/pull/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) [#3348](https://github.com/microsoft/STL/pull/3348) `basic_string_view` should allow explicit conversion when only traits vary * [LWG-3867](https://wg21.link/lwg3867) [#3367](https://github.com/microsoft/STL/pull/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. [#3232](https://github.com/microsoft/STL/pull/3232) * Fixed another unintentionally dllexported symbol in the import library. [#3233](https://github.com/microsoft/STL/pull/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. [#3235](https://github.com/microsoft/STL/pull/3235) + This ABI break was introduced by [#1735](https://github.com/microsoft/STL/pull/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`. [#3255](https://github.com/microsoft/STL/pull/3255) + This ABI break was introduced by [#2654](https://github.com/microsoft/STL/pull/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()`. [#3247](https://github.com/microsoft/STL/pull/3247) + This fixed a regression that was introduced by [#2434](https://github.com/microsoft/STL/pull/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. [#3243](https://github.com/microsoft/STL/pull/3243) * Fixed compiler warnings when passing `long double` to `copysign()`. [#3253](https://github.com/microsoft/STL/pull/3253) * Re-enabled ASan (Address Sanitizer) annotations in `<string>` after fixing significant bugs. [#3164](https://github.com/microsoft/STL/pull/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()`. [#3270](https://github.com/microsoft/STL/pull/3270) * Fixed `shared_future<void>`'s move assignment operator to be `noexcept` as required by the Standard. [#3284](https://github.com/microsoft/STL/pull/3284) * Fixed Clang compiler errors involving intrinsics by including `<intrin.h>`, which is a header that Clang recognizes and supports. [#3285](https://github.com/microsoft/STL/pull/3285) * Fixed `numeric_limits` to correctly report that `is_signed` is `true` for the STL's internal 128-bit signed-integer-class type. [#3291](https://github.com/microsoft/STL/pull/3291) * Fixed `<stacktrace>` to correctly pass `SYMOPT_FAIL_CRITICAL_ERRORS` to the Windows API. [#3292](https://github.com/microsoft/STL/pull/3292) * Fixed `<charconv>` (and headers that include it, like `<chrono>` and `<format>`) to avoid emitting warning C4365 "signed/unsigned mismatch" when being compiled with `/J`. [#3295](https://github.com/microsoft/STL/pull/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. [#3316](https://github.com/microsoft/STL/pull/3316) * Added compiler bug workarounds: + For Clang in `<expected>`. [#3326](https://github.com/microsoft/STL/pull/3326) + For Clang in `<ranges>`. [#3328](https://github.com/microsoft/STL/pull/3328) + For MSVC modules in `<filesystem>`. [#3331](https://github.com/microsoft/STL/pull/3331) * Fixed `constexpr` `basic_string` to correctly start the lifetimes of its elements, avoiding compiler errors. [#3334](https://github.com/microsoft/STL/pull/3334) * Fixed `views::istream` constraints to precisely follow the Standard. [#3335](https://github.com/microsoft/STL/pull/3335) * Implemented C++17's parallel specialized `<memory>` algorithms. [#3145](https://github.com/microsoft/STL/pull/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. [#3342](https://github.com/microsoft/STL/pull/3342) * Fixed a compiler error when calling `ranges::prev` on an `iota_view` iterator in debug mode. [#3356](https://github.com/microsoft/STL/pull/3356) * Fixed `ranges::minmax` to avoid moving from an element twice when called with a single-element range of `move_iterator`s. [#3366](https://github.com/microsoft/STL/pull/3366) * Fixed a minor conformance issue in the `std.ixx` Standard Library Module. [#3373](https://github.com/microsoft/STL/pull/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. [#3380](https://github.com/microsoft/STL/pull/3380) * Fixed Clang `-Wdeprecated` warnings that said "out-of-line definition of constexpr static data member is redundant in C++17 and is deprecated". [#3381](https://github.com/microsoft/STL/pull/3381) * Changed `vformat_to()` to instantiate its machinery in a lazier way. [#3403](https://github.com/microsoft/STL/pull/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==()`. [#3250](https://github.com/microsoft/STL/pull/3250) * Activated `count()`'s vectorized implementation for more eligible iterators in C++14/17 modes. [#3262](https://github.com/microsoft/STL/pull/3262) * Activated the vectorized implementations of `find()`, `count()`, `ranges::find()`, and `ranges::count()` for more scenarios involving pointer elements. [#3267](https://github.com/microsoft/STL/pull/3267) * Optimized `<atomic>` for ARM64, massively improving load-acquire and store-release (measured 14.1x to 23.8x speedups - times, not percent) and significantly improving sequentially consistent stores (measured 1.58x speedup). [#3399](https://github.com/microsoft/STL/pull/3399) * `ranges::find` now calls `memchr()` in more situations (when the vectorized implementation isn't available). [#3386](https://github.com/microsoft/STL/pull/3386) - Improved throughput: * Moved user-defined literals for the STL's internal 128-bit integer-class types from product code to test code. [#3252](https://github.com/microsoft/STL/pull/3252) * Removed unnecessary `operator==` and `operator!=` overloads for internal types in C++20 mode. [#3256](https://github.com/microsoft/STL/pull/3256) * Used `if constexpr` instead of overloads in internal machinery. [#3389](https://github.com/microsoft/STL/pull/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. [#3194](https://github.com/microsoft/STL/pull/3194) [#3201](https://github.com/microsoft/STL/pull/3201) + See tracking issue [#3193](https://github.com/microsoft/STL/issues/3193) for a list of compiler bugs that affect these newly enabled `/clr` scenarios. * Added visualizers for `error_category` and `error_code`. [#3204](https://github.com/microsoft/STL/pull/3204) * Improved the output of `source_location::function_name()`. [#3206](https://github.com/microsoft/STL/pull/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. [#3282](https://github.com/microsoft/STL/pull/3282) * Changed `<mutex>` to use scope guards instead of `throw;`, making debugging easier when exceptions are thrown. [#3321](https://github.com/microsoft/STL/pull/3321) * Strengthened the exception specifications for: + `mutex::unlock()`, `recursive_mutex::unlock()`, and `unique_lock`'s move assignment operator. [#3321](https://github.com/microsoft/STL/pull/3321) + Various member functions and `swap()` overloads for stream types. [#3314](https://github.com/microsoft/STL/pull/3314) + Various non-member and member functions in `<condition_variable>`, `<mutex>`, `<shared_mutex>`, and `<thread>`. [#3388](https://github.com/microsoft/STL/pull/3388) * Added `modules/modules.json` to support build systems. [#3358](https://github.com/microsoft/STL/pull/3358) [#3488](https://github.com/microsoft/STL/pull/3488) * Refactored `ranges::minmax` and `ranges::minmax_element` to detect the single-element case naturally. [#3384](https://github.com/microsoft/STL/pull/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. [#3453](https://github.com/microsoft/STL/pull/3453) - Improved documentation: * Clarified the error message when including the internal header `<__msvc_cxx_stdatomic.hpp>` in C mode. [#3192](https://github.com/microsoft/STL/pull/3192) - Improved test coverage: * Enabled `<stdatomic.h>` test coverage for Clang. [#3186](https://github.com/microsoft/STL/pull/3186) * Updated the modules tests after a compiler bugfix for `source_location`. [#3339](https://github.com/microsoft/STL/pull/3339) * Added more tests for `views::elements`. [#3350](https://github.com/microsoft/STL/pull/3350) * Updated our LLVM submodule reference, including new tests. [#3344](https://github.com/microsoft/STL/pull/3344) [#3357](https://github.com/microsoft/STL/pull/3357) * Added more tests for `views::drop`, `views::drop_while`, `views::take`, and `views::take_while`. [#3390](https://github.com/microsoft/STL/pull/3390) - Code cleanups: * Removed compiler bug workarounds. [#3202](https://github.com/microsoft/STL/pull/3202) [#3288](https://github.com/microsoft/STL/pull/3288) [#3351](https://github.com/microsoft/STL/pull/3351) [#3350](https://github.com/microsoft/STL/pull/3350) * Removed comments that were citing proposed resolutions for LWG issues, now that those issues have been officially resolved by the November 2022 and February 2023 meetings. [#3238](https://github.com/microsoft/STL/pull/3238) [#3461](https://github.com/microsoft/STL/pull/3461) * Improved consistency in preprocessor comments. [#3208](https://github.com/microsoft/STL/pull/3208) * Simplified a line in `experimental::filesystem::recursive_directory_iterator::operator++()`. [#3279](https://github.com/microsoft/STL/pull/3279) * Various cleanups (described in detail in the PRs, not repeated here). [#3293](https://github.com/microsoft/STL/pull/3293) [#3300](https://github.com/microsoft/STL/pull/3300) * Removed unused internal machinery. [#3299](https://github.com/microsoft/STL/pull/3299) * Simplified types by defaulting some of their special member functions: + `promise` and `packaged_task`. [#3315](https://github.com/microsoft/STL/pull/3315) + `shared_mutex`, `shared_timed_mutex`, and `shared_lock`. [#3352](https://github.com/microsoft/STL/pull/3352) * Changed more temporary objects to be constructed with braces instead of parentheses. [#3277](https://github.com/microsoft/STL/pull/3277) * Updated comments after a compiler bug was fixed. [#3394](https://github.com/microsoft/STL/pull/3394) * Updated tests and separately compiled sources to directly use the `[[nodiscard]]` attribute. [#3397](https://github.com/microsoft/STL/pull/3397) * Updated notes for skipped tests in the `libcxx` test suite. [#3464](https://github.com/microsoft/STL/pull/3464) - Infrastructure improvements: * Added GitHub Actions to automatically add PR cards to the Code Reviews project. [#3393](https://github.com/microsoft/STL/pull/3393) * Fixed the build system to properly pass options when assembling the "alias objects". [#3402](https://github.com/microsoft/STL/pull/3402) * Updated dependencies. [#3202](https://github.com/microsoft/STL/pull/3202) [#3288](https://github.com/microsoft/STL/pull/3288) [#3340](https://github.com/microsoft/STL/pull/3340) [#3351](https://github.com/microsoft/STL/pull/3351) [#3467](https://github.com/microsoft/STL/pull/3467) + Updated build compiler to VS 2022 17.5 Preview 6 (now required). + Updated CMake to 3.25 (now required). + Updated Python to 3.11.2. + Updated Boost.Math to 1.81.0. [#3312](https://github.com/microsoft/STL/pull/3312) - Updated `_MSVC_STL_UPDATE`. [#3191](https://github.com/microsoft/STL/pull/3191) [#3264](https://github.com/microsoft/STL/pull/3264) [#3362](https://github.com/microsoft/STL/pull/3362) [#3395](https://github.com/microsoft/STL/pull/3395)

vs-2022-17.5

VS 2022 17.5 - Merged C++23 features: * [P2322R6](https://wg21.link/P2322R6) [#3099](https://github.com/microsoft/STL/pull/3099) `ranges::fold_left`, `ranges::fold_right`, etc. * [P2465R3](https://wg21.link/P2465R3) [#3108](https://github.com/microsoft/STL/pull/3108) Standard Library Modules `std` And `std.compat` + Initially supported for MSVC only; see tracking issue [#1694](https://github.com/microsoft/STL/issues/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) [#3074](https://github.com/microsoft/STL/pull/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()`. [#3043](https://github.com/microsoft/STL/pull/3043) * [P2321R2](https://wg21.link/P2321R2) `zip`: + `views::zip`. [#3035](https://github.com/microsoft/STL/pull/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) [#2949](https://github.com/microsoft/STL/pull/2949) Missing preconditions for `slide_view` constructor * [LWG-3788](https://wg21.link/lwg3788) [#3130](https://github.com/microsoft/STL/pull/3130) `jthread::operator=(jthread&&)` postconditions are unimplementable under self-assignment - Fixed bugs: * Fixed compiler warnings when using Standard Library Header Units. [#3069](https://github.com/microsoft/STL/pull/3069) * Removed a non-Standard member function `locale::c_str()`. [#3088](https://github.com/microsoft/STL/pull/3088) * Fixed narrowing warnings when calling `piecewise_constant_distribution<float>::densities()` and `piecewise_linear_distribution<float>::densities()`. [#3107](https://github.com/microsoft/STL/pull/3107) * Fixed compiler errors when calling `ranges::is_permutation` with predicates that return highly unusual boolean-testable types. [#3113](https://github.com/microsoft/STL/pull/3113) * Fixed compiler errors when building the Standard Library Modules with static RTTI disabled. [#3115](https://github.com/microsoft/STL/pull/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. [#3101](https://github.com/microsoft/STL/pull/3101) [#3148](https://github.com/microsoft/STL/pull/3148) * When `chrono::time_zone::get_info()` throws an exception, fixed it to report `GetLastError()` as intended, instead of `"The operation completed successfully."` [#3122](https://github.com/microsoft/STL/pull/3122) * Fixed incorrect results returned by `ellint_2()`. [#3077](https://github.com/microsoft/STL/pull/3077) * Fixed `error_category`'s default constructor to be `constexpr`. [#3139](https://github.com/microsoft/STL/pull/3139) [#3176](https://github.com/microsoft/STL/pull/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". [#3162](https://github.com/microsoft/STL/pull/3162) * Fixed compiler errors in certain `<ranges>` scenarios by properly constraining *`movable-box`*'s copy constructors. [#3171](https://github.com/microsoft/STL/pull/3171) - Improved performance: * Added support for unwrapping to `move_sentinel`. [#3098](https://github.com/microsoft/STL/pull/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). [#3012](https://github.com/microsoft/STL/pull/3012) * Optimized `gcd()` to avoid a redundant shift. [#3127](https://github.com/microsoft/STL/pull/3127) * Optimized `locale::classic()` for a 10x speedup (times, not percent). [#3048](https://github.com/microsoft/STL/pull/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. [#3182](https://github.com/microsoft/STL/pull/3182) - Improved throughput: * Significantly improved compile times for `<variant>` `visit()`. [#3070](https://github.com/microsoft/STL/pull/3070) * `<format>` now includes fewer headers. [#3128](https://github.com/microsoft/STL/pull/3128) * Moved random number generator machinery out of `<xutility>`, one of the STL's central internal headers. [#3157](https://github.com/microsoft/STL/pull/3157) - Enhanced behavior: * Clarified `get_future()`'s `[[nodiscard("message")]]`. [#3068](https://github.com/microsoft/STL/pull/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). [#3116](https://github.com/microsoft/STL/pull/3116) * Improved `<format>`'s compiler error messages for unformattable types. [#3080](https://github.com/microsoft/STL/pull/3080) - Improved test coverage: * Added test coverage for `<variant>` `visit()` invoking pointers to members. [#3070](https://github.com/microsoft/STL/pull/3070) * Expanded test coverage for `forward_like()`. [#3072](https://github.com/microsoft/STL/pull/3072) * Updated test coverage for `views::as_rvalue`. [#3089](https://github.com/microsoft/STL/pull/3089) * Expanded test coverage for `bind_front()` and `bind_back()`. [#3117](https://github.com/microsoft/STL/pull/3117) * Updated our LLVM submodule reference, including new tests, and updates to the `any`/`optional`/`variant` shared test code. [#2976](https://github.com/microsoft/STL/pull/2976) * Fixed bogus test code discovered by Clang 15. [#3135](https://github.com/microsoft/STL/pull/3135) * Fixed the off-by-default "exhaustive" mode of the parallel `is_partitioned()` test. [#3174](https://github.com/microsoft/STL/pull/3174) - Code cleanups: * Various cleanups (described in detail in the PRs, not repeated here). [#3082](https://github.com/microsoft/STL/pull/3082) [#3083](https://github.com/microsoft/STL/pull/3083) [#3084](https://github.com/microsoft/STL/pull/3084) [#3085](https://github.com/microsoft/STL/pull/3085) [#3086](https://github.com/microsoft/STL/pull/3086) [#3090](https://github.com/microsoft/STL/pull/3090) [#3091](https://github.com/microsoft/STL/pull/3091) [#3092](https://github.com/microsoft/STL/pull/3092) [#3093](https://github.com/microsoft/STL/pull/3093) [#3177](https://github.com/microsoft/STL/pull/3177) [#3178](https://github.com/microsoft/STL/pull/3178) * Improved Python scripts. [#3123](https://github.com/microsoft/STL/pull/3123) * Removed compiler bug workarounds. [#3155](https://github.com/microsoft/STL/pull/3155) * Moved `<atomic>` implementation details, preparing for later changes. [#3124](https://github.com/microsoft/STL/pull/3124) * Removed unnecessary partial specializations of `common_type` for the STL's internal 128-bit integer-class types. [#3153](https://github.com/microsoft/STL/pull/3153) - Infrastructure improvements: * The PR/CI system now uses spot VMs again. [#3071](https://github.com/microsoft/STL/pull/3071) * Configured Azure Pipelines to avoid running checks for draft PRs. [#3078](https://github.com/microsoft/STL/pull/3078) * Added GitHub Actions to allow contributors to move their PR cards in the Code Reviews project. [#2584](https://github.com/microsoft/STL/pull/2584) * Updated dependencies. [#3104](https://github.com/microsoft/STL/pull/3104) [#3155](https://github.com/microsoft/STL/pull/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). [#3077](https://github.com/microsoft/STL/pull/3077) + Updated Clang to 15.0.1 (now required). + Updated CMake to 3.24 (now required). + Updated Google Benchmark to 1.7.0. [#3151](https://github.com/microsoft/STL/pull/3151) + Updated Python to 3.10.8. - Updated `_MSVC_STL_UPDATE`. [#3073](https://github.com/microsoft/STL/pull/3073) [#3147](https://github.com/microsoft/STL/pull/3147)

vs-2022-17.4

VS 2022 17.4 - Merged C++23 features: * [P0849R8](https://wg21.link/P0849R8) [#2808](https://github.com/microsoft/STL/pull/2808) `auto(x)`: *`decay-copy`* In The Language + The compiler part is not yet implemented; the library part was implemented in C++20 mode when Ranges were initially implemented. * [P0881R7](https://wg21.link/P0881R7) [#2502](https://github.com/microsoft/STL/pull/2502) `<stacktrace>` + [P2301R1](https://wg21.link/P2301R1) Add A `pmr` Alias For `std::stacktrace` * [P1206R7](https://wg21.link/P1206R7) [#2806](https://github.com/microsoft/STL/pull/2806) [#3026](https://github.com/microsoft/STL/pull/3026) [#3028](https://github.com/microsoft/STL/pull/3028) Conversions From Ranges To Containers * [P1328R1](https://wg21.link/P1328R1) [#2793](https://github.com/microsoft/STL/pull/2793) `constexpr` `type_info::operator==()` * [P1899R3](https://wg21.link/P1899R3) [#2981](https://github.com/microsoft/STL/pull/2981) `views::stride` * [P2291R3](https://wg21.link/P2291R3) [#3049](https://github.com/microsoft/STL/pull/3049) `constexpr` Integral `<charconv>` * [P2302R4](https://wg21.link/P2302R4) [#2911](https://github.com/microsoft/STL/pull/2911) `ranges::contains`, `ranges::contains_subrange` * [P2387R3](https://wg21.link/P2387R3) [#2661](https://github.com/microsoft/STL/pull/2661) Pipe Support For User-Defined Range Adaptors * [P2408R5](https://wg21.link/P2408R5) [#2960](https://github.com/microsoft/STL/pull/2960) [#3056](https://github.com/microsoft/STL/pull/3056) Ranges Iterators As Inputs To Non-Ranges Algorithms * [P2417R2](https://wg21.link/P2417R2) [#2972](https://github.com/microsoft/STL/pull/2972) More `constexpr` `bitset` * [P2419R2](https://wg21.link/P2419R2) [#2977](https://github.com/microsoft/STL/pull/2977) Clarify Handling Of Encodings In Localized Formatting Of `chrono` Types * [P2438R2](https://wg21.link/P2438R2) [#3057](https://github.com/microsoft/STL/pull/3057) `string::substr() &&` * [P2440R1](https://wg21.link/P2440R1) [#2580](https://github.com/microsoft/STL/pull/2580) `ranges::iota`, `ranges::shift_left`, `ranges::shift_right` * [P2441R2](https://wg21.link/P2441R2) [#2619](https://github.com/microsoft/STL/pull/2619) `views::join_with` * [P2445R1](https://wg21.link/P2445R1) [#2974](https://github.com/microsoft/STL/pull/2974) `forward_like()` * [P2446R2](https://wg21.link/P2446R2) [#3008](https://github.com/microsoft/STL/pull/3008) `views::as_rvalue` * [P2494R2](https://wg21.link/P2494R2) [#2965](https://github.com/microsoft/STL/pull/2965) Relaxing Range Adaptors To Allow Move-Only Types * [P2499R0](https://wg21.link/P2499R0) [#2947](https://github.com/microsoft/STL/pull/2947) `string_view` Range Constructor Should Be `explicit` * [P2517R1](https://wg21.link/P2517R1) [#2959](https://github.com/microsoft/STL/pull/2959) Conditional `noexcept` For `apply()` * [P2520R0](https://wg21.link/P2520R0) [#2958](https://github.com/microsoft/STL/pull/2958) [#2994](https://github.com/microsoft/STL/pull/2994) `move_iterator<T*>` Should Be A Random-Access Iterator - Merged LWG issue resolutions: * [LWG-3564](https://wg21.link/lwg3564) [#2961](https://github.com/microsoft/STL/pull/2961) `transform_view::`*`iterator`*`<true>::value_type` and `iterator_category` should use `const F&` * [LWG-3617](https://wg21.link/lwg3617) [#2966](https://github.com/microsoft/STL/pull/2966) `function`/`packaged_task` deduction guides and deducing `this` * [LWG-3656](https://wg21.link/lwg3656) [#2880](https://github.com/microsoft/STL/pull/2880) Inconsistent bit operations returning a count * [LWG-3671](https://wg21.link/lwg3671) [#2905](https://github.com/microsoft/STL/pull/2905) `atomic_fetch_xor` missing from `stdatomic.h` * [LWG-3672](https://wg21.link/lwg3672) [#2907](https://github.com/microsoft/STL/pull/2907) `common_iterator::operator->()` should return by value * [LWG-3683](https://wg21.link/lwg3683) [#2879](https://github.com/microsoft/STL/pull/2879) `operator==` for `polymorphic_allocator` cannot deduce template argument in common cases * [LWG-3701](https://wg21.link/lwg3701) [#2957](https://github.com/microsoft/STL/pull/2957) Make `formatter<remove_cvref_t<const charT[N]>, charT>` requirement explicit * [LWG-3707](https://wg21.link/lwg3707) [#2883](https://github.com/microsoft/STL/pull/2883) `chunk_view::`*`outer-iterator`*`::value_type::size` should return unsigned type * [LWG-3710](https://wg21.link/lwg3710) [#2878](https://github.com/microsoft/STL/pull/2878) The `end` of `chunk_view` for input ranges can be `const` * [LWG-3712](https://wg21.link/lwg3712) [#2943](https://github.com/microsoft/STL/pull/2943) `chunk_view` and `slide_view` should not be `default_initializable` * [LWG-3715](https://wg21.link/lwg3715) [#2946](https://github.com/microsoft/STL/pull/2946) `view_interface::empty` is overconstrained * [LWG-3719](https://wg21.link/lwg3719) [#2902](https://github.com/microsoft/STL/pull/2902) Directory iterators should be usable with default sentinel * [LWG-3721](https://wg21.link/lwg3721) [#2906](https://github.com/microsoft/STL/pull/2906) Allow an *arg-id* with a value of zero for *width* in *std-format-spec* * [LWG-3724](https://wg21.link/lwg3724) [#2903](https://github.com/microsoft/STL/pull/2903) *`decay-copy`* should be constrained - Merged *proposed* resolutions for LWG issues (not yet accepted for the C++ Working Draft, but we've chosen to implement this speculatively): * [LWG-3705](https://wg21.link/lwg3705) [#2741](https://github.com/microsoft/STL/pull/2741) Hashability shouldn't depend on `basic_string`'s allocator - Fixed bugs: * Fixed linker errors when using `<any>` with our unofficially supported mode to disable exceptions. [#2193](https://github.com/microsoft/STL/pull/2193) * Fixed compiler errors when using `<format>` with the new compiler option `/presetPadding` by adding a compiler bug workaround. [#2746](https://github.com/microsoft/STL/pull/2746) * Fixed division by `complex` zero to behave consistently with other implementations. [#2758](https://github.com/microsoft/STL/pull/2758) * Fixed a memory leak in `<syncstream>`. [#2763](https://github.com/microsoft/STL/pull/2763) * Fixed compiler errors when formatting `long` or `unsigned long` values with `formatter`. [#2768](https://github.com/microsoft/STL/pull/2768) * Fixed a binary compatibility break in the unordered associative containers, which could cause memory corruption when linking code that was built with different versions of the STL. [#2774](https://github.com/microsoft/STL/pull/2774) + Original Versions: VS 2015 through VS 2019 16.2 inclusive. + Modified Versions: VS 2019 16.3 through VS 2022 17.3 inclusive. + Fixed Versions: VS 2022 17.4 and later. + The bincompat break happened when mixing Original with Modified code. All other mixing is safe: Original with Original, Modified with Modified, Fixed with Fixed, Original with Fixed, and Modified with Fixed. * Fixed a bug in the unordered associative containers, specific to user-defined allocators, where the containers sometimes called `deallocate()` with null pointers. User-defined allocators aren't required to tolerate that, so the containers now avoid such calls. [#2790](https://github.com/microsoft/STL/pull/2790) * Fixed a bug in `deque`, specific to rarely-used fancy pointers, where some fancy pointers weren't being destroyed. [#2775](https://github.com/microsoft/STL/pull/2775) * `<chrono>` formatting now accepts `%x` ("The locale's date representation") for `year_month_day`, `year_month_day_last`, `year_month_weekday`, and `year_month_weekday_last`. [#2762](https://github.com/microsoft/STL/pull/2762) * `std::filesystem::directory_entry`'s constructors, `assign()`, and `replace_filename()` now call `refresh()` as required by the Standard and will propagate any errors (via exceptions or `error_code`s), except that "file not found" is not considered an error. [#1343](https://github.com/microsoft/STL/pull/1343) * Added a compiler bug workaround to `construct_at()`, allowing immovable objects to be emplaced via copy elision. [#2624](https://github.com/microsoft/STL/pull/2624) * Fixed leap second validation when parsing `time_point`s. [#2705](https://github.com/microsoft/STL/pull/2705) * `lerp()` now avoids overflowing to infinity when it can calculate the correct result with a fallback approach. [#1918](https://github.com/microsoft/STL/pull/1918) * Fixed a debugger visualization issue, specific to Clang in C++20 mode (or later), where the debugger wouldn't display the contents of a `list`, `forward_list`, or ordered/unordered associative container. [#2782](https://github.com/microsoft/STL/pull/2782) * Fixed the visualizers for the non-Standard `stdext::hash_map` container family. [#2784](https://github.com/microsoft/STL/pull/2784) * Fixed the visualizers for `make_shared()` and `allocate_shared()`. [#2811](https://github.com/microsoft/STL/pull/2811) * `put_time()` (and the `time_put::do_put()` machinery powering it) now avoids modifying `errno` when it succeeds. [#2049](https://github.com/microsoft/STL/pull/2049) * Added a compiler bug workaround to fix compiler errors with `source_location::current()` in certain scenarios. [#2824](https://github.com/microsoft/STL/pull/2824) * Fixed compiler errors when using `<format>` to print `duration`s with extremely small periods (e.g. femtoseconds, attoseconds). [#2814](https://github.com/microsoft/STL/pull/2814) * Fixed "`istreambuf_iterator` is not dereferenceable" assertions when attempting to use `time_get::get()` or `get_time()` to parse certain formats when there's insufficient input. [#2851](https://github.com/microsoft/STL/pull/2851) + For example, with the format `"%X"`, the input `"3:04:05"` succeeds. The input `"3:04"` previously asserted/crashed; now it sets `ios_base::failbit | ios_base::eofbit` as required by the Standard. * Removed `std::filesystem::directory_entry::clear_cache()`, which was a non-Standard extension. [#2854](https://github.com/microsoft/STL/pull/2854) * Fixed incorrect results from `<complex>` `log()`/`log10()`/`pow()` on ARM64. [#2870](https://github.com/microsoft/STL/pull/2870) * Fixed `path::lexically_relative()` to handle UNC drive paths like `\\?\C:\meow.txt`. [#2867](https://github.com/microsoft/STL/pull/2867) * Fixed `filesystem::read_symlink()` and `filesystem::copy()` to handle junctions. [#2877](https://github.com/microsoft/STL/pull/2877) * Fixed compiler errors in `ranges::uninitialized_copy_n` and `ranges::uninitialized_move_n` with certain input iterators. [#2964](https://github.com/microsoft/STL/pull/2964) * Fixed `ranges::enable_view` to properly reject references and to avoid compiler errors in certain unusual situations. [#2978](https://github.com/microsoft/STL/pull/2978) * Temporarily disabled ASan (Address Sanitizer) annotations in `<string>` while significant bugs are under investigation. [#2990](https://github.com/microsoft/STL/pull/2990) * Fixed compiler errors in `views::chunk_by` with unusual predicates returning non-`bool` types. [#2890](https://github.com/microsoft/STL/pull/2890) * Fixed compiler errors in `visit<R>()` involving conversions to immovable types. [#2971](https://github.com/microsoft/STL/pull/2971) [#2999](https://github.com/microsoft/STL/pull/2999) * Fixed compiler errors in `chrono::abs()` in certain unusual situations. [#2988](https://github.com/microsoft/STL/pull/2988) * Fixed `<format>` to always print NaNs as `"nan"`, `"-nan"`, or uppercase versions as required by the Standard, never `"-nan(ind)"`. [#3001](https://github.com/microsoft/STL/pull/3001) * Fixed `ranges::shuffle` and `ranges::sample` to accept `uniform_random_bit_generator`s that don't provide `result_type`. [#3002](https://github.com/microsoft/STL/pull/3002) * Fixed `vector<bool>::insert(where, first, last)` and `vector<bool>::insert_range(where, range)` to meet the Standard's complexity requirements. [#3021](https://github.com/microsoft/STL/pull/3021) * Fixed how `chunk_view` and `stride_view` iterators validate their preconditions. [#3023](https://github.com/microsoft/STL/pull/3023) * Fixed a compiler warning emitted by the unusual scenario of `basic_string_view<char_like_struct>`. [#3032](https://github.com/microsoft/STL/pull/3032) * Fixed `move_only_function` to behave correctly when passed between DLLs. [#3038](https://github.com/microsoft/STL/pull/3038) * Fixed compiler errors when `dllexport`ing classes derived from `pair` or `tuple`. [#3045](https://github.com/microsoft/STL/pull/3045) + This fixed a regression that was introduced by [#2687](https://github.com/microsoft/STL/pull/2687) implementing [P2321R2](https://wg21.link/P2321R2)'s changes to `pair` and `tuple` in VS 2022 17.3. * Fixed `<regex>` integer overflows when parsing huge numbers in backreferences, braced repetitions, and decimal escapes. [#2169](https://github.com/microsoft/STL/pull/2169) + These will now properly throw `regex_error`s with codes of `error_backref`, `error_badbrace`, and `error_escape`, respectively. * Fixed `ranges::distance` to follow the Standard, which depicts two overloads (for sized and unsized sentinels). [#2987](https://github.com/microsoft/STL/pull/2987) * Overhauled how the STL unwraps iterators and sentinels, fixing various issues. [#3024](https://github.com/microsoft/STL/pull/3024) * `basic_string::substr()` now uses a default-constructed allocator as required by the Standard. [#3057](https://github.com/microsoft/STL/pull/3057) * Fixed CUDA compiler errors with `std::_Bit_cast` by using `__builtin_bit_cast` instead of a `memcpy` workaround. [#3066](https://github.com/microsoft/STL/pull/3066) - Improved performance: * Improved `clamp()` codegen with conditional move instructions. [#2336](https://github.com/microsoft/STL/pull/2336) * Massively improved iostreams performance for `signed char`, `unsigned char`, `char8_t`, and `byte` elements, matching the performance of `char` by avoiding a slow codepath. [#2739](https://github.com/microsoft/STL/pull/2739) * `vector`'s range constructor, `insert()`, and `assign()` now efficiently handle iterators that satisfy the `forward_iterator` concept, even when their classic `iterator_category` isn't convertible to `forward_iterator_tag`. [#1794](https://github.com/microsoft/STL/pull/1794) * Reduced the size of the lookup tables used for `<format>` grapheme clusterization, saving 2670 bytes. [#2757](https://github.com/microsoft/STL/pull/2757) * `std::filesystem::path::lexically_relative()` now avoids unnecessary memory allocations. [#1915](https://github.com/microsoft/STL/pull/1915) * Added vectorized implementations of `min_element()`, `max_element()`, `minmax_element()`, `ranges::min_element()`, `ranges::max_element()`, and `ranges::minmax_element()`, with speedups ranging from 1.5x to 26.6x (times, not percent). [#2447](https://github.com/microsoft/STL/pull/2447) [#2821](https://github.com/microsoft/STL/pull/2821) [#2825](https://github.com/microsoft/STL/pull/2825) * Reduced binary size for programs using `atomic::wait`. [#2781](https://github.com/microsoft/STL/pull/2781) * Avoided an unnecessary OS call in `thread::join()`. [#2820](https://github.com/microsoft/STL/pull/2820) * VS 2022 doesn't support targeting Windows Vista and Server 2008, but the STL still had runtime branches for those unsupported OSes. We've removed that code to improve performance, notably in `mutex::try_lock()`. [#2317](https://github.com/microsoft/STL/pull/2317) + The STL still supports targeting Windows 7 and Server 2008 R2. * Removed more unused code for Windows XP/Vista, reducing the size of the STL's DLL by 2 KB, and reducing the number of OS calls during STL startup. [#2841](https://github.com/microsoft/STL/pull/2841) * Reduced the number of OS calls in `filesystem::resize_file()` and `experimental::filesystem::resize_file()`. [#2771](https://github.com/microsoft/STL/pull/2771) * Improved the optimized codegen for `T + complex<T>`, `T * complex<T>`, `complex<T> * T`, and `complex<T> / T`. Improved the debug codegen for `complex<T> + T` and `complex<T> - T`. [#2855](https://github.com/microsoft/STL/pull/2855) * Improved the optimized codegen for `unreachable()`. [#3055](https://github.com/microsoft/STL/pull/3055) - Improved throughput: * Used `if constexpr` instead of tag dispatch in: + `get<I>()` and `get<T>()` for `pair`. [#2756](https://github.com/microsoft/STL/pull/2756) * `optional`, `pair`, and `tuple` now use conditional `explicit` instead of SFINAE in all Standard modes, for all supported compilers. [#2796](https://github.com/microsoft/STL/pull/2796) * The STL now uses "hidden friends" for all operators that are required to exist but aren't required to be namespace-scope functions (e.g. `n + vector::iterator`). This improves throughput by not polluting unqualified name lookup. [#2797](https://github.com/microsoft/STL/pull/2797) * `<charconv>`'s large lookup tables are now separately compiled, so translation units including `<charconv>` will emit significantly smaller object files. [#2125](https://github.com/microsoft/STL/pull/2125) * The STL now uses helper function templates for testing bitmask types, replacing a significant number of function overloads. [#2865](https://github.com/microsoft/STL/pull/2865) * `<unordered_map>` and `<unordered_set>` now avoid including most of `<string>`. [#2996](https://github.com/microsoft/STL/pull/2996) + This also improves throughput for `<functional>`, which internally uses `<unordered_map>` to implement `boyer_moore_searcher`. + Escape hatch: define `_SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS`. [#3027](https://github.com/microsoft/STL/pull/3027) * `<functional>` now avoids including `<memory>`. [#2998](https://github.com/microsoft/STL/pull/2998) + Escape hatch: define `_LEGACY_CODE_ASSUMES_FUNCTIONAL_INCLUDES_MEMORY`. [#3027](https://github.com/microsoft/STL/pull/3027) - Enhanced behavior: * `<tuple>` is now a [core header](https://github.com/microsoft/STL/wiki/The-Difference-Between-Core-And-Non-Core-Headers). [#2730](https://github.com/microsoft/STL/pull/2730) * The STL now supports enabling C++20 `char8_t` in C++14 and C++17 modes via [`/Zc:char8_t`](https://learn.microsoft.com/en-us/cpp/build/reference/zc-char8-t?view=msvc-170). [#2748](https://github.com/microsoft/STL/pull/2748) * `complex<NonFloating>` now emits a deprecation warning explaining that it has unspecified behavior according to the Standard. [#2759](https://github.com/microsoft/STL/pull/2759) * When `wchar_t` is a real type, the STL now avoids emitting many specializations for `unsigned short` that are intended for fake `wchar_t` only (i.e. the non-Standard `/Zc:wchar_t-` option). [#2164](https://github.com/microsoft/STL/pull/2164) * The STL now marks all of its namespace-scope `constexpr` variables as `inline` in C++17-and-later mode. [#2792](https://github.com/microsoft/STL/pull/2792) + This consistency improvement will also avoid emitting a new compiler warning that MSVC is implementing for C++20 header units: "warning C5260: the constant variable `'std::_Meow'` has internal linkage in an included header file context, but external linkage in imported header unit context; consider declaring it `'inline'` as well if it will be shared across translation units, or `'static'` to express intent to use it local to this translation unit". * `constexpr` `basic_string` now uses the Small String Optimization. [#1735](https://github.com/microsoft/STL/pull/1735) * `error_code`s with `0` values and `future_category` or `iostream_category` now return `"success"` from `message()`, matching the behavior of `generic_category`. [#2742](https://github.com/microsoft/STL/pull/2742) * `<system_error>` now maps: [#2744](https://github.com/microsoft/STL/pull/2744) [#2899](https://github.com/microsoft/STL/pull/2899) + `WAIT_TIMEOUT`, `ERROR_TIMEOUT`, and `ERROR_SEM_TIMEOUT` to `errc::timed_out` + `ERROR_BAD_NET_NAME` to `errc::no_such_file_or_directory` + `ERROR_FILENAME_EXCED_RANGE` to `errc::filename_too_long` * Added visualizers for `unique_ptr`s and `vector`s storing character sequences. [#2843](https://github.com/microsoft/STL/pull/2843) * Added more visualizers for `<any>`, `<format>`, `<functional>`, `<mutex>`, and `<ranges>`. [#2191](https://github.com/microsoft/STL/pull/2191) * `<cstdlib>` now makes its `using`-declarations for `std::getenv()` and `std::system()` available to UWP apps. [#2850](https://github.com/microsoft/STL/pull/2850) * `<filesystem>` and `<experimental/filesystem>` now use [`GetTempPath2W()`](https://learn.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-gettemppath2w) when it's available on Windows 11. [#2302](https://github.com/microsoft/STL/pull/2302) + This is a security improvement for processes running as SYSTEM; there's no behavioral change for ordinary processes. + Follow-up: Fixed linker errors involving `_Init_locks::operator=` in unusual situations. [#3011](https://github.com/microsoft/STL/pull/3011) * Added a couple of warning numbers for easier lookup: [#2061](https://github.com/microsoft/STL/pull/2061) + STL4038 warns "The contents of `<meow>` are available only with C++NN or later." + STL4039 warns "The contents of `<coroutine>` are not available with `/await`." * `<unordered_map>` and `<unordered_set>` no longer provide a non-Standard `hash_compare` class template in `namespace std`. [#2996](https://github.com/microsoft/STL/pull/2996) * Improved how STL error messages (like "Unexpected compiler version") are displayed. [#2897](https://github.com/microsoft/STL/pull/2897) * Further improved how STL warnings and errors are displayed. [#2973](https://github.com/microsoft/STL/pull/2973) * Added explanations to the STL's `[[nodiscard]]` warnings, when the compiler supports `[[nodiscard("message")]]` and the reason is more complex than the common/simple scenario of pure observers. [#2211](https://github.com/microsoft/STL/pull/2211) + For example, discarding the return value of `std::remove_if()` now emits a detailed warning message, explaining the classic erase-remove idiom, and suggesting C++20 `std::erase_if()` instead. * `vector::assign(num, val)` and `std::swap_ranges()` now have debug checks for forbidden aliasing. [#1263](https://github.com/microsoft/STL/pull/1263) * Strengthened exception specifications on: + Iterator machinery. [#1347](https://github.com/microsoft/STL/pull/1347) [#2991](https://github.com/microsoft/STL/pull/2991) + `<optional>` and the classic comparison function objects (`less<T>`, `equal_to<T>`, etc.). [#1937](https://github.com/microsoft/STL/pull/1937) [#3041](https://github.com/microsoft/STL/pull/3041) * Added support for defining `_ENFORCE_ONLY_CORE_HEADERS`, limiting STL usage to the subset of [core headers](https://github.com/microsoft/STL/wiki/The-Difference-Between-Core-And-Non-Core-Headers). [#2068](https://github.com/microsoft/STL/pull/2068) * Updated the STL's internal 128-bit integer-class types for C++14/17 compatibility, which will be useful for future performance work. [#3036](https://github.com/microsoft/STL/pull/3036) - Improved test coverage: * Enabled tests now that Clang 14 supports `<coroutine>`. [#2861](https://github.com/microsoft/STL/pull/2861) * Slightly accelerated test runs by running memory leak tests with only debug configurations (where memory leak tracking is available). [#2853](https://github.com/microsoft/STL/pull/2853) * Fixed a test that failed at runtime on ARM64. [#2864](https://github.com/microsoft/STL/pull/2864) * Added `/permissive` configurations to tests that can successfully compile in this discouraged-but-supported mode. [#3015](https://github.com/microsoft/STL/pull/3015) * Taught VSCode's Python extension where to find our test support machinery. [#3040](https://github.com/microsoft/STL/pull/3040) * Updated the `<source_location>` test for an upcoming compiler fix. [#3046](https://github.com/microsoft/STL/pull/3046) * Added test coverage for a `<string>` bug (specific to ASan annotations being enabled) that was fixed. [#3039](https://github.com/microsoft/STL/pull/3039) - Code cleanups: * Removed compiler bug workarounds. [#2791](https://github.com/microsoft/STL/pull/2791) [#2861](https://github.com/microsoft/STL/pull/2861) * Various cleanups (described in detail in the PRs, not repeated here). [#2798](https://github.com/microsoft/STL/pull/2798) [#2801](https://github.com/microsoft/STL/pull/2801) [#2802](https://github.com/microsoft/STL/pull/2802) [#2815](https://github.com/microsoft/STL/pull/2815) [#2766](https://github.com/microsoft/STL/pull/2766) [#2828](https://github.com/microsoft/STL/pull/2828) [#2863](https://github.com/microsoft/STL/pull/2863) [#2950](https://github.com/microsoft/STL/pull/2950) [#3019](https://github.com/microsoft/STL/pull/3019) * Removed visualizers for VS 2013's binary-incompatible representations of various data structures. [#2804](https://github.com/microsoft/STL/pull/2804) * Simplified `tuple_cat()`'s implementation. [#2833](https://github.com/microsoft/STL/pull/2833) * Improved how `<system_error>` maps Windows error codes to `errc` values. [#2837](https://github.com/microsoft/STL/pull/2837) * Refactored `<atomic>` to share code with C11 atomics (work in progress). [#2846](https://github.com/microsoft/STL/pull/2846) * Updated most files (with limited exceptions) to consistently include the `<cmeow>` wrapper headers instead of the `<meow.h>` CRT headers. [#2852](https://github.com/microsoft/STL/pull/2852) * Simplified `<random>`'s `static constexpr` data members. [#3006](https://github.com/microsoft/STL/pull/3006) * Finished changing all aliases from `typedef` to `using`. [#3018](https://github.com/microsoft/STL/pull/3018) * Cleaned up several tests to avoid unnecessary dependencies on macros and non-Standard code. [#3034](https://github.com/microsoft/STL/pull/3034) * Updated `<functional>` and `<memory>` to consistently use modern `int = 0` SFINAE. [#2124](https://github.com/microsoft/STL/pull/2124) * Cleaned up feature-test macro usage to be simpler and more consistent. [#3053](https://github.com/microsoft/STL/pull/3053) - Improved documentation: * Added a comment explaining why `basic_string` doesn't use templated `static constexpr` data members as internal helpers. [#2980](https://github.com/microsoft/STL/pull/2980) - Infrastructure improvements: * Eliminated duplicate builds of the "alias objects". [#2743](https://github.com/microsoft/STL/pull/2743) * Fixed distributed test runs to split up the test suite deterministically, avoiding missed or repeated tests. [#2795](https://github.com/microsoft/STL/pull/2795) * Properly applied `/analyze` to PR/CI builds, and fixed warnings in the STL's separately compiled sources. [#2812](https://github.com/microsoft/STL/pull/2812) * Fixed cross-PR/CI contamination by cleaning both before and after checkout. [#2832](https://github.com/microsoft/STL/pull/2832) * Fixed cross-PR/CI contamination by ignoring submodules during code format validation. [#3033](https://github.com/microsoft/STL/pull/3033) * Added support for writing benchmarks with [google/benchmark](https://github.com/google/benchmark). [#2780](https://github.com/microsoft/STL/pull/2780) * The PR/CI system now uses "1ES Hosted Pools". [#3054](https://github.com/microsoft/STL/pull/3054) * Updated dependencies. [#2754](https://github.com/microsoft/STL/pull/2754) [#2791](https://github.com/microsoft/STL/pull/2791) [#2831](https://github.com/microsoft/STL/pull/2831) [#2861](https://github.com/microsoft/STL/pull/2861) [#3017](https://github.com/microsoft/STL/pull/3017) + Updated build compiler to VS 2022 17.4 Preview 1 (now required). + Updated Clang to 14.0.5 (now required). + Updated CMake to 3.23 (now required). + Updated Ninja to 1.11.0. + Updated Python to 3.10.6. + Updated CUDA to 11.6.0 (now required). - Updated `_MSVC_STL_UPDATE`. [#2764](https://github.com/microsoft/STL/pull/2764) [#2840](https://github.com/microsoft/STL/pull/2840) [#3020](https://github.com/microsoft/STL/pull/3020)

vs-2022-17.3

VS 2022 17.3 - Merged C++23 features: * [P0323R12](https://wg21.link/P0323R12) [#2643](https://github.com/microsoft/STL/pull/2643) `<expected>` + [P2549R1](https://wg21.link/P2549R1) [#2643](https://github.com/microsoft/STL/pull/2643) [#3075](https://github.com/microsoft/STL/pull/3075) `unexpected<E>::error()` * [P1413R3](https://wg21.link/P1413R3) [#2583](https://github.com/microsoft/STL/pull/2583) Deprecate `aligned_storage` And `aligned_union` * [P2273R3](https://wg21.link/P2273R3) [#2582](https://github.com/microsoft/STL/pull/2582) `constexpr` `unique_ptr` * [P2442R1](https://wg21.link/P2442R1) [#2670](https://github.com/microsoft/STL/pull/2670) [#2685](https://github.com/microsoft/STL/pull/2685) Windowing Range Adaptors: `views::chunk`, `views::slide` * [P2443R1](https://wg21.link/P2443R1) [#2565](https://github.com/microsoft/STL/pull/2565) `views::chunk_by` - Merged *partial* C++23 features: * [P2321R2](https://wg21.link/P2321R2) `zip`: + Changes to `tuple`, `pair`, and `vector<bool>::reference`. [#2687](https://github.com/microsoft/STL/pull/2687) - Merged LWG issue resolutions: * [LWG-3121](https://wg21.link/lwg3121) [#2640](https://github.com/microsoft/STL/pull/2640) `tuple` constructor constraints for `UTypes&&...` overloads * [LWG-3525](https://wg21.link/lwg3525) [#2639](https://github.com/microsoft/STL/pull/2639) `uses_allocator_construction_args` fails to handle types convertible to `pair` * [LWG-3570](https://wg21.link/lwg3570) [#2418](https://github.com/microsoft/STL/pull/2418) `basic_osyncstream::emit` should be an unformatted output function * [LWG-3571](https://wg21.link/lwg3571) [#2418](https://github.com/microsoft/STL/pull/2418) `flush_emit` should set `badbit` if the `emit` call fails - Merged *proposed* resolutions for LWG issues (not yet accepted for the C++ Working Draft, but we've chosen to implement this speculatively): * [LWG-3234](https://wg21.link/lwg3234) [#2703](https://github.com/microsoft/STL/pull/2703) Sufficient Additional Special Math Overloads * [LWG-3627](https://wg21.link/lwg3627) [#2607](https://github.com/microsoft/STL/pull/2607) Inconsistent specifications for `std::make_optional` overloads - Fixed bugs: * Fixed `vector<bool>` to properly invalidate iterators during reallocation, which fixes compiler errors with `constexpr` usage of `vector<bool>`. [#2441](https://github.com/microsoft/STL/pull/2441) * `empty_view` rvalues are now considered `borrowed_range`s as required by the Standard. [#2576](https://github.com/microsoft/STL/pull/2576) * Added compiler bug workarounds to `is_convertible` and `common_reference`, so `contiguous_iterator<const volatile int*>` is now `true`. [#2592](https://github.com/microsoft/STL/pull/2592) * Added missing constraints to functions that were implied by "*Effects:* Equivalent to" Standardese: `make_any()`, `make_optional()`, `shared_ptr::operator=()`, `shared_ptr::reset()`, and `weak_ptr::operator=()`. * Fixed `filesystem::path`'s comparison operators and some other member functions being IF-NDR (ill-formed, no diagnostic required) in C++23 mode. [#2457](https://github.com/microsoft/STL/pull/2457) + This fixed a regression that was introduced by [#2000](https://github.com/microsoft/STL/pull/2000) implementing [P1989R2](https://wg21.link/P1989R2) Range Constructor For `string_view` in VS 2022 17.0. * Fixed C++20 `<chrono>` parsing to fail when the input is insufficient to supply the entire format string. [#2523](https://github.com/microsoft/STL/pull/2523) + For example, the input `"23:59"` is insufficient for the format string `"%H:%M:%S"`. * Fixed an out-of-bounds read in `ranges::find()` with `unreachable_sentinel`. [#2434](https://github.com/microsoft/STL/pull/2434) * Added compiler bug workarounds for CUDA (involving `[[nodiscard]] friend`) to fix spurious cases of "warning C5240: 'nodiscard': attribute is ignored in this syntactic position". [#2622](https://github.com/microsoft/STL/pull/2622) * Removed `ExecutionPolicy` overloads of `copy_backward()` and `move_backward()` that were mistakenly implemented. They don't appear in the Standard because they would be useless. [#2627](https://github.com/microsoft/STL/pull/2627) * Added compiler bug workarounds for Clang (involving the ordering of constrained and unconstrained destructors) to fix compiler errors in `<ranges>` machinery. [#2630](https://github.com/microsoft/STL/pull/2630) * Fixed a bug affecting `<future>`'s use of `<ppltasks.h>` in Desktop XAML apps. [#2654](https://github.com/microsoft/STL/pull/2654) * Fixed a bug that prevented C++20 `<chrono>` from parsing fractional seconds as floating-point `duration`s. [#2638](https://github.com/microsoft/STL/pull/2638) * Fixed `<bit>`'s `countl_zero()` returning incorrect results on ARM64 for 8-bit and 16-bit types. [#2647](https://github.com/microsoft/STL/pull/2647) * Added macroization guards to the STL's usage of compiler-specific custom attributes. [#2649](https://github.com/microsoft/STL/pull/2649) * Fixed `get_time()` and `time_get`'s 2-digit year logic. [#2666](https://github.com/microsoft/STL/pull/2666) * Fixed `system_category().message()` to behave correctly instead of returning `"???"` when the user language and system language are different. [#2669](https://github.com/microsoft/STL/pull/2669) * Fixed the ARM64EC implementations of `atomic_thread_fence()` and `atomic<8-byte type>::store()`. [#2702](https://github.com/microsoft/STL/pull/2702) * Fixed compiler errors in `atomic<shared_ptr<T[]>>`, `atomic<shared_ptr<T[N]>>`, `atomic<weak_ptr<T[]>>`, and `atomic<weak_ptr<T[N]>>`. [#1339](https://github.com/microsoft/STL/pull/1339) * Added overloads of `<cmath>`'s `lerp()` for arithmetic types. [#2113](https://github.com/microsoft/STL/pull/2113) * Fixed `filesystem::directory_entry` to work with FAT32 and exFAT. [#2373](https://github.com/microsoft/STL/pull/2373) * `<filesystem>` now handles special system files like `hiberfil.sys`. [#2715](https://github.com/microsoft/STL/pull/2715) * `filesystem::copy_file()` now tolerates other processes having opened the source file or the target file for reading or writing (as much as possible, depending on the choice of `copy_options`). [#2718](https://github.com/microsoft/STL/pull/2718) * Fixed the visualizers for `shared_ptr<void>`, `weak_ptr<void>`, and `unique_ptr<void, Deleter>`. [#2706](https://github.com/microsoft/STL/pull/2706) * Fixed compiler errors in `move_only_function` when compiling `<functional>` in `/std:c++latest` mode with `/Zc:alignedNew-`. [#2712](https://github.com/microsoft/STL/pull/2712) * Implemented C++20's removal of the explicit specialization for `allocator<void>`. [#2726](https://github.com/microsoft/STL/pull/2726) + Note that `allocator<void>` is still supported, it just uses the primary template now. * Fixed "unresolved external symbol" linker errors in certain scenarios involving separately compiled third-party libraries. [#2734](https://github.com/microsoft/STL/pull/2734) [#2738](https://github.com/microsoft/STL/pull/2738) + On x64, these errors mentioned `__imp___std_init_once_begin_initialize` and `__imp___std_init_once_complete`. + On x86, these errors mentioned `__imp____std_init_once_begin_initialize@16` and `__imp____std_init_once_complete@12`. + This fixed a regression that was introduced by [#2381](https://github.com/microsoft/STL/pull/2381) in VS 2022 17.2. + This fix was backported to VS 2022 17.2.5. - Improved performance: * Optimized `rotl()` and `rotr()` in `<bit>` for 8-bit and 16-bit integers by using compiler intrinsics. [#2611](https://github.com/microsoft/STL/pull/2611) * Optimized the vectorized implementation of `reverse()` for 32-bit trivial types. [#2383](https://github.com/microsoft/STL/pull/2383) * Improved `<format>` performance when the execution character set isn't self-synchronizing, by caching expensive calls to get codepage info. [#2600](https://github.com/microsoft/STL/pull/2600) * Added vectorized implementations of `find()`, `count()`, `ranges::find()`, and `ranges::count()`, with speedups ranging from 2.0x to 27.6x (times, not percent). [#2434](https://github.com/microsoft/STL/pull/2434) * Slightly improved the performance of `<charconv>` floating-point `from_chars()`. [#2623](https://github.com/microsoft/STL/pull/2623) - Improved throughput: * Used `if constexpr` instead of tag dispatch, overloads, or specializations in: + `is_permutation()`, `sample()`, `rethrow_if_nested()`, and `default_searcher`. [#2219](https://github.com/microsoft/STL/pull/2219) + `<map>` and `<set>`'s common machinery. [#2287](https://github.com/microsoft/STL/pull/2287) + `polymorphic_allocator`. [#2471](https://github.com/microsoft/STL/pull/2471) + `basic_string_view` and `basic_string`'s `find_first_of()`, `find_last_of()`, `find_first_not_of()`, and `find_last_not_of()`. [#2479](https://github.com/microsoft/STL/pull/2479) [#2660](https://github.com/microsoft/STL/pull/2660) + `<regex>`. [#2484](https://github.com/microsoft/STL/pull/2484) + Parallel `inclusive_scan()` and `transform_inclusive_scan()`. [#2662](https://github.com/microsoft/STL/pull/2662) + `scoped_allocator_adaptor`'s `operator==()`. [#2677](https://github.com/microsoft/STL/pull/2677) + `function`, `move_only_function`, and `bind()`. [#2668](https://github.com/microsoft/STL/pull/2668) + `vector<bool>::insert()`. [#2694](https://github.com/microsoft/STL/pull/2694) * Replaced tag dispatch with SFINAE in `subtract_with_carry_engine`'s internal machinery. [#2693](https://github.com/microsoft/STL/pull/2693) * Split `<chrono>` into a smaller internal header, improving throughput when other headers need only pre-C++20 `<chrono>` machinery. [#2604](https://github.com/microsoft/STL/pull/2604) - Enhanced behavior: * Changed `<deque>` to use scope guards instead of `throw;`, making debugging easier when exceptions are thrown. [#2308](https://github.com/microsoft/STL/pull/2308) * Merged an MSVC-specific attribute, allowing the compiler to improve its handling of `constexpr` dynamic allocation and `constexpr unique_ptr`. [#2658](https://github.com/microsoft/STL/pull/2658) * Implemented `<format>` grapheme clusterization when determining the width of a string for padding and alignment purposes. This is a "quality of implementation" feature recommended by [N4910](https://wg21.link/N4910) `[format.string.std]/11`. [#2119](https://github.com/microsoft/STL/pull/2119) * Changed `<strstream>` to deprecate its classes instead of the entire header. [#2680](https://github.com/microsoft/STL/pull/2680) * C++98's `unexpected()` in `<exception>` was removed by C++17. As with almost all removals, we support an escape hatch to restore `unexpected()`, by defining `_HAS_UNEXPECTED` to `1`. However, this escape hatch conflicts with C++23, which is reusing the identifier for `unexpected<E>` in `<expected>`. Therefore, the escape hatch is now blocked with an `#error` in C++23 mode. [#2709](https://github.com/microsoft/STL/pull/2709) * Added ASan (Address Sanitizer) annotations to `<string>`, allowing additional errors to be detected. [#2196](https://github.com/microsoft/STL/pull/2196) * `<ciso646>` now emits a warning in C++20 mode, as it was removed in that Standard. [#2710](https://github.com/microsoft/STL/pull/2710) * Temporarily disabled `join_view` for non-`forward_range`s until [LWG-3698](https://wg21.link/lwg3698) is resolved. [#2727](https://github.com/microsoft/STL/pull/2727) * `<random>` distributions now have non-`const` function call operators, making it easier to write portable code. [#2732](https://github.com/microsoft/STL/pull/2732) - Improved documentation: * Added comments to the test suite citing GitHub issues and LWG issues. [#2433](https://github.com/microsoft/STL/pull/2433) * Expanded a comment about the build system's use of `/Os`. [#2708](https://github.com/microsoft/STL/pull/2708) - Improved test coverage: * Dramatically improved the compiler memory consumption and compile time of two `ranges` algorithm tests. [#2657](https://github.com/microsoft/STL/pull/2657) * Removed `/Za` test coverage. [#2714](https://github.com/microsoft/STL/pull/2714) + `/Za` is ["not recommended"](https://learn.microsoft.com/en-us/cpp/build/reference/za-ze-disable-language-extensions?view=msvc-170) and has been superseded by `/permissive-`. - Code cleanups: * Removed compiler bug workarounds. [#2611](https://github.com/microsoft/STL/pull/2611) * Various cleanups (described in detail in the PRs, not repeated here). [#2595](https://github.com/microsoft/STL/pull/2595) [#2621](https://github.com/microsoft/STL/pull/2621) [#2656](https://github.com/microsoft/STL/pull/2656) [#2673](https://github.com/microsoft/STL/pull/2673) [#2674](https://github.com/microsoft/STL/pull/2674) [#2675](https://github.com/microsoft/STL/pull/2675) [#2676](https://github.com/microsoft/STL/pull/2676) [#2678](https://github.com/microsoft/STL/pull/2678) [#2679](https://github.com/microsoft/STL/pull/2679) [#2686](https://github.com/microsoft/STL/pull/2686) * Simplified the preprocessor logic in `<stdatomic.h>` for non-compiler tools. [#2615](https://github.com/microsoft/STL/pull/2615) * Removed test workarounds now that VCRuntime properly recognizes Clang's `/std:c++20` and `/std:c++latest` modes. [#2637](https://github.com/microsoft/STL/pull/2637) - Infrastructure improvements: * Fixed the build system to avoid relinking any DLLs when rerunning CMake and Ninja with no other changes. [#2606](https://github.com/microsoft/STL/pull/2606) * Added `format` and `validate` targets to CMake, so it can run clang-format in parallel, and improved how Azure Pipelines runs the Code Format Validation check. [#2671](https://github.com/microsoft/STL/pull/2671) [#2697](https://github.com/microsoft/STL/pull/2697) * Updated dependencies. [#2611](https://github.com/microsoft/STL/pull/2611) [#2651](https://github.com/microsoft/STL/pull/2651) [#2714](https://github.com/microsoft/STL/pull/2714) + Updated build compiler to VS 2022 17.3 Preview 1 (17.2 is now required). + Updated to Windows 11 SDK 22000. This is now required for building and testing the STL, but not for using it. [#2729](https://github.com/microsoft/STL/pull/2729) + Updated Python to 3.10.4. - Updated `_MSVC_STL_UPDATE`. [#2634](https://github.com/microsoft/STL/pull/2634) [#2696](https://github.com/microsoft/STL/pull/2696)

vs-2022-17.2

VS 2022 17.2 - Merged C++20 Defect Reports: * [P2216R3](https://wg21.link/P2216R3) [#2221](https://github.com/microsoft/STL/pull/2221) `std::format` Improvements * [P2418R2](https://wg21.link/P2418R2) [#2323](https://github.com/microsoft/STL/pull/2323) Add Support For `std::generator`-like Types To `std::format` * With a final bit of work to implement an `integer-class` type (per [P1522R1](https://wg21.link/p1522r1)) for `iota_view`, declare `<ranges>` and `<format>` stable and make them fully available under `/std:c++20`. [#2518](https://github.com/microsoft/STL/pull/2518) - Merged C++23 features: * [P0288R9](https://wg21.link/P0288R9) [#2267](https://github.com/microsoft/STL/pull/2267) [#2429](https://github.com/microsoft/STL/pull/2429) `move_only_function` * [P0627R6](https://wg21.link/P0627R6) [#2526](https://github.com/microsoft/STL/pull/2526) `unreachable()` * [P0798R8](https://wg21.link/P0798R8) [#2301](https://github.com/microsoft/STL/pull/2301) Monadic Operations For `optional` * [P2077R3](https://wg21.link/P2077R3) [#2350](https://github.com/microsoft/STL/pull/2350) Heterogeneous Erasure Overloads For Associative Containers * [P2393R1](https://wg21.link/P2393R1) [#2541](https://github.com/microsoft/STL/pull/2541) Cleaning Up Integer-Class Types - Merged LWG issue resolutions: * [LWG-2762](https://wg21.link/lwg2762) [#2376](https://github.com/microsoft/STL/pull/2376) `unique_ptr` `operator*()` should be `noexcept` * [LWG-2774](https://wg21.link/lwg2774) [#2098](https://github.com/microsoft/STL/pull/2098) `std::function` construction vs assignment * [LWG-3146](https://wg21.link/lwg3146) [#2409](https://github.com/microsoft/STL/pull/2409) Excessive unwrapping in `std::ref`/`cref` * [LWG-3392](https://wg21.link/lwg3392) [#2421](https://github.com/microsoft/STL/pull/2421) `ranges::distance()` cannot be used on a move-only iterator with a sized sentinel * [LWG-3470](https://wg21.link/lwg3470) [#2414](https://github.com/microsoft/STL/pull/2414) *`convertible-to-non-slicing`* seems to reject valid case * [LWG-3471](https://wg21.link/lwg3471) [#2567](https://github.com/microsoft/STL/pull/2567) `polymorphic_allocator::allocate` does not satisfy *Cpp17Allocator* requirements * [LWG-3480](https://wg21.link/lwg3480) [#2340](https://github.com/microsoft/STL/pull/2340) `directory_iterator` and `recursive_directory_iterator` are not C++20 ranges * [LWG-3519](https://wg21.link/lwg3519) [#2208](https://github.com/microsoft/STL/pull/2208) Incomplete synopses for `<random>` classes * [LWG-3543](https://wg21.link/lwg3543) [#2424](https://github.com/microsoft/STL/pull/2424) Definition of when `counted_iterator`s refer to the same sequence isn't quite right * [LWG-3557](https://wg21.link/lwg3557) [#2406](https://github.com/microsoft/STL/pull/2406) The `static_cast` expression in `convertible_to` has the wrong operand * [LWG-3563](https://wg21.link/lwg3563) [#2426](https://github.com/microsoft/STL/pull/2426) `keys_view` example is broken * [LWG-3574](https://wg21.link/lwg3574) [#2410](https://github.com/microsoft/STL/pull/2410) `common_iterator` should be completely `constexpr`-able * [LWG-3580](https://wg21.link/lwg3580) [#2417](https://github.com/microsoft/STL/pull/2417) `iota_view`'s `iterator`'s binary `operator+` should be improved * [LWG-3589](https://wg21.link/lwg3589) [#2425](https://github.com/microsoft/STL/pull/2425) The `const` lvalue reference overload of `get` for `subrange` does not constrain `I` to be `copyable` when `N == 0` * [LWG-3590](https://wg21.link/lwg3590) [#2404](https://github.com/microsoft/STL/pull/2404) `split_view::base() const &` is overconstrained * [LWG-3591](https://wg21.link/lwg3591) [#2411](https://github.com/microsoft/STL/pull/2411) `lazy_split_view<input_view>::`*`inner-iterator`*`::base() &&` invalidates outer iterators * [LWG-3592](https://wg21.link/lwg3592) [#2411](https://github.com/microsoft/STL/pull/2411) `lazy_split_view` needs to check the simpleness of `Pattern` * [LWG-3593](https://wg21.link/lwg3593) [#2448](https://github.com/microsoft/STL/pull/2448) Several iterators' `base() const &` and `lazy_split_view::`*`outer-iterator`*`::value_type::end()` missing `noexcept` * [LWG-3595](https://wg21.link/lwg3595) [#2410](https://github.com/microsoft/STL/pull/2410) Exposition-only classes *`proxy`* and *`postfix-proxy`* for `common_iterator` should be fully `constexpr` * [LWG-3598](https://wg21.link/lwg3598) [#2560](https://github.com/microsoft/STL/pull/2560) `system_category().default_error_condition(0)` is underspecified * [LWG-3610](https://wg21.link/lwg3610) [#2542](https://github.com/microsoft/STL/pull/2542) `iota_view::size` sometimes rejects integer-class types * [LWG-3612](https://wg21.link/lwg3612) [#2586](https://github.com/microsoft/STL/pull/2586) Inconsistent pointer alignment in `std::format` * [LWG-3618](https://wg21.link/lwg3618) [#2566](https://github.com/microsoft/STL/pull/2566) Unnecessary `iter_move` for `transform_view::iterator` * [LWG-3621](https://wg21.link/lwg3621) [#2543](https://github.com/microsoft/STL/pull/2543) Remove feature-test macro `__cpp_lib_monadic_optional` * [LWG-3648](https://wg21.link/lwg3648) [#2587](https://github.com/microsoft/STL/pull/2587) `format` should not print `bool` with `'c'` * [LWG-3654](https://wg21.link/lwg3654) [#2528](https://github.com/microsoft/STL/pull/2528) `basic_format_context::arg(size_t)` should be `noexcept` * [LWG-3657](https://wg21.link/lwg3657) [#2564](https://github.com/microsoft/STL/pull/2564) `std::hash<std::filesystem::path>` is not enabled * [LWG-3660](https://wg21.link/lwg3660) [#2549](https://github.com/microsoft/STL/pull/2549) `iterator_traits<common_iterator>::pointer` should conform to `[iterator.traits]` * [LWG-3661](https://wg21.link/lwg3661) [#2544](https://github.com/microsoft/STL/pull/2544) `constinit atomic<shared_ptr<T>> a(nullptr);` should work - Merged *proposed* resolutions for LWG issues (not yet accepted for the C++ Working Draft, but we've chosen to implement this speculatively): * [LWG-3636](https://wg21.link/lwg3636) [#2573](https://github.com/microsoft/STL/pull/2573) `formatter<T>::format` should be `const`-qualified - Fixed bugs: * Fixed Clang compiler errors when using `ranges::join_view`. [#2352](https://github.com/microsoft/STL/pull/2352) * Fixed several runtime correctness bugs in `std::string`. [#2305](https://github.com/microsoft/STL/pull/2305) * Fixed a memory leak affecting a specific scenario in [P0408R7](https://wg21.link/P0408R7) Efficient Access To `basic_stringbuf`'s Buffer. [#2361](https://github.com/microsoft/STL/pull/2361) * Each call to `ranges::clamp` now correctly performs at most three projections. [#1898](https://github.com/microsoft/STL/pull/1898) * The STL no longer rejects Clang in CUDA mode, nor the `cl /showIncludes /D__CUDACC__ ...` command used by CUDA's msbuild integration to gather dependencies. [#2075](https://github.com/microsoft/STL/pull/2075) * Fixed `allocator::is_always_equal` to be deprecated, not removed, in C++20 mode. (It was deprecated by [LWG-3170](https://wg21.link/lwg3170).) [#2423](https://github.com/microsoft/STL/pull/2423) * Fixed `begin()`/`end()` crashing for empty `valarray`s, which also affected range-based for-loops. [#2435](https://github.com/microsoft/STL/pull/2435) * Fixed regression in `ranges::distance` (from [LWG-3392](https://wg21.link/lwg3392) which broke `ranges::distance(some_array, s)`) by speculatively implementing [LWG-3664](https://wg21.link/lwg3664). [#2522](https://github.com/microsoft/STL/pull/2522) * Fixed `basic_string::resize_and_overwrite()` to no longer emit "warning C4018: signed/unsigned mismatch" when given certain user-defined function objects. [#2525](https://github.com/microsoft/STL/pull/2525) * Increased `__cpp_lib_concepts` to its final value for C++20, `202002L`. [#2559](https://github.com/microsoft/STL/pull/2559) + It should have been updated in VS 2019 16.6 when [P1964R2](https://wg21.link/P1964R2) "Replacing `boolean` With _`boolean-testable`_" was implemented by [#565](https://github.com/microsoft/STL/pull/565). The presence of that release (or any later release) can be detected by inspecting our implementation-specific macro [`_MSVC_STL_UPDATE`](https://github.com/microsoft/STL/wiki/Macro-_MSVC_STL_UPDATE). Coincidentally, the value of `_MSVC_STL_UPDATE` for VS 2019 16.6 was also `202002L`. * Fixed numerous tiny bugs discovered by the `libcxx` test suite. [#2499](https://github.com/microsoft/STL/pull/2499) * Fixed a bug in `<format>` that sporadically caused incorrect output when formatting floating-point values in `hex` or `scientific` notation with extremely large precisions. [#2569](https://github.com/microsoft/STL/pull/2569) * Fixed a bug in `<charconv>` `from_chars()` `float` tiebreaking that produced incorrect results. This affected decimal strings that were at the exact midpoint of consecutive `float` values, within a narrow range (the smallest and largest affected values were `"32768.009765625"` and `"131071.98828125"`), where the tiebreaker rule wanted to round to "even" and "even" happened to be "down", but the implementation incorrectly rounded "up". (`double` was unaffected.) [#2366](https://github.com/microsoft/STL/pull/2366) * `promise<T>` now compiles when `!is_default_constructible_v<T>`. [#2568](https://github.com/microsoft/STL/pull/2568) * Moving from an `optional<const T>` now behaves like moving from a `const T`: it selects `T`'s copy constructor. [#2460](https://github.com/microsoft/STL/pull/2460) * Fixed a bug in `<format>` that incorrectly accepted `volatile` arguments; the Standard currently says that they should be rejected. [#2579](https://github.com/microsoft/STL/pull/2579) - Improved performance: * Optimized `rotl()` and `rotr()` in `<bit>` for 32-bit and 64-bit integers by using compiler intrinsics. [#2369](https://github.com/microsoft/STL/pull/2369) * `reverse_copy()`'s vectorized implementation is now activated (for eligible types) in all Standard modes. Previously, only the C++14/17 modes activated this optimization; C++20/23 modes unintentionally used the plain implementation (correct but slower). [#2416](https://github.com/microsoft/STL/pull/2416) * Improved codegen for `gcd()` and `lcm()`. [#2343](https://github.com/microsoft/STL/pull/2343) * Improved `<format>` performance when the execution character set is self-synchronizing. For example, code page 1252 "ANSI Latin 1; Western European (Windows)" activates this optimization. The `/utf-8` compiler option also activates this optimization. [#2493](https://github.com/microsoft/STL/pull/2493) * Improved codegen for `generate_canonical`. [#2498](https://github.com/microsoft/STL/pull/2498) - Improved throughput: * Used `if constexpr` instead of tag dispatch in: + Optimizations in `find()`. [#2380](https://github.com/microsoft/STL/pull/2380) + `experimental::filesystem::directory_iterator`. [#2478](https://github.com/microsoft/STL/pull/2478) + `basic_string(first, last)`. [#2480](https://github.com/microsoft/STL/pull/2480) - Enhanced behavior: * Fixed new warnings emitted by Clang 13: `-Wdeprecated-copy` (in product and test code) and `-Wunused-but-set-variable` (in test code only). [#2266](https://github.com/microsoft/STL/pull/2266) * Added ASan (Address Sanitizer) annotations to `<vector>`, allowing additional errors to be detected. [#2071](https://github.com/microsoft/STL/pull/2071) [#2420](https://github.com/microsoft/STL/pull/2420) [#2464](https://github.com/microsoft/STL/pull/2464) [#2508](https://github.com/microsoft/STL/pull/2508) * Added a debug assertion to `allocator::deallocate()`; passing a null pointer with a non-zero size is an error. [#2412](https://github.com/microsoft/STL/pull/2412) * For supply chain security, replaced checked-in OBJ files (generated by an internal tool `aliasobj`) with the linker's `/ALTERNATENAME` option (which is strictly more reproducible, although not officially documented). [#2381](https://github.com/microsoft/STL/pull/2381) + In certain scenarios involving separately compiled third-party libraries, this can cause "unresolved external symbol" linker errors. See issue [#2655](https://github.com/microsoft/STL/issues/2655) for an explanation and workarounds. - Improved documentation: * Clarified the messages emitted by `<format>` and `<ranges>`. [#2382](https://github.com/microsoft/STL/pull/2382) * Added a comment explaining how [LWG-3632](https://wg21.link/lwg3632) "`unique_ptr` '*Mandates:* This constructor is not selected by class template argument deduction'" was already implemented. [#2548](https://github.com/microsoft/STL/pull/2548) - Improved test coverage: * Added test cases for the `_BitScanForward` optimization used by `countr_zero()` on older CPUs. [#2337](https://github.com/microsoft/STL/pull/2337) * Added tests for `gcd()` and `lcm()`. [#2507](https://github.com/microsoft/STL/pull/2507) * Added test coverage for deduplicated (topologically sorted) header units. [#2516](https://github.com/microsoft/STL/pull/2516) [#2563](https://github.com/microsoft/STL/pull/2563) * Updated the `libcxx` test suite. [#2499](https://github.com/microsoft/STL/pull/2499) - Code cleanups: * Removed compiler bug workarounds. [#2338](https://github.com/microsoft/STL/pull/2338) [#2351](https://github.com/microsoft/STL/pull/2351) [#2357](https://github.com/microsoft/STL/pull/2357) [#2474](https://github.com/microsoft/STL/pull/2474) [#2496](https://github.com/microsoft/STL/pull/2496) * Updated test code to directly pass a format string to `printf()`, allowing the compiler to check it. [#2346](https://github.com/microsoft/STL/pull/2346) * Cleaned up clang-formatting. [#2356](https://github.com/microsoft/STL/pull/2356) * Changed the `<charconv>` test headers to use include guards, for closer alignment with libc++. [#2372](https://github.com/microsoft/STL/pull/2372) * Improved the clarity of vectorized algorithm implementations by replacing the magic numbers `27` and `78`. [#2377](https://github.com/microsoft/STL/pull/2377) * Improved consistency by always saying `friend constexpr` instead of the reverse order. [#2419](https://github.com/microsoft/STL/pull/2419) * Simplified `<ratio>`'s implementation by using `constexpr` functions instead of template metaprogramming. [#2450](https://github.com/microsoft/STL/pull/2450) * Simplified an internal function for opening files. [#2095](https://github.com/microsoft/STL/pull/2095) - Infrastructure improvements: * Updated dependencies. [#2474](https://github.com/microsoft/STL/pull/2474) [#2496](https://github.com/microsoft/STL/pull/2496) [#2514](https://github.com/microsoft/STL/pull/2514) + Updated build compiler to VS 2022 17.1 Preview 5 (now required). + Updated Clang to 13.0.0 (now required). + Updated CMake to 3.22 (now required). + Updated Python to 3.10.2. * Added scripts to set `INCLUDE`, `LIB`, and `PATH` after building the repo. [#2578](https://github.com/microsoft/STL/pull/2578) * Azure Pipelines now uploads test logs as artifacts, making it easier to investigate test failures when lengthy command lines, compiler output, or runtime output are truncated in the web UI. [#2575](https://github.com/microsoft/STL/pull/2575) - Updated `_MSVC_STL_UPDATE`. [#2374](https://github.com/microsoft/STL/pull/2374) [#2455](https://github.com/microsoft/STL/pull/2455) [#2519](https://github.com/microsoft/STL/pull/2519) [#2602](https://github.com/microsoft/STL/pull/2602)

vs-2022-17.1

VS 2022 17.1 - Merged C++20 Defect Reports: * [P2210R2](https://wg21.link/P2210R2) [#2042](https://github.com/microsoft/STL/pull/2042) Superior String Splitting * [P2231R1](https://wg21.link/P2231R1) [#2005](https://github.com/microsoft/STL/pull/2005) Completing `constexpr` In `optional` And `variant` * [P2281R1](https://wg21.link/P2281R1) [#2197](https://github.com/microsoft/STL/pull/2197) Clarifying Range Adaptor Objects * [P2372R3](https://wg21.link/P2372R3) [#2273](https://github.com/microsoft/STL/pull/2273) Fixing Locale Handling In `chrono` Formatters * [P2415R2](https://wg21.link/P2415R2) [#2275](https://github.com/microsoft/STL/pull/2275) What Is A `view`? * [P2432R1](https://wg21.link/P2432R1) [#2245](https://github.com/microsoft/STL/pull/2245) Fix `istream_view` - Merged C++23 features: * [P0448R4](https://wg21.link/P0448R4) [#2029](https://github.com/microsoft/STL/pull/2029) `<spanstream>` * [P0943R6](https://wg21.link/P0943R6) [#2008](https://github.com/microsoft/STL/pull/2008) Supporting C Atomics In C++ + *Note:* `<stdatomic.h>` is currently supported when compiling as C++ (`/std:c++latest`). It is not yet supported when compiling as C (`/std:c11` and `/std:c17`), but support for C atomics is planned for a future release. For more info, see the September 2020 blog post ["C11 and C17 Standard Support Arriving in MSVC"](https://devblogs.microsoft.com/cppblog/c11-and-c17-standard-support-arriving-in-msvc/). * [P1072R10](https://wg21.link/P1072R10) [#2258](https://github.com/microsoft/STL/pull/2258) `basic_string::resize_and_overwrite` * [P1147R1](https://wg21.link/P1147R1) [#2262](https://github.com/microsoft/STL/pull/2262) Printing `volatile` Pointers * [P1272R4](https://wg21.link/P1272R4) [#2235](https://github.com/microsoft/STL/pull/2235) `byteswap()` * [P1425R4](https://wg21.link/P1425R4) [#1994](https://github.com/microsoft/STL/pull/1994) Iterator Pair Constructors For `stack` And `queue` * [P1518R2](https://wg21.link/P1518R2) [#2032](https://github.com/microsoft/STL/pull/2032) Stop Overconstraining Allocators In Container Deduction Guides * [P1659R3](https://wg21.link/P1659R3) [#1997](https://github.com/microsoft/STL/pull/1997) `ranges::starts_with`, `ranges::ends_with` * [P2136R3](https://wg21.link/P2136R3) [#2019](https://github.com/microsoft/STL/pull/2019) `invoke_r()` * [P2251R1](https://wg21.link/P2251R1) [#2259](https://github.com/microsoft/STL/pull/2259) Require `span` And `basic_string_view` To Be Trivially Copyable * [P2401R0](https://wg21.link/P2401R0) [#2263](https://github.com/microsoft/STL/pull/2263) Conditional `noexcept` For `exchange()` - Merged LWG issue resolutions: * [P2259R1](https://wg21.link/P2259R1) [#2059](https://github.com/microsoft/STL/pull/2059) Repairing Input Range Adaptors And `counted_iterator` + Completed by implementing the input range adaptors part. * [LWG-3422](https://wg21.link/lwg3422) [#2260](https://github.com/microsoft/STL/pull/2260) Issues of `seed_seq`'s constructors * [LWG-3506](https://wg21.link/lwg3506) [#1994](https://github.com/microsoft/STL/pull/1994) Missing allocator-extended constructors for `priority_queue` * [LWG-3520](https://wg21.link/lwg3520) [#2200](https://github.com/microsoft/STL/pull/2200) `iter_move` and `iter_swap` are inconsistent for `transform_view::`*`iterator`* * [LWG-3522](https://wg21.link/lwg3522) [#1994](https://github.com/microsoft/STL/pull/1994) Missing requirement on `InputIterator` template parameter for `priority_queue` constructors * [LWG-3527](https://wg21.link/lwg3527) [#2194](https://github.com/microsoft/STL/pull/2194) `uses_allocator_construction_args` handles rvalue pairs of rvalue references incorrectly * [LWG-3528](https://wg21.link/lwg3528) [#2160](https://github.com/microsoft/STL/pull/2160) `make_from_tuple` can perform (the equivalent of) a C-style cast * [LWG-3536](https://wg21.link/lwg3536) [#2037](https://github.com/microsoft/STL/pull/2037) Should `chrono::from_stream()` assign zero to `duration` for failure? * [LWG-3546](https://wg21.link/lwg3546) [#1991](https://github.com/microsoft/STL/pull/1991) `common_iterator`'s *`postfix-proxy`* is not quite right * [LWG-3549](https://wg21.link/lwg3549) [#2198](https://github.com/microsoft/STL/pull/2198) `view_interface` is overspecified to derive from `view_base` * [LWG-3554](https://wg21.link/lwg3554) [#2261](https://github.com/microsoft/STL/pull/2261) `chrono::parse` needs `const charT*` overloads - Fixed bugs: * Fixed `<complex>` `exp()` and `polar()` for infinity and NaN inputs. [#1584](https://github.com/microsoft/STL/pull/1584) * Fixed compiler errors when comparing `common_iterator`s of different types for equality. [#2066](https://github.com/microsoft/STL/pull/2066) * Attempting to actually call `declval()` now emits a `static_assert` citing the paragraph of the Standard that forbids this. (Previously, `declval()` was declared but not defined, which was too permissive.) [#2101](https://github.com/microsoft/STL/pull/2101) * Fixed `basic_streambuf::seekoff()` and `basic_streambuf::seekpos()` to work with custom `pos_type`s. [#2121](https://github.com/microsoft/STL/pull/2121) * Restored our guarantee beyond the Standard that `string_view` is trivially move constructible. [#2128](https://github.com/microsoft/STL/pull/2128) + This fixed a regression that was introduced by [#2000](https://github.com/microsoft/STL/pull/2000) implementing [P1989R2](https://wg21.link/P1989R2) Range Constructor For `string_view` in VS 2022 17.0. * Fixed a bug where `vector` and `string` would terminate via `noexcept` instead of throwing `length_error` as desired when a `size_t` would be truncated to an allocator's narrower `size_type`. [#2139](https://github.com/microsoft/STL/pull/2139) * `<istream>` and `<ostream>` now properly catch and rethrow internal IO exceptions. [#2033](https://github.com/microsoft/STL/pull/2033) * Fixed `<format>` to correctly print hexfloats with large precisions. [#2157](https://github.com/microsoft/STL/pull/2157) * Fixed compiler errors when using `constexpr` `vector`s with certain user-defined allocators. [#2161](https://github.com/microsoft/STL/pull/2161) * Fixed silent bad codegen in `ranges::stable_sort()`, where for certain inputs it would neither sort nor permute the range. `ranges::inplace_merge()` was also affected. [#2188](https://github.com/microsoft/STL/pull/2188) * `subtract_with_carry_engine`'s textual representation is now correct. [#2088](https://github.com/microsoft/STL/pull/2088) * Fixed a deadlock in the overload of `condition_variable_any::wait_until` taking `stop_token`. [#2220](https://github.com/microsoft/STL/pull/2220) * `u8streampos`, `u16streampos`, and `u32streampos` are now declared by `<iosfwd>` as required by the Standard after [P0482R6](https://wg21.link/P0482R6) and [P1148R0](https://wg21.link/P1148R0) were accepted. [#2223](https://github.com/microsoft/STL/pull/2223) * Fixed ARM64EC compiler errors in `<limits>`. [#2306](https://github.com/microsoft/STL/pull/2306) * Fixed heap corruption in `fstream` when calling `putback()` followed by `close()`. [#2189](https://github.com/microsoft/STL/pull/2189) * Fixed `views::reverse` to work properly with `ranges::reverse_view` lvalues. [#2313](https://github.com/microsoft/STL/pull/2313) * Fixed a bug where the STL's DLL was using Windows Vista's APIs for critical sections and condition variables, instead of the more efficient APIs that were introduced in Windows 7. This was specific to `/MD` (dynamic release) and the STL's GitHub CMake build system; it did not affect the legacy build system that's currently used for official builds of the MSVC toolset. [#2314](https://github.com/microsoft/STL/pull/2314) * Fixed a bug affecting older CPUs where the STL generated the newer `tzcnt` instruction instead of the fallback `bsf` instruction. This affected `<bit>`'s `countr_zero()` and `countr_one()`, `<numeric>`'s `gcd()` and `lcm()`, and `vector<bool>`'s optimized implementations of `find()` and relational/spaceship operators. [#2333](https://github.com/microsoft/STL/pull/2333) * Fixed minor conformance issues in `basic_string`. These changes were specified by [P1148R0](https://wg21.link/P1148R0) "Cleaning Up `[strings]`", which was *almost* a pure rewording paper without normative impact. Oops! [#2222](https://github.com/microsoft/STL/pull/2222) * Fixed `ranges::find_end()` to return correct values for bidirectional common ranges. [#2270](https://github.com/microsoft/STL/pull/2270) * Fixed compiler errors affecting `ranges::sort()`, `ranges::search()`, and other ranges machinery. [#2290](https://github.com/microsoft/STL/pull/2290) * Fixed `array<T, 0>`, allowing it to compile when `T` is not default constructible. [#2296](https://github.com/microsoft/STL/pull/2296) * Fixed `allocator::allocate_at_least()` which was improperly annotated with `__declspec(allocator)`. [#2328](https://github.com/microsoft/STL/pull/2328) - Improved performance: * Optimized `steady_clock::now()` when `QueryPerformanceFrequency()` is exactly 10 MHz, which is very common for modern PCs. [#2086](https://github.com/microsoft/STL/pull/2086) * Improved codegen for x86 atomic loads. [#2110](https://github.com/microsoft/STL/pull/2110) * Optimized the fallback implementation of `popcount()`, which is used when compiler intrinsics are unavailable (and is also used at compile time). [#2079](https://github.com/microsoft/STL/pull/2079) * Slightly improved codegen when `<format>` prints a pointer in hexadecimal. [#2097](https://github.com/microsoft/STL/pull/2097) * Optimized `<ranges>` *`non-propagating-cache`* for trivially destructible types. [#2118](https://github.com/microsoft/STL/pull/2118) * Improved ARM64 codegen for `popcount()`, using compiler intrinsics. [#2127](https://github.com/microsoft/STL/pull/2127) * Extended the `memcpy()`, `memmove()`, and `memcmp()` optimizations in various algorithms to handle more types. [#2158](https://github.com/microsoft/STL/pull/2158) * Significantly improved the performance of `bitset::count()` by using the same machinery as `popcount()`. [#2201](https://github.com/microsoft/STL/pull/2201) * Also improved the performance of `std::count()` for `vector<bool>` by using `popcount()` machinery in a more optimizer-friendly way. [#2203](https://github.com/microsoft/STL/pull/2203) * `weak_ptr`'s converting constructors now avoid locking except when necessary to ensure correctness in virtual inheritance scenarios. [#2282](https://github.com/microsoft/STL/pull/2282) + For example, converting `weak_ptr<T>` to `weak_ptr<const T>` now avoids locking. * Removed a duplicated assignment in `filesystem::create_directories()`. [#2304](https://github.com/microsoft/STL/pull/2304) * Optimized `is_permutation()` for reversed sequences. [#2043](https://github.com/microsoft/STL/pull/2043) - Improved throughput: * Replaced tag dispatch with `if constexpr` in container copy/move assignment. [#2217](https://github.com/microsoft/STL/pull/2217) * `<format>` now avoids instantiating `vformat()` unless and until it's called. [#2331](https://github.com/microsoft/STL/pull/2331) - Enhanced behavior: * Changed `numeric_limits<long double>::max_digits10` to handle both 64-bit and 80-bit `long double`, by restoring the original logic that was used before VS 2017 15.8. + *Note:* 80-bit `long double` remains unsupported by MSVC. * C++ headers now emit clear `#error` messages when they're compiled as C. [#2148](https://github.com/microsoft/STL/pull/2148) + This applies to both the "C++ library headers" like `<vector>` and the "C++ headers for C library facilities" like `<cstdio>`. * Improved the wording of `binary_semaphore`'s debug check messages. [#2293](https://github.com/microsoft/STL/pull/2293) - Improved documentation: * Cited [LWG-3581](https://wg21.link/lwg3581) "The range constructor makes `basic_string_view` not trivially move constructible" in our implementation of its proposed resolution. [#2175](https://github.com/microsoft/STL/pull/2175) * Removed comments that were citing [GH-489](https://github.com/microsoft/STL/issues/489), now that [LWG-3530](https://wg21.link/lwg3530) "*`BUILTIN-PTR-MEOW`* should not opt the type out of syntactic checks" has been officially resolved by the June 2021 virtual plenary meeting. [#2186](https://github.com/microsoft/STL/pull/2186) - Improved test coverage: * Removed a `constructible_from` test case that was invalidated by recent changes to the Core Language. [#2107](https://github.com/microsoft/STL/pull/2107) * Fixed a test for `next_permutation()` and `prev_permutation()`; the algorithms were fine, but the test never worked and was never called. [#2137](https://github.com/microsoft/STL/pull/2137) * Fixed the test harness to handle non-English Visual Studio installations running on Windows with non-UTF-8 encodings. [#2145](https://github.com/microsoft/STL/pull/2145) * Added `/arch:AVX2` to the matrix of compiler options that's used when testing `<bit>`. [#2150](https://github.com/microsoft/STL/pull/2150) * Skipped more flaky tests in the legacy `tr1` test suite. [#2202](https://github.com/microsoft/STL/pull/2202) * Fixed flaky tests in the legacy `tr1` test suite that were generating collisions between temporary filenames. [#2210](https://github.com/microsoft/STL/pull/2210) * Fixed test failures on Windows 11. [#2265](https://github.com/microsoft/STL/pull/2265) * Fixed `<chrono>` formatting test failures related to locale-dependent time zone abbreviations. [#2231](https://github.com/microsoft/STL/pull/2231) - Code cleanups: * Moved a helper `struct` from a central internal header to `<optional>`. [#2117](https://github.com/microsoft/STL/pull/2117) * Cleaned up comments and clang-formatting. [#2136](https://github.com/microsoft/STL/pull/2136) * Removed a spurious overload of `operator>>(basic_istream&&, basic_string&)`. This didn't affect correctness, but it was neither necessary nor depicted by the Standard. [#2138](https://github.com/microsoft/STL/pull/2138) * Cleaned up various things, notably simplifying `exception_ptr`'s operators for C++20 and emitting a clear error message when compiling `<stdatomic.h>` as C. [#2140](https://github.com/microsoft/STL/pull/2140) * Removed unnecessary code in `<cctype>` that was attempting to defend against macroized `isalnum` etc. [#2147](https://github.com/microsoft/STL/pull/2147) * Removed an unnecessary `reinterpret_cast`, and changed some `reinterpret_cast`s from `void*` to `T*` to use `static_cast` instead. [#2096](https://github.com/microsoft/STL/pull/2096) * Removed an unnecessary definition of our internal macro `_HAS_CXX23` from our central internal header `yvals_core.h`. [#2226](https://github.com/microsoft/STL/pull/2226) * Removed comments that were citing proposed resolutions for LWG issues, now that those issues have been officially resolved by the October 2021 virtual plenary meeting. [#2269](https://github.com/microsoft/STL/pull/2269) * Removed unnecessary `(void)` casts now that MSVC emits fewer spurious warnings about unreferenced parameters. [#2280](https://github.com/microsoft/STL/pull/2280) * Removed compiler bug workarounds. [#2327](https://github.com/microsoft/STL/pull/2327) - Infrastructure improvements: * Updated dependencies. [#2115](https://github.com/microsoft/STL/pull/2115) [#2204](https://github.com/microsoft/STL/pull/2204) [#2277](https://github.com/microsoft/STL/pull/2277) [#2327](https://github.com/microsoft/STL/pull/2327) + Updated build compiler to VS 2022 17.1 Preview 1. + Updated CMake to 3.21 (now required). + Updated Python to 3.10.0. * Replaced vcpkg with [boostorg/math](https://github.com/boostorg/math) 1.77 in standalone mode. [#2151](https://github.com/microsoft/STL/pull/2151) - Updated `_MSVC_STL_UPDATE`. [#2183](https://github.com/microsoft/STL/pull/2183) [#2233](https://github.com/microsoft/STL/pull/2233) [#2321](https://github.com/microsoft/STL/pull/2321)

vs-2022-17.0

VS 2022 17.0 - Merged C++20 Defect Reports: * [P2325R3](https://wg21.link/P2325R3) [#2012](https://github.com/microsoft/STL/pull/2012) Views Should Not Be Required To Be Default Constructible * [P2328R1](https://wg21.link/P2328R1) [#2038](https://github.com/microsoft/STL/pull/2038) `join_view` Should Join All `view`s Of `range`s * [P2367R0](https://wg21.link/P2367R0) [#2026](https://github.com/microsoft/STL/pull/2026) Remove Misuses Of List-Initialization From Clause 24 Ranges - Enabled C++20 features for Clang: [#2064](https://github.com/microsoft/STL/pull/2064) * [P0980R1](https://wg21.link/P0980R1) `constexpr` `std::string` * [P1004R2](https://wg21.link/P1004R2) `constexpr` `std::vector` - Merged C++23 features: * [P0401R6](https://wg21.link/P0401R6) [#2036](https://github.com/microsoft/STL/pull/2036) Providing Size Feedback In The Allocator Interface * [P1048R1](https://wg21.link/P1048R1) [#1950](https://github.com/microsoft/STL/pull/1950) `is_scoped_enum` * [P1132R7](https://wg21.link/P1132R7) [#1998](https://github.com/microsoft/STL/pull/1998) `out_ptr()`, `inout_ptr()` * [P1679R3](https://wg21.link/P1679R3) [#1478](https://github.com/microsoft/STL/pull/1478) `contains()` For `basic_string`/`basic_string_view` * [P1682R3](https://wg21.link/P1682R3) [#1828](https://github.com/microsoft/STL/pull/1828) `to_underlying()` For Enumerations * [P1951R1](https://wg21.link/P1951R1) [#2009](https://github.com/microsoft/STL/pull/2009) Default Template Arguments For `pair`'s Forwarding Constructor * [P1989R2](https://wg21.link/P1989R2) [#2000](https://github.com/microsoft/STL/pull/2000) Range Constructor For `string_view` * [P2162R2](https://wg21.link/P2162R2) [#2006](https://github.com/microsoft/STL/pull/2006) Inheriting From `variant` * [P2166R1](https://wg21.link/P2166R1) [#1995](https://github.com/microsoft/STL/pull/1995) Prohibiting `basic_string` And `basic_string_view` Construction From `nullptr` + This is a common **source-breaking change** - code that previously had undefined behavior at runtime will now be rejected with compiler errors. * [P2186R2](https://wg21.link/P2186R2) [#2010](https://github.com/microsoft/STL/pull/2010) Removing Garbage Collection Support - Merged LWG issue resolutions: * [LWG-3430](https://wg21.link/lwg3430) [#1968](https://github.com/microsoft/STL/pull/1968) `std::fstream` & co. should be constructible from `string_view` * [LWG-3494](https://wg21.link/lwg3494) [#1877](https://github.com/microsoft/STL/pull/1877) Allow ranges to be conditionally borrowed * [LWG-3502](https://wg21.link/lwg3502) [#1878](https://github.com/microsoft/STL/pull/1878) `elements_view` should not be allowed to return dangling references * [LWG-3518](https://wg21.link/lwg3518) [#2080](https://github.com/microsoft/STL/pull/2080) Exception requirements on char trait operations unclear * [LWG-3533](https://wg21.link/lwg3533) [#1993](https://github.com/microsoft/STL/pull/1993) Make `base() const &` consistent across iterator wrappers that support `input_iterator`s * [LWG-3541](https://wg21.link/lwg3541) [#1992](https://github.com/microsoft/STL/pull/1992) `indirectly_readable_traits` should be SFINAE-friendly for all types * [LWG-3548](https://wg21.link/lwg3548) [#2007](https://github.com/microsoft/STL/pull/2007) `shared_ptr` construction from `unique_ptr` should move (not copy) the deleter * [LWG-3553](https://wg21.link/lwg3553) [#1990](https://github.com/microsoft/STL/pull/1990) Useless constraint in `split_view::`*`outer-iterator`*`::value_type::begin()` * [LWG-3555](https://wg21.link/lwg3555) [#1989](https://github.com/microsoft/STL/pull/1989) `{transform,elements}_view::`*`iterator`*`::iterator_concept` should consider `const`-qualification of the underlying range - Merged *partial* LWG issue resolutions: * [P2259R1](https://wg21.link/P2259R1) [#1939](https://github.com/microsoft/STL/pull/1939) Repairing Input Range Adaptors And `counted_iterator` + The `counted_iterator` part is implemented; the input range adaptors part is not yet implemented. - Fixed bugs: * Fixed `time_put::do_put` to avoid crashing when the invalid parameter handler has been changed to not end execution. [#1563](https://github.com/microsoft/STL/pull/1563) * Fixed a compiler error in `ranges::take_view`. [#1844](https://github.com/microsoft/STL/pull/1844) * Fixed improper partitioning of forward ranges in the parallel algorithms. [#1753](https://github.com/microsoft/STL/pull/1753) * Fixed an unintentionally dllexported symbol in the import library. [#1927](https://github.com/microsoft/STL/pull/1927) * Fixed a bug in which `ranges::unique_copy` would fail to compile with a non-input output iterator. [#1933](https://github.com/microsoft/STL/pull/1933) * Fixed a compiler error when calling `format_to()` in a specialization of `formatter` (see [#1961](https://github.com/microsoft/STL/issues/1961) for an example). [#1874](https://github.com/microsoft/STL/pull/1874) * Fixed compiler errors when calling `views::drop` and `views::take` with types that aren't integers, but are convertible to integers (e.g. `integral_constant`). [#1958](https://github.com/microsoft/STL/pull/1958) * Fixed a compiler error when calling `constexpr` `vector::emplace(position, args...)`. [#1962](https://github.com/microsoft/STL/pull/1962) * Fixed `jthread` to provide `native_handle()`. [#1966](https://github.com/microsoft/STL/pull/1966) * Fixed `filesystem::remove()` to delete read-only files, as required by the Standard. [#1559](https://github.com/microsoft/STL/pull/1559) * Fixed `mersenne_twister_engine`: [#1631](https://github.com/microsoft/STL/pull/1631) + Fixed the seeding algorithm to follow [N4892](https://wg21.link/N4892) [rand.eng.mers]/8, avoiding an all-zero state. (This is a runtime special case.) + Fixed the engine's behavior when `m == n` or `n == 1`. (This is a compile-time special case, which doesn't affect `mt19937` and `mt19937_64` at all.) + Fixed `operator<<()` to avoid printing a trailing space after the engine's textual representation. * Fixed `<chrono>` to adjust for leap seconds when formatting `file_time`. [#1879](https://github.com/microsoft/STL/pull/1879) * Fixed `chrono::from_stream()` to allow a year and a day-of-year to be parsed to a `time_point`. [#1940](https://github.com/microsoft/STL/pull/1940) * Fixed `filesystem::u8path()` to accept `char8_t` sources. [#1943](https://github.com/microsoft/STL/pull/1943) * Fixed `<chrono>` to parse subseconds for `time_point`s. [#1987](https://github.com/microsoft/STL/pull/1987) + Also fixed the parsing of `local_time` with a UTC offset. * Fixed `<chrono>` formatting to correctly estimate string widths (see [N4892](https://wg21.link/N4892) [format.string.std]/9). [#2017](https://github.com/microsoft/STL/pull/2017) * Fixed a major regression in the `_ITERATOR_DEBUG_LEVEL == 2` machinery, where a multithreaded program in debug mode could crash when one thread is modifying a container and another thread is destroying iterators. [#2060](https://github.com/microsoft/STL/pull/2060) + This regression affected all Standard modes (C++14/17/20/23) and was introduced by [#1546](https://github.com/microsoft/STL/pull/1546) in VS 2019 16.10. + Fixed in both VS 2019 16.11.4 and VS 2022 17.0. * Fixed a compiler error in `pmr::map<K, pair<A, B>>::operator[]`. [#2023](https://github.com/microsoft/STL/pull/2023) * Fixed compiler errors in `basic_string`'s `getline()` and `operator>>()` caused by the source-breaking change C++23 [P2266R1](https://wg21.link/P2266R1) "Simpler Implicit Move", first implemented in Clang 13. [#2025](https://github.com/microsoft/STL/pull/2025) * `bit_ceil()` now enforces its precondition during `constexpr` evaluation, as required by the Standard. [#2041](https://github.com/microsoft/STL/pull/2041) * `clog` is no longer tied to `cout`, and similarly for `wclog` and `wcout`, following the Standard. [#2056](https://github.com/microsoft/STL/pull/2056) * In `<ranges>`, when `filter_view`, `drop_view`, `drop_while_view`, and `reverse_view` store a cached position into an underlying view, they now properly invalidate that cached position when the underlying view is moved from. [#1931](https://github.com/microsoft/STL/pull/1931) - Improved performance: * Slightly improved debug codegen for `vector<bool>`, `basic_string`, and `map`/`multimap`/`set`/`multiset`'s `empty()` member functions. [#1836](https://github.com/microsoft/STL/pull/1836) * Fixed bloated codegen for `<format>`. [#1874](https://github.com/microsoft/STL/pull/1874) * Dramatically improved the performance of `std::find()` and `std::count()` for `vector<bool>`, with measured speedups between 19x and 26x (times, not percent). [#1131](https://github.com/microsoft/STL/pull/1131) * Extended our `memcmp`/`memcpy`/`memchr` optimizations to ranges with contiguous iterators and unreachable sentinels. [#1810](https://github.com/microsoft/STL/pull/1810) * `<format>` now detects when it's writing to a `back_insert_iterator` for a `basic_string` or a `vector`, and performs a faster call to `insert()` at the `end()` of the container. [#1894](https://github.com/microsoft/STL/pull/1894) * `std::byte` now activates the "trivially swappable" optimization in `reverse()` and `variant::swap()`, so it'll have the same performance as `unsigned char`. [#2044](https://github.com/microsoft/STL/pull/2044) * Extended the vectorization optimization in `std::swap_ranges()` to `ranges::swap_ranges()`, and enhanced it to work for arbitrary contiguous iterators. [#2048](https://github.com/microsoft/STL/pull/2048) * Reduced debug codegen size; an internal assertion macro was emitting completely unused, potentially long strings for function names. [#2054](https://github.com/microsoft/STL/pull/2054) - Improved throughput: * `<format>` and `<chrono>` now avoid including `<array>`. [#2031](https://github.com/microsoft/STL/pull/2031) - Enhanced behavior: * Added a visualizer for `source_location`. [#1837](https://github.com/microsoft/STL/pull/1837) * Added `[[nodiscard]]` to the `stoi()` family of functions in `<string>` and to various functions in `<locale>` (`collate` member functions, `has_facet()`, and the `isalnum()` and `tolower()` families). [#1809](https://github.com/microsoft/STL/pull/1809) * Added a debug mode precondition check to `forward_list::splice_after()`. [#2057](https://github.com/microsoft/STL/pull/2057) * Added visualizers for `bind_front()`, `u8string` (and its iterators), `default_sentinel_t`, `unreachable_sentinel_t`, `ranges::empty_view`, `ranges::single_view`, `ranges::iota_view` (and its iterator/sentinel), `ranges::ref_view`, `thread`, `thread::id`, `jthread`, and `filesystem::path`. [#1856](https://github.com/microsoft/STL/pull/1856) - Improved test coverage: * Added test coverage for our implementation-specific guarantees that `span` and `basic_string_view` are trivially copyable; [P2251](https://wg21.link/P2251) may eventually Standardize these guarantees. [#2015](https://github.com/microsoft/STL/pull/2015) * Fixed the ranges test machinery to properly specialize `std::basic_common_reference`; it was unintentionally relying on identical bugs in MSVC and Clang, but EDG correctly diagnosed that the code was non-Standard. [#2013](https://github.com/microsoft/STL/pull/2013) * Fixed a test (for the `abs()` overloads in `<cmath>` and `<cstdlib>`) that unintentionally hadn't been running in our new GitHub test harness. [#2070](https://github.com/microsoft/STL/pull/2070) - Code cleanups: * Removed compiler bug workarounds. [#1759](https://github.com/microsoft/STL/pull/1759) [#1778](https://github.com/microsoft/STL/pull/1778) [#1920](https://github.com/microsoft/STL/pull/1920) * Removed unnecessary C casts. [#1843](https://github.com/microsoft/STL/pull/1843) * The STL now uses Standard `_Pragma` instead of non-Standard `__pragma` (when possible) to internally suppress warnings. [#1342](https://github.com/microsoft/STL/pull/1342) * `<format>` now uses `_First`/`_Last` parameter names (instead of `_Begin`/`_End`) to be consistent with the rest of the STL. (The connotations are that first/last refers to an arbitrary range that might be a subrange, while begin/end refers to an entire container/view.) [#1951](https://github.com/microsoft/STL/pull/1951) * Removed comments that were citing proposed resolutions for LWG issues, now that those issues have been officially resolved by the June 2021 virtual plenary meeting. [#1967](https://github.com/microsoft/STL/pull/1967) * Improved `vector`'s implementation, also using `if constexpr` to simplify code. [#1771](https://github.com/microsoft/STL/pull/1771) * Simplified `<format>`'s implementation of type-erased argument storage. [#1907](https://github.com/microsoft/STL/pull/1907) * Filed [LWG-3566](https://wg21.link/lwg3566) "Constraint recursion for `operator<=>(optional<T>, U)`" and updated our implementation's comment accordingly. [#2011](https://github.com/microsoft/STL/pull/2011) * Simplified the backwards loop in `char_traits::move()`. [#2055](https://github.com/microsoft/STL/pull/2055) * Marked all overriding functions with `override`, and removed redundant `virtual` keywords. [#2069](https://github.com/microsoft/STL/pull/2069) * REMOVED THE "SHOUTY COMMENT BANNERS" LIKE `// CLASS TEMPLATE vector`; SEE [#306](https://github.com/microsoft/STL/issues/306) FOR THE RATIONALE. [#2074](https://github.com/microsoft/STL/pull/2074) * Removed an unnecessary check for self-assignment in the compile-time implementation of `char_traits::move()`. [#2083](https://github.com/microsoft/STL/pull/2083) - Infrastructure improvements: * Updated dependencies. [#1884](https://github.com/microsoft/STL/pull/1884) [#1920](https://github.com/microsoft/STL/pull/1920) [#1953](https://github.com/microsoft/STL/pull/1953) [#2014](https://github.com/microsoft/STL/pull/2014) [#2064](https://github.com/microsoft/STL/pull/2064) [#2081](https://github.com/microsoft/STL/pull/2081) + Updated build compiler to VS 2022 17.0 Preview 2 (now required). + Updated Clang to 12.0.0 (now required). + Updated CMake to 3.20 (now required). + Updated Python to 3.9.6. + Updated vcpkg for Boost 1.76.0 (now required). - Build system improvements: * The STL is now built with [MSVC's `/ZH:SHA_256` switch](https://learn.microsoft.com/en-us/cpp/build/reference/zh?view=msvc-160) to improve supply chain integrity. [#1829](https://github.com/microsoft/STL/pull/1829) - Updated `_MSVC_STL_UPDATE`. Also updated `_MSVC_STL_VERSION` to `143` for the VS 2022 release series. [#1897](https://github.com/microsoft/STL/pull/1897) [#1955](https://github.com/microsoft/STL/pull/1955) [#2035](https://github.com/microsoft/STL/pull/2035) [#2091](https://github.com/microsoft/STL/pull/2091)

vs-2019-16.10

VS 2019 16.10 - The STL is **C++20 feature complete**. - Merged C++20 features: * [P0053R7](https://wg21.link/P0053R7) [#1564](https://github.com/microsoft/STL/pull/1564) `<syncstream>` + [P0753R2](https://wg21.link/P0753R2) `osyncstream` Manipulators * [P0355R7](https://wg21.link/P0355R7) `<chrono>` Calendars And Time Zones: + [#323](https://github.com/microsoft/STL/pull/323) implemented calendars. + [#1789](https://github.com/microsoft/STL/pull/1789) implemented new clocks, leap seconds, time zones, and parsing. + [#1870](https://github.com/microsoft/STL/pull/1870) implemented `<chrono>`'s `format()` support (via `formatter` specializations) and remaining `operator<<()` overloads, completing this feature. + While the STL generally provides all features on all supported versions of Windows, leap seconds and time zones (which change over time) require OS support that was added to Windows 10. Specifically, updating the leap second database requires Windows 10 version 1809 or later, and time zones require `icu.dll` which is provided by Windows 10 version 1903/19H1 or later. This applies to both client and server OSes; note that Windows Server 2019 is based on Windows 10 version 1809. * [P0408R7](https://wg21.link/P0408R7) [#919](https://github.com/microsoft/STL/pull/919) Efficient Access To `basic_stringbuf`'s Buffer * [P0466R5](https://wg21.link/P0466R5) [#1575](https://github.com/microsoft/STL/pull/1575) Layout-Compatibility And Pointer-Interconvertibility Traits + Initially supported for MSVC only; will be supported for Clang after [LLVM-48860](https://github.com/llvm/llvm-project/issues/48204) is resolved. * [P0475R1](https://wg21.link/P0475R1) [#1668](https://github.com/microsoft/STL/pull/1668) Guaranteed Copy Elision For Piecewise Construction * [P0591R4](https://wg21.link/P0591R4) [#1668](https://github.com/microsoft/STL/pull/1668) Utility Functions For Uses-Allocator Construction + [LWG-3185](https://wg21.link/lwg3185) Uses-allocator construction functions missing `constexpr` and `noexcept` + [LWG-3187](https://wg21.link/lwg3187) P0591R4 reverted LWG-2586 fixes to `scoped_allocator_adaptor::construct()` + [LWG-3321](https://wg21.link/lwg3321) `uninitialized_construct_using_allocator` should use `construct_at` * [P0608R3](https://wg21.link/P0608R3) [#1629](https://github.com/microsoft/STL/pull/1629) Improving `variant`'s Converting Constructor/Assignment * [P0645R10](https://wg21.link/P0645R10) [#1821](https://github.com/microsoft/STL/pull/1821) [#1834](https://github.com/microsoft/STL/pull/1834) [#1803](https://github.com/microsoft/STL/pull/1803) [#1853](https://github.com/microsoft/STL/pull/1853) [#1862](https://github.com/microsoft/STL/pull/1862) [#1867](https://github.com/microsoft/STL/pull/1867) [#1851](https://github.com/microsoft/STL/pull/1851) [#1875](https://github.com/microsoft/STL/pull/1875) `<format>` Text Formatting * [P0784R7](https://wg21.link/P0784R7) [#1369](https://github.com/microsoft/STL/pull/1369) [#1546](https://github.com/microsoft/STL/pull/1546) Library Support For More `constexpr` Containers * [P0896R4](https://wg21.link/P0896R4) Ranges, completed with the final PRs: + [#1383](https://github.com/microsoft/STL/pull/1383) algorithms `inplace_merge`, `stable_partition`, `stable_sort` + [#1693](https://github.com/microsoft/STL/pull/1693) view `ranges::iota_view` + [#1436](https://github.com/microsoft/STL/pull/1436) view `ranges::join_view` + [#1731](https://github.com/microsoft/STL/pull/1731) view `ranges::split_view` + [#1748](https://github.com/microsoft/STL/pull/1748) Define `__cpp_lib_ranges` and declare victory! + Completes support for the 23 proposals and 35 LWG issues listed in [this GH issue comment](https://github.com/microsoft/STL/issues/39#issue-490091723). * [P0980R1](https://wg21.link/P0980R1) [#1502](https://github.com/microsoft/STL/pull/1502) `constexpr` `std::string` + Initially supported for MSVC only; will be supported for Clang after [LLVM-48606](https://github.com/llvm/llvm-project/issues/47950) is resolved. * [P1004R2](https://wg21.link/P1004R2) [#1407](https://github.com/microsoft/STL/pull/1407) [#1690](https://github.com/microsoft/STL/pull/1690) [#1698](https://github.com/microsoft/STL/pull/1698) `constexpr` `std::vector` + Initially supported for MSVC only; see note for `constexpr` `std::string`. * [P1208R6](https://wg21.link/P1208R6) [#664](https://github.com/microsoft/STL/pull/664) `<source_location>` + Initially supported for MSVC only; will be supported for Clang after it implements `consteval` (see [Clang's C++20 status](https://clang.llvm.org/cxx_status.html#cxx20)). * [P1502R1](https://wg21.link/P1502R1) [#1567](https://github.com/microsoft/STL/pull/1567) [#1692](https://github.com/microsoft/STL/pull/1692) Standard Library Header Units + Initially supported for MSVC only; will be supported for Clang after it implements C++20 modules (see [Clang's C++20 status](https://clang.llvm.org/cxx_status.html#cxx20)). * [P1614R2](https://wg21.link/P1614R2) [#1602](https://github.com/microsoft/STL/pull/1602) [#1678](https://github.com/microsoft/STL/pull/1678) Adding Spaceship `<=>` To The Library - Merged LWG issue resolutions: * [LWG-3171](https://wg21.link/lwg3171) [#1573](https://github.com/microsoft/STL/pull/1573) LWG-2989 breaks `directory_entry` stream insertion * [LWG-3449](https://wg21.link/lwg3449) [#1457](https://github.com/microsoft/STL/pull/1457) `take_view` and `take_while_view`'s *`sentinel`*`<false>` not comparable with their const iterator * [LWG-3466](https://wg21.link/lwg3466) [#1572](https://github.com/microsoft/STL/pull/1572) Specify the requirements for `promise`/`future`/`shared_future` consistently - Fixed bugs: * Fixed regex character class behavior with `regex::icase`. [#1503](https://github.com/microsoft/STL/pull/1503) * Fixed compiler errors when calling `std::equal()` with user-defined contiguous iterators. [#1527](https://github.com/microsoft/STL/pull/1527) * Fixed `boolalpha` extraction to be case-sensitive again. [#1543](https://github.com/microsoft/STL/pull/1543) [#1570](https://github.com/microsoft/STL/pull/1570) (This was a regression in VS 2019 16.8 caused by [#1168](https://github.com/microsoft/STL/pull/1168).) * Fixed a compiler error when calling `std::fill()` with `volatile byte*`. [#1557](https://github.com/microsoft/STL/pull/1557) * Fixed `ranges::unique` to correctly handle inputs that are already unique. [#1561](https://github.com/microsoft/STL/pull/1561) * Fixed compiler errors, specific to Clang targeting ARM64, in `<atomic>` and `<bit>`, related to compiler intrinsics. [#1505](https://github.com/microsoft/STL/pull/1505) * Fixed C++20 mode to remove old `std::allocator` members that were deprecated in C++17. (As usual, fine-grained and coarse-grained escape hatches are available for this removal.) [#1585](https://github.com/microsoft/STL/pull/1585) * Fixed an inaccurate approximation in `binomial_distribution`. [#1531](https://github.com/microsoft/STL/pull/1531) * Fixed incorrect `min`/`max` values for several `<random>` distributions. [#1601](https://github.com/microsoft/STL/pull/1601) * Fixed incorrect behavior in `gamma_distribution::param_type::operator==`. [#1601](https://github.com/microsoft/STL/pull/1601) * Fixed a regression in VS 2019 16.6 caused by [#423](https://github.com/microsoft/STL/pull/423), where `__declspec(dllexport)`ing a class derived from `unordered_map` or `unordered_set` would fail to compile with a `static_assert`. [#1639](https://github.com/microsoft/STL/pull/1639) * Fixed compiler errors in `ranges::uninitialized_copy`, `ranges::uninitialized_copy_n`, `ranges::uninitialized_move`, and `ranges::uninitialized_move_n` when attempting to use `memcpy` for efficiency. [#1548](https://github.com/microsoft/STL/pull/1548) * Fixed incorrect behavior in `ranges::uninitialized_value_construct` and `ranges::uninitialized_value_construct_n` when attempting to use `memset` for efficiency. [#1700](https://github.com/microsoft/STL/pull/1700) * Fixed `year_month_day_last::day()` to return a valid-but-unspecified value for `!ok()` dates, as required by the Standard. [#1663](https://github.com/microsoft/STL/pull/1663) * Fixed a regression in VS 2019 16.7 caused by [#309](https://github.com/microsoft/STL/pull/309), where `<memory>` would fail to compile with `/std:c++latest` [`/Zc:alignedNew-`](https://learn.microsoft.com/en-us/cpp/build/reference/zc-alignednew?view=msvc-160). [#1689](https://github.com/microsoft/STL/pull/1689) * Fixed incorrect behavior in `get_time()`. [#1620](https://github.com/microsoft/STL/pull/1620) + Format specifications without delimiters are now correctly handled, even when a field is all-zero. For example, `"19700405T000006"` can now be parsed with `"%Y%m%dT%H%M%S"`. + Literal matching (outside of `'%'` conversion specifications) is now case-insensitive. + If the stream ends during literal matching, `ios_base::eofbit | ios_base::failbit` is now set. + Incomplete conversion specifications (e.g. `'%'` appearing as the last character of a format specification) now result in `ios_base::failbit` instead of literal matching. + The seconds field now permits `60` to handle leap seconds. * Fixed compiler errors in `ranges::uninitialized_copy` and `ranges::uninitialized_move` when attempting to use `memcpy` for efficiency. [#1713](https://github.com/microsoft/STL/pull/1713) * Fixed compiler errors where the `ranges::uninitialized_meow()` algorithms assumed that `<algorithm>` was included; now they can be called after including only `<memory>`. [#1832](https://github.com/microsoft/STL/pull/1832) * Fixed an off-by-default truncation warning in `<complex>` (warning C5219: implicit conversion from `'const int'` to `'const float'`, possible loss of data). [#1722](https://github.com/microsoft/STL/pull/1722) * Fixed compiler errors in `make_shared` and `allocate_shared` with `noexcept(false)` destructors. [#1736](https://github.com/microsoft/STL/pull/1736) * Fixed compiler errors in an advanced scenario for Standard Library Header Units: using the IDE's build system to perform "dependency scanning" in addition to automatic translation of `#include` to `import`. [#1781](https://github.com/microsoft/STL/pull/1781) * Fixed a regression in VS 2019 16.9 caused by [#1336](https://github.com/microsoft/STL/pull/1336), where `<cmath>`'s usage of new compiler intrinsics in `ceil`, `copysign`, `floor`, `round`, and `trunc` would fail to compile with CUDA and the Intel C++ Compiler. [#1886](https://github.com/microsoft/STL/pull/1886) + Also backported to VS 2019 16.9.7. + Will appear in VS 2019 16.11 Preview 2 (but not 16.11 Preview 1). + *Note:* The Intel C++ Compiler remains unsupported by MSVC. - Improved performance: * `countr_zero()` and `countr_one()` in `<bit>` are now faster for `uint8_t` and `uint16_t`. [#1540](https://github.com/microsoft/STL/pull/1540) * `atomic` locks on x86/x64 now use the `_mm_pause` intrinsic with increasing back-off. [#1146](https://github.com/microsoft/STL/pull/1146) * Slightly optimized `<charconv>`'s integer `to_chars()` for the bases 3, 5, 6, 7, and 9. [#1622](https://github.com/microsoft/STL/pull/1622) * Significantly optimized `<chrono>`'s conversions between `year_month_day` and `sys_days`. [#1634](https://github.com/microsoft/STL/pull/1634) [#1646](https://github.com/microsoft/STL/pull/1646) * Extended `std` algorithm optimizations to `std::ranges` algorithms and generalized those optimizations from pointers to contiguous iterators. [#1433](https://github.com/microsoft/STL/pull/1433) [#1772](https://github.com/microsoft/STL/pull/1772) - Enhanced behavior: * Added `header-units.json`, a file that will tell the compiler which headers are eligible to be automatically treated as header units at the user's request. (That is, there will be a compiler option allowing `#include <vector>` to be treated as `import <vector>;` without changing the source code.) [#1545](https://github.com/microsoft/STL/pull/1545) * Added `[[nodiscard]]` to several member functions in `<hash_map>` and `<hash_set>`, even though these non-Standard headers are deprecated and will be removed soon. [#1574](https://github.com/microsoft/STL/pull/1574) * Added `static_assert(is_clock_v<Clock>);` as required by [N4878](https://wg21.link/N4878) [thread.req.paramname]/1. [#1687](https://github.com/microsoft/STL/pull/1687) * `<coroutine>` is now supported in C++14 mode and C++17 mode; the new `/await:strict` compiler option activates this "downlevel" support. [#1730](https://github.com/microsoft/STL/pull/1730) + `<coroutine>` remains supported in C++20 mode with no additional compiler options. * Added the STL's visualizers to this repo, see `stl/debugger/STL.natvis`. [#1720](https://github.com/microsoft/STL/pull/1720) + Significantly improved the visualizer for `coroutine_handle`. [#1785](https://github.com/microsoft/STL/pull/1785) + Added a visualizer for `span`. [#1774](https://github.com/microsoft/STL/pull/1774) + Added visualizers for new `<chrono>` types. [#1773](https://github.com/microsoft/STL/pull/1773) + Added visualizers for `strong_ordering`, `weak_ordering`, and `partial_ordering`. [#1855](https://github.com/microsoft/STL/pull/1855) * Generalized `<complex>`'s 80-bit `long double` detection logic to work with Clang in addition to the Intel C++ Compiler. [#1728](https://github.com/microsoft/STL/pull/1728) + *Note:* 80-bit `long double` remains unsupported by MSVC. - Improved test coverage: * Added test coverage for CUDA 10.1 Update 2. [#1519](https://github.com/microsoft/STL/pull/1519) [#1539](https://github.com/microsoft/STL/pull/1539) * Accelerated the test for [P1502R1](https://wg21.link/P1502R1) Standard Library Header Units by building the header units in parallel, using `/MP`. [#1529](https://github.com/microsoft/STL/pull/1529) * The test harness now builds all tests for ARM and ARM64. [#1505](https://github.com/microsoft/STL/pull/1505) + This is build-only; the goal of running tests on ARM and ARM64 is tracked by [#820](https://github.com/microsoft/STL/issues/820). + Clang is supported for ARM64 only, not ARM. * Updated the `libcxx` test suite. [#1594](https://github.com/microsoft/STL/pull/1594) * Added more test coverage for the `default_initializable` concept. [#1604](https://github.com/microsoft/STL/pull/1604) - Code cleanups: * Removed compiler bug workarounds. [#1521](https://github.com/microsoft/STL/pull/1521) [#1711](https://github.com/microsoft/STL/pull/1711) [#1841](https://github.com/microsoft/STL/pull/1841) * Improved formatting with clang-format 11. [#1521](https://github.com/microsoft/STL/pull/1521) * CUDA 10.1 Update 2 is now required, allowing the STL to unconditionally use `if constexpr` for compiler throughput and code clarity. [#1544](https://github.com/microsoft/STL/pull/1544) * Updated `<charconv>`'s product/test code to be more compatible with libc++. [#1670](https://github.com/microsoft/STL/pull/1670) * Rearranged `[[nodiscard]]` attributes to appear before `__declspec` specifications for functions (otherwise, `[[nodiscard]]` is ignored). [#1703](https://github.com/microsoft/STL/pull/1703) * Updated the Standard Library Header Units test now that the compiler supports attributes in modules. [#1747](https://github.com/microsoft/STL/pull/1747) * Suppressed a harmless warning in test code after MSVC implemented `constinit`. [#1611](https://github.com/microsoft/STL/pull/1611) * Renamed a few internal identifiers to be `_Ugly`, following the Standard's strict requirements. [#1743](https://github.com/microsoft/STL/pull/1743) * The STL now consistently uses SFINAE instead of concepts when `__cpp_lib_concepts` isn't defined. [#1749](https://github.com/microsoft/STL/pull/1749) * Removed comments that were citing proposed resolutions for LWG issues, now that those issues have been officially resolved by the February 2021 virtual plenary meeting. [#1686](https://github.com/microsoft/STL/pull/1686) * Fixed mysterious LWG issue citations in `<optional>`. [#1788](https://github.com/microsoft/STL/pull/1788) - Infrastructure improvements: * Updated dependencies. [#1521](https://github.com/microsoft/STL/pull/1521) [#1577](https://github.com/microsoft/STL/pull/1577) [#1636](https://github.com/microsoft/STL/pull/1636) [#1711](https://github.com/microsoft/STL/pull/1711) + Updated build compiler to VS 2019 16.10 Preview 1 (now required). + Updated Clang to 11.0.0 (now required). + Updated vcpkg for Boost 1.75.0 (now required). + Updated CMake to 3.19 (now required). + Updated Ninja to 1.10.2. + Updated Python to 3.9.2. * Accelerated the CI with partial clones, shallow clones, and sparse checkouts. [#1513](https://github.com/microsoft/STL/pull/1513) [#1605](https://github.com/microsoft/STL/pull/1605) * Fixed reliability issues in the `parallelize` tool, which is used to run `clang-format` on all files in the codebase. [#1632](https://github.com/microsoft/STL/pull/1632) * Skipped a flaky test in the legacy `tr1` test suite. [#1697](https://github.com/microsoft/STL/pull/1697) * We now use GitHub Actions to update the [Status Chart](https://microsoft.github.io/STL/) every day. [#1769](https://github.com/microsoft/STL/pull/1769) * The test harness now runs the Standard Library Header Units test in a "parallelism group", which should make the CI system more reliable. [#1776](https://github.com/microsoft/STL/pull/1776) - Updated `_MSVC_STL_UPDATE`. [#1535](https://github.com/microsoft/STL/pull/1535) [#1552](https://github.com/microsoft/STL/pull/1552) [#1626](https://github.com/microsoft/STL/pull/1626) [#1708](https://github.com/microsoft/STL/pull/1708) [#1801](https://github.com/microsoft/STL/pull/1801)

vs-2019-16.9

VS 2019 16.9 - Merged C++20 features: * [P0339R6](https://wg21.link/P0339R6) [#1311](https://github.com/microsoft/STL/pull/1311) `polymorphic_allocator<>` * [P0660R10](https://wg21.link/P0660R10) [#1196](https://github.com/microsoft/STL/pull/1196) `<stop_token>` And `jthread` * [P0768R1](https://wg21.link/P0768R1) [#1370](https://github.com/microsoft/STL/pull/1370) Library Support For The Spaceship Comparison Operator `<=>` + This feature was mostly implemented in VS 2019 16.0; it's now complete with the addition of the spaceship customization point objects `strong_order`, `weak_order`, `partial_order`, `compare_strong_order_fallback`, `compare_weak_order_fallback`, and `compare_partial_order_fallback`. * [P1007R3](https://wg21.link/P1007R3) [#1306](https://github.com/microsoft/STL/pull/1306) `assume_aligned()` * [P1020R1](https://wg21.link/P1020R1) [#1315](https://github.com/microsoft/STL/pull/1315) Smart Pointer Creation With Default Initialization * [P1771R1](https://wg21.link/P1771R1) [#1495](https://github.com/microsoft/STL/pull/1495) [#1514](https://github.com/microsoft/STL/pull/1514) `[[nodiscard]]` For Constructors - Merged *partial* C++20 features: * [P0355R7](https://wg21.link/P0355R7) `<chrono>` Calendars And Time Zones: + [#1341](https://github.com/microsoft/STL/pull/1341) `operator<<(basic_ostream&, const duration&)` * [P0896R4](https://wg21.link/P0896R4) Ranges: + [#1092](https://github.com/microsoft/STL/pull/1092) [#1265](https://github.com/microsoft/STL/pull/1265) [#1268](https://github.com/microsoft/STL/pull/1268) `common_iterator` + [#1271](https://github.com/microsoft/STL/pull/1271) `views::take` and `views::drop` now handle `basic_string_view` as specified in [P1739R4](https://wg21.link/P1739R4). + [#1313](https://github.com/microsoft/STL/pull/1313) `ranges::construct_at` and `ranges::destroy_at` + [#1164](https://github.com/microsoft/STL/pull/1164) algorithms `ranges::uninitialized_default_construct`, `ranges::uninitialized_default_construct_n`, `ranges::uninitialized_value_construct`, `ranges::uninitialized_value_construct_n`, `ranges::uninitialized_fill`, `ranges::uninitialized_fill_n`, `ranges::uninitialized_copy`, `ranges::uninitialized_copy_n`, `ranges::uninitialized_move_n` + [#1281](https://github.com/microsoft/STL/pull/1281) Changes to the stream iterators (`istream_iterator`, `ostream_iterator`, `istreambuf_iterator`, and `ostreambuf_iterator`) to model the C++20 iterator concepts + [#1366](https://github.com/microsoft/STL/pull/1366) view `ranges::drop_while_view` + [#1406](https://github.com/microsoft/STL/pull/1406) view `ranges::elements_view` + [#1334](https://github.com/microsoft/STL/pull/1334) view `ranges::istream_view` + [#1372](https://github.com/microsoft/STL/pull/1372) view `ranges::take_while_view` + [#1305](https://github.com/microsoft/STL/pull/1305) `views::common` + [#1375](https://github.com/microsoft/STL/pull/1375) `views::counted` * [P1502R1](https://wg21.link/P1502R1) Standard Library Header Units: + [#1388](https://github.com/microsoft/STL/pull/1388) [#1396](https://github.com/microsoft/STL/pull/1396) Added test coverage. This found blocking compiler bugs that are being fixed; see [#1694](https://github.com/microsoft/STL/issues/1694) for their current status. - Merged LWG issue resolutions: * [LWG-3036](https://wg21.link/lwg3036) [#1455](https://github.com/microsoft/STL/pull/1455) `polymorphic_allocator::destroy` is extraneous * [LWG-3117](https://wg21.link/lwg3117) [#1493](https://github.com/microsoft/STL/pull/1493) Missing `packaged_task` deduction guides * [LWG-3170](https://wg21.link/lwg3170) [#1501](https://github.com/microsoft/STL/pull/1501) `is_always_equal` added to `std::allocator` makes the standard library treat derived types as always equal * [LWG-3211](https://wg21.link/lwg3211) [#1460](https://github.com/microsoft/STL/pull/1460) `std::tuple<>` should be trivially constructible * [LWG-3448](https://wg21.link/lwg3448) [#1458](https://github.com/microsoft/STL/pull/1458) `transform_view`'s *`sentinel`*`<false>` not comparable with *`iterator`*`<true>` * [LWG-3460](https://wg21.link/lwg3460) [#1452](https://github.com/microsoft/STL/pull/1452) Unimplementable `noop_coroutine_handle` guarantees * [LWG-3464](https://wg21.link/lwg3464) [#1483](https://github.com/microsoft/STL/pull/1483) `istream::gcount()` can overflow - Fixed bugs: * Fixed the `invocable_r` family of type traits to handle C++17 deferred temporary materialization. [#1282](https://github.com/microsoft/STL/pull/1282) * Fixed a compiler error in `atomic_ref<[u]int8_t>::operator--(int)`. [#1303](https://github.com/microsoft/STL/pull/1303) * Removed non-Standard implicitly converting constructors from `complex`. [#1294](https://github.com/microsoft/STL/pull/1294) * Enabled `constexpr` destruction of `memory_resource`. [#1314](https://github.com/microsoft/STL/pull/1314) * `std::filesystem::create_directories()` now throws an exception (or fails with an `error_code`) when called with an empty `path`. [#1285](https://github.com/microsoft/STL/pull/1285) * Fixed compiler errors (with clang-tidy and IntelliSense-in-Clang-mode) caused by `intrin0.h` including `intrin.h`, which no longer happens. [#1300](https://github.com/microsoft/STL/issues/1300) * Fixed undefined behavior and incorrect results in `geometric_distribution`, `poisson_distribution`, `binomial_distribution`, and `gamma_distribution`. [#1159](https://github.com/microsoft/STL/pull/1159) * Fixed incorrect results (infinity and NaN) in `normal_distribution`, `lognormal_distribution`, `fisher_f_distribution`, and `student_t_distribution`. [#1228](https://github.com/microsoft/STL/pull/1228) * Fixed `bind_front()` to determine its return type from the decayed types of its arguments. [#1293](https://github.com/microsoft/STL/pull/1293) * Fixed `pow(complex, arithmetic)` to strictly follow the Standard's rules and return correct results. [#1299](https://github.com/microsoft/STL/pull/1299) * Fixed `_Node_handle` - the internal class template that reifies the Standard's _`node-handle`_ family of exposition-only types - to destroy contained values with an allocator rebound to the value type instead of to the type of the node. [#1310](https://github.com/microsoft/STL/pull/1310) * Fixed overflow when converting extreme relative times (like `duration::max()`) to absolute times in `condition_variable_any::wait_for()`, `condition_variable::wait_for()`, `recursive_timed_mutex::try_lock_for()`, `shared_timed_mutex::try_lock_for()`, `shared_timed_mutex::try_lock_shared_for()`, `this_thread::sleep_for()`, and `timed_mutex::try_lock_for()`. [#1371](https://github.com/microsoft/STL/pull/1371) * Fixed a compiler error when compiling `<experimental/generator>` in `/kernel` mode. [#1373](https://github.com/microsoft/STL/pull/1373) * Fixed `std::atomic_init`; C++20 deprecated it (which we previously implemented) and changed its effects to be equivalent to a relaxed store (which we previously missed). [#1090](https://github.com/microsoft/STL/pull/1090) * Fixed `get_time()` to correctly handle format specifications without delimiters; for example, `"20201029"` can now be parsed with `"%Y%m%d"`. [#1280](https://github.com/microsoft/STL/pull/1280) + This fix was incomplete; it was completed by [#1620](https://github.com/microsoft/STL/pull/1620) in VS 2019 16.10. * Fixed the ordered associative containers (`map`, `multimap`, `set`, `multiset`) so that their move constructors and move assignment operators don't attempt to swap their comparators (which could fail to compile, especially for lambdas which aren't assignable). [#1357](https://github.com/microsoft/STL/pull/1357) * Fixed a crash when a user-defined class, deriving from `streambuf`, threw an exception from its constructor. [#1358](https://github.com/microsoft/STL/pull/1358) * Fixed two lines in ranges machinery that mistakenly said `noexcept(noexcept(is_nothrow_v))` (which is always `noexcept(true)`). Now they say `noexcept(is_nothrow_v)` as intended. [#1417](https://github.com/microsoft/STL/pull/1417) * Marked `hash<coroutine_handle<>>::operator()` as `const`, required by the Standard. [#1423](https://github.com/microsoft/STL/pull/1423) * Fixed several issues in `complex` `sqrt()` and `log()`: [#935](https://github.com/microsoft/STL/pull/935) + Fixed `sqrt()` overflow for huge inputs. + Fixed `sqrt()` inaccuracy for tiny inputs, due to internal underflow. + Fixed `log()` inaccuracy for tiny inputs, due to internal underflow. + Improved accuracy of `log()` when |z| ~= 1. + Fixed `log(complex<float>{1, 0})` for certain combinations of compile-time and run-time settings; now it correctly returns `0`. + These correctness fixes have a moderate performance cost, partially mitigated by using hardware FMA when available on x86/x64/arm64. * Fixed an AddressSanitizer `new-delete-type-mismatch` issue in `valarray`. [#1496](https://github.com/microsoft/STL/pull/1496) * Fixed linker errors on ARM and ARM64 when using atomic waits. [#1507](https://github.com/microsoft/STL/pull/1507) * Fixed the exception specification for `basic_string_view`'s (iterator, sentinel) constructor. [#1510](https://github.com/microsoft/STL/pull/1510) * Fixed `regex_traits::transform()` to accept arbitrary forward iterators instead of requiring raw pointers. [#1494](https://github.com/microsoft/STL/pull/1494) * Fixed a `static_assert` that was preventing `atomic_ref<const T>` from compiling. [#1500](https://github.com/microsoft/STL/pull/1500) * Fixed a compiler error when compiling `<atomic>` in C++20 mode with Clang targeting ARM64. [#1509](https://github.com/microsoft/STL/pull/1509) - Improved performance: * Removed unused code for Windows XP (and Server 2003) support, slightly improving runtime performance and decreasing the size of the STL's DLL by 3%. [#1194](https://github.com/microsoft/STL/pull/1194) [#1325](https://github.com/microsoft/STL/pull/1325) [#1397](https://github.com/microsoft/STL/pull/1397) * Optimized `<charconv>` `from_chars()` by simplifying how it assembles floating-point values, and by using the branchless rounding technique that was originally invented for `hex` precision `to_chars()`. [#1220](https://github.com/microsoft/STL/pull/1220) * Changed `vector`'s move constructor to be more optimizer-friendly. [#1330](https://github.com/microsoft/STL/pull/1330) * Optimized the `fill` family of algorithms (including `fill_n`, the `uninitialized_` forms, and the `ranges::` forms) to use `memset` when setting scalars to all-bits-zero. [#1273](https://github.com/microsoft/STL/pull/1273) * Used new compiler intrinsics in `<cmath>`'s `float` and `long double` overloads of `ceil`, `copysign`, `floor`, `round`, and `trunc`. [#1336](https://github.com/microsoft/STL/pull/1336) * The range adaptor closure objects for `views::filter` and `views::transform` now properly move from their stashed function objects when possible. [#1410](https://github.com/microsoft/STL/pull/1410) * The spaceship customization point objects `strong_order` and `weak_order` now compare floating-point values without branching on the sign bit. [#1475](https://github.com/microsoft/STL/pull/1475) - Enhanced behavior: * Changed `_Execute_once()`, an internal helper function, to be compatible with XFG, an enhanced version of the Control Flow Guard feature. [#1318](https://github.com/microsoft/STL/pull/1318) [#1356](https://github.com/microsoft/STL/pull/1356) * Added checks to `optional::operator*` and `optional::operator->` that fire when called on an empty `optional` when `_CONTAINER_DEBUG_LEVEL > 0` (which is implied by `_ITERATOR_DEBUG_LEVEL != 0`). [#1362](https://github.com/microsoft/STL/pull/1362) * Header improvements: [#1405](https://github.com/microsoft/STL/pull/1405) + `<tuple>` no longer includes `<new>`. + Changed most (but not all) C wrapper headers to be ["core headers"](https://github.com/microsoft/STL/wiki/The-Difference-Between-Core-And-Non-Core-Headers). * Function objects for operators (`less`, `equal_to`, `greater`, `plus`, etc., and the recently-added `compare_three_way`) now emit `[[nodiscard]]` warnings. [#1474](https://github.com/microsoft/STL/pull/1474) - Improved throughput: * Replaced one use of tag dispatch with `if constexpr`, and changed several uses of type trait structs to variable templates (which the MSVC compiler recognizes and efficiently handles). [#1413](https://github.com/microsoft/STL/pull/1413) * Added `::std::` qualification to certain names, improving throughput for extremely large `tuple`s (noticeable with 50+ elements). [#1490](https://github.com/microsoft/STL/pull/1490) - Improved documentation: * Added `llvm-project` and the `--progress` option to the README's instructions for the initial submodule sync. This takes longer (a lot longer), but it simplifies the testing instructions later. [#1441](https://github.com/microsoft/STL/pull/1441) - Improved test coverage: * Added more `<charconv>` `to_chars()` test cases. [#1278](https://github.com/microsoft/STL/pull/1278) * Added tests for `get_time()` being called with a format specification that's longer than the stream's contents. [#1326](https://github.com/microsoft/STL/pull/1326) * Updated the `libcxx` test suite. [#1090](https://github.com/microsoft/STL/pull/1090) * Fixed the range adaptor tests to properly test `const` rvalues. [#1393](https://github.com/microsoft/STL/pull/1393) * Overhauled the test harness, improving its performance for both manual and CI runs. (For example, on one machine, testing time decreased from 75 minutes to 60 minutes.) [#1394](https://github.com/microsoft/STL/pull/1394) * Added `/analyze:autolog-` to `/analyze:only` test configurations; together, [these compiler options](https://learn.microsoft.com/en-us/cpp/build/reference/analyze-code-analysis?view=msvc-160) run code analysis without producing an object file (`/analyze:only`) and without writing detailed analyzer results to an XML file (`/analyze:autolog-`), as we're simply looking for any warnings from code analysis. [#1434](https://github.com/microsoft/STL/pull/1434) * Skipped parts of `tests/std/tests/VSO_0226079_mutex` that could intermittently fail due to `system_clock` time adjustments on virtual machines. [#1473](https://github.com/microsoft/STL/pull/1473) - Code cleanups: * Removed compiler bug workarounds. [#1291](https://github.com/microsoft/STL/pull/1291) [#1327](https://github.com/microsoft/STL/pull/1327) [#1451](https://github.com/microsoft/STL/pull/1451) * Removed unused `#include` directives from `stl/src` files, and changed inclusions from `<meow.h>` to `<cmeow>`. [#1270](https://github.com/microsoft/STL/pull/1270) * Removed unnecessary macros and a compiler bug workaround. [#1307](https://github.com/microsoft/STL/pull/1307) * Removed unnecessary code in `ranges::uninitialized_default_construct_n`. [#1377](https://github.com/microsoft/STL/pull/1377) * Changed test code to consistently use `unsigned int` instead of `unsigned`. [#1390](https://github.com/microsoft/STL/pull/1390) * Moved helper structs in separately compiled code into unnamed namespaces. [#1398](https://github.com/microsoft/STL/pull/1398) * Changed test code to construct `initializer_list` with Standard code, instead of our internal constructor. [#1400](https://github.com/microsoft/STL/pull/1400) * Changed test code to always `remove_cvref_t` the argument to `enable_borrowed_range` (because the library doesn't allow user specializations for cv-qualified types or reference types). [#1415](https://github.com/microsoft/STL/pull/1415) * Renamed internal `<ranges>` machinery to `_Category_base`, which avoids shadowing the internal `_Iterator_base` used throughout the STL. [#1420](https://github.com/microsoft/STL/pull/1420) * Improved the readability of the `<ranges>` "expression-equivalent" machinery by extracting a `constexpr` "strategy" variable. [#1426](https://github.com/microsoft/STL/pull/1426) * Removed comments that were citing proposed resolutions for LWG issues, now that those issues have been officially resolved by the November 2020 virtual plenary meeting. [#1456](https://github.com/microsoft/STL/pull/1456) * Unified internal machinery for floating-point type traits. [#1442](https://github.com/microsoft/STL/pull/1442) * Fixed a comment that was mentioning a non-existent parameter. [#1476](https://github.com/microsoft/STL/pull/1476) - Infrastructure improvements: * Our pre-build code checks ("validate" and "clang-format") now both run even if one fails, and the tests are now skipped when the build fails. (Certainly one of our most leet contributions.) [#1337](https://github.com/microsoft/STL/pull/1337) * Accelerated CI tests by dividing them into shards across many machines. [#1414](https://github.com/microsoft/STL/pull/1414) * Updated dependencies. + Updated build compiler to VS 2019 16.9 Preview 1. [#1290](https://github.com/microsoft/STL/pull/1290) [#1399](https://github.com/microsoft/STL/pull/1399) [#1451](https://github.com/microsoft/STL/pull/1451) + Updated Python to 3.9.0. [#1371](https://github.com/microsoft/STL/pull/1371) - Updated `_MSVC_STL_UPDATE`. [#1272](https://github.com/microsoft/STL/pull/1272) [#1340](https://github.com/microsoft/STL/pull/1340) [#1439](https://github.com/microsoft/STL/pull/1439)

vs-2019-16.8

VS 2019 16.8 - Merged C++20 features: * [P0019R8](https://wg21.link/P0019R8) [#843](https://github.com/microsoft/STL/pull/843) `atomic_ref` * [P0528R3](https://wg21.link/P0528R3) [#1029](https://github.com/microsoft/STL/pull/1029) Atomic Compare-And-Exchange With Padding Bits (for MSVC; Clang support is pending compiler intrinsics, see [LLVM-46685](https://github.com/llvm/llvm-project/issues/46030)) * Completed [P0553R4](https://wg21.link/P0553R4) and [P0556R3](https://wg21.link/P0556R3) [#795](https://github.com/microsoft/STL/pull/795) by adding MSVC support for the functions in `<bit>` that were previously only supported when compiling with Clang (`bit_ceil`, `bit_floor`, `bit_width`, `countl_one`, `countl_zero`, `countr_one`, `countr_zero`, `has_single_bit`, `popcount`, `rotl`, and `rotr`). * Completed [P0811R3](https://wg21.link/P0811R3) [#1048](https://github.com/microsoft/STL/pull/1048) `midpoint()`, `lerp()` by adding `constexpr` support and improving handling of infinite arguments. * [P0912R5](https://wg21.link/P0912R5) [#894](https://github.com/microsoft/STL/pull/894) [#961](https://github.com/microsoft/STL/pull/961) [#1204](https://github.com/microsoft/STL/pull/1204) Library Support For Coroutines * [P1001R2](https://wg21.link/P1001R2) [#1111](https://github.com/microsoft/STL/pull/1111) `execution::unseq` * [P1032R1](https://wg21.link/P1032R1) [#491](https://github.com/microsoft/STL/pull/491) [#861](https://github.com/microsoft/STL/pull/861) Miscellaneous `constexpr` * [P1065R2](https://wg21.link/P1065R2) [#703](https://github.com/microsoft/STL/pull/703) `constexpr` INVOKE * Completed [P1135R6](https://wg21.link/P1135R6) The C++20 Synchronization Library: + This feature adds a new satellite DLL "`atomic_wait`". + [#593](https://github.com/microsoft/STL/pull/593) [#1143](https://github.com/microsoft/STL/pull/1143) [#1179](https://github.com/microsoft/STL/pull/1179) `std::atomic::wait` + [P1644R0](https://wg21.link/P1644R0) [#1136](https://github.com/microsoft/STL/pull/1136) Adding wait/notify To `atomic<shared_ptr<T>>`, `atomic<weak_ptr<T>>` + [#1057](https://github.com/microsoft/STL/pull/1057) `<barrier>`, `<latch>`, and `<semaphore>` - Merged *partial* C++20 features: * [P0896R4](https://wg21.link/P0896R4) Ranges: + [#888](https://github.com/microsoft/STL/pull/888) algorithm `ranges::move` + [#892](https://github.com/microsoft/STL/pull/892) algorithm `ranges::is_permutation` + [#896](https://github.com/microsoft/STL/pull/896) algorithm `ranges::search` + [#904](https://github.com/microsoft/STL/pull/904) algorithms `ranges::fill` and `ranges::fill_n` + [#905](https://github.com/microsoft/STL/pull/905) algorithms `ranges::generate` and `ranges::generate_n` + [#914](https://github.com/microsoft/STL/pull/914) algorithm `ranges::search_n` + [#915](https://github.com/microsoft/STL/pull/915) algorithms `ranges::is_sorted` and `ranges::is_sorted_until` + [#916](https://github.com/microsoft/STL/pull/916) algorithms `ranges::min`, `ranges::max`, `ranges::minmax`, `ranges::clamp`, `ranges::min_element`, `ranges::max_element`, and `ranges::minmax_element` + [#917](https://github.com/microsoft/STL/pull/917) algorithms `ranges::lower_bound`, `ranges::upper_bound`, `ranges::equal_range`, and `ranges::binary_search` + [#918](https://github.com/microsoft/STL/pull/918) algorithm `ranges::swap_ranges` + [#925](https://github.com/microsoft/STL/pull/925) concepts `std::permutable` and `std::sortable` + [#930](https://github.com/microsoft/STL/pull/930) algorithms `ranges::is_heap`, `ranges::is_heap_until`, `ranges::make_heap`, `ranges::push_heap`, `ranges::pop_heap`, and `ranges::sort_heap` + [#941](https://github.com/microsoft/STL/pull/941) algorithm `ranges::transform` + [#976](https://github.com/microsoft/STL/pull/976) algorithms `ranges::is_partitioned`, `ranges::partition`, `ranges::partition_copy`, and `ranges::partition_point` + [#983](https://github.com/microsoft/STL/pull/983) algorithms `ranges::replace`, `ranges::replace_copy`, and `ranges::replace_copy_if` + [#984](https://github.com/microsoft/STL/pull/984) algorithm `ranges::replace_if` + [#1005](https://github.com/microsoft/STL/pull/1005) algorithms `ranges::remove`, `ranges::remove_if`, `ranges::remove_copy`, and `ranges::remove_copy_if` + [#1026](https://github.com/microsoft/STL/pull/1026) algorithm `ranges::copy_backward` + [#1028](https://github.com/microsoft/STL/pull/1028) algorithm `ranges::reverse` (vectorized like `std::reverse`) + [#1039](https://github.com/microsoft/STL/pull/1039) algorithms `ranges::unique` and `ranges::unique_copy` + [#1044](https://github.com/microsoft/STL/pull/1044) Concept `mergeable`, and algorithms `ranges::includes`, `ranges::set_difference`, `ranges::set_intersection`, `ranges::set_symmetric_difference`, and `ranges::set_union` + [#1052](https://github.com/microsoft/STL/pull/1052) algorithms `ranges::sample` and `ranges::shuffle` + [#1053](https://github.com/microsoft/STL/pull/1053) algorithm `ranges::move_backward` + [#1063](https://github.com/microsoft/STL/pull/1063) algorithm `ranges::nth_element` + [#1073](https://github.com/microsoft/STL/pull/1073) algorithms `ranges::rotate` and `ranges::rotate_copy` + [#1076](https://github.com/microsoft/STL/pull/1076) range access function `ranges::ssize` + [#1081](https://github.com/microsoft/STL/pull/1081) algorithm `ranges::lexicographical_compare` + [#1083](https://github.com/microsoft/STL/pull/1083) iterator adaptor `counted_iterator` + [#1095](https://github.com/microsoft/STL/pull/1095) algorithm `ranges::reverse_copy` (vectorized like `std::reverse_copy`) + [#1099](https://github.com/microsoft/STL/pull/1099) algorithms `ranges::next_permutation` and `ranges::prev_permutation` + [#1101](https://github.com/microsoft/STL/pull/1101) algorithm `ranges::merge` + [#1127](https://github.com/microsoft/STL/pull/1127) algorithm `ranges::sort` + [#1132](https://github.com/microsoft/STL/pull/1132) view `ranges::ref_view` + [#1137](https://github.com/microsoft/STL/pull/1137) algorithm `ranges::uninitialized_move` + [#1201](https://github.com/microsoft/STL/pull/1201) range factories `views::empty` and `views::single` + [#1229](https://github.com/microsoft/STL/pull/1229) range adaptors `views::all` and `views::reverse` + [#1231](https://github.com/microsoft/STL/pull/1231) algorithms `ranges::partial_sort` and `ranges::partial_sort_copy` + [#1245](https://github.com/microsoft/STL/pull/1245) [P1391R4](https://wg21.link/P1391R4) Range Constructor For `string_view` + [#1252](https://github.com/microsoft/STL/pull/1252) range adaptor `views::filter` + [#1253](https://github.com/microsoft/STL/pull/1253) range adaptors `views::drop` and `views::take` + [#1258](https://github.com/microsoft/STL/pull/1258) range adaptor `views::transform` - Merged LWG issue resolutions: * [LWG-1203](https://wg21.link/lwg1203) [#1225](https://github.com/microsoft/STL/pull/1225) More useful rvalue stream insertion * [LWG-2597](https://wg21.link/lwg2597) [#884](https://github.com/microsoft/STL/pull/884) `std::log` misspecified for complex numbers * [LWG-3070](https://wg21.link/lwg3070) [#923](https://github.com/microsoft/STL/pull/923) `path::lexically_relative` causes surprising results if a filename can also be a root-name - Fixed bugs: * `variant` no longer emits warnings about narrowing/sign conversions when determining which alternative should be activated for a given initializer. (Warnings can still be emitted by the chosen initialization; that's intentional and desirable.) [#858](https://github.com/microsoft/STL/pull/858) * `condition_variable_any` now correctly unlocks-and-relocks the lock argument to timed wait functions when given a non-positive relative timeout or absolute time in the past. [#685](https://github.com/microsoft/STL/pull/685) * `std::pow` is now templated to handle integral and floating-point types as required by C++11 and later. For example, `std::pow(float, int)` previously returned `float` and now returns `double`. [#903](https://github.com/microsoft/STL/pull/903) * Removed a bogus overload of `ranges::copy_n` that wasn't supposed to exist and wouldn't have compiled. [#957](https://github.com/microsoft/STL/pull/957) * `filesystem_error` now transcodes wide characters with no equivalent in the current locale to replacement characters instead of failing and throwing `system error`. [#1010](https://github.com/microsoft/STL/pull/1010) * Fixed `0 <=> partial_ordering::unordered` to return the correct value, and improved `<compare>` codegen. [#1049](https://github.com/microsoft/STL/pull/1049) * `discrete_distribution` no longer yields invalid results when its parameters sum very close to, but not equal to 1. [#1025](https://github.com/microsoft/STL/pull/1025) * `move_iterator::current` is no longer inadvertently a `protected` data member - it has become properly `private` and been renamed. [#1080](https://github.com/microsoft/STL/pull/1080) * Range algorithms no longer mishandle pointer-to-member predicates and projections when they are larger than `void*`. [#1091](https://github.com/microsoft/STL/pull/1091) * The `slice_array`, `gslice_array`, `mask_array`, and `indirect_array` helpers defined in `<valarray>` now have proper copy constructors and copy assignment operators. [#988](https://github.com/microsoft/STL/pull/988) * Fixed a bug in `ranges::iter_swap` that would cause it to sometimes drop one of the "swapped" values on the floor. [#1072](https://github.com/microsoft/STL/pull/1072) * `weak_ptr` conversions now preserve control blocks for expired objects. [#1104](https://github.com/microsoft/STL/pull/1104) * Fixed `<bit>`'s `countl_zero` to correctly use the `bsr` instruction as a fallback for old CPUs that don't support the `lzcnt` instruction. [#1108](https://github.com/microsoft/STL/pull/1108) [#1166](https://github.com/microsoft/STL/pull/1166) * Fixed `partial_sort_copy` to perform only operations that are required by the Standard to compile. [#1088](https://github.com/microsoft/STL/pull/1088) * Fixed `deque::erase(iter, iter)` to no longer perform self-move-assignments when called with an empty range. [#1148](https://github.com/microsoft/STL/pull/1148) * Fixed `coroutine_handle<>::resume` and `coroutine_handle<>::operator()` to allow exceptions to be thrown from coroutines. [#1182](https://github.com/microsoft/STL/pull/1182) * Fixed `piecewise_constant_distribution` and `piecewise_linear_distribution` to return correctly distributed values. [#1032](https://github.com/microsoft/STL/pull/1032) * Fixed `deque` (and therefore `queue` and `stack`) compiler errors in unusual scenarios where `iter + int` and `iter - int` would invoke an unexpected operator overload. [#1161](https://github.com/microsoft/STL/pull/1161) * Fixed `any` and `atomic` compiler errors when building with [`/Zc:noexceptTypes-`](https://learn.microsoft.com/en-us/cpp/build/reference/zc-noexcepttypes?view=msvc-160). [#1150](https://github.com/microsoft/STL/pull/1150) * Fixed `<charconv>` hexfloat `from_chars()` to correctly handle numbers like `"0.fffffffffffff8p-1022"` which are just below `numeric_limits<Floating>::min()`. [#934](https://github.com/microsoft/STL/pull/934) * Changed `shared_ptr`'s atomic functions to use `SRWLOCK` instead of a naive spinlock, fixing priority inversion and improving performance. [#1200](https://github.com/microsoft/STL/pull/1200) * Fixed incorrect constants that were producing incorrect results for `cosh()` and `sinh()`. [#1156](https://github.com/microsoft/STL/pull/1156) * Fixed 3 bugs in how `ostream << floating_point` handles precision: [#1173](https://github.com/microsoft/STL/pull/1173) + Hexfloat output now ignores precision, as required by the Standard. + Implemented [LWG-231](https://wg21.link/lwg231) (resolved in C++11, but overlooked); now, `0` precision for scientific or general notation is directly passed to `sprintf`, instead of being replaced with `6` precision. + Negative precision no longer crashes. * `get_time()` now ignores case when parsing day and month names, as required by the Standard. [#1168](https://github.com/microsoft/STL/pull/1168) [#1240](https://github.com/microsoft/STL/pull/1240) * `<experimental/generator>` now defines an `unhandled_exception()` member function, required for C++20 coroutine promise types, even when `/EHs` isn't being used. [#1219](https://github.com/microsoft/STL/pull/1219) * Fixed compiler errors in the "iterator unwrapping" machinery for `counted_iterator`. [#1213](https://github.com/microsoft/STL/pull/1213) * `fill` now works correctly with pointers-to-`volatile` integral types. (This change also applies our `memset`/`memcmp` optimizations for `fill`/`equal` a bit more aggressively; they now activate for filling contiguous ranges of `bool` or comparing such with contiguous ranges of single-byte integer types.) [#1160](https://github.com/microsoft/STL/pull/1160) * `valarray::operator[]` now verifies its argument is in range when `/D_CONTAINER_DEBUG_LEVEL=1`. [#1247](https://github.com/microsoft/STL/pull/1247) * Fixed a compiler error in `<complex>` (introduced in VS 2019 16.7 by [#367](https://github.com/microsoft/STL/pull/367)) when compiling with the Intel C++ Compiler's 80-bit `long double` mode. [#1316](https://github.com/microsoft/STL/pull/1316) + *Note:* 80-bit `long double` remains unsupported by MSVC. - Improved performance: * Extended `equal()`'s `memcmp()` optimization to `ranges::equal_to` and arbitrary contiguous iterators. [#831](https://github.com/microsoft/STL/pull/831) * `optional` no longer unnecessarily zero-fills its storage when default constructed. [#878](https://github.com/microsoft/STL/pull/878) * Improved `span`'s debug codegen by simplifying its representation (as `/std:c++latest` isn't ABI-frozen). [#877](https://github.com/microsoft/STL/pull/877) * Use `__iso_volatile_store64` for relaxed atomics on x86, and use `__iso_volatile_store64` unconditionally. [#694](https://github.com/microsoft/STL/pull/694) * Enabled more `constexpr` in `<system_error>` using the `[[msvc::noop_dtor]]` attribute we requested from the MSVC compiler front-end. [#1016](https://github.com/microsoft/STL/pull/1016) * Hand-vectorized `std::reverse_copy`. [#804](https://github.com/microsoft/STL/pull/804) * Refactored the comparison category types into aggregates so they can be passed in registers. [#1065](https://github.com/microsoft/STL/pull/1065) * Optimized `std::fill` and `std::fill_n` for `vector<bool>`. [#879](https://github.com/microsoft/STL/pull/879) * Applied `DisableThreadLibraryCalls` to all "satellite" DLLs. [#1142](https://github.com/microsoft/STL/pull/1142) * Improved debug codegen in `<valarray>` by extracting repeated calls to `size()`. Also improved readability by expanding macros, and avoided unnecessary use of magic statics for non-trivial types. [#1165](https://github.com/microsoft/STL/pull/1165) * `vector` now avoids quadratic complexity when its `size()` is near `max_size()` (which is effectively impossible for the default `allocator`, making this an extremely obscure scenario). Now, if geometric growth would exceed `max_size()`, we clamp to `max_size()`. [#1221](https://github.com/microsoft/STL/pull/1221) - Enhanced behavior: * Strengthened `noexcept` for all container iterators. [#1227](https://github.com/microsoft/STL/pull/1227) * `basic_string` and `basic_string_view` now enforce the requirement that their character types must be non-array, trivial, standard-layout types. [#1262](https://github.com/microsoft/STL/pull/1262) - Improved throughput: * Simplified `is_function`, `is_object`, `is_member_function_pointer`, `is_member_object_pointer`, and `is_member_pointer`. [#460](https://github.com/microsoft/STL/pull/460) - Improved documentation: * The README's IDE instructions now explain how to use the vcpkg submodule. [#873](https://github.com/microsoft/STL/pull/873) * The README's command prompt instructions now explicitly explain how to build both x86 and x64. [#1226](https://github.com/microsoft/STL/pull/1226) - Improved test coverage: * Added test cases for the large integer fallback in `<charconv>` `to_chars()` plain shortest round-trip. [#835](https://github.com/microsoft/STL/pull/835) * Future-proofed test code for the upcoming addition of C++20 `std::chrono::last`. [#837](https://github.com/microsoft/STL/pull/837) * Enabled more libcxx test coverage for `span`. [#839](https://github.com/microsoft/STL/pull/839) * Added test coverage for the new `/Zc:preprocessor` compiler option. [#677](https://github.com/microsoft/STL/pull/677) * Added tests for [LWG-3018](https://wg21.link/lwg3018) "`shared_ptr` of function type". [#833](https://github.com/microsoft/STL/pull/833) * Fixed "unresolved" tests by linking with [`/MANIFEST:EMBED`](https://learn.microsoft.com/en-us/cpp/build/reference/manifest-create-side-by-side-assembly-manifest?view=msvc-160). [#862](https://github.com/microsoft/STL/pull/862) * The test harness now emits a "note" for unsupported locales instead of a warning. [#866](https://github.com/microsoft/STL/pull/866) * Prevented failing tests from displaying assertion/crash dialog boxes. Also, the standard output streams of failing tests are no longer lost due to buffering. [#906](https://github.com/microsoft/STL/pull/906) * Increased test coverage in the ranges spaceship test by removing compiler bug workarounds. [#852](https://github.com/microsoft/STL/pull/852) * Improved ranges test machinery. [#959](https://github.com/microsoft/STL/pull/959) * Enabled "multiple translation unit" tests which hadn't been running in the new test infrastructure. These tests detect problems like forgetting to mark header-only non-templated functions as `inline`. [#1109](https://github.com/microsoft/STL/pull/1109) * Added a test to verify that `deque::erase(iter, iter)` no longer performs self-move-assignments when called with an empty range. [#1203](https://github.com/microsoft/STL/pull/1203) * Removed experimental `/await` from test configurations, and re-enabled various tests now that compiler bugs have been fixed. [#1207](https://github.com/microsoft/STL/pull/1207) * Added a test for `<coroutine>` "end-to-end" behavior. [#1215](https://github.com/microsoft/STL/pull/1215) - Code cleanups: * Updated comment to cite [LWG-3446](https://wg21.link/lwg3446). [#841](https://github.com/microsoft/STL/pull/841) * Renamed identifiers like `_R1` to `_Rx1`, avoiding any resemblance to macros. [#865](https://github.com/microsoft/STL/pull/865) * Added comments to `<execution>`, mentioning the subtle control flow. [#849](https://github.com/microsoft/STL/pull/849) * Avoided function-style casts in test code. [#899](https://github.com/microsoft/STL/pull/899) * Cleaned up `stl/src`, changing C casts to C++ casts, `0` to `nullptr`, and more. [#900](https://github.com/microsoft/STL/pull/900) [#912](https://github.com/microsoft/STL/pull/912) * Added `ranges::_Ubegin` and `ranges::_Uend` internal helper functions to simplify getting "unwrapped" iterators from a range. [#901](https://github.com/microsoft/STL/pull/901) * Renamed internal headers to `.hpp` and adjusted `clang-format` to sort them last. [#902](https://github.com/microsoft/STL/pull/902) * Simplified comments, as `using _Pred` and `using operator<` weren't necessary to mention. [#977](https://github.com/microsoft/STL/pull/977) * Removed compiler workarounds and used braces to construct objects. [#978](https://github.com/microsoft/STL/pull/978) [#1020](https://github.com/microsoft/STL/pull/1020) * Improved ranges test machinery to better tolerate `using`-directives. [#979](https://github.com/microsoft/STL/pull/979) * Consistently formatted `requires`, preparing for when clang-format becomes aware of concepts. [#999](https://github.com/microsoft/STL/pull/999) * Provided comparison operators for `map`, `multimap`, `set`, and `multiset` instead of their internal base class `_Tree`. [#1022](https://github.com/microsoft/STL/pull/1022) * Updated the implementations of some of the oldest Range algorithms to match our current style: + [#956](https://github.com/microsoft/STL/pull/956) `ranges::copy` + [#958](https://github.com/microsoft/STL/pull/958) `ranges::copy_if` + [#970](https://github.com/microsoft/STL/pull/970) `ranges::move` + [#974](https://github.com/microsoft/STL/pull/974) `ranges::count` + [#975](https://github.com/microsoft/STL/pull/975) `ranges::count_if` + [#1058](https://github.com/microsoft/STL/pull/1058) the `ranges::find` family + [#1060](https://github.com/microsoft/STL/pull/1060) the `ranges::for_each` family + [#1061](https://github.com/microsoft/STL/pull/1061) the `ranges::all_of` family + [#1062](https://github.com/microsoft/STL/pull/1062) `ranges::swap_ranges` and `ranges::distance` * Took advantage of some of the clang-format changes in LLVM 10 to keep our codebase looking nice. [#1075](https://github.com/microsoft/STL/pull/1075) * Removed unnecessary `std::` qualification from product and test code. [#1119](https://github.com/microsoft/STL/pull/1119) * Cleaned up compiler bug workarounds, which will be possible to remove in the near future. [#1191](https://github.com/microsoft/STL/pull/1191) * Worked around some IntelliSense bugs in the concepts-enabled C++20 parts of the STL. [#1216](https://github.com/microsoft/STL/pull/1216) * Removed an unnecessary compiler option `/d2Zi+` from `CMakeLists.txt`. [#1218](https://github.com/microsoft/STL/pull/1218) * Consistently use `conjunction_v` for short-circuiting in conditional `explicit` clauses. [#1241](https://github.com/microsoft/STL/pull/1241) * Avoided null pointer constants masquerading as integers by replacing `0` with `nullptr` in a great many places. [#1250](https://github.com/microsoft/STL/pull/1250) - Infrastructure improvements: * Updated dependencies. + Updated build compiler to VS 2019 16.8 Preview 1. [#851](https://github.com/microsoft/STL/pull/851) [#911](https://github.com/microsoft/STL/pull/911) [#1015](https://github.com/microsoft/STL/pull/1015) [#1153](https://github.com/microsoft/STL/pull/1153) [#1185](https://github.com/microsoft/STL/pull/1185) + Updated vcpkg to 2020.06. [#1042](https://github.com/microsoft/STL/pull/1042) * `CMakeLists.txt` now defaults to using our `vcpkg` submodule, simplifying our build process. [#1124](https://github.com/microsoft/STL/pull/1124) * Removed a timing assumption from `test_atomic_wait.hpp` that was causing intermittent test failures. * Added `/analyze` to PR/CI builds, and fixed the resulting warnings. [#1009](https://github.com/microsoft/STL/pull/1009) * Enhanced our Code Format Validation check to detect lines exceeding 120 columns, and cleaned up a few occurrences in areas where clang-format had been suppressed. [#1214](https://github.com/microsoft/STL/pull/1214) - Updated `_MSVC_STL_UPDATE`. [#897](https://github.com/microsoft/STL/pull/897) [#989](https://github.com/microsoft/STL/pull/989) [#1144](https://github.com/microsoft/STL/pull/1144)

vs-2019-16.7

VS 2019 16.7 - Merged C++20 features: * [P0415R1](https://wg21.link/P0415R1) [#367](https://github.com/microsoft/STL/pull/367) `constexpr` For `<complex>` (Again) * [P0476R2](https://wg21.link/P0476R2) [#583](https://github.com/microsoft/STL/pull/583) `<bit>` `bit_cast` * [P0586R2](https://wg21.link/P0586R2) [#621](https://github.com/microsoft/STL/pull/621) Integer Comparison Functions * [P0674R1](https://wg21.link/P0674R1) [#309](https://github.com/microsoft/STL/pull/309) `make_shared()` For Arrays + [LWG-3005](https://wg21.link/lwg3005) Destruction order of arrays by `make_shared`/`allocate_shared` only recommended? + [LWG-3007](https://wg21.link/lwg3007) `allocate_shared` should rebind allocator to cv-unqualified `value_type` for construction * [P0718R2](https://wg21.link/P0718R2) [#601](https://github.com/microsoft/STL/pull/601) `atomic<shared_ptr<T>>`, `atomic<weak_ptr<T>>` * [P0722R3](https://wg21.link/P0722R3) [#692](https://github.com/microsoft/STL/pull/692) Efficient Sized `delete` For Variable Sized Classes (library support types) * [P1023R0](https://wg21.link/P1023R0) [#599](https://github.com/microsoft/STL/pull/599) `constexpr` For `std::array` Comparisons * [P1115R3](https://wg21.link/P1115R3) [#566](https://github.com/microsoft/STL/pull/566) `erase()`/`erase_if()` Return `size_type` * [P1831R1](https://wg21.link/P1831R1) [#634](https://github.com/microsoft/STL/pull/634) Deprecating `volatile` In The Standard Library * [P1871R1](https://wg21.link/P1871R1) [#607](https://github.com/microsoft/STL/pull/607) `disable_sized_sentinel_for`; renames `disable_sized_sentinel` to `disable_sized_sentinel_for`. * [P1956R1](https://wg21.link/P1956R1) [#524](https://github.com/microsoft/STL/pull/524) `<bit>` `has_single_bit()`, `bit_ceil()`, `bit_floor()`, `bit_width()` * [P1976R2](https://wg21.link/P1976R2) [#500](https://github.com/microsoft/STL/pull/500) Explicit Constructors For Fixed-Extent `span` From Dynamic-Extent Ranges * [P2116R0](https://wg21.link/P2116R0) [#587](https://github.com/microsoft/STL/pull/587) Removing `tuple`-Like Protocol Support From Fixed-Extent `span` - Merged *partial* C++20 features: * [P0768R1](https://wg21.link/P0768R1) [#515](https://github.com/microsoft/STL/pull/515) Library Support For The Spaceship Comparison Operator `<=>`; includes `lexicographical_compare_three_way`. * [P0784R7](https://wg21.link/P0784R7) [#501](https://github.com/microsoft/STL/pull/501) Library Support For More `constexpr` Containers; includes `construct_at`. * [P0896R4](https://wg21.link/P0896R4) Ranges: + [#385](https://github.com/microsoft/STL/pull/385) function objects `ranges::equal_to`, `ranges::not_equal_to`, `ranges::less`, `ranges::less_equal`, `ranges::greater`, and `ranges::greater_equal` + [#734](https://github.com/microsoft/STL/pull/734) `ranges::subrange` and `ranges::view_interface` + [#759](https://github.com/microsoft/STL/pull/759) changes to `reverse_iterator` to better adapt C++20 iterators + [#787](https://github.com/microsoft/STL/pull/787) similar changes to `move_iterator`, implement `move_sentinel` + [#815](https://github.com/microsoft/STL/pull/815) algorithm `ranges::find_end` + [#821](https://github.com/microsoft/STL/pull/821) algorithm `ranges::find_first_of` + [#822](https://github.com/microsoft/STL/pull/822) algorithm `ranges::adjacent_find` * [P1135R6](https://wg21.link/P1135R6) The C++20 Synchronization Library; includes `atomic_flag::test` and lock-free integral types. [#684](https://github.com/microsoft/STL/pull/684) * [P1614R2](https://wg21.link/P1614R2) [#385](https://github.com/microsoft/STL/pull/385) Adding Spaceship `<=>` To The Library; includes concepts `three_way_comparable` and `three_way_comparable_with`, type trait `compare_three_way_result` (with `_t` variant), and function object `compare_three_way`. - Merged LWG issue resolutions: * [LWG-3149](https://wg21.link/lwg3149) [#635](https://github.com/microsoft/STL/pull/635) `DefaultConstructible` should require default initialization * [LWG-3255](https://wg21.link/lwg3255) [#506](https://github.com/microsoft/STL/pull/506) `span`'s `array` constructor is too strict * [LWG-3320](https://wg21.link/lwg3320) [#548](https://github.com/microsoft/STL/pull/548) `span::cbegin/cend` methods produce different results than `std::[ranges::]cbegin/cend` * [LWG-3329](https://wg21.link/lwg3329) [#512](https://github.com/microsoft/STL/pull/512) `totally_ordered_with` both directly and indirectly requires `common_reference_with` * [LWG-3330](https://wg21.link/lwg3330) [#513](https://github.com/microsoft/STL/pull/513) Include `<compare>` from most library headers * [LWG-3390](https://wg21.link/lwg3390) [#567](https://github.com/microsoft/STL/pull/567) `make_move_iterator()` cannot be used to construct a `move_iterator` for a move-only iterator - Merged *proposed* resolutions for LWG issues that were eventually accepted at the November 2020 virtual plenary meeting: * [LWG-3420](https://wg21.link/lwg3420) [#786](https://github.com/microsoft/STL/pull/786) _`cpp17-iterator`_ should check that the type looks like an iterator first * [LWG-3446](https://wg21.link/lwg3446) [#834](https://github.com/microsoft/STL/pull/834) `indirectly_readable_traits` ambiguity for types with both `value_type` and `element_type` - Fixed bugs: * `operator/` and `operator%` for `chrono::duration` now properly SFINAE away when `common_type_t<Rep1, Rep2>` can't be formed. [#573](https://github.com/microsoft/STL/pull/573) * `<filesystem>` `directory_iterator` now properly handles `"."` and `".."` on network drives. [#494](https://github.com/microsoft/STL/pull/494) * `<filesystem>` `space()` no longer requires read permissions for every directory along the path in some cases, and resolves symbolic links. [#552](https://github.com/microsoft/STL/pull/552) * `<filesystem>` now considers `ERROR_BAD_NETPATH` as a "file does not exist" condition. [#616](https://github.com/microsoft/STL/pull/616) * `filesystem::path::path(const Source&)` is now properly removed from overload resolution when `Source` is a non-iterator with member `value_type` even in C++20 mode. [#631](https://github.com/microsoft/STL/pull/631) * The CMake release build now correctly uses the compiler flags in `VCLIBS_RELEASE_OPTIONS`. [#608](https://github.com/microsoft/STL/pull/610) * Enabled the implementation of [LWG-2899](https://wg21.link/lwg2899) in `/clr` mode now that the fix for the compiler bug triggered by such (VSO-1006185) has been released. [#417](https://github.com/microsoft/STL/pull/417) * Fixed a bug specific to Clang 10 in `<system_error>` and removed the `_SILENCE_CLANG_CONCEPTS_MESSAGE` barrier in `<concepts>` now that we've worked with Clang developers to ensure Clang 10 and the STL play well together with Concepts enabled. [#622](https://github.com/microsoft/STL/pull/622) * `__cpp_lib_int_pow2` is no longer incorrectly defined when the compiler lacks support for the intrinsics necessary to implement `has_single_bit`, `bit_ceil`, `bit_floor`, and `bit_width`. Also, `__cpp_lib_bitops` is no longer defined when the compiler is EDG-imitating-MSVC, so IntelliSense properly reflects the non-availability of operations not yet supported by MSVC. [#695](https://github.com/microsoft/STL/pull/695) * Fixed a 43-year-old bug in `boyer_moore_searcher` by implementing a 40-year-old fix. [#724](https://github.com/microsoft/STL/pull/724) * `std::function` now handles over-aligned types. [#698](https://github.com/microsoft/STL/pull/698) * `<cvt/sjis_0208>` now correctly recognizes bad second bytes. [#755](https://github.com/microsoft/STL/pull/755) * Fixed several bugs in `complex`'s Sufficient Additional Overloads. [#791](https://github.com/microsoft/STL/pull/791) + `arg(real)` now behaves like `arg(complex)`, instead of always returning `0`. + `conj(real)` now behaves like `conj(complex)`, returning an imaginary part of negative zero. + `proj(real)` now behaves like `proj(complex)`, mapping negative infinity to positive infinity. + `conj` and `proj` now return `complex`. + `norm` now upgrades integers to `double` before squaring, instead of after. * `<filesystem>` now consistently handles nonexistent network paths when the Windows API emits `ERROR_INVALID_NAME`. [#800](https://github.com/microsoft/STL/pull/800) * Fixed a race condition in the parallel `adjacent_find` algorithm that could cause it to return a result other than the first under heavy load. [#816](https://github.com/microsoft/STL/pull/816) - Enhanced behavior: * Strengthened `noexcept` for `array` iterators, also improving the behavior of `span` construction from `array` iterators. [#627](https://github.com/microsoft/STL/pull/627) * Removed a `static_assert` in `<atomic>` that prevented certain (completely conforming) usage from compiling until users defined the macro `_ENABLE_ATOMIC_ALIGNMENT_FIX`. Note: MSVC's STL has generated correct code for such usage since VS 2015 Update 2, so this change doesn't degrade correctness in any way - it merely removes an annoying compilation roadblock that warned about potential ODR violations when mixing code compiled with ancient toolsets that generated incorrect code for such usage in the first place. [#723](https://github.com/microsoft/STL/pull/723) * Enabled `bit_cast` for IntelliSense now that front-end support is available. [#733](https://github.com/microsoft/STL/pull/733) * `complex`'s `real(T)` and `imag(T)` setters now properly return `void`. [#367](https://github.com/microsoft/STL/pull/367) * Fixed Clang warnings in STL headers (when they aren't suppressed by Clang's treatment of "system headers") and enhanced test coverage to remain clean. [#755](https://github.com/microsoft/STL/pull/755) * We now detect compiler support for `consteval` by testing `__cpp_consteval`. [#765](https://github.com/microsoft/STL/pull/765) * Fixed CUDA warnings/errors. [#772](https://github.com/microsoft/STL/pull/772) - Improved performance: * Massively improved the performance of `<system_error>` by avoiding the need for synchronization when constructing error categories. [#529](https://github.com/microsoft/STL/pull/529) * Removed layers of calls to helpers and `forward()` in `invoke()`. [#585](https://github.com/microsoft/STL/pull/585) * Cached the result of `QueryPerformanceFrequency` in calls to `steady_clock::now()`. [#646](https://github.com/microsoft/STL/pull/646) * [#653](https://github.com/microsoft/STL/pull/653) attempted to avoid one division in `steady_clock::now()`. This caused a regression where `steady_clock::now()` overflowed after approximately 15 minutes, so it was reverted by [#972](https://github.com/microsoft/STL/pull/972). The revert was ported to VS 2019 16.7 Preview 5, separately from the commit order in GitHub.) * `bitset::all` now returns upon finding the first non-set bit. [#671](https://github.com/microsoft/STL/pull/671) * `gcd` now uses the same machinery as `countr_zero` instead of a hand-rolled bit counting loop. [#665](https://github.com/microsoft/STL/pull/665) * `atomic_thread_fence` now avoids unnecessary contention by using separate guard variables. [#740](https://github.com/microsoft/STL/pull/740) * `<algorithm>` now increments/decrements copies of iterators, which could be more efficient for certain user-defined iterators than adding/subtracting `1`. [#771](https://github.com/microsoft/STL/pull/771) [#803](https://github.com/microsoft/STL/pull/803) * `<mutex>` `call_once` uses `InitOnceBeginInitialize` and `InitOnceComplete` unconditionally now that we no longer support Windows XP, and avoids trips through `try` regions and `std::current_exception`. [#688](https://github.com/microsoft/STL/pull/688) - Improved throughput: * `<array>` no longer includes `<algorithm>`, `<iterator>`, and `<tuple>`; this is a source-breaking change for projects that weren't strict about including what they use. [#482](https://github.com/microsoft/STL/pull/482) * Reworked the machinery for the `is_invocable` family of type traits, improving throughput. [#408](https://github.com/microsoft/STL/pull/408) * `~scoped_lock()` now uses fold expressions, instead of helper functions in `<tuple>` that weren't used by product code anywhere else. [#760](https://github.com/microsoft/STL/pull/760) - Code cleanups: * Consistently use empty braces to construct tags like `_Meow{}`. [#497](https://github.com/microsoft/STL/pull/497) * Avoid declaring multiple variables on a single line. [#550](https://github.com/microsoft/STL/pull/550) * Removed comment now that `to_address()` is now totally `constexpr`. [#568](https://github.com/microsoft/STL/pull/568) * Consistently use `__cpp_lib_byte` to detect whether `std::byte` is available. [#577](https://github.com/microsoft/STL/pull/577) * Replaced `_STATIC_UNLESS_PURE` with `static`. (This was a macro workaround for a compiler bug that was fixed.) [#584](https://github.com/microsoft/STL/pull/584) * Removed `#if 1` `#endif` pair after [LWG-3150](https://wg21.link/lwg3150) was accepted. [#638](https://github.com/microsoft/STL/pull/638) * Removed comments after [LWG-3201](https://wg21.link/lwg3201) was accepted. [#640](https://github.com/microsoft/STL/pull/640) * Updated the STL's required compilers to Clang 10 and MSVC 19.26. [#708](https://github.com/microsoft/STL/pull/708) * Replaced some implicit conversions with explicit conversions to silence the new MSVC warning C5219 `implicit conversion from '%s' to '%s', possible loss of data`. [#730](https://github.com/microsoft/STL/pull/730) * Refactored some `for`-loops to follow the normal pattern. [#709](https://github.com/microsoft/STL/pull/709) * Removed the so-called `_ITERATOR_DEBUG_ARRAY_OVERLOADS` (see [#660](https://github.com/microsoft/STL/issues/660)). [#735](https://github.com/microsoft/STL/pull/735) * Silenced warnings for use of C++20 extensions in downlevel language modes when Clang believes the STL headers are not system headers. [#737](https://github.com/microsoft/STL/pull/737) * Removed and updated compiler bug workarounds. [#742](https://github.com/microsoft/STL/pull/742) * Fixed spelling mistakes. [#743](https://github.com/microsoft/STL/pull/743) * Improved build instructions: now the command-line build matches the IDE build, and respects `.gitignore`. [#764](https://github.com/microsoft/STL/pull/764) * Removed unused `_RAISE` macro. Modernized code to use `{}` for `index_sequence`, `nullptr`, and more C++ casts. Extracted assignments before comparisons. Used `unsigned int` consistently. [#764](https://github.com/microsoft/STL/pull/764) * Avoided shadowing `_Noinit` and removed an unnecessary `struct`. [#772](https://github.com/microsoft/STL/pull/772) * Removed redundant suppressions of warning C6294. [#794](https://github.com/microsoft/STL/pull/794) * Used more empty braces, added `_STD` to `system_category()` etc. calls, changed `<experimental/filesystem>` `error_code` handling to be consistent with Standard `<filesystem>`, removed an unnecessary `using`-directive in `<regex>`. [#827](https://github.com/microsoft/STL/pull/827) - Infrastructure improvements: * Updated dependencies. [#620](https://github.com/microsoft/STL/pull/620) [#645](https://github.com/microsoft/STL/pull/645) + Updated build compiler to VS 2019 16.6 Preview 2. + Updated Clang to 10.0.0. + Updated CMake to 3.16.5. + Updated Ninja to 1.10.0. + Updated Python to 3.8.2. + Added CUDA 10.1 Update 2 (not yet used). [#682](https://github.com/microsoft/STL/pull/682) * Introduced CI testing using `lit`. [#520](https://github.com/microsoft/STL/pull/520) + Fully ported `libcxx` testsuite. + Partially ported `std` testsuite. + Partially ported `tr1` testsuite. [#652](https://github.com/microsoft/STL/pull/652) + Added testing instructions to the README. [#647](https://github.com/microsoft/STL/pull/647) [#783](https://github.com/microsoft/STL/pull/783) + Added `/BE` test coverage (for EDG-powered IntelliSense). [#682](https://github.com/microsoft/STL/pull/682) + Improved test infrastructure (speedups, timeouts, shuffling, etc.). [#769](https://github.com/microsoft/STL/pull/769) + Skipped `/clr` test coverage (as `/clr` support libraries aren't yet built). [#796](https://github.com/microsoft/STL/pull/796) * Updated the pull request template to reflect that testing is now online. [#644](https://github.com/microsoft/STL/pull/644) * `VCLIBS_SUFFIX` is now a CMake cache variable. [#649](https://github.com/microsoft/STL/pull/649) * Improved code format validation: + Reject long paths and paths containing spaces. [#699](https://github.com/microsoft/STL/pull/699) + Moved code format validation into a separate stage. [#682](https://github.com/microsoft/STL/pull/682) + Used `constexpr is_sorted()` in `validate.cpp`. [#650](https://github.com/microsoft/STL/pull/650) * Added a new "question" issue template to encourage folks to ask questions about the STL implementation. [#687](https://github.com/microsoft/STL/pull/687) - Updated `_MSVC_STL_UPDATE`. [#637](https://github.com/microsoft/STL/pull/637) [#676](https://github.com/microsoft/STL/pull/676) [#793](https://github.com/microsoft/STL/pull/793)