C++ Team Blog

C++ tutorials, C and C++ news, and information about Visual Studio, Visual Studio Code, and Vcpkg from the Microsoft C++ team.

Image customCompletion
Custom AI-Assisted IntelliSense for your team

As you’ve been editing code, you may have noticed IntelliCode’s starred recommendations in your autocompletion lists. Our previous IntelliCode blog post explains that these smarter suggestions were machine-learned over thousands of open sourced GitHub repos. Using community knowledge is great for public APIs like the Standard Library,

Image word image
More Spectre Mitigations in MSVC

In a previous blog post, Microsoft described the Spectre mitigations available under /Qspectre. These mitigations, while not significantly impacting performance, do not protect against all possible speculative load attacks. We are now adding two new switches /Qspectre-load and /Qspectre-load-cf to provide a more complete mitigation of Spectre attacks based on loads for customers.

The Qt Company Logo
Qt to support Visual Studio Linux projects

Qt is a popular cross-platform framework for application development and user interface design. Its various libraries and toolsets can be used to create, test, and deploy applications that target multiple platforms and operating systems including Linux, Windows, macOS and embedded/microcontroller systems.

Easily Add, Remove, and Rename Files and Targets in CMake Projects

It’s easier than ever to work with CMake projects in Visual Studio 2019 16.5 Preview 2. Now you can add, remove, and rename source files and targets in your CMake projects from the IDE without manually editing your CMake scripts. When you add or remove files with the Solution Explorer,

Code Navigation for CMake Scripts

Visual Studio 2019 16.5 Preview 2 makes it easy to make sense of complex CMake projects. Code navigation features such as Go To Definition and Find All References are now supported for variables, functions, and targets in CMake script files. This can be a huge timesaver because CMake projects with more than a handful of source files are often organized into several CMake scripts to encapsulate each part of the project.

A screenshot of a computer Description automatically generated
JCC Erratum Mitigation in MSVC

The content of this blog was provided by Gautham Beeraka from Intel Corporation.
Intel recently announced Jump Conditional Code (JCC) Erratum which can occur in some of its processors. The MSVC team has been working with Intel to provide a software fix in the compiler to mitigate the performance impact of the microcode update that prevents the erratum.

MSVC Backend Updates in Visual Studio 2019 Versions 16.3 and 16.4

Versions 16.3 and 16.4 of Visual Studio 2019 brought many new improvements in code generation quality, build throughput, and security. If you still haven’t downloaded your copy, here is a brief overview of what you’ve been missing out on.

Demonstration of C++ Build Insights,

CMake language services, including Peek Definition, in CMakeLists.txt
CMake, Linux targeting, and IntelliSense improvements in Visual Studio 2019 version 16.5 Preview 2

Visual Studio’s native support for CMake allows you to target both Windows and Linux from the comfort of a single IDE. Visual Studio 2019 version 16.5 Preview 2 introduces several new features specific to cross-platform development, including:

File copy optimizations for CMake projects targeting a remote Linux system
Native WSL support when separating your build system from your remote deploy system
The ability to easily add,

Announcement

Image word image
More Spectre Mitigations in MSVC

In a previous blog post, Microsoft described the Spectre mitigations available under /Qspectre. These mitigations, while not significantly impacting performance, do not protect against all possible speculative load attacks. We are now adding two new switches /Qspectre-load and /Qspectre-load-cf to provide a more complete mitigation of Spectre attacks based on loads for customers.

The Qt Company Logo
Qt to support Visual Studio Linux projects

Qt is a popular cross-platform framework for application development and user interface design. Its various libraries and toolsets can be used to create, test, and deploy applications that target multiple platforms and operating systems including Linux, Windows, macOS and embedded/microcontroller systems.

A screenshot of a computer Description automatically generated
JCC Erratum Mitigation in MSVC

The content of this blog was provided by Gautham Beeraka from Intel Corporation.
Intel recently announced Jump Conditional Code (JCC) Erratum which can occur in some of its processors. The MSVC team has been working with Intel to provide a software fix in the compiler to mitigate the performance impact of the microcode update that prevents the erratum.

Improve Parallelism in MSBuild

Starting in Visual Studio 2019 16.3, we have been adding features to improve build parallelism.

MSVC Backend Updates in Visual Studio 2019 Versions 16.3 and 16.4

Versions 16.3 and 16.4 of Visual Studio 2019 brought many new improvements in code generation quality, build throughput, and security. If you still haven’t downloaded your copy, here is a brief overview of what you’ve been missing out on.

Demonstration of C++ Build Insights,

C++ Modules conformance improvements with MSVC in Visual Studio 2019 16.5

C++20 is right around the corner. Along with the new standard comes the much anticipated Modules feature! The compiler team initially announced that we were working on the Modules TS back in 2017 and since then we have been hard at work improving the feature and improving compiler conformance around this feature.

C++ Inliner Improvements: The Zipliner

Visual Studio 2019 versions 16.3 and 16.4 include improvements to the C++ inliner. Among these is the ability to inline some routines after they have been optimized, referred to as the “Zipliner.” Depending on your application, you may see some minor code quality improvements and/or major build-time (compiler throughput) improvements. 

An image of the CMake Tools extension for VS Code, with a project outline to the left and several CMake-specific commands in the command palette.
CMake Tools Extension for Visual Studio Code

Microsoft is now the primary maintainer of the CMake Tools extension for Visual Studio Code. The extension was created and previously maintained by vector-of-bool, who has moved on to other things. Thank you vector-of-bool for all of your hard work getting this extension to where it is today!

EA debugging a unit test on the Windows Subsystem for Linux.
EA and Visual Studio’s Linux Support

EA is using Visual Studio’s cross-platform support to cross-compile on Windows and debug on Linux. The following post is written by Ben May, a Senior Software Engineer of Engineering Workflows at EA. Thanks Ben and EA for your partnership, and for helping us make Visual Studio the best IDE for C++ cross-platform development.

Introducing C++ Build Insights

C++ builds should always be faster. In Visual Studio 2019 16.2, we’ve shown our commitment to this ideal by speeding up the linker significantly. Today, we are thrilled to announce a new collection of tools that will give you the power to make improvements of your own.

C++ Q&A Series

Simplify Your Code With Rocket Science: C++20’s Spaceship Operator

This post is part of a regular series of posts where the C++ product team here at Microsoft and other guests answer questions we have received from customers. The questions can be about anything C++ related: MSVC toolset, the standard language and library,

Guaranteed Copy Elision Does Not Elide Copies

This post is also available on Simon 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

Clang/LLVM Support in Visual Studio

Visual Studio 2019 version 16.1 Preview 2 comes with support for Clang/LLVM out-of-the-box. Visual Studio has had great tooling for MSVC and GCC for quite a while now. The latest preview brings Clang into the fold.
Visual Studio 2019 includes out of the box support for editing,

Install the “Clang compiler for Windows” optional component as part of the “Desktop development with C++” workload.
Visual Studio CMake Support – Clang/LLVM, CMake 3.14, Vcpkg, and Performance Improvements

We’ve introduced a bunch of improvements to our CMake support in the latest preview of Visual Studio 2019 Update 1. The latest release includes Clang/LLVM support, CMake 3.14, better vcpkg integration, and many more enhancements. If you are not familiar with Visual Studio’s CMake support, check out how to get started.

Exploring Clang Tooling Part 3: Rewriting Code with clang-tidy

In the previous post in this series, we used clang-query to examine the Abstract Syntax Tree of a simple source code file. Using clang-query, we can prototype an AST Matcher which we can use in a clang-tidy check to refactor code in bulk.

Exploring Clang Tooling Part 2: Examining the Clang AST with clang-query

This post is part of a regular series of posts where the C++ product team and other guests answer questions we have received from customers. The questions can be about anything C++ related: MSVC toolset, the standard language and library, the C++ standards committee,

Exploring Clang Tooling Part 1: Extending Clang-Tidy

This post is part of a regular series of posts where the C++ product team and other guests answer questions we have received from customers. The questions can be about anything C++ related: MSVC toolset, the standard language and library, the C++ standards committee,

Exploring Clang Tooling, Part 0: Building Your Code with Clang

This post is part of a regular series of posts where the C++ product team and other guests answer questions we have received from customers. The questions can be about anything C++ related: MSVC toolset, the standard language and library, the C++ standards committee,

CMake

'All' CMake commands apply to all folders in the workspace, not just the active folder.
Visual Studio Code CMake Tools Extension: Multi-root workspaces and file-based API

The February 2020 update of the Visual Studio Code CMake Tools extension is now available. This release includes two of the extension’s top feature requests: file-based API support and multi-root workspaces. For a full list of this release’s improvements check out the release notes on GitHub.

Easily Add, Remove, and Rename Files and Targets in CMake Projects

It’s easier than ever to work with CMake projects in Visual Studio 2019 16.5 Preview 2. Now you can add, remove, and rename source files and targets in your CMake projects from the IDE without manually editing your CMake scripts. When you add or remove files with the Solution Explorer,

Code Navigation for CMake Scripts

Visual Studio 2019 16.5 Preview 2 makes it easy to make sense of complex CMake projects. Code navigation features such as Go To Definition and Find All References are now supported for variables, functions, and targets in CMake script files. This can be a huge timesaver because CMake projects with more than a handful of source files are often organized into several CMake scripts to encapsulate each part of the project.

CMake language services, including Peek Definition, in CMakeLists.txt
CMake, Linux targeting, and IntelliSense improvements in Visual Studio 2019 version 16.5 Preview 2

Visual Studio’s native support for CMake allows you to target both Windows and Linux from the comfort of a single IDE. Visual Studio 2019 version 16.5 Preview 2 introduces several new features specific to cross-platform development, including:

File copy optimizations for CMake projects targeting a remote Linux system
Native WSL support when separating your build system from your remote deploy system
The ability to easily add,

CMake Properties to manipulate the remote header copy in the "Advanced" section of the CMake Settings Editor
Improvements to Accuracy and Performance of Linux IntelliSense

This blog post was written by Paul Maybee, a Principal Software Engineer on the C++ Cross-Platform Team. 
Accurate C++ IntelliSense requires access to the C++ headers that are referenced by C++ source files. For Linux scenarios the headers referenced by a Linux MSBuild or CMake project are copied to Windows by Visual Studio from the Linux device (or VM,

Make sure arm-Debug is your active CMake configuration and gdbserver is your active debug configuration.
Debugging Linux CMake Projects with gdbserver

Update 2/20/20: We have addressed a bug which allows you to debug simple CMake projects using one level of CMakeLists.txt files with gdbserver in Visual Studio 2019 version 16.5 Preview 3. The example launch configuration has been updated below.
Gdbserver is a program that allows you to remotely debug applications running on Linux.

Add a new remote connection in Visual Studio, with input fields for host name, port, user name, authentication type, and password.
Build C++ Applications in a Linux Docker Container with Visual Studio

Docker containers provide a consistent development environment for building, testing, and deployment. The virtualized OS, file system, environment settings, libraries, and other dependencies are all encapsulated and shipped as one image that can be shared between developers and machines. This is especially useful for C++ cross-platform developers because you can target a container that runs a different operating system than the one on your development machine.

An image of the CMake Tools extension for VS Code, with a project outline to the left and several CMake-specific commands in the command palette.
CMake Tools Extension for Visual Studio Code

Microsoft is now the primary maintainer of the CMake Tools extension for Visual Studio Code. The extension was created and previously maintained by vector-of-bool, who has moved on to other things. Thank you vector-of-bool for all of your hard work getting this extension to where it is today!

Set Environment Variables for Debug, Launch, and Tools with CMake and Open Folder

There are many reasons why you may want to customize environment variables. Many build systems use environment variables to drive behavior; debug targets sometimes need to have PATH customized to ensure their dependencies are found; etc. Visual Studio has a mechanism to customize environment variables for debugging and building CMake projects and C++ Open Folder.

The launch drop-down menu now displays your most recently used debug targets at the top of the menu.
Usability Improvements for CMake in Visual Studio 2019 version 16.4: Launch Target Selection and Overview Pages

We hear your feedback, and in Visual Studio 2019 version 16.4 Preview 2 we have addressed one of our top Developer Community issues related to CMake development in Visual Studio by revamping the selection of CMake launch targets. We have also added Overview Pages for CMake to help you get started with CMake and cross-platform development.

Containers

Make sure arm-Debug is your active CMake configuration and gdbserver is your active debug configuration.
Debugging Linux CMake Projects with gdbserver

Update 2/20/20: We have addressed a bug which allows you to debug simple CMake projects using one level of CMakeLists.txt files with gdbserver in Visual Studio 2019 version 16.5 Preview 3. The example launch configuration has been updated below.
Gdbserver is a program that allows you to remotely debug applications running on Linux.

Add a new remote connection in Visual Studio, with input fields for host name, port, user name, authentication type, and password.
Build C++ Applications in a Linux Docker Container with Visual Studio

Docker containers provide a consistent development environment for building, testing, and deployment. The virtualized OS, file system, environment settings, libraries, and other dependencies are all encapsulated and shipped as one image that can be shared between developers and machines. This is especially useful for C++ cross-platform developers because you can target a container that runs a different operating system than the one on your development machine.

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.

C++ development with Docker containers in Visual Studio Code

Containers allow developers to package up an application with all the parts it needs, such as libraries and other dependencies, and ship it all out as one image. This is especially useful for C++ cross-platform development – with containers you can choose to target a platform that runs on a completely different operating system than your developer machine.

Using MSVC in a Docker Container for Your C++ Projects

Containers encapsulate the runtime environment of an application: the file system, environment settings, and virtualized OS are bundled into a package. Docker containers have changed the way we think about build and test environments since they were introduced five years ago.

Coroutine

Using C++ Resumable Functions with Libuv

Previously on this blog we have talked about Resumable Functions, and even recently we touched on the renaming of the yield keyword to co_yield in our implementation in Visual Studio 2017. I am very excited about this potential C++ standards feature,

`yield` keyword to become `co_yield` in VS 2017

Coroutines—formerly known as “C++ resumable functions”—are one of the Technical Specifications (TS) that we have implemented in the Visual C++ compiler. We’ve supported coroutines for three years—ever since the VC++ November 2013 CTP release.
If you’re using coroutines you should be aware that the keyword yield is being removed in the release of VS 2017.

Using C++ Coroutines to simplify async UWP code

The Universal Windows Platform (UWP) introduced many async APIs; there are now almost 1700 of them. In fact, the team switched every API that could take 50ms or more to complete to async mode.
Coding with the async pattern is not an easy task,

C++

Image customCompletion
Custom AI-Assisted IntelliSense for your team

As you’ve been editing code, you may have noticed IntelliCode’s starred recommendations in your autocompletion lists. Our previous IntelliCode blog post explains that these smarter suggestions were machine-learned over thousands of open sourced GitHub repos. Using community knowledge is great for public APIs like the Standard Library,

The Qt Company Logo
Qt to support Visual Studio Linux projects

Qt is a popular cross-platform framework for application development and user interface design. Its various libraries and toolsets can be used to create, test, and deploy applications that target multiple platforms and operating systems including Linux, Windows, macOS and embedded/microcontroller systems.

'All' CMake commands apply to all folders in the workspace, not just the active folder.
Visual Studio Code CMake Tools Extension: Multi-root workspaces and file-based API

The February 2020 update of the Visual Studio Code CMake Tools extension is now available. This release includes two of the extension’s top feature requests: file-based API support and multi-root workspaces. For a full list of this release’s improvements check out the release notes on GitHub.

Easily Add, Remove, and Rename Files and Targets in CMake Projects

It’s easier than ever to work with CMake projects in Visual Studio 2019 16.5 Preview 2. Now you can add, remove, and rename source files and targets in your CMake projects from the IDE without manually editing your CMake scripts. When you add or remove files with the Solution Explorer,

Code Navigation for CMake Scripts

Visual Studio 2019 16.5 Preview 2 makes it easy to make sense of complex CMake projects. Code navigation features such as Go To Definition and Find All References are now supported for variables, functions, and targets in CMake script files. This can be a huge timesaver because CMake projects with more than a handful of source files are often organized into several CMake scripts to encapsulate each part of the project.

CMake language services, including Peek Definition, in CMakeLists.txt
CMake, Linux targeting, and IntelliSense improvements in Visual Studio 2019 version 16.5 Preview 2

Visual Studio’s native support for CMake allows you to target both Windows and Linux from the comfort of a single IDE. Visual Studio 2019 version 16.5 Preview 2 introduces several new features specific to cross-platform development, including:

File copy optimizations for CMake projects targeting a remote Linux system
Native WSL support when separating your build system from your remote deploy system
The ability to easily add,

CMake Properties to manipulate the remote header copy in the "Advanced" section of the CMake Settings Editor
Improvements to Accuracy and Performance of Linux IntelliSense

This blog post was written by Paul Maybee, a Principal Software Engineer on the C++ Cross-Platform Team. 
Accurate C++ IntelliSense requires access to the C++ headers that are referenced by C++ source files. For Linux scenarios the headers referenced by a Linux MSBuild or CMake project are copied to Windows by Visual Studio from the Linux device (or VM,

Make sure arm-Debug is your active CMake configuration and gdbserver is your active debug configuration.
Debugging Linux CMake Projects with gdbserver

Update 2/20/20: We have addressed a bug which allows you to debug simple CMake projects using one level of CMakeLists.txt files with gdbserver in Visual Studio 2019 version 16.5 Preview 3. The example launch configuration has been updated below.
Gdbserver is a program that allows you to remotely debug applications running on Linux.

Add a new remote connection in Visual Studio, with input fields for host name, port, user name, authentication type, and password.
Build C++ Applications in a Linux Docker Container with Visual Studio

Docker containers provide a consistent development environment for building, testing, and deployment. The virtualized OS, file system, environment settings, libraries, and other dependencies are all encapsulated and shipped as one image that can be shared between developers and machines. This is especially useful for C++ cross-platform developers because you can target a container that runs a different operating system than the one on your development machine.

An image of the CMake Tools extension for VS Code, with a project outline to the left and several CMake-specific commands in the command palette.
CMake Tools Extension for Visual Studio Code

Microsoft is now the primary maintainer of the CMake Tools extension for Visual Studio Code. The extension was created and previously maintained by vector-of-bool, who has moved on to other things. Thank you vector-of-bool for all of your hard work getting this extension to where it is today!

Diagnostics

Introducing C++ Build Insights

C++ builds should always be faster. In Visual Studio 2019 16.2, we’ve shown our commitment to this ideal by speeding up the linker significantly. Today, we are thrilled to announce a new collection of tools that will give you the power to make improvements of your own.

Linux Development with C++ in Visual Studio 2019: WSL, ASan for Linux, Separation of Build and Debug

In Visual Studio 2019 you can target both Windows and Linux from the comfort of a single IDE. In Visual Studio 2019 version 16.1 Preview 3 we announced several new features specific to the Linux Workload: native support for the Windows Subsystem for Linux (WSL),

AddressSanitizer (ASan) for the Linux Workload in Visual Studio 2019

In Visual Studio 2019 version 16.1 Preview 3 we have integrated AddressSanitizer (ASan) into Visual Studio for Linux projects. ASan is a runtime memory error detector for C/C++ that catches the following errors:

Use after free (dangling pointer reference)
Heap buffer overflow
Stack buffer overflow
Use after return
Use after scope
Initialization order bugs

You can enable ASan for MSBuild-based Linux projects and CMake projects that target a remote Linux system or WSL (Windows Subsystem for Linux).

Step Back – Going Back in C++ Time

Step Back for C++
In the most recent, 15.9, update to Visual Studio 2017 Enterprise Edition, we’ve added “Step Back” for C++ developers targeting Windows 10 Anniversary Update (1607) and later. With this feature, you can now return to a previous state while debugging without having to restart the entire process.

C++ Core Checks in Visual Studio 2017 15.7 Preview 2

This post was written by Sergiy Oryekhov.
The C++ Core Guidelines Check extension received several new rules in Visual Studio 2017 15.7 Preview 2. The primary focus in this iteration was on the checks that would make it easier to adopt utilities from the Guidelines Support Library.

C++ Code Analysis Improvements for Visual Studio 2017 15.7 Preview 1

点这里看中文版
We’re making it easier to configure and use the C++ code analysis features with a set of changes targeting 15.7. In the first 15.7 preview we’ve cleaned up the UI, fixed our documentation links and, most importantly, simplified the way analysis extensions are configured. 

Arithmetic overflow checks in C++ Core Check

点这里看中文版
We’ve improved the C++ Code Analysis toolset with every major compiler update in Visual Studio 2017. Version 15.6, now in Preview, includes a set of arithmetic overflow checks. This article discusses those checks and why you’ll want to enable them in your code.

Image Watch is now available for Visual Studio 2017

点这里看中文版
Image Watch is a Visual Studio extension that provides a watch window for viewing in-memory bitmaps when debugging native C++ code. It comes with built-in support for OpenCV image types (e.g. cv::Mat, cv::Mat_<> , etc.).
We know that, for many of you,

Broken Warnings Theory

Перевод статьи на русском
The “broken warnings theory” is a fictional theory of the norm-setting and signaling effect of coding practices and bug-checking techniques in 3rd party libraries on new bugs and design anti-patterns. The theory states that maintaining and monitoring warning levels to prevent small problems such as “signed/unsigned mismatch”,

Diagnostic Improvements in Visual Studio 2017 15.3.0

This post as well as described diagnostics significantly benefited from the feedback by Mark, Xiang, Stephan, Marian, Gabriel, Ulzii, Steve and Andrew.
Visual Studio 2017 15.3.0 release comes with a number of improvements to the Microsoft Visual C++ compiler’s diagnostics. Most of these improvements are in response to the diagnostics improvements survey we shared with you at the beginning of the 15.3 development cycle.

Documentation

Side-by-side Minor Version MSVC Toolsets in Visual Studio 2019

Visual Studio 2019 version 16.1 Preview 3 ships with the first side-by-side minor versions of the v142 MSVC toolset. We first shipped minor side-by-side versions of MSVC toolsets with Visual Studio 2017, but a few things have changed in 2019. This post covers what’s new;

Using Visual Studio for Cross Platform C++ Development Targeting Windows and Linux

A great strength of C++ is the ability to target multiple platforms without sacrificing performance. If you are using the same codebase for multiple targets, then CMake is the most common solution for building your software. You can use Visual Studio for your C++ cross platform development when using CMake without needing to create or generate Visual Studio projects.

STL Features and Fixes in VS 2017 15.8

15.7 was our first feature complete C++17 library (except floating-point <charconv>), and in 15.8 we have addressed large numbers of outstanding bugs. As usual, we’ve maintained a detailed list of the STL fixes that are available. Visual Studio 2017 15.8 is available at https://visualstudio.microsoft.com/vs/.

Using C++17 Parallel Algorithms for Better Performance

This post is part of a regular series of posts where the C++ product team here at Microsoft and other guests answer questions we have received from customers. The questions can be about anything C++ related: MSVC toolset, the standard language and library,

Shared PCH usage sample in Visual Studio

This post was written by Olga Arkhipova and Xiang Fan
Oftentimes, multiple projects in a Visual Studio solution use the same (or very similar) precompiled headers. As pch files are often big and building them takes a significant amount of time,

Configuring C++ IntelliSense and Browsing

Whether you are creating a new (or modifying an existing) C++ project using a Wizard, or importing an project into Visual Studio from another IDE, it’s important to configure the project correctly for the IntelliSense and Browsing features to provide accurate information. 

Continuous Integration for C++ with Visual Studio Team Services

Visual Studio Team Services (VSTS) is an easy way to help your team manage code and stay connected when developing. VSTS supports continuous integration using a shared code repository that everyone on the team uses to check in code changes. Every time any code is checked in,

Targeting the Windows Subsystem for Linux from Visual Studio

Update Jan. 8, 2020: Visual Studio 2019 version 16.1 and later has native support for WSL. This eliminates the need to establish an SSH connection and is the recommended workflow for building and debugging on WSL.
The Windows Subsystem for Linux (WSL) was first introduced at Build in 2016 and was delivered as an early beta in Windows 10 Anniversary Update.

Visual C++ docs: the future is… soon!

We on the Visual C++ documentation team are pleased to announce some changes to the API reference content in the following Visual C++ libraries: STL, MFC, ATL, AMP, and ConcRT.
Since the beginning of MSDN online, the Visual C++ libraries have documented each class member,

Experimental

Smarter Member List Filtering for C++ 

We are always looking for ways to make you more productive while coding in Visual Studio. In Visual Studio 2019 version 16.2, we have created a smarter, more relevant Member List. Specifically, we now apply method filtering based on type qualifiers.

New Code Analysis Checks in Visual Studio 2019: use-after-move and coroutine

Visual Studio 2019 Preview 2 is an exciting release for the C++ code analysis team. In this release, we shipped a new set of experimental rules that help you catch bugs in your codebase, namely: use-after-move and coroutine checks. This article provides an overview of the new rules and how you can enable them in your project.

MSVC Preprocessor Progress towards Conformance

Why re-write the preprocessor?

Recently, we published a blog post on C++ conformance completion. As mentioned in the blog post, the preprocessor in MSVC is currently getting an overhaul. We are doing this to improve its language conformance, address some of the longstanding bugs that were difficult to fix due to its design and improve its usability and diagnostics.

New, experimental code analysis features in Visual Studio 2017 15.8 Preview 3

The Visual C++ team has been working to refresh our code analysis experience inside Visual Studio. We’re aiming to make these tools both more useful and natural to use and hope that they’ll benefit you no matter your workflow, style, or project type.

Broken Warnings Theory

Перевод статьи на русском
The “broken warnings theory” is a fictional theory of the norm-setting and signaling effect of coding practices and bug-checking techniques in 3rd party libraries on new bugs and design anti-patterns. The theory states that maintaining and monitoring warning levels to prevent small problems such as “signed/unsigned mismatch”,

Precompiled Header (PCH) issues and recommendations

This post written by Mark Hall, Xiang Fan, Yuriy Solodkyy, Bat-Ulzii Luvsanbat, and Andrew Pardoe.
Precompiled headers can reduce your compilation times significantly. They’ve worked reliably for millions of developers since they were introduced 25 years ago to speed up builds of MFC apps.

Clang 3.8 in the May release of Clang with Microsoft CodeGen

This blog post written by Dave Bartolomeo, Yuriy Solodkyy, and Andrew Pardoe
We have just released our fifth out-of-band update of Clang/C2 toolset. As always, this release has been driven by your feedback. While we’ve heard a lot of feature requests the one’s we’ve heard most frequently are that you want Clang 3.8 and you want x64-hosted compilers.

Clang/C2: We need your advice!

The Visual C++ team has shipped three releases of Clang with Microsoft CodeGen (Clang/C2). We’ve got a solid pre-production compiler that passes all of our STL tests and compiles a bunch of code into native Windows binaries. We’ve about to move to the 3.8 release of clang.

Clang with Microsoft CodeGen (January 2016) released

We have just released an out-of-band update of Clang/C2 toolset that brings in some of the community fixes as well as bugs found from testing. This is one of many rapid releases to come in the future, and issues reported from customers will be addressed progressively.

Visual Studio 2015 Update 1: New Experimental Feature – MPX

Introduction
This post is about Intel® Memory Protection Extensions (Intel® MPX) support in Microsoft Visual Studio* 2015; content provided by Gautham Beeraka, George Kuan, and Juan Rodriguez from Intel Corporation.
  
Overview
Update 1 for Visual Studio 2015 was announced on November 30, 2015.

faster

Introducing C++ Build Insights

C++ builds should always be faster. In Visual Studio 2019 16.2, we’ve shown our commitment to this ideal by speeding up the linker significantly. Today, we are thrilled to announce a new collection of tools that will give you the power to make improvements of your own.

Unreal Engine 4 Infiltrator Demo link times
Improved Linker Fundamentals in Visual Studio 2019

On the C++ team we’ve heard loud and clear from users that build times are a pain point. We’ve continued our focus on improving the step, linking, that dominates F5 build times. Fast F5 build times, or iteration build times, are a key contributor to developer productivity and we felt that there was a large opportunity so we narrowed in on changes that we felt could move the needle 2x or more.

developer command prompt launches VS Code workspace folder. In VS Code open a file and right click in the editor window to see the "build and debug active file" menu option. Selecting the menu option starts a debugger session on the active file.
Visual Studio Code C/C++ extension: March 2019 Update

The March 2019 update of the Visual Studio Code C/C++ extension is now available. This release includes many new features and bug fixes, including IntelliSense caching, Build and Debug Active File, and configuration squiggles. For a full list of this release’s improvements,

Linker Throughput Improvement in Visual Studio 2019

In Visual Studio 2019 Preview 2 we made the compiler back-end to prune away debug information that is unrelated to code or data emitted into binary and changed certain hash implementations in the PDB engine, to improve linker throughput, which resulted in more than 2x reduction on link time for some large AAA game title.

Visual Studio 2017 Throughput Improvements and Advice

点这里看中文版
As C++ programs get larger and larger and the optimizer becomes more complex the compiler’s build time, or throughput, increasingly comes into focus. It’s something that needs to be continually addressed as new patterns emerge and take hold (such as “unity”

Faster C++ build cycle in VS 2017 with /Debug:fastlink

Continuing with our goal of further improving developer productivity with Visual Studio 2017 there have been major investments made for also improving incremental developer builds. The developer incremental build is one where a developer changes a single or multiple source files and builds.

Faster C++ solution load with VS 2017

The Visual C++ product has had projects ever since its inception.  Visual C++ had its own IDE up through Visual Studio 6.  Starting in Visual Studio .NET, C++ moved to a new IDE shared by Visual Basic, C#, C++, and other tools. 

General C++ Series

Use of conditionally explicit constructor
C++20’s Conditionally Explicit Constructors

explicit(bool) is a C++20 feature for simplifying the implementation of generic types and improving compile-time performance.
In C++ it is common to write and use types which wrap objects of other types. std::pair and std::optional are two examples, but there are plenty of others in the standard library,

Simplify Your Code With Rocket Science: C++20’s Spaceship Operator

This post is part of a regular series of posts where the C++ product team here at Microsoft and other guests answer questions we have received from customers. The questions can be about anything C++ related: MSVC toolset, the standard language and library,

Output from Sphinx, which is much more compact and attractive
Clear, Functional C++ Documentation with Sphinx + Breathe + Doxygen + CMake

Writing good documentation is hard. Tools can’t solve this problem in themselves, but they can ease the pain. This post will show you how to use Sphinx to generate attractive, functional documentation for C++ libraries, supplied with information from Doxygen. We’ll also integrate this process into a CMake build system so that we have a unified workflow.

Q&A: Fine-grained friendship

This post is part of a regular series of posts where the C++ product team here at Microsoft answers questions we have received from customers. The questions can be about anything C++ related: Visual C++, the standard language and library, the C++ standards committee,

Exploring Clang Tooling Part 3: Rewriting Code with clang-tidy

In the previous post in this series, we used clang-query to examine the Abstract Syntax Tree of a simple source code file. Using clang-query, we can prototype an AST Matcher which we can use in a clang-tidy check to refactor code in bulk.

Exploring Clang Tooling Part 2: Examining the Clang AST with clang-query

This post is part of a regular series of posts where the C++ product team and other guests answer questions we have received from customers. The questions can be about anything C++ related: MSVC toolset, the standard language and library, the C++ standards committee,

Exploring Clang Tooling Part 1: Extending Clang-Tidy

This post is part of a regular series of posts where the C++ product team and other guests answer questions we have received from customers. The questions can be about anything C++ related: MSVC toolset, the standard language and library, the C++ standards committee,

Standard Library Algorithms: Changes and Additions in C++17

Today we have a guest post from Marc Gregoire, Software Architect at Nikon Metrology and Microsoft MVP since 2007.
 
The C++14 standard already contains a wealth of different kinds of algorithms. C++17 adds a couple more algorithms and updates some existing ones.

How to Use Class Template Argument Deduction

Class Template Argument Deduction (CTAD) is a C++17 Core Language feature that reduces code verbosity. C++17’s Standard Library also supports CTAD, so after upgrading your toolset, you can take advantage of this new feature when using STL types like std::pair and std::vector.

std::any: How, when, and why

This post is part of a regular series of posts where the C++ product team here at Microsoft and other guests answer questions we have received from customers. The questions can be about anything C++ related: MSVC toolset, the standard language and library,

IoT

Linux Development with C++ in Visual Studio 2019: WSL, ASan for Linux, Separation of Build and Debug

In Visual Studio 2019 you can target both Windows and Linux from the comfort of a single IDE. In Visual Studio 2019 version 16.1 Preview 3 we announced several new features specific to the Linux Workload: native support for the Windows Subsystem for Linux (WSL),

ARM GCC Cross Compilation in Visual Studio

点这里看中文版
⏱ Updated on January 10, 2018 to cover addition of debugging support in Visual Studio 2017 15.6
In Visual Studio 2017 15.5 we are introduced support for cross compilation targeting ARM microcontrollers. The 15.6 Preview 2 release adds debugging support.

Visual C++ for Linux 1.0.5 Updates

The Visual C++ for Linux announcement post has been updated with the content below. If you are already familiar with this extension this post covers what is new since our last update.
We recently posted new bits for our 1.0.5 release of the Visual C++ for Linux extension for Visual Studio 2015.

Visual C++ for Linux Updates

Updated 6/14/2016: We updated the original announcement post with the content below if you want a single page that covers everything about this extension. The below remains the same and just covers the updates from the original release.
We’re happy to provide an update on the VC++ for Linux extension which has a new release today.

Linux

The Qt Company Logo
Qt to support Visual Studio Linux projects

Qt is a popular cross-platform framework for application development and user interface design. Its various libraries and toolsets can be used to create, test, and deploy applications that target multiple platforms and operating systems including Linux, Windows, macOS and embedded/microcontroller systems.

CMake language services, including Peek Definition, in CMakeLists.txt
CMake, Linux targeting, and IntelliSense improvements in Visual Studio 2019 version 16.5 Preview 2

Visual Studio’s native support for CMake allows you to target both Windows and Linux from the comfort of a single IDE. Visual Studio 2019 version 16.5 Preview 2 introduces several new features specific to cross-platform development, including:

File copy optimizations for CMake projects targeting a remote Linux system
Native WSL support when separating your build system from your remote deploy system
The ability to easily add,

CMake Properties to manipulate the remote header copy in the "Advanced" section of the CMake Settings Editor
Improvements to Accuracy and Performance of Linux IntelliSense

This blog post was written by Paul Maybee, a Principal Software Engineer on the C++ Cross-Platform Team. 
Accurate C++ IntelliSense requires access to the C++ headers that are referenced by C++ source files. For Linux scenarios the headers referenced by a Linux MSBuild or CMake project are copied to Windows by Visual Studio from the Linux device (or VM,

Make sure arm-Debug is your active CMake configuration and gdbserver is your active debug configuration.
Debugging Linux CMake Projects with gdbserver

Update 2/20/20: We have addressed a bug which allows you to debug simple CMake projects using one level of CMakeLists.txt files with gdbserver in Visual Studio 2019 version 16.5 Preview 3. The example launch configuration has been updated below.
Gdbserver is a program that allows you to remotely debug applications running on Linux.

Add a new remote connection in Visual Studio, with input fields for host name, port, user name, authentication type, and password.
Build C++ Applications in a Linux Docker Container with Visual Studio

Docker containers provide a consistent development environment for building, testing, and deployment. The virtualized OS, file system, environment settings, libraries, and other dependencies are all encapsulated and shipped as one image that can be shared between developers and machines. This is especially useful for C++ cross-platform developers because you can target a container that runs a different operating system than the one on your development machine.

EA debugging a unit test on the Windows Subsystem for Linux.
EA and Visual Studio’s Linux Support

EA is using Visual Studio’s cross-platform support to cross-compile on Windows and debug on Linux. The following post is written by Ben May, a Senior Software Engineer of Engineering Workflows at EA. Thanks Ben and EA for your partnership, and for helping us make Visual Studio the best IDE for C++ cross-platform development.

The launch drop-down menu now displays your most recently used debug targets at the top of the menu.
Usability Improvements for CMake in Visual Studio 2019 version 16.4: Launch Target Selection and Overview Pages

We hear your feedback, and in Visual Studio 2019 version 16.4 Preview 2 we have addressed one of our top Developer Community issues related to CMake development in Visual Studio by revamping the selection of CMake launch targets. We have also added Overview Pages for CMake to help you get started with CMake and cross-platform development.

Add a missing vcpkg package with a quick fix in Visual Studio 2019
C++ Cross-Platform Development with Visual Studio 2019 version 16.3: vcpkg, CMake configuration, remote headers, and WSL

In Visual Studio 2019 you can target both Windows and Linux from the comfort of a single IDE. Visual Studio’s native support for CMake lets you open any folder containing C++ code and a CMakeLists.txt file directly in Visual Studio to edit,

Linux Development with C++ in Visual Studio 2019: WSL, ASan for Linux, Separation of Build and Debug

In Visual Studio 2019 you can target both Windows and Linux from the comfort of a single IDE. In Visual Studio 2019 version 16.1 Preview 3 we announced several new features specific to the Linux Workload: native support for the Windows Subsystem for Linux (WSL),

AddressSanitizer (ASan) for the Linux Workload in Visual Studio 2019

In Visual Studio 2019 version 16.1 Preview 3 we have integrated AddressSanitizer (ASan) into Visual Studio for Linux projects. ASan is a runtime memory error detector for C/C++ that catches the following errors:

Use after free (dangling pointer reference)
Heap buffer overflow
Stack buffer overflow
Use after return
Use after scope
Initialization order bugs

You can enable ASan for MSBuild-based Linux projects and CMake projects that target a remote Linux system or WSL (Windows Subsystem for Linux).

Migration DevLab

Binary Compatibility and Pain-free Upgrade: Why Moving to Visual Studio 2017 is almost “too easy”

Visual Studio 2017 is a major leap forward in terms of C++ functionality compared with VS 2015. We hope the new release will delight you in your day-to-day job as soon as you can upgrade.
This blog post focuses on the steps needed to upgrade from Visual Studio 2015 to 2017.

Stuck on an older toolset version? Move to Visual Studio 2017 without upgrading your toolset

⏱ Updated on March 11, 2019 with the latest functionality in Visual Studio 2017
Are you currently developing your C++ projects in an older version of Visual Studio? If your reasons for avoiding the all-new features in VS 2017 are covered next,

Mobile

Android NDK R15C support goes in-box in Visual Studio 2017 Version 15.6 Preview

Visual Studio has provided in-box support for building C++ Android and iOS apps or libraries since VS 2015, enabling cross-platform C++ mobile development with full editing and debugging capabilities all in one single IDE.
Just recently, we updated the tools to make it easier for you to work with newer versions of the Android platform.

New Feature

CMake language services, including Peek Definition, in CMakeLists.txt
CMake, Linux targeting, and IntelliSense improvements in Visual Studio 2019 version 16.5 Preview 2

Visual Studio’s native support for CMake allows you to target both Windows and Linux from the comfort of a single IDE. Visual Studio 2019 version 16.5 Preview 2 introduces several new features specific to cross-platform development, including:

File copy optimizations for CMake projects targeting a remote Linux system
Native WSL support when separating your build system from your remote deploy system
The ability to easily add,

CMake Properties to manipulate the remote header copy in the "Advanced" section of the CMake Settings Editor
Improvements to Accuracy and Performance of Linux IntelliSense

This blog post was written by Paul Maybee, a Principal Software Engineer on the C++ Cross-Platform Team. 
Accurate C++ IntelliSense requires access to the C++ headers that are referenced by C++ source files. For Linux scenarios the headers referenced by a Linux MSBuild or CMake project are copied to Windows by Visual Studio from the Linux device (or VM,

Make sure arm-Debug is your active CMake configuration and gdbserver is your active debug configuration.
Debugging Linux CMake Projects with gdbserver

Update 2/20/20: We have addressed a bug which allows you to debug simple CMake projects using one level of CMakeLists.txt files with gdbserver in Visual Studio 2019 version 16.5 Preview 3. The example launch configuration has been updated below.
Gdbserver is a program that allows you to remotely debug applications running on Linux.

The launch drop-down menu now displays your most recently used debug targets at the top of the menu.
Usability Improvements for CMake in Visual Studio 2019 version 16.4: Launch Target Selection and Overview Pages

We hear your feedback, and in Visual Studio 2019 version 16.4 Preview 2 we have addressed one of our top Developer Community issues related to CMake development in Visual Studio by revamping the selection of CMake launch targets. We have also added Overview Pages for CMake to help you get started with CMake and cross-platform development.

Add a missing vcpkg package with a quick fix in Visual Studio 2019
C++ Cross-Platform Development with Visual Studio 2019 version 16.3: vcpkg, CMake configuration, remote headers, and WSL

In Visual Studio 2019 you can target both Windows and Linux from the comfort of a single IDE. Visual Studio’s native support for CMake lets you open any folder containing C++ code and a CMakeLists.txt file directly in Visual Studio to edit,

Smarter Member List Filtering for C++ 

We are always looking for ways to make you more productive while coding in Visual Studio. In Visual Studio 2019 version 16.2, we have created a smarter, more relevant Member List. Specifically, we now apply method filtering based on type qualifiers.

Box coloring in right side of screenshot where it is outside variable declaration
Visual Studio Code C/C++ Extension: July 2019 Update

The July 2019 update of the Visual Studio Code C/C++ extension is now available. This release includes many new features, including semantic colorization and improvements to the IntelliSense Configuration Settings Editor UI and IntelliSense cache. For a full list of this release’s improvements,

Linux Development with C++ in Visual Studio 2019: WSL, ASan for Linux, Separation of Build and Debug

In Visual Studio 2019 you can target both Windows and Linux from the comfort of a single IDE. In Visual Studio 2019 version 16.1 Preview 3 we announced several new features specific to the Linux Workload: native support for the Windows Subsystem for Linux (WSL),

AddressSanitizer (ASan) for the Linux Workload in Visual Studio 2019

In Visual Studio 2019 version 16.1 Preview 3 we have integrated AddressSanitizer (ASan) into Visual Studio for Linux projects. ASan is a runtime memory error detector for C/C++ that catches the following errors:

Use after free (dangling pointer reference)
Heap buffer overflow
Stack buffer overflow
Use after return
Use after scope
Initialization order bugs

You can enable ASan for MSBuild-based Linux projects and CMake projects that target a remote Linux system or WSL (Windows Subsystem for Linux).

New Code Analysis quick fixes: C6001
New code analysis quick fixes for uninitialized memory (C6001) and use before init (C26494) warnings

In the latest Preview release of Visual Studio 2019 version 16.1, we’ve added two quick fixes to the Code Analysis experience focused around uninitialized variable checks. These quick fixes are available via the Quick Actions (lightbulb) menu on relevant lines, accessed by hovering over the line or squiggle,

New User

Configuring C++ IntelliSense and Browsing

Whether you are creating a new (or modifying an existing) C++ project using a Wizard, or importing an project into Visual Studio from another IDE, it’s important to configure the project correctly for the IntelliSense and Browsing features to provide accurate information. 

C++ Tutorial: Hello World

Welcome to the C++ Tutorial.
In this first C++ tutorial, you will learn how to write (and run!) your first C++ program, “Hello, World!”. Along the way you will learn a little C++ history, see how to configure a C++ console application in Visual Studio 2017,

Bring your C++ code to Visual Studio

C++ has been around for a long time and throughout its history many tools have been built to make life easier for C++ developers. This has led to a diverse C++ ecosystem in terms of the editing tools, build systems, coding conventions,

Migrate your existing Windows C++ projects to MSBuild

If your project targets one of the Windows platforms only (Desktop or UWP), you should consider using MSBuild as your C++ build system. If you consider expanding beyond these platforms though, consider using CMake to specify your build. To learn more,

Bring your existing Android Eclipse projects to Visual Studio

You can use Visual Studio to develop your C++ projects targeting Android. To learn more about this support read the Visual C++ for Cross-Platform Mobile development section on MSDN.
If you’re currently using Eclipse and considering moving to Visual Studio, you can do that via our Eclipse Android Project Import Wizard.

Bring your existing C++ Linux projects to Visual Studio

Visual Studio supports targeting Linux out of the box – you can edit, remote build and remote debug to a Linux machine (whether that’s a remote machine, a VM running locally or in the cloud, or WSL in Windows 10).
This article covers the high-level steps to bring your existing Linux projects to Visual Studio.

Bring your existing Qt projects to Visual Studio

Qt framework is an ever growing cross-platform C++ framework, ideal for building desktop, mobile, and even embedded solutions. While you can use CMake to target Qt (if you do, you should read more about the Visual Studio support for CMake), Qt also provides its own Qt-optimized build system called qmake.

CMake support in Visual Studio

⏱ Updated on October 5, 2017 with the latest functionality included with Visual Studio 2017 15.4
Visual Studio 2017 introduces built-in support for handling CMake projects. This makes it a lot simpler to develop C++ projects built with CMake without the need to generate VS projects and solutions from the command line.

Bring your C++ codebase to Visual Studio with “Open Folder”

⏱ Updated on March 06, 2017 with the latest functionality in Visual Studio 2017 RTW

Welcome to Visual Studio 2017! Starting with this release, Visual Studio supports opening folders containing source code without the need to create any solutions or projects.

OpenFolder

Set Environment Variables for Debug, Launch, and Tools with CMake and Open Folder

There are many reasons why you may want to customize environment variables. Many build systems use environment variables to drive behavior; debug targets sometimes need to have PATH customized to ensure their dependencies are found; etc. Visual Studio has a mechanism to customize environment variables for debugging and building CMake projects and C++ Open Folder.

Clang/LLVM Support in Visual Studio

Visual Studio 2019 version 16.1 Preview 2 comes with support for Clang/LLVM out-of-the-box. Visual Studio has had great tooling for MSVC and GCC for quite a while now. The latest preview brings Clang into the fold.
Visual Studio 2019 includes out of the box support for editing,

Install the “Clang compiler for Windows” optional component as part of the “Desktop development with C++” workload.
Visual Studio CMake Support – Clang/LLVM, CMake 3.14, Vcpkg, and Performance Improvements

We’ve introduced a bunch of improvements to our CMake support in the latest preview of Visual Studio 2019 Update 1. The latest release includes Clang/LLVM support, CMake 3.14, better vcpkg integration, and many more enhancements. If you are not familiar with Visual Studio’s CMake support, check out how to get started.

Introducing the New CMake Project Settings UI

Visual Studio 2019 Preview 2 introduces a new CMake Project Settings Editor to help you more easily configure your CMake projects in Visual Studio. The editor provides an alternative to modifying the CMakeSettings.json file directly and allows you to create and manage your CMake configurations.

IntelliSense Enhancements for C++ Open Folder and CMake

Today’s preview of Visual Studio 2017 version 15.6 Preview 2 includes two IntelliSense improvements to streamline code editing for C++ Open Folder and CMake. We added a new type of IntelliSense squiggle to C++ Open Folder and CMake to streamline cross-platform development. 

Customizing your Environment with Visual C++ and Open Folder

点这里看中文版
Ever since we shipped support for opening a folder of C++ code, the community has been asking for more control over their build and editing environments.  To achieve this, we have added new ways to customize your environment with CppProperties.json in the latest version of Visual Studio 2017.

ARM GCC Cross Compilation in Visual Studio

点这里看中文版
⏱ Updated on January 10, 2018 to cover addition of debugging support in Visual Studio 2017 15.6
In Visual Studio 2017 15.5 we are introduced support for cross compilation targeting ARM microcontrollers. The 15.6 Preview 2 release adds debugging support.

Remote tasks in Visual Studio

We have introduced a new capability to run remote tasks in Visual Studio 2017 15.5 Preview 2.  This capability allows you to run any command on a remote system that is defined in Visual Studio’s Connection Manager. Remote tasks also provide the capability to copy files to the remote system.

CMake support in Visual Studio – CMake 3.9, Linux targeting, feedback

点这里看中文版
Visual Studio 2017 15.4 Preview 2 is now available and includes enhancements to Visual Studio’s CMake tools.  The latest preview upgrades CMake to version 3.9, includes better support for independent CMakeLists, and supports targeting Linux directly.
Please check out the preview and try out the latest CMake features. 

Using MinGW and Cygwin with Visual C++ and Open Folder

Building cross-platform C and C++ code is easier than ever with Visual Studio 15.3 Preview 4.  The latest preview improves support for alternative compilers and build environments such as MinGW and Cygwin.  MinGW (Minimalist GNU for Windows), in case you are not familiar with it,

performance

A screenshot of a computer Description automatically generated
JCC Erratum Mitigation in MSVC

The content of this blog was provided by Gautham Beeraka from Intel Corporation.
Intel recently announced Jump Conditional Code (JCC) Erratum which can occur in some of its processors. The MSVC team has been working with Intel to provide a software fix in the compiler to mitigate the performance impact of the microcode update that prevents the erratum.

MSVC Backend Updates in Visual Studio 2019 Versions 16.3 and 16.4

Versions 16.3 and 16.4 of Visual Studio 2019 brought many new improvements in code generation quality, build throughput, and security. If you still haven’t downloaded your copy, here is a brief overview of what you’ve been missing out on.

Demonstration of C++ Build Insights,

Game performance improvements in Visual Studio 2019 version 16.2

This spring Gratian Lup described in his blog post the improvements for C++ game development in Visual Studio 2019. From Visual Studio 2019 version 16.0 to Visual Studio 2019 version 16.2 we’ve made some more improvements. On the Infiltrator Demo we’ve got 2–3% performance wins for the most CPU-intensive parts of the game.

Improving the Performance of Standard Library Functions

In Visual Studio 2019 version 16.2 we improved the codegen of several standard library functions. Guided by your feedback on Developer Community (Inlining std::lldiv and Improved codegen for std::fmin, std::fmax, std::round, std::trunc) we focused on the variants of standard division (std::div,

Unreal Engine 4 Infiltrator Demo link times
Improved Linker Fundamentals in Visual Studio 2019

On the C++ team we’ve heard loud and clear from users that build times are a pain point. We’ve continued our focus on improving the step, linking, that dominates F5 build times. Fast F5 build times, or iteration build times, are a key contributor to developer productivity and we felt that there was a large opportunity so we narrowed in on changes that we felt could move the needle 2x or more.

Inlining Decisions in Visual Studio

Introduction
My name is Terry Mahaffey and I work on the code generation team in MSVC. Lately I’ve been doing some work on our inliner and I wanted to give a brief introduction to it before later diving into some of the changes we’ll be shipping.

Accelerating Compute-Intensive Workloads with Intel® AVX-512

This guest post was authored by Junfeng Dong, John Morgan, and Li Tian from Intel Corporation.
Introduction
Last year we introduced Intel® Advanced Vector Extensions 512 (Intel® AVX-512) support in Microsoft* Visual Studio* 2017 through this VC++ blog post. In this follow-on post,

developer command prompt launches VS Code workspace folder. In VS Code open a file and right click in the editor window to see the "build and debug active file" menu option. Selecting the menu option starts a debugger session on the active file.
Visual Studio Code C/C++ extension: March 2019 Update

The March 2019 update of the Visual Studio Code C/C++ extension is now available. This release includes many new features and bug fixes, including IntelliSense caching, Build and Debug Active File, and configuration squiggles. For a full list of this release’s improvements,

SIMD Extension to C++ OpenMP in Visual Studio

In the era of ubiquitous AI applications there is an emerging demand of the compiler accelerating computation-intensive machine-learning code for existing hardware. Such code usually does mathematical computation like matrix transformation and manipulation and it is usually in the form of loops.

Game performance and compilation time improvements in Visual Studio 2019

The C++ compiler in Visual Studio 2019 includes several new optimizations and improvements geared towards increasing the performance of games and making game developers more productive by reducing the compilation time of large projects. Although the focus of this blog post is on the game industry,

Survey

Spring 2018 Visual C++ Migration Survey

The Spring 2018 Visual C++ Migration Survey is now open.
Please take a few minutes to share your experiences, positive or not so positive. If you have not migrated your solutions and project to Visual Studio 2017, please let us know why. 

vcpkg 3 Months Anniversary, Survey

vcpkg, a tool to acquire and build C++ open source libraries on Windows, was published 3 months ago. We started with 20 libraries and now the C++ community has added 121 new C++ libraries. We really appreciate your feedback and we created a survey to collect it.

C++ code analysis: tell us what you think!

We’d love to hear more about what you would like to see in C++ code analysis. We’re running a short survey–just 20 questions–to help us understand how to make C++ code analysis and Visual C++ better.
Please take a couple of minutes to fill out our C++ Code Analysis survey and let us know your thoughts.

C++ Unit Testing Survey (Summer 2016)

Hi everyone! The Visual Studio C++ team is conducting a survey to learn more about your C++ unit testing experiences. We’ll use the feedback to make improvements to Visual Studio in the future. The survey should take less than 10 minutes to complete.

Visual C++ for Linux Updates

Updated 6/14/2016: We updated the original announcement post with the content below if you want a single page that covers everything about this extension. The below remains the same and just covers the updates from the original release.
We’re happy to provide an update on the VC++ for Linux extension which has a new release today.

C-Runtime Deployment: Why choose AppLocal?

There are three main ways to depend on and deploy the Visual C++ libraries and the Universal CRT:

You can depend on the Visual C++ libraries and Universal CRT DLLs and deploy those DLLs centrally using the redistributables (the VCRedist, MSMs,

Do You Develop Games?

Or have you worked on a game recently?
If so, please share some details about your experience. The Microsoft Visual Studio team would like to learn more about your current game development experience. The survey should take less than ~10 minutes.

Trip Report

Cppp 2019 Trip Report

Summary
CPPP is a new C++ conference in Paris, France. Its first iteration ran for a single day with three parallel tracks, drawing in 160 attendees.
The conference great on all fronts: the speakers & talks were varied and high-quality, the venue was right next to the Eiffel Tower and had plenty of space,

VC++ Migration Documentation

Binary Compatibility and Pain-free Upgrade: Why Moving to Visual Studio 2017 is almost “too easy”

Visual Studio 2017 is a major leap forward in terms of C++ functionality compared with VS 2015. We hope the new release will delight you in your day-to-day job as soon as you can upgrade.
This blog post focuses on the steps needed to upgrade from Visual Studio 2015 to 2017.

Visual C++ 2015 and 2017 Migration Documentation Update

Upgrading to the latest C++ compiler and toolset is sometimes not so easy and can be time consuming. You are likely to encounter some compiler and linker errors and warnings in code that previously compiled cleanly. There are several possible sources for these errors,

Stuck on an older toolset version? Move to Visual Studio 2017 without upgrading your toolset

⏱ Updated on March 11, 2019 with the latest functionality in Visual Studio 2017
Are you currently developing your C++ projects in an older version of Visual Studio? If your reasons for avoiding the all-new features in VS 2017 are covered next,

Vcpkg

Add a missing vcpkg package with a quick fix in Visual Studio 2019
C++ Cross-Platform Development with Visual Studio 2019 version 16.3: vcpkg, CMake configuration, remote headers, and WSL

In Visual Studio 2019 you can target both Windows and Linux from the comfort of a single IDE. Visual Studio’s native support for CMake lets you open any folder containing C++ code and a CMakeLists.txt file directly in Visual Studio to edit,

Install the “Clang compiler for Windows” optional component as part of the “Desktop development with C++” workload.
Visual Studio CMake Support – Clang/LLVM, CMake 3.14, Vcpkg, and Performance Improvements

We’ve introduced a bunch of improvements to our CMake support in the latest preview of Visual Studio 2019 Update 1. The latest release includes Clang/LLVM support, CMake 3.14, better vcpkg integration, and many more enhancements. If you are not familiar with Visual Studio’s CMake support, check out how to get started.

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.

Use the official Boost.Hana with MSVC 2017 Update 8 compiler

We would like to share a progress update to our previous announcement regarding enabling Boost.Hana with MSVC compiler. Just as a quick background, Louis Dionne, the Boost.Hana author, and us have jointly agreed to provide a version of Boost.Hana in vcpkg to promote usage of the library among more C++ users from the Visual C++ community.

Use Boost.Hana via vcpkg with the latest MSVC compiler

Overview
As we continue to work towards improving the conformance of the MSVC compiler for the C++ community, we would like to enable more C++ libraries, and today we are bringing Boost.Hana to Visual C++.  Building on our recent C++ conformance progress,

Announcing a single C++ library manager for Linux, macOS and Windows: Vcpkg

At Microsoft, the core of our vision is “Any Developer, Any App, Any Platform” and we are committed to bringing you the most productive development tools and services to build your apps across all platforms. With this in mind, we are thrilled to announce today the availability of vcpkg on Linux and MacOS.

Vcpkg: introducing installation options with Feature Packages

We are happy to announce a new feature for vcpkg in version 0.0.103: Feature Packages.
Vcpkg is a package manager to help acquiring and building open source libraries on Windows; vcpkg currently offers over 600 C++ libraries available for VS2017 and VS2015.

Vcpkg: Introducing the upgrade command

If you’re just getting started and want to learn more about vcpkg, check out our initial post.
We recently added a new option to vcpkg (i.e. vcpkg contact –survey) to provide a direct way to share your feedback with the Vcpkg team.

Vcpkg: Using multiple enlistments to handle multiple versions of a library

Vcpkg allows you to acquire and build 3rd party libraries on Windows. Once cloned, the vcpkg directory (enlistment) provides a stable set of libraries that are all compatible and based on the latest published version of these libraries. Occasionally, you may need different versions of the same library.

Vcpkg: introducing export command

Vcpkg helps you acquire and build open source libraries on Windows. Since September 2016, the community added more than 200 libraries in the vcpkg catalog and has been contributing actively to the code itself. Vcpkg now supports Visual Studio 2015 and Visual Studio 2017 and can target dynamic or static libraries and platforms like x64,

Visual Studio Code

'All' CMake commands apply to all folders in the workspace, not just the active folder.
Visual Studio Code CMake Tools Extension: Multi-root workspaces and file-based API

The February 2020 update of the Visual Studio Code CMake Tools extension is now available. This release includes two of the extension’s top feature requests: file-based API support and multi-root workspaces. For a full list of this release’s improvements check out the release notes on GitHub.

An image of the CMake Tools extension for VS Code, with a project outline to the left and several CMake-specific commands in the command palette.
CMake Tools Extension for Visual Studio Code

Microsoft is now the primary maintainer of the CMake Tools extension for Visual Studio Code. The extension was created and previously maintained by vector-of-bool, who has moved on to other things. Thank you vector-of-bool for all of your hard work getting this extension to where it is today!

A screenshot of text Description automatically generated
Visual Studio Code C++ extension: Nov 2019 update

Find All References, Rename Symbol refactoring, support for localization, new navigation breadcrumb controls, and improvements to the Outline view are only a few of the improvements in the November 2019 update of Visual Studio Code C++ extension.

Box coloring in right side of screenshot where it is outside variable declaration
Visual Studio Code C/C++ Extension: July 2019 Update

The July 2019 update of the Visual Studio Code C/C++ extension is now available. This release includes many new features, including semantic colorization and improvements to the IntelliSense Configuration Settings Editor UI and IntelliSense cache. For a full list of this release’s improvements,

"Install on WSL" option for the C/C++ extension after Remote - WSL is installed
Visual Studio Code C/C++ extension: May 2019 Update

The May 2019 update of the Visual Studio Code C/C++ extension is now available to C/C++ extension Insiders. This release includes many new features, including Visual Studio Code Remote Development extensions with C/C++, an IntelliSense Configurations settings UI, and IntelliSense improvements.

developer command prompt launches VS Code workspace folder. In VS Code open a file and right click in the editor window to see the "build and debug active file" menu option. Selecting the menu option starts a debugger session on the active file.
Visual Studio Code C/C++ extension: March 2019 Update

The March 2019 update of the Visual Studio Code C/C++ extension is now available. This release includes many new features and bug fixes, including IntelliSense caching, Build and Debug Active File, and configuration squiggles. For a full list of this release’s improvements,

Visual Studio Code C/C++ extension: January 2019 Update

[Updated on 11/4/2019] – Removed mentions of “Improved Member Function Completion” which is no longer supported based on user feedback.
The January 2019 update of the Visual Studio Code C++ extension is now available. This release includes many new features and bug fixes including documentation comments support,

Visual Studio Code C/C++ extension August 2018 Update

Late last week we shipped the August 2018 update  to the C/C++ extension for Visual Studio Code. This update included support for “Just My Code” symbol search, a gcc-x64 option in the intelliSenseMode setting, and many bug fixes. You can find the full list of changes in the release notes.

C++ development with Docker containers in Visual Studio Code

Containers allow developers to package up an application with all the parts it needs, such as libraries and other dependencies, and ship it all out as one image. This is especially useful for C++ cross-platform development – with containers you can choose to target a platform that runs on a completely different operating system than your developer machine.

Visual Studio Code C/C++ extension July 2018 Update and IntelliSense auto-configuration for CMake

Last week we shipped the July 2018 update to the C/C++ extension for Visual Studio Code. In this update we added support for a new experimental API that allows build system extensions to pass IntelliSense configuration information to our extension for powering up full IntelliSense experience.

Writing Code

A screenshot of text Description automatically generated
Visual Studio Code C++ extension: Nov 2019 update

Find All References, Rename Symbol refactoring, support for localization, new navigation breadcrumb controls, and improvements to the Outline view are only a few of the improvements in the November 2019 update of Visual Studio Code C++ extension.

Improved C++ IntelliCode now Ships with Visual Studio 2019

IntelliCode support for C++ previously shipped as an extension, but it is now an in-box component that installs with the “Desktop Development with C++” workload in Visual Studio 2019 16.1 Preview 2. Make sure that IntelliCode is active for C++ by enabling the “C++ base model” under Tools >

std::optional: How, when, and why

This post is part of a regular series of posts where the C++ product team here at Microsoft and other guests answer questions we have received from customers. The questions can be about anything C++ related: MSVC toolset, the standard language and library,

C++ Core Checks in Visual Studio 2017 15.7 Preview 2

This post was written by Sergiy Oryekhov.
The C++ Core Guidelines Check extension received several new rules in Visual Studio 2017 15.7 Preview 2. The primary focus in this iteration was on the checks that would make it easier to adopt utilities from the Guidelines Support Library.

C++ Code Analysis Improvements for Visual Studio 2017 15.7 Preview 1

点这里看中文版
We’re making it easier to configure and use the C++ code analysis features with a set of changes targeting 15.7. In the first 15.7 preview we’ve cleaned up the UI, fixed our documentation links and, most importantly, simplified the way analysis extensions are configured. 

Arithmetic overflow checks in C++ Core Check

点这里看中文版
We’ve improved the C++ Code Analysis toolset with every major compiler update in Visual Studio 2017. Version 15.6, now in Preview, includes a set of arithmetic overflow checks. This article discusses those checks and why you’ll want to enable them in your code.

Diagnostic Improvements in Visual Studio 2017 15.3.0

This post as well as described diagnostics significantly benefited from the feedback by Mark, Xiang, Stephan, Marian, Gabriel, Ulzii, Steve and Andrew.
Visual Studio 2017 15.3.0 release comes with a number of improvements to the Microsoft Visual C++ compiler’s diagnostics. Most of these improvements are in response to the diagnostics improvements survey we shared with you at the beginning of the 15.3 development cycle.

Building your C++ application with Visual Studio Code

Over the last few months, we have heard a lot of requests with respect to adding capability to Visual Studio Code to allow developers to build their C/C++ application. The task extensibility in Visual Studio Code exists to automate tasks like building,