I could grudgingly get on board with that, though I feel that there
are sort of two levels of mutability I use: casual and essential.
Essential is protected by constness, whereas casual is sort of
everyday minor changes, but changes I don't want to allow in `const`
code, thus don't want `mutable`.
I believe in least surprise for the caller of an API. This seems to
match with the Google style, as you describe it: any parameter which may
be mutated in any manner should be passed as pointer, rather than reference.
Cheers,
David
On 22/07/2019 08:43, Karl Tomlinson wrote:
> https://google.gith
https://google.github.io/styleguide/cppguide.html#Reference_Arguments
has a simple rule to determine when reference parameters are
permitted:
"Within function parameter lists all references must be const."
This is consistent with Mozilla's previous coding style:
"Use pointers, instead of references
3 matches
Mail list logo