Home

Recursive lambdas from C++14 to C++23

There are algorithms that have natural recursive representation and are very cumbersome or painful to write iteratively. With the advent of lambda expressions in C++11, it seemed just natural that they should support recursive calls. But the reality hit hard, recursion and lambdas hadn’t mixed at all until C++14, and even then the support was fa...

Read more... (Approximate reading time 8 minutes)

How to initialize everything in modern C and stay sane

Have you ever struggled with initialization of a struct, trying to set all its members to default values while writing code that’s both efficient and readable? Or committed a piece of code where you memset-ed a just declared array with zero’s? In this article, you’ll learn how to initialize just about everything in C to zero, using consistent, m...

Read more... (Approximate reading time 6 minutes)

Rvalue references and move semantics 101

Rvalue references and move semantics can hardly be counted among the beginner’s topics in C++. After encountering them for the first time in a Scott Meyer’s book, I felt deeply confused. Like, what would you ever need them for? And why make an already complex language even more so? It turns out, not only are rvalue references useful, but they al...

Read more... (Approximate reading time 10 minutes)