Discussion: Rvalue refs and a Move construtor for D

Suleyman sahmi.soulaimane at gmail.com
Sat Sep 7 21:59:54 UTC 2019


On Saturday, 7 September 2019 at 21:41:16 UTC, kinke wrote:
> It's not because of dangerousness or such, but firstly because 
> I think pure rvalue refs (disallowing lvalue args) are used 
> extremely seldomly, and secondly because I want to avoid 
> further syntactic complexity. We have ref, auto ref, scope ref, 
> return ref, now we're discussing @rvalue ref...

That still doesn't justify hiding it under auto ref. If it is 
rarely used then even if you add the attribute to the language it 
will be rarely used. Instead of explaining the new @rvalue 
keyword, we will be explaining the unnamed auto ref expansion. 
There is a difference between being naturally rarely used and 
inconveniencing people off of it.

When you have a bloat of names then fix the naming conventions. 
Hiding this under existing stuff like auto ref is like brushing 
it under the carpet.



More information about the Digitalmars-d mailing list