Templates in classes => what is wrong?

John Chapman johnch_atms at hotmail.com
Sun Apr 15 04:23:36 PDT 2012


On Sunday, 15 April 2012 at 11:16:43 UTC, Xan wrote:
>
> int main(string [] args)
> {
>     auto alg = Algorisme!(int,int);

Should be:
       auto alg = new Algorisme!(int, int);

>     alg.nom = "Doblar";
>     alg.versio = 1;
>     alg.funcio = (int a) {return 2*a};

Should be:
       alg.funcio = (int a) { return 2 * a; };
or:
       alg.funcio = a => 2 * a;

> }


More information about the Digitalmars-d-learn mailing list