An option(al) to surprise you -- Andreas Fertig
In today's post I share a learning of a customer with you. A while back, a customer asked me to join a debugging session. They had an issue they didn't (fully) understand.
An option(al) to surprise you
by Andreas Fertig
From the article:
The base
What I will show you is a much down-stripped and, of course, altered version. It was about a message system, but that's not important. Have a look at the code below.
You can see a class enum for a state and a function
Worker. The function takes aStateand aconst char*message nameddata. The function's job is to create astd::optionalcontaining the user data, a C-style string.


A unique milestone: “Whole new language”
Templates are one of C++’s most powerful features, enabling developers to write generic, reusable code—but they come with a cost: notoriously verbose and opaque error messages. With the introduction of concepts in C++20, we can now impose clear constraints on template parameters and get far more helpful diagnostics when something goes wrong.
Some time ago, we developed a
C++ continues to refine its range library, offering developers more efficient and expressive ways to manipulate collections. In this post, we'll dive into three powerful range adaptors—
Modern C++ offers a variety of ways to work with key-value data structures like