templates and functions

Daniel daniel.lincke at pik-potsdam.de
Mon Sep 26 08:59:20 PDT 2011


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 */
Id_Func!int test() {
    return new Test!(int);
}

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


More information about the Digitalmars-d mailing list