Boost logo

Boost Users :

From: Brian Neal (xarxas_at_[hidden])
Date: 2005-02-01 19:18:14


Well to answer my own question, I think, it can be
used when you already have something that is reference
counted and you want to manage it yourself. Also in
places where new and delete aren't the correct
actions. Or when you need something with less resource
requirements than shared_ptr. For example, when
multi-threading is turned on, shared_ptr asks for a
mutex. Intrusive_ptr leaves that up to you.

Am I getting close here?

I didn't think about using it when you have a function
that takes a shared_ptr but you need to pass in this.

I dunno, I tend to use shared_ptr sparingly. If I
don't need a shared_ptr, I don't ask for one on the
interface to a function. That way the user can pass in
a naked pointer or a shared_ptr::get(). I make sure to
document what the function does (and does not do) with
the input pointer though.

Thanks.

                
__________________________________
Do you Yahoo!?
Yahoo! Mail - Find what you need with new enhanced search.
http://info.mail.yahoo.com/mail_250


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