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: what's the meaning of the warning "instantiated from here"


Hi hj,

> En, I followed the message, and find the warning description as: "xxxx
> will be initialized after".
> But I still cannot understand what the compiler want to tell me.

class Foo
{
public:
  Foo();

  int x;
  int y;
  int z;
};

Foo::Foo()
  :
  z(3),
  y(2),
  x(1)
{
}

Even though you specified the initialization list z, y then x, they will be
initialized x, y then z (as specified in the declaration order).

That's what the "xxxx will be initialized after" warning is telling you.

--Eljay


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