4 ms·
Rust is stricter about aliasing than C++ is. Vectors are the size of 3 pointers (data, size, capacity), so I guess 24 bytes on x64. Even if the move requires
by ReactiveJelly 6y ago
Rust is stricter about aliasing than C++ is.
Vectors are the size of 3 pointers (data, size, capacity), so I guess 24 bytes on x64.
Even if the move requires a memcpy, it's only copying that 24 bytes - The heap allocation is not copied, because there are never two owners of the vector at once.