#cpp
29 posts tagged #cpp.
Meeting C++ 2026 lands in Berlin with a units-library keynote
Meeting C++ 2026 runs 26 to 28 November in Berlin, hybrid as always. Two keynotes are announced so far: Mateusz Pusz, author of the mp-units library now on its way into the standard, and Kate Gregory. For anyone following the quantities-and-units work, the library's author opening the main European C++ conference is worth a note in the calendar.
The hottest line is often not the one worth optimizing
A sampling profiler tells you where time is spent, which is not the same as where speeding things up would help. Causal profiling answers the second question directly, and it routinely disagrees with the first. A tour of the profilers worth knowing in 2026: Coz, Tracy, poop, samply, and plain perf.
You can see the dependency chain without running anything
Before reaching for a profiler, read what the compiler already produced. Two loops that add the same floats compile to eight adds into one register versus four independent accumulators, and llvm-mca will predict the throughput difference from that assembly without executing a single instruction. Episode 4 of the verification series.
RealtimeSanitizer checks the promise that a function never blocks
Mark a function [[clang::nonblocking]] and RealtimeSanitizer verifies at runtime that nothing inside it allocates, locks, or makes a syscall. It is the sanitizer for audio callbacks, control loops, and any deadline-bound code where a hidden malloc is a dropped frame. Episode 3 of the verification series.
The same assertion, as a unit test and as a fuzzer
Google FuzzTest lets one assertion serve as both a bounded property test that runs with your normal suite and a coverage-guided fuzzer you invoke on demand. Written against a deliberately buggy encoder, it found the counterexample without being asked to fuzz at all, and printed a regression test to paste back.
A real GoogleTest suite runs in your browser
GoogleTest is a Compiler Explorer library, so a real test binary builds and runs in the browser and prints the familiar RUN/OK report. That makes a shareable link the cheapest possible way to settle an argument about behavior. Episode 1 of the verification series, on assembling a C++ setup that catches bugs before your users do.
Carbon is still pre-0.1, with 1.0 somewhere after 2028
Carbon gets discussed as though it were an option you could evaluate. It is not one yet: the project has not reached 0.1, its own roadmap puts that at late 2026 at the earliest and 1.0 sometime after 2028, and it says so plainly. Reading the roadmap is a better use of ten minutes than another Carbon-versus-Rust argument.
{fmt} can do the whole format at compile time
FMT_COMPILE parses the format string during compilation and emits straight-line formatting code, so a format call can be a constant expression with no parsing at runtime. The 12.2 release adds a type-safe C API, a proper C++20 module target, and turns the full Dragonbox cache on by default for faster float formatting.
CppCon 2026 is onsite only, and Stroustrup opens it
CppCon runs 12 to 18 September in Aurora, Colorado, and this year there is no online track. Sessions are recorded and posted to YouTube afterwards, but nothing is streamed live, so remote attendance is not an option. Bjarne Stroustrup gives the Monday opening keynote.
Two compilers, one float-to-int cast, two different wrong answers
Converting a float to an int is undefined behavior when the value does not fit, and for NaN. Nothing warns by default, and GCC and Clang produce different results for the same cast. Worse, GCC deliberately leaves the check out of -fsanitize=undefined, so you have to name float-cast-overflow to catch it.
Chrome fixed 1,072 security bugs in two releases and 97% of its code is span-clean
Chrome 149 and 150 fixed more security bugs than the previous 23 milestones combined, and 97% of first-party Chrome code now compiles cleanly under strict unsafe-buffer warnings. The strategy is worth reading closely: harden C++ aggressively, migrate selectively, and admit openly that runtime mitigations are approaching diminishing returns.
GCC will decline AI-generated contributions above the legal threshold
The GCC Steering Committee has adopted a policy declining any legally significant contribution that includes or is derived from LLM-generated content. Test cases are an explicit exception, small contributions are allowed if clearly marked, and using a model to find bugs or review patches stays permitted. Commits that had AI help need an Assisted-by tag, and only humans may submit or sign off.
A new proposal deletes your enum bitmask boilerplate
Every C++ codebase that uses a scoped enum as a flag set writes the same eight operator overloads by hand, just to get |, &, and ~ back. P4313 in the 2026-07 mailing proposes an opt-in attribute, enum class [[std::bitmask_type]], that generates all of it and keeps each bitmask a distinct type. Here is the boilerplate it removes, running today.
Google Benchmark runs live on Compiler Explorer
You do not need a local build to run a real microbenchmark. Add the benchmark library on Compiler Explorer, turn on execution, and Google Benchmark prints its timing table in the output pane. The demo is also the first lesson every microbenchmark teaches: without benchmark::DoNotOptimize the compiler deletes the loop you are trying to measure and reports a time near zero.
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.