{"id":10175,"date":"2016-08-24T12:38:11","date_gmt":"2016-08-24T19:38:11","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/vcblog\/?p=10175"},"modified":"2019-02-18T18:04:44","modified_gmt":"2019-02-18T18:04:44","slug":"c1417-features-and-stl-fixes-in-vs-15-preview-4","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/cppblog\/c1417-features-and-stl-fixes-in-vs-15-preview-4\/","title":{"rendered":"C++14\/17 Features and STL Fixes in VS &#8220;15&#8221; Preview 4"},"content":{"rendered":"<p><span style=\"font-family:Verdana;font-size:12pt\">Visual Studio &#8220;15&#8221; Preview 4 is <a href=\"https:\/\/devblogs.microsoft.com\/visualstudio\/visual-studio-15-preview-4\/\">now available<\/a>, with a <a href=\"https:\/\/devblogs.microsoft.com\/cppblog\/the-lightweight-visual-studio-15-installer\/\">new installer<\/a>.\u00a0 (VS &#8220;15&#8221; is an IDE version number, not a year.\u00a0 It&#8217;s the next major version after VS 2015, which was IDE version 14.\u00a0 VS has different numbers for its year branding, IDE version, and C++ compiler version.)\n<\/span><\/p>\n<p>\n\u00a0<\/p>\n<p><span style=\"font-family:Verdana;font-size:12pt\">All of the <a href=\"https:\/\/blogs.msdn.microsoft.com\/vcblog\/2016\/08\/12\/stl-fixes-in-vs-2015-update-3\/\">features and fixes<\/a> in VS 2015 Update 3 (including optimizer improvements for std::abs(), std::min(), std::max(), and std::pow(), which we forgot to mention) are also available in VS &#8220;15&#8221; Preview 4.\u00a0 Additionally, we have something new to announce.\u00a0 Previously, new major IDE versions contained new major compiler versions and binary-incompatible STLs (which allowed us to overhaul our data structure representations for correctness and performance).\u00a0 Now that we&#8217;ve been adding features to the compiler and STL since VS 2015 RTM in a highly compatible manner, we&#8217;re going to continue this into the new major IDE version.\u00a0 Specifically, VS 2015 and VS &#8220;15&#8221; will have the same major compiler version (19) and their STLs will be binary-compatible, and this compatible compiler and STL will remain available throughout the lifecycle of VS &#8220;15&#8221;.\u00a0 This implies that the STL&#8217;s DLL will continue to be named msvcp140.dll.\u00a0 (At some point in the future, we expect to have a compiler version 20 and a binary-incompatible STL again.)\n<\/span><\/p>\n<p>\n\u00a0<\/p>\n<p><span style=\"font-family:Verdana;font-size:12pt\">Note that we&#8217;re guaranteeing binary compatibility, not source compatibility.\u00a0 While the <a href=\"https:\/\/devblogs.microsoft.com\/cppblog\/standards-version-switches-in-the-compiler\/\">version switch<\/a> \/std:c++14 (which is the default) will typically preserve source compatibility, it is always possible for bugfixes or Issue resolutions to require source code changes.\u00a0 While we&#8217;re trying to avoid unnecessary source breaking changes, when they&#8217;re necessary they&#8217;ll be documented on MSDN, <a href=\"https:\/\/msdn.microsoft.com\/library\/mt723604.aspx\">as we&#8217;ve been doing<\/a> for VS 2015 Updates.\u00a0 And note that \/std:c++latest will frequently experience source breaking changes, but we&#8217;ll try to document them too (especially in the STL, as we update our implementation to conform to the latest Working Paper, this can sometimes break source code in unexpected ways which we aren&#8217;t immediately aware of, hence the caveat).\n<\/span><\/p>\n<p>\n\u00a0<\/p>\n<p><span style=\"font-family:Verdana;font-size:12pt\">To be clear, this is a good thing for you, our programmer-users.\u00a0 Although the major compiler version is remaining unchanged at 19, we&#8217;re still adding new compiler and STL features.\u00a0 (_MSC_FULL_VER will increase, allowing the updated compiler to be detected.)\u00a0 And the STL binary compatibility means that third-party libraries can be built once and used with both VS 2015 and VS &#8220;15&#8221;.\u00a0 (However, it is still best for everything to be compiled consistently with the latest available version, as that will give you the most correctness and performance.)\u00a0 Now, here&#8217;s what we&#8217;re adding:\n<\/span><\/p>\n<p>\n\u00a0<\/p>\n<p><span style=\"font-family:Verdana;font-size:12pt\"><strong>Compiler Features<\/strong>\n\t\t<\/span><\/p>\n<p>\n\u00a0<\/p>\n<p><span style=\"font-family:Verdana;font-size:12pt\">The C++14 feature <a href=\"https:\/\/na01.safelinks.protection.outlook.com\/?url=http%3a%2f%2fwww.open-std.org%2fjtc1%2fsc22%2fwg21%2fdocs%2fpapers%2f2013%2fn3653.html&amp;data=01%7c01%7cstl%40exchange.microsoft.com%7ce1d21b06275047f9812508d3c6321817%7c72f988bf86f141af91ab2d7cd011db47%7c1&amp;sdata=7QoPuIlHKQ%2blPQ1GG1b7XDTloPHIya9Al450RLcqkoc%3d\">NSDMIs for aggregates<\/a> has been implemented unconditionally by Vinny Romano.\n<\/span><\/p>\n<p>\n\u00a0<\/p>\n<p><span style=\"font-family:Verdana;font-size:12pt\">The C++17 feature <a href=\"https:\/\/na01.safelinks.protection.outlook.com\/?url=http%3a%2f%2fwww.open-std.org%2fjtc1%2fsc22%2fwg21%2fdocs%2fpapers%2f2016%2fp0188r1.pdf&amp;data=01%7c01%7cstl%40exchange.microsoft.com%7ce1d21b06275047f9812508d3c6321817%7c72f988bf86f141af91ab2d7cd011db47%7c1&amp;sdata=dyhk%2fxIOS0JdM%2b1eC2sNPpVbBWWudtrOUSe9bQHV0D0%3d\">[[fallthrough]] attribute<\/a> has been implemented under \/std:c++latest by Shuo Chang.\n<\/span><\/p>\n<p>\n\u00a0<\/p>\n<p><span style=\"font-family:Verdana;font-size:12pt\"><strong>STL Features\n<\/strong><\/span><\/p>\n<p>\n\u00a0<\/p>\n<p><span style=\"font-family:Verdana;font-size:12pt\">The C++17 feature <a href=\"https:\/\/na01.safelinks.protection.outlook.com\/?url=http%3a%2f%2fwww.open-std.org%2fjtc1%2fsc22%2fwg21%2fdocs%2fpapers%2f2016%2fp0220r1.html&amp;data=01%7c01%7cstl%40exchange.microsoft.com%7ce1d21b06275047f9812508d3c6321817%7c72f988bf86f141af91ab2d7cd011db47%7c1&amp;sdata=AGSb7Zcd9m8WWJAAtbTVVu512C2UQ6Re0Nig2T09KJA%3d\">&lt;algorithm&gt; sample()<\/a> has been implemented under \/std:c++latest.\n<\/span><\/p>\n<p>\n\u00a0<\/p>\n<p><span style=\"font-family:Verdana;font-size:12pt\">The C++17 feature <a href=\"https:\/\/na01.safelinks.protection.outlook.com\/?url=http%3a%2f%2fwww.open-std.org%2fjtc1%2fsc22%2fwg21%2fdocs%2fpapers%2f2016%2fp0077r2.html&amp;data=01%7c01%7cstl%40exchange.microsoft.com%7ce1d21b06275047f9812508d3c6321817%7c72f988bf86f141af91ab2d7cd011db47%7c1&amp;sdata=dQ%2bas%2f8oUzDJHSl%2fINmjI7oM3MpJhqdNdEDLzutiww0%3d\">is_callable<\/a> has been implemented under \/std:c++latest.\u00a0 (is_nothrow_callable was blocked by a compiler bug in Preview 4, which has been fixed for the next build.)\n<\/span><\/p>\n<p>\n\u00a0<\/p>\n<p><span style=\"font-family:Verdana;font-size:12pt\"><strong>LWG Issues\n<\/strong><\/span><\/p>\n<p>\n\u00a0<\/p>\n<p><span style=\"font-family:Verdana;font-size:12pt\">The following C++14 Library Issue resolutions have been implemented unconditionally:\n<\/span><\/p>\n<p>\n\u00a0<\/p>\n<ul>\n<li><span style=\"font-family:Verdana;font-size:12pt\">LWG 2135 Unclear requirement for exceptions thrown in condition_variable::wait()\n<\/span><\/li>\n<li><span style=\"font-family:Verdana;font-size:12pt\">LWG 2203 scoped_allocator_adaptor uses wrong argument types for piecewise construction\n<\/span><\/li>\n<li><span style=\"font-family:Verdana;font-size:12pt\">LWG 2210 Missing allocator-extended constructor for allocator-aware containers\n<\/span><\/li>\n<\/ul>\n<p>\n\u00a0<\/p>\n<p><span style=\"font-family:Verdana;font-size:12pt\">The following C++17 Library Issue resolutions have been implemented unconditionally:\n<\/span><\/p>\n<p>\n\u00a0<\/p>\n<ul>\n<li><span style=\"font-family:Verdana;font-size:12pt\">LWG 2063 Contradictory requirements for string move assignment\n<\/span><\/li>\n<li><span style=\"font-family:Verdana;font-size:12pt\">LWG 2219 INVOKE-ing a pointer to member with a reference_wrapper as the object expression\n<\/span><\/li>\n<li><span style=\"font-family:Verdana;font-size:12pt\">LWG 2439 unique_copy() sometimes can&#8217;t fall back to reading its output\n<\/span><\/li>\n<li><span style=\"font-family:Verdana;font-size:12pt\">LWG 2476 scoped_allocator_adaptor is not assignable\n<\/span><\/li>\n<li><span style=\"font-family:Verdana;font-size:12pt\">LWG 2566 Requirements on the first template parameter of container adaptors\n<\/span><\/li>\n<li><span style=\"font-family:Verdana;font-size:12pt\">LWG 2576 istream_iterator and ostream_iterator should use std::addressof\n<\/span><\/li>\n<li><span style=\"font-family:Verdana;font-size:12pt\">LWG 2577 {shared,unique}_lock should use std::addressof\n<\/span><\/li>\n<li><span style=\"font-family:Verdana;font-size:12pt\">LWG 2579 Inconsistency wrt Allocators in basic_string assignment vs. basic_string::assign\n<\/span><\/li>\n<li><span style=\"font-family:Verdana;font-size:12pt\">LWG 2583 There is no way to supply an allocator for basic_string(str, pos)\n<\/span><\/li>\n<li><span style=\"font-family:Verdana;font-size:12pt\">LWG 2586 Wrong value category used in scoped_allocator_adaptor::construct()\n<\/span><\/li>\n<li><span style=\"font-family:Verdana;font-size:12pt\">LWG 2684 priority_queue lacking comparator typedef\n<\/span><\/li>\n<li><span style=\"font-family:Verdana;font-size:12pt\">LWG 2716 Specification of shuffle and sample disallows lvalue URNGs\n<\/span><\/li>\n<\/ul>\n<p>\n\u00a0<\/p>\n<p><span style=\"font-family:Verdana;font-size:12pt\"><strong>STL Fixes<\/strong>\n\t\t<\/span><\/p>\n<p>\n\u00a0<\/p>\n<p><span style=\"font-family:Verdana;font-size:12pt\">Cleaned up _ITERATOR_DEBUG_LEVEL=2 assertions.\u00a0 Now they always emit only one assertion dialog, and they cannot be ignored.\u00a0 (Previously, some but not all assertions emitted two dialogs, and some but not all could be ignored.)\n<\/span><\/p>\n<p>\n\u00a0<\/p>\n<p><span style=\"font-family:Verdana;font-size:12pt\">Further improved support for fancy pointers.\u00a0 Class types imitating pointers while wearing top hats and monocles are now accepted throughout more of the STL.\u00a0 (Fancy pointers, powered by <a href=\"https:\/\/msdn.microsoft.com\/en-us\/library\/jj190031.aspx\">std::pointer_traits<\/a>, are highly advanced and extremely rare.)\n<\/span><\/p>\n<p>\n\u00a0<\/p>\n<p><span style=\"font-family:Verdana;font-size:12pt\">Fixed a regression that was triggering compiler errors when calling uninitialized_copy() on a list\/forward_list containing elements with non-trivial destructors (VSO#233820\/<a href=\"https:\/\/connect.microsoft.com\/VisualStudio\/feedback\/details\/2846868\/\">Connect#2846868<\/a>).\n<\/span><\/p>\n<p>\n\u00a0<\/p>\n<p><span style=\"font-family:Verdana;font-size:12pt\">Fixed all known scoped_allocator bugs: VSO#129349 &#8220;&lt;scoped_allocator&gt;: scoped_allocator is attempting to default construct allocators&#8221;, VSO#146338 &#8220;&lt;scoped_allocator&gt;: error C2512: no appropriate default constructor available&#8221;, and VSO#224478 &#8220;&lt;scoped_allocator&gt;: construction is using true placement new, not OUTERMOST_ALLOC_TRAITS::construct&#8221;.\n<\/span><\/p>\n<p>\n\u00a0<\/p>\n<p><span style=\"font-family:Verdana;font-size:12pt\">Fixed setlocale() memory corruption issues in &lt;filesystem&gt;.\n<\/span><\/p>\n<p>\n\u00a0<\/p>\n<p><span style=\"font-family:Verdana;font-size:12pt\">Fixed broken handling of match_prev_avail, match_not_bol, and match_not_eol in &lt;regex&gt; (VSO#225160\/<a href=\"https:\/\/connect.microsoft.com\/VisualStudio\/feedback\/details\/2745913\/\">Connect#2745913<\/a>, VSO#226914).\n<\/span><\/p>\n<p>\n\u00a0<\/p>\n<p><span style=\"font-family:Verdana;font-size:12pt\">Prevented the CRT from shutting down before std::async() threads have shut down (VSO#225699).\n<\/span><\/p>\n<p>\n\u00a0<\/p>\n<p><span style=\"font-family:Verdana;font-size:12pt\">Billy Robert O&#8217;Neal III &#8211; <a href=\"https:\/\/twitter.com\/malwareminigun\">@MalwareMinigun<\/a> &#8211; <a href=\"mailto:bion@microsoft.com\">bion@microsoft.com<\/a>\n\t\t<\/span><\/p>\n<p><span style=\"font-family:Verdana;font-size:12pt\">Casey Carter &#8211; <a href=\"https:\/\/twitter.com\/codercasey\">@CoderCasey<\/a> &#8211; <a href=\"mailto:cacarter@microsoft.com\">cacarter@microsoft.com<\/a>\n\t\t<\/span><\/p>\n<p><span style=\"font-family:Verdana;font-size:12pt\">Stephan T. Lavavej &#8211; <a href=\"https:\/\/twitter.com\/stephantlavavej\">@StephanTLavavej<\/a> &#8211; <a href=\"mailto:stl@microsoft.com\">stl@microsoft.com<\/a>\n\t\t<\/span><\/p>\n<p><span style=\"font-family:Verdana;font-size:12pt\">Steve Wishnousky &#8211; <a href=\"mailto:stwish@microsoft.com\">stwish@microsoft.com<\/a><\/span>\n\t<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Visual Studio &#8220;15&#8221; Preview 4 is now available, with a new installer.\u00a0 (VS &#8220;15&#8221; is an IDE version number, not a year.\u00a0 It&#8217;s the next major version after VS 2015, which was IDE version 14.\u00a0 VS has different numbers for its year branding, IDE version, and C++ compiler version.) \u00a0 All of the features and [&hellip;]<\/p>\n","protected":false},"author":266,"featured_media":35994,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-10175","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-cplusplus"],"acf":[],"blog_post_summary":"<p>Visual Studio &#8220;15&#8221; Preview 4 is now available, with a new installer.\u00a0 (VS &#8220;15&#8221; is an IDE version number, not a year.\u00a0 It&#8217;s the next major version after VS 2015, which was IDE version 14.\u00a0 VS has different numbers for its year branding, IDE version, and C++ compiler version.) \u00a0 All of the features and [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/posts\/10175","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/users\/266"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/comments?post=10175"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/posts\/10175\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/media\/35994"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/media?parent=10175"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/categories?post=10175"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/tags?post=10175"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}