Ja*********@t-online.de wrote:
Hi there,
i've got a STL list like this:
list<object *> myList;
Now, i want to create a vector with iterators of this list like this:
vector< list<object *>::iterator > myVector
Where's the fault?
thanks for reply,
Jan
I recommend not using raw pointers in your container, and instead use
smart pointers like boost::shared_ptr or smart_ptr
http://code.axter.com/smart_ptr.h
Other pointers:
http://code.axter.com/cow_ptr.h http://code.axter.com/copy_ptr.h
Are you sure you need the list container in the first place. It's
rarely optimal to use std::list over std::vector/std::deque.
If you're not doing a lot of insertions and deletions in the center of
the container, you should consider just using std::vector in the first
place.
I recommend you do some performance test to see if you really need the
std::list in the first place.