
On 7/12/05, Bjorn.Karlsson@readsoft.com <Bjorn.Karlsson@readsoft.com> wrote:
From: Felipe Magno de Almeida [mailto:felipe.m.almeida@gmail.com]
Boost.Smart_ptr (http://www.boost.org/libs/smart_ptr/smart_ptr.htm) can help: use boost::shared_ptr, which is a reference-counted smart pointer.
typedef boost::variant<object1,object2> variant_type;
std::vector<boost::shared_ptr<variant_type> > vec; boost::shared_ptr<variant_type> v(new variant_type(object1())); vec.push_back(v); // No copying of the variant
Is that what I needed was owning semantics... Like ptr_container for STL containers. But I think that isnt anything like that yet in boost... I will go with shared_ptr for now then. Or maybe intrusive_ptr.
Bjorn Karlsson
Thanks. Felipe. -- Felipe Magno de Almeida Developer from synergy and Computer Science student from State University of Campinas(UNICAMP). Unicamp: http://www.ic.unicamp.br Synergy: http://www.synergy.com.br "There is no dark side of the moon really. Matter of fact it's all dark."