Why check this != other? I've seen this once before in a codebase and concluded it was unnecessary.
Asking as someone whose life became much easier after opting not do anything of the above and just write C in C++ ;-)
Asking as someone whose life became much easier after opting not do anything of the above and just write C in C++ ;-)
If src and this are equal and you don't check for it, then you end up destroying src/this resources and the end result would be an empty vector (since the last step is to clear everything out).
The expected behavior is a no-op.
I probably still wouldn't care, unless it's clear that moving to self is even required. Trying to break everything in a thousand pieces and generalizing and perfecting them individually is a lot of busywork.