Overengineering max(a, b)

Mixed comparison functions, common references, and Rust’s lifetime annotations

max is a function that returns the maximum of two numbers. While it seems simple on the surface, there are some nuances if you want to make it fully generic. For starters, what is max(-1, 1u) or max(lvalue, prvalue)?

Let’s go on a journey of overengineering max. We’ll …

An (In-)Complete Guide to C++ Object Lifetimes

A C++ program manipulate objects, but it is undefined behavior if you attempt to manipulate them while they are not alive. So let’s do a deep dive into object lifetime.

When are objects created, and when are they destroyed? How does temporary lifetime extension come into …

Express your expectations

A fast, compliant JSON pull parser for writing robust applications


There are, by now, several well-established C++ JSON libraries, for example, boost.JSON, rapidjson, and simdjson. C++ developers can choose between DOM parsers, SAX parsers, and pull parsers. DOM parsers are by design slow and use a lot of memory, SAX parsers are clumsy to use …

The New Library On The Block

A strong library foundation for your next project


We at think-cell have given many conceptual talks about iterators, ranges, string formatting, and generic programming in the past. Now, we would like to present the library that is the foundation of our code base and that lets us write code the way we like it: Short, elegant, and …

Coroutines: C++ vs Rust

C++ on Sea

C++ and Rust are both system programming languages that recently received support for asynchronous programming using coroutines. Given the memory and time constraints, both languages opted for stackless coroutines implemented by a compiler-generated state machine. However, beyond …

The Static Initialization Order Fiasco

How to Properly Initialize Global State

Meeting C++

Global variables are initialized before main() runs, but the relative initialization order is not necessarily well-defined. As such, accessing global state while you initialize your global variables, might not work the way you expect.

A simple solution is to stop using global …

Rethinking Pointers


“Do not use owning raw pointers, use a smart pointer instead.” — And yet it is common to use them when writing a linked list, for example.

“Use a reference when a pointer is non-null.” — But the standard library interfaces themselves don’t follow …

I Just Wanted to Point to Something!


Every non-trivial programming language needs a way to refer to another object that is stored in a different place. In some programming languages this behavior is the default ­— they have reference semantics.

But this is not the case in C++. In C++ you need a special type to refer …

Fun with (User-Defined) Attributes

Meeting C++

C++11 added a generalized attribute syntax to annotate your code with additional information - basically comments that your compiler will read. It also standardized a couple of attributes. C++14 and 17 went on to add more standardized attributes. But C++17 also added another …

Type-safe Programming


C++ provides a really advanced type system. A prime example of its application is std::chrono: It uses the type system to create different types for different units and prevent programmer errors.

But the same principle can be applied to your everyday code - this talk is going to …

Designing and Implementing a new Allocator model

Meeting C++

Judging by the recent amount of talks about the STL Allocator model it is a pretty well-known fact that is has some issues. This is a problem because allocators are essential for many performance demanding applications such as games. The STL model makes it awkward both to write …