DIP 1016 should use expression lowering, not statement lowering

Steven Schveighoffer schveiguy at gmail.com
Thu Jan 31 03:26:05 UTC 2019

On 1/30/19 10:03 PM, Nicholas Wilson wrote:
> On Thursday, 31 January 2019 at 02:29:47 UTC, Steven Schveighoffer wrote:
>> I came up with this idea based on tempCString, but it doesn't work:
>> So I don't get why it doesn't work. But if that was fixed, could be a 
>> potential workaround without requiring a DIP.
> Thats nice! But it doesn't fix the problem that in generic code you 
> don't know without checking if you need to do that. Also the template 
> bloat.

Yeah, it could do this too:

auto ref rv(T)(auto ref T t)
    static if(__traits(isRef, t)) return t;
    else /* do the other stuff */

But yes, template bloat. Plus having to put rv on everything... would 
suck. The DIP to me seems like it should be good with the clarification 
of not applying to lvalue -> rvalue auto translations.


More information about the Digitalmars-d-announce mailing list