Boost logo

Boost Users :

From: Felipe Magno de Almeida (felipe.m.almeida_at_[hidden])
Date: 2007-05-25 21:03:01


On 5/25/07, Seweryn Habdank-Wojewódzki <shw_at_[hidden]> wrote:
> # sobota 26 maja 2007 02:14, @ Felipe Magno de Almeida:
> > Use ptr_vector<ptr_vector<T> >
>
> Thanks
>
> Btw why there is no way to work with it like that:
>
> ptr_vector<Foo> g;
> g.push_back ( new Foo(1,k) );
>
> ptr_vector<ptr_vector<Foo> > d;
> d.push_back ( new ptr_vector<Foo> ( g ) );

Because ptr_vector is not copy-constructable. That is the same reason
why you can't use it inside a STL container.

> I should do like that:
>
> ptr_vector<Foo> g;
> g.push_back ( new Foo(1,k) );
>
> ptr_vector<ptr_vector<Foo> > d;
> d.push_back ( new_clone ( g ) );
>
> Regards.
>
> --
>
> |\/\/| Seweryn Habdank-Wojewódzki
> \/\/

Regards,

-- 
Felipe Magno de Almeida

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