Operator overloading for size_t

Adam D. Ruppe destructionator at gmail.com
Thu Mar 14 18:18:47 UTC 2019


On Thursday, 14 March 2019 at 18:07:46 UTC, Alec Stewart wrote:
>         // let's just stick with this.
>         return d_start.opEquals(other.d_start) && 
> d_end.opEquals(other.d_end);

Why not just use d_start == other.d_start && d_end == other.d_end 
there?


> So should I bother with operator overloading here, or just make 
> a member function?

You shouldn't often call .opEquals yourself, just write a == b 
and let the compiler translate it if it needs to.


More information about the Digitalmars-d-learn mailing list