2 ms·
Once you allow only pointers, you know if you see foo.bar, foo is a value on the stack. As a function parameter, you know that mutable calls with "." don't chan
by muro 8y ago
Once you allow only pointers, you know if you see foo.bar, foo is a value on the stack.
As a function parameter, you know that mutable calls with "." don't change state outside of the function.
It reduces mental overhead.
- thestoicattack 8y agoThat's a good point. I use references, even with that mental overhead, because they're not nullable. Clearly there are trade-offs.
- muro 8y agoI think const ref is ok, but avoid non-const