Boost logo

Boost :

Subject: Re: [boost] static_vector using aligned_storage
From: Nevin Liber (nevin_at_[hidden])
Date: 2012-12-12 11:44:36


On 12 December 2012 10:22, Marshall Clow <mclow.lists_at_[hidden]> wrote:

> On Dec 12, 2012, at 8:08 AM, Adam Wulkiewicz <adam.wulkiewicz_at_[hidden]>
> wrote:
> >
> https://svn.boost.org/svn/boost/sandbox-branches/geometry/index/tests/static_vector.cpp
> >
> > I've searched for this kind of container in Boost since I remember that
> someone proposed it some time ago but didn't find it anywhere. Is it
> released somewhere? Maby as a part of some library?
>
> This is supposed to be easy in C++11, with the appropriate allocator.
> [ I say "supposed to be" since I haven't tried it. ]
>

I do not believe it is possible to do so with just an allocator under
C++11. :-( I think the best one can do is have a separate (not embedded in
the allocator, and hence, not embedded in vector) arena for the space, as
in http://home.roadrunner.com/~hinnant/stack_alloc.html. So there is still
a need for a static vector class.

-- 
 Nevin ":-)" Liber  <mailto:nevin_at_[hidden]>  (847) 691-1404

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