Boost logo

Boost Users :

Subject: Re: [Boost-users] seeking comments on 'weak_key_map' experiments
From: Nicolas Lelong (rotoglup_at_[hidden])
Date: 2008-12-12 12:53:07


>
> Does the weak_ptr need to be removed from the map "instantly" when it
> expires?
> Could you just clean up the expired weak_ptrs at some later point? For
> example, when an iterator is incremented it might remove all the weak_ptrs
> it
> encounters while it is trying to find the next live weak_ptr in the map.
>

In my current usage scenario and implementation, I rely on values being
removed 'instantly'.

The thing is that I never iterate these maps, I only query values associated
to keys ; so in this case, a cleanup could be triggered, but it would
increase the 'query' time cost - I tend to see this weak_key_map as a
lightweight construction if possible...

I also find that the 'instantly' matches well the shared_ptr philosophy, but
that's not very objective.



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net