Re: NSNotFound signed???
Re: NSNotFound signed???
- Subject: Re: NSNotFound signed???
- From: Quincey Morris <email@hidden>
- Date: Wed, 12 Jun 2013 09:57:35 -0700
On Jun 12, 2013, at 01:14 , Oleg Krupnov <email@hidden> 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 (email@hidden)
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:
This email sent to email@hidden