
14 Aug
2011
14 Aug
'11
9:59 a.m.
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 ?