Back To Schedule

Five Issues with std::expected and How to Fix Them

09:00 - 10:30 Tuesday 29th April 2025 MT Lauder Seminar Room
Intermediate
Advanced
API Design

std::expected is a powerful abstraction for error handling and chaining computations introduced in the C++ 23 standard. Even though this abstraction is relatively new in the C++ ecosystem, it already has several issues, particularly when used as the primary error-handling mechanism in large code bases.
This talk will focus on the most significant practical challenges faced when working with std::expected, providing insights into common pitfalls and offering potential solutions. While some of these challenges are addressed in separate libraries, others are not. Much of the functionality discussed in this talk is not available in the standard library. However, I’ll demonstrate real-world code samples and point to open-source helper utilities that address some of these gaps.
This talk will be useful for software engineers looking to understand the limitations of std::expected, explore possible workarounds, and even contribute to the evolution of this abstraction by submitting proposals for future improvements.

View Slides

Vitaly Fanaskov

Principal Software EngineerreMarkable

Vitaly is a principal software engineer at reMarkable. He has been designing and developing software using C++ and some other languages for over 10 years. Primary areas of interest are design and development of frameworks and libraries, modern programming languages, and functional programming. Vitaly holds a PhD in Computer Science from the Moscow State Mining University.