|
|
|
|
|
by bsder
67 days ago
|
|
"Effective C++" ? Chapter 2: Constructors, Destructors, and Assignment Operators
Item 5: Know what functions C++ silently writes and calls.
Item 6: Explicitly disallow the use of compiler generated functions you do not want.
Item 7: Declare destructors virtual in polymorphic base classes.
Item 8: Prevent exceptions from leaving destructors.
Item 9: Never call virtual functions during construction or destruction.
Item 10: Have assignment operators return a reference to *this.
Item 11: Handle assignment to self in operator=.
Item 12: Copy all parts of an object.
This stuff is bread and butter of C++ (or at least it used to be; perhaps this is different in "modern" C++) and lots and lots of grist for people like Scott Meyers and Herb Sutter. |
|
No C++ "bread and butter" I have seen so far goes into depth on this subject.