Boost logo

Boost :

From: David Abrahams (david.abrahams_at_[hidden])
Date: 2002-03-08 11:16:58

----- Original Message -----
From: "Howard Hinnant" <hinnant_at_[hidden]>
To: <boost_at_[hidden]>
Sent: Friday, March 08, 2002 11:03 AM
Subject: Re: [boost] Re: container design (Was: std::complex design
(Was: N-Dimensional array))

> On Friday, March 8, 2002, at 10:33 AM, David Abrahams wrote:
> >> What problem does this solve that vector<T>(n, uninitialized_flag)
> >> doesn't solve?
> >
> > Using uninitialized_flag allows people to make vectors with broken
> > invariants, and the invariants stay broken for an arbitrary amount
> > time. The memory adoption suggestion keeps the vector invariants
> > assuming that the user doesn't lie to the vector when she tells it
> > adopt (and that's just the usual danger that the user must not break
> > end of the contract).
> >
> > I think that's a big advantage, assuming that the other needs are
> Sorry to be dense, but what vector invariant is broken?

Oh, for example, that the vector can be copied or destroyed or the 0th
item can be dereferenced, depending on the definition of T and what you
think uninitialized_flag actually does.


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