RSSAmplifier

Blog

AndreasFertig.com

/RSS feed ↗20 posts

Latest posts

More compile-time checks with std::nullptr_t

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 …

C++ Insights Episode 76: New, better, lambda visualization in C++ Insights

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

Keep It Tight: Restrict Variadic Templates Using C++20 Concepts

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 …

C++ Insights new lambda transformation

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 …

C++ Insights Episode 75: The Ref-Qualifier That Saves You from Undefined Behavior

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

More C++26 reflection at compile-time

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 …

C++ Insights Episode 74: Why move requires noexcept in C++20

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

Happy 8th anniversary C++ Insights

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 …

From Undefined to Defined: Using std::launder in C++

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 …

C++ Insights Episode 73: Things you can do effortlessly with C++20s concepts

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

Open-Enrollment classes in 2026

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 …

iX Article: Neue Features in C++26

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

What reinterpret_cast doesn't do

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 …

C++ Insights Episode 72: Why you should never call a virtual member function in a constructor

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

Best performance of a C++ singleton

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 …

C++ Insights Episode 71: C++23: multidimensional operator[]

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

CppCon 2025 recording of my talk "Back to Basics: static, inline, const, and constexpr" is available

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 …

The Reset trick

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 …

C++ Insights Episode 70: Efficiently passing a std::source_location object

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

Singleton done right in C++

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 …