At 11:37 AM -0700 1/24/08, Thom Boyer wrote:
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?

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 don't think you understood Joe's more obvious question.

AFAIK, the Order values are supposed to numify like this:

  Order::Increase -> -1
  Order::Same     ->  0
  Order::Decrease -> +1

The above quoted text shows the numify in the order [-1,0,1], but the Order values are not in the corresponding sequence.

To fix the problem, the S29 text should probably say:

returns |Order::Increase|, |Order::Same|, or |Order::Decrease| (which numify to -1, 0, +1)

That way, reading the S29 text makes more sense.

This is, I believe, what Joe was pointing out needed to be fixed.

-- Darren Duncan

Reply via email to