I was surprised that no one talked about when a link could point to a null object
This is because he cannot, in the right program.
Your function, which has a nullpointer difference, has Undefined Behavior . The compiler is allowed to emit code that, for example, causes a failure at this point.
However, one of the possible effects of UB is that the code does what he thought it would do. Thus, null references may occur. I have never come across this, but if so, it means that there is a serious logical error in the code.
All the functions of the null reference object that you use that you show are logical errors.
It’s best to use these methods and fix things .; -)
Cheers and hth.,
source share