Boost logo

Boost :

From: Greg Colvin (gcolvin_at_[hidden])
Date: 2000-03-23 20:36:38

From: Kevin Atkinson <kevinatk_at_[hidden]>
> On Thu, 23 Mar 2000, Beman Dawes wrote:
> > 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.
> Some pointers people seam to be missing.
> Making smart pointers more generic my taking in the necessary
> copy/assign/delete functions as a parameters. This will avoid the need to
> have a separate smart pointer for arrays and also allow them to be used
> with libraries well a special function has to be called to free a pointer
> as is command with most C libraries.

This has been on my to-do list for years. The variety of possible
copy/assign/delete operations, among other difficulties, has stymied
me to date.
> My ClonePtr which unlike the Copy pointer doesn't REALLY need the two
> header approach because most of the time the Abstract Base Classes (ABC) is
> visible. I find the clone pointers extrema useful as it makes using ABC
> a lot safer as with the ClonePtr you can _almost_ treat them as if
> there were the actual class (ie not a pointer) and thus many times avoid
> the need for light weight wrapper classes for ABC which alloys one to treat an
> ABC as an actual object.

Classes with deep copy semantics seem to me more like "smart references"
than smart pointers, so I wonder if they should have a pointer-like
interface at all.

Boost list run by bdawes at, gregod at, cpdaniel at, john at