Skip to content

hint (or directions?) for move_semantics2 are confusing/wrong? #1596

@solarshado

Description

@solarshado

Working my way through 5.5.1, and the hint for move_semantics2 suggests multiple solutions. However, unless I've misunderstood something, neither of the first two suggestions produce the "expected output" described in the comments above main(); they both copy vec0 before it's populated, leaving it empty when printed.

As far as I can tell, the only suggestion that does work is the third (mutably borrow a reference to vec0), which, contradictory to what the hint says, is the only option which doesn't affect the output of the first println!.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions