1 Aug 2002 01:48
Re: collection container
Matthias Kronenberger <mkronen <at> rhrk.uni-kl.de>
2002-07-31 23:48:43 GMT
2002-07-31 23:48:43 GMT
Hm, what's the point in having such collections? The pointers in a container would refer to data that is stored somewhere. Since we want to minimize side effects, the only valid use of a pointer container would be to store a set of polymorphic objects. Even now, the ownership question is raised. So, one should use a smart pointer. To adapt the pointers for the standard algorithm of the STL, one could use a projection iterator adapter. ----- Original Message ----- From: "Bohdan" <yg-boost-users <at> m.gmane.org> Newsgroups: gmane.comp.lib.boost.user Sent: Thursday, August 01, 2002 12:49 AM Subject: collection container > Has boost any plans on creating container, that holds data by pointer, not > by > value? > > Rationale: > It is impossible to use normally vector<...> for types that do not have > copy constructor. Interface of vector< shared_ptr<...> > doesn't seems to be > very convenient( for example with std::algorithms ). > And most of all it is not good idea to show vector< shared_ptr<...> > > interface to > user of my lib, that wants to have container::iterator with normal behavior.(Continue reading)
Thanks,
Erik
Info: <
RSS Feed