Returning by value as a const can
seem a bit subtle at first, so it deserves a bit more explanation. Consider the
binary operator+. If you use it in an expression such as f(a+b),
the result of a+b becomes a temporary object that is used in the call to
f( ). Because it’s a temporary, it’s automatically
const, so whether you explicitly make the return value const or
not has no effect.
However, it’s also possible for you
to send a message to the return value of a+b, rather than just passing it
to a function. For example, you can say (a+b).g( ), in which
g( ) is some member function of Integer, in this case. By
making the return value const, you state that only a const member
function can be called for that return value. This is const-correct,
because it prevents you from storing potentially valuable information in an
object that will most likely be lost.