C++ Team Blog
The latest in C++, Visual Studio, VS Code, and vcpkg from the MSFT C++ team
Latest posts
MSVC Backend Updates in Visual Studio 2019 Preview 2: New Optimizations, OpenMP, and Build Throughput improvements
In Visual Studio 2019 Preview 2 we have continued to improve the C++ backend with new features, new and improved optimizations, build throughput improvements, and quality of life changes. New Features New and Improved Optimizations Build Throughput Improvements Quality of Life Improvements We’d love for you to download Visual Studio 2019 and give it a try. As always, we welcome your feedback. We can be reached via the comments below or via email (visualcpp@microsoft.com). ...
Lifetime Profile Update in Visual Studio 2019 Preview 2
The C++ Core Guidelines' Lifetime Profile, which is part of the C++ Core Guidelines, aims to detect lifetime problems, like dangling pointers and references, in C++ code. It uses the type information already present in the source along with some simple contracts between functions to detect defects at compile time with minimal annotation. These are the basic contracts that the profile expects code to follow: For more information on the history and goals of the profile, check out Herb Sutter's blog post about version 1.0. What's New in Visual Studio 2019 Preview 2 In Preview 2, we've shipped a...
Out-of-Process Debugger for C++ in Visual Studio 2019
Visual Studio 2019 Preview 1 introduces an improved debugger for C++ that uses an external 64-bit process for hosting its memory-intensive components. If you’ve experienced memory-related issues while debugging C++ applications before, these issues should now be largely resolved with Visual Studio 2019. Background One of the areas of feedback for the debugger in Visual Studio has been around its high memory usage during debugging of large and complex C++ applications. Most of the memory consumption in this scenario is due to the large amounts of symbol information that the debugger needs to load to show program...
New Start Window and New Project Dialog Experience in Visual Studio 2019
Two features available in Visual Studio 2019 Preview 1 for C++ developers are the start window and a revamped new project dialog. The start window moves the core features from the Visual Studio Start Page, which normally appeared in the editor space when Visual Studio is launched, out into a separate window that appears before the IDE launches. The window includes five main sections: Open recent, Clone or checkout code, Open a project or solution, Open a local folder, Create a new project. It is also possible to continue past the window without opening any code by choosing “Continue without code”. Let’s dig into ...
Using multi-stage containers for C++ development
Updated January 10, 2020: Corrected link to article source that was broken by refactoring in the repo. Containers are a great tool for configuring reproducible build environments. It’s fairly easy to find Dockerfiles that provide various C++ environments. Unfortunately, it is hard to find guidance on how to use newer techniques like multi-stage builds. This post will show you how you can leverage the capabilities of multi-stage containers for your C++ development. This is relevant to anyone doing C++ development regardless what tools you are using. Multi-stage builds are Dockerfiles that use multiple FROM s...
Guaranteed Copy Elision Does Not Elide Copies
This post is also available on Sy Brand's blog C++17 merged in a paper called Guaranteed copy elision through simplified value categories. The changes mandate that no copies or moves take place in some situations where they were previously allowed, e.g.: You can see this behavior in compiler versions Visual Studio 2017 15.6, Clang 4, GCC 7, and above. Despite the name of the paper and what you might read on the Internet, the new rules do not guarantee copy elision. Instead, the new value category rules are defined such that no copy exists in the first place. Understanding this nuance gives a deeper under...
Visual Studio Code C++ extension: October 2018 update and a simplified Insiders program
The October 2018 update of the Visual Studio Code C++ extension has recently shipped. It comes with a ton of bug fixes, improved Go to Definition support, integrated terminal support when debugging, and a simpler way to opt into our extension’s Insiders program. For a detailed list of this release’s improvements, check out the release notes. Go to Definition improvements Go to Definition takes advantage now of the full semantic information coming from the C++ IntelliSense engine. When C++ IntelliSense is enabled (which is the default, and as long as the fallback to Tag Parser does not kick in), you will see imp...
AI-Assisted Code Completion Suggestions Come to C++ via IntelliCode
After reading and writing enough code, you begin to notice certain usage patterns. For example, if a stream is open, it will eventually be closed. More interestingly, if a string is used in the context of an if-statement, it will often be to check if the string is empty or if it has a certain size. You begin to identify and use these coding patterns over time, but what if Visual Studio already knew these common patterns and could suggest them to you as you code? That’s exactly what IntelliCode does. IntelliCode uses machine learning to train over thousands of real-world projects including open-source projects...
Announcing Live Share for C++: Real-Time Sharing and Collaboration
C++ developers using Visual Studio 2019 16.0 Preview 1 or Visual Studio Code can now use Live Share. With Live Share you can share the full context of your code, enabling collaborative editing and debugging. Collaborative Editing: Collaborative Debugging: In a Live Share session there is a host and a guest(s). The host of the session provides the guest with everything it needs to be productive; the guest doesn’t need any of the source files locally. Furthermore, the guest doesn’t need the right compiler, external dependencies, or even the same installed components. The guest even gets IntelliSense fr...