Originally posted by Jesper Young:
That's not the way you should look at it. Look at it this way: Both indices are 0-based, but the begin index is inclusive, and the end index is exclusive.
Yeah, this is the only part of K&B that really made me shake my head when I first read it. What were they thinking when they wrote this "end index is 1-based" explanation? Not only is it more confusing than the "end index exclusive" explanation, but the official API documentation itself uses the "end index exclusive" terminology. (Bert, if you're around, I'd love to hear your thoughts on this.
)