Boost logo

Boost :

From: Andrei Alexandrescu (andrewalex_at_[hidden])
Date: 2002-01-26 13:17:16


> > In what way does introducing policies and abstraction simplify and
clarify
> > the boost::scoped_ptr. The task of this class is incredibly simply, is
a
>
> Hard to argue with that.

1. You do need to have powerful smart pointers library so that people don't
reinvent them all the time.

2. They do things that are hard and use techniques that took the C++
community a long time to develop.

3. They are easily customizable by average programmers following a simple
specification.

4. Among tons of other things, they do what scoped_ptr does.

Question: given that you do need a truly smart smart pointer, which can also
do what scoped_ptr does, do you still need scoped_ptr as an old palimpsest
in the library? If yes, why? Or would a one-liner typedef do?

> I would agree. But policies are cool. You really are taking the romance
out
> of this ;-)
>
> From what I have seen, I think the methods of and usefulness of template
> policy programming are still being investigated by some of the smart
people
> on this list.

I guess a good argument in favor of both policies and the fact that
designing smart pointers is hard, is that the smart pointer implementation
that you posted has a number of bugs, which I will address in a separate
post. Bugs are not about romance, they are as prosaic as it gets.

Since the discussion started, I saw two Loki-like smart pointer
implementations posted. Seems like a Loki-like implementation would be
acceptable as long as it's not Loki itself. Given my recent posting history,
I guess I don't have enough feathers to fuss about that :o).

Andrei


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