Boost logo

Boost :

From: Beman Dawes (bdawes_at_[hidden])
Date: 2004-01-21 14:53:16


At 10:05 PM 1/20/2004, Howard Hinnant wrote:

>That is, smart pointers to arrays of objects should not respect
>dervied-to-base conversions because the language does not do so for raw
>pointers.
>
>Therefore an interface should not imply that you can handle arrays of
>objects by simply customizing the deletion policy. Smart pointers to
>arrays of objects require a different interface, including:
>
>* no dervied-to-base conversions
>* no operator*()
>* no operator->()
>* operator[](size_t)

Yeah, that's been my point about some of the policy-based SP designs;
polices have to be able to change both behavior and interface. If the
interface is fixed, some otherwise useful policies can't be expressed
properly.

>...
>
>move_ptr<T>
>move_ptr<T[]>
>
>...
>
>I guess the basic point I'm trying to make (and none to elegantly) ...

You convinced me! The docs would have to be careful to get the word out
that T[] is required for arrays.

--Beman


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