Subject: Re: [boost] static_vector using aligned_storage
From: Andrew Hundt (athundt_at_[hidden])
Date: 2012-12-12 13:11:37
Yes, I had proposed StaticVector.
Here is the repository:
Here is a link to the original discussion via google groups:
I would be interested in working with you to complete either my version or
yours. Did you have any thoughts or questions regarding my implementation?
There are a few items related to my implementation on the github ticket
list that came from the discussion thread that need resolving before the
next round, but nothing too bad.
On Wed, Dec 12, 2012 at 11:08 AM, Adam Wulkiewicz <adam.wulkiewicz_at_[hidden]
> I'm developing R-tree container for Boost.Geometry. To keep it short,
> there are containers of Values in leaf nodes. Those containers must have
> push_back() functionality. For static-size nodes I'm using a container
> based on boost::array. Unfortunately this means that default constructors
> of stored Values are called when the container is created. I'd like not to
> expect that Values have their default ctor implemented. I've implemented an
> alternative container using boost::aligned_storage. This is just a proof of
> concept. The code is available here:
> 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?
> If not, would you be so kind and see if my solution should work for
> any/most popular compiler/platform? I've tested it only on clang.
> To be specific, won't there be any problems with the memory aligmnent if I
> use this code for storage:
> boost::aligned_storage<sizeof(**Value) * Capacity> m_storage;
> this for access:
> *(reinterpret_cast<Value*>(m_**storage.address()) + i);
> and this for construction
> (reinterpret_cast<Value*>(m_**storage.address()) + i)
> Unsubscribe & other changes: http://lists.boost.org/**