{"id":33657,"date":"2024-02-13T20:09:41","date_gmt":"2024-02-13T20:09:41","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/cppblog\/?p=33657"},"modified":"2024-03-06T09:46:29","modified_gmt":"2024-03-06T09:46:29","slug":"whats-new-for-cpp-developers-in-visual-studio-2022-17-9","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/cppblog\/whats-new-for-cpp-developers-in-visual-studio-2022-17-9\/","title":{"rendered":"What&#8217;s New for C++ Developers in Visual Studio 2022 17.9"},"content":{"rendered":"<p>We are happy to announce that Visual Studio 2022 version 17.9 is now generally available! This post summarizes the new features you can find in this release for C++. You can download Visual Studio 2022 from the\u00a0<a href=\"https:\/\/visualstudio.microsoft.com\/downloads\/\" target=\"_blank\" rel=\"noopener\">Visual Studio downloads page\u00a0<\/a>or upgrade your existing installation by following the\u00a0<a href=\"https:\/\/learn.microsoft.com\/en-us\/visualstudio\/install\/update-visual-studio?view=vs-2022\" target=\"_blank\" rel=\"noopener\">Update Visual Studio Learn page<\/a>.<\/p>\n<h2>Standard Library<\/h2>\n<p>We&#8217;re continuing to improve our open source <a href=\"https:\/\/github.com\/microsoft\/STL\">standard library implementation<\/a>. Thank you to everyone who has contributed features and fixes to this release! You can find the full set of changes at the <a href=\"https:\/\/github.com\/microsoft\/STL\/wiki\/Changelog\">STL changelog<\/a>.<\/p>\n<p>The main conformance highlight for this release is the implementation of the <code>&lt;mdspan&gt;<\/code> header. This provides support for multi-dimensional views of data. You can read WG21 paper <a href=\"https:\/\/wg21.link\/P0009R18\" rel=\"nofollow\">P0009R18<\/a> for details and the <a href=\"https:\/\/en.cppreference.com\/w\/cpp\/container\/mdspan\">cppreference page<\/a> for documentation on how to use it.<\/p>\n<p>We&#8217;ve also made progress on the implementation of <a href=\"https:\/\/www.open-std.org\/jtc1\/sc22\/wg21\/docs\/papers\/2022\/p2286r8.html\">P2286 Formatting Ranges<\/a>. This work will continue into version 17.10.<\/p>\n<p>Outside of conformance, you&#8217;ll also find improved performance for some algorithms. For example, we optimized the <code>copy()<\/code>,\u00a0<code>copy_n()<\/code>, and\u00a0<code>move()<\/code>\u00a0algorithms for\u00a0<code>vector&lt;bool&gt;<\/code> iterators, with speedups varying from 1.8x (times, not percent) to 3200x (not a typo), depending on the size and alignment of the bits being copied.<\/p>\n<h2>Core Editor<\/h2>\n<h2>AI Generated Git Commit Messages<\/h2>\n<p>Although developers frequently make Git commits, many often overlook the importance of writing meaningful commit messages. The new generated commit message feature is designed to assist you in describing your changes, ensuring clarity and relevance in your commits.<\/p>\n<p><img decoding=\"async\" width=\"397\" height=\"426\" class=\"wp-image-33658 aligncenter\" src=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2024\/02\/a-screenshot-of-a-computer-program-description-au.png\" alt=\"A screenshot of a computer program Description automatically generated\" srcset=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2024\/02\/a-screenshot-of-a-computer-program-description-au.png 397w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2024\/02\/a-screenshot-of-a-computer-program-description-au-280x300.png 280w\" sizes=\"(max-width: 397px) 100vw, 397px\" \/><\/p>\n<p>To get started, ensure you have an active GitHub Copilot subscription along with the preview GitHub Copilot Chat Extension installed. Simply click the &#8216;Add AI Generated Commit Message&#8217; sparkle pen icon within the Git Changes window for a suggested commit message. GitHub Copilot analyzes your commit&#8217;s file changes, provides a summary, and then offers a descriptive message for each change. Choose to &#8216;Insert AI Suggestion&#8217; or &#8216;Discard&#8217; based on your preference. We welcome your feedback on this feature at <a href=\"https:\/\/aka.ms\/AICommitMessages\"><em>this link<\/em><\/a>. Additionally, the issue related to the icon&#8217;s appearance has been addressed; more information can be found <a href=\"https:\/\/developercommunity.visualstudio.com\/t\/How-do-I-enable-GitHub-Copilot-Commit-Me\/10528699\"><em>here.<\/em><\/a><\/p>\n<h2>Open a Pull Request in Visual Studio or in the Browser<\/h2>\n<p>To support GitHub and Azure DevOps users who prefer to use the browser view for creating pull requests, we&#8217;ve added a secondary link to help maintain current user flows.<\/p>\n<p><img decoding=\"async\" class=\"wp-image-33659 size-medium aligncenter\" src=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2024\/02\/a-screenshot-of-a-computer-description-automatica-4-300x265.png\" alt=\"A screenshot of a computer Description automatically generated\" width=\"300\" height=\"265\" srcset=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2024\/02\/a-screenshot-of-a-computer-description-automatica-4-300x265.png 300w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2024\/02\/a-screenshot-of-a-computer-description-automatica-4-768x679.png 768w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2024\/02\/a-screenshot-of-a-computer-description-automatica-4.png 894w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/p>\n<h2>Responsive Ref Labels in the Git Repository Window<\/h2>\n<p>Your branch and tag labels now resize responsively to make it easier to see which branches you&#8217;re looking at in the Git graph.<\/p>\n<p><img decoding=\"async\" width=\"164\" height=\"77\" class=\"wp-image-33660 aligncenter\" src=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2024\/02\/a-screenshot-of-a-computer-description-automatica.gif\" alt=\"A screenshot of a computer Description automatically generated\" \/><\/p>\n<h2>Multi Project Configuration<\/h2>\n<p>Now, you can easily set up and save profiles for launching specific projects within a multi-project solution for streamlined debugging. Simplify working with complex solutions, enhance debugging efficiency, and effortlessly share configurations with your team.<\/p>\n<p><img decoding=\"async\" width=\"774\" height=\"537\" class=\"wp-image-33661 aligncenter\" src=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2024\/02\/word-image-33657-4.gif\" \/><\/p>\n<h2>Auto Surround with Quotes or Brackets<\/h2>\n<p>You can now easily surround a selection with bracket delimiters including: &#8220;double quotes&#8221;, &#8216;single quotes&#8217;, and (parentheses). Just select an area of code and press the relevant key.<\/p>\n<p><img decoding=\"async\" width=\"767\" height=\"77\" class=\"wp-image-33662 aligncenter\" src=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2024\/02\/word-image-33657-5.gif\" \/><\/p>\n<p>To enable or disable this feature, go to <strong>Tools <\/strong>&gt; <strong>Options <\/strong>&gt; <strong>Text Editor <\/strong>and check the &#8220;Automatically surround selections when typing quotes or brackets&#8221; option.<\/p>\n<h2>Game Development<\/h2>\n<h2>Streamlined Unreal Engine Blueprints References<\/h2>\n<p>Available gradually over the upcoming weeks, you will no longer need the Visual Studio Unreal Engine plugin to see Blueprint References, and Visual Studio will now display CodeLens hints with reduced latency and use fewer machine resources. Additionally, we have added support for including usages of UFUNCTIONs outside of the class hierarchy directly in the CodeLens results. We will cache your results from previous scans and only process new or modified assets since the last scan.<\/p>\n<h2>Improved IntelliSense for Unreal Engine projects<\/h2>\n<p>Unreal Engine uses its own reflection mechanism to connect the worlds of C++ and Blueprints. This is achieved through custom preprocessing of C++ sources with the Unreal Header Tool (UHT) and injection through the regular C++ preprocessor. We have improved the handling of Unreal Engine IntelliSense by ensuring consistency and accuracy. IntelliSense will now refresh more readily for UHT generated files, reducing the likelihood of displaying unwarranted errors.<\/p>\n<h2>Cross Platform<\/h2>\n<h2>Remote Linux Unit Testing<\/h2>\n<p>Based on <a href=\"https:\/\/developercommunity.visualstudio.com\/t\/ctest-support-for-remote-linux-targets\/431771\">your feedback<\/a> we have enabled running unit tests for remote Linux scenarios. Try it out with your C++ projects that target Linux on WSL or remote systems in the Test Explorer. Learn more about how the <a href=\"https:\/\/devblogs.microsoft.com\/cppblog\/azure-networking-team-reaches-peak-productivity-with-visual-studios-new-remote-linux-capabilities-and-improvements\">Azure Networking Team has used remote Linux in Visual Studio<\/a>, including remote unit testing.<\/p>\n<h2><img decoding=\"async\" width=\"1024\" height=\"544\" class=\"wp-image-33663 aligncenter\" src=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2024\/02\/a-screenshot-of-a-computer-description-automatica-5.png\" alt=\"A screenshot of a computer Description automatically generated\" srcset=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2024\/02\/a-screenshot-of-a-computer-description-automatica-5.png 1024w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2024\/02\/a-screenshot-of-a-computer-description-automatica-5-300x159.png 300w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2024\/02\/a-screenshot-of-a-computer-description-automatica-5-768x408.png 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/h2>\n<h2>Specify custom CMake executable<\/h2>\n<p>Visual Studio ships with CMake bundled when you download the Desktop Development with C++ workload. However, you can now specify your own custom CMake executable on your machine if desired. Navigate to <strong>Tools<\/strong> &gt; <strong>Options<\/strong> and select <strong>CMake &gt; General.<\/strong> From here, you can check <strong>Enable custom CMake executable<\/strong> and specify the directory path of your CMake executable you wish to use.<\/p>\n<p><img decoding=\"async\" width=\"1126\" height=\"743\" class=\"wp-image-33664 aligncenter\" src=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2024\/02\/a-screenshot-of-a-computer-description-automatica-6.png\" alt=\"A screenshot of a computer Description automatically generated\" srcset=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2024\/02\/a-screenshot-of-a-computer-description-automatica-6.png 1126w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2024\/02\/a-screenshot-of-a-computer-description-automatica-6-300x198.png 300w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2024\/02\/a-screenshot-of-a-computer-description-automatica-6-1024x676.png 1024w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2024\/02\/a-screenshot-of-a-computer-description-automatica-6-768x507.png 768w\" sizes=\"(max-width: 1126px) 100vw, 1126px\" \/><\/p>\n<h2>Productivity<\/h2>\n<h2>C++ Memory Layout Visualization<\/h2>\n<p>Based on <a href=\"https:\/\/developercommunity.visualstudio.com\/t\/Add-tools-to-display-c-class-memory-la\/392536?q=memory+layout\">your feedback<\/a> we have added the<strong> Memory Layout<\/strong> feature. This feature enables visualization of the memory arrangements for your classes, structs, and unions directly within your editor, removing the need for compilation to view these layouts. When you hover over your types, a \u201cMemory Layout\u201d link will appear within the Quick Info. Clicking this link will open a dedicated window displaying the memory layout of the selected type. Furthermore, hovering over individual data types within this window will provide detailed information about their size and offset within the type.<\/p>\n<p><img decoding=\"async\" class=\"aligncenter wp-image-33665 size-large\" src=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2024\/02\/a-screenshot-of-a-computer-description-automatica-7-980x1024.png\" alt=\"A screenshot of a computer Description automatically generated\" width=\"640\" height=\"669\" srcset=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2024\/02\/a-screenshot-of-a-computer-description-automatica-7-980x1024.png 980w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2024\/02\/a-screenshot-of-a-computer-description-automatica-7-287x300.png 287w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2024\/02\/a-screenshot-of-a-computer-description-automatica-7-768x802.png 768w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2024\/02\/a-screenshot-of-a-computer-description-automatica-7-24x24.png 24w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2024\/02\/a-screenshot-of-a-computer-description-automatica-7.png 1080w\" sizes=\"(max-width: 640px) 100vw, 640px\" \/><\/p>\n<h2>#include Diagnostics<\/h2>\n<p>Visual Studio now introduces <strong>#include Diagnostics<\/strong>, which provides a detailed analysis of your #include directives by displaying their references and build time. Once you turn on this feature, the number of references will be displayed in CodeLens. From there, you can easily navigate to the list of references and locate each reference. To view the build time of your #include directives next to their references, you will need to run Build Insights by navigating to Build &gt; Run Build Insights.<\/p>\n<p><img decoding=\"async\" width=\"1279\" height=\"598\" class=\"wp-image-33666 aligncenter\" src=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2024\/02\/a-screen-shot-of-a-computer-description-automatic.gif\" alt=\"A screen shot of a computer Description automatically generated\" \/><\/p>\n<h2>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\u00a0<a href=\"https:\/\/developercommunity.visualstudio.com\/cpp\" target=\"_blank\" rel=\"noopener\">Visual Studio Developer Community<\/a>. You can also reach us on Twitter (<a href=\"https:\/\/twitter.com\/visualc\" target=\"_blank\" rel=\"noopener\">@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.9 is now generally available! This post summarizes the new features you can find in this release for C++. You can download Visual Studio 2022 from the\u00a0Visual Studio downloads page\u00a0or upgrade your existing installation by following the\u00a0Update Visual Studio Learn page. Standard Library We&#8217;re continuing [&hellip;]<\/p>\n","protected":false},"author":706,"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-33657","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-cplusplus"],"acf":[],"blog_post_summary":"<p>We are happy to announce that Visual Studio 2022 version 17.9 is now generally available! This post summarizes the new features you can find in this release for C++. You can download Visual Studio 2022 from the\u00a0Visual Studio downloads page\u00a0or upgrade your existing installation by following the\u00a0Update Visual Studio Learn page. Standard Library We&#8217;re continuing [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/posts\/33657","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=33657"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/posts\/33657\/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=33657"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/categories?post=33657"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/tags?post=33657"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}