
17 Mar
2005
17 Mar
'05
6:11 p.m.
Hi Felipe, "Felipe Magno de Almeida" <felipe.almeida@ic.unicamp.br> wrote in message news:4239C1B1.3050507@ic.unicamp.br... | Hi. | | I dont see why ptr_map throws in operator[], I think it should have the | same behavior of std::map and return a default constructed object in | case it doesnt find the key. | Anyway, it is just a opinion Hm..yeah...I guess you can use map.at( "foo" ); if you want the exception to be thrown. I think you're right it should call insert a heap-allocated object. I will change this for the post-review. In the meantime, you can make a new function in ptr_map_adapter using lookup() as a template to get the behavior you need. . | Im using ptr_map in production code and I'm glad to hear that. -Thorsten