October 2004
Intermediate to advanced
240 pages
6h 22m
English
What you create, also clean up: If you define any of the copy constructor, copy assignment operator, or destructor, you might need to define one or both of the others.
If you need to define any of these three functions, it means you need it to do more than its default behavior—and the three are asymmetrically interrelated. Here’s how:
• If you write/disable either the copy constructor or the copy assignment operator, you probably need to do the same for the other: If one does “special” work, probably so should the other because the two functions should have similar effects. (See Item 53, which expands on this point in isolation.)
• If you explicitly write the copying functions, you probably ...
Read now
Unlock full access