std.v2020.algorithm etc[ WAS: Is run.d going to be expand for runtime and the phobos library?]

Andrei Alexandrescu SeeWebsiteForEmail at erdani.com
Tue Jun 23 18:14:12 UTC 2020


On 6/23/20 1:01 PM, Steven Schveighoffer wrote:
> On 6/23/20 11:54 AM, Andrei Alexandrescu wrote:
>> No, it doesn't work because of the implicit conversion, although 
>> implicit conversion is part of it.
> 
> Whether the compiler hacks it by converting the type before invoking the 
> type detection, or whether it hacks by adjusting the IFTI detection is 
> not really important.

*nod*

> In the general case, though, there is no implicit conversion -- the 
> conversion function must be used. So it would be important to call the 
> conversion function before IFTI is invoked.
> 
> But another solution would be define implicit conversions that are 
> preferred for IFTI/auto. Like an opCanonical or something. This I think 
> sits better and is more consistent.

Yah, that's what I meant with opOnCall. opOnAutoOrIFTI...

> There are other cases aside from tail-const that could make IFTI more 
> usable. For example: https://issues.dlang.org/show_bug.cgi?id=4998
> 
> This wouldn't be doable without some more help from the compiler during 
> IFTI with possibly template constraints.

*nod*



More information about the Digitalmars-d mailing list