how to compare immutable ints?

Charles Hixson charleshixsn at earthlink.net
Tue Jun 18 10:45:34 PDT 2013


How should I compare immutable ints to ensure that they are actually equal?

I was quite surprised to receive the following error message:

cbt2.d(732): Error: function object.Object.opEquals (Object o) is not 
callable using argument types (immutable(int))

when I tried to assert that two values were equal.  They were (should 
be), indeed, immutable ints, but I'd prefer that I could check that they 
were equivalent without printing them both out.  (I'm having a bit of 
trouble keeping my logic straight, so I'm trying to assert many things 
that should obviously be true.  And sometimes I've been surprised.)

-- 
Charles Hixson



More information about the Digitalmars-d-learn mailing list