On Saturday, 3 June 2017 at 19:57:47 UTC, Mark wrote:
Hello again.

I'm designing a template version of a BST.

Because of this, I want to be able to compare if two objects of the same class type are references to the same anonymous class on the heap somewhere.

Example:

Not sure what happened there.

Anyways, example:

auto A = new Box();
auto B = new Box();

if(A.opEquals(B)) {}

gives the error
test.o:(.data.rel.ro+0x18): undefined reference to `_D5Stack12__ModuleInfoZ'
collect2: error: ld returned 1 exit status
Error: linker exited with status 1

if(Object.opEquals(A,B) gives

test.d(10): Error: function object.Object.opEquals (Object o) is not callable using argument types (Box, Box)


How do I got about comparing two objects then??
Thanks.

Reply via email to