New shared pointer
Stefan Teleman
steleman at nyc.rr.com
Sat Sep 10 00:24:34 BST 2005
On Friday 09 September 2005 20:44, Frerich Raabe wrote:
> I have all my books in boxes already (I'll move to Hamburg soon) so I
> cannot check myself: isn't the sourcecode which you can see on the very
> last pages of MEC++ actually an auto_ptr implementation? If not, is it
> really giving you explicitely shared semantics? An implicitely shared
> pointer (like
> QSharedDataPointer) is nice, but quite a hassle because it's perfectly
> possible that a lot of code which uses KSharedPtr actually depends on not
> detaching automatically.
it's not a std::auto_ptr<T> implementation (Meyers gives one of those as
well), it's actually a real shared/smart pointer with reference counting. i
remember his implementation is based on two templates -- the inner one is a
RefCountObject<T> and the outer one is the actual SmartPtr<T>. and he also
gives the implementation for the type conversion template methods for the
const correctness problem.
hang on, i think i have a CD copy of the book somewhere and i can just copy
and paste it to you. i need to do an excavation and find the CD. stay
tuned. :-)
--Stefa
--
Stefan Teleman 'Nobody Expects the Spanish Inquisition'
steleman at nyc.rr.com -Monty Python
More information about the kde-core-devel
mailing list