This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: invalid offsetof from non-POD type
Matthias Benkmann wrote:
Can't you wrap the POD-stuff in a real POD like this:
yes, but then you (well I've had to in the past), do something like
class Foo {
public:
struct Pod { ...};
...
};
class BiggerFoo : public Foo {
public
struct Pod : Foo::Pod { ... }; // this is a lie now
...
};
It gets annoying to have to write
struct Pod { struct Foo::Pod base; ... };
as that exposes the hierachy to all BiggerFoo::Pod users.
nathan
--
Nathan Sidwell :: http://www.codesourcery.com :: CodeSourcery LLC
The voices in my head said this was stupid too
nathan at codesourcery dot com : http://www.cs.bris.ac.uk/~nathan/ : nathan at acm dot org