D - Value template parameters (BUG maybe)
- Tobias Neukom <tneukom swissonline.ch> Jan 13 2004
- "Walter" <walter digitalmars.com> Jan 14 2004
Hi everyone
I'm trying to port my matrix class from C++ to D. The C++ Class makes
heavy use of templates and I want to do it the same way in D. Why DOES
the following code compile?
template mat(int ROWS, int COLS) {
struct matrix {
float items[ROWS * COLS];
}
}
void foo(mat!(4,4).matrix x) {
}
int main ( char [] [] args ) {
mat!(5,6).matrix a;
foo(a);// Should NOT work because the type of the
// paramter x is mat!(4,4).matrix
return 0;
}
Cheers Tobias
Jan 13 2004








"Walter" <walter digitalmars.com>