Apply Rule of Zero across utility/options/ empty destructors#693
Open
lyskov-ai wants to merge 1 commit into
Open
Apply Rule of Zero across utility/options/ empty destructors#693lyskov-ai wants to merge 1 commit into
lyskov-ai wants to merge 1 commit into
Conversation
Drop user-declared empty destructors from option and option-key classes. The implicit destructor preserves virtual dispatch through inherited virtual destructors (Option::~Option() and Key::~Key()). utility/options/ — abstract bases and remaining leaf options: AnyOption, AnyVectorOption, ScalarOption, ScalarOption_T_, VectorOption, VectorOption_T_, PathOption, PathVectorOption, StringOption, StringVectorOption, ResidueChainVectorOption. utility/options/keys/ — base OptionKey plus 16 leaf key types: Any/AnyVector, Boolean/BooleanVector, File/FileVector, Integer/IntegerVector, Path/PathVector, Real/RealVector, ResidueChainVector, Scalar, String/StringVector, Vector. Follow-up to PR RosettaCommons#692, which left these classes for a second batch.
lyskov
approved these changes
May 15, 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
Drop user-declared empty destructors from the
utility/options/andutility/options/keys/class hierarchies. The implicit destructor preserves virtual dispatch in every case via inherited virtual destructors:utility::options::Option, which declaresvirtual ~Option().utility::keys::Key, which declaresvirtual ~Key().No class touched here owns a raw resource, declares a non-trivial destructor body, or has a user-declared copy/move that would suppress the implicit destructor.
utility/options/— abstract bases and remaining leaf option classesScalarOption,ScalarOption_T_,VectorOption,VectorOption_T_,AnyOption,AnyVectorOption.PathOption,PathVectorOption,StringOption,StringVectorOption,ResidueChainVectorOption.AnyOption/AnyVectorOptionused thevirtualkeyword on the empty body; the rest usedoverride {}. Both forms are equivalent to the implicit virtual destructor here.utility/options/keys/— base + 16 leaf key typesOptionKey.AnyOptionKey,AnyVectorOptionKey,BooleanOptionKey,BooleanVectorOptionKey,FileOptionKey,FileVectorOptionKey,IntegerOptionKey,IntegerVectorOptionKey,PathOptionKey,PathVectorOptionKey,RealOptionKey,RealVectorOptionKey,ResidueChainVectorOptionKey,ScalarOptionKey,StringOptionKey,StringVectorOptionKey,VectorOptionKey.This is the natural follow-up to #692, which intentionally deferred this batch. With this PR, the entire
utility/options*empty-virtual-destructor pattern is cleaned up.29 files, 156 deletions, 0 additions. Debug build clean.