[Issue 1650] Incorrect overload selected with IFTI
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Fri Jun 13 02:03:17 PDT 2008
http://d.puremagic.com/issues/show_bug.cgi?id=1650
------- Comment #6 from bugzilla at digitalmars.com 2008-06-13 04:03 -------
The "most specialized" template selection algorithm works with the template
parameters, not the function parameters.
Currently, the only way to make this example work is:
void proc(T, U=void)( T val )
{
printf( "proc:T\n" );
}
void proc(T:U[], U)( T val )
{
printf( "proc:T[]\n" );
}
void main()
{
proc( 0 );
proc( "abc".dup );
}
because (U[],U) is a match for (T,U), but (T,U) is not a match for (U[],U).
--
More information about the Digitalmars-d-bugs
mailing list