I'm playing around with the STL library and trying to create a vector container of classes:
Code: Select all
class MyClass
{
....
};
class MyClassVector: public vector<MyClass>
{
};
Now, as I understand it, an iterator acts as a pointer to data within container classes but they are only correct up to the point you start adding or removing data.. this isn't good for me since i want to create a pointer to data and delete stuff from the list as well
So how can I get a pointer to the data in the container that will still work after I add/delete items from the container? Or will i just have to create a vector of pointers instead?
- Nick