________________________________________ From: boost-users-bounces@lists.boost.org [mailto:boost-users-bounces@lists.boost.org] On Behalf Of Robert Dailey Sent: Friday, February 06, 2009 8:57 AM To: boost-users@lists.boost.org Subject: Re: [Boost-users] [ptr_container] ptr_map and cloning issues
First, this compiles without any problems for me:
class Texture; typedef boost::ptr_mapstd::string,Texture MapType;
void foo( const MapType& m ) { //MapType map; MapType::const_iterator i = m.find( "foo" ); //i = map.find( "foo" ); }
At first you said "...this compiles without any problems for me" and then you said "...the uncommented does not compile...". So which is it?
It's the commented-out code that will not compile. When the instance of MapType goes out of scope, the type of the contained pointers cannot be unknown, because they have to be deleted. John