From Token Sequences to operator for
Iterating Ranges: Insanely and Then Properly
operator forIterating Ranges: Insanely and Then Properly
In a previous post, I discussed the differences between push-based and pull-based customization in the context of trying to implement support for formatting and structured bindings. For those problems, pull-based customization (adding an annotation to a type and having a partial class template sp...
Almost two years ago now, I wrote the post Rust Attributes vs C++ Annotations. That post, I walked through how in standard C++26 we could get this code: struct [[=derive<Debug>]] Point { int x; int y; }; To have similar behavior and effect to this standard Rust code: #[derive(De...
meta::substituteMy CppCon 2025 talk, Practical Reflection, is now online. Check it out! Over winter break, I started working on proposal for string interpolation. It was a lot of fun to work through implementing, basically an hour a day during my daughter’s nap time. The design itself is motivated by wanting t...
C++26 Status Quo I’d previously written about how difficult it is to extend support for using class types as constant template parameters. These are the template parameters formerly known as non-type template parameters. But it turns out that since C++98, we had three kinds of template param...
Last week, C++26 was finalized in Sofia, Bulgaria — and C++26 will include all of the reflection papers that we were pushing for: P2996R13: Reflection for C++26 P3394R4: Annotations for Reflection P3293R3: Splicing a Base Class Subobject P3491R3: define_static_{string,object,array} P1...
Frequently, whenever the topic of Reflection comes up, I see a lot of complains specifically about the new syntax being added to support Reflection in C++26. I’ve always thought of that as being largely driven by unfamiliarity — this syntax is new, unfamiliar, and thus bad. I thought I’d take a d...
My CppCon 2025 talk, Practical Reflection, is now online, and goes over this example in more detail and more digressions. Check it out! Recently, I watched Andrew Kelley’s talk on Practical Data Oriented Design. It goes into some of the architectural changes he’s been making to the Zig compiler...
There was a StackOverflow question recently that led me to want to write a new post about Ranges. Specifically, I wanted to write about some situations in which Ranges do more work than it seems like they should have to. And then what we can do to avoid doing that extra work. I’ll offer solutions...
I was reading through the latest mailing, and a sentence caught my eye in P3661 (“Attributes, annotations, labels”), emphasis mine: Attributes turned out to be unsuitable for the role of “small features”, “small modifications to bigger features” or annotations from other languages. The need f...