VS 2019 16.9
·
1715 commits
to main
since this release
- Merged C++20 features:
- P0339R6 #1311
polymorphic_allocator<>
- P0660R10 #1196
<stop_token>
Andjthread
- P0768R1 #1370 Library Support For The Spaceship Comparison Operator
<=>
- This feature was mostly implemented in VS 2019 16.0; it's now complete with the addition of the spaceship customization point objects
strong_order
,weak_order
,partial_order
,compare_strong_order_fallback
,compare_weak_order_fallback
, andcompare_partial_order_fallback
.
- This feature was mostly implemented in VS 2019 16.0; it's now complete with the addition of the spaceship customization point objects
- P1007R3 #1306
assume_aligned()
- P1020R1 #1315 Smart Pointer Creation With Default Initialization
- P1771R1 #1495 #1514
[[nodiscard]]
For Constructors
- P0339R6 #1311
- Merged partial C++20 features:
- P0355R7
<chrono>
Calendars And Time Zones:- #1341
operator<<(basic_ostream&, const duration&)
- #1341
- P0896R4 Ranges:
- #1092 #1265 #1268
common_iterator
- #1271
views::take
andviews::drop
now handlebasic_string_view
as specified in P1739R4. - #1313
ranges::construct_at
andranges::destroy_at
- #1164 algorithms
ranges::uninitialized_default_construct
,ranges::uninitialized_default_construct_n
,ranges::uninitialized_value_construct
,ranges::uninitialized_value_construct_n
,ranges::uninitialized_fill
,ranges::uninitialized_fill_n
,ranges::uninitialized_copy
,ranges::uninitialized_copy_n
,ranges::uninitialized_move_n
- #1281 Changes to the stream iterators (
istream_iterator
,ostream_iterator
,istreambuf_iterator
, andostreambuf_iterator
) to model the C++20 iterator concepts - #1366 view
ranges::drop_while_view
- #1406 view
ranges::elements_view
- #1334 view
ranges::istream_view
- #1372 view
ranges::take_while_view
- #1305
views::common
- #1375
views::counted
- #1092 #1265 #1268
- P1502R1 Standard Library Header Units:
- P0355R7
- Merged LWG issue resolutions:
- LWG-3036 #1455
polymorphic_allocator::destroy
is extraneous - LWG-3117 #1493 Missing
packaged_task
deduction guides - LWG-3170 #1501
is_always_equal
added tostd::allocator
makes the standard library treat derived types as always equal - LWG-3211 #1460
std::tuple<>
should be trivially constructible - LWG-3448 #1458
transform_view
'ssentinel
<false>
not comparable withiterator
<true>
- LWG-3460 #1452 Unimplementable
noop_coroutine_handle
guarantees - LWG-3464 #1483
istream::gcount()
can overflow
- LWG-3036 #1455
- Fixed bugs:
- Fixed the
invocable_r
family of type traits to handle C++17 deferred temporary materialization. #1282 - Fixed a compiler error in
atomic_ref<[u]int8_t>::operator--(int)
. #1303 - Removed non-Standard implicitly converting constructors from
complex
. #1294 - Enabled
constexpr
destruction ofmemory_resource
. #1314 std::filesystem::create_directories()
now throws an exception (or fails with anerror_code
) when called with an emptypath
. #1285- Fixed compiler errors (with clang-tidy and IntelliSense-in-Clang-mode) caused by
intrin0.h
includingintrin.h
, which no longer happens. #1300 - Fixed undefined behavior and incorrect results in
geometric_distribution
,poisson_distribution
,binomial_distribution
, andgamma_distribution
. #1159 - Fixed incorrect results (infinity and NaN) in
normal_distribution
,lognormal_distribution
,fisher_f_distribution
, andstudent_t_distribution
. #1228 - Fixed
bind_front()
to determine its return type from the decayed types of its arguments. #1293 - Fixed
pow(complex, arithmetic)
to strictly follow the Standard's rules and return correct results. #1299 - Fixed
_Node_handle
- the internal class template that reifies the Standard'snode-handle
family of exposition-only types - to destroy contained values with an allocator rebound to the value type instead of to the type of the node. #1310 - Fixed overflow when converting extreme relative times (like
duration::max()
) to absolute times incondition_variable_any::wait_for()
,condition_variable::wait_for()
,recursive_timed_mutex::try_lock_for()
,shared_timed_mutex::try_lock_for()
,shared_timed_mutex::try_lock_shared_for()
,this_thread::sleep_for()
, andtimed_mutex::try_lock_for()
. #1371 - Fixed a compiler error when compiling
<experimental/generator>
in/kernel
mode. #1373 - Fixed
std::atomic_init
; C++20 deprecated it (which we previously implemented) and changed its effects to be equivalent to a relaxed store (which we previously missed). #1090 - Fixed
get_time()
to correctly handle format specifications without delimiters; for example,"20201029"
can now be parsed with"%Y%m%d"
. #1280- This fix was incomplete; it was completed by #1620 in VS 2019 16.10.
- Fixed the ordered associative containers (
map
,multimap
,set
,multiset
) so that their move constructors and move assignment operators don't attempt to swap their comparators (which could fail to compile, especially for lambdas which aren't assignable). #1357 - Fixed a crash when a user-defined class, deriving from
streambuf
, threw an exception from its constructor. #1358 - Fixed two lines in ranges machinery that mistakenly said
noexcept(noexcept(is_nothrow_v))
(which is alwaysnoexcept(true)
). Now they saynoexcept(is_nothrow_v)
as intended. #1417 - Marked
hash<coroutine_handle<>>::operator()
asconst
, required by the Standard. #1423 - Fixed several issues in
complex
sqrt()
andlog()
: #935- Fixed
sqrt()
overflow for huge inputs. - Fixed
sqrt()
inaccuracy for tiny inputs, due to internal underflow. - Fixed
log()
inaccuracy for tiny inputs, due to internal underflow. - Improved accuracy of
log()
when |z| ~= 1. - Fixed
log(complex<float>{1, 0})
for certain combinations of compile-time and run-time settings; now it correctly returns0
. - These correctness fixes have a moderate performance cost, partially mitigated by using hardware FMA when available on x86/x64/arm64.
- Fixed
- Fixed an AddressSanitizer
new-delete-type-mismatch
issue invalarray
. #1496 - Fixed linker errors on ARM and ARM64 when using atomic waits. #1507
- Fixed the exception specification for
basic_string_view
's (iterator, sentinel) constructor. #1510 - Fixed
regex_traits::transform()
to accept arbitrary forward iterators instead of requiring raw pointers. #1494 - Fixed a
static_assert
that was preventingatomic_ref<const T>
from compiling. #1500 - Fixed a compiler error when compiling
<atomic>
in C++20 mode with Clang targeting ARM64. #1509
- Fixed the
- Improved performance:
- Removed unused code for Windows XP (and Server 2003) support, slightly improving runtime performance and decreasing the size of the STL's DLL by 3%. #1194 #1325 #1397
- Optimized
<charconv>
from_chars()
by simplifying how it assembles floating-point values, and by using the branchless rounding technique that was originally invented forhex
precisionto_chars()
. #1220 - Changed
vector
's move constructor to be more optimizer-friendly. #1330 - Optimized the
fill
family of algorithms (includingfill_n
, theuninitialized_
forms, and theranges::
forms) to usememset
when setting scalars to all-bits-zero. #1273 - Used new compiler intrinsics in
<cmath>
'sfloat
andlong double
overloads ofceil
,copysign
,floor
,round
, andtrunc
. #1336 - The range adaptor closure objects for
views::filter
andviews::transform
now properly move from their stashed function objects when possible. #1410 - The spaceship customization point objects
strong_order
andweak_order
now compare floating-point values without branching on the sign bit. #1475
- Enhanced behavior:
- Changed
_Execute_once()
, an internal helper function, to be compatible with XFG, an enhanced version of the Control Flow Guard feature. #1318 #1356 - Added checks to
optional::operator*
andoptional::operator->
that fire when called on an emptyoptional
when_CONTAINER_DEBUG_LEVEL > 0
(which is implied by_ITERATOR_DEBUG_LEVEL != 0
). #1362 - Header improvements: #1405
<tuple>
no longer includes<new>
.- Changed most (but not all) C wrapper headers to be "core headers".
- Function objects for operators (
less
,equal_to
,greater
,plus
, etc., and the recently-addedcompare_three_way
) now emit[[nodiscard]]
warnings. #1474
- Changed
- Improved throughput:
- Replaced one use of tag dispatch with
if constexpr
, and changed several uses of type trait structs to variable templates (which the MSVC compiler recognizes and efficiently handles). #1413 - Added
::std::
qualification to certain names, improving throughput for extremely largetuple
s (noticeable with 50+ elements). #1490
- Replaced one use of tag dispatch with
- Improved documentation:
- Added
llvm-project
and the--progress
option to the README's instructions for the initial submodule sync. This takes longer (a lot longer), but it simplifies the testing instructions later. #1441
- Added
- Improved test coverage:
- Added more
<charconv>
to_chars()
test cases. #1278 - Added tests for
get_time()
being called with a format specification that's longer than the stream's contents. #1326 - Updated the
libcxx
test suite. #1090 - Fixed the range adaptor tests to properly test
const
rvalues. #1393 - Overhauled the test harness, improving its performance for both manual and CI runs. (For example, on one machine, testing time decreased from 75 minutes to 60 minutes.) #1394
- Added
/analyze:autolog-
to/analyze:only
test configurations; together, these compiler options run code analysis without producing an object file (/analyze:only
) and without writing detailed analyzer results to an XML file (/analyze:autolog-
), as we're simply looking for any warnings from code analysis. #1434 - Skipped parts of
tests/std/tests/VSO_0226079_mutex
that could intermittently fail due tosystem_clock
time adjustments on virtual machines. #1473
- Added more
- Code cleanups:
- Removed compiler bug workarounds. #1291 #1327 #1451
- Removed unused
#include
directives fromstl/src
files, and changed inclusions from<meow.h>
to<cmeow>
. #1270 - Removed unnecessary macros and a compiler bug workaround. #1307
- Removed unnecessary code in
ranges::uninitialized_default_construct_n
. #1377 - Changed test code to consistently use
unsigned int
instead ofunsigned
. #1390 - Moved helper structs in separately compiled code into unnamed namespaces. #1398
- Changed test code to construct
initializer_list
with Standard code, instead of our internal constructor. #1400 - Changed test code to always
remove_cvref_t
the argument toenable_borrowed_range
(because the library doesn't allow user specializations for cv-qualified types or reference types). #1415 - Renamed internal
<ranges>
machinery to_Category_base
, which avoids shadowing the internal_Iterator_base
used throughout the STL. #1420 - Improved the readability of the
<ranges>
"expression-equivalent" machinery by extracting aconstexpr
"strategy" variable. #1426 - Removed comments that were citing proposed resolutions for LWG issues, now that those issues have been officially resolved by the November 2020 virtual plenary meeting. #1456
- Unified internal machinery for floating-point type traits. #1442
- Fixed a comment that was mentioning a non-existent parameter. #1476
- Infrastructure improvements:
- Updated
_MSVC_STL_UPDATE
. #1272 #1340 #1439