-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ComponentEntity.addComponent()
doesn't copy the component
#195
Comments
There's other methods that claim to make copies. We should check these all and add tests for this. |
After having a discussion with @nickerso we think the following behaviour should be observed:
|
Hmm... doesn't the following go against what we have recently agreed on and implemented?
I would expect
|
Yes it does go against what has just been implemented. On reflection I don't like the current implementation. To me it is doing a move but we are calling it an add. I feel it is more straight forward to add components this way. We can then add convenience methods to help with moving components or multiple additions of say an imported component. |
Hmm... fair points. Otherwise, yes, it might be nice to have convenience methods. |
The docstring for
ComponentEntity.addComponent(const ComponentPtr &c)
says a copy of the component argument will be madehttps://github.com/cellml/libcellml/blob/develop/src/api/libcellml/componententity.h#L51-L58
This doesn't seem to be the case:
The text was updated successfully, but these errors were encountered: