Re: NotNull and pointer parameters that may or may not be null

2019-08-05 Thread Henri Sivonen
On Mon, Jul 22, 2019 at 10:00 AM Karl Tomlinson wrote: > Google style requires pointers for parameters that may be mutated > by the callee, which provides that the potential mutation is > visible at the call site. Pointers to `const` types are > permitted, but recommended when "input is somehow

Re: NotNull and pointer parameters that may or may not be null

2019-07-22 Thread Jeff Gilbert
FWIW RefPtr already behaves as MaybeNull for assert-on-deref, making them functionally Maybe. (though they don't represent a contract that it's nullable) For non-outvar-args, I tend to use references to document non-null, though I do so even for many non-const uses. (balancing what is and isn't

NotNull and pointer parameters that may or may not be null

2019-07-22 Thread Karl Tomlinson
Google style requires pointers for parameters that may be mutated by the callee, which provides that the potential mutation is visible at the call site. Pointers to `const` types are permitted, but recommended when "input is somehow treated differently" [1], such as when a null value may be