Boost logo

Boost :

From: Beman Dawes (beman_at_[hidden])
Date: 2000-03-12 19:58:05


At 07:40 PM 3/7/00 +0100, Nicolai Josuttis wrote:

>Questions:
>
>o Shouldn't auto_array be provided (for completeness) ?

I suppose so.

>o The decision was made to use a direct detached implementation
> technique. To cite the text:
> "We went so far as to run various timings of the direct and
indirect
>approaches, and found
> that at least on Intel Pentium chips there was very little
measurable
>difference."
> However, the smart pointer tests give a totally different view.
Following them
> using a direct detached implementation is a significant penalty.
> So, why do we still use the direct detached implementation
technique?

The timings didn't include the indirect approach which allocates both
the count and the pointer on the heap. You were probably looking at
the timings for one of the other flavors. And yes, they are faster
that the version now up on the site.

>o I wonder, whether it would be useful to parametrize the release
operation,
> at least for scoped_ptr and scoped_array.

Several boost people tried to do that late last fall - there were
some proposals but the discussion kind of dribbled off. We need to
revisit it.

> Couldn't we implement a template for two types, the element type
and the
> release operation. This would allow to use the "resource
acquisition is
> initialization" idiom with other acquisitions than new and new[].
> Attached is an example implementation.

I will take a look; in the meantime you might want to look at how
Kevin Atkinson's ClonePtr and CopyPtr take 2 parameterization.

--Beman


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