Visual Studio 2022 version 17.5 for C++ Developers

Sy Brand

We are happy to announce that Visual Studio 2022 version 17.5 is now generally available! This post summarizes the new features you can find in this release for C++. See the Visual Studio 17.5 announcement to learn about all of the features in the release. You can download Visual Studio 2022 from the Visual Studio downloads page or upgrade your existing installation by following the

Contents

Arm64

In 17.3 you could use Visual Studio as a native Arm64 application. In 17.4 you could use our native Arm64 toolchain in production. Continuing our progress, in 17.5 you can now obtain a native Arm64 Clang toolset with our LLVM workload!

Image vs1

Productivity and Game Development

Build Performance

One of our highest voted Developer Community tickets was regarding the runtime overhead of functions like std::move and std::forward in debug builds. In 17.5 we addressed this issue, making these cast-like functions never produce function calls in generated code, even in debug mode. Depending on your projects, this could noticeably improve performance of your debug builds. This feature is supported by a new attribute, [[msvc::intrinsic]]. It can be applied to non-recursive functions consisting of a single cast, which take only one parameter. You can read more about these changes in Improving the State of Debug Performance in C++.

Developer Productivity

This section used to say that Brace Pair Colorization and Spell Check were available in this release. Unfortunately these are being delayed until 17.6. You can try them out in 17.6 Preview 1 which is now available.

17.5 comes with a host of new productivity features, which are outlined below, and you can learn more about them in C++ Brace Pair Colorization and More in Visual Studio.

Reimagined Member List is a new experimental feature which puts the members whose types match the current context you are in at the top of the list for easy access. This is currently being rolled out to a subset of users, and we will be exploring this space further in future releases, evaluating more criteria for promoting items to the top of the list.

Text Description automatically generated

When you hover over a macro, the expanded macro gets displayed in a pop-up. With new formatting and a monospaced font you’ll be able to read the expanded macro much easier. You will also have two new options: to copy the expanded macro to your clipboard, and to replace the macro invocation with its expansion.

Text Description automatically generated

Visual Studio now has a Spell Checker that helps in making your spelling accurate. This feature checks the spelling of all words inside comments, and names on declarations will be checked by separating camelCase and underscored words. Using quick actions you can then easily select a replacement, or choose to ignore the spelling issue, adding the word to your personal dictionary.

Image word image 31800 5

Unreal Engine

You can now view properties from base classes modified in an Unreal Blueprint asset without leaving Visual Studio. Double-click in a Blueprint reference for a C++ class or property to open the UE Asset Inspector.

Image word image 31800 6

 

Code Safety

If you want less noise when using the Lifetime Checker, you can use the new high-confidence versions of the existing warnings. As of 17.5, the high-confidence warnings are still experimental, but depending on the feedback we might include them in some of the recommended profiles in future versions. You can learn more in High-confidence Lifetime Checks in Visual Studio version 17.5 Preview 2.

Standards Conformance

C++23

We’re continuing our work on standards conformance for C++23, giving you several new standard library features to try out.

std::ranges::fold_left, fold_right and friends define fold operations, similar to std::accumulate, but more general. For example:

std::vector<double> v = {0.25, 0.75};
auto sum = ranges::fold_left(v, 0, std::plus());

std::views::zip is a range adaptor for “zipping” together multiple ranges, with the Nth element being a tuple of the Nth elements of all the supplied ranges. For example:

std::vector<std::string> cats { "marshmallow", "milkshake", "lexical cat" };
std::vector<int> ages { 4, 4, 6 };
// {{"marshmallow", 4}, {"milkshake", 4}, {"lexical cat", 6}}
std::views::zip(cats, ages)

std::format_string provides a way to take a compile-time checked format string as a function argument. For example:

template <typename... Args>
void log(std::format_string<Args...> s, Args&&... args) {
    if (logging_enabled) {
        log_raw(std::format(s, std::forward<Args>(args)...));
    }
}

log("cat {} is {} years old", cat.name(), cat.age());

For more details on what is new and upcoming in the standard library, check out our changelog on GitHub.

C11

We’re also expanding our C11 optional feature support. You can now use an experimental implementation of C11 atomic primitives (<stdatomic.h>) with the /experimental:c11atomics flag in /std:c11 mode or later. You can learn more in C11 Atomics in Visual Studio 2022 version 17.5 Preview 2.

 

Cross Platform & Embedded

Linux

If you are targeting Linux platforms, you can now interact with remote processes with full terminal I/O with the Visual Studio Integrated Terminal. This lets you debug interactive terminal applications with ease, all from within Visual Studio. Learn more at Debug Linux Console apps in Visual Studio’s Integrated Terminal.

Linux Console allows input, output, and supports color

Embedded

Concurrent monitoring is now supported in the Serial Monitor. This allows you to monitor multiple ports at the same time, side by side! Press the “Open an additional monitor” button to get started.

Image vs9

CMake

If you have multiple CMake targets in one project, you can now select multiple targets to build from the CMake Targets view. Use Ctrl+Click or Shift+Click to select the set of targets you want to build, right click on one of them, and select “Build Selection” to build them all.

Image vs10

CMakePresets.json gives you a standard way to express your CMake build configurations which you can easily check in to source control. You can now use CMakePresets.json version 5 in Visual Studio. See the CMake documentation for information on new features.

If you have large test suites, you may want to make the most of all of your hardware to run them as fast as possible. To support this, Test Explorer can now build and test multiple CMake targets in parallel. Enable this with the “Run Tests in Parallel” option.

Image vs11

Developer Containers

For those of you using Developer Containers, you are now able to run them on a remote Linux Machine, and to open a terminal window into the currently running Developer Container.

Send us your feedback

We are very much interested in your feedback to continue to improve this experience. The comments below are open. Feedback can also be shared through the Developer Community. You can also reach us on Twitter (@VisualC), or via email at visualcpp@microsoft.com.

14 comments

Discussion is closed. Login to edit/delete existing comments.

  • David Aldrich 0

    Hi, I can’t find option ‘Enable Brace Pair Colorization’ in 17.5. Colorization appears not to be on by default.

    • Mryam GirmayMicrosoft employee 0

      Hi David, the Brace Colorization needed more baking time and will be included in 17.6 release. I sincerely apologize for this oversight.

  • Paulo Pinto 0

    What about the -memory-safe C++ features as presented at CppCon, wasn’t it planned for 17.5 as well?

  • John Norman 0

    It appears that spell checking also didn’t make it into 17.5. I don’t see the option anywhere in the feature preview list.

    • Sy BrandMicrosoft employee 0

      You’re right, apologies, this has been updated

      • Yossi Sadot-Sogrin 0

        Strange. I do have the spell check since I upgraded to 17.5 (no preview, Professional 2022 (64-bit) Version 17.5.0). Not the brace colorization, though.

  • Matthias Straka 0

    After upgrading to VS2002 17.5, I lost IntelliSense support for any C++ project that includes the boost header <boost/concept_check.hpp> with the error message
    E0020 identifier “BOOST_PP_IIF_BOOST_PP_BOOL_” is undefined BoostConceptTest XXX\boost_1_81_0\boost\concept_check.hpp

    Tested with Boost 1.70 and 1.81 and I was able to reproduce this on two machines (create a .cpp file that includes just that header)
    Is anyone else aware of this or is there a workaround?
    Thanks, Matthias

  • MGetz 0

    Not sure if anyone else has run across this but I’m running into an issue where the /Zc:externC gets triggered if you include the same header in two different global module fragments with different preprocessor results (in this case icmpapi.h and the PIO_STATUS_ROUTINE_DEFINED macro which is required to build on W10+). The work around was to synchronize them but AFAIK they should be independent and not interact in this way. Now to figure out why another module is causing an ICE, intellisense seems to think it has something to do with ATL and __declspec(noinline).

  • Michael Litwak 0

    Hello. A quick question: Does Visual Studio 2022 build 17.5 provide an AddressSanitizer that can log errors at runtime and keep going (rather than quit after the first error)? I recall reading somewhere that ASAN would offer this in the 17.5 general release, but I see no mention of it here or in the release announcement.

Feedback usabilla icon