- 
                Notifications
    You must be signed in to change notification settings 
- Fork 13.9k
Closed
Labels
A-codegenArea: Code generationArea: Code generationA-type-systemArea: Type systemArea: Type systemC-cleanupCategory: PRs that clean code up or issues documenting cleanup.Category: PRs that clean code up or issues documenting cleanup.
Milestone
Description
In changing code to prepare for #2633, I'm noticing that most of the "copying a noncopyable" errors when I disable last-use have to do with a return, usually a return of a local variable. I propose that a return x should, by default, mean return (move x) when x is an owned lvalue. This avoids the need to insert lots of explicit moves once last-use is disabled.
An argument against this proposal is that the point of #2633 is to make more things explicit, and this proposal makes more things implicit again. However, I think it's easier to understand that "return is move" when you're returning something you own than it is to understand how last-use works.
Metadata
Metadata
Assignees
Labels
A-codegenArea: Code generationArea: Code generationA-type-systemArea: Type systemArea: Type systemC-cleanupCategory: PRs that clean code up or issues documenting cleanup.Category: PRs that clean code up or issues documenting cleanup.