Subject: Re: [boost] [container] static_vector: fixed capacity vector update
From: Jeffrey Lee Hellrung, Jr. (jeffrey.hellrung_at_[hidden])
Date: 2013-01-21 15:50:14
On Mon, Jan 21, 2013 at 10:29 AM, Nevin Liber <nevin_at_[hidden]>wrote:
> On 21 January 2013 11:19, Andrew Hundt <athundt_at_[hidden]> wrote:
> > On Mon, Jan 21, 2013 at 10:45 AM, Olaf van der Spek <ml_at_[hidden]>
> > > What happened to hybrid array/vector?
> > Strictly speaking it's not a proper superset since there are some
> > fundamental interface differences between a container with a hard size
> > limit of N vs one with a more flexible size limit.
> I see no fundamental difference between your solution and a hybrid vector
> with a null allocator.
I would expect sizeof( static_vector ) < sizeof( hybrid_vector ) (even with
EBO used for storing the allocator in the latter case), as hybrid_vector
needs to discriminate between using internal and using external storage.
Additionally, this will sometimes necessitate more branching and/or
indirection in hybrid_vector than in static_vector for the same operation.
Well, really, that's all just a guess, I haven't actually gone and
implemented each myself. And it's assuming that hybrid_vector< T, N,
null_allocator<T> > isn't special-cased to behave like a
static_vector<T,N>, because, at that point, now we're just arguing over