4 ms·
> I suppose the reason a Vec doesn't implement Copy then is that its members might not, like a file handle? That is correct, Vec has a pointer to a heap alloca
by masklinn 10y ago
> I suppose the reason a Vec doesn't implement Copy then is that its members might not, like a file handle?
That is correct, Vec has a pointer to a heap allocated buffer, meaning if Vec were Copy, you'd get two Vec structures for the same backing buffer and that's a recipe for disaster.