[Issue 1650] Incorrect overload selected with IFTI
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sun Jun 15 09:49:25 PDT 2008
http://d.puremagic.com/issues/show_bug.cgi?id=1650
------- Comment #11 from sean at invisibleduck.org 2008-06-15 11:49 -------
(In reply to comment #9)
> Okay, I understand the logic, though I'm not sure I understand the reasoning
> behind it. I would expect the more correct set of function parameters to be
> chosen among the set of instantiable function templates rather than the
> reverse.
Let me clarify this a bit. My original (incorrect) understanding of "more
specialized" related to the amount of 'work' required to make the set of
function parameters work for the supplied arguments. For example:
void fn(T)( T val ) {}
void fn(T)( T[] val ) {}
With the above, I would expect the second function to be a better match for
array arguments because T represents less of the complete type, since the array
specifier "[]" is explicit. Then I added the dummy template parameter so the
module would compile.
--
More information about the Digitalmars-d-bugs
mailing list