https://d.puremagic.com/issues/show_bug.cgi?id=3882



--- Comment #21 from Per Nordl�w <[email protected]> 2014-03-01 17:01:58 
PST ---
(In reply to comment #20)
> (In reply to comment #19)
> 
> > What does test.f!int.f mean?
> > ...
> > @safe pure nothrow T f(T)(T x)
> > {
> >     return x*x;
> > }
> > void main(string args[])
> > {
> >     int x = 3;
> >     f(x);
> > }
> 
> f here is not a function, it's a function template.
> 
> This code:
> 
> @safe pure nothrow T f(T)(T x) {
>     return x*x;
> }
> 
> Is the same as:
> 
> template f(T) {
>     @safe pure nothrow T f(T x) {
>         return x*x;
>     }
> }
> 
> So when you call f inside the test module with an int you are actually calling
> test.f!int.f
> 
> For a templated function the second f is redundant in the error message.

Ahh, get it.

I guess I still need to figure out how to print test.f instead right?

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

Reply via email to