0
non-public inheritance
why no one question about non-public inheritance?
2 odpowiedzi
+ 1
Public inheritance: Public members of the base class become public members of the derived class and protected members of the base class become protected members of the derived class.
Protected inheritance: Public and protected members of the base class become protected members of the derived class.
Private inheritance: Public and protected members of the base class become private members of the derived class.
You probably won't ever need to use anything but public inheritance.
0
this can be used not so often, but I'm facing with it (private only, no one protected) from time to time. here is a perfect sample from guru :) http://www.gotw.ca/gotw/040.htm