Boost logo

Boost :

From: David B. Held (dheld_at_[hidden])
Date: 2004-01-06 14:23:08


"Pavel Vozenilek" <pavel_vozenilek_at_[hidden]> wrote in message
news:btea2t$3m3$1_at_sea.gmane.org...
> "David B. Held" <dheld_at_[hidden]> wrote
> [...]
> > Be careful what you claim here. ;) Not everything is as it seems,
> > and I can give you an example that doesn't.
>
> Go ahead please.

#include <iostream>

struct P1 { int x; };
struct P2 { };
struct P3 { };
struct P4 { };

struct S : public P1, public P2, public P3, public P4 { };

int main()
{
    std::cout << sizeof(S) << std::endl;
}

On my system, this prints "32" with EBO enabled.

Dave

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.556 / Virus Database: 348 - Release Date: 12/26/2003

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