Fenglou Mao wrote:
> On Mon, 25 Jan 1999, Burak Serdar wrote:
>
> > I think I was unclear. This was what I said. You cannot keep references to the
> > elements of a vector if you are inserting elements. What I said was, instead of
> > storing objects in the vector, you can store references to objects, and instead of
> > storing a reference to an element of the vector, you can store a reference to the
> > actual object, i.e.
> >
> > vector<someclass&> v;
> >
> > and instead of storing vector<someclass&>::iterator reference to an element of the
> > vector, use a someclass& reference to the actual object. After an insert
> > operation, vector<someclass&>::iterator will be definitely destroyed.
>
> vector is a type of container, it is used to contain my objects, if I
> only use vector to store "reference to object", why do I use a 'vector'?
>
maybe to keep pointers to objects you put into a vector...
maybe to implement a polymorphic vector...
maybe you don't want your objects to be destroyed when the container is destroyed...
or just for fun...
> Sincerely Yours,
>
> FengLou Mao
> *******************************
> ADD:Mr. FengLou Mao
> Peking University
> BeiJing
> P.R.China
> Tel:86-10-62751490
> Fax:86-10-62751725