Wrong selection of opEquals for objects.

Alexandru Ermicioi alexandru.ermicioi at gmail.com
Fri Aug 28 13:35:43 UTC 2020


On Friday, 28 August 2020 at 12:29:20 UTC, Simen Kjærås wrote:
> ....

Seems that these methods should be rooted out from Object, and 
placed in respective interfaces like:

-----
interface Equatable(T) {
     bool opEquals(T value);
}
-----

Then it would be a lot more simple. People who want equality 
check, will implement interface with right type, for example 
Equatable!Object.

- Alex


More information about the Digitalmars-d-learn mailing list