Universal/Forwarding References - A Key to More Modern C++

Speaker: Nicolai Josuttis

Audience level: [ Intermediate | Advanced ]

Universal/forwarding references were introduced in C++11 mainly for perfect forwarding of move semantics.

However, over time they became more and more a key feature in various situations of C++.
One example is the implementation for the range-based for loop.

With C++20 they even get an important for ordinary application programmers.
You need them to be able to implement generic code that works for both containers and views.

Time to look carefully at <code>T&&</code>, <code>auto&&</code> (and maybe their cousin <code>decltype(auto)</code>) in detail.