3 ms·
Destructuring doesn't cause problems for move semantics, it's that move semantics restrict the ways in which you can destructure an object. Essentially, if you
by seabee 12y ago
Destructuring doesn't cause problems for move semantics, it's that move semantics restrict the ways in which you can destructure an object.
Essentially, if you're trying to destructure a borrowed object, you have to use references. If instead you tried to destructure its fields into owned objects, this would involve moving the field in the borrowed object into your owned object, except you're not allowed to destroy borrowed objects.
For further clarification, when you say "I wish to use the name X to refer to field Y", that's a reference (X refers to Y).