Skip to content

Simplified "deep copy" constructors needed for the IMF pointer.#198

Merged
trquinn merged 2 commits intomasterfrom
trq/copy_constructor_cleanup
May 27, 2025
Merged

Simplified "deep copy" constructors needed for the IMF pointer.#198
trquinn merged 2 commits intomasterfrom
trq/copy_constructor_cleanup

Conversation

@trquinn
Copy link
Member

@trquinn trquinn commented May 14, 2025

The Fdbk and Stfm classes have a lot of attributes for feedback and star formation, and they need to do a "deep copy" because of the IMF pointer. It is too easy to forget to add a new parameter to the copy constructor resulting in uninitialized attributes in the class. This was the root cause of a weird star formation history after a recent merge of star formation code with a downstream branch.

This is a rewrite so that the default constructor is used for the attributes, and only the IMF pointer gets the special constructor.

Note that the "pup" operators have a similar problem. We should also think about rewriting those.

Copy link
Member Author

@trquinn trquinn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor white space.

@trquinn
Copy link
Member Author

trquinn commented May 27, 2025

Checked this change on GM1.

@trquinn trquinn merged commit d9acc5a into master May 27, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant