C++ Team Blog

The latest in C++, Visual Studio, VS Code, and vcpkg from the MSFT C++ team

Latest posts

Visual Studio Code C/C++ extension July 2018 Update and IntelliSense auto-configuration for CMake
Jul 25, 2018
Post comments count 0
Post likes count 0

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

Rong Lu
Rong Lu

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. You can find the full list of changes in the July 2018 update in the changelog. As CMake has been the most requested build system for us to provide support for, we’ve been working with vector-of-bool, author of the CMake Tools extension, on an implementation using this new API to provide IntelliSense auto-configuration for ...

Data Breakpoints – Visual Studio 2017 15.8 Update  
Jul 25, 2018
Post comments count 0
Post likes count 0

Data Breakpoints – Visual Studio 2017 15.8 Update  

Leslie Richardson
Leslie Richardson

New to Visual Studio 2017 version 15.8, you can now set data breakpoints from within the Locals, Autos, Watch, and Quickwatch windows!  To view official documentation on data breakpoints, check out this post. Data breakpoints allow you to stop execution when a particular variable stored at a specific memory address changes.  Prior to version 15.8, data breakpoints could only be set via the Breakpoints window. In this window, a data breakpoint can be set by selecting New > Data Breakpoint.. and then entering the address of the desired variable and the number of bytes you want the window to watch. Setting data ...

MSVC Preprocessor Progress towards Conformance
Jul 6, 2018
Post comments count 1
Post likes count 0

MSVC Preprocessor Progress towards Conformance

Ulzii Luvsanbat [MSFT]
Ulzii Luvsanbat [MSFT]

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. In addition to that, there are places in the standard where the preprocessor behavior is undefined or unspecified and our traditional behavior diverged from other major compilers. In some of those cases, we want to move closer to the ecosystem to make...

Shared PCH usage sample in Visual Studio
Jul 5, 2018
Post comments count 4
Post likes count 1

Shared PCH usage sample in Visual Studio

EricMittelette
EricMittelette

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, this leads to the popular question: is it possible for several projects to use the same pch file which would be built just once? The answer is yes, but it requires a couple of tricks to satisfy cl’s check that command line used for building the pch is the same as the command line used for building a source file using this pch. Here is a sample solution, which has ...

Support for Unity (Jumbo) Files in Visual Studio 2017 15.8 (Experimental)
Jul 2, 2018
Post comments count 0
Post likes count 1

Support for Unity (Jumbo) Files in Visual Studio 2017 15.8 (Experimental)

Will Buik
Will Buik

This post was written by Olga Arkhipova. Many big codebases use so-called unity (jumbo) builds where many source files are included in one or a few ‘unity’ files for compilation, which makes compiling and linking much faster. Just to avoid any confusion – this blog is NOT related to the Unity game engine. Looking at some customer feedback regarding slow IntelliSense, we found that projects often include both source files and unity files including those source files. Currently there is no easy way to exclude source files from the build and unity files from the IntelliSense parsing, so we do quite a lot of unnec...

Announcing C++ Just My Code Stepping in Visual Studio
Jun 29, 2018
Post comments count 1
Post likes count 0

Announcing C++ Just My Code Stepping in Visual Studio

Marian Luparu
Marian Luparu

In Visual Studio 2017 release 15.8 Preview 3 we’re announcing support for Just My Code stepping for C++. In addition to previously supported callstack filtering, the Visual Studio debugger now also supports stepping over non-user-code. As you “Step In”, for example in an algorithm from the Standard library with a custom predicate or in a Win32 API that has a user callback, the debugger will conveniently step into the predicate or callback you provided rather than the library code that will eventually call your code. After the very warm reception of our debugging improvements in stepping in std::function calls an...

CMake Support in Visual Studio – Configuration Templates
Jun 27, 2018
Post comments count 0
Post likes count 0

CMake Support in Visual Studio – Configuration Templates

Will Buik
Will Buik

Visual Studio 2017 15.8 Preview 3 is now available and it includes several improvements to the CMake tools. In addition to a few fixes we have simplified the way you can configure your CMakeSettings.json file by adding configuration templates. If you are new to CMake in Visual Studio, check out how to get started. Configuration Templates for CMake If you have created a CMakeSettings.json file to customize your project’s settings in the past you might know that that file could be a little daunting. With both the Desktop and Linux workloads installed, the default CMakeSettings.json template was over 100 lines long...

New, experimental code analysis features in Visual Studio 2017 15.8 Preview 3
Jun 26, 2018
Post comments count 0
Post likes count 0

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

eli fessler
eli fessler

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. Trying out new features In Visual Studio 2017 version 15.8 Preview 3, available in the Preview channel, we’ve introduced some new, in-progress code analysis features. These features are disabled by default, but you may enable them under Tools > Options > Text Editor > C++ > Experimental > Code Analysis. We encourage you to test them out and provide any...

Convert Macros to Constexpr
Jun 26, 2018
Post comments count 0
Post likes count 1

Convert Macros to Constexpr

Augustin Popa
Augustin Popa

Visual Studio 2017 version 15.8 is currently available in preview. Today, Preview 3 has been released, and it comes with several features that improve the developer productivity experience. One key theme in 15.8 is code modernization, and macros are a key target for that. In 15.8 Preview 1, we announced the ability to expand macros in Quick Info tooltips, and now, for Preview 3, we are happy to announce a way to convert them to modern C++ constexpr expressions. The new preview includes a quick fix, accessible from the editor window, that identifies macros that can be converted to constexpr, and offers the option ...