
6 Oct
2010
6 Oct
'10
12:25 p.m.
On 06.10.2010 14:09, Rutger ter Borg wrote:
On 2010-10-06 13:11, Stewart, Robert wrote:
(I haven't looked, but I do hope that the bool follows the optional value to reduce padding overhead.)
It doesn't, the boolean is followed by the optional value (see boost/optional/optional.hpp lines 447-448).
I really don't think it makes a difference. Unless you're using compiler-specific packing instructions, the size of a struct will always be a multiple of the largest alignment of any of its subobjects. In other words, no matter where you place the bool, it will take as much space as the alignment of the value. Sebastian