This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: compile error when initializing descendant struct
- From: "corey taylor" <corey dot taylor at gmail dot com>
- To: "Dave Bender" <codehero at gmail dot com>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Wed, 9 Apr 2008 21:53:15 -0400
- Subject: Re: compile error when initializing descendant struct
- References: <1fe498980804091506r10d1e64dp56d3a7de40a63c82@mail.gmail.com>
On Wed, Apr 9, 2008 at 6:06 PM, Dave Bender <codehero@gmail.com> wrote:
> struct B : public A {
> int y;
> };
>
> My goal is to incorporate a large set of structs in a DSO (so that
> they reside in the read only section). I don't see why this code
> should not compile.
Have you considered using composition and then initializing A then y
in your aggregate?
corey