Behavior of opEquals

Steven Schveighoffer via Digitalmars-d digitalmars-d at puremagic.com
Thu Sep 3 06:05:50 PDT 2015


On 9/2/15 2:57 PM, Jacob Carlborg wrote:

> In this case the solution/workaround is to explicitly call
> super.opEquals, but that will miss some optimizations implemented in
> object.opEquals.

Those optimizations have already been exploited by the time you get to 
Foo.opEquals, so I wouldn't worry about that.

However, the avoidance of casting would be a good goal. One of the 
things I don't like about the current == implementation for objects is 
it cannot take any advantage of type knowledge at the call site.

-Steve


More information about the Digitalmars-d mailing list