Recent notes
How to annotate in C++26 (1)
This post shows how to use different kinds of annotations in C++. Starting with a simple [[=annotation]], it moves to a more powerful [[=derive(Annotation)]] syntax, and ends up discussing the merits of using stateful annotations, like [[=derive(Annotation(WithSomeValue))]].
Recursive lambdas in C++
It’s hard to imagine functional programming without lambdas or recursion. True to the promise of being a multi-paradigm programming language, C++ has both these tools available. However, until recently, they couldn’t be used together. This post discusses how to work around this limitation and make use of recursion with lambdas in C++.
More ...Annotations in C++26 static reflection
C++26 added static reflection to the already big bag of compile-time features. One of the most powerful tools that made it into the language, as part of the reflection package, is the ability to use custom annotations and to inspect them at compile time. Here, we will see how to define simple annotations, and how to use reflection to extract them at compile time to generate code.
More ...