8:04 Then what is the point of defining a move assignment operator at all? If the same assignment operator can be used for rvalue references and regular lvalues?
Very nice presentation! I think that the usage of the raw pointer instead of a unique_ptr object is just for the sake of simplicity. That Bradley is using 0 in place of nullptr is to preserve legality with older compilers.
You seriously need to do more of that.
There aren't such high-level lessons that are so well presented.
Thank you!
@Bradley Please come up with more c++ videos.Thanks :)
Great video and great series of tutorials. Thanks 😊
8:04 Then what is the point of defining a move assignment operator at all? If the same assignment operator can be used for rvalue references and regular lvalues?
Very nice presentation! I think that the usage of the raw pointer instead of a unique_ptr object is just for the sake of simplicity. That Bradley is using 0 in place of nullptr is to preserve legality with older compilers.
awesome video thanks, looking forward for more such advanced videos
Thanks for the video, very useful. Looking forward for more videos.
Thanks a million. Helped a lot !
I was wondering whether a smart pointer should be used in place of the raw pointer? the constructors could throw when allocating memory.
not an issue, if a ctor throws its dtor isn't invoked. Already constructed members do have their dtors invoked in such a scenario
Thanks!
why we dont delete the old object ?!
Because we swapped the pointers with the local temporary object, so the destructor of the temporary object will take care of deleting the old object.
@@bradleyneedham1666 so the temporary object will only live tell the assignment operator function end and then the destructor get called on it ?!
@@abdelrhmanahmed1378 yes