|
|
|
|
|
by _gabe_
614 days ago
|
|
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 |
|
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.