Insight 10.3.1.
Other than one detail described below, declaring a reference to be
const
doesn’t allow it to do anything new. It just asks the compiler to help avoid accidental changes to the referenced value. It is a way for a function to make a binding promise to the caller: “you are going to give me access to some of your memory, but I promise I won’t change that memory.”
The one extra things you can do with a const reference: a
const
reference is allowed to reference a const variable (a normal constant). A normal reference is not allowed to. Otherwise we could use the reference to change the const
. We won’t need to use this feature.