Returning std::optional

Let's learn the different ways to return an optional.

If you return an optional from a function, then it’s very convenient to return just std::nullopt or the computed value.

Get hands-on with 1200+ tech skills courses.