[Issue 2257] Template value parameters behave like alias parameters

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Oct 13 10:21:12 PDT 2009


http://d.puremagic.com/issues/show_bug.cgi?id=2257


Rob Jacques <sandford at jhu.edu> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |sandford at jhu.edu


--- Comment #2 from Rob Jacques <sandford at jhu.edu> 2009-10-13 10:21:10 PDT ---
This issue causes major issues with Nd-array and Small Vector implementations,
as the incorrect type signatures play havoc with other templated functions.
Here is another test case illustrating the problem:

import std.stdio;
struct Matrix(T,size_t D) {
    Matrix!(U,D) foo(U)(U v) { return Matrix!(U,D)(); }
}

void main() {
    real r;
    size_t d = 2;
    Matrix!(float,2) m;
    writeln(typeof( m.foo(r) ).stringof);            //writes Matrix(float,D)
    Matrix!(float,d) n;
    writeln(typeof( n ).stringof);                   //writes Matrix(float,d)
}

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


More information about the Digitalmars-d-bugs mailing list