After reading the related question, I see that the advice in the second most common answer is to use std::move in the list of initializers for the move constructor, because whether it is a primitive type or not, it will do the right thing. I somewhat disagree with this and think that you only need to call std::move , if necessary, but these were personal preferences.
Also, for your forwarding destination operator, the way you have it is fine, although I believe that an unnecessary call to std::move should be deleted personally. Another option is to use std::swap , which will do everything right.
Car Car::operator=(Car && obj) { std::swap(this->prBufferLength, obj.prBufferLength); std::swap(this->prBuffer, obj.prBuffer); return *this; }
The difference between the specified forwarding assignment operator and the forwarding assignment operator is that freeing memory is delayed when your version immediately frees memory, which can be important in some situations.
source share