Pull Request №706 RosettaCommons/rosetta/main ← lyskov-ai/rosetta/refactor/core-empty-dtors-rule-of-zero
Merge: 8ebeca78061b79e9fbbc68db33a78b2fd0361428←03c3f888d6d61e013d489f96065d5b403698b12d
Apply Rule of Zero to empty destructors across core/
----------------
Merge commit message:
Apply Rule of Zero to empty destructors across core/
Remove trivially empty (~X() {}) or =default;-bodied destructors, deleting
the declaration outright rather than re-declaring it as =default in the
header, and remove the redundant out-of-line .cc definitions.
Per review: for the derived classes here the base already declares a virtual
destructor, so the destructor is virtual by inheritance whether or not it is
declared -- an explicit ~X() override = default; buys nothing. Omitting it is
the actual Rule of Zero: it keeps the destructor virtual (inherited) and, for
classes with no other user-declared special members, lets the implicit move
operations be generated. A =default destructor would not do the latter: it is
still user-declared and suppresses the implicit moves exactly as a
user-provided one would.
LKHBondInfo and HBondInfo are polymorphic bases that need an explicitly
declared virtual destructor, so they keep 'virtual ~X() = default;'. Also
removes an unused user-defined empty copy ctor on LKHBondInfo.
Pure code-style refactor; no intended behavior change.