4 ms·
Passing by 'const value' is not a real thing. In the implementation you can remove the const and the compiler will not complain. You can put them in the defini
by jcranberry 5y ago
Passing by 'const value' is not a real thing. In the implementation you can remove the const and the compiler will not complain.
You can put them in the definition and the compiler will prevent you from mutating that argument in the body of the function however.
I remove these in declarations if I see them usually. I see it as noisy and a little distracting, the caller can already see that there's going to be no side effects to that variable, whether or not the function changes its copy of it is an implementation detail.