Boost logo

Boost :

From: Jeff Paquette (paquette_at_[hidden])
Date: 2000-10-02 12:55:07


When I needed such a class, I created auto_array_ptr from auto_ptr (cut &
paste) and changed delete to delete [].

Inelegant? yes.
Quick & painless? yes.
Did it work? yes.
Would I rather see a version with a parameterized deleter function? Yes.

--
Jeff Paquette
paquette at mediaone.net
http://www.atnetsend.net
> -----Original Message-----
> From: William Kempf [mailto:sirwillard_at_[hidden]]
> Sent: Monday, October 02, 2000 10:12 AM
> To: boost_at_[hidden]
> Subject: [boost] Re: auto_array
>
>
> --- In boost_at_[hidden], "David Abrahams" <abrahams_at_m...> wrote:
> > Hi,
> >
> > I realize that smart pointer development is effectively stalled
> because we
> > only want to build the perfect, infinitely parametrizable smart
> pointer once
> > at this point<0.1wink>, but I find myself in need of auto_array (no,
> > scoped_array/shared_array won't do - I need to release ownership).
> I just
> > wanted to put that feature request into the giant river we've
> already got
> > ;-)
>
> Won't std::vector work for you?  Though not currently standardized,
> there's a DR to insure, and all known implementations todate work
> with:
>
> legacy_func(&vec[0]);
>
> At least with the obvious safe guards (the vector must have a size
> greater than 0, for instance).
>
> Given this, there's very few reasons to need an auto_array (lack of a
> release() is one of the few I can think of right off the top of my
> head).
>
> Bill Kempf
>
>
>
>

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