Boost logo

Boost :

Subject: Re: [boost] Interest in Boost.Array companion: StaticVector - A statically allocated fixed capacity vector
From: Joel falcou (joel.falcou_at_[hidden])
Date: 2011-08-14 05:59:53


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 ?


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