in reply to const correctness

I've always been a fan of const in C++, and make everything const-correct.

Because? I try to do it when I'm patching C code only because I imagine the maintainers might care. I doubt I would bother in my own code. It seems about as useful as that crazy-paranoid public/private/protected nonsense. Oh no, someone might call a private method! The sky, it's a gonna fall!

-sam

Replies are listed 'Best First'.
Re^2: const correctness
by chromatic (Archbishop) on May 15, 2008 at 22:57 UTC

    A decent C++ compiler (can't believe I wrote that) can perform several useful optimizations if you have correctly used const. It can also create a program which crashes spectacularly if you have used const incorrectly.