Boost logo

Boost :

From: Beman Dawes (beman_at_[hidden])
Date: 2000-03-23 09:36:12


At 11:41 PM 3/22/00 -0500, Kevin Atkinson wrote:

>What is the consensus of my CopyPtr and ClonePtr idea?

They are neat. They supply several interesting and useful features.
Deep/clone copy semantics complements other smart pointers which
supply shallow copy or no copy semantics.

The two header approach, with resulting relaxed requirement on T
allowing use with incomplete types, looks like it may be more widely
useful.

>There was some decision about deep verses shallow pointers but it
much
>about the generic part of my code.
>
>Do you think my CopyPtr, ClonePtr, and GenericCoptPtr (perhaps under
a
>different name although I think copy is far clearly than deep)?

The questions in my mind are not so much about CopyPtr, et al,
linked_ptr, or any other specific smart pointer, but rather how
should they be related? Chaos will result if they have to be
presented to the world as totally independent of one another. At the
minimum, they need to at least share a set of common requirements,
IMO.

The long term agenda is to have a set of world-class smart pointers
which is a established defacto standard, and can be presented to the
C++ committee as a unified package for inclusion in the next revision
of the standard library.

Some of the boost members will be in Tokyo in mid-April for the C++
committee meeting, and we will certainly get together to talk about
smart pointers. If boost members were not so spread out, it would be
nice to get everyone interested together; email bandwidth is just too
narrow. But I don't see how to do that.

>About implicit conversions from smart pointer to a normal pointer.
I will
>do what ever you decide on however I think with my pointers there is
hardly
>any danger and it is a HELL of a lot more convenient. Especially if
you want
>to treat the pointer like a normal pointer that will be
copied/destroyed
>in the inclosing class copy constructor and/or assignment operator &
>destructor.

While some people (myself included) will agree with you on that,
others don't. People who teach or write books about C++ programming,
and people who monitor the errors made by groups of programmers, tend
to be very concerned about the possibility for errors.

--Beman


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