[mlpack] Doubt regarding move constructor in det

Ryan Curtin ryan at ratml.org
Thu Jan 19 12:12:42 EST 2017


On Thu, Jan 19, 2017 at 10:14:35PM +0530, Piyush Jaiswal wrote:
> Hi,
> When calling the move constructor while moving one DTree to another DTree
> in det,
> *std::move* is used to move the value of the member variables - maxVals and
> minVals to the other DTree and then not initialized later on in the
> original DTree. Wouldn't this leave these values in an unspecified state
> when accessing them with the original DTree?

Hi Piyush,

I don't understand what you mean or exactly where you are referring to.
But using std::move(maxVals) and std::move(minVals) is just fine,
because that ends up resetting the state of minVals and maxVals in the
object that was moved to the correct initial state.

If you're certain there is a bug, then if you can please develop a
runnable test case with clearly incorrect behavior, we can make a fix.

Thanks,

Ryan

-- 
Ryan Curtin    | "Oh boy, am I happy!  I'm surrounded by bugs!"
ryan at ratml.org |  - Agitha


More information about the mlpack mailing list