Why is the copy-constructor argument const?

You’ve gotten answers that mention ensuring that the ctor can’t change what’s being copied — and they’re right, putting the const there does have that effect.

More important, however, is that a temporary object cannot bind to a non-const reference. The copy ctor must take a reference to a const object to be able to make copies of temporary objects.

Leave a Comment