Boost logo

Boost :

Subject: Re: [boost] Interest in StaticVector - fixed capacity vector
From: Nathan Ridge (zeratul976_at_[hidden])
Date: 2011-10-15 19:17:46

[Nathan Ridge]

[Nevin Liber]
> > How could it ever be a "drop-in replacement for vector"
> For over a decade, the mental model for calling push_back, insert,
> resize, etc. is that it they have no preconditions to check. This is
> true *for every standard container* (which supports the corresponding
> operation, of course). You want to *silently* break that consistency.
> That will lead to buffer overrun bugs, which we know are hard to
> debug and
> I'm not saying we don't need the unchecked functionality. I'm saying
> it should never be spelled p-u-s-h-_-b-a-c-k, i-n-s-e-r-t,
> r-e-s-i-z-e, etc. (which is one of the reasons I'm arguing against
> making it policy based). I'm strongly opposed to any solution that
> uses the same function signatures as the standard containers that
> isn't as safe and easy to call as the ones in the standard containers.

I don't have strong feelings about this, but I would be OK with changing
the name of my proposed std::array-like version of static vector (which I had
called capacity_array for lack of a better name)

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