Boost logo

Boost :

From: Ed Brey (brey_at_[hidden])
Date: 1999-08-20 12:42:06


Email seemed somewhat boring, until Reid Sweatman wrote:
>
>> 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.
>
>What do you mean by "same as an array?" The items in an array could have
>widely varying alignments, depending on whether you specified a packing size
>or an alignment boundary for data items. For instance, specifying an even
>alignment is just about guaranteed to create differently-sized array
>elements than specifying a 16-byte alignment, depending, of course, on
>what's in the array. Do you mean that whatever alignment is current when
>the array is allocated determines its start address? What about the start
>addresses of its elements?

The defect report can give you the details of the proposed solution much
better than I can. See:

http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-issues.html#69

From the requirements in the proposed solution, you can deduce that
the elements would be stored "like an array", for a given packing.
I don't think that C++ addresses how to deal with varying packing schemes
within the same program or translation unit. That is left to how the
implementation wants to implement its pragmas and compiler switches.
I would expect that implementations will apply the current packing that
is in place when the vector is defined.


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