Tags: microsoft/STL
Tags
VS 2022 17.13 - Merged C++23 features: * [P2502R2](https://wg21.link/P2502R2) [#4953](#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](#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](#4955) + This fixed a regression that was introduced by [#4091](#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](#4922) * Fixed compiler errors when calling `ranges::inplace_merge` with certain combinations of elements, projections, and comparisons. [#4927](#4927) * Fixed compiler errors in `basic_ispanstream`'s constructor and `basic_ispanstream::span()` taking `ReadOnlyRange&&` with highly unusual types. [#4938](#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](#4951) * Fixed compiler errors when constructing `optional` from highly unusual types. [#4961](#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](#4963) [#4980](#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](#4975) * Fixed compiler errors in `variant`'s converting constructor and converting assignment operator for certain types. [#4966](#4966) * Fixed `bitset`'s streaming operator `operator>>(basic_istream<CharT, Traits>&, bitset<N>&)` to use the stream's `Traits` to compare characters. [#4970](#4970) * Fixed `basic_string` and `list`'s internal constructors to avoid disrupting highly unusual scenarios. [#4976](#4976) * Fixed compiler errors when constructing a `packaged_task` from a move-only function object. [#4946](#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](#4990) * Fixed `ranges::copy_n` to properly handle negative values of n (as a no-op) when activating our `memmove()` optimization. [#5046](#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](#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](#5073) * Fixed `assign_range()` for sequence containers to `static_assert` that the container elements are assignable from the range's reference type. [#5086](#5086) * Fixed compiler errors in various ranges algorithms when used with `views::iota` in certain scenarios. [#5091](#5091) - Improved performance: * Added vectorized implementations of: + `basic_string::find_first_of()`. [#4744](#4744) + `basic_string::find_last_of()`. [#4934](#4934) + `basic_string::find()` for a substring. [#5048](#5048) + `basic_string::rfind()` for a substring. [#5057](#5057) + `basic_string::rfind()` for a single character. [#5087](#5087) + `search()`, `ranges::search`, and `default_searcher`, for 1-byte and 2-byte elements. [#4745](#4745) + `find_end()` and `ranges::find_end`, for 1-byte and 2-byte elements. [#4943](#4943) [#5041](#5041) [#5042](#5042) + `bitset`'s constructors from strings. [#4839](#4839) + `remove()` and `ranges::remove`. [#4987](#4987) * Improved the vectorized implementations of: + `ranges::minmax`, now activated for 1-byte and 2-byte elements. [#4913](#4913) + The `minmax_element()` and `minmax()` algorithm families. [#4917](#4917) [#5016](#5016) * Helped the compiler auto-vectorize: + `swap()` and `ranges::swap` for arrays. [#4991](#4991) + `adjacent_difference()`. [#4958](#4958) [#5061](#5061) [#5079](#5079) [#5097](#5097) * `ranges` algorithms now unwrap output iterators, avoiding unnecessary checking. [#5015](#5015) [#5027](#5027) * Optimized `bitset`'s streaming operators. [#5008](#5008) * Optimized the newline-printing overloads `println(FILE*)`, `println(ostream&)`, and nullary `println()`. [#4672](#4672) * Updated `array` and `vector`'s spaceship comparison operators to take advantage of the vectorized implementation of `lexicographical_compare_three_way()`. [#5078](#5078) * Extended the "key extraction" optimization in the unique associative containers (both ordered and unordered) to handle more types. [#5050](#5050) * Optimized `filesystem::symlink_status()` by avoiding unnecessary Windows API calls. [#5071](#5071) - Improved throughput: * Improved C++23 throughput by not including all of `<ostream>` (which drags in `<format>`) unless the Standard requires it. [#4936](#4936) * Improved C++23 throughput of `<queue>`, `<stack>`, `<stacktrace>`, and `<thread>` by not including all of `<format>`. [#5003](#5003) * Moved `system_clock`, `high_resolution_clock`, and `chrono_literals` from a commonly-included internal header to `<chrono>`. [#5105](#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](#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](#4933) * Silenced CodeQL warnings. [#4942](#4942) [#4985](#4985) [#5072](#5072) * Added a visualizer for `system_clock::time_point`. [#5005](#5005) * Changed some `vector` machinery to use scope guards instead of `throw;`, making debugging easier when exceptions are thrown. [#4977](#4977) * Improved `regex_error::what()`'s message for `regex_constants::error_badbrace`. [#5025](#5025) * Improved `optional<T>::swap()`'s `static_assert` messages when `T` isn't both move constructible and swappable. [#5065](#5065) * Removed `locale::id`'s non-Standard constructor from `size_t` and implicit conversion operator to `size_t`. [#5067](#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](#5099) - Improved test coverage: * Updated tests to work with Clang 18. [#4932](#4932) [#4937](#4937) * Fixed sporadic failures in a `timed_mutex` test. [#4973](#4973) * Extended CUDA test coverage beyond C++14, adding C++17 and C++20. [#4974](#4974) * When Python `psutil` is installed, the test harness now supports a `priority` parameter, defaulting to `idle`. [#5032](#5032) * Increased the consistency of the `swap_ranges()` benchmark by adding allocators to control alignment. [#5043](#5043) * Updated our LLVM submodule, including new tests. [#5038](#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](#5063) - Code cleanups: * Removed compiler bug workarounds. [#4939](#4939) [#4944](#4944) [#4947](#4947) [#5017](#5017) [#5103](#5103) * Explicitly marked `packaged_task`'s defaulted move constructor and move assignment operator as `noexcept`. [#4940](#4940) * Various cleanups (described in detail in the PRs, not repeated here). [#4945](#4945) [#5014](#5014) [#5058](#5058) * Refactored internal usage of the *`tuple-like`* and *`pair-like`* concepts. [#4983](#4983) * Used `if constexpr` to simplify ~~eldritch horrors from beyond spacetime~~ locale facets. [#5001](#5001) * Simplified control flow in `basic_string::find_first_not_of()`/`find_last_not_of()`. [#5006](#5006) * Refactored the vectorized implementation of `bitset::to_string()`. [#5013](#5013) * Replaced SFINAE with concepts in C++20-and-later code. [#5044](#5044) - Improved documentation: * Removed an inaccurate comment in `list`'s move assignment operator. [#5024](#5024) - Infrastructure improvements: * Updated dependencies. [#4947](#4947) [#5017](#5017) [#5082](#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](#4928) - Updated `_MSVC_STL_UPDATE`. [#4926](#4926) [#4994](#4994) [#5064](#5064)
VS 2022 17.12 - Merged C++26 features: * [P0952R2](https://wg21.link/P0952R2) [#4740](#4740) [#4850](#4850) A New Specification For `generate_canonical()` * [P2407R5](https://wg21.link/P2407R5) [#4743](#4743) Freestanding Library: Partial Classes * [P2833R2](https://wg21.link/P2833R2) [#4743](#4743) Freestanding Library: `inout` `expected` `span` * [P2968R2](https://wg21.link/P2968R2) [#4777](#4777) Make `std::ignore` A First-Class Object * [P2997R1](https://wg21.link/P2997R1) [#4816](#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](#4716) + Implemented `formatter` for the container adaptors `stack`, `queue`, and `priority_queue`. [#4825](#4825) - Merged LWG issue resolutions: * [LWG-3944](https://cplusplus.github.io/LWG/issue3944) [#4784](#4784) Formatters converting sequences of `char` to sequences of `wchar_t` * [LWG-4061](https://cplusplus.github.io/LWG/issue4061) [#4758](#4758) Should `std::basic_format_context` be default-constructible/copyable/movable? * [LWG-4074](https://cplusplus.github.io/LWG/issue4074) [#4814](#4814) *`compatible-joinable-ranges`* is underconstrained * [LWG-4083](https://cplusplus.github.io/LWG/issue4083) [#4786](#4786) `views::as_rvalue` should reject non-input ranges * [LWG-4096](https://cplusplus.github.io/LWG/issue4096) [#4785](#4785) `views::iota(views::iota(0))` should be rejected * [LWG-4098](https://cplusplus.github.io/LWG/issue4098) [#4815](#4815) `views::adjacent<0>` should reject non-forward ranges * [LWG-4106](https://cplusplus.github.io/LWG/issue4106) [#4757](#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](#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](#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](#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](#4740) * Fixed `filesystem::weakly_canonical()` to avoid failing on Windows 11 24H2 in certain scenarios. [#4844](#4844) * Fixed `condition_variable_any::wait_for()` to consistently use `steady_clock`. [#4755](#4755) * Removed a broken and useless visualizer for `ranges::view_interface`. [#4835](#4835) * Fixed the visualizer for `move_iterator` to use the updated name of its internal data member. [#4836](#4836) + This fixed a regression that was introduced by [#1080](#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](#4837) * Fixed `time_put`/`put_time()` to avoid crashing for: + Unknown conversion specifiers. (Now they're copied unchanged.) [#4840](#4840) + Out-of-range `tm` fields. (Now they're replaced with a `?` character.) [#4883](#4883) * Fixed compiler errors in `ranges::inplace_merge` and `ranges::minmax` in unusual scenarios. [#4841](#4841) * Fixed truncation warnings when: + Using `conjunction` and `disjunction` with non-`bool_constant` arguments. [#4846](#4846) + Calling algorithms with contiguous iterators whose difference types are narrower than `ptrdiff_t`. [#4898](#4898) * Improved `array::size()` and `<mdspan>` static analysis annotations, fixing warnings in some scenarios. [#4856](#4856) * Fixed `lexicographical_compare_three_way()` to enforce the Standard's mandate that the comparison returns a comparison category type. [#4878](#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](#4701) * Fixed the vectorized implementation of floating-point `ranges::min`, `ranges::max`, and `ranges::minmax` to return correct results for negative zeros. [#4734](#4734) * Fixed Clang compiler errors for certain `constexpr` `variant` scenarios by adding a compiler bug workaround. [#4903](#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](#4906) * Fixed compiler errors when using `<format>` machinery in user-defined modules by adding compiler bug workarounds. [#4919](#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](#4907) - Improved performance: * Overhauled `condition_variable` and `condition_variable_any`, improving their performance and simplifying their implementation. [#4720](#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](#4654) [#4753](#4753) * Improved the ARM64 performance of `popcount()` by using new compiler intrinsics. [#4695](#4695) [#4733](#4733) * Further improved the vectorized implementations of: + The `minmax_element()` and `minmax()` algorithm families. [#4659](#4659) [#4739](#4739) * Slightly improved the performance of `ranges::min`, `ranges::max`, and `ranges::minmax` for certain iterator types. [#4775](#4775) * On x86, the STL is now built with `/arch:SSE2` (which is the default) instead of `/arch:IA32`. [#4741](#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](#4648) * On x64, `atomic_ref<16 bytes>` now always uses the cmpxchg16b instruction. [#4751](#4751) * Streaming a small `bitset` to a `basic_ostream` now avoids dynamically allocating memory. [#4818](#4818) * Slightly improved performance for Clang ARM64 `<atomic>`. [#4870](#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](#4873) [#4894](#4894) * Optimized equality comparisons for empty `string`s and `string_view`s. [#4904](#4904) - Improved throughput: * Improved `<queue>` and `<stack>` throughput by dragging in fewer headers. [#4707](#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](#4713) + This C++20 behavioral change was originally implemented by [#1629](#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](#4749) * Added debug checks to `gcd()` and `lcm()` for precondition violations. [#4776](#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](#4838) * Updated the precondition check in `vector::pop_back()` to be guarded by `_CONTAINER_DEBUG_LEVEL`. [#4849](#4849) * Renamed the parameters of `views::iota` and `views::repeat` to provide better IDE guidance. [#4908](#4908) * Simplified internal locale facet machinery to use class-specific `operator new` and `operator delete` overloads in both release and debug mode. [#4916](#4916) - Improved debugger visualization: * Inserted the debug visualizer changes from [#3848](#3848), [#4274](#4274), [#4835](#4835), and [#4836](#4836) in the VS repo so they'll finally ship. - Improved test coverage: * Updated LLVM-derived test coverage for `<any>`, `<optional>`, and `<variant>`. [#4713](#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](#4748) * Improved the benchmarks for `bitset::to_string()`. [#4817](#4817) * Updated our LLVM submodule, including new tests. [#4862](#4862) [#4910](#4910) * Re-enabled tests that were previously skipped in the `libcxx` test suite. [#4721](#4721) [#4732](#4732) [#4911](#4911) * Skipped tests that were sporadically failing due to incorrect timing assumptions. [#4885](#4885) * Added compiler bug workarounds. [#4895](#4895) * Tested the resolution of [LWG-4105](https://cplusplus.github.io/LWG/issue4105) "`ranges::ends_with`'s *Returns* misses difference casting". [#4897](#4897) * Updated tests to work with Clang 19. [#4912](#4912) * Avoided unnecessary usage of `rand()`, which is considered harmful. [#4921](#4921) - Code cleanups: * Removed compiler bug workarounds. [#4725](#4725) [#4782](#4782) [#4889](#4889) * Various cleanups (described in detail in the PRs, not repeated here). [#4724](#4724) [#4900](#4900) [#4920](#4920) * Replaced SFINAE with concepts in C++20-and-later code. [#4718](#4718) [#4819](#4819) * Removed a significant amount of unused code calling `GetCurrentPackageId`. [#4742](#4742) * Simplified how `ranges::equal` compares sizes. [#4864](#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](#4742) [#4857](#4857) - Infrastructure improvements: * The STL now clearly rejects attempts to: - Build a preset whose architecture doesn't match the compiler command prompt. [#4709](#4709) - Test a build whose architecture doesn't match the compiler command prompt. [#4717](#4717) * Updated dependencies. [#4725](#4725) [#4824](#4824) [#4889](#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](#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](#4886) * Improved how CMake searches for the clang-format executable. [#4888](#4888) - Updated `_MSVC_STL_UPDATE`. [#4706](#4706) [#4708](#4708) [#4754](#4754) [#4872](#4872)
VS 2022 17.11 - Merged C++26 features: * [P2875R4](https://wg21.link/P2875R4) [#4532](#4532) Undeprecate `polymorphic_allocator::destroy` * [P3142R0](https://wg21.link/P3142R0) [#4611](#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](#4438) [#4631](#4631) [#4681](#4681) + Implemented `range_formatter`. [#4642](#4642) - Merged LWG issue resolutions: * [LWG-3767](https://cplusplus.github.io/LWG/issue3767) [#4542](#4542) `codecvt<charN_t, char8_t, mbstate_t>` incorrectly added to locale * [LWG-3919](https://cplusplus.github.io/LWG/issue3919) [#4526](#4526) `enumerate_view` may invoke UB for sized common non-forward underlying ranges * [LWG-3950](https://cplusplus.github.io/LWG/issue3950) [#4510](#4510) `std::basic_string_view` comparison operators are overspecified * [LWG-3984](https://cplusplus.github.io/LWG/issue3984) [#4543](#4543) `ranges::to`'s recursion branch may be ill-formed * [LWG-4012](https://cplusplus.github.io/LWG/issue4012) [#4529](#4529) `common_view::begin`/`end` are missing the *`simple-view`* check * [LWG-4013](https://cplusplus.github.io/LWG/issue4013) [#4530](#4530) `lazy_split_view::`*`outer-iterator`*`::value_type` should not provide default constructor * [LWG-4016](https://cplusplus.github.io/LWG/issue4016) [#4539](#4539) *`container-insertable`* checks do not match what *`container-inserter`* does * [LWG-4035](https://cplusplus.github.io/LWG/issue4035) [#4525](#4525) `single_view` should provide `empty` * [LWG-4053](https://cplusplus.github.io/LWG/issue4053) [#4685](#4685) Unary call to `std::views::repeat` does not decay the argument * [LWG-4054](https://cplusplus.github.io/LWG/issue4054) [#4540](#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](#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](#4459) * Fixed compiler errors when `constexpr basic_string` interacted with the undocumented compiler option `/d1initall`. [#4474](#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](#4478) * Removed the vectorized implementation of `ranges::find` with `unreachable_sentinel` as it was fundamentally incompatible with ASan (Address Sanitizer). [#4486](#4486) + This was introduced by [#2434](#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](#4561) + This fixed a regression that was introduced by [#3925](#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](#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](#4527) * Fixed compiler errors involving incomplete types in: + `pair` and `tuple` machinery. [#4488](#4488) * Fixed `make_from_tuple()` to properly implement [LWG-3528](https://wg21.link/lwg3528) with a constraint instead of a `static_assert`. [#4528](#4528) * Added integral overloads for `<cmath>`'s classification functions `fpclassify()`, `isfinite()`, `isinf()`, `isnan()`, `isnormal()`, and `signbit()`. [#4537](#4537) * Fixed `is_trivial` to correctly handle unusual types. [#4576](#4576) * Avoided mentioning `__vectorcall` for ARM64EC, where it is not yet supported. [#4600](#4600) * Fixed `std.ixx` to include `<intrin.h>` in the Global Module Fragment, fixing compiler errors with `import std;` in certain scenarios. [#4626](#4626) * Fixed compiler errors when a user-defined `formatter` calls `basic_format_parse_context::next_arg_id()` with an empty format-spec. [#4640](#4640) * Fixed compiler errors when using `<expected>` in `/permissive` mode. [#4658](#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](#4664) * Fixed `pair`'s self-`swap()` behavior to follow the Standard by self-swapping its elements. [#4674](#4674) * Fixed `atomic<void*>` and `atomic_ref<void*>` to provide `difference_type`. [#4689](#4689) - Improved performance: * Helped the compiler auto-vectorize: + `replace_copy()`, `replace_copy_if()`, `ranges::replace_copy`, and `ranges::replace_copy_if`. [#4431](#4431) + `iota()`. [#4627](#4627) + `ranges::iota`. [#4647](#4647) * Added vectorized implementations of: + `find_first_of()` and `ranges::find_first_of`. [#4466](#4466) [#4557](#4557) [#4563](#4563) [#4587](#4587) [#4623](#4623) + `mismatch()` and `ranges::mismatch`. [#4495](#4495) [#4538](#4538) [#4584](#4584) + `replace()` and `ranges::replace` for 32-bit and 64-bit elements. [#4554](#4554) [#4584](#4584) + `lexicographical_compare()`, `ranges::lexicographical_compare`, and `lexicographical_compare_three_way()`. [#4552](#4552) * Further improved the vectorized implementations of: + `count()`, `find()`, `ranges::count`, `ranges::find`, and `ranges::find_last`. [#4570](#4570) [#4614](#4614) * Used Clang builtins to improve the performance of `<cmath>`'s floating-point classification and comparison functions: [#4612](#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](#4618) - Improved throughput: * Slightly improved `<mdspan>` throughput by using short-circuiting `conjunction_v` instead of fold expressions. [#4559](#4559) * Refactored floating-point machinery, improving throughput by reducing inclusion of various headers. [#4615](#4615) * Improved `<string_view>` throughput by no longer dragging in most of `<string>`'s contents. [#4633](#4633) - Improved diagnostics: * Improved compiler error messages when `formatter<UDT>::format()` isn't `const`. [#4461](#4461) * Massively improved the compiler error messages for `get<T>(tuple<Types...>)` when `T` doesn't occur exactly once in `Types`. [#4578](#4578) * Significantly improved compiler error messages when `ranges::to` is unable to construct the requested result. [#4608](#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](#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](#4551) + The `iota_view(first, last)` constructor. [#4616](#4616) * Improved the wording of `[[nodiscard("reason")]]` messages for `empty()`. [#4572](#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](#4585) * Changed the internal constructors of `basic_format_arg::handle` and `basic_format_context` to be `private`. [#4489](#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](#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](#4458) * Deleted the `<experimental/meow>` headers that provided `std::experimental::erase()/erase_if()`. [#4470](#4470) * Removed the non-Standard `_FPOSOFF` macro and the non-Standard `std::fpos::seekpos()` member function. [#4606](#4606) * Removed the non-Standard `lower_bound()`/`upper_bound()` member functions from the unordered associative containers. [#4607](#4607) - Improved test coverage: * Added benchmarks for vectorized `swap_ranges()`. [#4589](#4589) * Added a workaround for an ASan failure in an ancient STL test. [#4652](#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](#4656) * Improved the `<filesystem>` test, including its coverage of `rename()` and how it generates names for temporary files and directories. [#4665](#4665) * Re-enabled tests that were previously skipped in the `libcxx` test suite. [#4698](#4698) * Updated our LLVM submodule, including new tests. [#4702](#4702) - Code cleanups: * Removed compiler bug workarounds. [#4475](#4475) [#4576](#4576) * Various cleanups (described in detail in the PRs, not repeated here). [#4465](#4465) [#4490](#4490) [#4493](#4493) * Improved the script for downloading Unicode data files when updating `<format>`. [#4469](#4469) * Consistently centralized how algorithms invoke their vectorized implementations. [#4544](#4544) * Simplified how `condition_variable` is implemented as a wrapper around the Windows API `CONDITION_VARIABLE`. [#4545](#4545) * Removed `inline` from `constexpr` variable templates. [#4546](#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](#4577) * Updated tests to use C++17 terse `static_assert`. [#4588](#4588) * Simplified function templates to use `static_assert(false)` as permitted by [CWG-2518](https://wg21.link/cwg2518). [#4591](#4591) * Simplified debug checks for comparison function objects by using `if constexpr`. [#4610](#4610) * Simplified `char_traits::assign()` by removing unnecessary codepaths for constant evaluation. [#4613](#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](#4624) * Simplified `ranges::stable_sort` to use `iter_value_t` instead of an internal helper. [#4628](#4628) * Changed the STL to use `in_range<T>()` more and `numeric_limits<T>::min()`/`max()` less. [#4634](#4634) * Replaced SFINAE with concepts in C++20-and-later code. [#4637](#4637) * Simplified the vectorized implementation of the `minmax()` family for 64-bit elements. [#4661](#4661) * Modernized our usage of Google Benchmark. [#4662](#4662) - Infrastructure improvements: * Overhauled our Azure Pipelines machinery: [#4594](#4594) [#4687](#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](#4475) [#4492](#4492) [#4576](#4576) [#4568](#4568) [#4594](#4594) [#4687](#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](#4599) + Updated Google Benchmark to 1.8.4. [#4694](#4694) - Updated `_MSVC_STL_UPDATE`. [#4467](#4467) [#4556](#4556) [#4655](#4655)
VS 2022 17.10 - Merged C++26 features: * [P2510R3](https://wg21.link/P2510R3) [#4198](#4198) Formatting Pointers * [P2937R0](https://wg21.link/P2937R0) [#4203](#4203) Freestanding Library: Remove `strtok` - Merged C++23 features: * [P2836R1](https://wg21.link/P2836R1) [#4188](#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](#4133) - Merged C++20 Defect Reports: * [P2905R2](https://wg21.link/P2905R2) [#4196](#4196) Runtime Format Strings * [P2909R4](https://wg21.link/P2909R4) [#4189](#4189) Fix Formatting Of Code Units As Integers - Merged LWG issue resolutions: * [LWG-3749](https://wg21.link/lwg3749) [#4190](#4190) `common_iterator` should handle integer-class difference types * [LWG-3809](https://wg21.link/lwg3809) [#4194](#4194) Is `subtract_with_carry_engine<uint16_t>` supposed to work? * [LWG-3897](https://wg21.link/lwg3897) [#4186](#4186) `inout_ptr` will not update raw pointer to null * [LWG-3946](https://wg21.link/lwg3946) [#4187](#4187) The definition of `const_iterator_t` should be reworked * [LWG-3947](https://wg21.link/lwg3947) [#4195](#4195) Unexpected constraints on `adjacent_transform_view::base()` * [LWG-3949](https://wg21.link/lwg3949) [#4204](#4204) `atomic<bool>`'s trivial destructor dropped in C++17 spec wording * [LWG-3953](https://wg21.link/lwg3953) [#4167](#4167) `iter_move` for `common_iterator` and `counted_iterator` should return `decltype(auto)` * [LWG-3974](https://wg21.link/lwg3974) [#4214](#4214) `mdspan::operator[]` should not copy `OtherIndexTypes` * [LWG-4001](https://wg21.link/lwg4001) [#4193](#4193) `iota_view` should provide `empty` - Fixed bugs: * Fixed `mutex`'s constructor to be `constexpr`. [#3824](#3824) [#4000](#4000) [#4339](#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](#4078) + To require that dynamic width and precision arguments have integral types. [#4155](#4155) * Fixed how `format()` handles empty strings like `format("{:a<10}", "")`. [#4243](#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](#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](#4421) * Fixed `format()` to accept `%X` and `%EX` for `chrono::duration` and `chrono::hh_mm_ss`. [#4250](#4250) * Fixed `chrono::duration` formatting to respect dynamically provided widths. [#4283](#4283) * Fixed crashes and incorrect results in the vectorized implementation of `ranges::find` with `unreachable_sentinel`. [#4450](#4450) + This fixed regressions that were introduced by [#2434](#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](#4142) * Fixed `ranges::to` to accept certain container constructors taking a range followed by more than one argument. [#4218](#4218) * Fixed compiler errors involving range adaptor closure objects in unusual scenarios. [#4211](#4211) * Fixed `ranges::ssize` to be conditionally `noexcept` as required by the Standard. [#4231](#4231) * Fixed `join_view` and `join_with_view`'s iterators to be default constructible. [#4264](#4264) * Fixed truncation warnings when using `views::repeat`. [#4255](#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](#4416) * Fixed compiler errors when using `views::pairwise_transform` and `views::adjacent_transform` via Standard Library Modules. [#4420](#4420) * Fixed incorrect output from iostreams (like `"i.nf"`) when printing infinity and NaN values with `setprecision(0) << showpoint << fixed`. [#4212](#4212) * Fixed problems involving unusual allocators with size types other than `size_t`: + Compiler errors in `basic_stringbuf::overflow()`. [#4219](#4219) + Truncation warnings in `basic_stringbuf`'s constructor, `string`/`vector` iterator subtraction, `ranges::is_permutation`, and `allocate_shared()`. [#4228](#4228) [#4237](#4237) [#4252](#4252) * Fixed `<atomic>` correctness issues for ARM64 CHPE (`_M_HYBRID_X86_ARM64`). [#4222](#4222) * Fixed `atomic` by adding `atomic& operator=(const atomic&) volatile = delete;` as required by the Standard. [#4287](#4287) * Fixed `atomic<shared_ptr>::wait()` and `atomic<weak_ptr>::wait()` to properly detect equivalent smart pointers. [#3655](#3655) * Fixed sign-compare warnings in `<mdspan>` when using `extents` with different index types. [#4227](#4227) * Fixed compiler errors in `<mdspan>` when constructing unusual mappings. [#4236](#4236) * Fixed bugs specific to extremely unusual fancy pointers: + Fixed how such `vector`s interact with ranges algorithms. [#4244](#4244) + Fixed how such `vector`s and `basic_string`s interact with classic algorithms and iterator spaceship comparisons. [#4275](#4275) * Fixed compiler errors when constructing `locale{nullptr}`. [#4245](#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](#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](#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](#4254) * Fixed compiler errors in parallel `transform_reduce()` when performing narrowing conversions. [#4260](#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](#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](#4277) * Added macroization defenses for the STL's non-Standard extensions (e.g. `type_info`'s `raw_name` member function). [#4285](#4285) * Fixed floating-point `to_chars()` on ARM64 to return correct results. [#4304](#4304) * Fixed compiler errors when defining variadic alias templates for `is_nothrow_convertible`. [#4318](#4318) * Fixed `filesystem::is_empty()` and `filesystem::directory_iterator` to handle empty volumes (before they've been assigned a drive letter). [#4311](#4311) * Fixed compiler errors in algorithms involving highly unusual types. [#4233](#4233) [#4419](#4419) * Fixed `basic_stringbuf` to avoid implementing moving with swapping, which is a correctness issue for unusual custom allocators. [#4239](#4239) * Fixed `deque::shrink_to_fit()` to follow the Standard instead of unconditionally moving elements. [#4091](#4091) * Fixed `allocate_shared_for_overwrite()` to directly destroy objects, instead of using `Alloc::destroy()`. [#4274](#4274) * Removed `ios_base::hexfloat`, a non-Standard bitmask element. [#4345](#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](#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](#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](#4406) + `unordered_multimap` and `unordered_multiset` already behaved correctly. * Silenced "warning C4324: structure was padded due to alignment specifier" in all STL headers. [#4426](#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](#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](#4447) * Fixed compiler errors involving incomplete types in: + Non-modifying algorithms. [#4138](#4138) + `erase()`, `erase_if()`, `remove()`, `remove_if()`. [#4217](#4217) + \[alg.min.max\], \[alg.clamp\], \[alg.lex.comparison\], \[alg.three.way\] algorithms. [#4216](#4216) + `atomic` and `atomic_ref`. [#4221](#4221) + Modifying algorithms. [#4256](#4256) + Container operations taking iterator pairs. [#4258](#4258) + `is_nothrow_convertible`. [#4318](#4318) + Comparison operators. [#4334](#4334) + Merge algorithms, set operations, heap operations, and permutation generators. [#4347](#4347) + Sorting and related algorithms. [#4367](#4367) + `vector`'s destructor and other member functions. [#4373](#4373) + Uninitialized memory algorithms. [#4374](#4374) + `default_searcher`. [#4379](#4379) + `<ranges>` views. [#4389](#4389) + Numeric algorithms. [#4391](#4391) + `ranges::advance`, `ranges::distance`, `span` constructors, and `condition_variable::wait_for`. [#4402](#4402) + `shared_ptr` creation functions and `atomic` smart pointers. [#4403](#4403) + `function`, `move_only_function`, `packaged_task`, `promise`, and `optional`. [#4430](#4430) - Improved performance: * Improved `<atomic>` performance: [#4222](#4222) + For ARM64, significantly improved the performance of `atomic<T>::load()` (taking no arguments, requesting sequential consistency), matching how [#3399](#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](#3399 major improvements. * Improved `atomic::wait` family performance by internally using `memory_order_acq_rel` instead of `memory_order_seq_cst` when initializing OS support functions. [#4288](#4288) * Slightly improved the codegen for `uniform_int_distribution`. [#4234](#4234) * Optimized `filesystem::path`'s `operator/` to perform a single memory allocation for common cases. [#4136](#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](#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](#3960) [#4382](#4382) [#4422](#4422) * Improved the vectorized implementations of `min_element()`, `max_element()`, `minmax_element()`, and related algorithms: + Extended them to handle floating-point types. [#3928](#3928) + Further improved performance by restructuring control flow. [#4401](#4401) * Improved the vectorized implementations of `ranges::min`, `ranges::max`, `ranges::minmax`, and the `min()`, `max()`, and `minmax()` overloads for `initializer_list`. [#4384](#4384) + These algorithms only need to track values, not locations. * Changed the destructors of `mutex` and `recursive_mutex` to be trivial. [#4390](#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](#4407) + At-thread-exit machinery. [#4408](#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](#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](#4080) * Improved `shared_ptr` constructor constraints to avoid forming invalid types. [#4290](#4290) * Updated `<charconv>` to use the `__umulh` intrinsic for ARM64 CHPE (`_M_HYBRID_X86_ARM64`). [#4330](#4330) * Improved `expected`'s copy/move assignment operators to be trivial when possible, like how `optional` and `variant` already behave. [#4271](#4271) * Improved `<random>`'s TR1 legacy code: [#4284](#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](#4451) + Currently, this arbitrarily limits the number of capture groups to 1000. - Improved test coverage: * Updated the STL-ASan-CI pipeline. [#4240](#4240) [#4295](#4295) * Added support for building the STL's separately compiled code with ASan instrumentation and enabled this in the STL-ASan-CI pipeline. [#4313](#4313) * Updated our LLVM submodule, including new tests. [#4263](#4263) [#4267](#4267) [#4270](#4270) [#4272](#4272) [#4328](#4328) [#4336](#4336) [#4348](#4348) [#4355](#4355) * Minor test improvements, including printing exit codes in both decimal and hex. [#4309](#4309) * Improved output for "unresolved" test failures. [#4323](#4323) * Fixed sporadic "unresolved" test failures. [#4366](#4366) * Updated CTest to avoid running 2N tests in parallel, where N is the number of cores available. [#4335](#4335) * Enabled `__cpp_lib_concepts` for our command-line test coverage of the EDG compiler front-end. [#4296](#4296) [#4297](#4297) [#4440](#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](#4356) * Added benchmarks for vectorized `ranges::find` and `ranges::count`. [#4387](#4387) + This also covers classic `find()` and `count()`, which share the same vectorized implementation. * Fixed the test harness to handle paths case-insensitively. [#4395](#4395) * Updated tests to work with Clang 18. [#4452](#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](#4441) - Code cleanups: * Various cleanups (described in detail in the PRs, not repeated here). [#4143](#4143) [#4145](#4145) [#4146](#4146) [#4147](#4147) [#4149](#4149) [#4151](#4151) [#4192](#4192) [#4229](#4229) [#4230](#4230) [#4362](#4362) [#4439](#4439) [#4442](#4442) [#4443](#4443) [#4444](#4444) [#4445](#4445) * Removed unnecessary `typename` keywords in C++20 mode and later. [#4191](#4191) * Removed compiler bug workarounds. [#4197](#4197) [#4259](#4259) [#4340](#4340) [#4392](#4392) * Removed an enormous amount of code that was dealing with `__cpp_lib_concepts` missing in C++20 mode. [#4298](#4298) [#4364](#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](#4405) * Added top-level `const` to function parameters in the vectorized implementations of algorithms. [#4410](#4410) * Added a script to download Unicode data files when updating `<format>`. [#4435](#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](#4446) * Used `if constexpr` to simplify helper functions for allocating and deallocating memory. [#4432](#4432) - Infrastructure improvements: * Updated dependencies. [#4197](#4197) [#4206](#4206) [#4259](#4259) [#4303](#4303) [#4392](#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](#4280) - Updated `_MSVC_STL_UPDATE`. [#4213](#4213) [#4226](#4226) [#4293](#4293) [#4361](#4361)
VS 2022 17.9 - Merged C++23 features: * [P0009R18](https://wg21.link/P0009R18) [#3972](#3972) [#4037](#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](#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](#3913) + Implemented `formattable`, `range_format`, and `format_kind`. [#4116](#4116) - Merged LWG issue resolutions: * [LWG-3561](https://wg21.link/lwg3561) [#4066](#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](#3982) + This fixed a regression that was introduced by [#3364](#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](#4013) * Fixed incorrect behavior when self-move-assigning `any`, and fixed compiler errors in `any` involving incomplete types. [#3965](#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](#4031) * Fixed `get()` and comparison operators to handle program-defined specializations of `array`. [#4041](#4041) * Fixed compiler errors in `to_array()` involving incomplete types. [#4042](#4042) * Fixed linker errors involving `stl_asan.lib` by disabling ASan annotations in the STL for unsupported platforms (e.g. ARM, ARM64, ARM64EC). [#4058](#4058) * Fixed `not_fn()` to return a perfect forwarding call wrapper in C++20 mode as required by [P0356R5](https://wg21.link/P0356R5). [#4057](#4057) * Fixed `deque` to preserve its internal invariants when taking advantage of allocators that provide `allocate_at_least()`. [#4017](#4017) * Fixed `deque` `emplace()` and `insert()` to not require elements to be swappable; this change also improved performance. [#4022](#4022) * Fixed `deque` to handle highly unusual fancy pointers. [#4049](#4049) * Fixed `deque::shrink_to_fit()` to avoid requiring the allocator to be default constructible. [#4071](#4071) * Fixed `allocate_shared()` for unbounded arrays to handle fancy pointers. [#4074](#4074) * Fixed the implementation of [P0408R7](https://wg21.link/P0408R7) Efficient Access To `basic_stringbuf`'s Buffer to properly destroy fancy pointers. [#4047](#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](#3914) * Fixed minor conformance issues in `<random>`: [#4120](#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](#3353) [#4045](#4045) * Optimized `priority_queue::push_range()` for small ranges. [#4025](#4025) * Improved debug codegen for `deque` by using unchecked iterators internally. [#4071](#4071) * Optimized `basic_string`'s range constructors to use `memmove()` for contiguous ranges when possible. [#4073](#4073) * Added a vectorized implementation of `ranges::find_last`. [#3925](#3925) - Enhanced behavior: * Added debug checks to `<valarray>` binary operations, verifying that the operands have the same size. [#3911](#3911) * Deprecated `basic_istream`'s `ipfx()`/`isfx()` and `basic_ostream`'s `opfx()`/`osfx()` member functions as they're non-Standard extensions. [#4006](#4006) * Added compiler bug workarounds for the upcoming Clang 17 release. [#4014](#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](#4020) * Silenced `/Wall` warnings: + When building the Standard Library Modules. [#4026](#4026) + Warning C4868 "compiler may not enforce left-to-right evaluation order in braced initializer list" throughout the STL. [#4067](#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](#4032) + *Note:* 80-bit `long double` remains unsupported by MSVC. * Improved `source_location::function_name()`: [#4055](#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](#4098) + For example, this allows code like `views::transform(ranges::distance)` to compile. * Marked internal `extern "C"` functions as `noexcept`. [#4106](#4106) [#4150](#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](#3987) [#3989](#3989) [#4029](#4029) [#4052](#4052) [#4068](#4068) [#4069](#4069) [#4075](#4075) * The test harness now cleans up emitted files as it runs. [#4086](#4086) * Simplified the feature-test macro test. [#4103](#4103) * Enabled test coverage for `basic_string`'s ASan annotations when exception handling interacts with the Small String Optimization. [#4118](#4118) - Code cleanups: * Removed unused code. [#3964](#3964) [#4005](#4005) * Removed compiler bug workarounds. [#4012](#4012) [#4028](#4028) [#4039](#4039) [#4083](#4083) * Various cleanups (described in detail in the PRs, not repeated here). [#3940](#3940) [#3973](#3973) [#3974](#3974) [#3984](#3984) [#4015](#4015) [#4016](#4016) [#4036](#4036) [#4087](#4087) [#4111](#4111) [#4113](#4113) [#4117](#4117) [#4119](#4119) [#4121](#4121) [#4122](#4122) [#4123](#4123) [#4124](#4124) [#4125](#4125) * Ported a `<format>` table generator script from C++ to Python. [#3994](#3994) * Improved how `<format>` uses the compiler macro `_MSVC_EXECUTION_CHARACTER_SET`. [#4076](#4076) - Improved documentation: * Improved the consistency of preprocessor comments. [#3950](#3950) - Infrastructure improvements: * Updated dependencies. [#4028](#4028) [#4039](#4039) [#4083](#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](#4021) - Updated `_MSVC_STL_UPDATE`. [#4003](#4003) [#4062](#4062)
VS 2022 17.8 - Merged C++26 features: * [P2013R5](https://wg21.link/P2013R5) [#3837](#3837) Freestanding Language: Optional `::operator new` * [P2198R7](https://wg21.link/P2198R7) [#3837](#3837) Freestanding Feature-Test Macros And Implementation-Defined Extensions * [P2338R4](https://wg21.link/P2338R4) [#3837](#3837) Freestanding Library: Character Primitives And The C Library * [P2538R1](https://wg21.link/P2538R1) [#3822](#3822) ADL-Proof `projected` - Merged C++23 features: * [P2675R1](https://wg21.link/P2675R1) [#3903](#3903) Improving `std::format`'s Width Estimation * [P2693R1](https://wg21.link/P2693R1) [#3861](#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](#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](#3745) `basic_format_arg(T&&)` should use `remove_cvref_t<T>` throughout * [LWG-3843](https://wg21.link/lwg3843) [#3737](#3737) `std::expected<T, E>::value() &` assumes `E` is copy constructible * [LWG-3893](https://wg21.link/lwg3893) [#3782](#3782) [LWG-3661](https://wg21.link/lwg3661) broke `atomic<shared_ptr<T>> a; a = nullptr;` * [LWG-3904](https://wg21.link/lwg3904) [#3781](#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](#3720) * Removed a non-Standard operator `basic_istream >> setfill(c)`. [#3725](#3725) * Fixed linker errors when linking x64 object files into ARM64EC programs. [#3732](#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](#3733) * Fixed `formatter<char, wchar_t>` to format the `char` as a character instead of an integer. [#3723](#3723) * The STL now avoids dragging in the non-reserved name `ISA_AVAILABILITY`. [#3721](#3721) * Fixed `chrono::hh_mm_ss` formatting to accept values of 24 hours or more. [#3727](#3727) * Changed the STL's usage of compiler-specific custom attributes to further defend against macros. [#3760](#3760) * Fixed `condition_variable_any::wait_until()` to handle `time_point`s with unsigned representations instead of waiting forever. [#3761](#3761) * Fixed `counting_semaphore` to add compile-time enforcement of the Standard's mandates. [#3747](#3747) * Fixed a bug, affecting UWP apps only, where locking a `mutex` could throw a bogus exception. [#3763](#3763) * Fixed the signatures of `char_traits` member functions to exactly match the Standard. [#3739](#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](#3787) * Fixed incorrect output when `format()` is asked to format a floating-point value in the alternate form without a type specifier. [#3815](#3815) * Added a compiler bug workaround for MSVC modules, allowing `<format>` machinery to work with `/utf-8` via `import std;`. [#3816](#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](#3712) [#3819](#3819) * Fixed Clang compiler errors when calling `function::target<FunctionType>()` on `const function` objects. [#3844](#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](#3863) * Improved function call operator overload resolution for the `bind()`, `bind_front()`, and `bind_back()` function objects. [#3775](#3775) * Fixed iostreams with imbued locales to print infinities and NaNs correctly. [#3868](#3868) [#3877](#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](#3869) [#3881](#3881) * Fixed `shared_ptr<void>` to not be constructible from `void*`. [#3873](#3873) * Fixed a complicated modules scenario by removing `#pragma once` from all STL headers. [#3895](#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](#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](#3862) * Fixed ASan annotations in `basic_string::replace()`. [#3884](#3884) * Fixed ASan annotations in `basic_string::assign()` and `basic_string::resize_and_overwrite()`. [#3956](#3956) - Improved performance: * Changed some helper member functions to be `static`, slightly improving debug codegen. [#3755](#3755) * `mutex` and `condition_variable` now avoid virtual function calls within their implementations. [#3770](#3770) * Optimized `steady_clock::now()` when `QueryPerformanceFrequency()` is exactly 24 MHz, which is very common for ARM64. [#3832](#3832) * Optimized `filesystem::path::lexically_normal()`. [#3850](#3850) * `basic_string`, `basic_stringbuf`, `basic_syncbuf`, `deque`, and `vector` now take advantage of allocators that provide `allocate_at_least()`. [#3864](#3864) [#3891](#3891) * Optimized `<format>` slightly. [#3826](#3826) * Optimized `bitset::to_string()`. [#3838](#3838) [#3904](#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](#3664) * Made a tiny tweak to `valarray` (access the stored size directly instead of via calling `size()`) to improve debug codegen. [#3968](#3968) - Improved throughput: * Moved machinery: [#3719](#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](#3777) * In C++17 mode and later, improved Clang throughput for an internal helper wrapping `is_same_v`. [#3933](#3933) - Enhanced behavior: * Added precondition checking in debug mode to the `iota_view(value)` constructor. [#3731](#3731) * Improved precondition checking in debug mode for `barrier`. [#3757](#3757) * Fixed static analysis warnings. [#3734](#3734) [#3743](#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](#3762) + `basic_string_view::compare(const charT*)`. [#3738](#3738) + Constructors of `locale::facet` and related base classes. [#3855](#3855) + Many functions in `<complex>`. [#3880](#3880) + Many functions in `<random>`, some functions in `<valarray>`, and 3-arg `hypot()` in `<cmath>`. [#3887](#3887) * The STL now avoids conflicting with non-Standard macros of reserved names that were defined by old versions of the ICU library. [#3776](#3776) * Updated `stdext::checked_array_iterator` and `stdext::unchecked_array_iterator`: [#3818](#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](#3831) * Improved how `views::cartesian_product` detects ranges with maximum sizes that are known at compile time. [#3839](#3839) * Improved how parallel algorithms perform compile-time iterator type checking. [#3899](#3899) * The STL now calls `abort()` instead of `terminate()` for unrecoverable conditions, when the Standard doesn't require `terminate()` to be called. [#3906](#3906) [#3909](#3909) * Improved the visualizer for `vector<char>` and the other character types. [#3772](#3772) * Improved the visualizer for `mutex` and `recursive_mutex`. [#3848](#3848) * Updated `chrono::duration_cast()` to use `if constexpr`, improving debug codegen. [#3958](#3958) - Improved test coverage: * Added properly functioning test coverage for `ranges::owning_view`. [#3753](#3753) * Added test coverage for calling `tellg()` while reading an LF file in text mode. [#3773](#3773) [#3841](#3841) * Added test coverage for [LWG-2295](https://wg21.link/lwg2295) Locale name when the provided `Facet` is a `nullptr`. [#3823](#3823) * Added test coverage for [LWG-2682](https://wg21.link/lwg2682) `filesystem::copy()` won't create a symlink to a directory. [#3827](#3827) * Updated tests to use lvalue references for the LHS of `is_assignable_v` and `is_nothrow_assignable_v`. [#3898](#3898) * Added more tests for `views::as_const`, `views::stride`, and `views::zip`. [#3920](#3920) * Test code now consistently uses `override` to avoid mistakes, following the same convention as product code. [#3934](#3934) * Fixed precondition violations in `is_permutation()` tests. [#3967](#3967) * Fixed precondition violations in `regex_iterator` and `regex_token_iterator` tests. [#3990](#3990) - Code cleanups: * Removed compiler bug workarounds. [#3722](#3722) [#3769](#3769) [#3866](#3866) [#3939](#3939) * Improved SFINAE to follow modern conventions. [#3736](#3736) * Various cleanups (described in detail in the PRs, not repeated here). [#3758](#3758) [#3759](#3759) [#3765](#3765) [#3768](#3768) [#3912](#3912) [#3927](#3927) [#3935](#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](#3784) [#3785](#3785) * Marked internal machinery as `[[noreturn]]`. [#3865](#3865) [#3882](#3882) * Removed unnecessary `typename` keywords in C++20 mode and later. [#3892](#3892) [#3893](#3893) [#3894](#3894) * Improved type safety by using an `enum class` for internal machinery within `<condition_variable>`, `<mutex>`, and `<thread>`. [#3897](#3897) * Improved the consistency of code that should never be called. [#3905](#3905) * Removed unused code. [#3936](#3936) * Improved the clarity and maintainability of `basic_string`'s implementation. [#3862](#3862) * Deprecated the non-standard `<cvt/meow>` headers and their provided character encoding conversion machinery. [#3924](#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](#3907) * Improved the consistency of preprocessor comments. [#3900](#3900) [#3951](#3951) - Infrastructure improvements: * Modernized code format validation to use `<print>`. [#3919](#3919) * Updated dependencies. [#3769](#3769) [#3866](#3866) [#3939](#3939) + Updated build compiler to VS 2022 17.8 Preview 1. + Updated Boost.Math to 1.83.0. [#3952](#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](#3730) [#3930](#3930) - Updated `_MSVC_STL_UPDATE`. [#3742](#3742) [#3851](#3851) [#3918](#3918)
VS 2022 17.7 - Merged C++23 features: * [P1467R9](https://wg21.link/P1467R9) [#3583](#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](#3337) `<print>`: Formatted Output + [P2539R4](https://wg21.link/P2539R4) Synchronizing `print()` With The Underlying Stream * [P2164R9](https://wg21.link/P2164R9) [#3472](#3472) `views::enumerate` * [P2165R4](https://wg21.link/P2165R4) [#3372](#3372) Compatibility Between `tuple`, `pair`, And *tuple-like* Objects * [P2321R2](https://wg21.link/P2321R2) `zip`, completed by implementing: + `views::adjacent` and `views::pairwise`. [#3508](#3508) + `views::adjacent_transform` and `views::pairwise_transform`. [#3546](#3546) * [P2374R4](https://wg21.link/P2374R4) [#3561](#3561) `views::cartesian_product` + [P2540R1](https://wg21.link/P2540R1) Empty Product For Certain Views * [P2572R1](https://wg21.link/P2572R1) [#3629](#3629) `std::format` Fill Character Allowances * [P2609R3](https://wg21.link/P2609R3) [#3486](#3486) Relaxing Ranges Just A Smidge * [P2614R2](https://wg21.link/P2614R2) [#3482](#3482) Deprecating `float_denorm_style`, `numeric_limits::has_denorm`, `numeric_limits::has_denorm_loss` * [P2652R2](https://wg21.link/P2652R2) [#3542](#3542) Disallowing User Specialization Of `allocator_traits` * [P2655R3](https://wg21.link/P2655R3) [#3513](#3513) `common_reference_t` Of `reference_wrapper` Should Be A Reference Type * [P2736R2](https://wg21.link/P2736R2) [#3556](#3556) Referencing The Unicode Standard + `<format>` now understands Unicode 15. * [P2770R0](https://wg21.link/P2770R0) [#3466](#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](#3656) - Merged LWG issue resolutions: * [LWG-2195](https://wg21.link/lwg2195) [#3506](#3506) Missing constructors for `match_results` * [LWG-2309](https://wg21.link/lwg2309) [#3469](#3469) `mutex::lock()` should not throw `device_or_resource_busy` * [LWG-2381](https://wg21.link/lwg2381) [#3364](#3364) Inconsistency in parsing floating point numbers * [LWG-3204](https://wg21.link/lwg3204) [#3494](#3494) `sub_match::swap` only swaps the base class * [LWG-3655](https://wg21.link/lwg3655) [#3495](#3495) The *`INVOKE`* operation and `union` types * [LWG-3677](https://wg21.link/lwg3677) [#3396](#3396) Is a *cv*-qualified `pair` specially handled in uses-allocator construction? * [LWG-3720](https://wg21.link/lwg3720) [#3511](#3511) Restrict the valid types of *arg-id* for *width* and *precision* in *std-format-spec* * [LWG-3733](https://wg21.link/lwg3733) [#3496](#3496) `ranges::to` misuses *`cpp17-input-iterator`* * [LWG-3734](https://wg21.link/lwg3734) [#3503](#3503) Inconsistency in `inout_ptr` and `out_ptr` for empty case * [LWG-3821](https://wg21.link/lwg3821) [#3509](#3509) `uses_allocator_construction_args` should have overload for *`pair-like`* * [LWG-3833](https://wg21.link/lwg3833) [#3477](#3477) Remove specialization `template<size_t N> struct formatter<const charT[N], charT>` * [LWG-3836](https://wg21.link/lwg3836) [#3587](#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](#3479) `ranges::to` can still return views * [LWG-3851](https://wg21.link/lwg3851) [#3517](#3517) `chunk_view::`*`inner-iterator`* missing custom `iter_move` and `iter_swap` * [LWG-3860](https://wg21.link/lwg3860) [#3480](#3480) `range_common_reference_t` is missing * [LWG-3862](https://wg21.link/lwg3862) [#3471](#3471) `basic_const_iterator`'s `common_type` specialization is underconstrained * [LWG-3865](https://wg21.link/lwg3865) [#3476](#3476) Sorting a range of `pair`s + This can be a **source-breaking change** in unusual scenarios. * [LWG-3869](https://wg21.link/lwg3869) [#3487](#3487) Deprecate `std::errc` constants related to UNIX STREAMS * [LWG-3870](https://wg21.link/lwg3870) [#3475](#3475) Remove *`voidify`* * [LWG-3872](https://wg21.link/lwg3872) [#3470](#3470) `basic_const_iterator` should have custom `iter_move` * [LWG-3875](https://wg21.link/lwg3875) [#3485](#3485) `std::ranges::repeat_view<T, IntegerClass>::`*`iterator`* may be ill-formed * [LWG-3877](https://wg21.link/lwg3877) [#3504](#3504) Incorrect constraints on `const`-qualified monadic overloads for `std::expected` * [LWG-3887](https://wg21.link/lwg3887) [#3589](#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](#3405) * Fixed compiler errors found with Clang 16. [#3483](#3483) * Fixed `<ranges>` to avoid using list-initialization when the difference between braces and parentheses is observable. [#3493](#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](#3510) * Fixed technically undefined behavior in `<regex>` and `<sstream>` found by Clang/LLVM's Undefined Behavior Sanitizer (UBSan). [#3452](#3452) * Fixed compiler errors when calling `ranges::equal` with ranges involving `views::iota`. [#3551](#3551) * Fixed the STL's iterator unwrapping machinery to avoid requiring a `_Prevent_inheriting_unwrap` typedef. [#3566](#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](#3581) * Fixed `bind()` function objects to have constrained function call operators, so they interact properly with `is_invocable` and related scenarios. [#3577](#3577) * Reverted [#2654](#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](#3607) + We backported this revert to VS 2022 17.6. * Fixed `views::cartesian_product` to avoid compiler errors in pathological scenarios. [#3609](#3609) * Fixed incorrect results for ranges larger than 4 GB passed to the vectorized implementations of `min_element()`, `max_element()`, and `minmax_element()`. [#3619](#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](#2447) [#2821](#2821) [#2825](#2825) in VS 2022 17.4. * Added a compiler bug workaround for MSVC in `shared_ptr`'s `operator<=>`. [#3647](#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](#3650) * Fixed compiler errors when formatting unusual `chrono::duration` types. [#3649](#3649) * Fixed `optional::transform()` to avoid terminating when the callable object throws an exception. [#3668](#3668) * Fixed `<charconv>` floating-point `from_chars()` to correctly handle two scenarios involving exponents with large absolute values. [#3670](#3670) * Fixed iostreams floating-point parsing to produce correct results for many different scenarios. [#3364](#3364) * Fixed compiler errors when importing the Standard Library Modules and calling `typeid(T).name()`. [#3677](#3677) * Fixed some nasty corner cases in `cartesian_product_view`. [#3678](#3678) * Fixed some issues with parsing numbers with grouping separators. [#3684](#3684) * Fixed a bug that could result in `unordered_meow` containers allocating too few buckets. [#3687](#3687) - Improved performance: * Slightly optimized `mutex` and `recursive_mutex` construction by avoiding a Windows API call. [#3522](#3522) * Slightly optimized `unique_ptr` move assignment by avoiding an unnecessary branch. [#3540](#3540) * Optimized `chrono::time_zone::to_sys` and `chrono::time_zone::to_local`, with a speedup of approximately 3x (times, not percent). [#3579](#3579) * Optimized `type_index::operator<=>` to avoid calling the comparison function twice. [#3600](#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](#3630) * Optimized the constructors `system_error(error_code)` and `system_error(int, const error_category&)`. [#3635](#3635) - Improved throughput: * `<optional>` and `<variant>` now include fewer headers. [#3624](#3624) * Moved internal machinery into `<regex>` where it's needed. [#3625](#3625) * C++20 `<chrono>` now avoids including `<algorithm>`. [#3626](#3626) * `<compare>` now avoids including `<bit>`. [#3627](#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](#3623) [#3654](#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](#3700) - Enhanced behavior: * Silenced [CodeQL](https://codeql.github.com/) warnings. [#3489](#3489) [#3585](#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](#3497) * Enabled `<source_location>` for Clang. [#3584](#3584) * Removed the non-Standard `xtime` type from `<chrono>`. [#3594](#3594) * Added `static_assert`s to containers, container adaptors, and `allocator` to improve the error messages when they're given non-object types. [#2436](#2436) [#3660](#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](#3452) * Added more tests for `views::empty`, `views::iota`, `views::istream`, `views::repeat`, and `views::single`. [#3553](#3553) * Fixed nonconformant code in the test for Standard Library Header Units and Modules. [#3588](#3588) * Added test coverage for C++23's customization point objects. [#3610](#3610) * Added more tests for `ranges::ref_view`, `ranges::subrange`, `views::common`, `views::filter`, `views::join`, `views::reverse`, and `views::transform`. [#3612](#3612) - Code cleanups: * Removed many compiler (and CMake) bug workarounds. [#3490](#3490) [#3499](#3499) [#3651](#3651) [#3711](#3711) * Various cleanups (described in detail in the PRs, not repeated here). [#2116](#2116) [#3406](#3406) [#3523](#3523) [#3524](#3524) [#3525](#3525) [#3526](#3526) [#3527](#3527) [#3528](#3528) [#3529](#3529) [#3530](#3530) [#3531](#3531) [#3532](#3532) [#3533](#3533) [#3539](#3539) [#3543](#3543) [#3547](#3547) [#3598](#3598) [#3633](#3633) [#3639](#3639) [#3658](#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](#3554) * Simplified code by calling `fill_n()` instead of `fill()` when possible. [#3578](#3578) - Improved documentation: * Added documentation about the STL's import library. [#2141](#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](#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](#3621) * Updated dependencies. [#3490](#3490) [#3651](#3651) [#3711](#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](#3657) - Updated `_MSVC_STL_UPDATE`. [#3518](#3518) [#3643](#3643) [#3680](#3680)
VS 2022 17.6 - Merged C++23 features: * [P1223R5](https://wg21.link/P1223R5) [#3268](#3268) `ranges::find_last`, `ranges::find_last_if`, `ranges::find_last_if_not` * [P2167R3](https://wg21.link/P2167R3) [#3258](#3258) Improving *`boolean-testable`* Usage * [P2278R4](https://wg21.link/P2278R4) [#3187](#3187) [#3234](#3234) `cbegin` Should Always Return A Constant Iterator * [P2404R3](https://wg21.link/P2404R3) [#3345](#3345) Move-Only Types For Comparison Concepts * [P2467R1](https://wg21.link/P2467R1) [#3065](#3065) `ios_base::noreplace`: Exclusive Mode For `fstream`s * [P2474R2](https://wg21.link/P2474R2) [#3142](#3142) `views::repeat` * [P2505R5](https://wg21.link/P2505R5) [#3361](#3361) Monadic Functions For `expected` * [P2588R3](https://wg21.link/P2588R3) [#3455](#3455) `barrier`'s Phase Completion Guarantees * [P2602R2](https://wg21.link/P2602R2) [#3215](#3215) Poison Pills Are Too Toxic * [P2711R1](https://wg21.link/P2711R1) [#3451](#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](#3323) * [P2321R2](https://wg21.link/P2321R2) `zip`: + `views::zip_transform`. [#3322](#3322) + *Note:* `views::adjacent` and `views::adjacent_transform` remain to be implemented. - Merged LWG issue resolutions: * [LWG-3515](https://wg21.link/lwg3515) [#3236](#3236) \[stacktrace.basic.nonmem\]: `operator<<` should be less templatized * [LWG-3545](https://wg21.link/lwg3545) [#3242](#3242) `std::pointer_traits` should be SFINAE-friendly * [LWG-3594](https://wg21.link/lwg3594) [#3276](#3276) `inout_ptr` - inconsistent `release()` in destructor * [LWG-3629](https://wg21.link/lwg3629) [#3272](#3272) `make_error_code` and `make_error_condition` are customization points * [LWG-3646](https://wg21.link/lwg3646) [#3261](#3261) `std::ranges::view_interface::size` returns a signed type * [LWG-3717](https://wg21.link/lwg3717) [#3266](#3266) `common_view::end` should improve `random_access_range` case * [LWG-3736](https://wg21.link/lwg3736) [#3318](#3318) `move_iterator` missing `disable_sized_sentinel_for` specialization * [LWG-3737](https://wg21.link/lwg3737) [#3320](#3320) `take_view::`*`sentinel`* should provide `operator-` * [LWG-3743](https://wg21.link/lwg3743) [#3269](#3269) `ranges::to`'s `reserve` may be ill-formed * [LWG-3746](https://wg21.link/lwg3746) [#3265](#3265) `optional`'s spaceship with `U` with a type derived from `optional` causes infinite constraint meta-recursion * [LWG-3769](https://wg21.link/lwg3769) [#3459](#3459) `basic_const_iterator::operator==` causes infinite constraint recursion * [LWG-3772](https://wg21.link/lwg3772) [#3462](#3462) `repeat_view`'s piecewise constructor is missing preconditions * [LWG-3778](https://wg21.link/lwg3778) [#3332](#3332) `vector<bool>` missing exception specifications * [LWG-3785](https://wg21.link/lwg3785) [#3319](#3319) `ranges::to` is over-constrained on the destination type being a range * [LWG-3798](https://wg21.link/lwg3798) [#3359](#3359) Rvalue reference and `iterator_category` * [LWG-3810](https://wg21.link/lwg3810) [#3421](#3421) CTAD for `std::basic_format_args` * [LWG-3823](https://wg21.link/lwg3823) [#3231](#3231) Unnecessary precondition for `is_aggregate` * [LWG-3848](https://wg21.link/lwg3848) [#3410](#3410) `slide_view` missing `base` accessor * [LWG-3850](https://wg21.link/lwg3850) [#3423](#3423) `views::as_const` on `empty_view<T>` should return `empty_view<const T>` * [LWG-3853](https://wg21.link/lwg3853) [#3468](#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](#3348) `basic_string_view` should allow explicit conversion when only traits vary * [LWG-3867](https://wg21.link/lwg3867) [#3367](#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](#3232) * Fixed another unintentionally dllexported symbol in the import library. [#3233](#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](#3235) + This ABI break was introduced by [#1735](#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](#3255) + This ABI break was introduced by [#2654](#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](#3247) + This fixed a regression that was introduced by [#2434](#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](#3243) * Fixed compiler warnings when passing `long double` to `copysign()`. [#3253](#3253) * Re-enabled ASan (Address Sanitizer) annotations in `<string>` after fixing significant bugs. [#3164](#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](#3270) * Fixed `shared_future<void>`'s move assignment operator to be `noexcept` as required by the Standard. [#3284](#3284) * Fixed Clang compiler errors involving intrinsics by including `<intrin.h>`, which is a header that Clang recognizes and supports. [#3285](#3285) * Fixed `numeric_limits` to correctly report that `is_signed` is `true` for the STL's internal 128-bit signed-integer-class type. [#3291](#3291) * Fixed `<stacktrace>` to correctly pass `SYMOPT_FAIL_CRITICAL_ERRORS` to the Windows API. [#3292](#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](#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](#3316) * Added compiler bug workarounds: + For Clang in `<expected>`. [#3326](#3326) + For Clang in `<ranges>`. [#3328](#3328) + For MSVC modules in `<filesystem>`. [#3331](#3331) * Fixed `constexpr` `basic_string` to correctly start the lifetimes of its elements, avoiding compiler errors. [#3334](#3334) * Fixed `views::istream` constraints to precisely follow the Standard. [#3335](#3335) * Implemented C++17's parallel specialized `<memory>` algorithms. [#3145](#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](#3342) * Fixed a compiler error when calling `ranges::prev` on an `iota_view` iterator in debug mode. [#3356](#3356) * Fixed `ranges::minmax` to avoid moving from an element twice when called with a single-element range of `move_iterator`s. [#3366](#3366) * Fixed a minor conformance issue in the `std.ixx` Standard Library Module. [#3373](#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](#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](#3381) * Changed `vformat_to()` to instantiate its machinery in a lazier way. [#3403](#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](#3250) * Activated `count()`'s vectorized implementation for more eligible iterators in C++14/17 modes. [#3262](#3262) * Activated the vectorized implementations of `find()`, `count()`, `ranges::find()`, and `ranges::count()` for more scenarios involving pointer elements. [#3267](#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](#3399) * `ranges::find` now calls `memchr()` in more situations (when the vectorized implementation isn't available). [#3386](#3386) - Improved throughput: * Moved user-defined literals for the STL's internal 128-bit integer-class types from product code to test code. [#3252](#3252) * Removed unnecessary `operator==` and `operator!=` overloads for internal types in C++20 mode. [#3256](#3256) * Used `if constexpr` instead of overloads in internal machinery. [#3389](#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](#3194) [#3201](#3201) + See tracking issue [#3193](#3193) for a list of compiler bugs that affect these newly enabled `/clr` scenarios. * Added visualizers for `error_category` and `error_code`. [#3204](#3204) * Improved the output of `source_location::function_name()`. [#3206](#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](#3282) * Changed `<mutex>` to use scope guards instead of `throw;`, making debugging easier when exceptions are thrown. [#3321](#3321) * Strengthened the exception specifications for: + `mutex::unlock()`, `recursive_mutex::unlock()`, and `unique_lock`'s move assignment operator. [#3321](#3321) + Various member functions and `swap()` overloads for stream types. [#3314](#3314) + Various non-member and member functions in `<condition_variable>`, `<mutex>`, `<shared_mutex>`, and `<thread>`. [#3388](#3388) * Added `modules/modules.json` to support build systems. [#3358](#3358) [#3488](#3488) * Refactored `ranges::minmax` and `ranges::minmax_element` to detect the single-element case naturally. [#3384](#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](#3453) - Improved documentation: * Clarified the error message when including the internal header `<__msvc_cxx_stdatomic.hpp>` in C mode. [#3192](#3192) - Improved test coverage: * Enabled `<stdatomic.h>` test coverage for Clang. [#3186](#3186) * Updated the modules tests after a compiler bugfix for `source_location`. [#3339](#3339) * Added more tests for `views::elements`. [#3350](#3350) * Updated our LLVM submodule reference, including new tests. [#3344](#3344) [#3357](#3357) * Added more tests for `views::drop`, `views::drop_while`, `views::take`, and `views::take_while`. [#3390](#3390) - Code cleanups: * Removed compiler bug workarounds. [#3202](#3202) [#3288](#3288) [#3351](#3351) [#3350](#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](#3238) [#3461](#3461) * Improved consistency in preprocessor comments. [#3208](#3208) * Simplified a line in `experimental::filesystem::recursive_directory_iterator::operator++()`. [#3279](#3279) * Various cleanups (described in detail in the PRs, not repeated here). [#3293](#3293) [#3300](#3300) * Removed unused internal machinery. [#3299](#3299) * Simplified types by defaulting some of their special member functions: + `promise` and `packaged_task`. [#3315](#3315) + `shared_mutex`, `shared_timed_mutex`, and `shared_lock`. [#3352](#3352) * Changed more temporary objects to be constructed with braces instead of parentheses. [#3277](#3277) * Updated comments after a compiler bug was fixed. [#3394](#3394) * Updated tests and separately compiled sources to directly use the `[[nodiscard]]` attribute. [#3397](#3397) * Updated notes for skipped tests in the `libcxx` test suite. [#3464](#3464) - Infrastructure improvements: * Added GitHub Actions to automatically add PR cards to the Code Reviews project. [#3393](#3393) * Fixed the build system to properly pass options when assembling the "alias objects". [#3402](#3402) * Updated dependencies. [#3202](#3202) [#3288](#3288) [#3340](#3340) [#3351](#3351) [#3467](#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](#3312) - Updated `_MSVC_STL_UPDATE`. [#3191](#3191) [#3264](#3264) [#3362](#3362) [#3395](#3395)
VS 2022 17.5 - Merged C++23 features: * [P2322R6](https://wg21.link/P2322R6) [#3099](#3099) `ranges::fold_left`, `ranges::fold_right`, etc. * [P2465R3](https://wg21.link/P2465R3) [#3108](#3108) Standard Library Modules `std` And `std.compat` + Initially supported for MSVC only; see tracking issue [#1694](#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](#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](#3043) * [P2321R2](https://wg21.link/P2321R2) `zip`: + `views::zip`. [#3035](#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](#2949) Missing preconditions for `slide_view` constructor * [LWG-3788](https://wg21.link/lwg3788) [#3130](#3130) `jthread::operator=(jthread&&)` postconditions are unimplementable under self-assignment - Fixed bugs: * Fixed compiler warnings when using Standard Library Header Units. [#3069](#3069) * Removed a non-Standard member function `locale::c_str()`. [#3088](#3088) * Fixed narrowing warnings when calling `piecewise_constant_distribution<float>::densities()` and `piecewise_linear_distribution<float>::densities()`. [#3107](#3107) * Fixed compiler errors when calling `ranges::is_permutation` with predicates that return highly unusual boolean-testable types. [#3113](#3113) * Fixed compiler errors when building the Standard Library Modules with static RTTI disabled. [#3115](#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](#3101) [#3148](#3148) * When `chrono::time_zone::get_info()` throws an exception, fixed it to report `GetLastError()` as intended, instead of `"The operation completed successfully."` [#3122](#3122) * Fixed incorrect results returned by `ellint_2()`. [#3077](#3077) * Fixed `error_category`'s default constructor to be `constexpr`. [#3139](#3139) [#3176](#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](#3162) * Fixed compiler errors in certain `<ranges>` scenarios by properly constraining *`movable-box`*'s copy constructors. [#3171](#3171) - Improved performance: * Added support for unwrapping to `move_sentinel`. [#3098](#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](#3012) * Optimized `gcd()` to avoid a redundant shift. [#3127](#3127) * Optimized `locale::classic()` for a 10x speedup (times, not percent). [#3048](#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](#3182) - Improved throughput: * Significantly improved compile times for `<variant>` `visit()`. [#3070](#3070) * `<format>` now includes fewer headers. [#3128](#3128) * Moved random number generator machinery out of `<xutility>`, one of the STL's central internal headers. [#3157](#3157) - Enhanced behavior: * Clarified `get_future()`'s `[[nodiscard("message")]]`. [#3068](#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](#3116) * Improved `<format>`'s compiler error messages for unformattable types. [#3080](#3080) - Improved test coverage: * Added test coverage for `<variant>` `visit()` invoking pointers to members. [#3070](#3070) * Expanded test coverage for `forward_like()`. [#3072](#3072) * Updated test coverage for `views::as_rvalue`. [#3089](#3089) * Expanded test coverage for `bind_front()` and `bind_back()`. [#3117](#3117) * Updated our LLVM submodule reference, including new tests, and updates to the `any`/`optional`/`variant` shared test code. [#2976](#2976) * Fixed bogus test code discovered by Clang 15. [#3135](#3135) * Fixed the off-by-default "exhaustive" mode of the parallel `is_partitioned()` test. [#3174](#3174) - Code cleanups: * Various cleanups (described in detail in the PRs, not repeated here). [#3082](#3082) [#3083](#3083) [#3084](#3084) [#3085](#3085) [#3086](#3086) [#3090](#3090) [#3091](#3091) [#3092](#3092) [#3093](#3093) [#3177](#3177) [#3178](#3178) * Improved Python scripts. [#3123](#3123) * Removed compiler bug workarounds. [#3155](#3155) * Moved `<atomic>` implementation details, preparing for later changes. [#3124](#3124) * Removed unnecessary partial specializations of `common_type` for the STL's internal 128-bit integer-class types. [#3153](#3153) - Infrastructure improvements: * The PR/CI system now uses spot VMs again. [#3071](#3071) * Configured Azure Pipelines to avoid running checks for draft PRs. [#3078](#3078) * Added GitHub Actions to allow contributors to move their PR cards in the Code Reviews project. [#2584](#2584) * Updated dependencies. [#3104](#3104) [#3155](#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](#3077) + Updated Clang to 15.0.1 (now required). + Updated CMake to 3.24 (now required). + Updated Google Benchmark to 1.7.0. [#3151](#3151) + Updated Python to 3.10.8. - Updated `_MSVC_STL_UPDATE`. [#3073](#3073) [#3147](#3147)
VS 2022 17.4 - Merged C++23 features: * [P0849R8](https://wg21.link/P0849R8) [#2808](#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](#2502) `<stacktrace>` + [P2301R1](https://wg21.link/P2301R1) Add A `pmr` Alias For `std::stacktrace` * [P1206R7](https://wg21.link/P1206R7) [#2806](#2806) [#3026](#3026) [#3028](#3028) Conversions From Ranges To Containers * [P1328R1](https://wg21.link/P1328R1) [#2793](#2793) `constexpr` `type_info::operator==()` * [P1899R3](https://wg21.link/P1899R3) [#2981](#2981) `views::stride` * [P2291R3](https://wg21.link/P2291R3) [#3049](#3049) `constexpr` Integral `<charconv>` * [P2302R4](https://wg21.link/P2302R4) [#2911](#2911) `ranges::contains`, `ranges::contains_subrange` * [P2387R3](https://wg21.link/P2387R3) [#2661](#2661) Pipe Support For User-Defined Range Adaptors * [P2408R5](https://wg21.link/P2408R5) [#2960](#2960) [#3056](#3056) Ranges Iterators As Inputs To Non-Ranges Algorithms * [P2417R2](https://wg21.link/P2417R2) [#2972](#2972) More `constexpr` `bitset` * [P2419R2](https://wg21.link/P2419R2) [#2977](#2977) Clarify Handling Of Encodings In Localized Formatting Of `chrono` Types * [P2438R2](https://wg21.link/P2438R2) [#3057](#3057) `string::substr() &&` * [P2440R1](https://wg21.link/P2440R1) [#2580](#2580) `ranges::iota`, `ranges::shift_left`, `ranges::shift_right` * [P2441R2](https://wg21.link/P2441R2) [#2619](#2619) `views::join_with` * [P2445R1](https://wg21.link/P2445R1) [#2974](#2974) `forward_like()` * [P2446R2](https://wg21.link/P2446R2) [#3008](#3008) `views::as_rvalue` * [P2494R2](https://wg21.link/P2494R2) [#2965](#2965) Relaxing Range Adaptors To Allow Move-Only Types * [P2499R0](https://wg21.link/P2499R0) [#2947](#2947) `string_view` Range Constructor Should Be `explicit` * [P2517R1](https://wg21.link/P2517R1) [#2959](#2959) Conditional `noexcept` For `apply()` * [P2520R0](https://wg21.link/P2520R0) [#2958](#2958) [#2994](#2994) `move_iterator<T*>` Should Be A Random-Access Iterator - Merged LWG issue resolutions: * [LWG-3564](https://wg21.link/lwg3564) [#2961](#2961) `transform_view::`*`iterator`*`<true>::value_type` and `iterator_category` should use `const F&` * [LWG-3617](https://wg21.link/lwg3617) [#2966](#2966) `function`/`packaged_task` deduction guides and deducing `this` * [LWG-3656](https://wg21.link/lwg3656) [#2880](#2880) Inconsistent bit operations returning a count * [LWG-3671](https://wg21.link/lwg3671) [#2905](#2905) `atomic_fetch_xor` missing from `stdatomic.h` * [LWG-3672](https://wg21.link/lwg3672) [#2907](#2907) `common_iterator::operator->()` should return by value * [LWG-3683](https://wg21.link/lwg3683) [#2879](#2879) `operator==` for `polymorphic_allocator` cannot deduce template argument in common cases * [LWG-3701](https://wg21.link/lwg3701) [#2957](#2957) Make `formatter<remove_cvref_t<const charT[N]>, charT>` requirement explicit * [LWG-3707](https://wg21.link/lwg3707) [#2883](#2883) `chunk_view::`*`outer-iterator`*`::value_type::size` should return unsigned type * [LWG-3710](https://wg21.link/lwg3710) [#2878](#2878) The `end` of `chunk_view` for input ranges can be `const` * [LWG-3712](https://wg21.link/lwg3712) [#2943](#2943) `chunk_view` and `slide_view` should not be `default_initializable` * [LWG-3715](https://wg21.link/lwg3715) [#2946](#2946) `view_interface::empty` is overconstrained * [LWG-3719](https://wg21.link/lwg3719) [#2902](#2902) Directory iterators should be usable with default sentinel * [LWG-3721](https://wg21.link/lwg3721) [#2906](#2906) Allow an *arg-id* with a value of zero for *width* in *std-format-spec* * [LWG-3724](https://wg21.link/lwg3724) [#2903](#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](#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](#2193) * Fixed compiler errors when using `<format>` with the new compiler option `/presetPadding` by adding a compiler bug workaround. [#2746](#2746) * Fixed division by `complex` zero to behave consistently with other implementations. [#2758](#2758) * Fixed a memory leak in `<syncstream>`. [#2763](#2763) * Fixed compiler errors when formatting `long` or `unsigned long` values with `formatter`. [#2768](#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](#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](#2790) * Fixed a bug in `deque`, specific to rarely-used fancy pointers, where some fancy pointers weren't being destroyed. [#2775](#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](#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](#1343) * Added a compiler bug workaround to `construct_at()`, allowing immovable objects to be emplaced via copy elision. [#2624](#2624) * Fixed leap second validation when parsing `time_point`s. [#2705](#2705) * `lerp()` now avoids overflowing to infinity when it can calculate the correct result with a fallback approach. [#1918](#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](#2782) * Fixed the visualizers for the non-Standard `stdext::hash_map` container family. [#2784](#2784) * Fixed the visualizers for `make_shared()` and `allocate_shared()`. [#2811](#2811) * `put_time()` (and the `time_put::do_put()` machinery powering it) now avoids modifying `errno` when it succeeds. [#2049](#2049) * Added a compiler bug workaround to fix compiler errors with `source_location::current()` in certain scenarios. [#2824](#2824) * Fixed compiler errors when using `<format>` to print `duration`s with extremely small periods (e.g. femtoseconds, attoseconds). [#2814](#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](#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](#2854) * Fixed incorrect results from `<complex>` `log()`/`log10()`/`pow()` on ARM64. [#2870](#2870) * Fixed `path::lexically_relative()` to handle UNC drive paths like `\\?\C:\meow.txt`. [#2867](#2867) * Fixed `filesystem::read_symlink()` and `filesystem::copy()` to handle junctions. [#2877](#2877) * Fixed compiler errors in `ranges::uninitialized_copy_n` and `ranges::uninitialized_move_n` with certain input iterators. [#2964](#2964) * Fixed `ranges::enable_view` to properly reject references and to avoid compiler errors in certain unusual situations. [#2978](#2978) * Temporarily disabled ASan (Address Sanitizer) annotations in `<string>` while significant bugs are under investigation. [#2990](#2990) * Fixed compiler errors in `views::chunk_by` with unusual predicates returning non-`bool` types. [#2890](#2890) * Fixed compiler errors in `visit<R>()` involving conversions to immovable types. [#2971](#2971) [#2999](#2999) * Fixed compiler errors in `chrono::abs()` in certain unusual situations. [#2988](#2988) * Fixed `<format>` to always print NaNs as `"nan"`, `"-nan"`, or uppercase versions as required by the Standard, never `"-nan(ind)"`. [#3001](#3001) * Fixed `ranges::shuffle` and `ranges::sample` to accept `uniform_random_bit_generator`s that don't provide `result_type`. [#3002](#3002) * Fixed `vector<bool>::insert(where, first, last)` and `vector<bool>::insert_range(where, range)` to meet the Standard's complexity requirements. [#3021](#3021) * Fixed how `chunk_view` and `stride_view` iterators validate their preconditions. [#3023](#3023) * Fixed a compiler warning emitted by the unusual scenario of `basic_string_view<char_like_struct>`. [#3032](#3032) * Fixed `move_only_function` to behave correctly when passed between DLLs. [#3038](#3038) * Fixed compiler errors when `dllexport`ing classes derived from `pair` or `tuple`. [#3045](#3045) + This fixed a regression that was introduced by [#2687](#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](#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](#2987) * Overhauled how the STL unwraps iterators and sentinels, fixing various issues. [#3024](#3024) * `basic_string::substr()` now uses a default-constructed allocator as required by the Standard. [#3057](#3057) * Fixed CUDA compiler errors with `std::_Bit_cast` by using `__builtin_bit_cast` instead of a `memcpy` workaround. [#3066](#3066) - Improved performance: * Improved `clamp()` codegen with conditional move instructions. [#2336](#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](#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](#1794) * Reduced the size of the lookup tables used for `<format>` grapheme clusterization, saving 2670 bytes. [#2757](#2757) * `std::filesystem::path::lexically_relative()` now avoids unnecessary memory allocations. [#1915](#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](#2447) [#2821](#2821) [#2825](#2825) * Reduced binary size for programs using `atomic::wait`. [#2781](#2781) * Avoided an unnecessary OS call in `thread::join()`. [#2820](#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](#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](#2841) * Reduced the number of OS calls in `filesystem::resize_file()` and `experimental::filesystem::resize_file()`. [#2771](#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](#2855) * Improved the optimized codegen for `unreachable()`. [#3055](#3055) - Improved throughput: * Used `if constexpr` instead of tag dispatch in: + `get<I>()` and `get<T>()` for `pair`. [#2756](#2756) * `optional`, `pair`, and `tuple` now use conditional `explicit` instead of SFINAE in all Standard modes, for all supported compilers. [#2796](#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](#2797) * `<charconv>`'s large lookup tables are now separately compiled, so translation units including `<charconv>` will emit significantly smaller object files. [#2125](#2125) * The STL now uses helper function templates for testing bitmask types, replacing a significant number of function overloads. [#2865](#2865) * `<unordered_map>` and `<unordered_set>` now avoid including most of `<string>`. [#2996](#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](#3027) * `<functional>` now avoids including `<memory>`. [#2998](#2998) + Escape hatch: define `_LEGACY_CODE_ASSUMES_FUNCTIONAL_INCLUDES_MEMORY`. [#3027](#3027) - Enhanced behavior: * `<tuple>` is now a [core header](https://github.com/microsoft/STL/wiki/The-Difference-Between-Core-And-Non-Core-Headers). [#2730](#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](#2748) * `complex<NonFloating>` now emits a deprecation warning explaining that it has unspecified behavior according to the Standard. [#2759](#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](#2164) * The STL now marks all of its namespace-scope `constexpr` variables as `inline` in C++17-and-later mode. [#2792](#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](#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](#2742) * `<system_error>` now maps: [#2744](#2744) [#2899](#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](#2843) * Added more visualizers for `<any>`, `<format>`, `<functional>`, `<mutex>`, and `<ranges>`. [#2191](#2191) * `<cstdlib>` now makes its `using`-declarations for `std::getenv()` and `std::system()` available to UWP apps. [#2850](#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](#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](#3011) * Added a couple of warning numbers for easier lookup: [#2061](#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](#2996) * Improved how STL error messages (like "Unexpected compiler version") are displayed. [#2897](#2897) * Further improved how STL warnings and errors are displayed. [#2973](#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](#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](#1263) * Strengthened exception specifications on: + Iterator machinery. [#1347](#1347) [#2991](#2991) + `<optional>` and the classic comparison function objects (`less<T>`, `equal_to<T>`, etc.). [#1937](#1937) [#3041](#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](#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](#3036) - Improved test coverage: * Enabled tests now that Clang 14 supports `<coroutine>`. [#2861](#2861) * Slightly accelerated test runs by running memory leak tests with only debug configurations (where memory leak tracking is available). [#2853](#2853) * Fixed a test that failed at runtime on ARM64. [#2864](#2864) * Added `/permissive` configurations to tests that can successfully compile in this discouraged-but-supported mode. [#3015](#3015) * Taught VSCode's Python extension where to find our test support machinery. [#3040](#3040) * Updated the `<source_location>` test for an upcoming compiler fix. [#3046](#3046) * Added test coverage for a `<string>` bug (specific to ASan annotations being enabled) that was fixed. [#3039](#3039) - Code cleanups: * Removed compiler bug workarounds. [#2791](#2791) [#2861](#2861) * Various cleanups (described in detail in the PRs, not repeated here). [#2798](#2798) [#2801](#2801) [#2802](#2802) [#2815](#2815) [#2766](#2766) [#2828](#2828) [#2863](#2863) [#2950](#2950) [#3019](#3019) * Removed visualizers for VS 2013's binary-incompatible representations of various data structures. [#2804](#2804) * Simplified `tuple_cat()`'s implementation. [#2833](#2833) * Improved how `<system_error>` maps Windows error codes to `errc` values. [#2837](#2837) * Refactored `<atomic>` to share code with C11 atomics (work in progress). [#2846](#2846) * Updated most files (with limited exceptions) to consistently include the `<cmeow>` wrapper headers instead of the `<meow.h>` CRT headers. [#2852](#2852) * Simplified `<random>`'s `static constexpr` data members. [#3006](#3006) * Finished changing all aliases from `typedef` to `using`. [#3018](#3018) * Cleaned up several tests to avoid unnecessary dependencies on macros and non-Standard code. [#3034](#3034) * Updated `<functional>` and `<memory>` to consistently use modern `int = 0` SFINAE. [#2124](#2124) * Cleaned up feature-test macro usage to be simpler and more consistent. [#3053](#3053) - Improved documentation: * Added a comment explaining why `basic_string` doesn't use templated `static constexpr` data members as internal helpers. [#2980](#2980) - Infrastructure improvements: * Eliminated duplicate builds of the "alias objects". [#2743](#2743) * Fixed distributed test runs to split up the test suite deterministically, avoiding missed or repeated tests. [#2795](#2795) * Properly applied `/analyze` to PR/CI builds, and fixed warnings in the STL's separately compiled sources. [#2812](#2812) * Fixed cross-PR/CI contamination by cleaning both before and after checkout. [#2832](#2832) * Fixed cross-PR/CI contamination by ignoring submodules during code format validation. [#3033](#3033) * Added support for writing benchmarks with [google/benchmark](https://github.com/google/benchmark). [#2780](#2780) * The PR/CI system now uses "1ES Hosted Pools". [#3054](#3054) * Updated dependencies. [#2754](#2754) [#2791](#2791) [#2831](#2831) [#2861](#2861) [#3017](#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](#2764) [#2840](#2840) [#3020](#3020)
PreviousNext