VS 2022 17.0
StephanTLavavej
released this
09 Mar 05:24
·
1480 commits
to main
since this release
- 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. #2041clog
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. #1894std::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