On Sun, 08 Apr 2012 00:18:41 +0300, Vladimir Panteleev
<[email protected]> wrote:

I've hit the mysterious opEquals problem again (this time with nothrow instead of pure). I'm going to try minimizing my codebase and find the cause.

I found the problem. The cause is that Object's opEquals is not nothrow,
another chicken-and-egg problem.

class C
{
        override bool opEquals(Object o) const nothrow
        {
                return true;
        }
}

struct S
{
        C o;

        bool opEquals(ref const S s) const nothrow
        {
                return o == s.o;
        }
}

What's even worse, is that overriding Object's opEquals with a nothrow
implementation still causes the error. I guess that's because a==b calls
the free opEquals function from object.d, which is not nothrow.

--
Best regards,
   Vladimir                            mailto:[email protected]
_______________________________________________
dmd-beta mailing list
[email protected]
http://lists.puremagic.com/mailman/listinfo/dmd-beta

Reply via email to