Is there a way to set an alias to specific form of a template?

Andrej Mitrovic andrej.mitrovich at gmail.com
Fri Oct 7 19:33:06 PDT 2011


You don't have to rewrite Vector for multiple dimensions, methinks:

class Vector(T...) {
    this(T t) {}
}

void main()
{
    alias Vector!(float, float) vec2f;
    auto v = new vec2f(1.0,1.0);
}

You'll probably have to play with `static if`, template constraints,
and stuff like that.


More information about the Digitalmars-d-learn mailing list