4 ms·
If you use cpp17, you can use the built-in std::optional to solve this problem.
by typon 6y ago
If you use cpp17, you can use the built-in std::optional to solve this problem.
- taeric 6y agoStrictly, not the same. One returns a value and an error. One returns a value or nothing. Having the error can signal both if a value could not be retrieved, or if it could be retrieved, but was coerced, as an example.