Module 07 of 10

Modern C++ (11 to 23)

Lessons

About This Module

Since C++11 the language has changed a lot, and most new code uses these features every day. This module starts with the auto keyword, which lets the compiler deduce a type for you, and then covers lambda expressions, small inline functions that you can pass around and capture variables into, following how they grew from C++11 through C++20.

The last two lessons cover move semantics: how rvalue references and std::move let you transfer resources instead of copying them, first with a short introduction and then with a deeper look at move constructors and move assignment.

Watch the lessons in order, then continue on to Concurrency.

Lessons

4 videos
01

The "auto" Keyword in C++

How type deduction works, when auto makes code cleaner, and when spelling out the type is the better choice.

02

Illuminating Lambda Expressions in C++

A walk through lambda expressions as defined in C++11 and the improvements added in C++14, C++17 and C++20.

03

Move Semantics in C++

Why unnecessary copies are costly, and how rvalue references, move constructors and std::move avoid them.

04

Back to Basics: Move Semantics

A CppCon deep dive into implementing a type with move semantics, including the move constructor, the move assignment operator and common design pitfalls.