Write More C++ Code Thanks to constexpr -- Andreas Fertig
Since its introduction, the constexpr keyword in C++ has steadily evolved with each new standard, becoming an increasingly powerful tool for compile-time computation and optimization. In this article, I’ll share a real-world example of how constexpr helped optimize memory usage and improve performance for an embedded system project, showcasing its potential to transform how we approach C++ programming.
Write More C++ Code Thanks to constexpr
by Andreas Fertig
From the article:
Since the keyword
constexprand its behavior got included in C++, it has been improved in each and every new standard of the language.I'm a big fan of
constexprand am not alone. Jason Turner is also very vocal, having coined the term "constexpr all the things".Well, demonstrating the powers of
constexpris nonetheless something difficult. I know that from my training classes and various consulting contracts. Today, I'd like to share a story from back in time when a customer hired me to consult. They did develop an embedded system and ran out of memory. Not during run-time, but before. The features they wanted to put in the chip were too big in code size and somewhat RAM.Initial
constexpr-free exampleThey used a class I've seen a couple of times in embedded systems with some variations. A string brings its memory picky-back.

Sometimes, we all need a way to iterate over a container in the opposite direction. There are several ways to reverse-iterate a container, and in this article, we’ll explore them.
In this article, you’ll see eight larger examples that illustrate the changes in C++23.
When tasked with diagnosing why a pointer passed through a pipeline emerged offset from its original value, I discovered an interesting culprit: the misuse of a wrapper function around
Back in the day, being a witch was considered a grave crime. Today, we’re diving into one of C++’s lesser-known spells: ADL (Argument-Dependent Lookup).