Re:Const all the things?
by gpderetta on Monday January 24, 2022 @09:31AM
(#30058006)
To stay on topic, if x was declared const, you wouldn't have to guess. The compiler would tell you.
[ Parent
| on HN ]
Re:Const all the things?
by lelanthran on Monday January 24, 2022 @11:50AM
(#30060204)
> To stay on topic, if x was declared const, you wouldn't have to guess. The compiler would tell you.
Frequently it can't be declared constant, because it is being changed in that scope as it runs.
Re:Const all the things?
by tsimionescu on Monday January 24, 2022 @04:46PM
(#30064516)
This was a discussion about passing out (or inout) parameters as `T&` vs `T*`. By definition, these parameters can't be const, so const is irrelevant to this thread.