It probably does (or should) in real implementations.
GCC hardens operator* with a not-valueless assertion. It doesn't harden operator-> because you just get a null pointer back if you call that on a valueless object. That might change to also harden operator->
View all comments
Show parent comment
5
u/jwakely libstdc++ tamer, LWG chair Aug 15 '26
It probably does (or should) in real implementations.
GCC hardens
operator*with a not-valueless assertion. It doesn't hardenoperator->because you just get a null pointer back if you call that on a valueless object. That might change to also hardenoperator->