3 ms·
I think in general it does something for symbols visible outside the compilation unit (globals, public fields). Otherwise, the compiler usually has enough infor
by tsimionescu 4y ago
I think in general it does something for symbols visible outside the compilation unit (globals, public fields). Otherwise, the compiler usually has enough information to decide if something is actually a constant regardless of the const modifier.
- heinrich5991 4y ago`const` only does something for (global, static, local) variable declarations. The rest is just guidance to for the programmer. It doesn't do anything on pointers, and I think it doesn't do anything on members, but not entirely sure on the last one.