3 ms·
No I meant that the only difference between a move and a copy under the hood is that the compiler can assume the destination memory overlaps the source. If the
by qppo 6y ago
No I meant that the only difference between a move and a copy under the hood is that the compiler can assume the destination memory overlaps the source. If the struct is large that might mean using a memmove instead of memcpy.
I don't think aliasing the this pointer matters, since it's the pointed-to memory that could be aliased.
But I'm not sure if that's actually faster or if any compiler utilizes the semantic difference.