No Moves, In-Place Construction: Perfect Forwarding vs. Variadic Templates

In a small code snippet we will extend the post from the NetworkBuffer that we used in our previous article with lambdas and views. We will demonstrate the difference between variadic templates and perfect forwarding vs perfect forwarding. You can find the cpp file in the src-code of the blog repo. The Packet & Buffer - Code In the NetworkPacket we have kept only two member variables for simplicity. Then we make the move ctor and move assignment operator custom so we can see when they are called. ...

March 25, 2026 · 3 min · 557 words

The 'T&&' Trap: Forwarding References in Templated Classes

In this article we will see shortly the trap of forwarding references for a member function of a class that is already templated. Let’s start with a practical and simple example of designing our own stack and get to the topic. Below we design a simple stack using a vector. We just need functions of empty ,top, pop and push. As always, you can also find the code example in the src-code from the repo. ...

March 15, 2026 · 3 min · 543 words

The Most Dangerous Pattern in C++: Why `const T&` Is Breaking Your Code

const T& binds to everything but it is dangerous

January 7, 2026 · 5 min · 871 words