VS 2019 16.8
·
2196 commits
to main
since this release
- Merged C++20 features:
- P0019R8 #843
atomic_ref - P0528R3 #1029 Atomic Compare-And-Exchange With Padding Bits (for MSVC; Clang support is pending compiler intrinsics, see LLVM-46685)
- Completed P0553R4 and P0556R3 #795 by adding MSVC support for the functions in
<bit>that were previously only supported when compiling with Clang (bit_ceil,bit_floor,bit_width,countl_one,countl_zero,countr_one,countr_zero,has_single_bit,popcount,rotl, androtr). - Completed P0811R3 #1048
midpoint(),lerp()by addingconstexprsupport and improving handling of infinite arguments. - P0912R5 #894 #961 #1204 Library Support For Coroutines
- P1001R2 #1111
execution::unseq - P1032R1 #491 #861 Miscellaneous
constexpr - P1065R2 #703
constexprINVOKE - Completed P1135R6 The C++20 Synchronization Library:
- P0019R8 #843
- Merged partial C++20 features:
- P0896R4 Ranges:
- #888 algorithm
ranges::move - #892 algorithm
ranges::is_permutation - #896 algorithm
ranges::search - #904 algorithms
ranges::fillandranges::fill_n - #905 algorithms
ranges::generateandranges::generate_n - #914 algorithm
ranges::search_n - #915 algorithms
ranges::is_sortedandranges::is_sorted_until - #916 algorithms
ranges::min,ranges::max,ranges::minmax,ranges::clamp,ranges::min_element,ranges::max_element, andranges::minmax_element - #917 algorithms
ranges::lower_bound,ranges::upper_bound,ranges::equal_range, andranges::binary_search - #918 algorithm
ranges::swap_ranges - #925 concepts
std::permutableandstd::sortable - #930 algorithms
ranges::is_heap,ranges::is_heap_until,ranges::make_heap,ranges::push_heap,ranges::pop_heap, andranges::sort_heap - #941 algorithm
ranges::transform - #976 algorithms
ranges::is_partitioned,ranges::partition,ranges::partition_copy, andranges::partition_point - #983 algorithms
ranges::replace,ranges::replace_copy, andranges::replace_copy_if - #984 algorithm
ranges::replace_if - #1005 algorithms
ranges::remove,ranges::remove_if,ranges::remove_copy, andranges::remove_copy_if - #1026 algorithm
ranges::copy_backward - #1028 algorithm
ranges::reverse(vectorized likestd::reverse) - #1039 algorithms
ranges::uniqueandranges::unique_copy - #1044 Concept
mergeable, and algorithmsranges::includes,ranges::set_difference,ranges::set_intersection,ranges::set_symmetric_difference, andranges::set_union - #1052 algorithms
ranges::sampleandranges::shuffle - #1053 algorithm
ranges::move_backward - #1063 algorithm
ranges::nth_element - #1073 algorithms
ranges::rotateandranges::rotate_copy - #1076 range access function
ranges::ssize - #1081 algorithm
ranges::lexicographical_compare - #1083 iterator adaptor
counted_iterator - #1095 algorithm
ranges::reverse_copy(vectorized likestd::reverse_copy) - #1099 algorithms
ranges::next_permutationandranges::prev_permutation - #1101 algorithm
ranges::merge - #1127 algorithm
ranges::sort - #1132 view
ranges::ref_view - #1137 algorithm
ranges::uninitialized_move - #1201 range factories
views::emptyandviews::single - #1229 range adaptors
views::allandviews::reverse - #1231 algorithms
ranges::partial_sortandranges::partial_sort_copy - #1245 P1391R4 Range Constructor For
string_view - #1252 range adaptor
views::filter - #1253 range adaptors
views::dropandviews::take - #1258 range adaptor
views::transform
- #888 algorithm
- P0896R4 Ranges:
- Merged LWG issue resolutions:
- Fixed bugs:
variantno longer emits warnings about narrowing/sign conversions when determining which alternative should be activated for a given initializer. (Warnings can still be emitted by the chosen initialization; that's intentional and desirable.) #858condition_variable_anynow correctly unlocks-and-relocks the lock argument to timed wait functions when given a non-positive relative timeout or absolute time in the past. #685std::powis now templated to handle integral and floating-point types as required by C++11 and later. For example,std::pow(float, int)previously returnedfloatand now returnsdouble. #903- Removed a bogus overload of
ranges::copy_nthat wasn't supposed to exist and wouldn't have compiled. #957 filesystem_errornow transcodes wide characters with no equivalent in the current locale to replacement characters instead of failing and throwingsystem error. #1010- Fixed
0 <=> partial_ordering::unorderedto return the correct value, and improved<compare>codegen. #1049 discrete_distributionno longer yields invalid results when its parameters sum very close to, but not equal to 1. #1025move_iterator::currentis no longer inadvertently aprotecteddata member - it has become properlyprivateand been renamed. #1080- Range algorithms no longer mishandle pointer-to-member predicates and projections when they are larger than
void*. #1091 - The
slice_array,gslice_array,mask_array, andindirect_arrayhelpers defined in<valarray>now have proper copy constructors and copy assignment operators. #988 - Fixed a bug in
ranges::iter_swapthat would cause it to sometimes drop one of the "swapped" values on the floor. #1072 weak_ptrconversions now preserve control blocks for expired objects. #1104- Fixed
<bit>'scountl_zeroto correctly use thebsrinstruction as a fallback for old CPUs that don't support thelzcntinstruction. #1108 #1166 - Fixed
partial_sort_copyto perform only operations that are required by the Standard to compile. #1088 - Fixed
deque::erase(iter, iter)to no longer perform self-move-assignments when called with an empty range. #1148 - Fixed
coroutine_handle<>::resumeandcoroutine_handle<>::operator()to allow exceptions to be thrown from coroutines. #1182 - Fixed
piecewise_constant_distributionandpiecewise_linear_distributionto return correctly distributed values. #1032 - Fixed
deque(and thereforequeueandstack) compiler errors in unusual scenarios whereiter + intanditer - intwould invoke an unexpected operator overload. #1161 - Fixed
anyandatomiccompiler errors when building with/Zc:noexceptTypes-. #1150 - Fixed
<charconv>hexfloatfrom_chars()to correctly handle numbers like"0.fffffffffffff8p-1022"which are just belownumeric_limits<Floating>::min(). #934 - Changed
shared_ptr's atomic functions to useSRWLOCKinstead of a naive spinlock, fixing priority inversion and improving performance. #1200 - Fixed incorrect constants that were producing incorrect results for
cosh()andsinh(). #1156 - Fixed 3 bugs in how
ostream << floating_pointhandles precision: #1173- Hexfloat output now ignores precision, as required by the Standard.
- Implemented LWG-231 (resolved in C++11, but overlooked); now,
0precision for scientific or general notation is directly passed tosprintf, instead of being replaced with6precision. - Negative precision no longer crashes.
get_time()now ignores case when parsing day and month names, as required by the Standard. #1168 #1240<experimental/generator>now defines anunhandled_exception()member function, required for C++20 coroutine promise types, even when/EHsisn't being used. #1219- Fixed compiler errors in the "iterator unwrapping" machinery for
counted_iterator. #1213 fillnow works correctly with pointers-to-volatileintegral types. (This change also applies ourmemset/memcmpoptimizations forfill/equala bit more aggressively; they now activate for filling contiguous ranges ofboolor comparing such with contiguous ranges of single-byte integer types.) #1160valarray::operator[]now verifies its argument is in range when/D_CONTAINER_DEBUG_LEVEL=1. #1247- Fixed a compiler error in
<complex>(introduced in VS 2019 16.7 by #367) when compiling with the Intel C++ Compiler's 80-bitlong doublemode. #1316- Note: 80-bit
long doubleremains unsupported by MSVC.
- Note: 80-bit
- Improved performance:
- Extended
equal()'smemcmp()optimization toranges::equal_toand arbitrary contiguous iterators. #831 optionalno longer unnecessarily zero-fills its storage when default constructed. #878- Improved
span's debug codegen by simplifying its representation (as/std:c++latestisn't ABI-frozen). #877 - Use
__iso_volatile_store64for relaxed atomics on x86, and use__iso_volatile_store64unconditionally. #694 - Enabled more
constexprin<system_error>using the[[msvc::noop_dtor]]attribute we requested from the MSVC compiler front-end. #1016 - Hand-vectorized
std::reverse_copy. #804 - Refactored the comparison category types into aggregates so they can be passed in registers. #1065
- Optimized
std::fillandstd::fill_nforvector<bool>. #879 - Applied
DisableThreadLibraryCallsto all "satellite" DLLs. #1142 - Improved debug codegen in
<valarray>by extracting repeated calls tosize(). Also improved readability by expanding macros, and avoided unnecessary use of magic statics for non-trivial types. #1165 vectornow avoids quadratic complexity when itssize()is nearmax_size()(which is effectively impossible for the defaultallocator, making this an extremely obscure scenario). Now, if geometric growth would exceedmax_size(), we clamp tomax_size(). #1221
- Extended
- Enhanced behavior:
- Improved throughput:
- Simplified
is_function,is_object,is_member_function_pointer,is_member_object_pointer, andis_member_pointer. #460
- Simplified
- Improved documentation:
- Improved test coverage:
- Added test cases for the large integer fallback in
<charconv>to_chars()plain shortest round-trip. #835 - Future-proofed test code for the upcoming addition of C++20
std::chrono::last. #837 - Enabled more libcxx test coverage for
span. #839 - Added test coverage for the new
/Zc:preprocessorcompiler option. #677 - Added tests for LWG-3018 "
shared_ptrof function type". #833 - Fixed "unresolved" tests by linking with
/MANIFEST:EMBED. #862 - The test harness now emits a "note" for unsupported locales instead of a warning. #866
- Prevented failing tests from displaying assertion/crash dialog boxes. Also, the standard output streams of failing tests are no longer lost due to buffering. #906
- Increased test coverage in the ranges spaceship test by removing compiler bug workarounds. #852
- Improved ranges test machinery. #959
- Enabled "multiple translation unit" tests which hadn't been running in the new test infrastructure. These tests detect problems like forgetting to mark header-only non-templated functions as
inline. #1109 - Added a test to verify that
deque::erase(iter, iter)no longer performs self-move-assignments when called with an empty range. #1203 - Removed experimental
/awaitfrom test configurations, and re-enabled various tests now that compiler bugs have been fixed. #1207 - Added a test for
<coroutine>"end-to-end" behavior. #1215
- Added test cases for the large integer fallback in
- Code cleanups:
- Updated comment to cite LWG-3446. #841
- Renamed identifiers like
_R1to_Rx1, avoiding any resemblance to macros. #865 - Added comments to
<execution>, mentioning the subtle control flow. #849 - Avoided function-style casts in test code. #899
- Cleaned up
stl/src, changing C casts to C++ casts,0tonullptr, and more. #900 #912 - Added
ranges::_Ubeginandranges::_Uendinternal helper functions to simplify getting "unwrapped" iterators from a range. #901 - Renamed internal headers to
.hppand adjustedclang-formatto sort them last. #902 - Simplified comments, as
using _Predandusing operator<weren't necessary to mention. #977 - Removed compiler workarounds and used braces to construct objects. #978 #1020
- Improved ranges test machinery to better tolerate
using-directives. #979 - Consistently formatted
requires, preparing for when clang-format becomes aware of concepts. #999 - Provided comparison operators for
map,multimap,set, andmultisetinstead of their internal base class_Tree. #1022 - Updated the implementations of some of the oldest Range algorithms to match our current style:
- Took advantage of some of the clang-format changes in LLVM 10 to keep our codebase looking nice. #1075
- Removed unnecessary
std::qualification from product and test code. #1119 - Cleaned up compiler bug workarounds, which will be possible to remove in the near future. #1191
- Worked around some IntelliSense bugs in the concepts-enabled C++20 parts of the STL. #1216
- Removed an unnecessary compiler option
/d2Zi+fromCMakeLists.txt. #1218 - Consistently use
conjunction_vfor short-circuiting in conditionalexplicitclauses. #1241 - Avoided null pointer constants masquerading as integers by replacing
0withnullptrin a great many places. #1250
- Infrastructure improvements:
- Updated dependencies.
CMakeLists.txtnow defaults to using ourvcpkgsubmodule, simplifying our build process. #1124- Removed a timing assumption from
test_atomic_wait.hppthat was causing intermittent test failures. - Added
/analyzeto PR/CI builds, and fixed the resulting warnings. #1009 - Enhanced our Code Format Validation check to detect lines exceeding 120 columns, and cleaned up a few occurrences in areas where clang-format had been suppressed. #1214
- Updated
_MSVC_STL_UPDATE. #897 #989 #1144