4 ms·
I am convinced that const correctness in C++ is so useless it's actually harmful. I can recall spending the sum of many hours tracking down various compilation
by alextgordon 16y ago
I am convinced that const correctness in C++ is so useless it's actually harmful.
I can recall spending the sum of many hours tracking down various compilation errors due to missing consts. Invariably the problem is miles away from the actual error message (which itself is usually long, cryptic and involving std::allocator).
And without fail, each time the error is either a complete fabrication, presumably invented by the compiler in order to spite me, or a genuine bug that I would have fixed in a great deal less time by actually running the fucking code.
If only const gave warnings, not errors, then we could eat our cake and have it too.