29 ms·
const_cast = code smell mutable = code smell Pretty much anything that breaks the contract is readily apparent when reading/searching the code, and indicates t
by dbcfd 13y ago
const_cast = code smell
mutable = code smell
Pretty much anything that breaks the contract is readily apparent when reading/searching the code, and indicates that something needs to be rewritten.
Just because you can break the contract doesn't mean you should break the contract. Const correctness produces more readable/easily understood code.
Don't be lazy, and make life better for anyone that has to maintain and use the code after you.