class template as a type

Karl asdf at asdf.com
Tue Sep 18 20:59:39 PDT 2007


Hi,

I've been playing around with templates, i'm a newbie in this matter, i created a class template and i want to use it as a type in functions and create arrays of it. Any help please.

Code sample:

module hello;

template Test(alias T)
{
    class Test
    {
        this(){} int x; ...
    }
}

void Foo(Test t){}

static Test[] myarray;


More information about the Digitalmars-d-learn mailing list