Re: non-const reference parameters in new and older code

2019-07-22 Thread Jeff Gilbert
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`.

Re: non-const reference parameters in new and older code

2019-07-22 Thread David Teller
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: >

non-const reference parameters in new and older code

2019-07-22 Thread Karl Tomlinson
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