I saw another commenter explain that it’s passed by reference, but I agree with you. The C++ Core Guidelines even mention that it’s better to use raw pointers (or pass by value and return a value) in cases like this to make the intent clear.https://isocpp.org/wiki/faq/references#call-by-reference
nmeofthestate|1 year ago
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.
jdashg|1 year ago
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`.
unknown|1 year ago
[deleted]
gpderetta|1 year ago
cornstalks|1 year ago