|
Boost : |
From: Andrei Alexandrescu (andrewalex_at_[hidden])
Date: 2002-04-19 14:19:32
<DKl_at_[hidden]> wrote in message
news:904AA220ACB4D211A10600104B3E85C92A82CD_at_MAIL...
> I can agree with this although only with the following restriction:
> It has to be complemented by a smart pointer template with just one
> template parameter, namely the type: This would be the type used in
> interfaces. It should be configurable to use different policies for
> different type but there is only one set of policies for a specific
> type.
But that's not "complementing". It is a template typedef. One certainly
doesn't want to write the same code multiple times.
> Merely advising people to add appropriate typedefs is not sufficient
> because there would have to be general agreement on the names of the
> typedefs and their configuration.
That is not "advice", it is project-wide policy and is established by the
architect(s).
> Of course, this issue is quite orthogonal to policy-based smart
> pointers but my impression of the recent discussion on smart pointers
> was that the intended change is replacing 'boost::shared_ptr' by a
> policy-based smart pointer.
I believe the two will coexist at least until template typedefs make it into
the mainstream, at least on backward compatibility grounds.
> This alone, without the addition of a
> specific name to be used in interfaces is what is actually evil about
> policy-based smart pointers (I haven't said so explicitly in my initial
> message but I thought I was quite clear about this).
By the way, sometimes it is better to use a non-template type in interfaces.
Andrei
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk