www.digitalmars.com         C & C++   DMDScript  

D - function shortcut for templates

we know that

class Obj(T) {
}

is short for

template Obj(T) {
    class Obj {
    }
}


could

template(T) RetType function(..Parameters..) {
}

be short for

template function(T) {
    RetType function(..Parameters..) {
    }
}

?


template(T) T max(T a,T b) {
    return a > b ? a : b;
}

would look nice.

greetings,
davepermen
Feb 02 2004