Boost logo

Boost Users :

From: Constantin Bryzgalin (constb_at_[hidden])
Date: 2007-05-26 07:58:51


Hello,

> Can anyone tell me why std::vector < boost::ptr_vector < T > > can not be
> reserved and resized I can not push_back anything inside vector, due to
> compile errors?

well, creating a copy of ptr_vector raises question of pointer ownership. which one of copies will be responsible for releasing it? if object is to be deleted when it has no referring pointers it looks pretty much like boost::shared_ptr approach. thus if we come to idea of using shared_ptr there seems to be no more reason to use ptr_vector, what you want is std::vector< std::vector< boost::shared_ptr<T> > > instead.

-- 
Constantin Bryzgalin
http://www.oneclicktools.com

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