|
Boost : |
From: Beman Dawes (bdawes_at_[hidden])
Date: 2003-02-04 10:19:40
At 03:35 AM 2/4/2003, Andrei Alexandrescu wrote:
>"Beman Dawes" <bdawes_at_[hidden]> wrote in message
>news:4.3.2.7.2.20030203161312.023801a0_at_mailhost.esva.net...
>> * 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.
>
>The original SmartPtr design leaves the onus of choosing the right policy
>combination to the application designer. To me, that's a design I find
>reasonable and in keep with the spirit of C++. Safer designs are possible
>that reject policy combinations that "don't go together" at the price of
>being more complicated or less efficient or less flexible.
Yes, understood.
One of the advantages of a generative approach is the improved ability to
reject invalid policy combinations.
In the generative experiments I tried a couple of years ago, there wasn't a
problem with added complexity or less efficiency, but the result was
definitely less flexible.
A GenVoca or curiously recurring template pattern hierarchy might be able
to solve all those problems, but they were at the boundary of my skill
level, so I never tried them.
--Beman
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk