Boost logo

Boost :

From: Thorsten Ottosen (nesotto_at_[hidden])
Date: 2005-03-17 13:11:27


Hi Felipe,

"Felipe Magno de Almeida" <felipe.almeida_at_[hidden]> wrote in message
news:4239C1B1.3050507_at_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


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk