Find out what type my class is being converted to for comparisons

rassoc rassoc at posteo.de
Wed Oct 19 09:54:32 UTC 2022


On 10/19/22 00:43, Matthew Rushworth via Digitalmars-d-learn wrote:
> Thank you, that worked perfectly, not sure exactly what I did wrong, I'm assuming I forgot to make the parameter a const variable

Object, the root of the class object hierarchy already defines an opEquals [1] and you need to overload/overwrite that for it to work properly. Only class methods are considered, hence ag0aep6g's suggestion.

[1] https://dlang.org/library/object/object.op_equals.html


More information about the Digitalmars-d-learn mailing list