Re: Where is NSList?
Re: Where is NSList?
- Subject: Re: Where is NSList?
- From: Tim Conkling <email@hidden>
- Date: Tue, 27 Jul 2004 19:07:32 -0400
std::map, std::multimap, and std::set also offer this capability.
std::deque, std::vector, and a few others don't, that's correct. I'm
looking for an NS object with the same sort of functionality as
std::list (or even std::map). From the responses my original post has
generated, I am going to assume that such an object does not exist, and
move on.
Thanks,
Tim
On Jul 27, 2004, at 6:25 PM, Allan Odgaard wrote:
On 28. Jul 2004, at 0:07, Tim Conkling wrote:
The reason NSArray/NSMutableArray doesn't work for my purposes is
because there is no way for an object in an NSArray to know where its
position in that NSArray is (unless I'm missing something), and for
that information to remain accurate after the array is modified. This
is a feature that is provided by, for example, the STL with its list
and map templates, through the use of iterator objects.
Only std::list offers this, the rest of the STL doesn't.
However, with Cocoa you always store pointers to objects in contrast
to STL, where you often store the objects inline. This means that the
storage for the actual data can change when the vector is resized,
which is not the case with Cocoa, so here you can just use the object
pointer.
So I see no need for the iterator indirection you are requesting?!?
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.