19 Dec
2006
19 Dec
'06
10:46 a.m.
Duane Murphy wrote:
I'm trying to use boost::ptr_map<> and cannot get calls insert to compile.
I'm on Mac OS X using gcc 3.3 with Xcode.
Even the most basic code fails to compile:
boost::ptr_map< in, int* > my_map; int * val = new int( 22 ); my_map.insert( 1, val );
See http://www.boost.org/libs/ptr_container/doc/ptr_map_adapter.html
The first argument needs to be a reference:
int key = 1;
my_map.insert( key, new int(22) );
1.34 adds the followinf overload:
template< class U >
std::pair