Subject: Re: [boost] storing intrusive_ptr in atomic?!
From: Peter Dimov (lists_at_[hidden])
Date: 2013-10-25 08:55:59
Oliver Kowalke wrote:
> yes, I could use atomic<T*> but the other code tracks T* in intrusive_ptr<
> T > and it looks a little bit awkward if I release a raw-ponter from a
> smart-pointer in order to store it in a container.
You're already doing manual addref/release on the pointer in the container,
so it's logically treated as a raw pointer. Even if you could store an
intrusive_ptr there, its additional addref/release would be wasted.
The rest of the code never sees the raw pointer; the functions that store
and retrieve from the container take/return intrusive_ptr.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk