On Friday, 10 March 2017 at 20:27:09 UTC, Meta wrote:
On Friday, 10 March 2017 at 17:08:42 UTC, Whatsthisnow wrote:
I guess i am just too used to the java way of x.equals(object)
which at the source is exactly 'return this == object'
Java would return false here too, though, if it actually di
On Friday, 10 March 2017 at 17:08:42 UTC, Whatsthisnow wrote:
I guess i am just too used to the java way of x.equals(object)
which at the source is exactly 'return this == object'
Java would return false here too, though, if it actually did
`this == object` in its default compare method. If I
On 03/10/2017 08:22 AM, DRex wrote:
Error: function app.A.opEquals does not override any function, did you
mean to override 'object.Object.opEquals'?
My A class appears exactly as mentioned in your comment...
FWIW, here's some other info:
http://ddili.org/ders/d.en/object.html#ix_object.op
On Friday, 10 March 2017 at 16:47:47 UTC, Adam D. Ruppe wrote:
On Friday, 10 March 2017 at 16:36:17 UTC, DRex wrote:
I'm fairly new to D, but this seems to be quite a pain in the
rear for a simple comparison of instances of classes...really
odd that comparing instances of classes in D requires
On Friday, 10 March 2017 at 16:36:17 UTC, DRex wrote:
I'm fairly new to D, but this seems to be quite a pain in the
rear for a simple comparison of instances of classes...really
odd that comparing instances of classes in D requires that
messing around when D seems all about simplifying things..
On Friday, 10 March 2017 at 16:30:00 UTC, Adam D. Ruppe wrote:
On Friday, 10 March 2017 at 16:22:18 UTC, DRex wrote:
Error: function app.A.opEquals does not override any function,
did you mean to override 'object.Object.opEquals'?
Oh sorry, maybe I messed up the const. Try:
override bool opEq
On Friday, 10 March 2017 at 16:22:18 UTC, DRex wrote:
Error: function app.A.opEquals does not override any function,
did you mean to override 'object.Object.opEquals'?
Oh sorry, maybe I messed up the const. Try:
override bool opEquals(A rhs) { ... }
and if the compiler still complains change
On Friday, 10 March 2017 at 16:13:21 UTC, Adam D. Ruppe wrote:
On Friday, 10 March 2017 at 16:08:05 UTC, DRex wrote:
Am I missing something here?
Yeah, you need to implement a custom equality operator.
class A {
int member;
override bool opEquals(const A rhs) {
return this.membe
On Friday, 10 March 2017 at 16:08:05 UTC, DRex wrote:
Am I missing something here?
Yeah, you need to implement a custom equality operator.
class A {
int member;
override bool opEquals(const A rhs) {
return this.member == rhs.member; // and other members
that need to be equal