As we have observed many times, the type of an object defines the operations that can be performed by that object. A
const type can use most but not all of the same operations as its non
const version. The one restriction is that we may use only those operations that cannot change an object. So, for example, we can use a
const int in arithmetic expressions in exactly the same way as a plain, non
const int. A
const int converts to
bool the same way as a plain
int, and so on.
Among the operations that don’t change the value of an object is initialization—when we use an object to initialize another object, it doesn’t matter whether either or both of the objects are
int i = 42;const int ci = i; // ok: the value in ...