Boost logo

Boost :

From: Andrei Alexandrescu (andrewalex_at_[hidden])
Date: 2002-04-19 16:42:19


<DKl_at_[hidden]> wrote in message
news:904AA220ACB4D211A10600104B3E85C92A82CF_at_MAIL...
> > I believe the two will coexist at least until template typedefs make it
> > into the mainstream, at least on backward compatibility grounds.
>
> My point is that they not only will coexist but that they actually *have*
> to coexists: one without the other makes no sense! For interfaces
> having only a policy-based smart pointer is evil.

Well, if "X is evil" is used as an argument against X, well, how can I
refute it :o).

SmartPtr is a template typedef shy away from shared_ptr. Why would one make
no sense without the other?

> For individual types
> having only one choice (ie. the current 'boost::shared_ptr') is also
> evil (however, since everybody seemed to be keen on replacing the latter
> with the form I didn't state that 'boost::shared_ptr<T>' is evil: that
> would have been oil on the flames...). They are both only viable
> together!

We certainly live in an evil world :o).

> Maybe my subject was too harsh: I'm *NOT* objecting to having and using
> policy-based smart pointer. What I'm objecting to is having *only* these!

First, that's a long cry from the title and the tone of your initial
message. Second, I didn't say we only have these. Of course, when template
typedefs will be out, I'll come with my little list. In my own projects I
prefer less duplicated code so I use the inner class trick to get around it,
but I understand that might not be palatable to all.

Andrei


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