Boost logo

Boost :

From: Beman Dawes (beman_at_[hidden])
Date: 2000-07-13 14:28:09


Kevlin Henney wrote:

> ...
>> >>ownership ( tightly-held // scoped_ptr
>> >> | transferable // auto_ptr
>> >> | shared // shared_ptr, linked_ptr, etc.
>> >> | weak // ??? weak_ptr
>> >> | copyable // copy_ptr
>> >
>> >Also: 'unowned'.
>>
>>Hum... Is it still a smart pointer? Could you explain a bit?
>
>Yup. Going back to square one (or should that be zero as it's C++?)
>smart pointers are proxy objects that add management and access control
>to a level of indirection, idiomatically appearing to support parts of
>the built-in pointer protocol. A common application (and misconception)
>is SPs for memory management. This is only one role that they can play:
>checking, locking, loading, navigation, etc are others. Hence, most
>iterators in the standard library are examples of smart pointers even
>though they have no strong ownership semantics.

Ah! The light dawns. In Tokyo Robert Klarer was talking about trying to
come up with a grand unification theory of pointers and iterators. Sounds
like you just did! Now the trick is to try to fit them into the feature
diagram. Have to think about that...

> ...
>
>>Is this a viable approach and in keeping with C&E?
>
>Don't know yet! But it sounds good.

Please do read the book; my guess is that several of us exploring the
possibilities together will go a lot farther that solo flight.

--Beman


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk