3 ms·
It's kinda both for me. If you have certainty from top to bottom that something will always be const, then maybe. This is often not true, and even if you think
by P_I_Staker 3y ago
It's kinda both for me. If you have certainty from top to bottom that something will always be const, then maybe.
This is often not true, and even if you think so, you're often wrong. I can't recall all the consequences of the flaws in the system (promote/demote const), but it's not fun to deal with.
I've seen so many things wind up passed to a function or going through an interface eventually that's non-const (or lets not forget is "const'd for safety").
This is where some would say you should give up on practical grounds... if the mission is to determine which const scenarios can be ensured, you argue this is not practically possible and throw the whole thing out.