#cpp
15 posts tagged #cpp.
The sanitizers run live on Compiler Explorer
AddressSanitizer, UndefinedBehaviorSanitizer, and ThreadSanitizer all run in Compiler Explorer's execution pane. Add one -fsanitize flag, turn on execution, and the runtime report prints in the browser: the faulting line, the allocation site, the shadow-byte map, both racing stacks. There is no cheaper way to show a colleague exactly why a bug is a bug.
The syscall behind C++ asymmetric fences
Asymmetric fences let you pay for a memory barrier only on the rare path. The common path gets a free compiler barrier; the uncommon path calls Linux membarrier(), which forces every other thread to run a full fence for you. Ryan Chung Yi Sheng's deep-dive follows the idea from the C++ standard down to the kernel, and finds a possible crack in the wording along the way.
Less standard library, faster program
Jussi Pakkanen (creator of Meson) rewrote a subset of the C++ standard library from scratch, dropping ISO conformance to chase compile speed. Converting his real CapyPDF library to it cut compile time ~80% and binary size ~75%, and made the program ~25% faster, with no runtime penalty for the faster build.
One word, final, turns a virtual call into two instructions
A C++ Weekly episode reminded everyone of a free win: marking a class final lets the compiler devirtualize. We took the canonical example to GCC 16.1 at -O2 and read the actual assembly. Without final, GCC hedges with a runtime vtable check; with final, the whole call folds to mov eax, 42; ret. The asm is the proof.
How the C++ community is actually using AI in 2026
The question in the C++ world has shifted from whether to use LLMs to how to use them well. A roundup of where that conversation is right now: Jason Turner's three-part C++ Weekly arc on getting useful code out of AI, CppCast on teaching C++ in the LLM era, and Herb Sutter asking the uncomfortable question about agents doing harm.
CppCon 2026 puts three language designers on one stage
CppCon 2026 (Sep 12-18, Aurora CO) will host the conference's first-ever keynote panel: Bjarne Stroustrup (C++), Guido van Rossum (Python), and Mads Torgersen (C#) on one stage. Three creators of three of the most-used languages alive, comparing notes on where their languages are headed.
Gor Nishanov (1971-2026), who gave C++ its coroutines
Gor Nishanov, the architect of C++20 coroutines, has died at 54. From the 2014 resumable-functions papers to shipping implementations in MSVC and Clang, he spent the better part of a decade turning co_await into a standard language feature. Herb Sutter remembered him as intelligent and witty, but above all kind.
std::rotate: how libstdc++ and libc++ actually differ
Raymond Chen's June 2026 series on The Old New Thing exposed a surprising fact: libstdc++ and libc++ implement std::rotate with completely different algorithms. libstdc++ swaps left-to-right and ends at n-1 swaps with good locality. libc++ decomposes the rotation into gcd(a, n) cycles and hits ~n/2 swaps but with poor locality. Which is faster depends entirely on your input shape.
Profiles take shape, and the contract C++26 left behind comes back
The other half of the Brno safety story: a profiles framework with real syntax (attributes, not pragmas) plus two concrete profiles from Stroustrup, and P3097 bringing virtual-function contracts back after they were cut from the C++26 MVP. All target C++29.
Five small C++29 papers from Brno you will actually use
Underneath the safety headlines, WG21 Brno cleared a stack of small papers that working programmers will feel every day: designated-initializers that reach through a base class, a map .get() that does not insert, defaultable postfix operators, constexpr pointer tagging (which quietly leans on reflection), and mandatory intptr_t. All target C++29.
C++ is writing down all of its undefined behavior
The structural move at WG21 Brno was not a feature -- it was a catalogue. P3596 adds two annexes that enumerate every case of undefined behavior and every ill-formed-no-diagnostic-required corner in the standard, and P3100 turns that list into a case-by-case program to close each one for C++29. There are exactly 80 core-language UB cases, and 70% of them are memory-safety bugs.
WG21 Brno: with C++26 done, the committee turns to undefined behavior
The WG21 Brno meeting (June 8-13, 2026) was the first since C++26 was finalized, and per Herb Sutter's trip report the theme is unmistakable: catalogue and eliminate undefined behavior, push memory-safety profiles toward C++29, and finish the pieces the C++26 MVP deferred. Reflection, the headline of C++26, was not on the marquee -- and that is exactly what shipping looks like.
CUDA 13.3: tile programming in C++ without the boilerplate
NVIDIA CUDA 13.3 (May 26) adds C++ tile programming: declarative tile abstractions replace manual shared memory, synchronization, and indexing. CompileIQ autotuning uses evolutionary algorithms to tune tile sizes and memory layout per kernel (up to 15% speedup on GEMM/attention). Works on Hopper and all other supported architectures.
C++: The Documentary is now on YouTube
CultRepo's 'C++: The Documentary' had its world premiere on May 28 in New York and is now available worldwide on YouTube. The film traces C++ from Bell Labs in 1979 through the language's role in modern infrastructure. Sponsored by Hudson River Trading.
Sutter's BeCPP keynote: C++ added more developers in 4 years than any other language
Herb Sutter's keynote at the BeCPP Symposium 2026 (March 30, Howest, Belgium) opened with a SlashData chart almost nobody outside the room has seen yet: C++ developer population grew 72% from Q1 2022 to Q1 2025 -- from 9.5M to 16.3M. That is the biggest absolute net gain of any general-purpose language over the period. Rust grew faster in percentage (137%) but on a smaller base (5.1M total). Here is the chart, the numbers behind it, and the thesis Sutter built on top -- plus an honest read on what 'fastest growing' means when JavaScript is still bigger than the second + third place combined.