Daily Shaarli

All links of one day in a single page.

May 11, 2024

std::expected - Monadic Extensions - C++ Stories
thumbnail

std::expected from C++23 not only serves as an error-handling mechanism but also introduces functional programming paradigms into the language. In this blog post, we’ll have a look at functional/monadic extensions of std::expected, which allow us to chain operations elegantly, handling errors at the same time. The techniques are very similar to std::optional extensions - see How to Use Monadic Operations for std::optional in C++23 - C++ Stories.