Modern C++ Features

Content explaining modern C++ features introduced in C++11 and beyond, such as lambdas, smart pointers, and move semantics.

Modern C++ Features

Modern features introduced from C++11 onward: lambda expressions, smart pointers, and move semantics. Also covers tools like auto, constexpr, noexcept, std::optional, and std::variant.

Goal: Use the modern C++ toolbox to write safer, shorter, and faster code where it matters.

TL;DR

  • Lambdas: [&], [=], captures, return types.
  • Smart pointers: std::unique_ptr, std::shared_ptr, std::weak_ptr.
  • Move semantics: T(T&&), std::move, balancing copy vs. move.
  • Helpers: auto, constexpr, noexcept, std::optional/std::variant.