Have you registered for CppCon 2018 in September? Early bird registration is open now.
While we wait for this year’s event, we’re featuring videos of some of the 100+ talks from CppCon 2017 for you to enjoy. Here is today’s feature:
The Nightmare of Move Semantics for Trivial Classes
by Nicolai Josuttis
Summary of the talk:
Assume, we implement a very simple 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 universal/forwarding references, enable_if, type traits, and concepts.