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

Request for Support with Copy and Move Semantics for KDTree in nanoflann Library #215

Open
cbtxs opened this issue Nov 7, 2023 · 1 comment

Comments

@cbtxs
Copy link

cbtxs commented Nov 7, 2023

Hello, I've been using the nanoflann library, and the KDTree algorithm developed by your team is incredibly efficient, greatly benefiting my current project. However, I recently encountered an issue where I need to copy KDTree objects and use move semantics with the operator=. Unfortunately, my C++ skills are limited, and I'm unsure how to achieve this. I kindly request your team to consider adding this functionality or providing guidance on how to accomplish it.

@jlblancoc
Copy link
Owner

It could be done at the nanoflann level, but in other projects, I have normally used encapsulation into a std::shared_ptr or std::unique_ptr. In that way, we can keep nanoflann as "simple" as possible...

See an example implementation here:
https://github.com/MRPT/mrpt/blob/c4e09e25ba225feb64b17396b351de1d23394738/libs/math/include/mrpt/math/KDTreeCapable.h#L716-L753

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