Bug 14152 – Document when function returns are moves vs. copies

Status
NEW
Severity
enhancement
Priority
P4
Component
dlang.org
Product
D
Version
D2
Platform
All
OS
All
Creation time
2015-02-08T21:45:22Z
Last change time
2024-12-15T15:22:46Z
Assigned to
No Owner
Creator
Peter Alexander
Moved to GitHub: dlang.org#4037 →

Comments

Comment #0 by peter.alexander.au — 2015-02-08T21:45:22Z
The language specification makes no mention of when a value will be moved or copied when returned from a function. This is important not just for optimization, but for semantics of non-copyable types (e.g. Unique). Particularly, we need to guarantee: 1. Returning an rvalue does not entail a copy. 2. Last return of a function local variable does not entail a copy. See discussion: http://forum.dlang.org/thread/[email protected]
Comment #1 by robert.schadek — 2024-12-15T15:22:46Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dlang.org/issues/4037 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB