On Thu, 3 Oct 2024 at 03:21, Walter Bright via Digitalmars-d <digitalmars-d@puremagic.com> wrote:
On 10/1/2024 1:15 PM, Timon Gehr wrote:
> I guess the new implementation you have in mind is something like the following?
>
> ```d
> auto move(T)(ref T arg)=>__rvalue(arg);
> ```

Not exactly. __rvalue would also convert an rvalue to an rvalue.

-preview=rvaluerefparams addresses this; it allows an rvalue to be supplied to the lvalue there. It's actually an essential mechanic to this whole thing, because it will allow the appropriate selection of copy/move overloads where a type may define either one, or both. If a copy and/or move constructor exists, it needs to select the proper one, and the -preview handles that properly as is.