Boost logo

Boost :

Subject: Re: [boost] Interest in Boost.Array companion: StaticVector - A statically allocated fixed capacity vector
From: Andrew Hundt (athundt_at_[hidden])
Date: 2011-08-14 13:09:11


It seems I missed the container review, it does look like that would
suffice. The simplicity of the StaticVector implementation may still make it
useful for cases where all you really need are a simple array and a size, in
the same way that boost.array is useful for an array alone. However, its
entirely possible that StaticVector is now redundant, and that's why I'm
asking if there is any interest. :-)

I've also tried to come up with a better name for it, but that is the best I
could think of. Any better naming suggestions around?

Cheers!
Andrew Hundt

On Sun, Aug 14, 2011 at 5:59 AM, Joel falcou <joel.falcou_at_[hidden]> wrote:

> On 14/08/11 11:55, Andrew Hundt wrote:
>
>> Sample Code:
>> StaticVector<std::size_t,3> three;
>> three.push_back(5);
>> three.push_back(2); // size: 2 capacity: 3
>> three.push_back(3);
>>
>> three.push_back(1); // throws std::out_of_range exception indicating the
>> capacity has been exceeded
>>
>
> Can't this just be done using Boost.Container or any stateful allcoator
> aware container implementation with a stateful allocator holding the static
> allocated block of memory ?
>
>
> ______________________________**_________________
> Unsubscribe & other changes: http://lists.boost.org/**
> mailman/listinfo.cgi/boost<http://lists.boost.org/mailman/listinfo.cgi/boost>
>


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