Error Handling and std::optional—Bartlomiej Filipek

Save to:
Instapaper Pocket Readability

Do you have a prefered way?

Error Handling and std::optional

by Bartlomiej Filipek

From the article:

In my last two posts in the C++17 STL series, I covered how to use std::optional. This wrapper type (also called “vocabulary type”) is handy when you’d like to express that something is ‘nullable’ and might be ‘empty’. For example, you can return std::nullopt to indicate that the code generated an error… but it this the best choice?

Add a Comment

Comments are closed.

Comments (0)

There are currently no comments on this entry.