[mlpack-git] [mlpack/mlpack] Use move semantics to set a given reference tree in NeighborSearch class. (#743)
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:
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the mlpack-git