Boost logo

Boost Users :

From: Matthias Kronenberger (mkronen_at_[hidden])
Date: 2002-08-01 04:44:44


----- Original Message -----
From: "Bohdan" <yg-boost-users_at_[hidden]>
Newsgroups: gmane.comp.lib.boost.user
Sent: Thursday, August 01, 2002 11:12 AM
Subject: Re: collection container

>
> "Matthias Kronenberger" <mkronen_at_[hidden]> wrote in message
> news:000501c238ec$cdd152c0$5ab2f683_at_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?


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net