Skip to content

San Francisco: std::optional<T>

Photo of Arthur O'Dwyer
Hosted By
Arthur O. and Armin P.
San Francisco: std::optional<T>

Details

This month Arthur O'Dwyer will talk about std::optional, one of the new features of the C++17 standard library.

What is std::optional? Why does it sometimes behave like a pointer and sometimes behave like a container? Fundamentally, what does it mean to have a T object that sometimes exists and sometimes doesn't? What template metaprogramming techniques are needed to implement the requirements on the type, such as

  • a destructor that is conditionally trivial

  • constructors that are conditionally constexpr and conditionally explicit

  • perfect-forwarding an initializer-list

This talk will be more off-the-cuff than usual, and may be relatively tilted toward Q&A.

Arthur O'Dwyer spent five years in the compiler group at Green Hills Software. He has presented at CppCon, C++Now, and Silicon Valley Code Camp. He currently works for Mixpanel in San Francisco.

Photo of Cpp Bay Area: C++ Programming In and Around Silicon Valley group
Cpp Bay Area: C++ Programming In and Around Silicon Valley
See more events