If the original owns something, the question is whether the copy can share ownership of that thing. In many cases, the item in question will have been allocated from the heap. If ownership will be shared, who will be responsible for deleting the shared item? There's
shared_ptr
to take care of that now, but perhaps the item represents a real-word resource that cannot be shared, in which case the copy constructor must allocate a new instance of that item. The compiler won't always get it right, so the flexibility of a copy constructor is required.
The
Rule of 3[
^] says that if you have a destructor, you typically need a copy constructor and copy operator (
operator=
). For efficiency, C++11 added the move constructor and move operator, so now the Rule of 3 is often the Rule of 5.
If you do a web search on "C++" plus "copy constructor", "copy assignment operator", "move constructor", or "move assignment operator", you will find lots of things to read.