Boost logo

Boost :

From: Ed Brey (brey_at_[hidden])
Date: 1999-08-19 16:43:44

Email seemed somewhat boring, until Reid Sweatman wrote:
>Frankly, I've never been totally clear on whether or not STL vectors are
>even required to maintain contiguous memory locations, let alone ones that
>have specified address alignments, which can be critical in CPU cache

How std::vector stores its internal data is currently undefined by the
C++ standard. However, the C++ standard committee is discussing a
defect report requiring the vector be contiguous. I'm not sure about
data alignment issues, though, but I expect that the the consideration
is for it to be the same as an array.

For the work I do, which makes extensive use of, M$'s COM, I make
the contiguity and alignment assumptions of "same as array". To
appease my own misgivings about that course of action, I tell myself
that C++ will probably be changed to make it valid soon, all known
implemntations happen to support it, and COM requires me to break so
many rules of good C++ coding, what's one more?

Boost list run by bdawes at, gregod at, cpdaniel at, john at