[mlpack-git] [mlpack/mlpack] Use move semantics to set a given reference tree in NeighborSearch class. (#743)
Ryan Curtin
notifications at github.com
Wed Aug 3 22:59:16 EDT 2016
I thought about this for a while. Trees have generally been passed as pointers, in part because internally trees must hold pointers to their children. But, I suppose, it is not necessarily reasonable to require that trees be passed as pointers. So, I can't justify any reason why we shouldn't make this change. But, there are a couple things we have to consider:
* What if the user prefers to pass a tree that should be copied? Maybe we should provide overloads with just a reference instead of an rvalue reference?
* We have to maintain reverse compatibility, so unfortunately we need to retain the overloads that take `TreeType*`. We can just have those call the reference/rvalue reference overloads, though. I think that in general they should call the rvalue-reference overloads since those functions generally took ownership of the tree.
---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/mlpack/mlpack/pull/743#issuecomment-237439372
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack-git/attachments/20160803/277af516/attachment-0001.html>
More information about the mlpack-git
mailing list