Joe Gottman wrote:
In the definition of cmp, S29 says the function "returns
|Order::Increase|, |Order::Decrease|, or |Order::Same| (which numify
to -1, 0, +1)". Shouldn't the enumerations and their numerical values
be listed in the same order?
Joe Gottman
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.
=thom
--
I wanna hang a map of the world in my house. Then I'm gonna put pins
into all the locations that I've traveled to. But first, I'm gonna have
to travel to the top two corners of the map so it won't fall down. --
Mitch Hedberg