5 ms·
True. Most things are reference types though
by beached_whale 8y ago
True. Most things are reference types though
- pjmlp 8y agoNo in the case of Nullable, which behaves just like std::optional.
- beached_whale 8y agoI 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.