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: pure virtual functions and name injection


Hi Pierre,

> Why should I inject the "foo" name from a into b ?

So that the compiler can find b::foo();

> The two functions have different prototypes, I thought that the compiler was
able to differentiate them.

Different prototypes, but the same name.  The name is what is causing the
error, not the rest of the signature.

To avoid this kind of situation, I recommend using a different method name
for the method with the different signature.

>Then it compiles but there is a *link* error !  Can somebody explain me what
happens ?

You have not defined the a::foo function anywhere.  So there is a link
error.

HTH,
--Eljay


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