Apply Rule of Zero to remaining LREnergyContainer iterator subclasses#699
Open
lyskov-ai wants to merge 1 commit into
Open
Conversation
Extends the disulfide-iterator pattern (PR RosettaCommons#689) to the four remaining ResidueNeighbor{,Const}Iterator subclasses: - DenseNeighbor{,Const}Iterator - OneToAllNeighbor{,Const}Iterator - PolymerBondedNeighbor{,Const}Iterator - CstResNeighb{,Const}Iterator For each: drop the empty `= default` destructor pair (override decl in .hh, out-of-line definition in .cc), and replace the pre-C++11 private undefined copy-assignment with an explicit `= delete` plus a comment explaining that all assignment must funnel through the polymorphic operator= so derived state is downcast and copied correctly. This exhausts the LREnergyContainer iterator family; together with PR RosettaCommons#689 all six concrete container's iterator pairs use the same idiom.
lyskov
approved these changes
May 12, 2026
roccomoretti
approved these changes
May 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Extends the disulfide-iterator pattern from PR #689 to the four remaining
ResidueNeighbor{,Const}Iteratorsubclasses incore/scoring/:DenseNeighbor{,Const}Iterator(DenseEnergyContainer.{hh,cc})OneToAllNeighbor{,Const}Iterator(OneToAllEnergyContainer.{hh,cc})PolymerBondedNeighbor{,Const}Iterator(PolymerBondedEnergyContainer.{hh,cc})CstResNeighb{,Const}Iterator(constraints/ConstraintEnergyContainer.{hh,cc})For each class:
~X() override;decl in.hhplusX::~X() = default;in.cc) — Rule of Zero suffices since the base destructor is already virtual.X & operator = (X const & );) with an explicit= deleteand a short comment explaining that all assignment must funnel through the polymorphicoperator = ( ResidueNeighbor{,Const}Iterator const & )so derived members are downcast and copied correctly.Together with PR #689 this exhausts the
LREnergyContaineriterator family — every concrete container's iterator pair now follows the same idiom.The bundle is smaller than the usual minimum (~77 lines) because no further sibling work exists in this hierarchy.