----- Original Message -----
From: "Bohdan"
"Matthias Kronenberger"
wrote in message news:000501c238ec$cdd152c0$5ab2f683@koe5isewcagsnh... Hm, what's the point in having such collections? The pointers in a container would refer to data that is stored
somewhere.
ok. What if your class hasn't copy constructor or you don't want to copy your object ... have you other choice ?
Well, the objects need to be stored somewhere. If we don't want to deal with reallocation, we need a container whose iterators are stable under insert, for example a list or a set. You are now able to use the iterator to that container to access the objects. std::vector <someIterator> v; v[123]->functionCall(); or v.front()-> dataMember; or (*v.begin())-> dataMember; Would that help?