Discussion: Rvalue refs and a Move construtor for D

Manu turkeyman at gmail.com
Wed Sep 4 18:31:12 UTC 2019


On Wed, Sep 4, 2019 at 1:25 AM Suleyman via Digitalmars-d
<digitalmars-d at puremagic.com> wrote:
>
> On Wednesday, 4 September 2019 at 00:33:06 UTC, Exil wrote:
> > How would it work with multi-function passing though? With a
> > rvalue reference, you are effectively just passing around a
> > reference.
>
> That aspect of rvalue ref is simply assigning to a temporary then
> passing it by ref.
>
> C++ example: https://cpp.godbolt.org/z/PRmkjd
> D equivalent: https://d.godbolt.org/z/idPqIN

And it comes for free with Andrei's DIP `-preview`...


More information about the Digitalmars-d mailing list