3 ms·
> You can still write the same bug in Rust I honestly don't think you can. If you try to iterate over values instead of references, you'll take ownership of th
by sapiogram 3y ago
> You can still write the same bug in Rust
I honestly don't think you can. If you try to iterate over values instead of references, you'll take ownership of the vector and not be able to use it again.
- tylerhou 3y agoIf the value is Copy, you will make a copy and won’t take ownership, right? (Iterate over a vector of ints). Granted Rust structs are not Copy by default. Same with any C++ class for which there is no copy constructor.