Boost logo

Boost :

From: Howard Hinnant (hinnant_at_[hidden])
Date: 2002-03-08 11:03:16

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 of
> time. The memory adoption suggestion keeps the vector invariants intact,
> assuming that the user doesn't lie to the vector when she tells it to
> adopt (and that's just the usual danger that the user must not break her
> end of the contract).
> I think that's a big advantage, assuming that the other needs are met.

Sorry to be dense, but what vector invariant is broken?


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