On Jun 12, 2013, at 01:14 , Oleg Krupnov <oleg.krup...@gmail.com> wrote:

> What if I have sparse array etc.
> 
> One higher bit is actually twice as many elements. Why having
> NSUInteger at all if you can't use more than NSIntegerMax? This
> doesn't seem right.

-- If you're talking about NSArray, there's no such thing as a sparse array. 
That's why NSNotFound == NSIntegerMax works  -- it's a value you can *never* 
use as a NSArray index, *not* an artificial limitation on the range of indexes.

-- The same is true for (non-sparse) C arrays.

-- If you implement a sparse array yourself, and you want to use the full index 
range, then you likely wouldn't use NSNotFound as a marker at all. If you need 
a marker, you'd likely use 0 or NSUIntegerMax, right?

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to