Skip to main content
  1. Tags/

C++

2026


How to annotate in C++26 (1)

·1224 words·6 mins

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))]].

More ...

Recursive lambdas in C++

·1575 words·8 mins

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

·1322 words·7 mins

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 ...