vs-2022-17.8
版本发布时间: 2024-03-09 13:29:43
microsoft/STL最新发布版本:vs-2022-17.11(2024-08-15 19:47:14)
- Merged C++26 features:
- Merged C++23 features:
- Merged C++20 extension:
- The C++23 named modules
std
andstd.compat
are now available when compiling in C++20 mode. #3977- This extension should eventually be portable to the major Standard Library implementations via an informal agreement between implementers.
- Build systems - including the Visual Studio IDE - will need changes to support
import std
in C++20. This change makes it possible for them to do so.
- The C++23 named modules
- Merged LWG issue resolutions:
-
LWG-3631 #3745
basic_format_arg(T&&)
should useremove_cvref_t<T>
throughout -
LWG-3843 #3737
std::expected<T, E>::value() &
assumesE
is copy constructible -
LWG-3893 #3782 LWG-3661 broke
atomic<shared_ptr<T>> a; a = nullptr;
-
LWG-3904 #3781
lazy_split_view::
outer-iterator
'sconst
-converting constructor isn't settingtrailing_empty_
-
LWG-3631 #3745
- Fixed bugs:
- Fixed the
deque(size_type)
constructor to properly destroy elements when constructing one of them throws an exception. #3720 - Removed a non-Standard operator
basic_istream >> setfill(c)
. #3725 - Fixed linker errors when linking x64 object files into ARM64EC programs. #3732
- We backported this fix to VS 2022 17.6.6 and VS 2022 17.7.
- Fixed the debug mode check in
cartesian_product_view::size()
to always accept empty views. #3733 - Fixed
formatter<char, wchar_t>
to format thechar
as a character instead of an integer. #3723 - The STL now avoids dragging in the non-reserved name
ISA_AVAILABILITY
. #3721 - Fixed
chrono::hh_mm_ss
formatting to accept values of 24 hours or more. #3727 - Changed the STL's usage of compiler-specific custom attributes to further defend against macros. #3760
- Fixed
condition_variable_any::wait_until()
to handletime_point
s with unsigned representations instead of waiting forever. #3761 - Fixed
counting_semaphore
to add compile-time enforcement of the Standard's mandates. #3747 - Fixed a bug, affecting UWP apps only, where locking a
mutex
could throw a bogus exception. #3763 - Fixed the signatures of
char_traits
member functions to exactly match the Standard. #3739- This Standardese was updated by N2349 in C++11.
- Fixed compiler errors when
visit_format_arg()
is called with highly unusual visitors. #3787 - Fixed incorrect output when
format()
is asked to format a floating-point value in the alternate form without a type specifier. #3815 - Added a compiler bug workaround for MSVC modules, allowing
<format>
machinery to work with/utf-8
viaimport std;
. #3816 - Fixed a subtle bug affecting
constexpr basic_string
's copy assignment operator, where it wasn't starting element lifetimes for the unused capacity. #3712 #3819 - Fixed Clang compiler errors when calling
function::target<FunctionType>()
onconst function
objects. #3844- This is an obscure corner case, because such calls are guaranteed to return null.
- Fixed compiler errors when using
array<T, 0>
inconstexpr
contexts. #3863 - Improved function call operator overload resolution for the
bind()
,bind_front()
, andbind_back()
function objects. #3775 - Fixed iostreams with imbued locales to print infinities and NaNs correctly. #3868 #3877
- Fixed incorrect
noexcept
s within the implementations offilesystem::current_path()
,filesystem::current_path(error_code&)
,read_symlink(const path&)
, andread_symlink(const path&, error_code&)
. #3869 #3881 - Fixed
shared_ptr<void>
to not be constructible fromvoid*
. #3873 - Fixed a complicated modules scenario by removing
#pragma once
from all STL headers. #3895-
#pragma once
is no longer needed to improve throughput because modern compilers automatically detect the idempotency guard idiom.
-
- Fixed
<stacktrace>
's internal use ofsnprintf()
in extreme situations. #3916 - Fixed an extremely obscure runtime correctness bug in
basic_string
's copy assignment operator, specific to non-equalpropagate_on_container_copy_assignment
allocators. #3862 - Fixed ASan annotations in
basic_string::replace()
. #3884 - Fixed ASan annotations in
basic_string::assign()
andbasic_string::resize_and_overwrite()
. #3956
- Fixed the
- Improved performance:
- Changed some helper member functions to be
static
, slightly improving debug codegen. #3755 -
mutex
andcondition_variable
now avoid virtual function calls within their implementations. #3770 - Optimized
steady_clock::now()
whenQueryPerformanceFrequency()
is exactly 24 MHz, which is very common for ARM64. #3832 - Optimized
filesystem::path::lexically_normal()
. #3850 -
basic_string
,basic_stringbuf
,basic_syncbuf
,deque
, andvector
now take advantage of allocators that provideallocate_at_least()
. #3864 #3891 - Optimized
<format>
slightly. #3826 - Optimized
bitset::to_string()
. #3838 #3904 - Added an attribute to
as_const()
,to_integer()
, andto_underlying()
that allows the MSVC compiler to intrinsically implement them without emitting function calls. #3664 - Made a tiny tweak to
valarray
(access the stored size directly instead of via callingsize()
) to improve debug codegen. #3968
- Changed some helper member functions to be
- Improved throughput:
- Moved machinery: #3719
- Moved
integer_sequence
,make_integer_sequence
,index_sequence
,make_index_sequence
, andindex_sequence_for
from<type_traits>
to<utility>
, which is where the Standard provides them. - Moved
allocator_arg
,allocator_arg_t
,uses_allocator
, anduses_allocator_v
so that they're dragged in by slightly fewer headers. (The Standard provides them in<memory>
.)
- Moved
- Some headers now avoid including
<limits>
. #3777 - In C++17 mode and later, improved Clang throughput for an internal helper wrapping
is_same_v
. #3933
- Moved machinery: #3719
- Enhanced behavior:
- Added precondition checking in debug mode to the
iota_view(value)
constructor. #3731 - Improved precondition checking in debug mode for
barrier
. #3757 - Fixed static analysis warnings. #3734 #3743
-
Note: The STL has always attempted to be
/W4 /analyze
clean, but does not yet attempt to be clean with respect to all additional static analysis rulesets.
-
Note: The STL has always attempted to be
- Strengthened the exception specifications for:
- Internal
<ranges>
machinery used injoin_view
iterators andlazy_split_view
. #3762 -
basic_string_view::compare(const charT*)
. #3738 - Constructors of
locale::facet
and related base classes. #3855 - Many functions in
<complex>
. #3880 - Many functions in
<random>
, some functions in<valarray>
, and 3-arghypot()
in<cmath>
. #3887
- Internal
- The STL now avoids conflicting with non-Standard macros of reserved names that were defined by old versions of the ICU library. #3776
- Updated
stdext::checked_array_iterator
andstdext::unchecked_array_iterator
: #3818- Added
const
ness conversions. - Deprecated these iterators, which have been superseded by
std::span
andgsl::span
.
- Added
- Added "lifetimebound" attributes to
minmax
andranges::minmax
, allowing MSVC code analysis and Clang-Wdangling
to detect dangling references in improper usage. #3831 - Improved how
views::cartesian_product
detects ranges with maximum sizes that are known at compile time. #3839 - Improved how parallel algorithms perform compile-time iterator type checking. #3899
- The STL now calls
abort()
instead ofterminate()
for unrecoverable conditions, when the Standard doesn't requireterminate()
to be called. #3906 #3909 - Improved the visualizer for
vector<char>
and the other character types. #3772 - Improved the visualizer for
mutex
andrecursive_mutex
. #3848 - Updated
chrono::duration_cast()
to useif constexpr
, improving debug codegen. #3958
- Added precondition checking in debug mode to the
- Improved test coverage:
- Added properly functioning test coverage for
ranges::owning_view
. #3753 - Added test coverage for calling
tellg()
while reading an LF file in text mode. #3773 #3841 - Added test coverage for LWG-2295 Locale name when the provided
Facet
is anullptr
. #3823 - Added test coverage for LWG-2682
filesystem::copy()
won't create a symlink to a directory. #3827 - Updated tests to use lvalue references for the LHS of
is_assignable_v
andis_nothrow_assignable_v
. #3898 - Added more tests for
views::as_const
,views::stride
, andviews::zip
. #3920 - Test code now consistently uses
override
to avoid mistakes, following the same convention as product code. #3934 - Fixed precondition violations in
is_permutation()
tests. #3967 - Fixed precondition violations in
regex_iterator
andregex_token_iterator
tests. #3990
- Added properly functioning test coverage for
- Code cleanups:
- Removed compiler bug workarounds. #3722 #3769 #3866 #3939
- Improved SFINAE to follow modern conventions. #3736
- Various cleanups (described in detail in the PRs, not repeated here). #3758 #3759 #3765 #3768 #3912 #3927 #3935
- Removed comments that were citing proposed resolutions for LWG issues, now that those issues have been officially resolved by the June 2023 meeting. #3784 #3785
- Marked internal machinery as
[[noreturn]]
. #3865 #3882 - Removed unnecessary
typename
keywords in C++20 mode and later. #3892 #3893 #3894 - Improved type safety by using an
enum class
for internal machinery within<condition_variable>
,<mutex>
, and<thread>
. #3897 - Improved the consistency of code that should never be called. #3905
- Removed unused code. #3936
- Improved the clarity and maintainability of
basic_string
's implementation. #3862 - Deprecated the non-standard
<cvt/meow>
headers and their provided character encoding conversion machinery. #3924- Users should prefer to call
MultiByteToWideChar()
andWideCharToMultiByte()
.
- Users should prefer to call
- Improved documentation:
- Infrastructure improvements:
- Build system improvements:
- Updated
_MSVC_STL_UPDATE
. #3742 #3851 #3918