C++ Team Blog

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

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).

"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.

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,

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 >

Announcement

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,

Select a WSL-Debug configuration
C++ with Visual Studio 2019 and Windows Subsystem for Linux (WSL)

In Visual Studio 2019 version 16.1 Preview 3 we have added native support for using C++ with the Windows Subsystem for Linux (WSL). WSL lets you run a lightweight Linux environment directly on Windows, including most command-line tools, utilities, and applications.

C++17/20 Features and Fixes in Visual Studio 2019

Visual Studio 2019 version 16.0 is now available and is binary compatible with VS 2015/2017. In this first release of VS 2019, we’ve implemented more compiler and library features from the C++20 Working Paper, implemented more <charconv> overloads (C++17’s “final boss”),

Particle logo
Visual Studio Code now available through Particle Workbench

We’re excited to announce that Visual Studio Code is included in the new release of tooling for Particle IoT developers. Developers using the Particle platform can now use Visual Studio Code as their default editor for building IoT apps!
Particle provides a widely-used IoT platform that consists of hardware,

Quick Info for "add_subdirectory" CMake command
In-Editor Documentation for CMake in Visual Studio

Visual Studio 2019 version 16.1 Preview 1 introduces in-editor documentation for CMake commands, variables, and properties. You can now leverage IntelliSense autocompletion and quick info tooltips when editing a CMakeLists.txt file, which will save you time spent outside of the IDE referencing documentation and make the process less error-prone.

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,

Making C++ Exception Handling Smaller On x64

Visual Studio 2019 Preview 3 introduces a new feature to reduce the binary size of C++ exception handling (try/catch and automatic destructors) on x64. Dubbed FH4 (for __CxxFrameHandler4, see below), I developed new formatting and processing for data used for C++ exception handling that is ~60% smaller than the existing implementation resulting in overall binary reduction of up to 20% for programs with heavy usage of C++ exception handling.

CUDA 10.1 available now, with support for latest Microsoft Visual Studio 2019 versions

We are pleased to echo NVIDIA’s announcement for CUDA 10.1 today, and are particularly excited about CUDA 10.1’s continued compatibility for Visual Studio. CUDA 10.1 will work with RC, RTW and future updates of Visual Studio 2019. To stay committed to our promise for a Pain-free upgrade to any version of Visual Studio 2017 that also carries forward to Visual Studio 2019,

C++ Q&A Series

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

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).

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.

Quick Info for "add_subdirectory" CMake command
In-Editor Documentation for CMake in Visual Studio

Visual Studio 2019 version 16.1 Preview 1 introduces in-editor documentation for CMake commands, variables, and properties. You can now leverage IntelliSense autocompletion and quick info tooltips when editing a CMakeLists.txt file, which will save you time spent outside of the IDE referencing documentation and make the process less error-prone.

Open Existing CMake Caches in Visual Studio

Visual Studio typically manages all the details of CMake for you, under the hood, when you open a project. However, some development workflows require more fine-grained control over how CMake is invoked. The latest Visual Studio 2019 Preview lets you have complete control over CMake if your project needs more flexibility.

What’s New in CMake – Visual Studio 2019 Preview 2

We have made a bunch of improvements to Visual Studio’s CMake support in the latest preview of the IDE. Many of these changes are taking the first steps to close the gap between working with solutions generated by CMake and the IDE’s native support.

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.

Using multi-stage containers for C++ development

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.

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.

Containers

Using multi-stage containers for C++ development

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.

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,

Diagnostics

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.

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.

Documentation

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

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. Since then, the WSL team has been hard at work, dramatically improving WSL’s abilty to run an ever increasing number of native Linux command-line binaries and tools,

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

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.

Clang with Microsoft CodeGen in VS 2015 Update 1

[This post was written by Dave Bartolomeo and the Clang/C2 feature crew]
One of the challenges with developing and maintaining cross-platform C++ code is dealing with different C++ compilers for different platforms. You write some code that builds fine with the Visual C++ compiler for your Windows-targeting build,

faster

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

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,

Books on C++17

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,

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,

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,

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

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).

"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.

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.

Quick Info for "add_subdirectory" CMake command
In-Editor Documentation for CMake in Visual Studio

Visual Studio 2019 version 16.1 Preview 1 introduces in-editor documentation for CMake commands, variables, and properties. You can now leverage IntelliSense autocompletion and quick info tooltips when editing a CMakeLists.txt file, which will save you time spent outside of the IDE referencing documentation and make the process less error-prone.

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.

Using multi-stage containers for C++ development

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.

Linux C++ Workload improvements to the Project System, Linux Console Window, rsync and Attach to Process

点这里看中文版
In Visual Studio 2017 15.7 Preview 1 we have made a number of improvements to our support to the Linux C++ workload based on your feedback. You can learn more about our Linux C++ workload in Visual Studio here.
MSBuild Project System improvements
We added some new properties to Linux projects on the C/C++ General properties page.

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.

Visual C++ for Linux Development with CMake

In Visual Studio 2017 15.4 you can now target Linux from your CMake projects. This enables you to work on your existing code base that uses CMake as your build solution without having to convert it to a VS project. If your code base is cross-platform you can target both Windows and Linux from within Visual Studio.

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

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,

"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.

Quick Info for "add_subdirectory" CMake command
In-Editor Documentation for CMake in Visual Studio

Visual Studio 2019 version 16.1 Preview 1 introduces in-editor documentation for CMake commands, variables, and properties. You can now leverage IntelliSense autocompletion and quick info tooltips when editing a CMakeLists.txt file, which will save you time spent outside of the IDE referencing documentation and make the process less error-prone.

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,

Making C++ Exception Handling Smaller On x64

Visual Studio 2019 Preview 3 introduces a new feature to reduce the binary size of C++ exception handling (try/catch and automatic destructors) on x64. Dubbed FH4 (for __CxxFrameHandler4, see below), I developed new formatting and processing for data used for C++ exception handling that is ~60% smaller than the existing implementation resulting in overall binary reduction of up to 20% for programs with heavy usage of C++ exception handling.

Concurrency Code Analysis in Visual Studio 2019

Concurrency Code Analysis in Visual Studio 2019
The battle against concurrency bugs poses a serious challenge to C++ developers. The problem is exacerbated by the advent of multi-core and many-core architectures. To cope with the increasing complexity of multithreaded software, it is essential to employ better tools and processes to help developers adhere to proper locking discipline.

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.

In-editor code analysis in Visual Studio 2019 Preview 2

The C++ team has been working to refresh the Code Analysis experience inside Visual Studio. Last year, we blogged about some in-progress features in this area. We’re happy to announce that in Visual Studio 2019 Preview 2, we’ve integrated code analysis directly into the editor,

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

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,

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,

performance

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,

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”

MSVC code optimizer improvements in Visual Studio 2017 versions 15.5 and 15.3

In this post, we’d like to give you an update on the significant progress the Visual C++ code optimizer made in the past year, focused mostly on the features released in the 15.3 and 15.5 versions. Compared to VS2015 Update 3,

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. 

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.

Uncategorized

Quick Info Improvements in Visual Studio 2019: Colorization and Search Online

The Quick Info tooltip has received a couple of improvements in Visual Studio 2019 version 16.1 Preview 3. 
Quick Info Colorization 
While Quick Info was previously all black text, the tooltip now respects the semantic colorization of your editor: 
 
If you’d like to customize your semantic colorization,

Visualize your build with IncrediBuild’s Build Monitor and Visual Studio 2019

There’s seeing your build, and then there’s REALLY seeing your build. The difference can be quite dramatic, unveiling a new world of possibilities. As part of a partnership between IncrediBuild and Visual Studio, you can enjoy these possibilities directly within Visual Studio.

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),

"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.

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 >

Visual Studio C++ Template IntelliSense Populates Based on Instantiations in Your Code

Ever since we announced Template IntelliSense, you all have given us great suggestions. One very popular suggestion was to have the Template Bar auto-populate candidates based on instantiations in your code. In Visual Studio 2019 version 16.1 Preview 2, we’ve added this functionality via an “Add All Existing Instantiations” option in the Template Bar dropdown menu.

Using VS Code for C++ development with containers

This post builds on using multi-stage containers for C++ development. That post showed how to use a single Dockerfile to describe a build stage and a deployment stage resulting in a container optimized for deployment. It did not show you how to use a containers with your development environment.

What’s New in CMake – Visual Studio 2019 Preview 2

We have made a bunch of improvements to Visual Studio’s CMake support in the latest preview of the IDE. Many of these changes are taking the first steps to close the gap between working with solutions generated by CMake and the IDE’s native support.

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.

Exploring Clang Tooling – Using Build Tools with 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,

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

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

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.

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,

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 Studio Code

"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

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, improved #include autocomplete performance, better member function completion, and many IntelliSense bug fixes. For a full list of this release’s improvements,

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.

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

Visual Studio Code C/C++ extension June 2018 Update
Today we’re very happy to announce the availability of the June 2018 update to the C/C++ extension for Visual Studio Code! In this update, we are continuing our efforts to make IntelliSense configuration easier by auto-detecting compile_commands.json files for IntelliSense,

Visual Studio Code C/C++ extension May 2018 Update – IntelliSense configuration just got so much easier!

Visual Studio Code C/C++ extension May 2018 Update – IntelliSense configuration just got so much easier!
This morning we shipped the May 2018 update of the C/C++ extension for Visual Studio Code, the most significant update to this extension in its 2-year history!

Visual Studio Code C/C++ extension March 2018 update

Today we are excited to announce the March 2018 update to the Visual Studio Code C/C++ extension! This update includes improved auto-complete for local and global scopes and a simplified configuration process for system includes and defines, enabling a better out-of-box IntelliSense experience.

Visual Studio Code C/C++ extension Feb 2018 update

点这里看中文版
The February 2018 update to the Visual Studio Code C/C++ extension is here! In addition to several bug fixes, this update added colorization for inactive code regions, making it easy to read C and C++ code. You can find the full list of changes in the 0.15.0 release notes.

Writing Code

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,