Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2002-07-17 09:14:08

From: "Ed Brey" <brey_at_[hidden]>
> Currently intrusive_ptr<T const> is not supported, ultimately because
counted_base::use_count_ is not mutable. To me it seems like the count of
references to an object are unrelated to its logical constness. What do
others think?

Nontrivial question. I don't have enough experience with it yet in order to

In the general case, intrusive_ptr<> doesn't really know whether the count
is part of the object state. It all depends on how intrusive_ptr_add_ref
(release) is defined for the specific type; if it takes const pointers,
intrusive_ptr<T const> should work fine.

In the specific case of objects derived from counted_base, either choice
seems plausible, since there's the option of using shared_ptr<T const> to
denote const objects.

Boost list run by bdawes at, gregod at, cpdaniel at, john at