Since std::move()
is just a cast operation, the default move constructor do not really empty the parameter. This lead to that I have to write all the move constructor by myself, which is boring and it's easy to make mistakes(for example I add a member but forgot to deal it with in the move constructor).
So any compile flags to make my life easier?
What's more, some guys said that std::move()
do not empty the value is because the "you do not pay for what you don't need" principle, I'm curious that is there any case that the "empty" operation is not needed? All destructors need to use the value to decide to release resources or not, "empty" the value seems a must for me...