Skip to content
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

WIP: Added the default move constructor to ConditionObject #880

Merged
merged 2 commits into from Nov 10, 2021

Conversation

bencouturier
Copy link

Added the default move constructor and default move assignment operator to dd4hep::detail::ConditionObject and dd4hep::NamedObject.
This allows storing ConditionObject in std::vector

BEGINRELEASENOTES

  • Added the default move constructor and default move assignment operator to dd4hep::detail::ConditionObject and dd4hep::NamedObject
    ENDRELEASENOTES

@MarkusFrankATcernch
Copy link
Contributor

Ben,
I am pretty sure that the tests will succeed. However, I am also very sure this solution will not solve your problem.....
The problem is that the payload cannot be easily be moved. The default move will just copy the byte array,
but the actual contained data there will be deleted and the "moved" instance will have meaningless values
unless these are primitives/scalars.....This will need more rigorous thinking.

@bencouturier
Copy link
Author

In that case, isn't it up to the deriving classes to implement the move constructor and assignment operator ?

@bencouturier
Copy link
Author

After our discussion I exp[licitly deleted the move constructor and assignment operators in ConditionObject. I left them in NamedObject though (as the copy constructor there is the default).

@MarkusFrankATcernch MarkusFrankATcernch merged commit 45a787e into AIDASoft:master Nov 10, 2021
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.

None yet

3 participants