3 ms·
> The whole point of an optional type is to prevent accidental unchecked access to the value no ? it is to model the idea of "a value is there or is not there"
by jcelerier 6y ago
> The whole point of an optional type is to prevent accidental unchecked access to the value
no ? it is to model the idea of "a value is there or is not there". definitely nothing more. If replacing a T* t by a optional<T>& incurs a meaningful performance cost (like a branch) then optional just won't be used