Skip to content

Modernize pre-C++11 copy prevention to = delete across core/ and protocols/#700

Open
lyskov-ai wants to merge 1 commit into
RosettaCommons:mainfrom
lyskov-ai:refactor/core-private-unimpl-copy-modernization
Open

Modernize pre-C++11 copy prevention to = delete across core/ and protocols/#700
lyskov-ai wants to merge 1 commit into
RosettaCommons:mainfrom
lyskov-ai:refactor/core-private-unimpl-copy-modernization

Conversation

@lyskov-ai
Copy link
Copy Markdown
Contributor

Summary

Replace the pre-C++11 idiom (declared-but-undefined private copy ctor / copy assignment used to prevent copies via link error) with explicit = delete. 16 files, no behaviour change — just turning latent link errors into clear compile-time errors. Same kind of work as #685 / #674 / #672 / #671 / etc.

Two flavours:

  1. Stand-alone non-copyable classes (14 files): replace the unimplemented private declarations with = delete. Drops redundant comments ("deny use of the copy constructor", "private and unimplemented") that = delete already conveys. Keeps the explanatory rationale only where the why is non-obvious (ScoreFunction / DockingScoreFunction / OtherContextScoreFunction: copies would discard subclass information; use clone() instead).

  2. Singleton (SymDofMoverSampler, inheriting utility::SingletonBase): drop the redundant copy/assignment declarations entirely — the base already = deletes its own copies, which transitively deletes the derived copies.

Files touched

core/scoring/: ScoreFunction.hh, MinScoreScoreFunction.hh, DockingScoreFunction.hh
core/pack/rotamer_set/: RotamerSet.hh, RotamerSet_.hh, RotamerSubset.hh
core/conformation/: RotamerSetBase.hh
core/environment/: DofPassport.hh
core/fragment/: ConstantLengthFragSetIterator_.hh, FrameListIterator_.hh, MinimalFragSetIterator_.hh, OrderedFragSetIterator_.hh
basic/resource_manager/locator/: FileSystemResourceLocator.hh (the inner FileStream)
protocols/flexpack/: OtherContextScoreFunction.hh
protocols/frag_picker/: FragmentPicker.hh (the inner QuotaDebug)
protocols/matdes/: SymDofMoverSampler.hh

Debug build passes clean.

…ocols/

Replace the pre-C++11 idiom (private undefined copy ctor / copy assignment to
prevent copies via link error) with explicit `= delete` for clearer diagnostics
and compile-time enforcement. 16 files; no behaviour change.

Two flavours:

1. Stand-alone non-copyable classes: replace the unimplemented private
   declarations with `= delete`. Drops redundant comments ("deny use of the
   copy constructor", "private and unimplemented", etc.) that are now
   self-evident from `= delete`. Keeps explanatory comments where the *why*
   is non-obvious (ScoreFunction / DockingScoreFunction / OtherContextScoreFunction:
   "copying discards subclass information; use clone() instead").

2. Singleton (SymDofMoverSampler, inheriting utility::SingletonBase): drop
   the redundant copy/assignment declarations entirely — the base already
   `= delete`s its own copies, which transitively makes the derived
   implicit copies deleted.

Files: ScoreFunction, MinScoreScoreFunction, DockingScoreFunction,
OtherContextScoreFunction, RotamerSet, RotamerSet_, RotamerSubset, RotamerSetBase,
DofPassport, ConstantLengthFragSetIterator_, FrameListIterator_,
MinimalFragSetIterator_, OrderedFragSetIterator_, FragmentPicker (QuotaDebug),
SymDofMoverSampler, FileSystemResourceLocator (FileStream).

Debug build passes clean.
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.

3 participants