Is there any real reason to use "const"?

Dennis dkorpel at gmail.com
Mon Jan 24 11:18:58 UTC 2022


On Monday, 24 January 2022 at 10:49:36 UTC, Dom DiSc wrote:
> I would NEVER EVER declare a variable const. It's always either 
> mutable or immutable.

I usually mark local variables `const` because it's shorter than 
`immutable`, and `immutable` doesn't buy me anything over `const` 
in those cases.




More information about the Digitalmars-d mailing list