rvalue references

bitwise via Digitalmars-d digitalmars-d at puremagic.com
Tue Jun 2 18:57:20 PDT 2015


On Tue, 02 Jun 2015 14:06:31 -0400, Namespace <rswhite4 at gmail.com> wrote:

> On Tuesday, 2 June 2015 at 17:22:07 UTC, Marc Schütz wrote:
>> On Tuesday, 2 June 2015 at 16:02:56 UTC, Namespace wrote:
>>> Thanks to DIP 25 I think it's time to review this again. I would  
>>> implement it (if no one else wants to do it), but there are still some  
>>> unanswered questions:
>>>
>>> 1. Is 'auto ref' still the chosen syntax (I guess so)?
>>
>> Why not `scope ref` (or `in ref` == `const scope ref`)?
>
> See DIP 36
>

I'm feeling like a bit of a troll here, but I can't help myself.

'in' is currently useless because scope is not defined properly, and const  
is too restrictive. Also, because of DIP25, it's now even more useless. It  
seems a pretty sure bet that it will either continue to be completely  
useless or be changed at some point anyways, so why not now? If it's only  
been around since 2.060, how bad could the code breakage really be?  
Replace All a few times and you're done. A compiler warning could be  
issued for the next few versions to notify users that the meaning of 'in'  
has changed, if needed.

So why not re-brand this awesomely concise and convenient keyword to be  
the "non-template auto ref"?

   Bit


More information about the Digitalmars-d mailing list