Discussion: Rvalue refs and a Move construtor for D

Suleyman sahmi.soulaimane at gmail.com
Sat Sep 7 20:25:02 UTC 2019


On Saturday, 7 September 2019 at 06:03:38 UTC, Manu wrote:
> On Fri, Sep 6, 2019 at 3:55 PM Suleyman via Digitalmars-d 
> <digitalmars-d at puremagic.com> wrote:
>>
>> On Friday, 6 September 2019 at 22:32:55 UTC, Manu wrote:
>> > S is an rvalue; there are no other references to S. That's 
>> > the point.
>>
>> With rvalue ref there is a reference. That's the point of 
>> rvalue ref passing rvalue around by reference.
>
> The whole point is to destroy the source value though, because 
> there's no external reference to it. If you receive an rvalue 
> ref, it's yours to do as you like with it.

Yes you can do anything including rendering the object invalid 
and even without this feature. You don't need this feature 
because it generally doesn't make sense and you can do without it.



More information about the Digitalmars-d mailing list