The Evolution of std::optional - From Boost to C++26 - Steve Downey - CppCon 2025 @CppCon
The Evolution of std::optional - From Boost to C++26 - Steve Downey - CppCon 2025  @CppCon
Uploaded November 2025 | Updated September 2026, 2 weeks ago
cppcon.org
---

The Evolution of std::optional - From Boost to C++26 - Steve Downey - CppCon 2025
---

Optionals were first proposed for C++ in 2005.

Optional<T> , where T is constrained not to be a reference, was added in 2017.

Optionals for lvalue references are on track to be added in C++ 26.

What are we getting and what design choices were made? This talk will show the results.

This talk will discuss the early history of Optionals, starting with Boost.Optional and “N1878: A Proposal to Add an Utility Class to Represent Optional Objects (Revision 1)”, and what the early concerns were for the reference specialization. “P1175R0: A Simple and Practical Optional Reference for C++” then re-proposed reference support for C++20, which was not adopted. In 2020, “P1683R0: References for Standard Library Vocabulary Types - an optional<&>case study” surveyed existing behavior of optional references in the wild, and pointed out the trap of assignment behavior being state dependent. In 2023, “P2988R0: Std:Optional” picked up the torch again, and Revision 10 of that is the proposal that is approved by the Library Working Group.

In 2024, “P3168R0: Give Std:Optional Range Support”, the proposal to make optional a range -- as opposed to having a separate range of zero or one -- was adopted. The reference implementation for optional<T&> and the test cases for views::maybe were used to vet the additional interfaces for optional range support. This merged implementation became one of the first Beman libraries, where the library and the optional reference proposal benefited immensely from the visibility and feedback.

The core of the difficulty has been that references are not values, and that types containing a reference do not have value semantics. References do not fit comfortably in the C++ type system. The core value semantic type that also has reference semantics is a pointer, but pointers have under-constrained and unsafe semantics. The lengthy discussion has been a proxy for what reference semantic types should look like in value semantic types within the standard library, particularly for "sum" types, like expected and variant, but also for view types such as single.

This talk will discuss Project Beman, Value and Reference Semantic Types, Sum and Product Types, CoData, and Lifetime Safety, among other topics.

---

Slides: github.com/CppCon/CppCon2025/blob/main/Presentations/stdoptional.pdf

Work at Hudson River Trading (HRT): tinyurl.com/safxfctf
---

Steve Downey

Steve Downey has been a programmer for more than 30 years. Steve graduated from SUNY Purchase with a BS in Mathematics. A Computer Science degree would have involved two classes before 11:00 am, so was impossible.

He has worked at Bloomberg since 2003, and is currently working as an Engineer on the C++ Infrastructure team.
---

CppCon is the annual, week-long face-to-face gathering for the entire C++ community. The conference is organized by the C++ community for the community. You will enjoy inspirational talks and a friendly atmosphere designed to help attendees learn from each other, meet interesting people, and generally have a stimulating experience. Taking place this year in Aurora, Colorado, near the Denver airport, and including multiple diverse tracks, the conference will appeal to anyone from C++ novices to experts.
Annual CppCon Conference - cppcon.org
linkedin.com/company/cppcon
https://x.com/cppcon
facebook.com/CppConference
reddit.com/r/cppcon
https://mastodon.social/@CppCon
---

Videos Filmed & Edited by Bash Films: BashFilms.com
YouTube Channel Managed by Digital Medium Ltd: events.digital-medium.co.uk
---

#cpp #cplusplus #cppcon #cppprogramming #cplusplusprogramming #softwaredevelopment #softwareengineering #coding #code #computerscience #technology #technews #programming #programmer
The Evolution of std::optional - From Boost to C++26 - Steve Downey - CppCon 2025Knockin on Headers Door: An Overview of C++ Modules - Alexsandro Thomas - CppCon 2025Lightning Talk: std::move & Spirited Away: When Nameless Objects Walk the Spirited WorldInvestigating C++ Legacy Design Trends: Newer Isn’t Always Better! - Katherine Rocha - CppCon 2024Lightning Talk: CppDefCon3 - WarGames - Kevin Carpenter - CppCon 2024Lazy and Fast: Ranges Meet Parallelism in C++ - Daniel Anderson - CppCon 2025Lightning Talk: Eight Consteval Queens and Compile-Time Printing - Sagnik Bhattacharya - CppCon 2025Cache-Friendly C++ - Jonathan Müller - CppCon 2025Lightning Talk: How Far Should You Indent Your Code? - The Number Of The Counting - Dave SteffenLightning Talk: Crafting CUDA Compatible C++ Code - Jon White - CppCon 2025Back to Basics: Master the static, inline, const, and constexpr C++ Keywords - Andreas FertigFrom Pure ISO C++20 To Compute Shaders - Koen Samyn - CppCon 2025
CppCon |

The Evolution of std::optional - From Boost to C++26 - Steve Downey - CppCon 2025

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER