Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Rolo Puentes

STL Performance

This topic is 5927 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

i need to traverse through a linked list, i''ve two choices, one using my own linked list implementation and another using the STL std::list. since iterating thru a linked list is so simple (just a mylist = mylist->next to go to the next element) do I have any processing overhead by using STL iterators? i''ve been trying to do some performance tests but the output was practically the same, does anybody know anything specific to this case? thanks

Share this post


Link to post
Share on other sites
Advertisement
STL iterators tend to have fairly simple behavior. And there''s not much you can do while iterating a linked list (other than iterate it), since STL does not perform bounds checking. Go ahead and use STL.



Don''t listen to me. I''ve had too much coffee.

Share this post


Link to post
Share on other sites
The good thing about using STL iterators with their list class is that you can still use the increment and decrement operators as if it were contiguous memory being iterated. And to access the object, you can simply defer the iterator! I guess you can say it''s almost like a pointer, that silly iterator.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!