std.v2020.algorithm etc[ WAS: Is run.d going to be expand for runtime and the phobos library?]
Steven Schveighoffer
schveiguy at gmail.com
Tue Jun 23 17:01:06 UTC 2020
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.
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.
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.
-Steve
More information about the Digitalmars-d
mailing list