String literals are immutable, std::stringare not.
The first is passing by reference. If you do not plan to change the line, pass it by reference const.
Secondly, transmission by value. - if you change the line inside the function, you would only modify the copy, so it's debatable
source
share