Boost logo

Boost :

Subject: Re: [boost] [optional] memory use for optional refs and ptrs
From: Larry Evans (cppljevans_at_[hidden])
Date: 2010-10-06 14:05:40

On 10/06/10 08:28, Sebastian Redl wrote:
> On 06.10.2010 14:26, Stewart, Robert wrote:
>> When the bool follows the value, it can occupy otherwise unused
>> padding between data members.
> I really don't think so. Maybe in theory, but not in practice,
A copy of the code posted here:

followed by:

struct C {
    int a;
    bool ta;
    double b;
    bool tb;
    double c;
    bool tc;
    std::string d;
    bool td;

int main(void)
    return 0;

showed sizeof(B) = sizeof(C), justifying Sebastian's doubt.


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