January 31, 2019 Re: DIP 1016 should use expression lowering, not statement lowering | ||||
---|---|---|---|---|
| ||||
Posted in reply to Steven Schveighoffer | 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.
|
January 30, 2019 Re: DIP 1016 should use expression lowering, not statement lowering | ||||
---|---|---|---|---|
| ||||
Posted in reply to Nicholas Wilson | 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.
-Steve
|
Copyright © 1999-2021 by the D Language Foundation