http://wiki.dlang.org/DIP25
Andrei Alexandrescu via Digitalmars-d
digitalmars-d at puremagic.com
Tue Dec 30 21:28:32 PST 2014
On 12/30/14 7:32 PM, Manu via Digitalmars-d wrote:
> While that code is legal, the rejection of rvalue->ref is absolutely arbitrary.
> The 'workaround' for not allowing rvalue->ref is to simply assign it
> to a stack local with a stupid name (eg: t1, t2, etc) on the preceding
> line.
> That workaround appears in*every* instance that rvalue->ref would be
> used, making code messy and more difficult to maintain.
The alternate hypothesis is "ref" is being misused. "ref" is for
propagating changes into the arguments. It should be rare that code does
not actually care for that. Unlike in C++, ref is seldom needed for
optimizing copies away. -- Andrei
More information about the Digitalmars-d
mailing list