Boost logo

Boost Users :

From: Thorsten Ottosen (nesotto_at_[hidden])
Date: 2005-10-25 10:04:15


Oleg Smolsky <oleg.smolsky <at> pacific-simulators.co.nz> writes:

>
> Hi all,
>
> I've just started looking at ptr_vector<> and got stuck on the
> following issue:

> std::map<std::string, boost::ptr_vector<Simple> > map;
> map["key"].push_back(new Simple);

The problem is that no pointer container is copyable.

Do

std::map<std::string, boost::shared_ptr< boost::ptr_vector<Simple> > > map;

or

boost::ptr_map<std::string, boost::ptr_vector<Simple> > map;

HTH

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