|
Boost : |
From: Darin Adler (darin_at_[hidden])
Date: 2002-02-05 13:49:56
On 2/5/02 10:24 AM, "Synge Todo" <wistaria_at_[hidden]> wrote:
Darin:
>>> I think that we should look into fixed_capacity_vector implementations
>>> that don't behave this way; for one thing, it would make them more
>>> compatible with vector, and for another, it would make them more efficient.
> I should confess that I've never thought about that. I have no idea
> if it's possible to implement it in such a way without using dynamic
> allocation.
It's possible; the main challenge is finding a way to portably declare a
member that's an array of the right amount of suitably-aligned raw memory.
Andrei:
>> I agree. The fixed-capacity vector should allocate raw memory, not T[N]. The
>> current implementation would be suitable for PODs only.
> By the way, what does 'POD' mean?
It means "plain old data". It's a concept used in the C++ standard to call
out structs that behave the same in both C and C++.
What Andrei meant in this case is that the current implementation would be
suitable only for classes with no constructor or destructor.
-- Darin
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk