How are std::list::iterators maintained/made?

I'm trying to understand how iterators work.

They are able to maintain list position even if the nodes beside it are removed. So I think it is more than a class with a prev/next nodes within the list.

Can anyone simply explain the contents of an iterator?

Also, if there is something better than std::list, I'd like to know about that too.

They are able to maintain list position even if the nodes beside it are removed.
- std::list leaves all the iterators pointing to the same locations after removing some of the list elements as it won't move anything else -


Here is a sample list iterator definition: http://www.cs.huji.ac.il/~etsman/Docs/gcc-3.4-base/libstdc++/html_user/stl__list_8h-source.html#l00111
Do professionals usually code like that? My eyes are bleeding. :[

Ok I think I understand, thanks for the implementation page. Looking through I realize I am better off writing my own implementation of stl::list.

Thanks.
Looking through I realize I am better off writing my own implementation of stl::list.


really ??
Yea STL is weak in too many areas to make it worth using in a project - I started using it only because I was tight on time and had to push features to reach my milestones. I ended up being a few months early and decided I'm going to go through all my code and remove all stl from my project with some types I've written.

STL is so poor in certain areas that I am willing to go through 300 files (about 3mb in size of code) and remove all traces of it. It sucks that hard.
All I can say is, enjoy your bugs.
Wow, I had no problems with using the STL for at least 2 years in all my projects.
InLight: in what respect does the STL "suck"?

Topic archived. No new replies allowed.