Boost logo

Boost :

From: Ion Gaztañaga (igaztanaga_at_[hidden])
Date: 2005-11-22 01:03:55


>>1. Overloads of static_pointer_cast, dynamic_pointer_cast,
>>const_pointer_cast overloads for raw pointers, so that we can use
>>pointer_xxx_cast in a generic way.
>
>
> Makes sense. :-) boost/utility/pointer_cast.hpp, probably.

Nice!

>>2. Add reinterpret_pointer_cast to complete cast family.
>
>
> Out of curiosity, why do you want it?

Well, currently I'm removing reinterpret_casts to convert void pointers
with static_casts, but if there is some place where a reinterpret_cast
has sense with raw pointers, I would add it to have complete family. But
we can live with static_pointer_cast.

>>We should define how this protocol is implemented in boost smart
>>pointers (for example, using overloading or a STL-like rebind mechanism)
>>so that every boost smart pointer developer knows how to make its
>>pointer type protocol-aware.
>
>
> template<class T, class U, template<class> class Sp>
> class pointer_to_other< Sp<T>, U >
> {
> typedef Sp<U> type;
> };
>
> works with auto_ptr and all boost smart pointers. Other smart pointers may
> want to specialize pointer_to_other.

No problem at all. What about other overloads for 2 and 3 template
parameter smart pointers, so that almost all smart pointers would be
covered. Of course, we need another version for raw pointers. What about
boost/utility/pointer_to_other.hpp?

Regards,

Ion


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