Re:T* makes for a poor optional<T&>
by germandiago on Monday December 13, 2021 @06:37PM
(#29546206)
I do not think it is. What does the language do on * dereferencing? Yes, it does not do a check. So if you do it now you have to remember two different rules, one rooted deep inside C and C++ minimal overhead philosophy. Now multiply by the number of types (unique_ptr, shared_ptr, optional and probably more) and remember the correct rule.
I do not think there is something bad with it. It does the same for the same syntax and you have a `.value()` checked access anyway.
I do not think there is something bad with it. It does the same for the same syntax and you have a `.value()` checked access anyway.