opEquals code generation

Steven Schveighoffer schveiguy at yahoo.com
Tue Sep 19 23:19:53 UTC 2017


On 9/19/17 4:28 PM, Neia Neutuladh wrote:

> Could be a bit simpler than that, depending on your needs:
> 
> bool opEquals(Object other) const nothrow @nogc
> {
>      auto f = cast(typeof(this)) other;
>      if (f is null) return false;
>      return this.tupleof == other.tupleof;
> }

That doesn't compare floating point in the way he wants.

-Steve


More information about the Digitalmars-d-learn mailing list