Using C++17 std::optional
Let’s take a pair of two types <YourType, bool> - what can you do with such composition?
In this article, I’ll describe std::optional - a helper “vocabulary” type added in C++17. It’s a wrapper that either contains a value of your type or is empty. Let’s see where it can be useful and how you can use it.
C++ Stories