Talk: The Nightmare of Move Semantics for Trivial C++ Classes


Assume, we implement a very simple C++ class having just multiple string members. Even ordinary application programmer prefer to make it simple and fast.

You think you know how to do it? Well beware! It can become a lot harder than you initially might assume.

So, let’s look at a trivial class with multiple string members and use live coding to see the effect using different implementation approaches (using constructors passing by value, by reference, by perfect forwarding, or doing more sophisticated tricks).

Sooner than later we will fall into the deep darkness of C++ with universal/forwarding references, enable_if, type traits, and concepts. And get to a surprising conclusion.