Hacker News new | ask | show | jobs
by foota 2532 days ago
Hm, technically don't think this would be required. Take for instance:

  auto no_destroy = new MoveNoDestroy();

  MoveNoDestroy* moved_into;

  *moved_into = std::move(*no_destroy);
Wouldn't call the destructor of the moved from MoveNoDestroy.
1 comments

Yes, if you leak resources, their destructors won't be called. That really has nothing at all to do with move semantics though. I think the important point is that move semantics don't alter the lifetime management of the moved-from object.