-
Notifications
You must be signed in to change notification settings - Fork 1.5k
VS 2022 Changelog
Stephan T. Lavavej edited this page May 21, 2024
·
3 revisions
For newer releases, see the current Changelog.
- VS 2022 17.7 - see the VS 2022 Release History
- VS 2022 17.6
- VS 2022 17.5
- VS 2022 17.4
- VS 2022 17.3
- VS 2022 17.2
- VS 2022 17.1
- VS 2022 17.0
C++20 and C++23 features generally require the /std:c++20
and /std:c++latest
compiler options, respectively.
- 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::format
Fill 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_t
Ofreference_wrapper
Should 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::swap
only swaps the base class -
LWG-3655 #3495 The
INVOKE
operation andunion
types -
LWG-3677 #3396 Is a cv-qualified
pair
specially 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::to
misusescpp17-input-iterator
-
LWG-3734 #3503 Inconsistency in
inout_ptr
andout_ptr
for empty case -
LWG-3821 #3509
uses_allocator_construction_args
should 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::to
can still return views -
LWG-3851 #3517
chunk_view::
inner-iterator
missing customiter_move
anditer_swap
-
LWG-3860 #3480
range_common_reference_t
is missing -
LWG-3862 #3471
basic_const_iterator
'scommon_type
specialization is underconstrained -
LWG-3865 #3476 Sorting a range of
pair
s- This can be a source-breaking change in unusual scenarios.
-
LWG-3869 #3487 Deprecate
std::errc
constants related to UNIX STREAMS -
LWG-3870 #3475 Remove
voidify
-
LWG-3872 #3470
basic_const_iterator
should have customiter_move
-
LWG-3875 #3485
std::ranges::repeat_view<T, IntegerClass>::
iterator
may 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_base
constants (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_resource
to respectpmr::pool_options::max_blocks_per_chunk
when 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::equal
with ranges involvingviews::iota
. #3551 - Fixed the STL's iterator unwrapping machinery to avoid requiring a
_Prevent_inheriting_unwrap
typedef. #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 literal0
. #3581 - Fixed
bind()
function objects to have constrained function call operators, so they interact properly withis_invocable
and related scenarios. #3577 - Reverted #2654 (which affected
<future>
's use of<ppltasks.h>
in Desktop XAML apps) because it introduced anole32.dll
dependency that broke multiple scenarios. #3607- We backported this revert to VS 2022 17.6.
- Fixed
views::cartesian_product
to 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::duration
types. #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 compiler errors when importing the Standard Library Modules and calling
typeid(T).name()
. #3677 - Fixed some nasty corner cases in
cartesian_product_view
. #3678 - Fixed some issues with parsing numbers with grouping separators. #3684
- Fixed a bug that could result in
unordered_meow
containers allocating too few buckets. #3687
- Fixed the
- Improved performance:
- Slightly optimized
mutex
andrecursive_mutex
construction by avoiding a Windows API call. #3522 - Slightly optimized
unique_ptr
move assignment by avoiding an unnecessary branch. #3540 - Optimized
chrono::time_zone::to_sys
andchrono::time_zone::to_local
, with a speedup of approximately 3x (times, not percent). #3579 - Optimized
type_index::operator<=>
to avoid calling the comparison function twice. #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 - Optimized the constructors
system_error(error_code)
andsystem_error(int, const error_category&)
. #3635
- Slightly optimized
- Improved throughput:
-
<optional>
and<variant>
now include fewer headers. #3624 - Moved internal machinery into
<regex>
where it's needed. #3625 - C++20
<chrono>
now avoids including<algorithm>
. #3626 -
<compare>
now avoids including<bit>
. #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 #3654
- Common source-breaking impact:
- Need to include
<cstdlib>
forexit
,quick_exit
, etc. - Need to include
<initializer_list>
forinitializer_list
.- Sometimes
initializer_list
is used implicitly when only braces appear in the source code.
- Sometimes
- Need to include
<functional>
forunary_function
andbinary_function
.- Note that
unary_function
andbinary_function
were deprecated in C++11 and removed in C++17, so it's best to stop using them completely.
- Note that
- Need to include
- Uncommon source-breaking impact:
- Need to include
<memory>
foraddressof
. - Need to include
<functional>
forless
,less_equal
,greater
,greater_equal
,equal_to
,not_equal_to
,plus
,minus
, andmultiplies
.
- Need to include
- Common source-breaking impact:
- 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
-
- Enhanced behavior:
- Silenced CodeQL warnings. #3489 #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 - Enabled
<source_location>
for Clang. #3584 - Removed the non-Standard
xtime
type from<chrono>
. #3594 - Added
static_assert
s to containers, container adaptors, andallocator
to improve the error messages when they're given non-object types. #2436 #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
- Added more tests for
views::empty
,views::iota
,views::istream
,views::repeat
, andviews::single
. #3553 - Fixed nonconformant code in the test for Standard Library Header Units and Modules. #3588
- Added test coverage for C++23's customization point objects. #3610
- Added more tests for
ranges::ref_view
,ranges::subrange
,views::common
,views::filter
,views::join
,views::reverse
, andviews::transform
. #3612
- Code cleanups:
- Removed many compiler (and CMake) bug workarounds. #3490 #3499 #3651 #3711
- Various cleanups (described in detail in the PRs, not repeated here). #2116 #3406 #3523 #3524 #3525 #3526 #3527 #3528 #3529 #3530 #3531 #3532 #3533 #3539 #3543 #3547 #3598 #3633 #3639 #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
- Simplified code by calling
fill_n()
instead offill()
when possible. #3578
- Improved documentation:
- Added documentation about the STL's import library. #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 redundantint main() {} // COMPILE-ONLY
, and (2) we no longer need to redundantly updatelibcxx/skipped_tests.txt
(which has been removed) identically tolibcxx/expected_results.txt
. #3484 - Enforced the usage of only core headers when building the STL's import library. #3621
- Updated dependencies. #3490 #3651 #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
- The internal test runner now understands compile-only tests and
- Updated
_MSVC_STL_UPDATE
. #3518 #3643 #3680
- Merged C++23 features:
-
P1223R5 #3268
ranges::find_last
,ranges::find_last_if
,ranges::find_last_if_not
-
P2167R3 #3258 Improving
boolean-testable
Usage -
P2278R4 #3187 #3234
cbegin
Should Always Return A Constant Iterator - P2404R3 #3345 Move-Only Types For Comparison Concepts
-
P2467R1 #3065
ios_base::noreplace
: Exclusive Mode Forfstream
s -
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_traits
should be SFINAE-friendly -
LWG-3594 #3276
inout_ptr
- inconsistentrelease()
in destructor -
LWG-3629 #3272
make_error_code
andmake_error_condition
are customization points -
LWG-3646 #3261
std::ranges::view_interface::size
returns a signed type -
LWG-3717 #3266
common_view::end
should improverandom_access_range
case -
LWG-3736 #3318
move_iterator
missingdisable_sized_sentinel_for
specialization -
LWG-3737 #3320
take_view::
sentinel
should provideoperator-
-
LWG-3743 #3269
ranges::to
'sreserve
may be ill-formed -
LWG-3746 #3265
optional
's spaceship withU
with a type derived fromoptional
causes 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::to
is 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_view
missingbase
accessor -
LWG-3850 #3423
views::as_const
onempty_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.lib
and 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
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.
- This ABI break was introduced by #1735 activating the Small String Optimization for
- Fixed a binary compatibility break in
ppltasks.cpp
poweringstd::async()
, which could lead to crashes caused by aninvalid_operation
exception 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
-1
in a range ofunsigned int
elements should consider the element0xFFFF'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 whenT
has a custom visualizer. #3243 - Fixed compiler warnings when passing
long double
tocopysign()
. #3253 - Re-enabled ASan (Address Sanitizer) annotations in
<string>
after fixing significant bugs. #3164- Also fixed ASan annotations in
<vector>
that were failing whenpmr::vector
was used withpmr::monotonic_buffer_resource
on x86.
- Also fixed ASan annotations in
- Fixed compiler errors when passing
ranges
types tostd::copy()
. #3270 - Fixed
shared_future<void>
's move assignment operator to benoexcept
as 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_limits
to correctly report thatis_signed
istrue
for the STL's internal 128-bit signed-integer-class type. #3291 - Fixed
<stacktrace>
to correctly passSYMOPT_FAIL_CRITICAL_ERRORS
to 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
/J
compiler 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::cdata
to behave like their non-const
counterparts when given array rvalues. #3316 - Added compiler bug workarounds:
- Fixed
constexpr
basic_string
to correctly start the lifetimes of its elements, avoiding compiler errors. #3334 - Fixed
views::istream
constraints to precisely follow the Standard. #3335 - Implemented C++17's parallel specialized
<memory>
algorithms. #3145 - Fixed
vector<bool, Alloc>
on 32-bit platforms with 64-bitdifference_type
s to support storing more than 232 bits. #3342 - Fixed a compiler error when calling
ranges::prev
on aniota_view
iterator in debug mode. #3356 - Fixed
ranges::minmax
to avoid moving from an element twice when called with a single-element range ofmove_iterator
s. #3366 - Fixed a minor conformance issue in the
std.ixx
Standard Library Module. #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.
- When
- Changed the STL's usage of a compiler-specific custom attribute to defend against macros. #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 - Changed
vformat_to()
to instantiate its machinery in a lazier way. #3403- When merely including
<format>
or<chrono>
, this avoids instantiating dynamic initializers for facet IDs, and improves throughput slightly.
- When merely including
- Fixed linker errors when using
- Improved performance:
- Avoided constructing unnecessary
string
s inlocale::operator==()
. #3250 - Activated
count()
's vectorized implementation for more eligible iterators in C++14/17 modes. #3262 - Activated the vectorized implementations of
find()
,count()
,ranges::find()
, andranges::count()
for more scenarios involving pointer elements. #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 -
ranges::find
now callsmemchr()
in more situations (when the vectorized implementation isn't available). #3386
- Avoided constructing unnecessary
- Improved throughput:
- 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 #3201- See tracking issue #3193 for a list of compiler bugs that affect these newly enabled
/clr
scenarios.
- See tracking issue #3193 for a list of compiler bugs that affect these newly enabled
- Added visualizers for
error_category
anderror_code
. #3204 - Improved the output of
source_location::function_name()
. #3206- For example, it now returns
"int __cdecl square(int)"
instead of"square"
.
- For example, it now returns
- When iterator debugging detects bogus usage of an invalidated
vector
iterator, it now displays an assertion message instead of abruptly crashing. #3282 - Changed
<mutex>
to use scope guards instead ofthrow;
, making debugging easier when exceptions are thrown. #3321 - Strengthened the exception specifications for:
- Added
modules/modules.json
to support build systems. #3358 #3488 - Refactored
ranges::minmax
andranges::minmax_element
to detect the single-element case naturally. #3384 - Changed the STL's user-defined literals to be consistently defined as
operator""meow
without a space, because CWG-2521 is deprecating the formoperator"" woof
with a space. #3453
- The STL now supports
- Improved documentation:
- Clarified the error message when including the internal header
<__msvc_cxx_stdatomic.hpp>
in C mode. #3192
- Clarified the error message when including the internal header
- Improved test coverage:
- Enabled
<stdatomic.h>
test coverage for Clang. #3186 - Updated the modules tests after a compiler bugfix for
source_location
. #3339 - Added more tests for
views::elements
. #3350 - Updated our LLVM submodule reference, including new tests. #3344 #3357
- Added more tests for
views::drop
,views::drop_while
,views::take
, andviews::take_while
. #3390
- Enabled
- Code cleanups:
- Removed compiler bug workarounds. #3202 #3288 #3351 #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 #3461
- Improved consistency in preprocessor comments. #3208
- Simplified a line in
experimental::filesystem::recursive_directory_iterator::operator++()
. #3279 - Various cleanups (described in detail in the PRs, not repeated here). #3293 #3300
- Removed unused internal machinery. #3299
- Simplified types by defaulting some of their special member functions:
- Changed more temporary objects to be constructed with braces instead of parentheses. #3277
- Updated comments after a compiler bug was fixed. #3394
- Updated tests and separately compiled sources to directly use the
[[nodiscard]]
attribute. #3397 - Updated notes for skipped tests in the
libcxx
test suite. #3464
- Infrastructure improvements:
- Added GitHub Actions to automatically add PR cards to the Code Reviews project. #3393
- Fixed the build system to properly pass options when assembling the "alias objects". #3402
- Updated dependencies. #3202 #3288 #3340 #3351 #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
- Updated
_MSVC_STL_UPDATE
. #3191 #3264 #3362 #3395
- Merged C++23 features:
-
P2322R6 #3099
ranges::fold_left
,ranges::fold_right
, etc. -
P2465R3 #3108 Standard Library Modules
std
Andstd.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.ixx
so you can referencestd.ifc
and linkstd.obj
. (Similarly for buildingstd.compat.ixx
intostd.compat.ifc
andstd.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
cbegin
Should 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_transform
are 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_permutation
with 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.ixx
with/GR- /D_HAS_STATIC_RTTI=0
will succeed, andstd::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.
- Now, building
- Fixed compiler errors in
reference_wrapper
,thread
, andvariant
involving 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
break
statement? Use[[fallthrough]]
when abreak
statement is intentionally omitted betweencase
s". #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_distribution
by 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
/variant
shared 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_type
for the STL's internal 128-bit integer-class types. #3153
- Infrastructure improvements:
- Updated
_MSVC_STL_UPDATE
. #3073 #3147
- Merged C++23 features:
-
P0849R8 #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 #2502
<stacktrace>
-
P2301R1 Add A
pmr
Alias Forstd::stacktrace
-
P2301R1 Add A
- P1206R7 #2806 #3026 #3028 Conversions From Ranges To Containers
-
P1328R1 #2793
constexpr
type_info::operator==()
-
P1899R3 #2981
views::stride
-
P2291R3 #3049
constexpr
Integral<charconv>
-
P2302R4 #2911
ranges::contains
,ranges::contains_subrange
- P2387R3 #2661 Pipe Support For User-Defined Range Adaptors
- P2408R5 #2960 #3056 Ranges Iterators As Inputs To Non-Ranges Algorithms
-
P2417R2 #2972 More
constexpr
bitset
-
P2419R2 #2977 Clarify Handling Of Encodings In Localized Formatting Of
chrono
Types -
P2438R2 #3057
string::substr() &&
-
P2440R1 #2580
ranges::iota
,ranges::shift_left
,ranges::shift_right
-
P2441R2 #2619
views::join_with
-
P2445R1 #2974
forward_like()
-
P2446R2 #3008
views::as_rvalue
- P2494R2 #2965 Relaxing Range Adaptors To Allow Move-Only Types
-
P2499R0 #2947
string_view
Range Constructor Should Beexplicit
-
P2517R1 #2959 Conditional
noexcept
Forapply()
-
P2520R0 #2958 #2994
move_iterator<T*>
Should Be A Random-Access Iterator
-
P0849R8 #2808
- Merged LWG issue resolutions:
-
LWG-3564 #2961
transform_view::
iterator
<true>::value_type
anditerator_category
should useconst F&
-
LWG-3617 #2966
function
/packaged_task
deduction guides and deducingthis
- LWG-3656 #2880 Inconsistent bit operations returning a count
-
LWG-3671 #2905
atomic_fetch_xor
missing fromstdatomic.h
-
LWG-3672 #2907
common_iterator::operator->()
should return by value -
LWG-3683 #2879
operator==
forpolymorphic_allocator
cannot deduce template argument in common cases -
LWG-3701 #2957 Make
formatter<remove_cvref_t<const charT[N]>, charT>
requirement explicit -
LWG-3707 #2883
chunk_view::
outer-iterator
::value_type::size
should return unsigned type -
LWG-3710 #2878 The
end
ofchunk_view
for input ranges can beconst
-
LWG-3712 #2943
chunk_view
andslide_view
should not bedefault_initializable
-
LWG-3715 #2946
view_interface::empty
is overconstrained - LWG-3719 #2902 Directory iterators should be usable with default sentinel
- LWG-3721 #2906 Allow an arg-id with a value of zero for width in std-format-spec
-
LWG-3724 #2903
decay-copy
should be constrained
-
LWG-3564 #2961
- 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
<any>
with our unofficially supported mode to disable exceptions. #2193 - Fixed compiler errors when using
<format>
with the new compiler option/presetPadding
by adding a compiler bug workaround. #2746 - Fixed division by
complex
zero to behave consistently with other implementations. #2758 - Fixed a memory leak in
<syncstream>
. #2763 - Fixed compiler errors when formatting
long
orunsigned long
values withformatter
. #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
- 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 - Fixed a bug in
deque
, specific to rarely-used fancy pointers, where some fancy pointers weren't being destroyed. #2775 -
<chrono>
formatting now accepts%x
("The locale's date representation") foryear_month_day
,year_month_day_last
,year_month_weekday
, andyear_month_weekday_last
. #2762 -
std::filesystem::directory_entry
's constructors,assign()
, andreplace_filename()
now callrefresh()
as required by the Standard and will propagate any errors (via exceptions orerror_code
s), except that "file not found" is not considered an error. #1343 - Added a compiler bug workaround to
construct_at()
, allowing immovable objects to be emplaced via copy elision. #2624 - Fixed leap second validation when parsing
time_point
s. #2705 -
lerp()
now avoids overflowing to infinity when it can calculate the correct result with a fallback approach. #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 - Fixed the visualizers for the non-Standard
stdext::hash_map
container family. #2784 - Fixed the visualizers for
make_shared()
andallocate_shared()
. #2811 -
put_time()
(and thetime_put::do_put()
machinery powering it) now avoids modifyingerrno
when it succeeds. #2049 - Added a compiler bug workaround to fix compiler errors with
source_location::current()
in certain scenarios. #2824 - Fixed compiler errors when using
<format>
to printduration
s with extremely small periods (e.g. femtoseconds, attoseconds). #2814 - Fixed "
istreambuf_iterator
is not dereferenceable" assertions when attempting to usetime_get::get()
orget_time()
to parse certain formats when there's insufficient input. #2851- For example, with the format
"%X"
, the input"3:04:05"
succeeds. The input"3:04"
previously asserted/crashed; now it setsios_base::failbit | ios_base::eofbit
as required by the Standard.
- For example, with the format
- Removed
std::filesystem::directory_entry::clear_cache()
, which was a non-Standard extension. #2854 - Fixed incorrect results from
<complex>
log()
/log10()
/pow()
on ARM64. #2870 - Fixed
path::lexically_relative()
to handle UNC drive paths like\\?\C:\meow.txt
. #2867 - Fixed
filesystem::read_symlink()
andfilesystem::copy()
to handle junctions. #2877 - Fixed compiler errors in
ranges::uninitialized_copy_n
andranges::uninitialized_move_n
with certain input iterators. #2964 - Fixed
ranges::enable_view
to properly reject references and to avoid compiler errors in certain unusual situations. #2978 - Temporarily disabled ASan (Address Sanitizer) annotations in
<string>
while significant bugs are under investigation. #2990 - Fixed compiler errors in
views::chunk_by
with unusual predicates returning non-bool
types. #2890 - Fixed compiler errors in
visit<R>()
involving conversions to immovable types. #2971 #2999 - Fixed compiler errors in
chrono::abs()
in certain unusual situations. #2988 - Fixed
<format>
to always print NaNs as"nan"
,"-nan"
, or uppercase versions as required by the Standard, never"-nan(ind)"
. #3001 - Fixed
ranges::shuffle
andranges::sample
to acceptuniform_random_bit_generator
s that don't provideresult_type
. #3002 - Fixed
vector<bool>::insert(where, first, last)
andvector<bool>::insert_range(where, range)
to meet the Standard's complexity requirements. #3021 - Fixed how
chunk_view
andstride_view
iterators validate their preconditions. #3023 - Fixed a compiler warning emitted by the unusual scenario of
basic_string_view<char_like_struct>
. #3032 - Fixed
move_only_function
to behave correctly when passed between DLLs. #3038 - Fixed compiler errors when
dllexport
ing classes derived frompair
ortuple
. #3045 - Fixed
<regex>
integer overflows when parsing huge numbers in backreferences, braced repetitions, and decimal escapes. #2169- These will now properly throw
regex_error
s with codes oferror_backref
,error_badbrace
, anderror_escape
, respectively.
- These will now properly throw
- Fixed
ranges::distance
to follow the Standard, which depicts two overloads (for sized and unsized sentinels). #2987 - Overhauled how the STL unwraps iterators and sentinels, fixing various issues. #3024
-
basic_string::substr()
now uses a default-constructed allocator as required by the Standard. #3057 - Fixed CUDA compiler errors with
std::_Bit_cast
by using__builtin_bit_cast
instead of amemcpy
workaround. #3066
- Fixed linker errors when using
- Improved performance:
- Improved
clamp()
codegen with conditional move instructions. #2336 - Massively improved iostreams performance for
signed char
,unsigned char
,char8_t
, andbyte
elements, matching the performance ofchar
by avoiding a slow codepath. #2739 -
vector
's range constructor,insert()
, andassign()
now efficiently handle iterators that satisfy theforward_iterator
concept, even when their classiciterator_category
isn't convertible toforward_iterator_tag
. #1794 - Reduced the size of the lookup tables used for
<format>
grapheme clusterization, saving 2670 bytes. #2757 -
std::filesystem::path::lexically_relative()
now avoids unnecessary memory allocations. #1915 - Added vectorized implementations of
min_element()
,max_element()
,minmax_element()
,ranges::min_element()
,ranges::max_element()
, andranges::minmax_element()
, with speedups ranging from 1.5x to 26.6x (times, not percent). #2447 #2821 #2825 - Reduced binary size for programs using
atomic::wait
. #2781 - Avoided an unnecessary OS call in
thread::join()
. #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- 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
- Reduced the number of OS calls in
filesystem::resize_file()
andexperimental::filesystem::resize_file()
. #2771 - Improved the optimized codegen for
T + complex<T>
,T * complex<T>
,complex<T> * T
, andcomplex<T> / T
. Improved the debug codegen forcomplex<T> + T
andcomplex<T> - T
. #2855 - Improved the optimized codegen for
unreachable()
. #3055
- Improved
- Improved throughput:
- Used
if constexpr
instead of tag dispatch in:-
get<I>()
andget<T>()
forpair
. #2756
-
-
optional
,pair
, andtuple
now use conditionalexplicit
instead of SFINAE in all Standard modes, for all supported compilers. #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 -
<charconv>
's large lookup tables are now separately compiled, so translation units including<charconv>
will emit significantly smaller object files. #2125 - The STL now uses helper function templates for testing bitmask types, replacing a significant number of function overloads. #2865
-
<unordered_map>
and<unordered_set>
now avoid including most of<string>
. #2996- This also improves throughput for
<functional>
, which internally uses<unordered_map>
to implementboyer_moore_searcher
. - Escape hatch: define
_SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS
. #3027
- This also improves throughput for
-
<functional>
now avoids including<memory>
. #2998- Escape hatch: define
_LEGACY_CODE_ASSUMES_FUNCTIONAL_INCLUDES_MEMORY
. #3027
- Escape hatch: define
- Used
- Enhanced behavior:
-
<tuple>
is now a core header. #2730 - The STL now supports enabling C++20
char8_t
in C++14 and C++17 modes via/Zc:char8_t
. #2748 -
complex<NonFloating>
now emits a deprecation warning explaining that it has unspecified behavior according to the Standard. #2759 - When
wchar_t
is a real type, the STL now avoids emitting many specializations forunsigned short
that are intended for fakewchar_t
only (i.e. the non-Standard/Zc:wchar_t-
option). #2164 - The STL now marks all of its namespace-scope
constexpr
variables asinline
in C++17-and-later mode. #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".
- 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
-
constexpr
basic_string
now uses the Small String Optimization. #1735 -
error_code
s with0
values andfuture_category
oriostream_category
now return"success"
frommessage()
, matching the behavior ofgeneric_category
. #2742 -
<system_error>
now maps: #2744 #2899-
WAIT_TIMEOUT
,ERROR_TIMEOUT
, andERROR_SEM_TIMEOUT
toerrc::timed_out
-
ERROR_BAD_NET_NAME
toerrc::no_such_file_or_directory
-
ERROR_FILENAME_EXCED_RANGE
toerrc::filename_too_long
-
- Added visualizers for
unique_ptr
s andvector
s storing character sequences. #2843 - Added more visualizers for
<any>
,<format>
,<functional>
,<mutex>
, and<ranges>
. #2191 -
<cstdlib>
now makes itsusing
-declarations forstd::getenv()
andstd::system()
available to UWP apps. #2850 -
<filesystem>
and<experimental/filesystem>
now useGetTempPath2W()
when it's available on Windows 11. #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
- Added a couple of warning numbers for easier lookup: #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
."
- STL4038 warns "The contents of
-
<unordered_map>
and<unordered_set>
no longer provide a non-Standardhash_compare
class template innamespace std
. #2996 - Improved how STL error messages (like "Unexpected compiler version") are displayed. #2897
- Further improved how STL warnings and errors are displayed. #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- 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++20std::erase_if()
instead.
- For example, discarding the return value of
-
vector::assign(num, val)
andstd::swap_ranges()
now have debug checks for forbidden aliasing. #1263 - Strengthened exception specifications on:
- Added support for defining
_ENFORCE_ONLY_CORE_HEADERS
, limiting STL usage to the subset of core headers. #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
-
- Improved test coverage:
- Enabled tests now that Clang 14 supports
<coroutine>
. #2861 - Slightly accelerated test runs by running memory leak tests with only debug configurations (where memory leak tracking is available). #2853
- Fixed a test that failed at runtime on ARM64. #2864
- Added
/permissive
configurations to tests that can successfully compile in this discouraged-but-supported mode. #3015 - Taught VSCode's Python extension where to find our test support machinery. #3040
- Updated the
<source_location>
test for an upcoming compiler fix. #3046 - Added test coverage for a
<string>
bug (specific to ASan annotations being enabled) that was fixed. #3039
- Enabled tests now that Clang 14 supports
- Code cleanups:
- Removed compiler bug workarounds. #2791 #2861
- Various cleanups (described in detail in the PRs, not repeated here). #2798 #2801 #2802 #2815 #2766 #2828 #2863 #2950 #3019
- Removed visualizers for VS 2013's binary-incompatible representations of various data structures. #2804
- Simplified
tuple_cat()
's implementation. #2833 - Improved how
<system_error>
maps Windows error codes toerrc
values. #2837 - Refactored
<atomic>
to share code with C11 atomics (work in progress). #2846 - Updated most files (with limited exceptions) to consistently include the
<cmeow>
wrapper headers instead of the<meow.h>
CRT headers. #2852 - Simplified
<random>
'sstatic constexpr
data members. #3006 - Finished changing all aliases from
typedef
tousing
. #3018 - Cleaned up several tests to avoid unnecessary dependencies on macros and non-Standard code. #3034
- Updated
<functional>
and<memory>
to consistently use modernint = 0
SFINAE. #2124 - Cleaned up feature-test macro usage to be simpler and more consistent. #3053
- Improved documentation:
- Added a comment explaining why
basic_string
doesn't use templatedstatic constexpr
data members as internal helpers. #2980
- Added a comment explaining why
- Infrastructure improvements:
- Eliminated duplicate builds of the "alias objects". #2743
- Fixed distributed test runs to split up the test suite deterministically, avoiding missed or repeated tests. #2795
- Properly applied
/analyze
to PR/CI builds, and fixed warnings in the STL's separately compiled sources. #2812 - Fixed cross-PR/CI contamination by cleaning both before and after checkout. #2832
- Fixed cross-PR/CI contamination by ignoring submodules during code format validation. #3033
- Added support for writing benchmarks with google/benchmark. #2780
- The PR/CI system now uses "1ES Hosted Pools". #3054
- Updated dependencies. #2754 #2791 #2831 #2861 #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 #2840 #3020
- Merged C++23 features:
- Merged partial C++23 features:
- Merged LWG issue resolutions:
-
LWG-3121 #2640
tuple
constructor constraints forUTypes&&...
overloads -
LWG-3525 #2639
uses_allocator_construction_args
fails to handle types convertible topair
-
LWG-3570 #2418
basic_osyncstream::emit
should be an unformatted output function -
LWG-3571 #2418
flush_emit
should setbadbit
if theemit
call fails
-
LWG-3121 #2640
- 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
vector<bool>
to properly invalidate iterators during reallocation, which fixes compiler errors withconstexpr
usage ofvector<bool>
. #2441 -
empty_view
rvalues are now consideredborrowed_range
s as required by the Standard. #2576 - Added compiler bug workarounds to
is_convertible
andcommon_reference
, socontiguous_iterator<const volatile int*>
is nowtrue
. #2592 - Added missing constraints to functions that were implied by "Effects: Equivalent to" Standardese:
make_any()
,make_optional()
,shared_ptr::operator=()
,shared_ptr::reset()
, andweak_ptr::operator=()
. - Fixed
filesystem::path
's comparison operators and some other member functions being IF-NDR (ill-formed, no diagnostic required) in C++23 mode. #2457 - Fixed C++20
<chrono>
parsing to fail when the input is insufficient to supply the entire format string. #2523- For example, the input
"23:59"
is insufficient for the format string"%H:%M:%S"
.
- For example, the input
- Fixed an out-of-bounds read in
ranges::find()
withunreachable_sentinel
. #2434 - Added compiler bug workarounds for CUDA (involving
[[nodiscard]] friend
) to fix spurious cases of "warning C5240: 'nodiscard': attribute is ignored in this syntactic position". #2622 - Removed
ExecutionPolicy
overloads ofcopy_backward()
andmove_backward()
that were mistakenly implemented. They don't appear in the Standard because they would be useless. #2627 - Added compiler bug workarounds for Clang (involving the ordering of constrained and unconstrained destructors) to fix compiler errors in
<ranges>
machinery. #2630 - Fixed a bug affecting
<future>
's use of<ppltasks.h>
in Desktop XAML apps. #2654 - Fixed a bug that prevented C++20
<chrono>
from parsing fractional seconds as floating-pointduration
s. #2638 - Fixed
<bit>
'scountl_zero()
returning incorrect results on ARM64 for 8-bit and 16-bit types. #2647 - Added macroization guards to the STL's usage of compiler-specific custom attributes. #2649
- Fixed
get_time()
andtime_get
's 2-digit year logic. #2666 - Fixed
system_category().message()
to behave correctly instead of returning"???"
when the user language and system language are different. #2669 - Fixed the ARM64EC implementations of
atomic_thread_fence()
andatomic<8-byte type>::store()
. #2702 - Fixed compiler errors in
atomic<shared_ptr<T[]>>
,atomic<shared_ptr<T[N]>>
,atomic<weak_ptr<T[]>>
, andatomic<weak_ptr<T[N]>>
. #1339 - Added overloads of
<cmath>
'slerp()
for arithmetic types. #2113 - Fixed
filesystem::directory_entry
to work with FAT32 and exFAT. #2373 -
<filesystem>
now handles special system files likehiberfil.sys
. #2715 -
filesystem::copy_file()
now tolerates other processes having opened the source file or the target file for reading or writing (as much as possible, depending on the choice ofcopy_options
). #2718 - Fixed the visualizers for
shared_ptr<void>
,weak_ptr<void>
, andunique_ptr<void, Deleter>
. #2706 - Fixed compiler errors in
move_only_function
when compiling<functional>
in/std:c++latest
mode with/Zc:alignedNew-
. #2712 - Implemented C++20's removal of the explicit specialization for
allocator<void>
. #2726- Note that
allocator<void>
is still supported, it just uses the primary template now.
- Note that
- Fixed "unresolved external symbol" linker errors in certain scenarios involving separately compiled third-party libraries. #2734 #2738
- On x64, these errors mentioned
__imp___std_init_once_begin_initialize
and__imp___std_init_once_complete
. - On x86, these errors mentioned
__imp____std_init_once_begin_initialize@16
and__imp____std_init_once_complete@12
. - This fixed a regression that was introduced by #2381 in VS 2022 17.2.
- This fix was backported to VS 2022 17.2.5.
- On x64, these errors mentioned
- Fixed
- Improved performance:
- Optimized
rotl()
androtr()
in<bit>
for 8-bit and 16-bit integers by using compiler intrinsics. #2611 - Optimized the vectorized implementation of
reverse()
for 32-bit trivial types. #2383 - Improved
<format>
performance when the execution character set isn't self-synchronizing, by caching expensive calls to get codepage info. #2600 - Added vectorized implementations of
find()
,count()
,ranges::find()
, andranges::count()
, with speedups ranging from 2.0x to 27.6x (times, not percent). #2434 - Slightly improved the performance of
<charconv>
floating-pointfrom_chars()
. #2623
- Optimized
- Improved throughput:
- Used
if constexpr
instead of tag dispatch, overloads, or specializations in:-
is_permutation()
,sample()
,rethrow_if_nested()
, anddefault_searcher
. #2219 -
<map>
and<set>
's common machinery. #2287 -
polymorphic_allocator
. #2471 -
basic_string_view
andbasic_string
'sfind_first_of()
,find_last_of()
,find_first_not_of()
, andfind_last_not_of()
. #2479 #2660 -
<regex>
. #2484 - Parallel
inclusive_scan()
andtransform_inclusive_scan()
. #2662 -
scoped_allocator_adaptor
'soperator==()
. #2677 -
function
,move_only_function
, andbind()
. #2668 -
vector<bool>::insert()
. #2694
-
- Replaced tag dispatch with SFINAE in
subtract_with_carry_engine
's internal machinery. #2693 - Split
<chrono>
into a smaller internal header, improving throughput when other headers need only pre-C++20<chrono>
machinery. #2604
- Used
- Enhanced behavior:
- Changed
<deque>
to use scope guards instead ofthrow;
, making debugging easier when exceptions are thrown. #2308 - Merged an MSVC-specific attribute, allowing the compiler to improve its handling of
constexpr
dynamic allocation andconstexpr unique_ptr
. #2658 - Implemented
<format>
grapheme clusterization when determining the width of a string for padding and alignment purposes. This is a "quality of implementation" feature recommended by N4910[format.string.std]/11
. #2119 - Changed
<strstream>
to deprecate its classes instead of the entire header. #2680 - C++98's
unexpected()
in<exception>
was removed by C++17. As with almost all removals, we support an escape hatch to restoreunexpected()
, by defining_HAS_UNEXPECTED
to1
. However, this escape hatch conflicts with C++23, which is reusing the identifier forunexpected<E>
in<expected>
. Therefore, the escape hatch is now blocked with an#error
in C++23 mode. #2709 - Added ASan (Address Sanitizer) annotations to
<string>
, allowing additional errors to be detected. #2196 -
<ciso646>
now emits a warning in C++20 mode, as it was removed in that Standard. #2710 - Temporarily disabled
join_view
for non-forward_range
s until LWG-3698 is resolved. #2727 -
<random>
distributions now have non-const
function call operators, making it easier to write portable code. #2732
- Changed
- Improved documentation:
- Improved test coverage:
- Dramatically improved the compiler memory consumption and compile time of two
ranges
algorithm tests. #2657 - Removed
/Za
test coverage. #2714-
/Za
is "not recommended" and has been superseded by/permissive-
.
-
- Dramatically improved the compiler memory consumption and compile time of two
- Code cleanups:
- Removed compiler bug workarounds. #2611
- Various cleanups (described in detail in the PRs, not repeated here). #2595 #2621 #2656 #2673 #2674 #2675 #2676 #2678 #2679 #2686
- Simplified the preprocessor logic in
<stdatomic.h>
for non-compiler tools. #2615 - Removed test workarounds now that VCRuntime properly recognizes Clang's
/std:c++20
and/std:c++latest
modes. #2637
- Infrastructure improvements:
- Fixed the build system to avoid relinking any DLLs when rerunning CMake and Ninja with no other changes. #2606
- Added
format
andvalidate
targets to CMake, so it can run clang-format in parallel, and improved how Azure Pipelines runs the Code Format Validation check. #2671 #2697 - Updated dependencies. #2611 #2651 #2714
- Updated build compiler to VS 2022 17.3 Preview 1 (17.2 is now required).
- Updated to Windows 11 SDK 22000. This is now required for building and testing the STL, but not for using it. #2729
- Updated Python to 3.10.4.
- Updated
_MSVC_STL_UPDATE
. #2634 #2696
- Merged C++20 Defect Reports:
- Merged C++23 features:
- Merged LWG issue resolutions:
-
LWG-2762 #2376
unique_ptr
operator*()
should benoexcept
-
LWG-2774 #2098
std::function
construction vs assignment -
LWG-3146 #2409 Excessive unwrapping in
std::ref
/cref
-
LWG-3392 #2421
ranges::distance()
cannot be used on a move-only iterator with a sized sentinel -
LWG-3470 #2414
convertible-to-non-slicing
seems to reject valid case -
LWG-3471 #2567
polymorphic_allocator::allocate
does not satisfy Cpp17Allocator requirements -
LWG-3480 #2340
directory_iterator
andrecursive_directory_iterator
are not C++20 ranges -
LWG-3519 #2208 Incomplete synopses for
<random>
classes -
LWG-3543 #2424 Definition of when
counted_iterator
s refer to the same sequence isn't quite right -
LWG-3557 #2406 The
static_cast
expression inconvertible_to
has the wrong operand -
LWG-3563 #2426
keys_view
example is broken -
LWG-3574 #2410
common_iterator
should be completelyconstexpr
-able -
LWG-3580 #2417
iota_view
'siterator
's binaryoperator+
should be improved -
LWG-3589 #2425 The
const
lvalue reference overload ofget
forsubrange
does not constrainI
to becopyable
whenN == 0
-
LWG-3590 #2404
split_view::base() const &
is overconstrained -
LWG-3591 #2411
lazy_split_view<input_view>::
inner-iterator
::base() &&
invalidates outer iterators -
LWG-3592 #2411
lazy_split_view
needs to check the simpleness ofPattern
-
LWG-3593 #2448 Several iterators'
base() const &
andlazy_split_view::
outer-iterator
::value_type::end()
missingnoexcept
-
LWG-3595 #2410 Exposition-only classes
proxy
andpostfix-proxy
forcommon_iterator
should be fullyconstexpr
-
LWG-3598 #2560
system_category().default_error_condition(0)
is underspecified -
LWG-3610 #2542
iota_view::size
sometimes rejects integer-class types -
LWG-3612 #2586 Inconsistent pointer alignment in
std::format
-
LWG-3618 #2566 Unnecessary
iter_move
fortransform_view::iterator
-
LWG-3621 #2543 Remove feature-test macro
__cpp_lib_monadic_optional
-
LWG-3648 #2587
format
should not printbool
with'c'
-
LWG-3654 #2528
basic_format_context::arg(size_t)
should benoexcept
-
LWG-3657 #2564
std::hash<std::filesystem::path>
is not enabled -
LWG-3660 #2549
iterator_traits<common_iterator>::pointer
should conform to[iterator.traits]
-
LWG-3661 #2544
constinit atomic<shared_ptr<T>> a(nullptr);
should work
-
LWG-2762 #2376
- 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 Clang compiler errors when using
ranges::join_view
. #2352 - Fixed several runtime correctness bugs in
std::string
. #2305 - Fixed a memory leak affecting a specific scenario in P0408R7 Efficient Access To
basic_stringbuf
's Buffer. #2361 - Each call to
ranges::clamp
now correctly performs at most three projections. #1898 - The STL no longer rejects Clang in CUDA mode, nor the
cl /showIncludes /D__CUDACC__ ...
command used by CUDA's msbuild integration to gather dependencies. #2075 - Fixed
allocator::is_always_equal
to be deprecated, not removed, in C++20 mode. (It was deprecated by LWG-3170.) #2423 - Fixed
begin()
/end()
crashing for emptyvalarray
s, which also affected range-based for-loops. #2435 - Fixed regression in
ranges::distance
(from LWG-3392 which brokeranges::distance(some_array, s)
) by speculatively implementing LWG-3664. #2522 - Fixed
basic_string::resize_and_overwrite()
to no longer emit "warning C4018: signed/unsigned mismatch" when given certain user-defined function objects. #2525 - Increased
__cpp_lib_concepts
to its final value for C++20,202002L
. #2559- It should have been updated in VS 2019 16.6 when P1964R2 "Replacing
boolean
Withboolean-testable
" was implemented by #565. The presence of that release (or any later release) can be detected by inspecting our implementation-specific macro_MSVC_STL_UPDATE
. Coincidentally, the value of_MSVC_STL_UPDATE
for VS 2019 16.6 was also202002L
.
- It should have been updated in VS 2019 16.6 when P1964R2 "Replacing
- Fixed numerous tiny bugs discovered by the
libcxx
test suite. #2499 - Fixed a bug in
<format>
that sporadically caused incorrect output when formatting floating-point values inhex
orscientific
notation with extremely large precisions. #2569 - Fixed a bug in
<charconv>
from_chars()
float
tiebreaking that produced incorrect results. This affected decimal strings that were at the exact midpoint of consecutivefloat
values, within a narrow range (the smallest and largest affected values were"32768.009765625"
and"131071.98828125"
), where the tiebreaker rule wanted to round to "even" and "even" happened to be "down", but the implementation incorrectly rounded "up". (double
was unaffected.) #2366 -
promise<T>
now compiles when!is_default_constructible_v<T>
. #2568 - Moving from an
optional<const T>
now behaves like moving from aconst T
: it selectsT
's copy constructor. #2460 - Fixed a bug in
<format>
that incorrectly acceptedvolatile
arguments; the Standard currently says that they should be rejected. #2579
- Fixed Clang compiler errors when using
- Improved performance:
- Optimized
rotl()
androtr()
in<bit>
for 32-bit and 64-bit integers by using compiler intrinsics. #2369 -
reverse_copy()
's vectorized implementation is now activated (for eligible types) in all Standard modes. Previously, only the C++14/17 modes activated this optimization; C++20/23 modes unintentionally used the plain implementation (correct but slower). #2416 - Improved codegen for
gcd()
andlcm()
. #2343 - Improved
<format>
performance when the execution character set is self-synchronizing. For example, code page 1252 "ANSI Latin 1; Western European (Windows)" activates this optimization. The/utf-8
compiler option also activates this optimization. #2493 - Improved codegen for
generate_canonical
. #2498
- Optimized
- Improved throughput:
- Enhanced behavior:
- Fixed new warnings emitted by Clang 13:
-Wdeprecated-copy
(in product and test code) and-Wunused-but-set-variable
(in test code only). #2266 - Added ASan (Address Sanitizer) annotations to
<vector>
, allowing additional errors to be detected. #2071 #2420 #2464 #2508 - Added a debug assertion to
allocator::deallocate()
; passing a null pointer with a non-zero size is an error. #2412 - For supply chain security, replaced checked-in OBJ files (generated by an internal tool
aliasobj
) with the linker's/ALTERNATENAME
option (which is strictly more reproducible, although not officially documented). #2381- In certain scenarios involving separately compiled third-party libraries, this can cause "unresolved external symbol" linker errors. See issue #2655 for an explanation and workarounds.
- Fixed new warnings emitted by Clang 13:
- Improved documentation:
- Improved test coverage:
- Code cleanups:
- Removed compiler bug workarounds. #2338 #2351 #2357 #2474 #2496
- Updated test code to directly pass a format string to
printf()
, allowing the compiler to check it. #2346 - Cleaned up clang-formatting. #2356
- Changed the
<charconv>
test headers to use include guards, for closer alignment with libc++. #2372 - Improved the clarity of vectorized algorithm implementations by replacing the magic numbers
27
and78
. #2377 - Improved consistency by always saying
friend constexpr
instead of the reverse order. #2419 - Simplified
<ratio>
's implementation by usingconstexpr
functions instead of template metaprogramming. #2450 - Simplified an internal function for opening files. #2095
- Infrastructure improvements:
- Updated dependencies. #2474 #2496 #2514
- Updated build compiler to VS 2022 17.1 Preview 5 (now required).
- Updated Clang to 13.0.0 (now required).
- Updated CMake to 3.22 (now required).
- Updated Python to 3.10.2.
- Added scripts to set
INCLUDE
,LIB
, andPATH
after building the repo. #2578 - Azure Pipelines now uploads test logs as artifacts, making it easier to investigate test failures when lengthy command lines, compiler output, or runtime output are truncated in the web UI. #2575
- Updated dependencies. #2474 #2496 #2514
- Updated
_MSVC_STL_UPDATE
. #2374 #2455 #2519 #2602
- Merged C++20 Defect Reports:
- Merged C++23 features:
-
P0448R4 #2029
<spanstream>
-
P0943R6 #2008 Supporting C Atomics In C++
-
Note:
<stdatomic.h>
is currently supported when compiling as C++ (/std:c++latest
). It is not yet supported when compiling as C (/std:c11
and/std:c17
), but support for C atomics is planned for a future release. For more info, see the September 2020 blog post "C11 and C17 Standard Support Arriving in MSVC".
-
Note:
-
P1072R10 #2258
basic_string::resize_and_overwrite
-
P1147R1 #2262 Printing
volatile
Pointers -
P1272R4 #2235
byteswap()
-
P1425R4 #1994 Iterator Pair Constructors For
stack
Andqueue
- P1518R2 #2032 Stop Overconstraining Allocators In Container Deduction Guides
-
P1659R3 #1997
ranges::starts_with
,ranges::ends_with
-
P2136R3 #2019
invoke_r()
-
P2251R1 #2259 Require
span
Andbasic_string_view
To Be Trivially Copyable -
P2401R0 #2263 Conditional
noexcept
Forexchange()
-
P0448R4 #2029
- Merged LWG issue resolutions:
-
P2259R1 #2059 Repairing Input Range Adaptors And
counted_iterator
- Completed by implementing the input range adaptors part.
-
LWG-3422 #2260 Issues of
seed_seq
's constructors -
LWG-3506 #1994 Missing allocator-extended constructors for
priority_queue
-
LWG-3520 #2200
iter_move
anditer_swap
are inconsistent fortransform_view::
iterator
-
LWG-3522 #1994 Missing requirement on
InputIterator
template parameter forpriority_queue
constructors -
LWG-3527 #2194
uses_allocator_construction_args
handles rvalue pairs of rvalue references incorrectly -
LWG-3528 #2160
make_from_tuple
can perform (the equivalent of) a C-style cast -
LWG-3536 #2037 Should
chrono::from_stream()
assign zero toduration
for failure? -
LWG-3546 #1991
common_iterator
'spostfix-proxy
is not quite right -
LWG-3549 #2198
view_interface
is overspecified to derive fromview_base
-
LWG-3554 #2261
chrono::parse
needsconst charT*
overloads
-
P2259R1 #2059 Repairing Input Range Adaptors And
- Fixed bugs:
- Fixed
<complex>
exp()
andpolar()
for infinity and NaN inputs. #1584 - Fixed compiler errors when comparing
common_iterator
s of different types for equality. #2066 - Attempting to actually call
declval()
now emits astatic_assert
citing the paragraph of the Standard that forbids this. (Previously,declval()
was declared but not defined, which was too permissive.) #2101 - Fixed
basic_streambuf::seekoff()
andbasic_streambuf::seekpos()
to work with custompos_type
s. #2121 - Restored our guarantee beyond the Standard that
string_view
is trivially move constructible. #2128 - Fixed a bug where
vector
andstring
would terminate vianoexcept
instead of throwinglength_error
as desired when asize_t
would be truncated to an allocator's narrowersize_type
. #2139 -
<istream>
and<ostream>
now properly catch and rethrow internal IO exceptions. #2033 - Fixed
<format>
to correctly print hexfloats with large precisions. #2157 - Fixed compiler errors when using
constexpr
vector
s with certain user-defined allocators. #2161 - Fixed silent bad codegen in
ranges::stable_sort()
, where for certain inputs it would neither sort nor permute the range.ranges::inplace_merge()
was also affected. #2188 -
subtract_with_carry_engine
's textual representation is now correct. #2088 - Fixed a deadlock in the overload of
condition_variable_any::wait_until
takingstop_token
. #2220 -
u8streampos
,u16streampos
, andu32streampos
are now declared by<iosfwd>
as required by the Standard after P0482R6 and P1148R0 were accepted. #2223 - Fixed ARM64EC compiler errors in
<limits>
. #2306 - Fixed heap corruption in
fstream
when callingputback()
followed byclose()
. #2189 - Fixed
views::reverse
to work properly withranges::reverse_view
lvalues. #2313 - Fixed a bug where the STL's DLL was using Windows Vista's APIs for critical sections and condition variables, instead of the more efficient APIs that were introduced in Windows 7. This was specific to
/MD
(dynamic release) and the STL's GitHub CMake build system; it did not affect the legacy build system that's currently used for official builds of the MSVC toolset. #2314 - Fixed a bug affecting older CPUs where the STL generated the newer
tzcnt
instruction instead of the fallbackbsf
instruction. This affected<bit>
'scountr_zero()
andcountr_one()
,<numeric>
'sgcd()
andlcm()
, andvector<bool>
's optimized implementations offind()
and relational/spaceship operators. #2333 - Fixed minor conformance issues in
basic_string
. These changes were specified by P1148R0 "Cleaning Up[strings]
", which was almost a pure rewording paper without normative impact. Oops! #2222 - Fixed
ranges::find_end()
to return correct values for bidirectional common ranges. #2270 - Fixed compiler errors affecting
ranges::sort()
,ranges::search()
, and other ranges machinery. #2290 - Fixed
array<T, 0>
, allowing it to compile whenT
is not default constructible. #2296 - Fixed
allocator::allocate_at_least()
which was improperly annotated with__declspec(allocator)
. #2328
- Fixed
- Improved performance:
- Optimized
steady_clock::now()
whenQueryPerformanceFrequency()
is exactly 10 MHz, which is very common for modern PCs. #2086 - Improved codegen for x86 atomic loads. #2110
- Optimized the fallback implementation of
popcount()
, which is used when compiler intrinsics are unavailable (and is also used at compile time). #2079 - Slightly improved codegen when
<format>
prints a pointer in hexadecimal. #2097 - Optimized
<ranges>
non-propagating-cache
for trivially destructible types. #2118 - Improved ARM64 codegen for
popcount()
, using compiler intrinsics. #2127 - Extended the
memcpy()
,memmove()
, andmemcmp()
optimizations in various algorithms to handle more types. #2158 - Significantly improved the performance of
bitset::count()
by using the same machinery aspopcount()
. #2201 - Also improved the performance of
std::count()
forvector<bool>
by usingpopcount()
machinery in a more optimizer-friendly way. #2203 -
weak_ptr
's converting constructors now avoid locking except when necessary to ensure correctness in virtual inheritance scenarios. #2282- For example, converting
weak_ptr<T>
toweak_ptr<const T>
now avoids locking.
- For example, converting
- Removed a duplicated assignment in
filesystem::create_directories()
. #2304 - Optimized
is_permutation()
for reversed sequences. #2043
- Optimized
- Improved throughput:
- Enhanced behavior:
- Changed
numeric_limits<long double>::max_digits10
to handle both 64-bit and 80-bitlong double
, by restoring the original logic that was used before VS 2017 15.8.-
Note: 80-bit
long double
remains unsupported by MSVC.
-
Note: 80-bit
- C++ headers now emit clear
#error
messages when they're compiled as C. #2148- This applies to both the "C++ library headers" like
<vector>
and the "C++ headers for C library facilities" like<cstdio>
.
- This applies to both the "C++ library headers" like
- Improved the wording of
binary_semaphore
's debug check messages. #2293
- Changed
- Improved documentation:
- Cited LWG-3581 "The range constructor makes
basic_string_view
not trivially move constructible" in our implementation of its proposed resolution. #2175 - Removed comments that were citing GH-489, now that LWG-3530 "
BUILTIN-PTR-MEOW
should not opt the type out of syntactic checks" has been officially resolved by the June 2021 virtual plenary meeting. #2186
- Cited LWG-3581 "The range constructor makes
- Improved test coverage:
- Removed a
constructible_from
test case that was invalidated by recent changes to the Core Language. #2107 - Fixed a test for
next_permutation()
andprev_permutation()
; the algorithms were fine, but the test never worked and was never called. #2137 - Fixed the test harness to handle non-English Visual Studio installations running on Windows with non-UTF-8 encodings. #2145
- Added
/arch:AVX2
to the matrix of compiler options that's used when testing<bit>
. #2150 - Skipped more flaky tests in the legacy
tr1
test suite. #2202 - Fixed flaky tests in the legacy
tr1
test suite that were generating collisions between temporary filenames. #2210 - Fixed test failures on Windows 11. #2265
- Fixed
<chrono>
formatting test failures related to locale-dependent time zone abbreviations. #2231
- Removed a
- Code cleanups:
- Moved a helper
struct
from a central internal header to<optional>
. #2117 - Cleaned up comments and clang-formatting. #2136
- Removed a spurious overload of
operator>>(basic_istream&&, basic_string&)
. This didn't affect correctness, but it was neither necessary nor depicted by the Standard. #2138 - Cleaned up various things, notably simplifying
exception_ptr
's operators for C++20 and emitting a clear error message when compiling<stdatomic.h>
as C. #2140 - Removed unnecessary code in
<cctype>
that was attempting to defend against macroizedisalnum
etc. #2147 - Removed an unnecessary
reinterpret_cast
, and changed somereinterpret_cast
s fromvoid*
toT*
to usestatic_cast
instead. #2096 - Removed an unnecessary definition of our internal macro
_HAS_CXX23
from our central internal headeryvals_core.h
. #2226 - Removed comments that were citing proposed resolutions for LWG issues, now that those issues have been officially resolved by the October 2021 virtual plenary meeting. #2269
- Removed unnecessary
(void)
casts now that MSVC emits fewer spurious warnings about unreferenced parameters. #2280 - Removed compiler bug workarounds. #2327
- Moved a helper
- Infrastructure improvements:
- Updated
_MSVC_STL_UPDATE
. #2183 #2233 #2321
- Merged C++20 Defect Reports:
- Enabled C++20 features for Clang: #2064
- Merged C++23 features:
- P0401R6 #2036 Providing Size Feedback In The Allocator Interface
-
P1048R1 #1950
is_scoped_enum
-
P1132R7 #1998
out_ptr()
,inout_ptr()
-
P1679R3 #1478
contains()
Forbasic_string
/basic_string_view
-
P1682R3 #1828
to_underlying()
For Enumerations -
P1951R1 #2009 Default Template Arguments For
pair
's Forwarding Constructor -
P1989R2 #2000 Range Constructor For
string_view
-
P2162R2 #2006 Inheriting From
variant
-
P2166R1 #1995 Prohibiting
basic_string
Andbasic_string_view
Construction Fromnullptr
- This is a common source-breaking change - code that previously had undefined behavior at runtime will now be rejected with compiler errors.
- P2186R2 #2010 Removing Garbage Collection Support
- Merged LWG issue resolutions:
-
LWG-3430 #1968
std::fstream
& co. should be constructible fromstring_view
- LWG-3494 #1877 Allow ranges to be conditionally borrowed
-
LWG-3502 #1878
elements_view
should not be allowed to return dangling references - LWG-3518 #2080 Exception requirements on char trait operations unclear
-
LWG-3533 #1993 Make
base() const &
consistent across iterator wrappers that supportinput_iterator
s -
LWG-3541 #1992
indirectly_readable_traits
should be SFINAE-friendly for all types -
LWG-3548 #2007
shared_ptr
construction fromunique_ptr
should move (not copy) the deleter -
LWG-3553 #1990 Useless constraint in
split_view::
outer-iterator
::value_type::begin()
-
LWG-3555 #1989
{transform,elements}_view::
iterator
::iterator_concept
should considerconst
-qualification of the underlying range
-
LWG-3430 #1968
- Merged partial LWG issue resolutions:
- Fixed bugs:
- Fixed
time_put::do_put
to avoid crashing when the invalid parameter handler has been changed to not end execution. #1563 - Fixed a compiler error in
ranges::take_view
. #1844 - Fixed improper partitioning of forward ranges in the parallel algorithms. #1753
- Fixed an unintentionally dllexported symbol in the import library. #1927
- Fixed a bug in which
ranges::unique_copy
would fail to compile with a non-input output iterator. #1933 - Fixed a compiler error when calling
format_to()
in a specialization offormatter
(see #1961 for an example). #1874 - Fixed compiler errors when calling
views::drop
andviews::take
with types that aren't integers, but are convertible to integers (e.g.integral_constant
). #1958 - Fixed a compiler error when calling
constexpr
vector::emplace(position, args...)
. #1962 - Fixed
jthread
to providenative_handle()
. #1966 - Fixed
filesystem::remove()
to delete read-only files, as required by the Standard. #1559 - Fixed
mersenne_twister_engine
: #1631- Fixed the seeding algorithm to follow N4892 [rand.eng.mers]/8, avoiding an all-zero state. (This is a runtime special case.)
- Fixed the engine's behavior when
m == n
orn == 1
. (This is a compile-time special case, which doesn't affectmt19937
andmt19937_64
at all.) - Fixed
operator<<()
to avoid printing a trailing space after the engine's textual representation.
- Fixed
<chrono>
to adjust for leap seconds when formattingfile_time
. #1879 - Fixed
chrono::from_stream()
to allow a year and a day-of-year to be parsed to atime_point
. #1940 - Fixed
filesystem::u8path()
to acceptchar8_t
sources. #1943 - Fixed
<chrono>
to parse subseconds fortime_point
s. #1987- Also fixed the parsing of
local_time
with a UTC offset.
- Also fixed the parsing of
- Fixed
<chrono>
formatting to correctly estimate string widths (see N4892 [format.string.std]/9). #2017 - Fixed a major regression in the
_ITERATOR_DEBUG_LEVEL == 2
machinery, where a multithreaded program in debug mode could crash when one thread is modifying a container and another thread is destroying iterators. #2060- This regression affected all Standard modes (C++14/17/20/23) and was introduced by #1546 in VS 2019 16.10.
- Fixed in both VS 2019 16.11.4 and VS 2022 17.0.
- Fixed a compiler error in
pmr::map<K, pair<A, B>>::operator[]
. #2023 - Fixed compiler errors in
basic_string
'sgetline()
andoperator>>()
caused by the source-breaking change C++23 P2266R1 "Simpler Implicit Move", first implemented in Clang 13. #2025 -
bit_ceil()
now enforces its precondition duringconstexpr
evaluation, as required by the Standard. #2041 -
clog
is no longer tied tocout
, and similarly forwclog
andwcout
, following the Standard. #2056 - In
<ranges>
, whenfilter_view
,drop_view
,drop_while_view
, andreverse_view
store a cached position into an underlying view, they now properly invalidate that cached position when the underlying view is moved from. #1931
- Fixed
- Improved performance:
- Slightly improved debug codegen for
vector<bool>
,basic_string
, andmap
/multimap
/set
/multiset
'sempty()
member functions. #1836 - Fixed bloated codegen for
<format>
. #1874 - Dramatically improved the performance of
std::find()
andstd::count()
forvector<bool>
, with measured speedups between 19x and 26x (times, not percent). #1131 - Extended our
memcmp
/memcpy
/memchr
optimizations to ranges with contiguous iterators and unreachable sentinels. #1810 -
<format>
now detects when it's writing to aback_insert_iterator
for abasic_string
or avector
, and performs a faster call toinsert()
at theend()
of the container. #1894 -
std::byte
now activates the "trivially swappable" optimization inreverse()
andvariant::swap()
, so it'll have the same performance asunsigned char
. #2044 - Extended the vectorization optimization in
std::swap_ranges()
toranges::swap_ranges()
, and enhanced it to work for arbitrary contiguous iterators. #2048 - Reduced debug codegen size; an internal assertion macro was emitting completely unused, potentially long strings for function names. #2054
- Slightly improved debug codegen for
- Improved throughput:
-
<format>
and<chrono>
now avoid including<array>
. #2031
-
- Enhanced behavior:
- Added a visualizer for
source_location
. #1837 - Added
[[nodiscard]]
to thestoi()
family of functions in<string>
and to various functions in<locale>
(collate
member functions,has_facet()
, and theisalnum()
andtolower()
families). #1809 - Added a debug mode precondition check to
forward_list::splice_after()
. #2057 - Added visualizers for
bind_front()
,u8string
(and its iterators),default_sentinel_t
,unreachable_sentinel_t
,ranges::empty_view
,ranges::single_view
,ranges::iota_view
(and its iterator/sentinel),ranges::ref_view
,thread
,thread::id
,jthread
, andfilesystem::path
. #1856
- Added a visualizer for
- Improved test coverage:
- Added test coverage for our implementation-specific guarantees that
span
andbasic_string_view
are trivially copyable; P2251 may eventually Standardize these guarantees. #2015 - Fixed the ranges test machinery to properly specialize
std::basic_common_reference
; it was unintentionally relying on identical bugs in MSVC and Clang, but EDG correctly diagnosed that the code was non-Standard. #2013 - Fixed a test (for the
abs()
overloads in<cmath>
and<cstdlib>
) that unintentionally hadn't been running in our new GitHub test harness. #2070
- Added test coverage for our implementation-specific guarantees that
- Code cleanups:
- Removed compiler bug workarounds. #1759 #1778 #1920
- Removed unnecessary C casts. #1843
- The STL now uses Standard
_Pragma
instead of non-Standard__pragma
(when possible) to internally suppress warnings. #1342 -
<format>
now uses_First
/_Last
parameter names (instead of_Begin
/_End
) to be consistent with the rest of the STL. (The connotations are that first/last refers to an arbitrary range that might be a subrange, while begin/end refers to an entire container/view.) #1951 - Removed comments that were citing proposed resolutions for LWG issues, now that those issues have been officially resolved by the June 2021 virtual plenary meeting. #1967
- Improved
vector
's implementation, also usingif constexpr
to simplify code. #1771 - Simplified
<format>
's implementation of type-erased argument storage. #1907 - Filed LWG-3566 "Constraint recursion for
operator<=>(optional<T>, U)
" and updated our implementation's comment accordingly. #2011 - Simplified the backwards loop in
char_traits::move()
. #2055 - Marked all overriding functions with
override
, and removed redundantvirtual
keywords. #2069 - REMOVED THE "SHOUTY COMMENT BANNERS" LIKE
// CLASS TEMPLATE vector
; SEE #306 FOR THE RATIONALE. #2074 - Removed an unnecessary check for self-assignment in the compile-time implementation of
char_traits::move()
. #2083
- Infrastructure improvements:
- Build system improvements:
- The STL is now built with MSVC's
/ZH:SHA_256
switch to improve supply chain integrity. #1829
- The STL is now built with MSVC's
- Updated
_MSVC_STL_UPDATE
. Also updated_MSVC_STL_VERSION
to143
for the VS 2022 release series. #1897 #1955 #2035 #2091