This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: compile error when initializing descendant struct


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]