
"Felipe Magno de Almeida" <felipe.almeida@ic.unicamp.br> wrote in message news:423A06C2.6020404@ic.unicamp.br... | sorry, it's just wrong. | | Felipe Magno de Almeida wrote: | > Ive modified the ptr_map_adapter in the operator[] | > to be: | > const_reference operator[]( const key_type& key ) const | > { | > //return lookup( key ); | > iterator i = find( key ); | > if( i != end() ) | > return *i; | > else { | > i = const_cast<ptr_map_adapter_base*>(this) | > ->insert(begin(), key, | > CloneAllocator::allocate_clone(value_type())); | > return *i; | > } | > } Try iterator i = this->find( key ) if( i != this->end() ) return *i; else { auto_type ptr( new value_type ); this->c_private()[ key ] = ptr.get(); // strong return *ptr.release(); // nothrow } -Thorsten