Dnia 03-11-2010 o 13:07:25 zhang <bitwo...@qq.com> napisał(a):

// It works
//    bool opEquals(Object a)
//    {
//        writefln("running here.");
//        return data == (cast(AClass)a).data;
//    }

It should be:

override equals_t opEquals(Object o)
{
    writefln("running here.");
    if (auto a = cast(AClass) o)
        return data == a.data;
    else
        return false;
}

I'm surprised it even compiled without 'override'.

BTW, anybody knows what the equals_t bool alias is for?

--
Tomek

Reply via email to