From: Beman Dawes (bdawes_at_[hidden])
Date: 2003-02-03 16:25:20
At 02:32 PM 2/3/2003, Howard Hinnant wrote:
>On Monday, February 3, 2003, at 12:50 PM, Beman Dawes wrote:
>> To me, a major benefit of a policy based design is to be able to
>> accommodate a wide range of features, including those which find only
>> limited use.
>> If a policy based smart pointer can't accommodate a wide range of
>> features, I start to wonder if the design itself is inflexible and
>> flawed. That's why I worry a lot about whether a given PBSP design can
>> handle apparently marginal uses.
>That is a strong argument. On the other hand, should a policy be
>provided for a configuration that is overly error prone or dangerous?
>I think the answer may be yes, but only if there is sufficient
>motivation (like a big performance increase). Otherwise, no. Why
>needlessly expose your clients to a dangerous interface?
There may be two separate issues:
* Should a PBSP supply policies that are prone to be used unsafely?
I'd say "no" is an acceptable answer, at least for something like the T*
conversion in widely used libraries like the Standard Library and Boost.
* Should a PBSP allow user supplied policies to modify interface, perhaps
in ways that may be unsafe or even just unfortunate?
That's tougher. At some point I lose interest in a PBSP if it prevents me
from doing the things I want to do, even if I only want to do them in the
privacy of my own code.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk