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 Version 16.5
In Visual Studio 2019 version 16.5 we have continued to improve the C++ backend with new features, new and improved optimizations, build throughput improvements, and better security. Here is a brief list of improvements for you to review. For additional optimizations implemented in MSVC in previous releases, check out our MSVC Backend Updates in Visual Studio 2019 Versions 16.3 and 16.4 Do you want to experience the new improvements of the C++ backend? Please download the latest Visual Studio 2019 and give it a try! Any feedback is welcome. We can be reached via the...
New templates for debugging CMake projects on remote systems and WSL in Visual Studio 2019
We heard your feedback that it can be difficult to configure debugging sessions on remote Linux systems or the Windows Subsystem for Linux (WSL). In Visual Studio 2019 version 16.6 Preview 2 we introduced a new debugging template to simplify debugging with gdb. The new cppgdb template We heard your feedback that the old debug configurations were too verbose, too confusing, and not well documented. The new cppgdb configuration has been simplified and looks like this: The new setting debuggerConfiguration indicates which set of debugging default values to use. In Visual Studio 2019 version ...
Porting a C++/CLI Project to .NET Core
One of the new features of Visual Studio 2019 (beginning with version 16.4) and .NET Core 3.1 is the ability to build C++/CLI projects targeting .NET Core. This can be done either directly with cl.exe and link.exe (using the new option) or via MSBuild (using ). In this post, I'll walk through the steps necessary to migrate a simple C++/CLI interop project to .NET Core. More details can be found in .NET Core documentation. The sample project First, I need to make a sample solution to migrate. I'm going to use an app with a native entry point that displays a Windows Forms form via C++/CLI. Migrating a solution w...
Announcing full support for a C/C++ conformant preprocessor in MSVC
Update June 8, 2021: The C11 and C17 announcement post has instructions on how to get the latest Windows SDK that works with the conformant preprocessor. We are excited to announce full support for a conformant preprocessor in the MSVC toolset starting with Visual Studio 2019 version 16.6 Preview 2. Since the original blog post announcing preprocessor conformance changes, we’ve come a long way and are now ready to announce the completion of the C/C++ conformant preprocessor and its move to a non-experimental, fully supported state via the switch. Alongside standard conformance, the preprocessor also suppor...
Doxygen and XML Doc Comment support
Whether you’re using Doxygen or XML Doc Comments, Visual Studio version 16.6 Preview 2 provides automatic comment stub generation as well as Quick Info, Parameter Help, and Member List tooltip support. Stub Generation By default, the stub generation is set to XML Doc Comments. The comment stub can be generated by typing a triple slash (///) or by using the documentation generation shortcut (Ctrl+/) above the function. XML Doc Comment Doxygen To switch to Doxygen, type “Doxygen” in the Ctrl+Q search box, or go to Tools > Options > Text Editor > C/C++ > > General, and choose your preferred doc...
IntelliSense Code Linter for C++
Introducing the IntelliSense Code Linter for C++; a preview of "as-you-type" code analysis with fixups. Try it out today in Visual Studio 2019 16.6 Preview 2.
More Spectre Mitigations in MSVC
In a previous blog post, Microsoft described the Spectre mitigations available under . These mitigations, while not significantly impacting performance, do not protect against all possible speculative load attacks, described in industry research as Load Value Injection. We are now adding two new switches and to provide a more complete mitigation of Spectre attacks based on loads for customers. These switches are only available on x86 and x64 platforms. What do the new switches do? The flag specifies compiler generation of serializing instructions for every load instruction. For most loads, this entails addin...
Analyze your builds programmatically with the C++ Build Insights SDK
We're happy to announce today the release of the C++ Build Insights SDK, a framework that gives you access to MSVC build time information via C and C++ APIs. To accompany this release, we are making vcperf open source on GitHub. Because vcperf itself is built with the SDK, you can use it as a reference when developing your own tools. We’re excited to see what sort of applications you’ll be building with the SDK, and we’re looking forward to receiving your feedback! Background Last November, we introduced vcperf and its Windows Performance Analyzer (WPA) plugin to help MSVC users understand their build times...
The Performance Benefits of Final Classes
The specifier in C++ marks a class or virtual member function as one which cannot be derived from or overriden. For example, consider the following code: If we attempt to write a new class which derives from `derived` then we get a compiler error: The specifier is useful for expressing to readers of the code that a class is not to be derived from and having the compiler enforce this, but it can also improve performance through aiding devirtualization. Devirtualization Virtual functions require an indirect call through the vtable, which is more expensive than a direct call due to interactions with b...