January 31, 2019
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
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
1 2
Next ›   Last »