2 ms·
Funny. I felt attacked by the intro, as I am a very big fan of locking things down with const and getting yelled at by the compiler for attempting to modify a
by klyrs 5y ago
Funny. I felt attacked by the intro, as I am a very big fan of locking things down with const and getting yelled at by the compiler for attempting to modify a const. But, the article goes on to attack stupid shit that I'd never do with const. (Though, I do think that there's marginal value in non-movable classes with public const data members: you don't need to implement a getter)
We're left with three good uses:
1. returning const references to private data
2. passing const references as arguments
3. const class methods
Ho-hum. I came expecting a fight, not validation.