
On Tue, Jun 16, 2009 at 2:37 AM, Thorsten Ottosen < thorsten.ottosen@dezide.com> wrote:
Christian Schladetsch skrev:
Hello,
The complete interface is:
template <class T , size_t C = 64 , class Al = std::allocator<T> , class Link = boost::uninitialised_array<T, C, Al> , class Links = std::deque<Link, Al> struct chain;
I have made reference to boost::uninitialised_array<T, C, Al> here. I don't think such a beast exists at the moment, but the idea is pretty simple. It is a fixed-sized array of uninitialised T's using storage from the given allocator.
boost::auto_buffer is usable like this via the function unitialized_grow(C).
Ahh right. I shall look into using auto_buffer for my chain and see if it can be resurrected in the general case. It will still be tricky, because IIRC auto_buffer doesn't span the stack/heap boundary? That is, it is either all on the stack, or all on the heap? The original motivation for chain (earlier 'rope') was to avoid resize, and to allow some of the links in the chain to be on the stack, and other links to be on the heap. Christian.