Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2002-11-17 17:53:22


From: "David Abrahams" <dave_at_[hidden]>

> I could use something like a std::map< weak_ptr<>, PyObject* >, ...

Yes, that's the "canonical" solution if you need to associate arbitrary data
with objects managed by shared_ptrs.

> ... but that would be truly awful:
>
> 1. I would need to sweep the map of dead entries periodically
> 2. It would incur a great deal of overhead
> 3. It would be very complicated.

I agree with (1), but (2) & (3) don't look obvious to me.

Please think about this solution for a while to see whether it stays "truly
awful". :-)


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