{"id":31800,"date":"2023-02-21T20:45:03","date_gmt":"2023-02-21T20:45:03","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/cppblog\/?p=31800"},"modified":"2023-02-23T11:08:08","modified_gmt":"2023-02-23T11:08:08","slug":"visual-studio-17-5-for-cpp-devs","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/cppblog\/visual-studio-17-5-for-cpp-devs\/","title":{"rendered":"Visual Studio 2022 version 17.5 for C++ Developers"},"content":{"rendered":"<p>We are happy to announce that Visual Studio 2022 version 17.5 is now generally available! This post summarizes the new features you can find in this release for C++. See the <a href=\"https:\/\/devblogs.microsoft.com\/visualstudio\/visual-studio-2022-17-5-released\/\">Visual Studio 17.5 announcement<\/a> to learn about all of the features in the release. You can download Visual Studio 2022 from the <a href=\"https:\/\/visualstudio.microsoft.com\/downloads\/\">Visual Studio downloads page\u00a0<\/a>or upgrade your existing installation by following the<\/p>\n<h2>Contents<\/h2>\n<ul>\n<li><a href=\"#_Toc127193067\">Arm64<\/a><\/li>\n<li><a href=\"#_Toc127193068\">Productivity and Game Development<\/a><\/li>\n<li><a href=\"#_Toc127193072\">Code Safety<\/a><\/li>\n<li><a href=\"#_Toc127193073\">Standards Conformance<\/a><\/li>\n<li><a href=\"#_Toc127193076\">Cross Platform &amp; Embedded<\/a><\/li>\n<\/ul>\n<h2><a name=\"_Toc127193067\"><\/a>Arm64<\/h2>\n<p>In 17.3 you could use Visual Studio as a native Arm64 application. In 17.4 you could use our native Arm64 toolchain in production. Continuing our progress, in 17.5 you can now obtain a native Arm64 Clang toolset with our LLVM workload!<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2023\/02\/vs1.png\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-31832\" src=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2023\/02\/vs1.png\" alt=\"Image vs1\" width=\"297\" height=\"150\" \/><\/a><\/p>\n<h2><a name=\"_Toc127193068\"><\/a>Productivity and Game Development<\/h2>\n<h2><a name=\"_Toc127193069\"><\/a>Build Performance<\/h2>\n<p>One of our highest voted Developer Community tickets was regarding the <a href=\"https:\/\/developercommunity.visualstudio.com\/t\/std::move-and-similar-functions-resu\/1681875\">runtime overhead of functions like std::move and std::forward in debug builds<\/a>. In 17.5 we addressed this issue, making these cast-like functions never produce function calls in generated code, even in debug mode. Depending on your projects, this could noticeably improve performance of your debug builds. This feature is supported by a new attribute, [[msvc::intrinsic]]. It can be applied to non-recursive functions consisting of a single cast, which take only one parameter. You can read more about these changes in <a href=\"https:\/\/devblogs.microsoft.com\/cppblog\/improving-the-state-of-debug-performance-in-c\/\">Improving the State of Debug Performance in C++<\/a>.<\/p>\n<h2><a name=\"_Toc127193070\"><\/a>Developer Productivity<\/h2>\n<p><em>This section used to say that Brace Pair Colorization and Spell Check were available in this release. Unfortunately these are being delayed until 17.6. You can try them out in 17.6 Preview 1 which is <a href=\"https:\/\/visualstudio.microsoft.com\/vs\/preview\/\">now available<\/a>.<\/em><\/p>\n<p>17.5 comes with a host of new productivity features, which are outlined below, and you can learn more about them in <a href=\"https:\/\/devblogs.microsoft.com\/cppblog\/brace-pair-colorization-and-more-in-visual-studio\/\">C++ Brace Pair Colorization and More in Visual Studio<\/a>.<\/p>\n<p>Reimagined Member List is a new experimental feature which puts the members whose types match the current context you are in at the top of the list for easy access. This is currently being rolled out to a subset of users, and we will be exploring this space further in future releases, evaluating more criteria for promoting items to the top of the list.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2023\/02\/text-description-automatically-generated-4.png\"><img decoding=\"async\" class=\"aligncenter size-large wp-image-31824\" src=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2023\/02\/text-description-automatically-generated-4.png\" alt=\"Text Description automatically generated\" width=\"640\" height=\"250\" srcset=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2023\/02\/text-description-automatically-generated-4.png 696w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2023\/02\/text-description-automatically-generated-4-300x117.png 300w\" sizes=\"(max-width: 640px) 100vw, 640px\" \/><\/a><\/p>\n<p>When you hover over a macro, the expanded macro gets displayed in a pop-up. With new formatting and a monospaced font you\u2019ll be able to read the expanded macro much easier. You will also have two new options: to copy the expanded macro to your clipboard, and to replace the macro invocation with its expansion.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2023\/02\/text-description-automatically-generated-5.png\"><img decoding=\"async\" class=\"aligncenter size-large wp-image-31825\" src=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2023\/02\/text-description-automatically-generated-5.png\" alt=\"Text Description automatically generated\" width=\"505\" height=\"212\" srcset=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2023\/02\/text-description-automatically-generated-5.png 505w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2023\/02\/text-description-automatically-generated-5-300x126.png 300w\" sizes=\"(max-width: 505px) 100vw, 505px\" \/><\/a><\/p>\n<p>Visual Studio now has a Spell Checker that helps in making your spelling accurate. This feature checks the spelling of all words inside comments, and names on declarations will be checked by separating camelCase and underscored words. Using quick actions you can then easily select a replacement, or choose to ignore the spelling issue, adding the word to your personal dictionary.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2023\/02\/word-image-31800-5-2.png\"><img decoding=\"async\" class=\"aligncenter size-large wp-image-31826\" src=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2023\/02\/word-image-31800-5-2.png\" alt=\"Image word image 31800 5\" width=\"640\" height=\"185\" srcset=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2023\/02\/word-image-31800-5-2.png 641w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2023\/02\/word-image-31800-5-2-300x87.png 300w\" sizes=\"(max-width: 640px) 100vw, 640px\" \/><\/a><\/p>\n<h2><a name=\"_Toc127193071\"><\/a>Unreal Engine<\/h2>\n<p>You can now view properties from base classes modified in an Unreal Blueprint asset without leaving Visual Studio. Double-click in a Blueprint reference for a C++ class or property to open the UE Asset Inspector.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2023\/02\/word-image-31800-6-2.png\"><img decoding=\"async\" class=\"aligncenter size-large wp-image-31827\" src=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2023\/02\/word-image-31800-6-2.png\" alt=\"Image word image 31800 6\" width=\"640\" height=\"207\" srcset=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2023\/02\/word-image-31800-6-2.png 837w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2023\/02\/word-image-31800-6-2-300x97.png 300w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2023\/02\/word-image-31800-6-2-768x249.png 768w\" sizes=\"(max-width: 640px) 100vw, 640px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<h2><a name=\"_Toc127193072\"><\/a>Code Safety<\/h2>\n<p>If you want less noise when using the Lifetime Checker, you can use the new high-confidence versions of the existing warnings. As of 17.5, the high-confidence warnings are still experimental, but depending on the feedback we might include them in some of the recommended profiles in future versions. You can learn more in <a href=\"https:\/\/devblogs.microsoft.com\/cppblog\/high-confidence-lifetime-checks-in-visual-studio-version-17-5-preview-2\/\">High-confidence Lifetime Checks in Visual Studio version 17.5 Preview 2<\/a>.<\/p>\n<h2><a name=\"_Toc127193073\"><\/a>Standards Conformance<\/h2>\n<h2><a name=\"_Toc127193074\"><\/a>C++23<\/h2>\n<p>We\u2019re continuing our work on standards conformance for C++23, giving you several new standard library features to try out.<\/p>\n<p><code>std::ranges::fold_left<\/code>, <code>fold_right<\/code> and friends define <a href=\"https:\/\/en.wikipedia.org\/wiki\/Fold_(higher-order_function)\">fold<\/a> operations, similar to <code>std::accumulate<\/code>, but more general. For example:<\/p>\n<pre class=\"prettyprint language-default\"><code class=\"language-default\">std::vector&lt;double&gt; v = {0.25, 0.75};\r\nauto sum = ranges::fold_left(v, 0, std::plus());<\/code><\/pre>\n<p><code>std::views::zip<\/code> is a range adaptor for \u201czipping\u201d together multiple ranges, with the Nth element being a tuple of the Nth elements of all the supplied ranges. For example:<\/p>\n<pre class=\"prettyprint language-default\"><code class=\"language-default\">std::vector&lt;std::string&gt; cats { \"marshmallow\", \"milkshake\", \"lexical cat\" };\r\nstd::vector&lt;int&gt; ages { 4, 4, 6 };\r\n\/\/ {{\"marshmallow\", 4}, {\"milkshake\", 4}, {\"lexical cat\", 6}}\r\nstd::views::zip(cats, ages)<\/code><\/pre>\n<p><code>std::format_string<\/code> provides a way to take a compile-time checked format string as a function argument. For example:<\/p>\n<pre class=\"prettyprint language-default\"><code class=\"language-default\">template &lt;typename... Args&gt;\r\nvoid log(std::format_string&lt;Args...&gt; s, Args&amp;&amp;... args) {\r\n\u00a0 \u00a0 if (logging_enabled) {\r\n\u00a0 \u00a0 \u00a0 \u00a0 log_raw(std::format(s, std::forward&lt;Args&gt;(args)...));\r\n\u00a0 \u00a0 }\r\n}\r\n\r\nlog(\"cat {} is {} years old\", cat.name(), cat.age());<\/code><\/pre>\n<p>For more details on what is new and upcoming in the standard library, check out our <a href=\"https:\/\/github.com\/microsoft\/STL\/wiki\/Changelog\">changelog on GitHub<\/a>.<\/p>\n<h2><a name=\"_Toc127193075\"><\/a>C11<\/h2>\n<p>We\u2019re also expanding our C11 optional feature support. You can now use an experimental implementation of C11 atomic primitives (&lt;stdatomic.h&gt;) with the\u00a0<code>\/experimental:c11atomics<\/code>\u00a0flag in\u00a0<code>\/std:c11\u00a0<\/code>mode or later. You can learn more in <a href=\"https:\/\/devblogs.microsoft.com\/cppblog\/c11-atomics-in-visual-studio-2022-version-17-5-preview-2\/\">C11 Atomics in Visual Studio 2022 version 17.5 Preview 2<\/a>.<\/p>\n<p>&nbsp;<\/p>\n<h2><a name=\"_Toc127193076\"><\/a>Cross Platform &amp; Embedded<\/h2>\n<h2><a name=\"_Toc127193077\"><\/a>Linux<\/h2>\n<p>If you are targeting Linux platforms, you can now interact with remote processes with full terminal I\/O with the Visual Studio Integrated Terminal. This lets you debug interactive terminal applications with ease, all from within Visual Studio. Learn more at <a href=\"https:\/\/devblogs.microsoft.com\/cppblog\/debug-linux-console-apps-in-visual-studios-integrated-terminal\/\">Debug Linux Console apps in Visual Studio\u2019s Integrated Terminal<\/a>.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2023\/01\/LinuxConsole.gif\"><img decoding=\"async\" class=\"aligncenter wp-image-31555 size-full\" src=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2023\/01\/LinuxConsole.gif\" alt=\"Linux Console allows input, output, and supports color\" width=\"1706\" height=\"1080\" \/><\/a><\/p>\n<h2><a name=\"_Toc127193078\"><\/a>Embedded<\/h2>\n<p>Concurrent monitoring is now supported in the Serial Monitor. This allows you to monitor multiple ports at the same time, side by side! Press the \u201cOpen an additional monitor\u201d button to get started.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2023\/02\/vs9.png\"><img decoding=\"async\" class=\"aligncenter size-large wp-image-31840\" src=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2023\/02\/vs9.png\" alt=\"Image vs9\" width=\"640\" height=\"360\" srcset=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2023\/02\/vs9.png 752w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2023\/02\/vs9-300x169.png 300w\" sizes=\"(max-width: 640px) 100vw, 640px\" \/><\/a><\/p>\n<h2><a name=\"_Toc127193079\"><\/a>CMake<\/h2>\n<p>If you have multiple CMake targets in one project, you can now select multiple targets to build from the CMake Targets view. Use Ctrl+Click or Shift+Click to select the set of targets you want to build, right click on one of them, and select \u201cBuild Selection\u201d to build them all.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2023\/02\/vs10.png\"><img decoding=\"async\" class=\"aligncenter size-large wp-image-31841\" src=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2023\/02\/vs10.png\" alt=\"Image vs10\" width=\"341\" height=\"198\" srcset=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2023\/02\/vs10.png 341w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2023\/02\/vs10-300x174.png 300w\" sizes=\"(max-width: 341px) 100vw, 341px\" \/><\/a><\/p>\n<p>CMakePresets.json gives you a standard way to express your CMake build configurations which you can easily check in to source control. You can now use CMakePresets.json version 5 in Visual Studio. See the <a href=\"https:\/\/cmake.org\/cmake\/help\/v3.24\/manual\/cmake-presets.7.html\">CMake documentation<\/a> for information on new features.<\/p>\n<p>If you have large test suites, you may want to make the most of all of your hardware to run them as fast as possible. To support this, Test Explorer can now build and test multiple CMake targets in parallel. Enable this with the \u201cRun Tests in Parallel\u201d option.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2023\/02\/vs11.png\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-31842\" src=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2023\/02\/vs11.png\" alt=\"Image vs11\" width=\"456\" height=\"154\" srcset=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2023\/02\/vs11.png 456w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2023\/02\/vs11-300x101.png 300w\" sizes=\"(max-width: 456px) 100vw, 456px\" \/><\/a><\/p>\n<h2><a name=\"_Toc127193080\"><\/a>Developer Containers<\/h2>\n<p>For those of you using Developer Containers, you are now able to run them on a remote Linux Machine, and to open a terminal window into the currently running Developer Container.<\/p>\n<h2><a name=\"_Toc127193081\"><\/a>Send us your feedback<\/h2>\n<p>We are very much interested in your feedback to continue to improve this experience. The comments below are open. Feedback can also be shared through the\u00a0<a href=\"https:\/\/developercommunity.visualstudio.com\/cpp\">Developer Community<\/a>. You can also reach us on Twitter (<a href=\"https:\/\/twitter.com\/visualc\">@VisualC<\/a>), or via email at\u00a0<a href=\"mailto:visualcpp@microsoft.com\">visualcpp@microsoft.com<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>We are happy to announce that Visual Studio 2022 version 17.5 is now generally available! This post summarizes the new features you can find in this release for C++. See the Visual Studio 17.5 announcement to learn about all of the features in the release. You can download Visual Studio 2022 from the Visual Studio [&hellip;]<\/p>\n","protected":false},"author":706,"featured_media":31836,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[270,1],"tags":[],"class_list":["post-31800","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-announcement","category-cplusplus"],"acf":[],"blog_post_summary":"<p>We are happy to announce that Visual Studio 2022 version 17.5 is now generally available! This post summarizes the new features you can find in this release for C++. See the Visual Studio 17.5 announcement to learn about all of the features in the release. You can download Visual Studio 2022 from the Visual Studio [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/posts\/31800","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\/706"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/comments?post=31800"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/posts\/31800\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/media\/31836"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/media?parent=31800"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/categories?post=31800"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/tags?post=31800"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}