3 ms·
I see what you are saying, yes. Also, in c++ if you try to use an empty value in an optional<T> it isn't using undefined behavior as dereferencing a null point
by beached_whale 8y ago
I see what you are saying, yes.
Also, in c++ if you try to use an empty value in an optional<T> it isn't using undefined behavior as dereferencing a null pointer would, plus with optional you get value semantics so things like copy are deep vs copying the pointer. Not sure about C# nullables, but I guess if you copy the .value member it is deep.