Forumite

Reply To: C++ Programming

#62613
Participant
Wheels-Of-Fire
@grahamdearsley
Forumite Points: 6,307

Ah yes there is a reason and in fact my C++ book gets round to it a few pages further on.

If you are passing a large structure to a function instead of a simple variable then passing a const reference will negate the need to create a copy to pass, as would be done if you passed by value.

Another thing the book gets into later is top level and low level constants and where the constantness of a top level constant may be ignored !