25 Oct
2013
25 Oct
'13
12:55 p.m.
Oliver Kowalke wrote:
yes, I could use atomic
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.