Hacker News new | ask | show | jobs
by Jyaif 2660 days ago
> Is it mainly for the ability to signal non-nullability in the signature?

Can't answer for the parent, but for me yes it's exactly that.

When I'm calling a function I'm going to look up the prototype anyways so I don't really care whether it's taking a reference or a pointer.

When I'm implementing the function, I want to make sure that all my callers never pass me a nullptr. Because of the styleguide I'm forced to put a "DCHECK(ptr);" and add a comment in the prototype saying "|ptr| must not be null".