|
|
|
|
|
by nmeofthestate
617 days ago
|
|
A pointer parameter can be null and it doesn't make sense for this parameter to be null, so IMO a reference is the better choice here. A non-const reference is just as clear a signal that the parameter may be modified as a non-const pointer. If there's no modification const ref should be used. |
|
You could choose to textually "tag" passing by mutable ref by passing `&foo` but this can rub people the wrong way, just like chaining pointer outvars with `&out_foo`.