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

Make HierarchyTree class copy and move constructible, and copy and move assignable #608

Open
beingkartik opened this issue Jul 11, 2024 · 1 comment

Comments

@beingkartik
Copy link

The HierarchyTree class is currently not copyable/movable currently. While the operations succeed, they cause issues due to memory managed using raw pointers.

For example, currently on copying a HierarchyTree, the copied-from and copied-to both have pointers to the same memory, and both attempt to delete the same memory, which is undefined behaviour.

As per the c++ standard guidelines, specifically the rule-of-three and rule-of-five, we should implement the copy+move constructors and assignment operators.

I will be happy to provide a pull request if the team is willing to consider this. This would involve recursively copying the tree for copy and cleaning transferring ownership for move.

wdyt?

@jcarpent
Copy link
Contributor

Very nice initiative @beingkartik.
We can assist you in this process. We inherit the raw pointers from the seminal FCL library that definitely needs to be updated.
Thanks in advance for your contribution.

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

No branches or pull requests

2 participants