Move Constructor Syntax

Timon Gehr timon.gehr at gmx.ch
Wed Oct 16 18:23:23 UTC 2024


On 10/16/24 20:21, Timon Gehr wrote:
> 
> Yes, I think the sane design is that if you pass an lvalue to an rvalue 
> parameter, that results in a copy (during argument passing), and the 
> copy is destroyed when it goes out of scope in the constructor.
> 
> So if you explicitly call an rvalue constructor, that would behave the 
> same as previously.

(Of course, this is all assuming last-use analysis does not insert 
moves, but it cannot do that in your example because the asserts read 
the value after the last opportunity for a move.)


More information about the Digitalmars-d mailing list