Boost logo

Boost :

From: Ion Gaztañaga (igaztanaga_at_[hidden])
Date: 2006-03-12 04:54:35


> Btw, I neglected to include Ion's suggestion:
>
>> If we can define the pointer type via deleter::pointer or similar
>> (with default T*) that would be even better.
>>
>
> which I think is a good one. Update on the way...

Can we add that also for unique_ptr Reference Implementation?

http://home.twcny.rr.com/hinnant/cpp_extensions/unique_ptr.html

Other smart pointers can benefit from a templatized pointer type also,
like intrusive_ptr:

template<class T, class VoidPointer = void *>
class intrusive_ptr;

See:

http://ice.prohosting.com/newfunk/boost/libs/shmem/doc/html/shmem/shmem_smart_ptr.html#shmem.intrusive_ptr

With Boost 1.34 boost::pointer_to_other<> and generalized get_pointer()
utilities intrusive pointer could support different pointer types.

I'm also seeing if a shared memory/memory mapped file shared_ptr<> is
possible using templatized pointers, but the lack of polymorphic
operations in shared memory would require an additional deleter template
parameter and an additional allocator template parameter to allocate the
reference count. Too much?

With so many smart pointers, I'm certainly confused. What's the
difference between unique_ptr:

http://home.twcny.rr.com/hinnant/cpp_extensions/unique_ptr.html

and move_ptr:

http://std.dkuug.dk/jtc1/sc22/wg21/docs/papers/2002/n1377.htm#move_ptr%20Example

Do we need scoped_ptr in future C++ standard if unique_ptr has all
needed operations? Or it's too dangerous for a scoped resource pattern
because of the release() operation?

Ion


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