In C struct's, I'm guaranteed that:
struct Foo { ... };
struct Bar {
Foo foo;
...
}
Bar bar;
assert(&bar == &(bar.foo));
Now, in C++, if I have:
class Foo { ... };
class Bar: public Foo, public Other crap ... {
...
}
Bar bar;
assert(&bar == (Foo*) (&bar)); // is this guaranteed?
If so, can you give me a reference (like "The C++ Programming Language, page xyz")?
Thanks!