Thom Boyer wrote: > The enumerations and the numerical values are both in correct order. > Since "abc" is less than "xyz", "abc" cmp "xyz" is being invoked with > its arguments in increasing order, So it returns Order::Increase. That > numifies to -1 because that's how "less-than" is usually encoded.
Others have pointed out Joe's actual intent in asking the question; so I won't belabor the point. Instead, I'll say that the idea that Order::Increase numifies to -1 is going to take some getting used to. While I understand the reasoning behind it, my intuition would have been to numify it to +1 for an increase and -1 for a decrease. If C<"abc" cmp "xyz"> must numify to -1, could we please choose something like 'Order::Before' and 'Order::After' instead of 'Order::Increase' and 'Order::Decrease'? Not only does this make more intuitive sense, but it also pairs the Order values more closely with the type-neutral comparison operators ('before' and 'after'). (Which brings up another point, which I'll freely admit I'm too lazy to look up at the moment: do we already have a type-neutral operator that corresponds to 'Order::Same'? I suspect that '===' is it; but my grasp of the plethora of equivalence operators is somewhat shaky. If not - and possibly even if so, depending on which paradigm is the most important one to reinforce - I might recommend using 'same' to complete the 'before'/'after' set of operators.) -- Jonathan "Dataweaver" Lang