Hacker News new | ask | show | jobs
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.
1 comments

"Prevent exceptions from leaving destructors." — thank you for providing well known sources that support my point! Although sadly we all have to eat Sutter Meyers bread, at least it explicitly tells you to not worry about the way exceptions are handled during object destruction — by simply avoiding such exceptions.

No C++ "bread and butter" I have seen so far goes into depth on this subject.