Marco Correia <[EMAIL PROTECTED]> writes: > The following is a simplification of my problem: > > struct Base { virtual void func() = 0; }; > > struct Derived : Base { inline void func() {...} }; > > Derived& d = ...; > d.func(); > > This last call is not being inlined. Is this normal? (As I said my example is > more complex, I didn't check if the above is inlined or not). Also in my > example, compiling with -Winline does not warn me that it is not inlined. I > discovered it only by profiling the executable.
This question would be more appropriate for the [EMAIL PROTECTED] mailing list. Please direct any followups to that list. Thanks. In general it is not possible to inline a virtual function. There might be a subclass of Derived which itself has an implementation of func. Declaring func inline in Derived does not make it non-virtual. Ian