C++Now 2018: Jonathan Müller “Rethinking Pointers”





The interactive transcript could not be loaded.


Rating is available when the video has been rented.
This feature is not available right now. Please try again later.
Published on May 29, 2018


Presentation Slides, PDFs, Source Code and other presenter materials are available at: http://cppnow.org/history/2018/talks/

"Do not use owning raw pointers, use a smart pointer instead." — And yet it is common to use them when writing a linked list, for example.

"Use a reference when a pointer is non-null." — But the standard library interfaces themselves don't follow this advice all the time.

We're at a point where a simple question "I need to point to some other object" requires a complicated lecture about raw vs. smart pointers, references and the danger of putting references inside angle brackets. Clearly we can do better.

Let's take a step back, and look at the bigger picture:
What are the common pointer-like types?
Which properties do they have in common, which are unique?
What are the possible situations that require pointer-like types?
Which properties do those situations require?

This talk will answer those questions and so provide the definitive guide to choosing the correct pointer types.
We'll be discussing whether or not `optional<T&>` or `std::observer_ptr` are necessary, talk about the difference in applications for `T&`, `gsl::non_null<T>` and `std::reference_wrapper<T>`, and look how the type system can help us catch lifetime issues.

Jonathan Müller
RWTH Aachen University

Jonathan is a second-year Computer Science passionate about C++. In his spare time he works on various C++ open source projects, like foonathan/memory, an allocoator library, or standardese, a C++ documentation generator. He also blogs about C++ and library development at foonathan.net. When he isn't doing C++ related things, he enjoys reading about non-programming things, or goes

Videos Filmed & Edited by Bash Films: http://www.BashFilms.com


to add this to Watch Later

Add to

Loading playlists...