www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - template parameters

reply "Bent Rasmussen" <exo bent-rasmussen.info> writes:
I suspect this bug is on the to-do scroll, but I'll mention it

module test;

void main ()
{
}

class A(T)
{
}

class B (T, S: A!(T))
{
}

dmd test.d

The compiler is okay with "S: T", "S = T" and "S: T = T". XP DMD 0.97
Jul 31 2004
parent Sean Kelly <sean f4.ca> writes:
Bent Rasmussen wrote:

 I suspect this bug is on the to-do scroll, but I'll mention it
 
 module test;
 
 void main ()
 {
 }
 
 class A(T)
 {
 }
 
 class B (T, S: A!(T))
 {
 }
 
 
dmd test.d

"test.d(7): identifier 'T' is not defined"

This raises the interesting issue of template template parameters, but in the above example you don't actually need the second template parameter at all. Sean
Jul 31 2004