Boost logo

Boost Users :

From: Felipe Magno de Almeida (felipe.m.almeida_at_[hidden])
Date: 2005-07-12 07:33:21


On 7/12/05, Bjorn.Karlsson_at_[hidden] <Bjorn.Karlsson_at_[hidden]> wrote:
> > From: Felipe Magno de Almeida [mailto:felipe.m.almeida_at_[hidden]]
>
> 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."

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