vs-2022-17.10
版本发布时间: 2024-05-22 06:29:10
microsoft/STL最新发布版本:vs-2022-17.11(2024-08-15 19:47:14)
- 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_iterator
should handle integer-class difference types -
LWG-3809 #4194 Is
subtract_with_carry_engine<uint16_t>
supposed to work? -
LWG-3897 #4186
inout_ptr
will not update raw pointer to null -
LWG-3946 #4187 The definition of
const_iterator_t
should 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_move
forcommon_iterator
andcounted_iterator
should returndecltype(auto)
-
LWG-3974 #4214
mdspan::operator[]
should not copyOtherIndexTypes
-
LWG-4001 #4193
iota_view
should 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
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.
-
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::general
rules 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%X
and%EX
forchrono::duration
andchrono::hh_mm_ss
. #4250 - Fixed
chrono::duration
formatting to respect dynamically provided widths. #4283 - Fixed crashes and incorrect results in the vectorized implementation of
ranges::find
withunreachable_sentinel
. #4450- This fixed regressions that were introduced by #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 - Fixed
ranges::to
to 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::ssize
to be conditionallynoexcept
as required by the Standard. #4231 - Fixed
join_view
andjoin_with_view
's iterators to be default constructible. #4264 - Fixed truncation warnings when using
views::repeat
. #4255 - Fixed compiler errors when using
views::zip_transform
with ranges that must be non-const
to be iterated through, such asviews::filter
. #4416 - Fixed compiler errors when using
views::pairwise_transform
andviews::adjacent_transform
via 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
atomic
by 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 usingextents
with 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_match
with the spaceship operator<=>
to abasic_string
with 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
constexpr
evaluation ofvector<bool>
caused by improper casting in iterator debugging machinery. #4276 - Fixed compiler errors (by adding a compiler bug workaround) when using
constexpr
invoke()
to call pointers to data members withreference_wrapper
arguments. #4277 - Added macroization defenses for the STL's non-Standard extensions (e.g.
type_info
'sraw_name
member function). #4285 - Fixed floating-point
to_chars()
on ARM64 to return correct results. #4304 - Fixed compiler errors when defining variadic alias templates for
is_nothrow_convertible
. #4318 - Fixed
filesystem::is_empty()
andfilesystem::directory_iterator
to handle empty volumes (before they've been assigned a drive letter). #4311 - Fixed compiler errors in algorithms involving highly unusual types. #4233 #4419
- Fixed
basic_stringbuf
to avoid implementing moving with swapping, which is a correctness issue for unusual custom allocators. #4239 - Fixed
deque::shrink_to_fit()
to follow the Standard instead of unconditionally moving elements. #4091 - Fixed
allocate_shared_for_overwrite()
to directly destroy objects, instead of usingAlloc::destroy()
. #4274 - Removed
ios_base::hexfloat
, a non-Standard bitmask element. #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 thestd::hexfloat
manipulator.
- The Standard ways to request hexadecimal floating-point output are to use the
- Fixed
std.ixx
to export VCRuntime machinery with Standard-conforming techniques. #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.
- This affects things like
- Fixed
basic_ostream::operator<<(basic_streambuf*)
to rethrow caught exceptions only whenfailbit
is set inexceptions()
. #4372 - Fixed
unordered_map
andunordered_set
's equality operators to test elements for equality (via theiroperator==
), not just equivalence (via the container's predicate for keys). #4406-
unordered_multimap
andunordered_multiset
already behaved correctly.
-
- Silenced "warning C4324: structure was padded due to alignment specifier" in all STL headers. #4426
- This was spuriously emitted by certain combinations of code, e.g.
views::cartesian_product
withviews::filter
.
- This was spuriously emitted by certain combinations of code, e.g.
- Fixed
time_get::date_order()
to correctly returntime_base::mdy
for the "C" locale, instead of picking up the date order for the current user locale. #4437 - Fixed
seed_seq::generate(RanIt, RanIt)
tostatic_assert
that the iterator's value type is at least a 32-bit unsigned integer type. #4447 - Fixed compiler errors involving incomplete types in:
- Non-modifying algorithms. #4138
-
erase()
,erase_if()
,remove()
,remove_if()
. #4217 - [alg.min.max], [alg.clamp], [alg.lex.comparison], [alg.three.way] algorithms. #4216
-
atomic
andatomic_ref
. #4221 - Modifying algorithms. #4256
- Container operations taking iterator pairs. #4258
-
is_nothrow_convertible
. #4318 - Comparison operators. #4334
- Merge algorithms, set operations, heap operations, and permutation generators. #4347
- Sorting and related algorithms. #4367
-
vector
's destructor and other member functions. #4373 - Uninitialized memory algorithms. #4374
-
default_searcher
. #4379 -
<ranges>
views. #4389 - Numeric algorithms. #4391
-
ranges::advance
,ranges::distance
,span
constructors, andcondition_variable::wait_for
. #4402 -
shared_ptr
creation functions andatomic
smart pointers. #4403 -
function
,move_only_function
,packaged_task
,promise
, andoptional
. #4430
- Fixed
- Improved performance:
- Improved
<atomic>
performance: #4222- For ARM64, significantly improved the performance of
atomic<T>::load()
(taking no arguments, requesting sequential consistency), matching how #3399 in VS 2022 17.6 improvedatomic<T>::load(memory_order_seq_cst)
. - For ARM64 CHPE (
_M_HYBRID_X86_ARM64
),atomic<T>
'sexchange
/compare_exchange_MEOW
/fetch_MEOW
now respectmemory_order
arguments instead of always providing sequential consistency. Also, ARM64 CHPE now benefits from all of #3399's major improvements.
- For ARM64, significantly improved the performance of
- Improved
atomic::wait
family performance by internally usingmemory_order_acq_rel
instead ofmemory_order_seq_cst
when initializing OS support functions. #4288 - Slightly improved the codegen for
uniform_int_distribution
. #4234 - Optimized
filesystem::path
'soperator/
to perform a single memory allocation for common cases. #4136 - Slightly improved performance by taking advantage of P1169R4
static operator()
in the STL's stateless function objects and lambdas. #4358- This is conditional on compiler feature availability (currently implemented by Clang), but not on Standard mode. Like C++17
if constexpr
and C++20explicit(bool)
, compilers will support C++23static operator()
in earlier Standard modes (emitting warnings that Future Technology is being used, which the STL internally suppresses).
- This is conditional on compiler feature availability (currently implemented by Clang), but not on Standard mode. Like C++17
- Added a vectorized implementation of
bitset::to_string()
. #3960 #4382 #4422 - Improved the vectorized implementations of
min_element()
,max_element()
,minmax_element()
, and related algorithms: - Improved the vectorized implementations of
ranges::min
,ranges::max
,ranges::minmax
, and themin()
,max()
, andminmax()
overloads forinitializer_list
. #4384- These algorithms only need to track values, not locations.
- Changed the destructors of
mutex
andrecursive_mutex
to be trivial. #4390- This especially benefits variables with static storage duration, as they no longer need "dynamic
atexit
destructors".
- This especially benefits variables with static storage duration, as they no longer need "dynamic
- Slightly improved performance by replacing
CRITICAL_SECTION
withSRWLOCK
in:
- Improved
- Enhanced behavior:
- Wrapped the STL in
extern "C++"
as a temporary workaround to allow#include <meow>
to coexist withimport std;
in the same translation unit, in that order. #4154- The other order,
import std;
before#include <meow>
, will still cause compiler errors. We're working on a long-term solution.
- The other order,
- The C++17 Standard added
invoke()
and the C++20 Standard made itconstexpr
. Previously, MSVC made non-constexpr
invoke()
unconditionally available, andconstexpr
invoke()
available in C++17 mode, as minor extensions. Now,constexpr
invoke()
is unconditionally available. #4080 - Improved
shared_ptr
constructor constraints to avoid forming invalid types. #4290 - Updated
<charconv>
to use the__umulh
intrinsic for ARM64 CHPE (_M_HYBRID_X86_ARM64
). #4330 - Improved
expected
's copy/move assignment operators to be trivial when possible, like howoptional
andvariant
already behave. #4271 - Improved
<random>
's TR1 legacy code: #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 thestd
namespace. - Removed non-Standard machinery from Standard engines and distributions. (For example, certain
static constexpr
data members inmersenne_twister_engine
and an extra function call operator overload inuniform_int_distribution
.)
- Deprecated the non-Standard engines (
- Changed
basic_regex
's constructor to throw an exception instead of stack overflowing when the pattern contains an excessive number of capture groups. #4451- Currently, this arbitrarily limits the number of capture groups to 1000.
- Wrapped the STL in
- Improved test coverage:
- Updated the STL-ASan-CI pipeline. #4240 #4295
- Added support for building the STL's separately compiled code with ASan instrumentation and enabled this in the STL-ASan-CI pipeline. #4313
- Updated our LLVM submodule, including new tests. #4263 #4267 #4270 #4272 #4328 #4336 #4348 #4355
- Minor test improvements, including printing exit codes in both decimal and hex. #4309
- Improved output for "unresolved" test failures. #4323
- Fixed sporadic "unresolved" test failures. #4366
- Updated CTest to avoid running 2N tests in parallel, where N is the number of cores available. #4335
- Enabled
__cpp_lib_concepts
for our command-line test coverage of the EDG compiler front-end. #4296 #4297 #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
- Added benchmarks for vectorized
ranges::find
andranges::count
. #4387- This also covers classic
find()
andcount()
, which share the same vectorized implementation.
- This also covers classic
- Fixed the test harness to handle paths case-insensitively. #4395
- Updated tests to work with Clang 18. #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
- Code cleanups:
- Various cleanups (described in detail in the PRs, not repeated here). #4143 #4145 #4146 #4147 #4149 #4151 #4192 #4229 #4230 #4362 #4439 #4442 #4443 #4444 #4445
- Removed unnecessary
typename
keywords in C++20 mode and later. #4191 - Removed compiler bug workarounds. #4197 #4259 #4340 #4392
- Removed an enormous amount of code that was dealing with
__cpp_lib_concepts
missing in C++20 mode. #4298 #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
- Added top-level
const
to function parameters in the vectorized implementations of algorithms. #4410 - Added a script to download Unicode data files when updating
<format>
. #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 - Used
if constexpr
to simplify helper functions for allocating and deallocating memory. #4432
- Infrastructure improvements:
- Updated
_MSVC_STL_UPDATE
. #4213 #4226 #4293 #4361