Visual Studio 2017 version 15.3 preview is now available, containing an updated Visual C++ toolset (i.e. compiler, linker, and libraries). Like VS 2015’s Updates, we’re adding C++17 features in VS 2017’s Updates, at a similar release frequency. Unlike VS 2015’s Updates (which combined IDE and toolset changes), VS 2017’s IDE is being updated more frequently (with what we’re calling “minor Updates”). That’s why this is the first toolset Update (also called a “foundational Update”).
Here’s the compiler feature table, with some notes. While you can download VS 2017 15.3 preview 1 today, we’ve checked in additional features for Preview 2 which will be released soon. We want to tell you about both sets of features, so features that will be available in Preview 2 (but aren’t available today) are marked as [P2].
C++03/11 Core Language Features |
Status |
Paper |
Notes |
[Everything else] |
VS 2015 |
[A] |
|
Two-phase name lookup |
Partial |
[twoPhase] |
|
Expression SFINAE |
Partial |
[B] |
|
C99 preprocessor |
Partial |
[C] |
|
Extended integer types |
N/A |
[D] |
|
C++14 Core Language Features |
Status |
Paper |
Notes |
Avoiding/fusing allocations |
N/A |
[E] |
|
Tweaked wording for contextual conversions |
VS 2013 |
||
Binary literals |
VS 2015 |
||
auto and decltype(auto) return types |
VS 2015 |
||
init-captures |
VS 2015 |
||
Generic lambdas |
VS 2015 |
||
Variable templates |
VS 2015.2 |
||
Extended constexpr |
VS 2017 |
||
NSDMIs for aggregates |
VS 2017 |
||
[[deprecated]] attribute |
VS 2015 |
||
Sized deallocation |
VS 2015 |
||
Digit separators |
VS 2015 |
||
C++17 Core Language Features |
Status |
Paper |
Notes |
New rules for auto with braced-init-lists |
VS 2015 |
[14] |
|
Terse static_assert |
VS 2017 |
||
typename in template template-parameters |
VS 2015 |
[14] |
|
Removing trigraphs |
VS 2010 |
[14] |
|
Nested namespace definitions |
VS 2015.3 |
||
Fixing qualification conversions |
No |
||
Attributes for namespaces and enumerators |
VS 2015 |
[14] |
|
u8 character literals |
VS 2015 |
[14] |
|
Allowing more non-type template args |
No |
||
Fold expressions |
No |
||
Removing some empty unary folds |
No |
||
Removing the register keyword |
VS 2017.3 |
||
Removing operator++ for bool |
VS 2017.3 |
||
Adding noexcept to the type system |
No |
||
Extended aggregate initialization |
No |
||
Capturing *this by value |
VS 2017.3 |
||
__has_include |
VS 2017.3 [P2] |
[14] |
|
Rewording inheriting constructors |
No |
||
Direct-list-init of fixed enums from integers |
VS 2017.3 |
||
constexpr lambdas |
VS 2017.3 |
||
Generalized range-based for-loops |
VS 2017 |
[14] |
|
[[fallthrough]] attribute |
VS 2017 |
||
[[nodiscard]] attribute |
VS 2017.3 |
||
[[maybe_unused]] attribute |
VS 2017.3 |
||
Hexfloat literals |
No |
||
Using attribute namespaces without repetition |
VS 2017.3 |
||
Over-aligned dynamic memory allocation |
No |
||
Template argument deduction for class templates |
No |
||
Declaring non-type template parameters with auto |
No |
||
Guaranteed copy elision |
VS 2017.3 |
||
Refining expression evaluation order |
No |
||
Structured bindings |
VS 2017.3 |
||
Ignoring unrecognized attributes |
No |
||
constexpr if-statements |
VS 2017.3 [P2] |
[F] |
|
Selection statements with initializers |
VS 2017.3 [P2] |
||
Inline variables |
No |
||
Matching template template-parameters to compatible arguments |
No |
||
Removing dynamic-exception-specifications |
No |
||
Pack expansions in using-declarations |
No |
[A] Except for dynamic exception specifications, which were deprecated in C++11 and mostly removed in C++17. Note that C++17 18.4 [except.spec]/2 says “The noexcept-specifier throw() is deprecated (D.3), and equivalent to the noexcept-specifier noexcept(true).” but VS 2017 version 15.3 preview currently considers throw() to be equivalent to __declspec(nothrow).
[twoPhase] While two-phase name lookup isn’t supported in VS 2017 version 15.3 preview, the compiler team is performing major work behind the scenes. For Preview 2, the /permissive- compiler option will activate partial support for two-phase name lookup (partial meaning roughly 60% complete). We’ll publish a detailed blog post in the future. (edited on May 10 at 3:30 PM Pacific Time for accuracy)
[B] Although Expression SFINAE is partially supported, it’s nearly complete. It was sufficient for the STL back in VS 2015.2, and Expression SFINAE has received further bugfixes for additional libraries like Boost. The most significant remaining deficiency is the need to use unique tag types when performing void_t/decltype Expression SFINAE.
[C] C99 preprocessor support is still partial, in that variadic macros mostly work. We’re planning to overhaul the preprocessor before marking this as complete.
[D] Extended integer types are permitted but not required. Like Clang and GCC, we’ve chosen not to implement any.
[E] Avoiding/fusing allocations is permitted but not required. For the time being, we’ve chosen not to implement this.
[F] Supported under /std:c++14 with “warning C4984: ‘if constexpr’ is a C++17 language extension”. This will allow the STL (in the future) to use “if constexpr” within its implementation.
[14] These features are always enabled, even under /std:c++14.
[P2] These features have been checked in and will be available in VS 2017.3 Preview 2.
Here’s the STL feature table:
Status |
Std |
Paper |
Title |
Notes |
missing |
C++17 |
Changing is_callable/result_of To is_invocable/invoke_result (Options A and B) | ||
missing |
C++17 |
not_fn() | ||
patch |
C++17 |
Fixes For not_fn() | ||
missing |
C++17 |
Deprecating <codecvt> | ||
missing |
C++17 |
Deprecating shared_ptr::unique() | ||
missing |
C++17 |
Deprecating Vestigial Library Parts | ||
missing |
C++17 |
Removing Dynamic Exception Specifications | ||
missing |
C++17 |
Removing Allocator Support In std::function | ||
missing |
C++17 |
Deduction Guides For The STL | ||
missing |
C++17 |
Inline Variables For The STL (Options A and B2) | ||
missing |
C++17 |
has_unique_object_representations | ||
missing |
C++17 |
constexpr For char_traits | ||
missing |
C++17 |
C11 Standard Library | ||
missing |
C++17 |
Rewording enable_shared_from_this | ||
missing |
C++17 |
shared_ptr<T[]>, shared_ptr<T[N]> | ||
patch |
C++17 |
Fixing shared_ptr For Arrays | ||
missing |
C++17 |
Splicing Maps And Sets | ||
patch |
C++17 |
Clarifying insert_return_type | ||
missing |
C++17 |
Elementary String Conversions | ||
… |
C++17 |
Library Fundamentals V1 | ||
missing |
C++17 |
… |
<memory_resource> | |
patch |
C++17 |
Deleting polymorphic_allocator Assignment | ||
missing |
C++17 |
hypot(x, y, z) | ||
missing |
C++17 |
Mathematical Special Functions | ||
missing |
C++17 |
Parallel Algorithms |
[G] |
|
patch |
C++17 |
Renaming Parallel Execution Policies | ||
patch |
C++17 |
Parallel Algorithms Should terminate() For Exceptions | ||
patch |
C++17 |
Unifying <numeric> Parallel Algorithms | ||
missing |
C++17 |
<filesystem> | ||
patch |
C++17 |
Relative Paths For Filesystem | ||
patch |
C++17 |
Directory Entry Caching For Filesystem | ||
patch |
C++17 |
Supporting string_view In Filesystem Paths | ||
patch |
C++17 |
Supporting Non-POSIX Filesystems | ||
patch |
C++17 |
Resolving NB Comments For Filesystem | ||
VS 2017.3 [P2] |
C++17 |
constexpr For <array> (Again) And <iterator> | ||
VS 2017.3 [P2] |
C++17 |
Emplace Return Type | ||
VS 2017.3 [P2] |
C++17 |
gcd(), lcm() | ||
VS 2017.3 [P2] |
C++17 |
std::byte |
[H] |
|
VS 2017.3 [P2] |
C++17 |
Overhauling common_type |
[14] |
|
VS 2017.3 [P2] |
C++17 |
constexpr For <chrono> (Again) | ||
VS 2017.3 [P2] |
C++17 |
Tweaking common_type And duration |
[14] |
|
VS 2017.3 |
C++17 |
… |
Boyer-Moore search() | |
VS 2017.3 |
C++17 |
Extending Memory Management Tools | ||
VS 2017.3 |
C++17 |
atomic::is_always_lock_free | ||
VS 2017.3 |
C++17 |
hardware_destructive_interference_size, etc. | ||
VS 2017.3 |
C++17 |
Renaming Variadic lock_guard To scoped_lock | ||
VS 2017.3 |
C++17 |
Fixing Searcher Return Types | ||
VS 2017.3 |
C++17 |
UDLs For <string_view> (“meow”sv, etc.) | ||
VS 2017.3 |
C++17 |
atomic compare_exchange memory_order Requirements |
[14] |
|
VS 2017.3 |
C++17 |
Poisoning hash |
[14] |
|
VS 2017.3 |
C++17 |
Marking shared_future Copying As noexcept |
[14] |
|
VS 2017.3 |
C++17 |
Constructing future_error From future_errc |
[14] |
|
VS 2017.3 |
C++17 |
Resolving atomic<T> Named Base Class Inconsistencies |
[I] [14] |
|
VS 2017.3 |
C++17 |
noexcept hash |
[14] |
|
VS 2017 |
C++17 |
… |
<algorithm> sample() | |
VS 2017 |
C++17 |
… |
<any> | |
VS 2017 |
C++17 |
… |
<optional> | |
VS 2017 |
C++17 |
… |
<string_view> | |
VS 2017 |
C++17 |
… |
<tuple> apply() | |
VS 2017 |
C++17 |
Homogeneous Interface For variant/any/optional | ||
VS 2017 |
C++17 |
is_callable, is_nothrow_callable | ||
VS 2017 |
C++17 |
<variant> | ||
VS 2017 |
C++17 |
shared_ptr::weak_type | ||
VS 2017 |
C++17 |
make_from_tuple() | ||
VS 2017 |
C++17 |
Integrating string_view And std::string | ||
VS 2017 |
C++17 |
Making Optional Greater Equal Again | ||
VS 2017 |
C++17 |
Making Variant Greater Equal | ||
VS 2017 |
C++17 |
Revisiting in_place_t/in_place_type_t<T>/in_place_index_t<I> | ||
VS 2017 |
C++17 |
Rejecting variants Of Nothing, Arrays, References, And Incomplete Types | ||
VS 2015.3 |
C++17 |
clamp() | ||
VS 2015.3 |
C++17 |
is_swappable, is_nothrow_swappable | ||
VS 2015.3 |
C++17 |
Non-const basic_string::data() | ||
VS 2015.2 |
C++17 |
Improving pair And tuple |
[14] |
|
VS 2015.2 |
C++17 |
shared_mutex (Untimed) |
[14] |
|
VS 2015.2 |
C++17 |
Removing Deprecated Iostreams Aliases |
[J] |
|
VS 2015.2 |
C++17 |
Variable Templates For Type Traits (is_same_v, etc.) |
[14] |
|
VS 2015.2 |
C++17 |
as_const() |
[14] |
|
VS 2015.2 |
C++17 |
Logical Operator Type Traits (conjunction, etc.) |
[14] |
|
VS 2015.2 |
C++17 |
owner_less<> |
[14] |
|
VS 2015.2 |
C++17 |
<chrono> floor(), ceil(), round(), abs() |
[14] |
|
VS 2015.2 |
C++17 |
Variadic lock_guard |
[14] |
|
VS 2015 |
C++17 |
void_t |
[14] |
|
VS 2015 |
C++17 |
Safe Conversions In unique_ptr<T[]> |
[14] |
|
VS 2015 |
C++17 |
invoke() |
[14] |
|
VS 2015 |
C++17 |
Removing auto_ptr, random_shuffle(), And Old <functional> Stuff |
[K] |
|
VS 2015 |
C++17 |
noexcept Cleanups |
[14] |
|
VS 2015 |
C++17 |
uncaught_exceptions() |
[14] |
|
VS 2015 |
C++17 |
Trivially Copyable reference_wrapper |
[14] |
|
VS 2015 |
C++17 |
insert_or_assign()/try_emplace() For map/unordered_map |
[14] |
|
VS 2015 |
C++17 |
size(), empty(), data() |
[14] |
|
VS 2015 |
C++17 |
Precisely Constraining unique_ptr Assignment |
[14] |
|
VS 2015 |
C++17 |
bool_constant |
[14] |
|
VS 2013 |
C++17 |
Supporting Incomplete Types In vector/list/forward_list |
[14] |
|
N/A |
C++17 |
Contiguous Iterators | ||
N/A |
C++17 |
Synopses For The C Library | ||
N/A |
C++17 |
Reserving Namespaces For Future Standardization | ||
N/A |
C++17 |
A <random> Nomenclature Tweak | ||
N/A |
C++17 |
Discouraging memory_order_consume | ||
N/A |
C++17 |
Requiring Forward Iterators In Parallel Algorithms | ||
N/A |
C++17 |
Parallel Algorithms Should terminate() For Exceptions, Usually | ||
N/A |
C++17 |
Correcting Library Usage Of “literal type” | ||
N/A |
C++17 |
Updating “Restrictions on exception handling” | ||
N/A |
C++17 |
Copying Trivially Copy Constructible Elements In Parallel Algorithms | ||
N/A |
C++17 |
Relaxing Complexity Requirements Of Parallel Algorithms (General) | ||
N/A |
C++17 |
Relaxing Complexity Requirements Of Parallel Algorithms (Specific) | ||
N/A |
C++17 |
Final C++17 Parallel Algorithms Fixes |
The “missing” and “patch” papers have been grouped together and should be self-explanatory. The Library Fundamentals V1 paper has been decomposed into individual features marked by “…”. Finally, “N/A” indicates papers that didn’t change normative wording, or that didn’t really result in new features for users. For example, when we implement Parallel Algorithms, we’ll implement the current Standardese. For tracking purposes, P0394R4 (Parallel Algorithms Should terminate() For Exceptions) is important for users and implementers to be aware of, while P0502R0 (Parallel Algorithms Should terminate() For Exceptions, Usually) isn’t (it permits non-Standard execution policies to have different behavior).
[G] Serial for_each_n() will be available in Preview 2.
[H] /std:c++17 and /std:c++latest enable std::byte. It can be disabled by defining _HAS_STD_BYTE to 0.
[I] We’ve implemented the user-visible parts of P0558R1 (Resolving atomic<T> Named Base Class Inconsistencies), except for the signatures of atomic_meow() and atomic_meow_explicit(), which can be observed by taking their addresses or providing explicit template arguments.
[J] /std:c++17 and /std:c++latest remove the old iostreams members. They can be restored by defining _HAS_OLD_IOSTREAMS_MEMBERS to 1.
[K] /std:c++17 and /std:c++latest remove auto_ptr, random_shuffle(), and the old <functional> stuff. They can be restored by defining _HAS_AUTO_PTR_ETC to 1.
We’ve also implemented 29 LWG issue resolutions, fixed several bugs, and made many behind-the-scenes improvements, which we’ll be writing about as we get closer to VS 2017.3’s final release.
Please try out Visual Studio 2017 version 15.3 preview and let us know what you think. (Remember that you must compile with either /std:c++17 or /std:c++latest to enable C++17 features, aside from those marked [14] above – and remember that [P2] features won’t be available until Preview 2.) You can use the IDE’s Report A Problem to report bugs. For compiler and library bugs, it’s important to provide self-contained test cases.
0 comments