Skip to content

Apply Rule of Zero to disulfide energy neighbor iterators#689

Open
lyskov-ai wants to merge 1 commit intoRosettaCommons:mainfrom
lyskov-ai:refactor/disulfide-energy-iterators-rule-of-zero
Open

Apply Rule of Zero to disulfide energy neighbor iterators#689
lyskov-ai wants to merge 1 commit intoRosettaCommons:mainfrom
lyskov-ai:refactor/disulfide-energy-iterators-rule-of-zero

Conversation

@lyskov-ai
Copy link
Copy Markdown
Contributor

Summary

  • Remove user-declared trivial (defaulted) destructors from the six disulfide neighbor iterator classes; the implicit virtual destructor inherited from ResidueNeighborIterator / ResidueNeighborConstIterator does the same job.
  • Modernize the old-style C++03 copy-assignment prevention (private undefined declaration) to a public = delete for the derived-type operator=. Behavior is unchanged: derived-derived assignment is still forbidden so all assignments flow through the polymorphic operator=(BaseType const &) override that downcasts and copies all members.

Touched: CentroidDisulfideNeighborIterator/ConstIterator, DisulfideMatchingNeighborIterator/ConstIterator, DisulfResNeighbIterator/ConstIterator.

Test plan

  • Full release build (scons mode=release bin) passes with no errors
  • No external call sites reference the removed destructors or the deleted operator=

The disulfide neighbor iterator classes in core/scoring/disulfides/
each had a user-declared destructor (defaulted in the .cc) and an
old-style private undefined copy assignment. The destructor did
nothing the compiler-generated virtual destructor wouldn't do, so
remove both the declaration and the empty `= default` definition.

Modernize the C++03-style copy-assignment prevention to public
`= delete`. The intent is preserved: assignment must go through the
polymorphic operator=(BaseType const &) override, which downcasts and
copies all members; the implicit derived-derived operator= would
bypass that path. A short comment captures this why.

Touched: CentroidDisulfideNeighborIterator/ConstIterator,
DisulfideMatchingNeighborIterator/ConstIterator,
DisulfResNeighbIterator/ConstIterator.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants