Boost logo

Boost Users :

Subject: Re: [Boost-users] [boost-users] [ptr_container] Genericity on containers
From: Thorsten Ottosen (nesotto_at_[hidden])
Date: 2010-11-23 16:03:43


Den 23-11-2010 11:54, Eloi Du Bois skrev:
> Hi,
>
> I would like to know why is'nt that working:
>
> boost::ptr_vector<B> p1;
> boost::ptr_vector<B> p2;
> std::vector<B> v1;
>
> boost::ptr_vector<A, boost::view_clone_allocator> pview;
>
> // add elements...
>
> p1 = p2;
> pview = p1;
> // p1 = v1; // don't work
> // pview = v1; // don't work
>
> It should be working, or would be interesting to get working.

Could you try

p1.assign(v1.begin(),v1.end())
pview.assign(v1.begin(),v1.end())

?

-Thorsten


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