Skip to content

Modernize copy prevention in core factory singletons and non-copyable classes#685

Open
lyskov-ai wants to merge 1 commit intoRosettaCommons:mainfrom
lyskov-ai:refactor/core-factory-copy-prevention
Open

Modernize copy prevention in core factory singletons and non-copyable classes#685
lyskov-ai wants to merge 1 commit intoRosettaCommons:mainfrom
lyskov-ai:refactor/core-factory-copy-prevention

Conversation

@lyskov-ai
Copy link
Copy Markdown
Contributor

Summary

  • SilentStructFactory, ConstraintFactory, SequenceFactory: all inherit from utility::SingletonBase, which already = deletes copy construction and copy assignment. Removes the now-redundant private-but-unimplemented declarations from each derived class (pre-C++11 idiom).
  • OrbitalsStatistics, AtomTreeDiff: had private-but-undefined copy constructors (pre-C++11 idiom); replaced with explicit = delete on both copy constructor and copy assignment operator.

No behaviour change; build-only verification is sufficient for pure copy-prevention modernisation.

Test plan

  • Debug build passes (scons.py -j16 mode=debug)

… classes

SilentStructFactory, ConstraintFactory, and SequenceFactory all inherit from
SingletonBase, which already = delete's copy construction and copy assignment.
Remove the now-redundant private unimplemented declarations from each derived
class.

OrbitalsStatistics and AtomTreeDiff had private-but-undefined copy constructors
(pre-C++11 idiom); replace with explicit = delete on both copy constructor and
copy assignment.
@lyskov lyskov requested a review from roccomoretti May 3, 2026 23:18
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