AA with complex keytype?
Manfred Nowak
svv1999 at hotmail.com
Fri Feb 9 08:03:19 PST 2007
Frits van Bommel wrote
> As long as the order is consistent[1] (a < b && b <
> c => a < c, that sort of thing) they're happy.
Thank you. This answers my question.
But immediately another arises:
Why are classes required to implement opCmp( Object) for AA's to
function properly?
Currently AA's misbehave if opCmp(Object) is not overwritten for a
class, but no error is thrown.
For the transitivity of an ordering it suffices for opCmp(Object) to
always give "==" if the objects are equal, and give "<" if they are
not.
It should be easy to implement this as the default opCmp(Object).
More information about the Digitalmars-d
mailing list