C++ Team Blog
devblogs.microsoft.com/cppblog · Company blog · on HN since 2019
Microsoft's C++ team writes about the MSVC compiler, C++ standard library, language features, debugging and build performance.
What HN saysHN links it for MSVC technical details such as deducing this, precompiled headers and Spy++ internals, and for debates over Microsoft's past C support.
131HN people shared it
67linked it in comments
181stories submitted
729story points
3 months agolast shared
2019people per year2026
Most-shared posts
- 1C11 and C17 Standard Support Arriving in MSVC18 people · 29 points · first shared 2020 · discussion on HN
- 2C++23’s Deducing this: what it is, why it is, how to use it8 people · 14 points · first shared 2022 · 1 comments on HN
- 3Open Sourcing Microsoft's C++ Standard Library Implementation6 people · 15 points · first shared 2019 · 2 comments on HN
- 4Making C++ Exception Handling Smaller on X645 people · 14 points · first shared 2019 · discussion on HN
- 5Simplify Your Code with Rocket Science: C++20’s Spaceship Operator5 people · 7 points · first shared 2019 · discussion on HN
- 6C11 Atomics in Visual Studio 20225 people · 2 points · first shared 2022 · discussion on HN
- 7C++ Dynamic Debugging: Full Debuggability for Optimized Builds4 people · 9 points · first shared 2025 · discussion on HN
- 8Visual C++ linking speedup by 2x-3x in latest Visual Studio 2019 16.2 release4 people · 6 points · first shared 2019 · discussion on HN
- 9CPP Template Instantiation Two Phase Lookup4 people · 2 points · first shared 2019 · discussion on HN
- 10C11 Threads in Visual Studio 2022 version 17.8 Preview 24 people · 1 points · first shared 2023 · discussion on HN
- 11The Great Microsoft C Runtime (CRT) Refactoring4 people · 1 points · first shared 2019 · discussion on HN
- 12Blizzard is using Visual Studio 2019 to debug Linux core dumps on WSL3 people · 26 points · first shared 2021 · 1 comments on HN
- 13C++20 Concepts Are Here in Visual Studio 2019 Version 16.33 people · 14 points · first shared 2019 · discussion on HN
- 14New safety rules in C++ Core Check3 people · 12 points · first shared 2020 · discussion on HN
- 15Integrating C++ header units into Office using MSVC (1/n)3 people · 11 points · first shared 2022 · discussion on HN
What HN people wrote when they linked it
pjmlp · 2026-08-10
They officially saw no need for C support going forward.
https://herbsutter.com/2012/05/03/reader-qa-what-about-vc-and-c99
Note,
"If you really need either of the following.....then we recommend that you consider using a different compiler such as Intel or gcc (short-term) and/or pressure your standards committee representatives to have ISO C++ include more of the C standard (longer-term)."
Which is kind of why nowadays clang is part of Visual Studio as well.
However, after Satya got into the whole Microsoft <3 FOSS, this changed a bit,
https://devblogs.microsoft.com/cppblog/c11-and-c17-standard-support-ar…
There are a few blogs after that, so at least up to C17 minus the optional parts from C11, the support is there.
It remains to be seen if anything C23 or later will ever come into MSVC, and then again, clang is part of VS installer.
jasomill · 2026-05-06
From applications that capture the screen or use accessibility APIs, perhaps, but what about, e.g., Windows applications that capture window messages, e.g.,
https://devblogs.microsoft.com/cppblog/spy-internals/
Obviously, if you can inject code into a process that receives sensitive data, you're already running in a context where all security bets are off.
But with processes you yourself create, you probably can, even without elevated privileges, unless the application takes measures to prevent injection (akin to game anticheat mechanisms), so it seems worth pointing out that there are simple mechanisms to subvert such "protected" fields that don't require application-specific reverse engineering.
tom_ · 2026-02-26
Windows: I set min size to whatever is necessary to make RAM+swap add up to ~2 GBytes per CPU thread, to avoid problems with parallel Visual Studio builds. (See, e.g., https://devblogs.microsoft.com/cppblog/precompiled-header-pch-issues-a… Performance is typically fine with ~0.75+ GBytes RAM per job, but if the swapfile isn't preconfigured then Windows can seemingly end up sometimes refusing to grow it fast enough. Safest to configure it first
macOS: never found a reason not to just let it do whatever it does. There's a hard limit of ~100 GBytes swap anyway, for some reason, so, either you'll never run out, or macOS is not for you
Linux: I've always gone for 1x physical RAM, though with modern RAM sizes I don't really know why any more
flohofwoe · 2025-06-02
An example I run into almost each day: run a non-trivial build in Visual Studio which consumes all available CPU cores. Now try to use the trackpad to scroll some random window content, it just doesn't work, at best you get a UI view that jumps around instead of smooth scrolling.
AFAIK Windows is supposed to boost the CPU priority of the UI during user input, but apparently that doesn't work.
AmigaOS also boosted the CPU priority of the UI during mouse movement, except it actually worked.
PS: and instead of fixing the issue from the ground up in the OS (which admittedly is probably impossible) the VS team instead added a feature called 'Low Priority Builds':
[1] https://developercommunity.visualstudio.com/t/Limit-CPU-usage-of-Visua…
[2] https://devblogs.microsoft.com/cppblog/msbuild-low-priority-builds-in-…
dureuill · 2023-10-15
Of course you're correct that Rust has no support for making the `Self` type itself generic, which is the core of the "deducing this" feature.
However, "deducing this" has the side-effect of allowing to explicitly specify the "this" parameter in the argument list. The syntax looks the same as Rust, and the convention of calling this parameter "self" is taken from "other languages" (Python, Rust, ...)[0].
Similarly, it could be argued that the ability to pass the object by value in method is lifted from Rust. That's how I understand the GP comment anyway.
[0]: https://devblogs.microsoft.com/cppblog/cpp23-deducing-this/ "You don’t have to use the names Self and self, but I think they’re the clearest options, and this follows what several other programming languages do."
w4rh4wk5 · 2023-01-04
Despite not knowing anything about your code base, I recommend giving pre-compiled headers a try.
I am currently working on a game + custom engine that is around 1M lines of C++ code. Thanks to pre-compiled headers and forward declarations, I can compile all of it in under 20 seconds (full rebuild, optimizations enabled).
AMD Ryzen 9 7950X 16-Core Processor
All code is stored on an NVMe drive, Windows Defender realtime protection is disabled.
There's also a way to profile your build process with MSVC. It seems a bit daunting at first, but it's actually not that complicated:
https://devblogs.microsoft.com/cppblog/introducing-c-build-insights/
maccard · 2022-10-26
> What’s wrong with strict typing and ahead of time compilation as long as it compiles fast? Doesn’t this prevent many runtime errors that can occur in Python?
Nothing, as long as the compilation is fast. C++ compilation is not fast. The large C++ projects I've worked on over the last few years, compilation is bordering on 2 hours for a full build, and 10-60s for incremental builds. At one point, incremental changes were taking 15 minutes to link at one point (resolved by [0]). Go is a great example of fast compilation and strict typing IMO.
[0] https://devblogs.microsoft.com/cppblog/improved-linker-fundamentals-in…
cygx · 2022-09-13
Note that while support for anything post C89 used to be spotty at best, the Visual Studio situation has improved in recent years, see e.g. [1].
[1] https://devblogs.microsoft.com/cppblog/c11-and-c17-standard-support-ar…
MarkSweep · 2021-12-08
On a related note, Microsoft has also talked about refactoring their C run time to be written in C++. They give some reasons like maccard mentions I a comment next to this: features like RAII and templates make code easier to maintain than manual memory management and ifdefs.
https://devblogs.microsoft.com/cppblog/the-great-c-runtime-crt-refacto…
sanxiyn · 2020-09-01
Obviously it would be of great historic interest, but as a living software, just no. Go read this: https://blogs.windows.com/msedgedev/2017/04/19/modernizing-dom-tree-mi…
IE implemented DOM without using tree. No, really. Up to 2017. After reading the article, all my questions why IE was so buggy evaporated and replaced by how could IE work at all.
MSVC up to 2015 also didn't create AST. Unbelievable, I know. The question is not why MSVC's C++ support was so buggy; the real question is how could MSVC implement C++ at all. https://devblogs.microsoft.com/cppblog/rejuvenating-the-microsoft-cc-c…
After learning about IE and MSVC, I gained respect for Microsoft developers and disdain for Microsoft. Tightrope walking is amazing display of skill. Letting your employees to commute by tightrope walking for years is amazing display of stupidity.
geraldcombs · 2020-03-26
Microsoft did the same thing for the Universal CRT.
https://devblogs.microsoft.com/cppblog/the-great-c-runtime-crt-refacto…
salicideblock · 2019-09-14
Great article. I have recently been looking at the state of Clang on Windows, though not so much from a performance perspective.
> Microsoft have announced that a full integration of Clang into the MSBuild framework will be coming soon. Let's hope that they will deliver on this promise.
This has been made available on Visual Studio 2019 version 16.2. It is very easy to use in msbuild-based environments (or cmake->msbuild). See https://devblogs.microsoft.com/cppblog/clang-llvm-support-for-msbuild-…
Longhanks · 2025-03-25
The license was explicitly chosen to enable code sharing with LLVM's libc++ (https://devblogs.microsoft.com/cppblog/open-sourcing-msvcs-stl/).
The MSVC STL's quality is good enough for thousands of pieces of Windows software (including Windows itself & Microsoft's software such as Office) to depend and rely on. It delivers excellent performance for a broad range of use cases. It is actively developed in the open, delivering cutting-edge (C++23 & C++26) features, accepting Pull Requests and wonderfully documented on GitHub. It can be consumed using MSVC and LLVM clang-cl (which the MSVC STL maintainers test with CI infrastructure). The maintainers are actively working on "hardening" features to enable more secure C++ (https://github.com/microsoft/STL/wiki/STL-Hardening).
Unless you specify what "best" or "a library's quality" means to you, MSVC STL is excellent and because of that, the default choice on & for Windows.
Google chooses to only support libc++ for Chrome/Chromium (https://chromium.googlesource.com/chromium/src/+/main/docs/toolchain_s… libc++ is not a Google-owned project.
samatman · 2024-06-21
> I don't think that's true or nothing compiled using MSVC could ever be open source. For example: Rust
It is true. Rust does not require MSVC in order to compile. Also, linking to proprietary code, and compiling code using a proprietary binary, are completely different things. A distribution of Rust which contained a proprietary library would not be open source, but that's entirely allowed, because Rust's license isn't viral.
As it happens, the linkable portion of MSVC is Apache 2.0:
https://devblogs.microsoft.com/cppblog/open-sourcing-msvcs-stl/#:~:tex…
This is so that open-source software which requires MSVC framework remains open source.
Please see this classic thread for more details:
https://gitlab.com/gnu-clisp/clisp/-/blob/master/doc/Why-CLISP-is-unde…
I'm not opposed to proprietary software, and as long as people clearly understand what they're getting into, they should make their own choices about using Lady Diedre. But the FAQ is dishonest, and I have a problem with that.
> You are not obligated to accept any new terms or amendments. In such a case, this Agreement will continue to govern your use of the Work you have already accessed under the original terms. However, if you do not accept the new terms or amendments, you will not be permitted to use any new versions, updates, upgrades, or modifications to the Work.
Great. Be sure to pin the cargo version of your…
malkia · 2020-04-21
Not sure why this got downvoted? Anyone to comment? I use C++ daily on my job, and I'm very happy with its developments - especially C++11, C++14, C++17 and what's coming in C++20 - but statically linking problems are real, and pain to solve (long term). We do mostly MSVC, where some teams are still in VS2017, others VS2019 - and while they are compatible - the compatibility works only if your final app is compiled with the latest compiler from each version, which puts our team (doing mostly libraries, and providing precompiled ones) that we should use the lowest version, but then our CI infrastructure might use even earlier.
With "C" there is less to care there, as most is set in stone (unless you use some really compiler vendor specific extensions, that appear during link time).
Just an example - https://devblogs.microsoft.com/cppblog/making-cpp-exception-handling-s… - this is great improvement, but also means that if you've compiled your lib with VS2019, and it throws an exception under application that uses VS017 - it'll not work.
MauranKilom · 2019-10-05
Either of your mentioned options for implementing template parsing were used by implementations when C++ was conceived (but before it became an ISO standard). Your "token string" approach is the route that Microsoft took with MSVC, whereas other compilers went with what later became standardized as "two phase lookup".
In short: Token stream alone is not enough. You need to decide whether T::A * b; is a pointer declaration or a multiplication immediately when you parse the template. If A is a dependent name (i.e. if T is a template parameter), it is assumed to be a variable (if that's not correct, the programmer must use typename or template).
MSVC has only recently completed their implementation of two-phase lookup, some twenty years after it was defined as the correct option in the ISO C++ standard. They have an excellent writeup here: https://devblogs.microsoft.com/cppblog/two-phase-name-lookup-support-c…
Maxatar · 2026-08-07
The reason the world didn't end is because people refused to upgrade Visual Studio, in particular Microsoft's bigger customers. Microsoft surveyed their users for why people weren't making the switch to VS 2013 despite all the "nice" and "new" features introduced and the predominant reason was due to all the ABI breakages.
For VS 2015 they adopted a policy of having a stable ABI and have preserved ABI compatibility for over 10 years now [1].
[1] https://devblogs.microsoft.com/cppblog/binary-compatibility-and-pain-f…
teki_one · 2026-03-23
The problem is not new: https://devblogs.microsoft.com/cppblog/mfc-update-powered-by-bcgsoft/
anankaie · 2026-02-15
You do not need a Professional or Enterprise license to use the Visual Studio Build Tools:
> Previously, if the application you were developing was not OSS, installing VSBT was permitted only if you had a valid Visual Studio license (e.g., Visual Studio Community or higher).
From (https://devblogs.microsoft.com/cppblog/updates-to-visual-studio-build-… For OSS, you do not even need a Community License anymore.
malfmalf · 2026-01-29
They are using modules in the MS Office team:
https://devblogs.microsoft.com/cppblog/integrating-c-header-units-into…
kev009 · 2025-11-17
C11 has a mutex API (threads.h), so why would it rely on POSIX? Are you sure it's not an runtime detail on one platform? https://devblogs.microsoft.com/cppblog/c11-threads-in-visual-studio-20…
cremno · 2025-07-21
"Windows" did this 11 years ago:
>FILE Encapsulation: In previous versions, the FILE type was completely defined in <stdio.h>, so it was possible for user code to reach into a FILE and muck with its internals. We have refactored the stdio library to improve encapsulation of the library implementation details. As part of this, FILE as defined in <stdio.h> is now an opaque type and its members are inaccessible from outside of the CRT itself.
https://devblogs.microsoft.com/cppblog/c-runtime-crt-features-fixes-an…
dwattttt · 2025-05-12
A cursory browse says there's no Linux-isms in the code base, so the Windows-y way to build that (without going into licensing) would be to use the Visual Studio Build Tools. They're the CLI toolchain you get for Visual Studio, but free when compiling open source projects (as of recently: https://devblogs.microsoft.com/cppblog/updates-to-visual-studio-build-…
They still notionally need to run on a Windows machine, although I recall people have managed to run them under wine before.
EDIT: It took me a few reads to parse what the link is saying, so: using the toolchain to compile open source dependencies is fine, even if your codebase is closed source, so long as the closed source part isn't being built with the Build Tools.
sigsev_251 · 2025-01-10
I think the documentation is outdated given that C11 atomics [1] and threads [2] are available for more than a year now. Same goes for pretty much everything MSVC frontend related stuff (I've yet to try which C++23 features are supported at the moment, but they've secretly added support for C23 features like typeof and attributes, as well as GNU Statement Expressions).
[1]: https://devblogs.microsoft.com/cppblog/c11-atomics-in-visual-studio-20…
[2]: https://devblogs.microsoft.com/cppblog/c11-threads-in-visual-studio-20…
motorest · 2024-12-23
> Those C89 hardliners have a different point of view.
C89 was only a thing because Microsoft somehow decided to drag it's feet and prevented msvc from supporting anything beyond c89 for a long, long time. Only in 2020 did they manage to finally do something about it.
https://devblogs.microsoft.com/cppblog/c11-and-c17-standard-support-ar…
tnh · 2024-05-08
Yes (at least approximately, I'm fuzzy on the details).
These days it supports both. (IIRC the default is legacy/nonstandard, you select the standard behavior with /fpermission-, and VS adds /fpermission- to newly generated projects)
https://devblogs.microsoft.com/cppblog/two-phase-name-lookup-support-c…
synergy20 · 2024-04-26
not true anymore, c11 and c17 are either supported or coming
https://devblogs.microsoft.com/cppblog/c11-and-c17-standard-support-ar…
Too · 2024-04-07
For a long time this was true but recently MS turned around and is now supposedly supporting even C17.
https://devblogs.microsoft.com/cppblog/c11-and-c17-standard-support-ar…
CyberDildonics · 2024-04-05
https://devblogs.microsoft.com/cppblog/new-code-analysis-checks-in-vis…
Actually it would trigger the first time you use something after moving and it's pretty obvious what happened because the data structure will have null pointers.
This is very rare and usually just due to a typo in practice because moving a variable in the middle of function is mostly to pass it to another function as an argument so it will be cleaned up when the function is done.
How often does this happen to you? Do you work in modern C++? I've never heard of this actually tripping anyone up.
LoganDark · 2024-03-12
FWIW, I opened a PR that adds Windows support: https://github.com/rkaehn/cr_task.h/pull/2
I may play with the C11-standard `threads.h`, but note that it was not implemented by MSVC at all until quite recently: https://devblogs.microsoft.com/cppblog/c11-threads-in-visual-studio-20…
Edit: Made a C11 threads.h implementation as well. https://github.com/rkaehn/cr_task.h/pull/3