Releases: microsoft/STL
Releases · microsoft/STL
VS 2022 17.14
- Merged C++26 features:
- Merged partial C++26 features:
- P3471R4 #5274 Standard Library Hardening
- Currently disabled by default.
- This can be enabled (for any Standard mode) by defining
_MSVC_STL_HARDENINGto1project-wide. - As C++26 Contracts are not yet implemented, this defaults to calling
__fastfail()for hardened precondition violations.
- P3471R4 #5274 Standard Library Hardening
- Related behavior enhancement:
- Implemented "destructor tombstones" to mitigate use-after-free mistakes. #5318
- Currently disabled by default.
- This can be enabled by defining
_MSVC_STL_DESTRUCTOR_TOMBSTONESto1project-wide.
- Implemented "destructor tombstones" to mitigate use-after-free mistakes. #5318
- Merged LWG issue resolutions:
- LWG-3133 #5157 Modernizing numeric type requirements
- LWG-3886 #5232 Monad mo' problems (in
optionalandexpected) - LWG-3899 #5303
co_yielding elements of an lvaluegeneratoris unnecessarily inefficient - LWG-3900 #5150 The
allocator_arg_toverloads ofgenerator::promise_type::operator newshould not be constrained - LWG-3918 #5135 #5170
std::uninitialized_move/_nand guaranteed copy elision - LWG-3956 #5334
chrono::parseusesfrom_streamas a customization point - LWG-4014 #5132 LWG-3809 changes behavior of some existing
std::subtract_with_carry_enginecode - LWG-4027 #5221
possibly-const-rangeshould prefer returningconst R& - LWG-4084 #5151
std::fixedignoresstd::uppercase - LWG-4112 #5152
has-arrowshould requireoperator->()to beconst-qualified - LWG-4119 #5220
generator::promise_type::yield_value(ranges::elements_of<R, Alloc>)'s nestedgeneratormay be ill-formed - LWG-4124 #5155 Cannot format
zoned_timewith resolution coarser than seconds - LWG-4135 #5131 The helper lambda of
std::eraseforlistshould specify return type asbool - LWG-4140 #5129 Useless default constructors for bit reference types
- LWG-4144 #5201 Disallow
unique_ptr<T&, D> - LWG-4169 #5128
std::atomic<T>'s default constructor should be constrained - LWG-4172 #5337
unique_lockself-move-assignment is broken
- Merged proposed resolutions for LWG issues (not yet accepted for the C++ Working Draft, but we've chosen to implement this speculatively):
- Fixed bugs:
- Fixed
system_category().message()to prefer US English, followed by the system locale, with an ultimate fallback ofFormatMessageA's behavior fordwLanguageId == 0. #5104- This is consistent with
generic_category().message()(which always returns US English in our implementation) and has the best chance of returning something intelligible instead of"unknown error"or"???". - This fixed a regression that was introduced by #2669 in VS 2022 17.3.
- This is consistent with
- Fixed
regex's behavior:- To reject bogus character class ranges like
R"([\d-e])". #5158 - For negated character class escapes (
\Dfor non-digits,\Sfor non-whitespace,\Wfor non-words) when matching against Unicode characters: - For character ranges in case-insensitive mode. #5164
- For the
basicgrammar to parse a single digit for backreferences. #5167 - For its internal buffers to grow geometrically. #5175
- For the special character
.(dot). #5192 - For its constructor to accept (null, zero) arguments. #5211
- To reject bogus character class ranges like
- Fixed
filesystem::equivalent()to return correct results when shared folders are involved. #5130 - Fixed
chrono::weekday's constructor to avoid integer overflow for extreme inputs. #5156 - Fixed
push_range()forstack,queue, andpriority_queueto forward the range toc.append_range()when possible, exactly as depicted in the Standard. #5168 - Fixed code to call
ranges::beginandranges::endexactly as depicted in the Standard: - Fixed compiler errors in
range_formatterinvolving highly unusual contiguous ranges. #5187 - Fixed heterogeneous lookup for unordered containers to follow the Standard, allowing braced initializer lists to be used as arguments. #5208
- Fixed compiler errors in
views::countedinvolving highly unusual types. #5223 - Fixed integer overflow in
this_thread::sleep_for()with extremely small units (e.g. picoseconds). #5237 - Fixed
basic_string::reserve()'s ASan annotations to detect writes to its unused capacity. #5252 - Fixed how
<format>handles field width for alternate form general floating-point. #5261 - Fixed compiler errors when constructing a
basic_ispanstreamfrom a modifiablebasic_string. #5309- This fixed a regression that was introduced by #4938 in VS 2022 17.13.
- Fixed compiler errors when using
<format>in a CUDA project, by adding a compiler bug workaround. #5335 - Fixed compiler errors when converting between different specializations of
basic_const_iterator. #5325
- Fixed
- Improved performance:
- Added vectorized implementations of:
basic_string::find()for a character. #5101
- Improved the vectorized implementations of:
basic_string::find_first_of()andbasic_string::find_last_of(). #5029
regex_traits::translate()is now an identity function, as required by the Standard, instead of an expensive locale operation. #5209- The STL now takes advantage of compiler support for C++23 P1169R4
static operator()in earlier Standard modes, slightly improving codegen. #5284 #5312 - Optimized the
minstd_randandminstd_rand0random number engines by avoiding constant divisions. #5256 - Slightly improved
move_only_function's constructors to do less work when setting the object to be empty. #5328
- Added vectorized implementations of:
- Enhanced behavior:
std::expected,std::unexpected, and all STL exception types are now marked[[nodiscard]]. #5174- This affects all user-defined functions returning these types by value. It also affects any directly constructed temporaries that are immediately discarded.
- Deprecated the non-Standard
locale::empty()static member function. [#5197](https:...
VS 2022 17.13
- Merged C++23 features:
- Merged C++23 Defect Reports:
- Fixed bugs:
- Fixed an infinite loop in
deque::shrink_to_fit(). #4955- This fixed a regression that was introduced by #4091 in VS 2022 17.10.
- Fixed compiler errors when constructing highly unusual
unique_ptrs (storing fancy pointers) from unspeakably evil relics of the forgotten past. #4922 - Fixed compiler errors when calling
ranges::inplace_mergewith certain combinations of elements, projections, and comparisons. #4927 - Fixed compiler errors in
basic_ispanstream's constructor andbasic_ispanstream::span()takingReadOnlyRange&&with highly unusual types. #4938 - Fixed compiler errors in the highly unusual scenario of calling
basic_stringandbasic_string_view'sfind_first_of()family of member functions for program-defined "unicorn" character types. #4951 - Fixed compiler errors when constructing
optionalfrom highly unusual types. #4961 - Fixed sequence container emplacement functions (e.g.
vector::emplace_back()) to avoid emitting "warning C5046: Symbol involving type with internal linkage not defined" for highly unusual types. #4963 #4980- This also fixed ODR violations when mixing C++14 with C++17-and-later translation units calling sequence container emplacement functions for any types.
- Fixed ODR violations when mixing C++17 with C++20-and-later translation units calling
list/forward_list::remove/remove_if/unique(). #4975 - Fixed compiler errors in
variant's converting constructor and converting assignment operator for certain types. #4966 - Fixed
bitset's streaming operatoroperator>>(basic_istream<CharT, Traits>&, bitset<N>&)to use the stream'sTraitsto compare characters. #4970 - Fixed
basic_stringandlist's internal constructors to avoid disrupting highly unusual scenarios. #4976 - Fixed compiler errors when constructing a
packaged_taskfrom a move-only function object. #4946 - For Clang
/fp:fast, fixed<cmath>and<limits>to avoid emitting-Wnan-infinity-disabledwarnings, except whennumeric_limits::infinity()/quiet_NaN()/signaling_NaN()are specifically called. #4990 - Fixed
ranges::copy_nto properly handle negative values of n (as a no-op) when activating ourmemmove()optimization. #5046- Also fixed our
memmove()optimization (used bycopy_n(),ranges::copy_n, and more) to avoid emitting compiler warnings with certain iterators.
- Also fixed our
- Fixed
filesystem::directory_entry::refresh()to avoid sporadically failing for nonexistent network paths on Windows 11 24H2. #5077 - Fixed
basic_istream::get()andbasic_istream::getline()to never write a null terminator into zero-sized buffers, and to always write a null terminator otherwise. #5073 - Fixed
assign_range()for sequence containers tostatic_assertthat the container elements are assignable from the range's reference type. #5086 - Fixed compiler errors in various ranges algorithms when used with
views::iotain certain scenarios. #5091
- Fixed an infinite loop in
- Improved performance:
- Added vectorized implementations of:
basic_string::find_first_of(). #4744basic_string::find_last_of(). #4934basic_string::find()for a substring. #5048basic_string::rfind()for a substring. #5057basic_string::rfind()for a single character. #5087search(),ranges::search, anddefault_searcher, for 1-byte and 2-byte elements. #4745find_end()andranges::find_end, for 1-byte and 2-byte elements. #4943 #5041 #5042bitset's constructors from strings. #4839remove()andranges::remove. #4987
- Improved the vectorized implementations of:
- Helped the compiler auto-vectorize:
rangesalgorithms now unwrap output iterators, avoiding unnecessary checking. #5015 #5027- Optimized
bitset's streaming operators. #5008 - Optimized the newline-printing overloads
println(FILE*),println(ostream&), and nullaryprintln(). #4672 - Updated
arrayandvector's spaceship comparison operators to take advantage of the vectorized implementation oflexicographical_compare_three_way(). #5078 - Extended the "key extraction" optimization in the unique associative containers (both ordered and unordered) to handle more types. #5050
- Optimized
filesystem::symlink_status()by avoiding unnecessary Windows API calls. #5071
- Added vectorized implementations of:
- Improved throughput:
- Improved C++23 throughput by not including all of
<ostream>(which drags in<format>) unless the Standard requires it. #4936 - Improved C++23 throughput of
<queue>,<stack>,<stacktrace>, and<thread>by not including all of<format>. #5003 - Moved
system_clock,high_resolution_clock, andchrono_literalsfrom a commonly-included internal header to<chrono>. #5105- This has source-breaking impact. If you see compiler errors complaining that it doesn't recognize
chronotypes likesystem_clockor UDLs like1729ms, you need to include<chrono>specifically, instead of assuming that headers like<thread>will drag it in.
- This has source-breaking impact. If you see compiler errors complaining that it doesn't recognize
- Improved C++23 throughput by not including all of
- Enhanced behavior:
- Changed an internal
pairconstructor to beprivate. #4979 - Fixed a CodeQL warning by replacing a squirrelly
memcpy()call in thefilesystemimplementation (that was intentionally performing a read overrun) with two cromulentmemcpy()calls. #4933 - Silenced CodeQL warnings. #4942 #4985 #5072
- Added a visualizer for
system_clock::time_point. #5005 - Changed some
vectormachinery to use scope guards instead ofthrow;, making debugging easier when exceptions are thrown. #4977 - Improved
regex_error::what()'s message forregex_constants::error_badbrace. #5025 - Improved
optional<T>::swap()'sstatic_assertmessages whenTisn't both move constructible and swappable. #5065 - Removed
locale::id's non-Standard constructor fromsize_tand implicit conversion operator tosize_t. #5067- For user-visible headers, at least. They remain dllexported for binary compatibility.
- Improved
mutexassertions to distinguish "unlock of unowned mutex" from "unlock of mutex not owned by the current thread". #5099
- Changed an internal
- Improved test coverage:
VS 2022 17.12
- Merged C++26 features:
- P0952R2 #4740 #4850 A New Specification For
generate_canonical() - P2407R5 #4743 Freestanding Library: Partial Classes
- P2833R2 #4743 Freestanding Library:
inoutexpectedspan - P2968R2 #4777 Make
std::ignoreA First-Class Object - P2997R1 #4816 Removing The Common Reference Requirement From The Indirectly Invocable Concepts
- P0952R2 #4740 #4850 A New Specification For
- Merged C++23 features:
- Merged LWG issue resolutions:
- LWG-3944 #4784 Formatters converting sequences of
charto sequences ofwchar_t - LWG-4061 #4758 Should
std::basic_format_contextbe default-constructible/copyable/movable? - LWG-4074 #4814
compatible-joinable-rangesis underconstrained - LWG-4083 #4786
views::as_rvalueshould reject non-input ranges - LWG-4096 #4785
views::iota(views::iota(0))should be rejected - LWG-4098 #4815
views::adjacent<0>should reject non-forward ranges - LWG-4106 #4757
basic_format_argsshould not be default-constructible
- LWG-3944 #4784 Formatters converting sequences of
- Merged proposed resolutions for LWG issues (not yet accepted for the C++ Working Draft, but we've chosen to implement this speculatively):
- Fixed bugs:
- Fixed static analysis warning C26818 "Switch statement does not cover all cases. Consider adding a 'default' label (es.79)." #4715
- Note: The STL has always attempted to be
/W4 /analyzeclean, but does not yet attempt to be clean with respect to all additional static analysis rulesets.
- Note: The STL has always attempted to be
- Fixed
atomic_ref::is_lock_free()on x64 to returntruefor 1, 2, 4, 8, and 16 bytes only. #4729 - Fixed
uniform_real_distribution<RealType>{min, max}to stay within the inclusive-exclusive range[min, max)and never generate themaxvalue exactly. #4740 - Fixed
filesystem::weakly_canonical()to avoid failing on Windows 11 24H2 in certain scenarios. #4844 - Fixed
condition_variable_any::wait_for()to consistently usesteady_clock. #4755 - Removed a broken and useless visualizer for
ranges::view_interface. #4835 - Fixed the visualizer for
move_iteratorto use the updated name of its internal data member. #4836- This fixed a regression that was introduced by #1080 in VS 2019 16.8.
- Fixed
expectedto conditionally delete its copy constructor and copy assignment operator as depicted in the Standard, which affects overload resolution in unusual scenarios. #4837 - Fixed
time_put/put_time()to avoid crashing for: - Fixed compiler errors in
ranges::inplace_mergeandranges::minmaxin unusual scenarios. #4841 - Fixed truncation warnings when:
- Improved
array::size()and<mdspan>static analysis annotations, fixing warnings in some scenarios. #4856 - Fixed
lexicographical_compare_three_way()to enforce the Standard's mandate that the comparison returns a comparison category type. #4878 - Fixed compiler errors in the parallel scan algorithms
inclusive_scan(),exclusive_scan(),transform_inclusive_scan(), andtransform_exclusive_scan()when the intermediate and output types are different. #4701 - Fixed the vectorized implementation of floating-point
ranges::min,ranges::max, andranges::minmaxto return correct results for negative zeros. #4734 - Fixed Clang compiler errors for certain
constexprvariantscenarios by adding a compiler bug workaround. #4903 - Fixed compiler errors when using
<random>machinery (e.g.generate_canonical(),uniform_real_distribution) via Standard Library Modules or Standard Library Header Units by adding compiler bug workarounds. #4906 - Fixed compiler errors when using
<format>machinery in user-defined modules by adding compiler bug workarounds. #4919 - Fixed
<format>to avoid crashing when formatting floating-point values with large precisions combined with the#(alternate form) orL(locale-specific form) options. #4907
- Fixed static analysis warning C26818 "Switch statement does not cover all cases. Consider adding a 'default' label (es.79)." #4715
- Improved performance:
- Overhauled
condition_variableandcondition_variable_any, improving their performance and simplifying their implementation. #4720- As a result,
condition_variable,timed_mutex, andrecursive_timed_mutexare now trivially destructible.
- As a result,
- Improved the performance of
search(),find_end(), and theirrangesforms by removing calls tomemcmp()that were surprisingly harmful. #4654 #4753 - Improved the ARM64 performance of
popcount()by using new compiler intrinsics. #4695 #4733 - Further improved the vectorized implementations of:
- Slightly improved the performance of
ranges::min,ranges::max, andranges::minmaxfor certain iterator types. #4775 - On x86, the STL is now built with
/arch:SSE2(which is the default) instead of/arch:IA32. #4741- See
/arch(x86) on Microsoft Learn.
- See
- Used Clang builtins to improve the performance of
<cmath>'s floating-point comparison functions for mixed types. #4648 - On x64,
atomic_ref<16 bytes>now always uses the cmpxchg16b instruction. #4751 - Streaming a small
bitsetto abasic_ostreamnow avoids dynamically allocating memory. #4818 - Slightly improved performance for Clang ARM64
<atomic>. #4870 - Updated
char_traits<wchar_t/char16_t>::compare/find/length,find, andranges::findto callwmemcmp/wmemchr/wcslenwhen possible, which will improve performance after a future UCRT header update. #4873 #4894 - Optimized equality comparisons for empty
strings andstring_views. #4904
- Overhauled
- Improved throughput:
- Improved
<queue>and<stack>throughput by dragging in fewer headers. #4707
- Improved
- Enhanced behavior:
- P0608R3 Improving
variant's Converting Constructor/Assignment is now unconditionally active (i.e. in C++17 mode and above), instead of being restricted to C++20 mode and above. #4713- This C++20 behavioral change was originally implemented by #1629 in VS 2019 16.10. While it can have source-breaking impact, it generally has highly desirable effects.
- Changed the machinery for copy...
- P0608R3 Improving
VS 2022 17.11
- Merged C++26 features:
- Merged partial C++23 features:
- Merged LWG issue resolutions:
- LWG-3767 #4542
codecvt<charN_t, char8_t, mbstate_t>incorrectly added to locale - LWG-3919 #4526
enumerate_viewmay invoke UB for sized common non-forward underlying ranges - LWG-3950 #4510
std::basic_string_viewcomparison operators are overspecified - LWG-3984 #4543
ranges::to's recursion branch may be ill-formed - LWG-4012 #4529
common_view::begin/endare missing thesimple-viewcheck - LWG-4013 #4530
lazy_split_view::outer-iterator::value_typeshould not provide default constructor - LWG-4016 #4539
container-insertablechecks do not match whatcontainer-inserterdoes - LWG-4035 #4525
single_viewshould provideempty - LWG-4053 #4685 Unary call to
std::views::repeatdoes not decay the argument - LWG-4054 #4540 Repeating a
repeat_viewshould repeat the view
- LWG-3767 #4542
- Fixed bugs:
- Fixed
condition_variable::wait_until()andcondition_variable_any::wait_until()to consistently use the giventime_point's clock type, instead of also depending on the system clock. This also fixedcondition_variable::wait_for()to consistently usesteady_clock. #4457 - Fixed
<format>to always perform compile-time format string checking forwchar_t, even when the narrow execution character set doesn't support it. #4459 - Fixed compiler errors when
constexpr basic_stringinteracted with the undocumented compiler option/d1initall. #4474 - Fixed
atomic_reffor 16-byte objects to correctly reportis_lock_free()andis_always_lock_freeon x64 (when the optional mode_STD_ATOMIC_ALWAYS_USE_CMPXCHG16Bis defined to be1) and ARM64 (always). #4478 - Removed the vectorized implementation of
ranges::findwithunreachable_sentinelas it was fundamentally incompatible with ASan (Address Sanitizer). #4486- This was introduced by #2434 in VS 2022 17.3.
- Fixed incorrect results from the vectorized implementation of
ranges::find_lastfor certain combinations of value and element types. #4561- This fixed a regression that was introduced by #3925 in VS 2022 17.9.
- Fixed the STL to avoid emitting the off-by-default warning C4365 (signed/unsigned mismatch) when the
/ZIcompiler option (debug info for Edit and Continue) is used. #4487- These warnings were most noticeable when building the Standard Library Modules, but they were also emitted by classic includes.
- Fixed the STL to avoid emitting the off-by-default warning C5246 (brace elision). #4527
- Fixed compiler errors involving incomplete types in:
pairandtuplemachinery. #4488
- Fixed
make_from_tuple()to properly implement LWG-3528 with a constraint instead of astatic_assert. #4528 - Added integral overloads for
<cmath>'s classification functionsfpclassify(),isfinite(),isinf(),isnan(),isnormal(), andsignbit(). #4537 - Fixed
is_trivialto correctly handle unusual types. #4576 - Avoided mentioning
__vectorcallfor ARM64EC, where it is not yet supported. #4600 - Fixed
std.ixxto include<intrin.h>in the Global Module Fragment, fixing compiler errors withimport std;in certain scenarios. #4626 - Fixed compiler errors when a user-defined
formattercallsbasic_format_parse_context::next_arg_id()with an empty format-spec. #4640 - Fixed compiler errors when using
<expected>in/permissivemode. #4658- Note: While
/permissivemode is discouraged, it's currently supported for most STL components.
- Note: While
- Fixed compiler errors when inheriting
expected's constructors in certain scenarios. #4664 - Fixed
pair's self-swap()behavior to follow the Standard by self-swapping its elements. #4674 - Fixed
atomic<void*>andatomic_ref<void*>to providedifference_type. #4689
- Fixed
- Improved performance:
- Helped the compiler auto-vectorize:
- Added vectorized implementations of:
find_first_of()andranges::find_first_of. #4466 #4557 #4563 #4587 #4623mismatch()andranges::mismatch. #4495 #4538 #4584replace()andranges::replacefor 32-bit and 64-bit elements. #4554 #4584lexicographical_compare(),ranges::lexicographical_compare, andlexicographical_compare_three_way(). #4552
- Further improved the vectorized implementations of:
- Used Clang builtins to improve the performance of
<cmath>'s floating-point classification and comparison
functions: #4612- Classification:
isfinite(),isinf(),isnan(),isnormal() - Comparison:
isgreater(),isgreaterequal(),isless(),islessequal(),islessgreater(),isunordered()
- Classification:
- Improved
normal_distribution::operator()(engine, param)by avoiding unnecessarily recomputing coefficients. #4618
- Improved throughput:
- Slightly improved
<mdspan>throughput by using short-circuitingconjunction_vinstead of fold expressions. #4559 - Refactored floating-point machinery, improving throughput by reducing inclusion of various headers. #4615
- Improved
<string_view>throughput by no longer dragging in most of<string>'s contents. #4633
- Slightly improved
- Improved diagnostics:
- Improved compiler error messages when
formatter<UDT>::format()isn'tconst. #4461 - Massively improved the compiler error messages for
get<T>(tuple<Types...>)whenTdoesn't occur exactly once inTypes. #4578 - Significantly improved compiler error messages when
ranges::tois unable to construct the requested result. #4608
- Improved compiler error messages when
- Enhanced behavior:
- To reduce risk, the STL no longer attempts to activate vectorized implementations of algorithms for ancient processors that support SSE2 but not SSE4.2. #4550
- This consolidated the STL's levels of vectorization to none, SSE4.2, and AVX2.
- This also slightly improved performance (for non-ancient processors) by taking advantage of newe...
- 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
VS 2022 17.10
- Merged C++26 features:
- Merged C++23 features:
- Merged partial C++23 features:
- Merged C++20 Defect Reports:
- Merged LWG issue resolutions:
- LWG-3749 #4190
common_iteratorshould handle integer-class difference types - LWG-3809 #4194 Is
subtract_with_carry_engine<uint16_t>supposed to work? - LWG-3897 #4186
inout_ptrwill not update raw pointer to null - LWG-3946 #4187 The definition of
const_iterator_tshould be reworked - LWG-3947 #4195 Unexpected constraints on
adjacent_transform_view::base() - LWG-3949 #4204
atomic<bool>'s trivial destructor dropped in C++17 spec wording - LWG-3953 #4167
iter_moveforcommon_iteratorandcounted_iteratorshould returndecltype(auto) - LWG-3974 #4214
mdspan::operator[]should not copyOtherIndexTypes - LWG-4001 #4193
iota_viewshould provideempty
- LWG-3749 #4190
- Fixed bugs:
- Fixed
mutex's constructor to beconstexpr. #3824 #4000 #4339- Note: Programs that aren't following the documented restrictions on binary compatibility may encounter null dereferences in
mutexmachinery. You must follow this rule:When you mix binaries built by different supported versions of the toolset, the Redistributable version must be at least as new as the latest toolset used by any app component.
- You can define
_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTORas an escape hatch.
- Note: Programs that aren't following the documented restrictions on binary compatibility may encounter null dereferences in
- Fixed
<format>'s compile-time format string checking: - Fixed how
format()handles empty strings likeformat("{:a<10}", ""). #4243 - Fixed
<format>to properly handle floating-point values in a specific situation. When a format-specifier appears without any precision or type, shortest round-trip formatting should be used instead ofchars_format::general. #4327- Example format strings:
"{:}"and"{0:}"were affected, as they have an optional arg-id (0) followed by a format-specifier (:) with an empty format-spec (nothing after the:). - More common format strings like
"{}"and"{0}"were unaffected, as they entirely lack a format-specifier. - Example value: For
12345678.0, the shortest round-trip rules produce"12345678", while thechars_format::generalrules produce"1.2345678e+07".
- Example format strings:
- Fixed
<format>to properly handle locale-specific floating-point formatting with a minimum field width, taking digit separators into account. #4421 - Fixed
format()to accept%Xand%EXforchrono::durationandchrono::hh_mm_ss. #4250 - Fixed
chrono::durationformatting to respect dynamically provided widths. #4283 - Fixed crashes and incorrect results in the vectorized implementation of
ranges::findwithunreachable_sentinel. #4450- This fixed regressions that were introduced by #2434 in VS 2022 17.3.
- Fixed
ranges::toto properly reject certain invalid uses with compiler errors, instead of trapping compilers in infinite loops of doom. #4142 - Fixed
ranges::toto accept certain container constructors taking a range followed by more than one argument. #4218 - Fixed compiler errors involving range adaptor closure objects in unusual scenarios. #4211
- Fixed
ranges::ssizeto be conditionallynoexceptas required by the Standard. #4231 - Fixed
join_viewandjoin_with_view's iterators to be default constructible. #4264 - Fixed truncation warnings when using
views::repeat. #4255 - Fixed compiler errors when using
views::zip_transformwith ranges that must be non-constto be iterated through, such asviews::filter. #4416 - Fixed compiler errors when using
views::pairwise_transformandviews::adjacent_transformvia Standard Library Modules. #4420 - Fixed incorrect output from iostreams (like
"i.nf") when printing infinity and NaN values withsetprecision(0) << showpoint << fixed. #4212 - Fixed problems involving unusual allocators with size types other than
size_t: - Fixed
<atomic>correctness issues for ARM64 CHPE (_M_HYBRID_X86_ARM64). #4222 - Fixed
atomicby addingatomic& operator=(const atomic&) volatile = delete;as required by the Standard. #4287 - Fixed
atomic<shared_ptr>::wait()andatomic<weak_ptr>::wait()to properly detect equivalent smart pointers. #3655 - Fixed sign-compare warnings in
<mdspan>when usingextentswith different index types. #4227 - Fixed compiler errors in
<mdspan>when constructing unusual mappings. #4236 - Fixed bugs specific to extremely unusual fancy pointers:
- Fixed compiler errors when constructing
locale{nullptr}. #4245- Rejoice, for now you can get a guaranteed
runtime_error!
- Rejoice, for now you can get a guaranteed
- Fixed compiler errors when overloading
next(),prev(),shift_left(), andshift_right()with concept-constrained functions that should be preferred during overload resolution. #4249 - Fixed compiler errors when comparing a
sub_matchwith the spaceship operator<=>to abasic_stringwith a custom traits and/or allocator type. #4253 - Fixed sequence container constructors to avoid interfering with CTAD (class template argument deduction) for
(Iter, Iter, BadAlloc); now this will SFINAE away instead of emitting a hard compiler error. #4254 - Fixed compiler errors in parallel
transform_reduce()when performing narrowing conversions. #4260- As usual, asking the STL to perform conversions on your behalf may emit sign/truncation compiler warnings; this is by design.
- Fixed compiler errors during
constexprevaluation ofvector<bool>caused by improper casting in iterator debugging machinery. #4276 - Fixed compiler errors (by adding a compiler bug workaround) when using
constexprinvoke()to call pointers to data members withreference_wrapperarguments. #4277 - Added macroization defenses for the STL's non-Standard extensions (e.g.
type_info'sraw_namemember function). #4285 - Fixed ...
- Fixed
VS 2022 17.9
- Merged C++23 features:
- P0009R18 #3972 #4037
<mdspan> - P1169R4 #4053
static operator()- This updates CTAD (class template argument deduction) for
std::functionandpackaged_taskto work with a C++23 Core Language feature, currently supported for Clang only. When MSVC and IntelliSense implement this Core feature, this will automatically "light up" the STL's CTAD for them too.
- This updates CTAD (class template argument deduction) for
- P0009R18 #3972 #4037
- Merged partial C++23 features:
- Merged LWG issue resolutions:
- Fixed bugs:
- Fixed incorrect results from iostreams floating-point parsing (e.g.
"1e-07"was incorrectly parsed as1e-06). #3982- This fixed a regression that was introduced by #3364 in VS 2022 17.7.
- We backported this fix to VS 2022 17.8.
- Fixed compiler errors when using
expectedtogether withany. #4013 - Fixed incorrect behavior when self-move-assigning
any, and fixed compiler errors inanyinvolving incomplete types. #3965 - Fixed bugs in
basic_string's copy assignment operator, specific to non-equalpropagate_on_container_copy_assignmentallocators, involving ASan annotations or fancy pointers. #4031 - Fixed
get()and comparison operators to handle program-defined specializations ofarray. #4041 - Fixed compiler errors in
to_array()involving incomplete types. #4042 - Fixed linker errors involving
stl_asan.libby disabling ASan annotations in the STL for unsupported platforms (e.g. ARM, ARM64, ARM64EC). #4058 - Fixed
not_fn()to return a perfect forwarding call wrapper in C++20 mode as required by P0356R5. #4057 - Fixed
dequeto preserve its internal invariants when taking advantage of allocators that provideallocate_at_least(). #4017 - Fixed
dequeemplace()andinsert()to not require elements to be swappable; this change also improved performance. #4022 - Fixed
dequeto handle highly unusual fancy pointers. #4049 - Fixed
deque::shrink_to_fit()to avoid requiring the allocator to be default constructible. #4071 - Fixed
allocate_shared()for unbounded arrays to handle fancy pointers. #4074 - Fixed the implementation of P0408R7 Efficient Access To
basic_stringbuf's Buffer to properly destroy fancy pointers. #4047 - Fixed
this_thread::sleep_until()to consistently use the giventime_point's clock type, instead of also depending on the system clock. This also fixedthis_thread::sleep_for()to consistently usesteady_clock. #3914 - Fixed minor conformance issues in
<random>: #4120- Removed non-Standard
base_typetypedefs fromdiscard_block_engine,independent_bits_engine, andshuffle_order_engine. - Fixed
discard_block_engine(Engine&&)to move-construct the base engine instead of copying it.
- Removed non-Standard
- Fixed incorrect results from iostreams floating-point parsing (e.g.
- Improved performance:
- Optimized the
copy(),copy_n(), andmove()algorithms forvector<bool>iterators, with speedups varying from 1.8x (times, not percent) to an incredible 3200x, depending on the size and alignment of the bits being copied. #3353 #4045 - Optimized
priority_queue::push_range()for small ranges. #4025 - Improved debug codegen for
dequeby using unchecked iterators internally. #4071 - Optimized
basic_string's range constructors to usememmove()for contiguous ranges when possible. #4073 - Added a vectorized implementation of
ranges::find_last. #3925
- Optimized the
- Enhanced behavior:
- Added debug checks to
<valarray>binary operations, verifying that the operands have the same size. #3911 - Deprecated
basic_istream'sipfx()/isfx()andbasic_ostream'sopfx()/osfx()member functions as they're non-Standard extensions. #4006 - Added compiler bug workarounds for the upcoming Clang 17 release. #4014
- Improved the STL's error messages so that error logs will record specific
static_asserts like "error STL1000: Unexpected compiler version, expected Clang 16.0.0 or newer." instead of just "Error in C++ Standard Library usage." #4020 - Silenced
/Wallwarnings:- When building the Standard Library Modules. #4026
- Warning C4868 "compiler may not enforce left-to-right evaluation order in braced initializer list" throughout the STL. #4067
- Note:
/Wallis not intended for regular production use, as it contains a large number of extremely noisy and low-value warnings. In general, the STL does not attempt to be/Wallclean.
- Changed
num_get::do_get()to tolerate 80-bitlong doubleby removing astatic_assertthat was added in 2018. #4032- Note: 80-bit
long doubleremains unsupported by MSVC.
- Note: 80-bit
- Improved
source_location::function_name(): #4055- It will return detailed information for Clang 17.
- Added an "escape hatch" for all compilers: define
_USE_DETAILED_FUNCTION_NAME_IN_SOURCE_LOCATIONto0. - For example, given
template <typename T> void cats()called withcats<vector<int>>(), MSVC's detailed info (implemented in VS 2022 17.6) is"void __cdecl cats<class std::vector<int,class std::allocator<int> >>(void)". Clang 17's detailed info is"void __cdecl cats(void) [T = std::vector<int>]". The escape hatch will return the basic info"cats".
- Changed the
rangesalgorithms to be ordinary function objects. #4098- For example, this allows code like
views::transform(ranges::distance)to compile.
- For example, this allows code like
- Marked internal
extern "C"functions asnoexcept. #4106 #4150- This improves codegen for
/EHs(versus/EHsc, whereextern "C"already impliesnoexcept).
- This improves codegen for
- Added debug checks to
- Improved test coverage:
- Added an STL-ASan-CI pipeline. #3987 #3989 #4029 #4052 #4068 #4069 #4075
- The test harness now cleans up emitted files as it runs. #4086
- Simplified the feature-test macro test. #4103
- Enabled test coverage for
basic_string's ASan annotations when exception handling interacts with the Small String Optimization. #4118
- Code cleanups:
VS 2022 17.8
- Merged C++26 features:
- Merged C++23 features:
- Merged C++20 extension:
- The C++23 named modules
stdandstd.compatare now available when compiling in C++20 mode. #3977- This extension should eventually be portable to the major Standard Library implementations via an informal agreement between implementers.
- Build systems - including the Visual Studio IDE - will need changes to support
import stdin C++20. This change makes it possible for them to do so.
- The C++23 named modules
- Merged LWG issue resolutions:
- LWG-3631 #3745
basic_format_arg(T&&)should useremove_cvref_t<T>throughout - LWG-3843 #3737
std::expected<T, E>::value() &assumesEis copy constructible - LWG-3893 #3782 LWG-3661 broke
atomic<shared_ptr<T>> a; a = nullptr; - LWG-3904 #3781
lazy_split_view::outer-iterator'sconst-converting constructor isn't settingtrailing_empty_
- LWG-3631 #3745
- Fixed bugs:
- Fixed the
deque(size_type)constructor to properly destroy elements when constructing one of them throws an exception. #3720 - Removed a non-Standard operator
basic_istream >> setfill(c). #3725 - Fixed linker errors when linking x64 object files into ARM64EC programs. #3732
- We backported this fix to VS 2022 17.6.6 and VS 2022 17.7.
- Fixed the debug mode check in
cartesian_product_view::size()to always accept empty views. #3733 - Fixed
formatter<char, wchar_t>to format thecharas a character instead of an integer. #3723 - The STL now avoids dragging in the non-reserved name
ISA_AVAILABILITY. #3721 - Fixed
chrono::hh_mm_ssformatting to accept values of 24 hours or more. #3727 - Changed the STL's usage of compiler-specific custom attributes to further defend against macros. #3760
- Fixed
condition_variable_any::wait_until()to handletime_points with unsigned representations instead of waiting forever. #3761 - Fixed
counting_semaphoreto add compile-time enforcement of the Standard's mandates. #3747 - Fixed a bug, affecting UWP apps only, where locking a
mutexcould throw a bogus exception. #3763 - Fixed the signatures of
char_traitsmember functions to exactly match the Standard. #3739- This Standardese was updated by N2349 in C++11.
- Fixed compiler errors when
visit_format_arg()is called with highly unusual visitors. #3787 - Fixed incorrect output when
format()is asked to format a floating-point value in the alternate form without a type specifier. #3815 - Added a compiler bug workaround for MSVC modules, allowing
<format>machinery to work with/utf-8viaimport std;. #3816 - Fixed a subtle bug affecting
constexpr basic_string's copy assignment operator, where it wasn't starting element lifetimes for the unused capacity. #3712 #3819 - Fixed Clang compiler errors when calling
function::target<FunctionType>()onconst functionobjects. #3844- This is an obscure corner case, because such calls are guaranteed to return null.
- Fixed compiler errors when using
array<T, 0>inconstexprcontexts. #3863 - Improved function call operator overload resolution for the
bind(),bind_front(), andbind_back()function objects. #3775 - Fixed iostreams with imbued locales to print infinities and NaNs correctly. #3868 #3877
- Fixed incorrect
noexcepts within the implementations offilesystem::current_path(),filesystem::current_path(error_code&),read_symlink(const path&), andread_symlink(const path&, error_code&). #3869 #3881 - Fixed
shared_ptr<void>to not be constructible fromvoid*. #3873 - Fixed a complicated modules scenario by removing
#pragma oncefrom all STL headers. #3895#pragma onceis no longer needed to improve throughput because modern compilers automatically detect the idempotency guard idiom.
- Fixed
<stacktrace>'s internal use ofsnprintf()in extreme situations. #3916 - Fixed an extremely obscure runtime correctness bug in
basic_string's copy assignment operator, specific to non-equalpropagate_on_container_copy_assignmentallocators. #3862 - Fixed ASan annotations in
basic_string::replace(). #3884 - Fixed ASan annotations in
basic_string::assign()andbasic_string::resize_and_overwrite(). #3956
- Fixed the
- Improved performance:
- Changed some helper member functions to be
static, slightly improving debug codegen. #3755 mutexandcondition_variablenow avoid virtual function calls within their implementations. #3770- Optimized
steady_clock::now()whenQueryPerformanceFrequency()is exactly 24 MHz, which is very common for ARM64. #3832 - Optimized
filesystem::path::lexically_normal(). #3850 basic_string,basic_stringbuf,basic_syncbuf,deque, andvectornow take advantage of allocators that provideallocate_at_least(). #3864 #3891- Optimized
<format>slightly. #3826 - Optimized
bitset::to_string(). #3838 #3904 - Added an attribute to
as_const(),to_integer(), andto_underlying()that allows the MSVC compiler to intrinsically implement them without emitting function calls. #3664 - Made a tiny tweak to
valarray(access the stored size directly instead of via callingsize()) to improve debug codegen. #3968
- Changed some helper member functions to be
- Improved throughput:
- Moved machinery: #3719
- Moved
integer_sequence,make_integer_sequence,index_sequence,make_index_sequence, andindex_sequence_forfrom<type_traits>to<utility>, which is where the Standard provides them. - Moved
allocator_arg,allocator_arg_t,uses_allocator, anduses_allocator_vso that they're dragged in by slightly fewer headers. (The Standard provides them in<memory>.)
- Moved
- Some headers now avoid including
<limits>. #3777 - In C++17 mode and later, improved Clang throughput for an internal helper wrapping
is_same_v. #3933
- Moved machinery: #3719
- Enhanced behavior:
- Added precondition checking in debug mode to the
iota_view(value)constructor. #3731 - Improved precondition checking in debug mode for
barrier. #3757 - Fixed static analysis warnings. #3734 #3743
- Note: The STL has always attempted to be
/W4 /analyzeclean, but does not yet attempt to be clean with respect to all additional static analysis rulesets.
- Note: The STL has always attempted to be
- Strengthened the exception specifications for:
- Internal
<ranges>machinery used injoin_viewiterators andlazy_split_view. #3762 basic_string_view::compare(const charT*). [#3738](https://github.com/microso...
- Internal
- Added precondition checking in debug mode to the
VS 2022 17.7
- Merged C++23 features:
- P1467R9 #3583 Extended Floating-Point Types
- Note: This means that we provide the
<stdfloat>header containing an emptynamespace std {}, as we don't support any optional extended floating-point types.
- Note: This means that we provide the
- P2093R14 #3337
<print>: Formatted Output- P2539R4 Synchronizing
print()With The Underlying Stream
- P2539R4 Synchronizing
- P2164R9 #3472
views::enumerate - P2165R4 #3372 Compatibility Between
tuple,pair, And tuple-like Objects - P2321R2
zip, completed by implementing: - P2374R4 #3561
views::cartesian_product- P2540R1 Empty Product For Certain Views
- P2572R1 #3629
std::formatFill Character Allowances - P2609R3 #3486 Relaxing Ranges Just A Smidge
- P2614R2 #3482 Deprecating
float_denorm_style,numeric_limits::has_denorm,numeric_limits::has_denorm_loss - P2652R2 #3542 Disallowing User Specialization Of
allocator_traits - P2655R3 #3513
common_reference_tOfreference_wrapperShould Be A Reference Type - P2736R2 #3556 Referencing The Unicode Standard
<format>now understands Unicode 15.
- P2770R0 #3466 Stashing Stashing Iterators For Proper Flattening
- P1467R9 #3583 Extended Floating-Point Types
- Merged partial C++23 features:
- Merged LWG issue resolutions:
- LWG-2195 #3506 Missing constructors for
match_results - LWG-2309 #3469
mutex::lock()should not throwdevice_or_resource_busy - LWG-2381 #3364 Inconsistency in parsing floating point numbers
- LWG-3204 #3494
sub_match::swaponly swaps the base class - LWG-3655 #3495 The
INVOKEoperation anduniontypes - LWG-3677 #3396 Is a cv-qualified
pairspecially handled in uses-allocator construction? - LWG-3720 #3511 Restrict the valid types of arg-id for width and precision in std-format-spec
- LWG-3733 #3496
ranges::tomisusescpp17-input-iterator - LWG-3734 #3503 Inconsistency in
inout_ptrandout_ptrfor empty case - LWG-3821 #3509
uses_allocator_construction_argsshould have overload forpair-like - LWG-3833 #3477 Remove specialization
template<size_t N> struct formatter<const charT[N], charT> - LWG-3836 #3587
std::expected<bool, E1>conversion constructorexpected(const expected<U, G>&)should take precedence overexpected(U&&)withoperator bool - LWG-3847 #3479
ranges::tocan still return views - LWG-3851 #3517
chunk_view::inner-iteratormissing customiter_moveanditer_swap - LWG-3860 #3480
range_common_reference_tis missing - LWG-3862 #3471
basic_const_iterator'scommon_typespecialization is underconstrained - LWG-3865 #3476 Sorting a range of
pairs- This can be a source-breaking change in unusual scenarios.
- LWG-3869 #3487 Deprecate
std::errcconstants related to UNIX STREAMS - LWG-3870 #3475 Remove
voidify - LWG-3872 #3470
basic_const_iteratorshould have customiter_move - LWG-3875 #3485
std::ranges::repeat_view<T, IntegerClass>::iteratormay be ill-formed - LWG-3877 #3504 Incorrect constraints on
const-qualified monadic overloads forstd::expected - LWG-3887 #3589 Version macro for
allocate_at_least
- LWG-2195 #3506 Missing constructors for
- Fixed bugs:
- Fixed the
ios_baseconstants (e.g.ios_base::binary,ios_base::failbit,ios_base::hex) to have the correct bitmask types. #3405 - Fixed compiler errors found with Clang 16. #3483
- Fixed
<ranges>to avoid using list-initialization when the difference between braces and parentheses is observable. #3493 - Fixed
pmr::unsynchronized_pool_resourceto respectpmr::pool_options::max_blocks_per_chunkwhen it's smaller than the default initial number of blocks per chunk. #3510 - Fixed technically undefined behavior in
<regex>and<sstream>found by Clang/LLVM's Undefined Behavior Sanitizer (UBSan). #3452 - Fixed compiler errors when calling
ranges::equalwith ranges involvingviews::iota. #3551 - Fixed the STL's iterator unwrapping machinery to avoid requiring a
_Prevent_inheriting_unwraptypedef. #3566 - Fixed spurious warnings from Clang's
-Wzero-as-null-pointer-constantwhen comparing the spaceship operator's return types (partial_ordering,weak_ordering,strong_ordering) with literal0. #3581 - Fixed
bind()function objects to have constrained function call operators, so they interact properly withis_invocableand related scenarios. #3577 - Reverted #2654 (which affected
<future>'s use of<ppltasks.h>in Desktop XAML apps) because it introduced anole32.dlldependency that broke multiple scenarios. #3607- We backported this revert to VS 2022 17.6.
- Fixed
views::cartesian_productto avoid compiler errors in pathological scenarios. #3609 - Fixed incorrect results for ranges larger than 4 GB passed to the vectorized implementations of
min_element(),max_element(), andminmax_element(). #3619 - Added a compiler bug workaround for MSVC in
shared_ptr'soperator<=>. #3647- This avoids compiler errors when comparing
shared_ptr<const int>toshared_ptr<void>.
- This avoids compiler errors when comparing
- Added a space to
chrono::ambiguous_local_time's message to exactly match the Standard. #3650 - Fixed compiler errors when formatting unusual
chrono::durationtypes. #3649 - Fixed
optional::transform()to avoid terminating when the callable object throws an exception. #3668 - Fixed
<charconv>floating-pointfrom_chars()to correctly handle two scenarios involving exponents with large absolute values. #3670 - Fixed iostreams floating-point parsing to produce correct results for many different scenarios. [#3364](...
- Fixed the
VS 2022 17.6
- Merged C++23 features:
- P1223R5 #3268
ranges::find_last,ranges::find_last_if,ranges::find_last_if_not - P2167R3 #3258 Improving
boolean-testableUsage - P2278R4 #3187 #3234
cbeginShould Always Return A Constant Iterator - P2404R3 #3345 Move-Only Types For Comparison Concepts
- P2467R1 #3065
ios_base::noreplace: Exclusive Mode Forfstreams - P2474R2 #3142
views::repeat - P2505R5 #3361 Monadic Functions For
expected - P2588R3 #3455
barrier's Phase Completion Guarantees - P2602R2 #3215 Poison Pills Are Too Toxic
- P2711R1 #3451 Making Multi-Param Constructors Of Views
explicit
- P1223R5 #3268
- Merged partial C++23 features:
- Merged LWG issue resolutions:
- LWG-3515 #3236 [stacktrace.basic.nonmem]:
operator<<should be less templatized - LWG-3545 #3242
std::pointer_traitsshould be SFINAE-friendly - LWG-3594 #3276
inout_ptr- inconsistentrelease()in destructor - LWG-3629 #3272
make_error_codeandmake_error_conditionare customization points - LWG-3646 #3261
std::ranges::view_interface::sizereturns a signed type - LWG-3717 #3266
common_view::endshould improverandom_access_rangecase - LWG-3736 #3318
move_iteratormissingdisable_sized_sentinel_forspecialization - LWG-3737 #3320
take_view::sentinelshould provideoperator- - LWG-3743 #3269
ranges::to'sreservemay be ill-formed - LWG-3746 #3265
optional's spaceship withUwith a type derived fromoptionalcauses infinite constraint meta-recursion - LWG-3769 #3459
basic_const_iterator::operator==causes infinite constraint recursion - LWG-3772 #3462
repeat_view's piecewise constructor is missing preconditions - LWG-3778 #3332
vector<bool>missing exception specifications - LWG-3785 #3319
ranges::tois over-constrained on the destination type being a range - LWG-3798 #3359 Rvalue reference and
iterator_category - LWG-3810 #3421 CTAD for
std::basic_format_args - LWG-3823 #3231 Unnecessary precondition for
is_aggregate - LWG-3848 #3410
slide_viewmissingbaseaccessor - LWG-3850 #3423
views::as_constonempty_view<T>should returnempty_view<const T> - LWG-3853 #3468
basic_const_iterator<volatile int*>::operator->is ill-formed
- LWG-3515 #3236 [stacktrace.basic.nonmem]:
- Merged proposed resolutions for LWG issues (not yet accepted for the C++ Working Draft, but we've chosen to implement this speculatively):
- Fixed bugs:
- Fixed linker errors when using
time_put<wchar_t>from the Standard Library Modules. #3232 - Fixed another unintentionally dllexported symbol in the import library. #3233
- This would emit a spurious message "Creating library
meow.liband objectmeow.exp" (while buildingmeow.exe) when using<stacktrace>or importing the Standard Library Modules.
- This would emit a spurious message "Creating library
- Fixed a binary compatibility break in
basic_string, which could lead to missing null terminators causing crashes and other runtime misbehavior, when linking code that was built with different versions of the STL. #3235- This ABI break was introduced by #1735 activating the Small String Optimization for
constexprbasic_stringin VS 2022 17.4. - The affected scenarios involved mixing VS 2022 17.3 (or earlier) with VS 2022 17.4 (or later, until this fix).
- We backported this fix to VS 2022 17.4.5 and VS 2022 17.5.
- This ABI break was introduced by #1735 activating the Small String Optimization for
- Fixed a binary compatibility break in
ppltasks.cpppoweringstd::async(), which could lead to crashes caused by aninvalid_operationexception slamming intonoexcept. #3255- This ABI break was introduced by #2654, and appeared in VS 2022 17.4 when the VCRedist was "unlocked".
- The affected scenarios involved building with VS 2015 (or possibly early versions of VS 2017), using "Single-Threaded Apartments", and running on an end user's machine with the VS 2022 17.4 VCRedist installed.
- We backported this fix to VS 2022 17.4.5 and VS 2022 17.5.
- Fixed incorrect results from
find(),count(),ranges::find(), andranges::count(). #3247- This fixed a regression that was introduced by #2434 in VS 2022 17.3.
- The affected scenarios involved mixing certain signed and unsigned types; for example, finding/counting occurrences of the
int-1in a range ofunsigned intelements should consider the element0xFFFF'FFFFuto be equal (due to C++'s usual arithmetic conversions), but it was incorrectly considered to be non-equal. - We backported this fix to VS 2022 17.4.5 and VS 2022 17.5.
- Fixed the visualizer for
optional<T>to work whenThas a custom visualizer. #3243 - Fixed compiler warnings when passing
long doubletocopysign(). #3253 - Re-enabled ASan (Address Sanitizer) annotations in
<string>after fixing significant bugs. #3164- Also fixed ASan annotations in
<vector>that were failing whenpmr::vectorwas used withpmr::monotonic_buffer_resourceon x86.
- Also fixed ASan annotations in
- Fixed compiler errors when passing
rangestypes tostd::copy(). #3270 - Fixed
shared_future<void>'s move assignment operator to benoexceptas required by the Standard. #3284 - Fixed Clang compiler errors involving intrinsics by including
<intrin.h>, which is a header that Clang recognizes and supports. #3285 - Fixed
numeric_limitsto correctly report thatis_signedistruefor the STL's internal 128-bit signed-integer-class type. #3291 - Fixed
<stacktrace>to correctly passSYMOPT_FAIL_CRITICAL_ERRORSto the Windows API. #3292 - Fixed
<charconv>(and headers that include it, like<chrono>and<format>) to avoid emitting warning C4365 "signed/unsigned mismatch" when being compiled with/J. #3295- Note: We strongly discourage any use of the
/Jcompiler option, as it's a recipe for One Definition Rule violations and it doesn't improve Standard conformance.
- Note: We strongly discourage any use of the
- Fixed
ranges::cbegin,ranges::cend,ranges::crbegin,ranges::crend, andranges::cdatato behave like their non-constcounterparts when given array rvalues. [#3316](https://github.com/microsoft...
- Fixed linker errors when using
VS 2022 17.5
- Merged C++23 features:
- P2322R6 #3099
ranges::fold_left,ranges::fold_right, etc. - P2465R3 #3108 Standard Library Modules
stdAndstd.compat- Initially supported for MSVC only; see tracking issue #1694 for lists of known compiler bugs and upcoming fixes.
- Build system support is a work in progress; currently, build systems must be manually taught to compile
std.ixxso you can referencestd.ifcand linkstd.obj. (Similarly for buildingstd.compat.ixxintostd.compat.ifcandstd.compat.obj.) - IntelliSense support is a work in progress; STL test coverage is not yet enabled.
- Will be supported for Clang after compiler support for modules is available; see Clang's C++20 implementation status.
- P2508R1 #3074
basic_format_string,format_string,wformat_string
- P2322R6 #3099
- Merged partial C++23 features:
- P2278R4
cbeginShould Always Return A Constant Iterator:- The "Iterators" section, including
basic_const_iterator,make_const_iterator(), andmake_const_sentinel(). #3043
- The "Iterators" section, including
- P2321R2
zip:views::zip. #3035- Note:
views::zip_transform,views::adjacent, andviews::adjacent_transformare the parts that remain to be implemented.
- P2278R4
- Merged LWG issue resolutions:
- Fixed bugs:
- Fixed compiler warnings when using Standard Library Header Units. #3069
- Removed a non-Standard member function
locale::c_str(). #3088 - Fixed narrowing warnings when calling
piecewise_constant_distribution<float>::densities()andpiecewise_linear_distribution<float>::densities(). #3107 - Fixed compiler errors when calling
ranges::is_permutationwith predicates that return highly unusual boolean-testable types. #3113 - Fixed compiler errors when building the Standard Library Modules with static RTTI disabled. #3115
- Now, building
std.ixxwith/GR- /D_HAS_STATIC_RTTI=0will succeed, andstd::anywill simply be unavailable (as it inherently requires static RTTI). - Additionally, including
<any>with static RTTI disabled will emit a warning message but not an error, and the feature-test macro__cpp_lib_anywill indicate (by its absence) that the feature is unavailable.
- Now, building
- Fixed compiler errors in
reference_wrapper,thread, andvariantinvolving incomplete types. #3101 #3148 - When
chrono::time_zone::get_info()throws an exception, fixed it to reportGetLastError()as intended, instead of"The operation completed successfully."#3122 - Fixed incorrect results returned by
ellint_2(). #3077 - Fixed
error_category's default constructor to beconstexpr. #3139 #3176 - Fixed all headers to avoid emitting the off-by-default "warning C5262: implicit fall-through occurs here; are you missing a
breakstatement? Use[[fallthrough]]when abreakstatement is intentionally omitted betweencases". #3162 - Fixed compiler errors in certain
<ranges>scenarios by properly constrainingmovable-box's copy constructors. #3171
- Improved performance:
- Added support for unwrapping to
move_sentinel. #3098 - Improved the performance of
uniform_int_distributionby implementing Daniel Lemire's algorithm Fast Random Integer Generation in an Interval. #3012 - Optimized
gcd()to avoid a redundant shift. #3127 - Optimized
locale::classic()for a 10x speedup (times, not percent). #3048 - Added an attribute to
move(),forward(),move_if_noexcept(), andforward_like()that will allow the MSVC compiler to intrinsically implement them without emitting function calls. #3182
- Added support for unwrapping to
- Improved throughput:
- Enhanced behavior:
- Clarified
get_future()'s[[nodiscard("message")]]. #3068 - The internal headers
<xatomic.h>,<xbit_ops.h>, and<xerrc.h>are now core headers. #3116 - Improved
<format>'s compiler error messages for unformattable types. #3080
- Clarified
- Improved test coverage:
- Added test coverage for
<variant>visit()invoking pointers to members. #3070 - Expanded test coverage for
forward_like(). #3072 - Updated test coverage for
views::as_rvalue. #3089 - Expanded test coverage for
bind_front()andbind_back(). #3117 - Updated our LLVM submodule reference, including new tests, and updates to the
any/optional/variantshared test code. #2976 - Fixed bogus test code discovered by Clang 15. #3135
- Fixed the off-by-default "exhaustive" mode of the parallel
is_partitioned()test. #3174
- Added test coverage for
- Code cleanups:
- Various cleanups (described in detail in the PRs, not repeated here). #3082 #3083 #3084 #3085 #3086 #3090 #3091 #3092 #3093 #3177 #3178
- Improved Python scripts. #3123
- Removed compiler bug workarounds. #3155
- Moved
<atomic>implementation details, preparing for later changes. #3124 - Removed unnecessary partial specializations of
common_typefor the STL's internal 128-bit integer-class types. #3153
- Infrastructure improvements:
- Updated
_MSVC_STL_UPDATE. #3073 #3147