Skip to content

Releases: microsoft/STL

VS 2022 17.11

15 Aug 11:47
e36ee6c
Compare
Choose a tag to compare
  • Merged C++26 features:
  • Merged partial C++23 features:
  • Merged LWG issue resolutions:
    • LWG-3767 #4542 codecvt<charN_t, char8_t, mbstate_t> incorrectly added to locale
    • LWG-3919 #4526 enumerate_view may invoke UB for sized common non-forward underlying ranges
    • LWG-3950 #4510 std::basic_string_view comparison operators are overspecified
    • LWG-3984 #4543 ranges::to's recursion branch may be ill-formed
    • LWG-4012 #4529 common_view::begin/end are missing the simple-view check
    • LWG-4013 #4530 lazy_split_view::outer-iterator::value_type should not provide default constructor
    • LWG-4016 #4539 container-insertable checks do not match what container-inserter does
    • LWG-4035 #4525 single_view should provide empty
    • LWG-4053 #4685 Unary call to std::views::repeat does not decay the argument
    • LWG-4054 #4540 Repeating a repeat_view should repeat the view
  • Fixed bugs:
    • Fixed condition_variable::wait_until() and condition_variable_any::wait_until() to consistently use the given time_point's clock type, instead of also depending on the system clock. This also fixed condition_variable::wait_for() to consistently use steady_clock. #4457
    • Fixed <format> to always perform compile-time format string checking for wchar_t, even when the narrow execution character set doesn't support it. #4459
    • Fixed compiler errors when constexpr basic_string interacted with the undocumented compiler option /d1initall. #4474
    • Fixed atomic_ref for 16-byte objects to correctly report is_lock_free() and is_always_lock_free on x64 (when the optional mode _STD_ATOMIC_ALWAYS_USE_CMPXCHG16B is defined to be 1) and ARM64 (always). #4478
    • Removed the vectorized implementation of ranges::find with unreachable_sentinel as it was fundamentally incompatible with ASan (Address Sanitizer). #4486
      • This was introduced by #2434 in VS 2022 17.3.
    • Fixed incorrect results from the vectorized implementation of ranges::find_last for certain combinations of value and element types. #4561
      • This fixed a regression that was introduced by #3925 in VS 2022 17.9.
    • Fixed the STL to avoid emitting the off-by-default warning C4365 (signed/unsigned mismatch) when the /ZI compiler option (debug info for Edit and Continue) is used. #4487
      • These warnings were most noticeable when building the Standard Library Modules, but they were also emitted by classic includes.
    • Fixed the STL to avoid emitting the off-by-default warning C5246 (brace elision). #4527
    • Fixed compiler errors involving incomplete types in:
      • pair and tuple machinery. #4488
    • Fixed make_from_tuple() to properly implement LWG-3528 with a constraint instead of a static_assert. #4528
    • Added integral overloads for <cmath>'s classification functions fpclassify(), isfinite(), isinf(), isnan(), isnormal(), and signbit(). #4537
    • Fixed is_trivial to correctly handle unusual types. #4576
    • Avoided mentioning __vectorcall for ARM64EC, where it is not yet supported. #4600
    • Fixed std.ixx to include <intrin.h> in the Global Module Fragment, fixing compiler errors with import std; in certain scenarios. #4626
    • Fixed compiler errors when a user-defined formatter calls basic_format_parse_context::next_arg_id() with an empty format-spec. #4640
    • Fixed compiler errors when using <expected> in /permissive mode. #4658
      • Note: While /permissive mode is discouraged, it's currently supported for most STL components.
    • Fixed compiler errors when inheriting expected's constructors in certain scenarios. #4664
    • Fixed pair's self-swap() behavior to follow the Standard by self-swapping its elements. #4674
    • Fixed atomic<void*> and atomic_ref<void*> to provide difference_type. #4689
  • Improved performance:
    • Helped the compiler auto-vectorize:
      • replace_copy(), replace_copy_if(), ranges::replace_copy, and ranges::replace_copy_if. #4431
      • iota(). #4627
      • ranges::iota. #4647
    • Added vectorized implementations of:
      • find_first_of() and ranges::find_first_of. #4466 #4557 #4563 #4587 #4623
      • mismatch() and ranges::mismatch. #4495 #4538 #4584
      • replace() and ranges::replace for 32-bit and 64-bit elements. #4554 #4584
      • lexicographical_compare(), ranges::lexicographical_compare, and lexicographical_compare_three_way(). #4552
    • Further improved the vectorized implementations of:
      • count(), find(), ranges::count, ranges::find, and ranges::find_last. #4570 #4614
    • Used Clang builtins to improve the performance of <cmath>'s floating-point classification and comparison
      functions: #4612
      • Classification: isfinite(), isinf(), isnan(), isnormal()
      • Comparison: isgreater(), isgreaterequal(), isless(), islessequal(), islessgreater(), isunordered()
    • Improved normal_distribution::operator()(engine, param) by avoiding unnecessarily recomputing coefficients. #4618
  • Improved throughput:
    • Slightly improved <mdspan> throughput by using short-circuiting conjunction_v instead of fold expressions. #4559
    • Refactored floating-point machinery, improving throughput by reducing inclusion of various headers. #4615
    • Improved <string_view> throughput by no longer dragging in most of <string>'s contents. #4633
  • Improved diagnostics:
    • Improved compiler error messages when formatter<UDT>::format() isn't const. #4461
    • Massively improved the compiler error messages for get<T>(tuple<Types...>) when T doesn't occur exactly once in Types. #4578
    • Significantly improved compiler error messages when ranges::to is unable to construct the requested result. #4608
  • Enhanced behavior:
    • To reduce risk, the STL no longer attempts to activate vectorized implementations of algorithms for ancient processors that support SSE2 but not SSE4.2. #4550
      • This consolidated the STL's levels of vectorization to none, SSE4.2, and AVX2.
      • This also slightly improved performance (for non-ancient processors) by taking advantage of newe...
Read more

VS 2022 17.10

21 May 22:29
d6efe94
Compare
Choose a tag to compare
  • Merged C++26 features:
  • Merged C++23 features:
    • P2836R1 #4188 basic_const_iterator Should Follow Its Underlying Type's Convertibility
  • Merged partial C++23 features:
    • P2286R8 Formatting Ranges:
      • Implemented formatter<vector<bool>::reference>. #4133
  • Merged C++20 Defect Reports:
  • Merged LWG issue resolutions:
    • LWG-3749 #4190 common_iterator should handle integer-class difference types
    • LWG-3809 #4194 Is subtract_with_carry_engine<uint16_t> supposed to work?
    • LWG-3897 #4186 inout_ptr will not update raw pointer to null
    • LWG-3946 #4187 The definition of const_iterator_t should be reworked
    • LWG-3947 #4195 Unexpected constraints on adjacent_transform_view::base()
    • LWG-3949 #4204 atomic<bool>'s trivial destructor dropped in C++17 spec wording
    • LWG-3953 #4167 iter_move for common_iterator and counted_iterator should return decltype(auto)
    • LWG-3974 #4214 mdspan::operator[] should not copy OtherIndexTypes
    • LWG-4001 #4193 iota_view should provide empty
  • Fixed bugs:
    • Fixed mutex's constructor to be constexpr. #3824 #4000 #4339
      • Note: Programs that aren't following the documented restrictions on binary compatibility may encounter null dereferences in mutex machinery. You must follow this rule:

        When you mix binaries built by different supported versions of the toolset, the Redistributable version must be at least as new as the latest toolset used by any app component.

      • You can define _DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR as an escape hatch.
    • Fixed <format>'s compile-time format string checking:
      • To detect when user-defined formatter specializations reject omitted format specifications like "{}". #4078
      • To require that dynamic width and precision arguments have integral types. #4155
    • Fixed how format() handles empty strings like format("{:a<10}", ""). #4243
    • Fixed <format> to properly handle floating-point values in a specific situation. When a format-specifier appears without any precision or type, shortest round-trip formatting should be used instead of chars_format::general. #4327
      • Example format strings: "{:}" and "{0:}" were affected, as they have an optional arg-id (0) followed by a format-specifier (:) with an empty format-spec (nothing after the :).
      • More common format strings like "{}" and "{0}" were unaffected, as they entirely lack a format-specifier.
      • Example value: For 12345678.0, the shortest round-trip rules produce "12345678", while the chars_format::general rules produce "1.2345678e+07".
    • Fixed <format> to properly handle locale-specific floating-point formatting with a minimum field width, taking digit separators into account. #4421
    • Fixed format() to accept %X and %EX for chrono::duration and chrono::hh_mm_ss. #4250
    • Fixed chrono::duration formatting to respect dynamically provided widths. #4283
    • Fixed crashes and incorrect results in the vectorized implementation of ranges::find with unreachable_sentinel. #4450
      • This fixed regressions that were introduced by #2434 in VS 2022 17.3.
    • Fixed ranges::to to properly reject certain invalid uses with compiler errors, instead of trapping compilers in infinite loops of doom. #4142
    • Fixed ranges::to to accept certain container constructors taking a range followed by more than one argument. #4218
    • Fixed compiler errors involving range adaptor closure objects in unusual scenarios. #4211
    • Fixed ranges::ssize to be conditionally noexcept as required by the Standard. #4231
    • Fixed join_view and join_with_view's iterators to be default constructible. #4264
    • Fixed truncation warnings when using views::repeat. #4255
    • Fixed compiler errors when using views::zip_transform with ranges that must be non-const to be iterated through, such as views::filter. #4416
    • Fixed compiler errors when using views::pairwise_transform and views::adjacent_transform via Standard Library Modules. #4420
    • Fixed incorrect output from iostreams (like "i.nf") when printing infinity and NaN values with setprecision(0) << showpoint << fixed. #4212
    • Fixed problems involving unusual allocators with size types other than size_t:
      • Compiler errors in basic_stringbuf::overflow(). #4219
      • Truncation warnings in basic_stringbuf's constructor, string/vector iterator subtraction, ranges::is_permutation, and allocate_shared(). #4228 #4237 #4252
    • Fixed <atomic> correctness issues for ARM64 CHPE (_M_HYBRID_X86_ARM64). #4222
    • Fixed atomic by adding atomic& operator=(const atomic&) volatile = delete; as required by the Standard. #4287
    • Fixed atomic<shared_ptr>::wait() and atomic<weak_ptr>::wait() to properly detect equivalent smart pointers. #3655
    • Fixed sign-compare warnings in <mdspan> when using extents with different index types. #4227
    • Fixed compiler errors in <mdspan> when constructing unusual mappings. #4236
    • Fixed bugs specific to extremely unusual fancy pointers:
      • Fixed how such vectors interact with ranges algorithms. #4244
      • Fixed how such vectors and basic_strings interact with classic algorithms and iterator spaceship comparisons. #4275
    • Fixed compiler errors when constructing locale{nullptr}. #4245
      • Rejoice, for now you can get a guaranteed runtime_error!
    • Fixed compiler errors when overloading next(), prev(), shift_left(), and shift_right() with concept-constrained functions that should be preferred during overload resolution. #4249
    • Fixed compiler errors when comparing a sub_match with the spaceship operator <=> to a basic_string with a custom traits and/or allocator type. #4253
    • Fixed sequence container constructors to avoid interfering with CTAD (class template argument deduction) for (Iter, Iter, BadAlloc); now this will SFINAE away instead of emitting a hard compiler error. #4254
    • Fixed compiler errors in parallel transform_reduce() when performing narrowing conversions. #4260
      • As usual, asking the STL to perform conversions on your behalf may emit sign/truncation compiler warnings; this is by design.
    • Fixed compiler errors during constexpr evaluation of vector<bool> caused by improper casting in iterator debugging machinery. #4276
    • Fixed compiler errors (by adding a compiler bug workaround) when using constexpr invoke() to call pointers to data members with reference_wrapper arguments. #4277
    • Added macroization defenses for the STL's non-Standard extensions (e.g. type_info's raw_name member function). #4285
    • Fixed ...
Read more

VS 2022 17.9

09 Mar 05:30
900eeac
Compare
Choose a tag to compare
  • Merged C++23 features:
    • P0009R18 #3972 #4037 <mdspan>
      • P2599R2 mdspan: index_type, size_type
      • P2604R0 mdspan: data_handle_type, data_handle(), exhaustive
      • P2613R1 mdspan: empty()
      • P2763R1 Fixing layout_stride's Default Constructor For Fully Static Extents
    • P1169R4 #4053 static operator()
      • This updates CTAD (class template argument deduction) for std::function and packaged_task to work with a C++23 Core Language feature, currently supported for Clang only. When MSVC and IntelliSense implement this Core feature, this will automatically "light up" the STL's CTAD for them too.
  • Merged partial C++23 features:
    • P2286R8 Formatting Ranges:
      • Implemented formatter::set_debug_format(). #3913
      • Implemented formattable, range_format, and format_kind. #4116
  • Merged LWG issue resolutions:
    • LWG-3561 #4066 Issue with internal counter in discard_block_engine
  • Fixed bugs:
    • Fixed incorrect results from iostreams floating-point parsing (e.g. "1e-07" was incorrectly parsed as 1e-06). #3982
      • This fixed a regression that was introduced by #3364 in VS 2022 17.7.
      • We backported this fix to VS 2022 17.8.
    • Fixed compiler errors when using expected together with any. #4013
    • Fixed incorrect behavior when self-move-assigning any, and fixed compiler errors in any involving incomplete types. #3965
    • Fixed bugs in basic_string's copy assignment operator, specific to non-equal propagate_on_container_copy_assignment allocators, involving ASan annotations or fancy pointers. #4031
    • Fixed get() and comparison operators to handle program-defined specializations of array. #4041
    • Fixed compiler errors in to_array() involving incomplete types. #4042
    • Fixed linker errors involving stl_asan.lib by disabling ASan annotations in the STL for unsupported platforms (e.g. ARM, ARM64, ARM64EC). #4058
    • Fixed not_fn() to return a perfect forwarding call wrapper in C++20 mode as required by P0356R5. #4057
    • Fixed deque to preserve its internal invariants when taking advantage of allocators that provide allocate_at_least(). #4017
    • Fixed deque emplace() and insert() to not require elements to be swappable; this change also improved performance. #4022
    • Fixed deque to handle highly unusual fancy pointers. #4049
    • Fixed deque::shrink_to_fit() to avoid requiring the allocator to be default constructible. #4071
    • Fixed allocate_shared() for unbounded arrays to handle fancy pointers. #4074
    • Fixed the implementation of P0408R7 Efficient Access To basic_stringbuf's Buffer to properly destroy fancy pointers. #4047
    • Fixed this_thread::sleep_until() to consistently use the given time_point's clock type, instead of also depending on the system clock. This also fixed this_thread::sleep_for() to consistently use steady_clock. #3914
    • Fixed minor conformance issues in <random>: #4120
      • Removed non-Standard base_type typedefs from discard_block_engine, independent_bits_engine, and shuffle_order_engine.
      • Fixed discard_block_engine(Engine&&) to move-construct the base engine instead of copying it.
  • Improved performance:
    • Optimized the copy(), copy_n(), and move() algorithms for vector<bool> iterators, with speedups varying from 1.8x (times, not percent) to an incredible 3200x, depending on the size and alignment of the bits being copied. #3353 #4045
    • Optimized priority_queue::push_range() for small ranges. #4025
    • Improved debug codegen for deque by using unchecked iterators internally. #4071
    • Optimized basic_string's range constructors to use memmove() for contiguous ranges when possible. #4073
    • Added a vectorized implementation of ranges::find_last. #3925
  • Enhanced behavior:
    • Added debug checks to <valarray> binary operations, verifying that the operands have the same size. #3911
    • Deprecated basic_istream's ipfx()/isfx() and basic_ostream's opfx()/osfx() member functions as they're non-Standard extensions. #4006
    • Added compiler bug workarounds for the upcoming Clang 17 release. #4014
    • Improved the STL's error messages so that error logs will record specific static_asserts like "error STL1000: Unexpected compiler version, expected Clang 16.0.0 or newer." instead of just "Error in C++ Standard Library usage." #4020
    • Silenced /Wall warnings:
      • When building the Standard Library Modules. #4026
      • Warning C4868 "compiler may not enforce left-to-right evaluation order in braced initializer list" throughout the STL. #4067
      • Note: /Wall is not intended for regular production use, as it contains a large number of extremely noisy and low-value warnings. In general, the STL does not attempt to be /Wall clean.
    • Changed num_get::do_get() to tolerate 80-bit long double by removing a static_assert that was added in 2018. #4032
      • Note: 80-bit long double remains unsupported by MSVC.
    • Improved source_location::function_name(): #4055
      • It will return detailed information for Clang 17.
      • Added an "escape hatch" for all compilers: define _USE_DETAILED_FUNCTION_NAME_IN_SOURCE_LOCATION to 0.
      • For example, given template <typename T> void cats() called with cats<vector<int>>(), MSVC's detailed info (implemented in VS 2022 17.6) is "void __cdecl cats<class std::vector<int,class std::allocator<int> >>(void)". Clang 17's detailed info is "void __cdecl cats(void) [T = std::vector<int>]". The escape hatch will return the basic info "cats".
    • Changed the ranges algorithms to be ordinary function objects. #4098
      • For example, this allows code like views::transform(ranges::distance) to compile.
    • Marked internal extern "C" functions as noexcept. #4106 #4150
      • This improves codegen for /EHs (versus /EHsc, where extern "C" already implies noexcept).
  • Improved test coverage:
    • Added an STL-ASan-CI pipeline. #3987 #3989 #4029 #4052 #4068 #4069 #4075
    • The test harness now cleans up emitted files as it runs. #4086
    • Simplified the feature-test macro test. #4103
    • Enabled test coverage for basic_string's ASan annotations when exception handling interacts with the Small String Optimization. #4118
  • Code cleanups:
Read more

VS 2022 17.8

09 Mar 05:29
ab60075
Compare
Choose a tag to compare
  • Merged C++26 features:
    • P2013R5 #3837 Freestanding Language: Optional ::operator new
    • P2198R7 #3837 Freestanding Feature-Test Macros And Implementation-Defined Extensions
    • P2338R4 #3837 Freestanding Library: Character Primitives And The C Library
    • P2538R1 #3822 ADL-Proof projected
  • Merged C++23 features:
  • Merged C++20 extension:
    • The C++23 named modules std and std.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.
  • Merged LWG issue resolutions:
    • LWG-3631 #3745 basic_format_arg(T&&) should use remove_cvref_t<T> throughout
    • LWG-3843 #3737 std::expected<T, E>::value() & assumes E is copy constructible
    • LWG-3893 #3782 LWG-3661 broke atomic<shared_ptr<T>> a; a = nullptr;
    • LWG-3904 #3781 lazy_split_view::outer-iterator's const-converting constructor isn't setting trailing_empty_
  • 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 the char 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 handle time_points 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 via import 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>() on const 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> in constexpr contexts. #3863
    • Improved function call operator overload resolution for the bind(), bind_front(), and bind_back() function objects. #3775
    • Fixed iostreams with imbued locales to print infinities and NaNs correctly. #3868 #3877
    • Fixed incorrect noexcepts within the implementations of filesystem::current_path(), filesystem::current_path(error_code&), read_symlink(const path&), and read_symlink(const path&, error_code&). #3869 #3881
    • Fixed shared_ptr<void> to not be constructible from void*. #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 of snprintf() in extreme situations. #3916
    • Fixed an extremely obscure runtime correctness bug in basic_string's copy assignment operator, specific to non-equal propagate_on_container_copy_assignment allocators. #3862
    • Fixed ASan annotations in basic_string::replace(). #3884
    • Fixed ASan annotations in basic_string::assign() and basic_string::resize_and_overwrite(). #3956
  • Improved performance:
    • Changed some helper member functions to be static, slightly improving debug codegen. #3755
    • mutex and condition_variable now avoid virtual function calls within their implementations. #3770
    • Optimized steady_clock::now() when QueryPerformanceFrequency() is exactly 24 MHz, which is very common for ARM64. #3832
    • Optimized filesystem::path::lexically_normal(). #3850
    • basic_string, basic_stringbuf, basic_syncbuf, deque, and vector now take advantage of allocators that provide allocate_at_least(). #3864 #3891
    • Optimized <format> slightly. #3826
    • Optimized bitset::to_string(). #3838 #3904
    • Added an attribute to as_const(), to_integer(), and to_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 calling size()) to improve debug codegen. #3968
  • Improved throughput:
    • Moved machinery: #3719
      • Moved integer_sequence, make_integer_sequence, index_sequence, make_index_sequence, and index_sequence_for from <type_traits> to <utility>, which is where the Standard provides them.
      • Moved allocator_arg, allocator_arg_t, uses_allocator, and uses_allocator_v so that they're dragged in by slightly fewer headers. (The Standard provides them in <memory>.)
    • 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
  • 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.
    • Strengthened the exception specifications for:
Read more

VS 2022 17.7

09 Mar 05:29
a621095
Compare
Choose a tag to compare
  • Merged C++23 features:
    • P1467R9 #3583 Extended Floating-Point Types
      • Note: This means that we provide the <stdfloat> header containing an empty namespace std {}, as we don't support any optional extended floating-point types.
    • P2093R14 #3337 <print>: Formatted Output
      • P2539R4 Synchronizing print() With The Underlying Stream
    • P2164R9 #3472 views::enumerate
    • P2165R4 #3372 Compatibility Between tuple, pair, And tuple-like Objects
    • P2321R2 zip, completed by implementing:
      • views::adjacent and views::pairwise. #3508
      • views::adjacent_transform and views::pairwise_transform. #3546
    • 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 Of reference_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
  • Merged partial C++23 features:
    • P2286R8 Formatting Ranges:
      • Implemented the ? format specifier for strings and characters. #3656
  • Merged LWG issue resolutions:
    • LWG-2195 #3506 Missing constructors for match_results
    • LWG-2309 #3469 mutex::lock() should not throw device_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 and union 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 misuses cpp17-input-iterator
    • LWG-3734 #3503 Inconsistency in inout_ptr and out_ptr for empty case
    • LWG-3821 #3509 uses_allocator_construction_args should have overload for pair-like
    • LWG-3833 #3477 Remove specialization template<size_t N> struct formatter<const charT[N], charT>
    • LWG-3836 #3587 std::expected<bool, E1> conversion constructor expected(const expected<U, G>&) should take precedence over expected(U&&) with operator bool
    • LWG-3847 #3479 ranges::to can still return views
    • LWG-3851 #3517 chunk_view::inner-iterator missing custom iter_move and iter_swap
    • LWG-3860 #3480 range_common_reference_t is missing
    • LWG-3862 #3471 basic_const_iterator's common_type specialization is underconstrained
    • LWG-3865 #3476 Sorting a range of pairs
      • 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 custom iter_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 for std::expected
    • LWG-3887 #3589 Version macro for allocate_at_least
  • 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 respect pmr::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 involving views::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 literal 0. #3581
    • Fixed bind() function objects to have constrained function call operators, so they interact properly with is_invocable and related scenarios. #3577
    • Reverted #2654 (which affected <future>'s use of <ppltasks.h> in Desktop XAML apps) because it introduced an ole32.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(), and minmax_element(). #3619
      • This also affected ranges::min_element, ranges::max_element, ranges::minmax_element, ranges::min, ranges::max, ranges::minmax, and the min(), max(), and minmax() overloads for initializer_list.
      • This fixed a regression that was introduced by #2447 #2821 #2825 in VS 2022 17.4.
    • Added a compiler bug workaround for MSVC in shared_ptr's operator<=>. #3647
      • This avoids compiler errors when comparing shared_ptr<const int> to shared_ptr<void>.
    • 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-point from_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](...
Read more

VS 2022 17.6

09 Mar 05:28
28a6aab
Compare
Choose a tag to compare
  • Merged C++23 features:
  • Merged partial C++23 features:
    • P2165R4 Compatibility Between tuple, pair, And tuple-like Objects:
    • P2321R2 zip:
      • views::zip_transform. #3322
      • Note: views::adjacent and views::adjacent_transform remain to be implemented.
  • 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 - inconsistent release() in destructor
    • LWG-3629 #3272 make_error_code and make_error_condition are customization points
    • LWG-3646 #3261 std::ranges::view_interface::size returns a signed type
    • LWG-3717 #3266 common_view::end should improve random_access_range case
    • LWG-3736 #3318 move_iterator missing disable_sized_sentinel_for specialization
    • LWG-3737 #3320 take_view::sentinel should provide operator-
    • LWG-3743 #3269 ranges::to's reserve may be ill-formed
    • LWG-3746 #3265 optional's spaceship with U with a type derived from optional 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 missing base accessor
    • LWG-3850 #3423 views::as_const on empty_view<T> should return empty_view<const T>
    • LWG-3853 #3468 basic_const_iterator<volatile int*>::operator-> is ill-formed
  • Merged proposed resolutions for LWG issues (not yet accepted for the C++ Working Draft, but we've chosen to implement this speculatively):
    • LWG-3857 #3348 basic_string_view should allow explicit conversion when only traits vary
    • LWG-3867 #3367 Should std::basic_osyncstream's move assignment operator be noexcept?
  • 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 object meow.exp" (while building meow.exe) when using <stacktrace> or importing the Standard Library Modules.
    • 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.
    • Fixed a binary compatibility break in ppltasks.cpp powering std::async(), which could lead to crashes caused by an invalid_operation exception slamming into noexcept. #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(), and ranges::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 of unsigned int elements should consider the element 0xFFFF'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 when T has a custom visualizer. #3243
    • Fixed compiler warnings when passing long double to copysign(). #3253
    • Re-enabled ASan (Address Sanitizer) annotations in <string> after fixing significant bugs. #3164
      • Also fixed ASan annotations in <vector> that were failing when pmr::vector was used with pmr::monotonic_buffer_resource on x86.
    • Fixed compiler errors when passing ranges types to std::copy(). #3270
    • Fixed shared_future<void>'s move assignment operator to be noexcept 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 that is_signed is true for the STL's internal 128-bit signed-integer-class type. #3291
    • Fixed <stacktrace> to correctly pass SYMOPT_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.
    • Fixed ranges::cbegin, ranges::cend, ranges::crbegin, ranges::crend, and ranges::cdata to behave like their non-const counterparts when given array rvalues. [#3316](https://github.com/microsoft...
Read more

VS 2022 17.5

09 Mar 05:27
c873cf0
Compare
Choose a tag to compare
  • Merged C++23 features:
    • P2322R6 #3099 ranges::fold_left, ranges::fold_right, etc.
    • P2465R3 #3108 Standard Library Modules std And std.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 reference std.ifc and link std.obj. (Similarly for building std.compat.ixx into std.compat.ifc and std.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
  • Merged partial C++23 features:
    • P2278R4 cbegin Should Always Return A Constant Iterator:
      • The "Iterators" section, including basic_const_iterator, make_const_iterator(), and make_const_sentinel(). #3043
    • P2321R2 zip:
      • views::zip. #3035
      • Note: views::zip_transform, views::adjacent, and views::adjacent_transform are the parts that remain to be implemented.
  • Merged LWG issue resolutions:
    • LWG-3711 #2949 Missing preconditions for slide_view constructor
    • LWG-3788 #3130 jthread::operator=(jthread&&) postconditions are unimplementable under self-assignment
  • 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() and piecewise_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, and std::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.
    • Fixed compiler errors in reference_wrapper, thread, and variant involving incomplete types. #3101 #3148
    • When chrono::time_zone::get_info() throws an exception, fixed it to report GetLastError() as intended, instead of "The operation completed successfully." #3122
    • Fixed incorrect results returned by ellint_2(). #3077
    • Fixed error_category's default constructor to be constexpr. #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 a break statement is intentionally omitted between cases". #3162
    • Fixed compiler errors in certain <ranges> scenarios by properly constraining movable-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(), and forward_like() that will allow the MSVC compiler to intrinsically implement them without emitting function calls. #3182
  • Improved throughput:
    • Significantly improved compile times for <variant> visit(). #3070
    • <format> now includes fewer headers. #3128
    • Moved random number generator machinery out of <xutility>, one of the STL's central internal headers. #3157
  • 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
  • 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() and bind_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
  • 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:
    • The PR/CI system now uses spot VMs again. #3071
    • Configured Azure Pipelines to avoid running checks for draft PRs. #3078
    • Added GitHub Actions to allow contributors to move their PR cards in the Code Reviews project. #2584
    • Updated dependencies. #3104 #3155
      • Updated build compiler to VS 2022 17.4 Preview 3.
      • Updated Boost.Math to 1.80.0 (now also used by the MSVC-internal build). #3077
      • Updated Clang to 15.0.1 (now required).
      • Updated CMake to 3.24 (now required).
      • Updated Google Benchmark to 1.7.0. #3151
      • Updated Python to 3.10.8.
  • Updated _MSVC_STL_UPDATE. #3073 #3147

VS 2022 17.4

09 Mar 05:26
af8adfa
Compare
Choose a tag to compare
  • Merged C++23 features:
  • Merged LWG issue resolutions:
    • LWG-3564 #2961 transform_view::iterator<true>::value_type and iterator_category should use const F&
    • LWG-3617 #2966 function/packaged_task deduction guides and deducing this
    • LWG-3656 #2880 Inconsistent bit operations returning a count
    • LWG-3671 #2905 atomic_fetch_xor missing from stdatomic.h
    • LWG-3672 #2907 common_iterator::operator->() should return by value
    • LWG-3683 #2879 operator== for polymorphic_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 of chunk_view for input ranges can be const
    • LWG-3712 #2943 chunk_view and slide_view should not be default_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
  • Merged proposed resolutions for LWG issues (not yet accepted for the C++ Working Draft, but we've chosen to implement this speculatively):
    • LWG-3705 #2741 Hashability shouldn't depend on basic_string's allocator
  • 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 or unsigned long values with formatter. #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") for year_month_day, year_month_day_last, year_month_weekday, and year_month_weekday_last. #2762
    • std::filesystem::directory_entry's constructors, assign(), and replace_filename() now call refresh() as required by the Standard and will propagate any errors (via exceptions or error_codes), 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_points. #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() and allocate_shared(). #2811
    • put_time() (and the time_put::do_put() machinery powering it) now avoids modifying errno 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 print durations with extremely small periods (e.g. femtoseconds, attoseconds). #2814
    • Fixed "istreambuf_iterator is not dereferenceable" assertions when attempting to use time_get::get() or get_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 sets ios_base::failbit | ios_base::eofbit as required by the Standard.
    • ...
Read more

VS 2022 17.3

09 Mar 05:26
60decd0
Compare
Choose a tag to compare
  • Merged C++23 features:
  • Merged partial C++23 features:
    • P2321R2 zip:
      • Changes to tuple, pair, and vector<bool>::reference. #2687
  • Merged LWG issue resolutions:
    • LWG-3121 #2640 tuple constructor constraints for UTypes&&... overloads
    • LWG-3525 #2639 uses_allocator_construction_args fails to handle types convertible to pair
    • LWG-3570 #2418 basic_osyncstream::emit should be an unformatted output function
    • LWG-3571 #2418 flush_emit should set badbit if the emit call fails
  • Merged proposed resolutions for LWG issues (not yet accepted for the C++ Working Draft, but we've chosen to implement this speculatively):
    • LWG-3234 #2703 Sufficient Additional Special Math Overloads
    • LWG-3627 #2607 Inconsistent specifications for std::make_optional overloads
  • Fixed bugs:
    • Fixed vector<bool> to properly invalidate iterators during reallocation, which fixes compiler errors with constexpr usage of vector<bool>. #2441
    • empty_view rvalues are now considered borrowed_ranges as required by the Standard. #2576
    • Added compiler bug workarounds to is_convertible and common_reference, so contiguous_iterator<const volatile int*> is now true. #2592
    • Added missing constraints to functions that were implied by "Effects: Equivalent to" Standardese: make_any(), make_optional(), shared_ptr::operator=(), shared_ptr::reset(), and weak_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
      • This fixed a regression that was introduced by #2000 implementing P1989R2 Range Constructor For string_view in VS 2022 17.0.
    • 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".
    • Fixed an out-of-bounds read in ranges::find() with unreachable_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 of copy_backward() and move_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-point durations. #2638
    • Fixed <bit>'s countl_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() and time_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() and atomic<8-byte type>::store(). #2702
    • Fixed compiler errors in atomic<shared_ptr<T[]>>, atomic<shared_ptr<T[N]>>, atomic<weak_ptr<T[]>>, and atomic<weak_ptr<T[N]>>. #1339
    • Added overloads of <cmath>'s lerp() for arithmetic types. #2113
    • Fixed filesystem::directory_entry to work with FAT32 and exFAT. #2373
    • <filesystem> now handles special system files like hiberfil.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 of copy_options). #2718
    • Fixed the visualizers for shared_ptr<void>, weak_ptr<void>, and unique_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.
    • 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.
  • Improved performance:
    • Optimized rotl() and rotr() 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(), and ranges::count(), with speedups ranging from 2.0x to 27.6x (times, not percent). #2434
    • Slightly improved the performance of <charconv> floating-point from_chars(). #2623
  • Improved throughput:
    • Used if constexpr instead of tag dispatch, overloads, or specializations in:
      • is_permutation(), sample(), rethrow_if_nested(), and default_searcher. #2219
      • <map> and <set>'s common machinery. #2287
      • polymorphic_allocator. #2471
      • basic_string_view and basic_string's find_first_of(), find_last_of(), find_first_not_of(), and find_last_not_of(). #2479 #2660
      • <regex>. #2484
      • Parallel inclusive_scan() and transform_inclusive_scan(). #2662
      • scoped_allocator_adaptor's operator==(). #2677
      • function, move_only_function, and bind(). #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
  • Enhanced behavior:
    • Changed <deque> to use scope guards instead of `thro...
Read more

VS 2022 17.2

09 Mar 05:25
4bb41db
Compare
Choose a tag to compare
  • Merged C++20 Defect Reports:
    • P2216R3 #2221 std::format Improvements
    • P2418R2 #2323 Add Support For std::generator-like Types To std::format
    • With a final bit of work to implement an integer-class type (per P1522R1) for iota_view, declare <ranges> and <format> stable and make them fully available under /std:c++20. #2518
  • Merged C++23 features:
  • Merged LWG issue resolutions:
    • LWG-2762 #2376 unique_ptr operator*() should be noexcept
    • 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 and recursive_directory_iterator are not C++20 ranges
    • LWG-3519 #2208 Incomplete synopses for <random> classes
    • LWG-3543 #2424 Definition of when counted_iterators refer to the same sequence isn't quite right
    • LWG-3557 #2406 The static_cast expression in convertible_to has the wrong operand
    • LWG-3563 #2426 keys_view example is broken
    • LWG-3574 #2410 common_iterator should be completely constexpr-able
    • LWG-3580 #2417 iota_view's iterator's binary operator+ should be improved
    • LWG-3589 #2425 The const lvalue reference overload of get for subrange does not constrain I to be copyable when N == 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 of Pattern
    • LWG-3593 #2448 Several iterators' base() const & and lazy_split_view::outer-iterator::value_type::end() missing noexcept
    • LWG-3595 #2410 Exposition-only classes proxy and postfix-proxy for common_iterator should be fully constexpr
    • 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 for transform_view::iterator
    • LWG-3621 #2543 Remove feature-test macro __cpp_lib_monadic_optional
    • LWG-3648 #2587 format should not print bool with 'c'
    • LWG-3654 #2528 basic_format_context::arg(size_t) should be noexcept
    • 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
  • 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 empty valarrays, which also affected range-based for-loops. #2435
    • Fixed regression in ranges::distance (from LWG-3392 which broke ranges::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 With boolean-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 also 202002L.
    • 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 in hex or scientific 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 consecutive float 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 a const T: it selects T's copy constructor. #2460
    • Fixed a bug in <format> that incorrectly accepted volatile arguments; the Standard currently says that they should be rejected. #2579
  • Improved performance:
    • Optimized rotl() and rotr() in <bit> for 32-bit and 64-bit integers by using compiler intrinsics. [#2369](https:...
Read more