http://wiki.dlang.org/DIP25

Steven Schveighoffer via Digitalmars-d digitalmars-d at puremagic.com
Mon Dec 29 11:54:33 PST 2014


On 12/29/14 2:04 PM, Dicebot wrote:
> On Monday, 29 December 2014 at 19:00:06 UTC, Andrei Alexandrescu wrote:
>> I tend to agree. You seem to have shown that reusing inout for scope
>> information becomes confusing. -- Andrei
>
> What is the problem with using inout exactly as it is now (== both for
> argument and return type) but defining it to propagate aliasing
> information as it is decribed in DIP25?

It can, and I don't have a problem for that.

But I think disallowing:

ref T foo(T)(ref T t) { return t;}

Is no good. The DIP seems to be indicating inout can have another use 
that has nothing to do with const, but I'm not exactly sure.

Ironically, inout used to be an alias for ref :)

-Steve


More information about the Digitalmars-d mailing list