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