const can save you a lot of trouble and time
constviolate1(const int i);
virtual int get_a() const;
constviolate1::constviolate1(const int i)
constviolate1::get_a() const
The compiler does not let you violate the contract!
The const says that get_a does not change the object in any way, so the compiler produces an error.
$ g++ -c const_violation.C
const_violation.C: In method `int constviolate1::get_a() const':
const_violation.C:17: assignment of read-only member `int constviolate1::a'
constviolate1::constviolate1(const int i)
const_violation.C: In method `constviolate1::constviolate1(int)':
const_violation.C:13: assignment of read-only parameter `int const i'
Here you said that the parameter won’t get modified!
Use of the const keyword will catch all those errors at compile time.
The largest impact, however, is when it comes to distributed computing (CORBA, ORB,…). If the compiler knows that remote object or the calling parameters won’t be modified, the operation can be executed a lot faster and with less overhead.