Template argument deduction is too strict
Jarrett Billingsley
jarrett.billingsley at gmail.com
Tue Oct 21 06:12:25 PDT 2008
On Tue, Oct 21, 2008 at 9:07 AM, Lars Kyllingstad
<public at kyllingen.nospamnet> wrote:
> The function template
> void foo(A)(A a, real b) { ... }
> is matched by
> foo(1, 1.0L);
> but not by
> foo(1, 1.0);
> since the second argument is a double literal.
>
> I think the latter should also work, since it would work for a non-templated
> function. Don't you agree? :)
>
> I am using D1, by the way. Is it the same in D2?
>
> -Lars
>
It's a bug that Walter tried to fix a while ago, didn't get right, and
as far as I know _still_ hasn't gotten right.
More information about the Digitalmars-d
mailing list