It doesn't work. obj == obj calls .opEquals(obj, obj), whose signature
is:
bool opEquals(Object obj1, Object obj2)
So even if you mark a derived instance's opEquals as const, the derived
class is stripped back down to Object before any calls are made.
Memoization and lazy calculations are not as important as being able to
compare const or immutable objects.
-Steve
This one is a very serious issue.
Should changing their signatures to:
bool op###(auto ref const Object) const // breaking change but just
signature
and addressing "auto ref" enough to fix it?
A few reports and Andrei's comment indicates that there is some
misunderstanding(?) on semantics/implementation.
http://d.puremagic.com/issues/show_bug.cgi?id=4215#c4
http://d.puremagic.com/issues/show_bug.cgi?id=4668
http://d.puremagic.com/issues/show_bug.cgi?id=4258
With a glance to source code, looks like all that is required is just a
few lines of change.
--
Using Opera's revolutionary email client: http://www.opera.com/mail/