templates and functions

Daniel daniel.lincke at pik-potsdam.de
Mon Sep 26 09:00:54 PDT 2011


Sorry, minor mistakes ;)
Again:

Thx, Simen.

Unfortunately, this works only for concretet types, but not for type parameters.
Example:

class Test(A) {

    A do_nothing(A x) {
       return x;
    }
}

/* WORKS */
Test!int test() {
    return new Test!(int);
}

/* Error : undefined identifier A */
Test!A test() {
    return new Test!(A);
}



More information about the Digitalmars-d mailing list