C++ just got a new operator
It looks like this: ^^
The committee calls it "the cat-ears operator." It's the gateway to the biggest language change since templates π§΅π
C++26 ships compile time reflection (P2996). The ^^ operator turns any entity (type, function, enumerator) into a compile-time mirror you can inspect and transform
Enum-to-string? One function. JSON serialization? No macros. By @BarryRevzin and six co-authors
You have a variant<Dog, Cat, Raccoon>
You also have an enum { Dog, Cat, Raccoon } that you manually keep in sync with it
One day someone adds Fox to the variant but forgets the enum. The switch compiles and the bug ships
What if the enum wrote itself? π§΅π
When you write co_await f() in C++, three questions need answers:
Which thread resumes you? Should you stop? Where does the frame get allocated?
Right now every coroutine library answers these differently. There's a proposal to unify them
P4003 by @FalcoVinnie, Mungo Gill, and Steve Gerbino proposes IoAwaitable: a minimal coroutine execution protocol
Implemented on three platforms. Designed as a companion to std::execution, not a replacement
Every C++ developer has a cursed shell script somewhere that converts a binary file into a C array so it can be compiled in
bin2c. xxd. Platform specific linker hacks. Custom CMake incantations
C++26 just killed all of them. One preprocessor directive
C++26 ships #embed. Pull any file into your binary at compile time. Shaders, fonts, certs, model weights. One directive, no tooling hacks
By @__phantomderp, who's been pushing this since 2018. Already in GCC 16.1 and Clang
Seven authors. Forwarded to EWG with committee consensus. And the title is a question most C++ developers assumed would never be asked officially:
"Should C++ be a memory-safe language?"
The debate is now open and it's already contentious
P3874 makes the case for a subset-of-superset strategy: new code gets a compiler enforced, UB-free subset. Existing code stays untouched
Not everyone agrees. The committee chose safety profiles over Safe C++. But this paper argues profiles alone won't get there. The debate continues