Posts
Sandor Dargo's Blog
Cancel

C++26: range support for std::optional

I learned about the new range API of std::optional from Steve Downey at CppCon 2025 during his talk about std::optional<T&>. To be honest, I found the idea quite strange at first. I wante...

C++26: std::optional<T&>

If you’re a regular reader of my blog, you know I’ve been sharing what I learn about new C++ language and library features ever since C++20. You probably also read my CppCon 2025 Trip Report. And t...

Trip report: CppCon 2025

A dream came true. My C++ conference journey started with CppCon. Well, almost. Back in 2019, my senior manager told me I would travel to the USA for a week to attend CppCon. In the end, cost-cutti...

Discovering observers - part 3

Over the last two weeks, we explored different implementations of the observer pattern in C++. We began with a very simple example, then evolved toward a more flexible, template- and inheritance-ba...

Discovering observers - part 2

Last week, we took the observer pattern from a very simple example and evolved it into a more flexible, template-based implementation in C++. We ended up with abstracted publishers and subscribers,...

Discovering observers - part 1

The goal of this mini-series is to explore the Observer Design Pattern in C++, walking through different implementations and weighing their pros and cons. First, let’s briefly recap what the obser...

How to look up values in a map

Whether you’re in a coding interview or writing production code, you’ll eventually face the question: What’s the right way to look up values in a std::map or std::unordered_map? For simplicity, we’...

C++26: Concept and variable-template template-parameters

Last week, we discussed why we should sometimes use remove_cvref_t on our template parameters before applying concepts to them. We also saw that the solution is not super readable because we lose a...

Use concepts with std::remove_cvref_t

This article was inspired by Mateusz Pusz’ The 10 Essential Features for the Future of C++ Libraries talk at C++ on Sea 2025. Let’s talk about templates, constraints, and concepts. We’ll start wi...

Avoiding Undefined Behaviour with BoostTests and standard types

Maybe the title is a bit clickbaity — sorry for that. But I’ve seen many people unintentionally introduce undefined behaviour (UB) into their code through Boost unit tests. Sure, it’s “only” in the...