WAT: opCmp and opEquals woes

H. S. Teoh via Digitalmars-d digitalmars-d at puremagic.com
Fri Jul 25 16:28:02 PDT 2014


On Fri, Jul 25, 2014 at 03:33:24PM -0700, Walter Bright via Digitalmars-d wrote:
> On 7/25/2014 3:31 PM, Walter Bright wrote:
> >On 7/25/2014 2:44 PM, H. S. Teoh via Digitalmars-d wrote:
> >>Uncommenting the const in opCmp fixes the problem.  WAT?
> >
> >opCmp must be const in order to be recognized for TypeInfo.
> >
> 
> See https://dlang.org/operatoroverloading#compare

That page doesn't say anything about TypeInfo, though.  But even then,
why doesn't the compiler reject opCmp signatures that don't match the
compiler's expectations?


T

-- 
It's amazing how careful choice of punctuation can leave you hanging:


More information about the Digitalmars-d mailing list