Re: Qualified class opEquals()

2018-12-27 Thread Jonathan M Davis via Digitalmars-d-learn
On Tuesday, December 25, 2018 7:27:39 AM MST Per Nordlöw via Digitalmars-d- learn wrote: > On Tuesday, 25 December 2018 at 00:32:55 UTC, Paul Backus wrote: > > No, because equality comparison between classes lowers to > > `object.opEquals` [1], which takes both parameters as `Object`. > > This is

Re: Qualified class opEquals()

2018-12-25 Thread Adam D. Ruppe via Digitalmars-d-learn
On Tuesday, 25 December 2018 at 14:27:39 UTC, Per Nordlöw wrote: This is a severe limitation. Are there any plans on fixing this or do I have to wait for Andrei's proposed ProtoObject? Ignore opEquals and use your own interface.

Re: Qualified class opEquals()

2018-12-25 Thread Per Nordlöw via Digitalmars-d-learn
On Tuesday, 25 December 2018 at 00:32:55 UTC, Paul Backus wrote: No, because equality comparison between classes lowers to `object.opEquals` [1], which takes both parameters as `Object`. This is a severe limitation. Are there any plans on fixing this or do I have to wait for Andrei's proposed

Re: Qualified class opEquals()

2018-12-24 Thread Paul Backus via Digitalmars-d-learn
On Monday, 24 December 2018 at 22:58:03 UTC, Per Nordlöw wrote: Is it in the following code possible to make the statement assert(car1 == car2); in the function testEqual() compile in a `@safe pure nothrow @nogc context`? No, because equality comparison between classes lowers to

Qualified class opEquals()

2018-12-24 Thread Per Nordlöw via Digitalmars-d-learn
Is it in the following code possible to make the statement assert(car1 == car2); in the function testEqual() compile in a `@safe pure nothrow @nogc context`? Code: import core.internal.hash : hashOf; /** Hash that distinguishes `Expr(X)` from `NounExpr(X)`. * * See_Also: