Boost logo

Boost :

From: Gennadiy Rozental (gennadiy.rozental_at_[hidden])
Date: 2005-04-26 11:30:57


"Peter Dimov" <pdimov_at_[hidden]> wrote in message
news:03d401c54a75$d3a71a20$6401a8c0_at_pdimov2...
> Gennadiy Rozental wrote:
>>> By PBSP, do you mean policy-based smart pointers in general, or a
>>> Loki-derived smart pointer in particular?
>>
>> You may say in general or Loki-derived - depend on point of view. I
>> have many objections to Loki solution (and some of it's derivatives).
>> But what I have in mind is similar. Do you have any other alternative
>> model?
>
> If you ask me for my personal opinion: I have little use for the
> Conversion and the Checking policies. However I do need an easier way of
> specifying a

Checking policy could be very convenient for implementing Debug only extra
checking. Similar to STLPort debug mode. Conversion is just a matter of
satisfying
legacy interfaces.

> deleter (ala Howard's unique_ptr) and a ConstPropagation policy (with the
> default being No for shallow copy and Yes for deep copy).
>
> In addition, I'm not happy with the integration of
> shared/weak/intrusive_ptr in the current model. To be really flexible, a
> policy-based incarnation of a reference counted pointer needs to leave its
> aspects configurable, covering the whole spectrum from a simple
> counted_ptr to full-featured shared_ptr (with or without weak_ptr support
> in both cases) and possibly covering the unsafe/basic/strong thread safety
> axis as well. This might imply a policy controlling whether conversions
> from smart_ptr<T> to smart_ptr<U> are allowed (because disallowing these
> allows alternative implementations or omitting one pointer from the
> control block.)
>
> My needs may not be typical, of course.

I hope David is listening to this and can comment. I am a bit out of date
with details of PBSP design/implementation to comment on that.

Gennadiy


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