From: Jonathan Turkanis (technews_at_[hidden])
Date: 2004-01-21 10:32:08


"Daniel Wallin" <dalwan01_at_[hidden]> wrote in message
news:400E9464.1040608_at_student.umu.se...
> Jonathan Turkanis wrote:

>
> Also, in general, it is far easier to start with less and add more
later
> than to throw everything in from the start and remove later.
>

I don't think so. I've already written the policy based version, with
two policies -- no_storage and auto_storage; I'm just working on one
or two more. It should be quite simple to get rid of it later.

> If adding a template parameter is absolutely essential, we'll end up
> with a half-baked smart_ptr<> and we could just as well spell
> move_ptr<>:
>
> smart_ptr<T, move_semantics, array_storage>
> smart_ptr<T, move_semantics, scalar_storage>
>

I liked Howard's ideas about handling smart pointers to arrays, and
think it should be straigforward to implement. (I haven't done it yet
because I don't want to obscure the issue of deletion policy.) I don't
think adding treament for arrays will require an additional template
parameter, so we shouldn't end up with a long list of policies.

Furthermore, the deletion storage policy doesn't have to be a template
parameter: I could illustrate the various possibilities with several
separate move_ptr templates; the policy parameter just happens to be
the simplest and most elegant solution, for the moment.

Regards,
Jonathan