Multiple Template Specialization Types (in D1)?
Jarrett Billingsley
kb3ctd2 at yahoo.com
Wed Jul 2 06:31:40 PDT 2008
"Nick Sabalausky" <a at a.a> wrote in message
news:g4f8aa$1bkq$1 at digitalmars.com...
>
> I'm still somewhat new to D's templates (been spending a lot of time in
> non-D development...not by choice), so I'm trying to understand exactly
> what's going on here as best as I can. Looked up "IFTI" (Implicit Function
> Template Instantiation), so I see now this method (test2.d) does work, but
> you have to explicitly instantiate the Foo template when calling the
> function:
>
> In main:
> "Foo('a');" -> "Foo!(char)('a');"
>
> That works. The first compiler error being from line 1 threw me off,
> didn't realize that was just a result of the line 9 error below.
>
> But could you explain how it is that Foo stops being a function template?
> Or rather, what is the compiler doing when attempting to process line 9 in
> both the broken "Foo('a');" and fixed "Foo!(char)('a');" scenarios?
More information about the Digitalmars-d-learn
mailing list