$include_dir="/home/hyper-archives/boost/include"; include("$include_dir/msg-header.inc") ?>
From: Peter Dimov (pdimov_at_[hidden])
Date: 2002-04-19 10:43:24
From: <DKl_at_[hidden]>
> My point is that there should be one smart pointer type to be used for
> passing "pointers" to 'T' around: This type appears in interfaces.
There is. It's called shared_ptr.
This is not the end of story, however. For example, a factory that creates
an object on the heap and transfers ownership to the user should return an
auto_ptr, not a shared_ptr. Similarly, a function that returns a pointer to
an object derived from counted_base should return an intrusive_ptr, not
shared_ptr. This is not an interoperability problem since both can be
converted to a shared_ptr; it's "as if" a shared_ptr is being returned.