|
Boost : |
From: Kevin Atkinson (kevinatk_at_[hidden])
Date: 2000-03-23 20:31:20
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.
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.
--- Kevin Atkinson kevinatk_at_[hidden] http://metalab.unc.edu/kevina/
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk