Tag: std::optional

C++17: std::optional<>

Written by on November 21, 2017 in C++, Programming with 0 Comments
C++17: std::optional<>

Suppose we want to write a function that returns a value, but with the possibility that  the computation might fail. This failure can be represented as an exception, or as a return value that unamibiguously denotes failure (for example, -1). Throwing an exception is a strong form of failure and might not be appropriate in […]

Continue Reading