Understanding Object Lifetime For Efficient and Safer C++

Jason Turner

⏱ 1-day-workshop
10:00-18:00, Tuesday, 2nd July 2024

C++ has something very few other languages have: a well defined object life cycle. Understanding this key aspect of C++ is critical to writing clean, maintainable, and efficient C++.

Topics we will cover include:

  • Understanding RAII
  • What does the standard say?
  • Member variable lifecycle
  • How and why to limit variable scope
  • The as-if rule
  • std::move and std::forward
  • Passing values
  • Returning values
  • Lifecycle of lambda captures
  • How the C++ memory model and object lifetime relate
  • Gotchas


The abstract generally covers the outline

🏷 object lifetime

Jason Turner

Jason has 2 decades of C++ experience and is a regular conference speaker, developer, and trainer. He has been publishing weekly C++ videos on his YouTube channel, C++ Weekly, since 2016.