Loading…
CppCon 2019 has ended
Back To Schedule
Thursday, September 19 • 15:15 - 16:15
Back to Basics: Smart Pointers

Log in to save this to your schedule, view media, leave feedback and see who's attending!

Smart pointers are one of the key features of modern C++. We'll cover the two fundamental strategies used by the standard smart pointers: unique ownership transfer and reference-counting. We'll show how shared_ptr uses control blocks to implement reference-counting of arbitrary objects, and how to use weak_ptr in conjunction with shared_ptr. We'll explain the convenience functions make_shared and make_unique, and demonstrate how they are more than just conveniences. Finally, we'll motivate, implement, and demystify the curiously recurring template enable_shared_from_this<T>.

Attendees will leave this session with a clear understanding of how C++11's smart pointers work under the hood.

Speakers
avatar for Arthur O'Dwyer

Arthur O'Dwyer

C++ Trainer
Arthur O'Dwyer is the author of "Mastering the C++17 STL" (Packt 2017) and of professional training courses such as "Intro to C++," "Classic STL: Algorithms, Containers, Iterators," and "The STL From Scratch." (Ask me about training your new hires!) Arthur is occasionally active on... Read More →


Thursday September 19, 2019 15:15 - 16:15 MDT
Aurora A
  Back to Basics