In this article, we’ll go through a new vocabulary type introduced in C++23. std::expected is a type specifically designed to return results from a function, along with the extra error information. Motivation Imagine you’re expecting a certain result from a function, but oops… things don’t always go as planned: