Boost logo

Boost Users :

Subject: Re: [Boost-users] PolyCollection requiring copyable
From: Ion Gaztañaga (igaztanaga_at_[hidden])
Date: 2017-10-04 20:38:21

On 04/10/2017 21:10, d3fault via Boost-users wrote:
> On 10/3/17, Steven Watanabe via Boost-users
> <boost-users_at_[hidden]> wrote:
>> PolyCollection uses contiguous storage (aka std::vector).
>> This requires copying when the segment is resized.
> Ahh that makes sense. Just throwing a random idea out here: would a
> semi-contiguous design be possible? PolyCollection could maintain a
> list of [contiguous] segments, something along the lines of how
> "extents" work in the filesystem world? You could get 99% cache hits
> and only a few misses when jumping to the next segments. idk maybe
> this idea sucks xD.

I don't remember if this was commented in the review for future
improvements, but it's an idea I wanted to share. If the internal
sequence type to hold the collection of objects of the same type could
be specified as an option, a deque-like sequence could allow non-movable
and non-copyable types, at least when insertion position is not
specified, and even stable references and pointers for such insertions.
A stable_vector based storage would allow even more operations for such
types, but we would loose element contiguity.


Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at