hi,

I have this code:

import std.conv, std.stdio, std.stream, std.string;
import std.socket, std.socketstream;
import std.datetime;

class Algorisme(U,V) {
    string nom;
    uint versio;
    V delegate (U) funcio;

}

int main(string [] args)
{
    auto alg = Algorisme!(int,int);
    alg.nom = "Doblar";
    alg.versio = 1;
    alg.funcio = (int a) {return 2*a};
}

but when I compile I receive errors:

$ gdmd-4.6 algorisme.d
algorisme.d:22: found '}' when expecting ';' following return statement
algorisme.d:25: found 'EOF' when expecting ';' following statement
algorisme.d:25: found 'EOF' when expecting '}' following compound statement


What is wrong?

Thanks in advance,
Xan.

Reply via email to