> but the decision has *nothing* to do with non-virtual
> member functions or other such oft-touted C++ speed improvements

But actually, it does. The fact is that std::lower_bound is a template that
specializes on the types of the iterators, so what you get is different code
generated depending on the iterator types, and in the case where the
iterators are simple pointers, a whole lot of "functions" that wind up
incurring no function calls at all, but reducing to simple pointer
increments and comparisons, inline--all made possible by static typing
information and C++'s ability to exploit that info. (And even in the cases
where the iterators are more complex, such as maps or sets, the functions
are probably only a line or two and also wind up inlined.)

Exactly the kind of thing I was talking about much earlier in the thread.
There's nothing wrong with NSArray, NSSet & NSDictionary--but the library of
data structures & algorithms in C++ is far more extensive.

-- 
Scott Ribe
scott_r...@killerbytes.com
http://www.killerbytes.com/
(303) 722-0567 voice


_______________________________________________

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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

Reply via email to