Boost logo

Boost :

From: Greg Colvin (gcolvin_at_[hidden])
Date: 2000-12-13 13:31:53


From: "David Abrahams" <abrahams_at_[hidden]>
> Do you worry about these differences?

No. shared_array is not a vector, it's a wrapper
for a pointer to the first element of an array.

> vector<int> x(0); // ok
> vector<int> x(12); // ok
> and
> boost::shared_array<int> x(0); // ok
> boost::shared_array<int> x(12) // error
>
> -Dave
> ----- Original Message -----
> From: "Greg Colvin" <gcolvin_at_[hidden]>
> To: <boost_at_[hidden]>
> Sent: Wednesday, December 13, 2000 12:41 AM
> Subject: Re: [boost] shared_array.size()
>
>
> > It's the name that worries me, it's the differing semantics,
> > I think null pointer to array versus pointer to empty array?
> >
> > From: "David Abrahams" <abrahams_at_[hidden]>
> > > "shared_array2" was just a placeholder
> > >
> > > any-resemblance-to-class-temlates-living-or-dead-is-pure-coincidence-ly
> > > y'rs,
> > > dave
> > > ----- Original Message -----
> > > From: "Greg Colvin" <gcolvin_at_[hidden]>
> > > To: <boost_at_[hidden]>
> > > Sent: Tuesday, December 12, 2000 11:46 PM
> > > Subject: Re: [boost] shared_array.size()
> > >
> > >
> > > > Yep, and adding a size field to shared_array is extra overhead as
> well,
> > > > but maybe not so bad. What I don't like is setting the size field
> > > > separately, but I'm not sure I like your shared_array2 interface
> either.
> > > > In particular, what about
> > > >
> > > > boost::shared_array<int> x(0);
> > > >
> > > > vs.
> > > >
> > > > boost::shared_array2<int> x(0);
> > > >
> > > > From: "David Abrahams" <abrahams_at_[hidden]>
> > > > > Okay; there's one extra level of indirection in that case, though,
> and a
> > > bit
> > > > > more overhead, FWIW.
> > > > >
> > > > > ----- Original Message -----
> > > > > From: "Greg Colvin" <gcolvin_at_[hidden]>
> > > > >
> > > > >
> > > > > > So use shared_ptr<vector> ?
> > > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > >
> > > >
> > > >
> > > >
> > >
> > >
> > >
> > >
> > >
> >
> >
> >
> >
>
>
>
>
>


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