2 ms·
Const matters to the caller, if it calls a function that takes a pointer to const it can generally reasonably expect that the object wont be changed. It is no
by gpderetta 6y ago
Const matters to the caller, if it calls a function that takes a pointer to const it can generally reasonably expect that the object wont be changed.
It is not about enabling compiler optimisations but about preserving invariants.