C++11/14/17 Features In VS 2015 RTM
Stephan T. Lavavej - MSFT
19 Jun 2015 11:47 AM
//z 2015-07-15 08:49:04 L.169'54656 BG57IV3@BYH T3824780732.K.F2506529148[T10,L352,R14,V142]
We're still working on finishing VS 2015 RTM, but we're definitely done with adding new features, so we can publish final feature tables. Let's start with the STL, where we implemented a bunch of stuff after publishing 2015 RC's features in April. Whenever I mention C++17 below, I'm referring to the current Working PaperN4527.
//z 2015-07-15 08:49:04 L.169'54656 BG57IV3@BYH T3824780732.K.F2506529148[T10,L352,R14,V142]
Standard Library
This table of C++14/17 Library features contains new rows for the features that were voted into C++17 in May:
Status |
Std |
Paper |
Title |
missing |
C++14 |
N3462 |
SFINAE-Friendly result_of |
missing |
C++17 |
N4387 |
Improving pair And tuple |
missing |
C++17 |
N4508 |
shared_mutex (Untimed) |
VS 2015 |
C++14 |
N3302 |
constexpr For <complex> |
VS 2015 |
C++14 |
N3469 |
constexpr For <chrono> |
VS 2015 |
C++14 |
N3470 |
constexpr For <array> |
VS 2015 |
C++14 |
N3471 |
constexpr For <initializer_list>, <tuple>, <utility> |
VS 2015 |
C++14 |
N3545 |
integral_constant::operator()() |
VS 2015 |
C++14 |
N3642 |
UDLs For <chrono>, <string> (1729ms, "meow"s, etc.) |
VS 2015 |
C++14 |
N3644 |
Null Forward Iterators |
VS 2015 |
C++14 |
N3654 |
quoted() |
VS 2015 |
C++14 |
N3657 |
Heterogeneous Associative Lookup |
VS 2015 |
C++14 |
N3658 |
integer_sequence |
VS 2015 |
C++14 |
N3659 |
shared_mutex (Timed) |
VS 2015 |
C++14 |
N3668 |
exchange() |
VS 2015 |
C++14 |
N3669 |
Fixing constexpr Member Functions Without const |
VS 2015 |
C++14 |
N3670 |
get<T>() |
VS 2015 |
C++14 |
N3671 |
Dual-Range equal(), is_permutation(), mismatch() |
VS 2015 |
C++14 |
N3778 |
Sized Deallocation |
VS 2015 |
C++14 |
N3779 |
UDLs For <complex> (3.14i, etc.) |
VS 2015 |
C++14 |
N3789 |
constexpr For <functional> |
VS 2015 |
C++14 |
N3887 |
tuple_element_t |
VS 2015 |
C++14 |
N3891 |
Renaming shared_mutex (Timed) To shared_timed_mutex |
VS 2015 |
C++17 |
N3911 |
void_t |
VS 2015 |
C++17 |
N4089 |
Safe Conversions In unique_ptr<T[]> |
VS 2015 |
C++17 |
N4169 |
invoke() |
2015 opt-in |
C++17 |
N4190 |
Removing auto_ptr, random_shuffle(), And Old <functional> Stuff |
VS 2015 |
C++17 |
N4258 |
noexcept Cleanups |
VS 2015 |
C++17 |
N4259 |
uncaught_exceptions() |
VS 2015 |
C++17 |
N4277 |
Trivially Copyable reference_wrapper |
VS 2015 |
C++17 |
N4279 |
insert_or_assign()/try_emplace() For map/unordered_map |
VS 2015 |
C++17 |
N4280 |
size(), empty(), data() |
VS 2015 |
C++17 |
N4366 |
Precisely Constraining unique_ptr Assignment |
VS 2015 |
C++17 |
N4389 |
bool_constant |
VS 2013 |
C++14 |
N3346 |
Minimal Container Element Requirements |
VS 2013 |
C++14 |
N3421 |
Transparent Operator Functors (less<>, etc.) |
VS 2013 |
C++14 |
N3655 |
Alias Templates For <type_traits> (decay_t, etc.) |
VS 2013 |
C++14 |
N3656 |
make_unique() |
VS 2013 |
C++17 |
N4510 |
Supporting Incomplete Types In vector/list/forward_list |
N/A |
C++14 |
N3924 |
Discouraging rand() |
N/A |
C++17 |
N4284 |
Contiguous Iterators |
"2015 opt-in" means that this is guarded by a macro. By default, we provide auto_ptr/etc. If you define _HAS_AUTO_PTR_ETC to 0 project-wide (which you should do via the command line or project file, not via #define), then we won't provide auto_ptr/etc. In the next major version, I'm planning to make this opt-out, and in the major version after that, I'm planning to eliminate auto_ptr/etc. entirely. Now would be a good time to start migrating your code.
"N/A" means that these proposals altered the Standard's wording, but did not physically affect implementers or users. I've listed them as Not Applicable for the sake of completeness.
Here's a detailed summary of our status:
Our C99 Standard Library implementation is complete, except for tgmath.h (which is irrelevant in C++) and the CX_LIMITED_RANGE/FP_CONTRACT pragma macros.
On top of that, our C++11 Standard Library implementation is complete.
On top of that, our C++14 Standard Library implementation is complete, except for Expression SFINAE in result_of (N3462) and std::function (LWG 2132), plus 11 more Library Issues.
On top of that, our C++17-so-far Standard Library implementation is complete, except for pair/tuple improvements (N4387) and untimed shared_mutex (N4508), plus 10 Library Issues.
Any remaining exceptions are bugs. (By the way, we've fixed roughly 160 bugs in the STL between 2013 and 2015. A year ago, I listed thefirst batch of fixes. I'll write about the rest of the fixes soon.) For example, we've implemented every occurrence of constexpr in C++17-so-far's STL, with a very small number of exceptions, which are tracked by DevDiv#1184873/Connect#1414341 and DevDiv#1188232:
- (C99) offsetof
- (C++11) numeric_limits<float/double/long double>::quiet_NaN()/signaling_NaN()
- (C++11) mutex's default constructor
- (C++14) error_category's default constructor
- (C++14) min()/max()/minmax() for initializer_list
- (C++17) min_element()/max_element()/minmax_element()
We've been focused on achieving Standard conformance, which is higher priority than implementing the various Technical Specifications that are being produced by the Committee. (We think TSes are important, but the Standard is even more important.) However, we've implemented a couple of TS things: the Filesystem "V3" TS (N4100) and Uniform Container Erasure (N4529 [container.erasure]).
Core Language
C++11 Core Language Features |
VS 2013 |
VS 2015 |
Notes |
Rvalue references |
Partial |
Yes |
|
ref-qualifiers |
No |
Yes |
|
Non-static data member initializers |
Partial |
Yes |
|
Variadic templates |
Yes |
Yes |
|
Initializer lists |
Partial |
Yes |
|
static_assert |
Yes |
Yes |
|
auto |
Yes |
Yes |
|
Trailing return types |
Yes |
Yes |
|
Lambdas |
Yes |
Yes |
|
decltype |
Yes |
Yes |
|
Right angle brackets |
Yes |
Yes |
|
Default template args for function templates |
Yes |
Yes |
|
Expression SFINAE |
No |
No |
[1] |
Alias templates |
Yes |
Yes |
|
Extern templates |
Yes |
Yes |
|
nullptr |
Yes |
Yes |
|
Strongly typed enums |
Yes |
Yes |
|
Forward declared enums |
Yes |
Yes |
|
Attributes |
No |
Yes |
[RTM] |
constexpr |
No |
Yes |
[RTM] |
Alignment |
Partial |
Yes |
|
Delegating constructors |
Yes |
Yes |
|
Inheriting constructors |
No |
Yes |
|
Explicit conversion operators |
Yes |
Yes |
|
char16_t and char32_t |
No |
Yes |
|
Unicode string literals |
No |
Yes |
|
Raw string literals |
Yes |
Yes |
|
Universal character names in literals |
No |
Yes |
|
User-defined literals |
No |
Yes |
|
Standard-layout and trivial types |
Yes |
Yes |
|
Defaulted and deleted functions |
Partial |
Yes |
|
Extended friend declarations |
Yes |
Yes |
|
Extended sizeof |
No |
Yes |
|
Inline namespaces |
No |
Yes |
|
Unrestricted unions |
No |
Yes |
|
Local and unnamed types as template args |
Yes |
Yes |
|
Range-based for-loop |
Yes |
Yes |
|
override and final |
Yes |
Yes |
|
Minimal GC support |
Yes |
Yes |
|
noexcept |
No |
Yes |
|
C++11 Core Language Features: Concurrency |
VS 2013 |
VS 2015 |
Notes |
Reworded sequence points |
Yes |
Yes |
|
Atomics |
Yes |
Yes |
|
Strong compare and exchange |
Yes |
Yes |
|
Bidirectional fences |
Yes |
Yes |
|
Memory model |
Yes |
Yes |
|
Data-dependency ordering |
Yes |
Yes |
|
Data-dependency ordering: attributes |
No |
Yes |
[RTM] |
exception_ptr |
Yes |
Yes |
|
quick_exit and at_quick_exit |
No |
Yes |
|
Atomics in signal handlers |
Yes |
Yes |
|
Thread-local storage |
Partial |
Yes |
|
Magic statics |
No |
Yes |
|
C++11 Core Language Features: C99 |
VS 2013 |
VS 2015 |
Notes |
__func__ |
Partial |
Yes |
|
C99 preprocessor |
Partial |
Partial |
[2] |
long long |
Yes |
Yes |
|
Extended integer types |
N/A |
N/A |
[3] |
C++14 Core Language Features |
VS 2013 |
VS 2015 |
Notes |
Tweaked wording for contextual conversions |
Yes |
Yes |
|
Binary literals |
No |
Yes |
|
auto and decltype(auto) return types |
No |
Yes |
|
init-captures |
No |
Yes |
|
Generic lambdas |
No |
Yes |
|
Variable templates |
No |
No |
|
Extended constexpr |
No |
No |
|
NSDMIs for aggregates |
No |
No |
|
Avoiding/fusing allocations |
N/A |
N/A |
[4] |
[[deprecated]] attributes |
No |
Yes |
[RTM] |
Sized deallocation |
No |
Yes |
|
Digit separators |
No |
Yes |
|
C++1z (C++17?) Core Language Features |
VS 2013 |
VS 2015 |
Notes |
New rules for auto with braced-init-lists |
No |
Yes |
|
Terse static_assert |
No |
No |
|
typename in template template-parameters |
No |
Yes |
|
Removing trigraphs |
Yes |
Yes |
|
Nested namespace definitions |
No |
No |
|
Fixing qualification conversions |
No |
No |
|
Attributes for namespaces and enumerators |
No |
Yes |
[RTM] |
u8 character literals |
No |
Yes |
[RTM] |
Allowing more non-type template args |
No |
No |
|
Fold expressions |
No |
No |
[RTM] These features were implemented between RC and RTM.
[1] We're planning to start implementing Expression SFINAE in the compiler immediately after 2015 RTM, and we're planning to deliver it in an Update to 2015, supported for production use. (But not necessarily 2015 Update 1. It might take longer.)
[2] C99 preprocessor support is unchanged. It's Partial because while the compiler supports variadic macros, our preprocessor's behavior doesn't conform to C99/C++11 in many ways.
[3] "Extended integer types" are listed as Not Applicable because the Standard permits but doesn't require support for types longer than long long. We've chosen not to support such types, which is conformant behavior. Neither GCCnor Clang has implemented such types.
[4] "Avoiding/fusing allocations" is listed as Not Applicable because the Standard permits but doesn't require this optimization. We've chosen not to implement it (at least for now), which is conformant behavior.
A note about C++11 constexpr: this is a large feature with complicated interactions throughout the Core Language, implemented in a compiler codebase undergoing modernization, being shipped for the first time. It contains bugs/limitations, some of which you might notice, and many of which will be fixed in Updates. (For example, the compiler is currently unable to emit initializers for non-scalar static constexpr data members, including character arrays. This scenario has been blocked with a warning-as-error C4579.) Nevertheless, I've chosen to list the compiler's support for C++11 constexpr as being complete, because the STL is successfully using it, and quite intensively so. (The STL's handful of missing constexpr occurrences are due to library-only issues, the absence of magic compiler hooks, and the absence of C++14 extended constexpr loops.)
Finally, we'd like to thank everyone who's reported bugs during 2015's development cycle, not just in constexpr but throughout the whole product. If you encounter any more bugs, please report them viaMicrosoft Connect or Send A Smile/Frown.
Stephan T. Lavavej
Senior Developer - Visual C++ Libraries
stl@microsoft.com
//z 2015-07-15 08:49:04 L.169'54656 BG57IV3@BYH T3824780732.K.F2506529148[T10,L352,R14,V142]
Visual Studio 2015 | ||
Visual Studio Community 2015 | Chinese-Simplified | 1044F9F4E0EA1304AFECF6780BF599F1DA248DF8 |
Chinese-Traditional | FDBA716E9CE9F27E95D48E773E168BEA2143FE13 | |
German | 503D0B7932E3446AC73272870051981F67D26EAD | |
English | BAAD3CEBAB7A5834D8F78F7D02E4880C010F3BA9 | |
Spanish | 37FBCFDF1B96B145E1AF84447C8F2BBD6195DD55 | |
French | 2A6C0895B80CC3B907B6864AF783491D43F9D00D | |
Italian | 731C517A51AC4A2267A8858BDF032E62486BE553 | |
Japanese | 71C246831BB71C0DB958D106DDC017E6243E8679 | |
Korean | 74A60388637036B567C3CB1F271EAB4C57380F70 | |
Russian | 537D88A9426A50616F5C9A984AE5EF6DD1AC0F25 | |
Visual Studio Enterprise 2015 | Chinese-Simplified | 4FFA1EE3E2D3337D3EDAE550A3583ABE9C426BEF |
Chinese-Traditional | D9B76AC7021CCCCB1E427CF2161C297AA9C820C1 | |
German | 4C68CF9F9BEAA115EC59E243BDEABFC0C6D0C630 | |
English | 07C949078F895CE0D9C03A1B8D55571A8C90AC94 | |
Spanish | C5D4FC9B11AA382154275B25353B0D2E3066BFDB | |
French | 30CFBEEBD7B8A9D5A0C0F77BB795C3CF3EC919A8 | |
Italian | 5B628C17A4373830E05040FAD87B6E53C1139B65 | |
Japanese | D9259F6865F40B3AF97CA598533038C2D1C791FE | |
Korean | 1679D9EB58F9AC7618EBB047B851196B272BB6D8 | |
Russian | 63512D840BB75AFBB3681215C1C9423708213418 | |
Visual Studio Professional 2015 | Chinese-Simplified | 629E7154E2695F08A3C692C0B3F6CE19DF6D3A72 |
Chinese-Traditional | 7F51CBF6BA98D4B40E911A477D9112AFA7F96750 | |
German | B2D324EE239582E98DCD1AAAD6A5B1BC44C3CF3E | |
English | E01F364C3F21CDFCEBB25D3C028398741F08EB24 | |
Spanish | C21AE545E06F6103AAAA740D14D1AD8B625042F1 | |
French | 42DE440DDCDBACEE6B0E44908F2C99781454CFCF | |
Italian | D81D460CF56BCC63C27310382D0F7A9E423A0D2A | |
Japanese | A9651AC6B16D793677E79673F535EC33F11C21BB | |
Korean | ABA778B9B2C307351E6A20DC0084D146A716F677 | |
Russian | 018347CE22CEAB66E31245C699A0522AFE535FC1 | |
Visual Studio Test Professional 2015 | Chinese-Simplified | 437DCB33E1D7F90A70FEDF7C98189C6E5DBFF33B |
Chinese-Traditional | 20E006E3CA5541FB32CEA617C6B13CE34D09687A | |
German | CFCA5C5AD902F5D31B796F36EAE11A9F4F928BFD | |
English | A532B03F4B461DE68F4A86D34F478F2C87F6413D | |
Spanish | 5B8A25DBB42C452497CD4BF8B535EBCFC5AA5C3D | |
French | D30BA530A585C7B26BD2FB9308920E54C328B892 | |
Italian | 359BE52F95B14EA3B0BB60D604B41A829C1E9912 | |
Japanese | D8214E180152AF6DCEF881565AD3817AFC12FBC0 | |
Korean | 2DB9A49F023722EF258B206988973C27F40EABF3 | |
Russian | C2DF22D2C2FE6A9AD5092558082B8A1A30DE0BA0 |
@IS2120#CNBLOGS.T2169364049[T1,L65,R1,V259]:备忘
$ € ₤ ₭ ₪ ₩ ₮ ₦ ₱ ฿ ₡ ₫ ﷼ ¥ ﷼ ₫ ₡ ฿ ₱ ₦ ₮ ₩ ₪ ₭ ₤ € $