In today's post, I like to show you the benefit of a often unknown type: std::nullptr_t . You have that data type in the language since C++11, together with the much more frequently used nullptr . While nullptr is the value, std::nullptr_t is the data type that can hold …
I published a new C++ insights episode: New, better, lambda visualization in C++ Insights. In this episode, you'll share the latest change in C++ Insights regarding visualizing lambdas. Andreas
I previously wrote about C++20's Concepts. Today I would like to discuss another aspect of Concepts: how they help you to limit the data type of a variadic type-template parameter to a specific one for all datatypes in the set. For reference, these are my previous posts about C …
Last week I pushed an updated lambda transformation for C++ Insights . Here is a little background on the change. Since I first published C++ Insights when you transformed a lambda like the following: 1 2 3 4 5 6 int main () { int val { 4 } ; auto lamb = [ & ] { return val ; }; } The result …
I published a new C++ insights episode: The Ref-Qualifier That Saves You from Undefined Behavior. In this episode, you'll learn how req-qualifers save you from undefined behavior. Andreas
In today's post, I like touch-up on C++26's static reflection. In case you haven't seen, I wrote a first post C++26 reflection at compile-time a while ago. One of the great things about reflection is that we can already explore the new feature since with Clang there is …
I published a new C++ insights episode: Why move requires noexcept in C++20. In this episode, you'll learn why noexcept is crucial for move operations of a class. Andreas
This year, we celebrate the 8th anniversary of C++ Insights! Thank you all for the wonderful years of support! The current status I've been a bit slower in updating C++ Insights to work with the latest Clang version. As a birthday gift I released the latest C++ Insights version which …
In today's post, I will continue with the overall topics of the last two months. Today you'll learn when and where you need to apply C++17's std::launder and where the difference to this utility is to reinterpret_cast or std::start_lifetime_as . The fields where you can apply today's learning …
I published a new C++ insights episode: Things you can do effortlessly with C++20s concepts. In this episode, you'll learn how C++20s concepts help you to write less code that's easier to maintain at the same time. Andreas
The year 2026 is already four months old. I hope you had a good start to this year. If you're interested in working with me at one of my public classes, here is what you need to know. I will give a one-day online workshop on Safe and Efficient C …
An article I wrote for the German iX magazine "Neue Features in C++26" is available in issue 2026/04. It is available as a printed edition as well as online . I hope you find the article both interesting and inspiring. Andreas
In today's post, I will explain one of C++'s biggest pitfalls: reinterpret_cast . Another title for this post could be: This is not the cast you're looking for! My motivation My motivation for this blog post comes from multiple training classes I thought over the past several months and a …
I published a new C++ insights episode: Why you should never call a virtual member function in a constructor. In this episode, you'll learn by example why you should never call a virtual member function from a constructor. Andreas
In my Januray post, I focused on implementing a singleton correctly. This time I want to add performance into the mix and show you the best way to implement your singleton... or give you guidance to pick your best way. Setting the scene I'm using a display manager as an …
I published a new C++ insights episode: C++23: multidimensional operator[]. In this episode, you'll learn about the change to the operator[] in C++23. Andreas
I'm pleased to announce that the recording of my talk at CppCon Back to Basics: static, inline, const, and constexpr of my presentation is available YouTube : You can find the slides of this talk on my talks and training page . This site also contains details about my other public appearances …
My last month's post, Singleton done right in C++ , has triggered plenty of comments. I expected a few, but not that much. So thank you for keeping the conversation going. As I said in my previous post, this is not to advertise singletons at all. It is just if you …
I published a new C++ insights episode: Efficiently passing a std::source_location object. In this episode, I'll answer a question from a viewer about how to efficiently pass a std::source_location object. Andreas
In today's post, I like to touch on a controversial topic: singletons. While I think it is best to have a codebase without singletons, the real-world shows me that singletons are often part of codebases. Since at least for the code that I see singletons exists, let's make sure you …