June 15, 2008
http://d.puremagic.com/issues/show_bug.cgi?id=1650





------- Comment #10 from sean@invisibleduck.org  2008-06-15 11:31 -------
Oh, I suppose I should mention that the reason this all came up in the first place is because specialization as in your example doesn't work if the parameter is a static array, while my original example does.  That's what prompted the design I'd originally chosen.


-- 

June 15, 2008
http://d.puremagic.com/issues/show_bug.cgi?id=1650





------- Comment #11 from sean@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.


-- 

January 25, 2010
http://d.puremagic.com/issues/show_bug.cgi?id=1650


Witold Baryluk <baryluk@smp.if.uj.edu.pl> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |baryluk@smp.if.uj.edu.pl


--- Comment #12 from Witold Baryluk <baryluk@smp.if.uj.edu.pl> 2010-01-24 21:09:31 PST ---
You should use probably something like this:
void proc(T : T[])(T[] val) {
}

Is there any reason this is still open?


I cheked documentation and there is such snippet:
  void Foo(T, U=T*)(T t) { U p; ... }

  int x;
  Foo(&x);    // T is int, U is int*

Well, for me it is strange that comment says "T is int", Foo is specialized and recived T (int), but we give it a pointer. Something really wrong somewhere.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
January 22, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=1650


Walter Bright <bugzilla@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |INVALID


--- Comment #13 from Walter Bright <bugzilla@digitalmars.com> 2012-01-21 21:39:46 PST ---
I believe the spec and the behavior of the compiler are matching and correct.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
1 2
Next ›   Last »