inline funtcion of base class

Jonathan Wakely
Tue Aug 20 07:56:00 GMT 2013

On 20 August 2013 06:02, Hatt Tom wrote:
> hi:
>   Here is my example :
>     class A { inline func();}
>    class B:public A ;

This code is not even valid C++.

>   If B calls func() ,is it dealed as inline ,which has no frame ?
>   if I want to share one inline function from base class , what is the
> best mothod ?

Yes, A::func() is an inline function.  It is visible to the derived
class, but it is not accessible because it's private.  If you make it
public or protected it will be accessible.

This question is not about GCC so you should find a forum about
learning C++ to ask this sort of question, e.g.

More information about the Gcc-help mailing list