4 ms·
But if you already have null then the method could return null, empty optional or optional with value.
by Shoothe 9y ago
But if you already have null then the method could return null, empty optional or optional with value.
- HumanDrivenDev 9y agoI don't know about C++, but for example Java has a method "ofNullable" that will convert a null to a None option. But yes, that could potentially happen. IIRC that problem exists in many languages, including F# and Scala. Not sure how big of an issue it is in practice...