You understood me correctly. My (mis?)understanding comes from: The Complete Reference,Fourth Edition Herbert Schildt Copyright 2003 ISBN 0-07-222680-3
Page 420 (And I Quote - don't you just love the phrase) "Remember: When a base class' access specifier is private, public and protected members of the base become private members of the derived class. This means that they are still accessible by members of the derived class but cannot be accessed by parts of your program that are not members of either the base or derived class." If you can, could you please provide a citation which contradicts Schildt? The examples have a derived class with a private access specifier to a base class which should allow access to base class private members, and I assume, functions - there is no privacy when you are so derived. Given the above quote the behavior seen by gcc is unexpected. Given your statement it appears that an access specifier of 'private' has no effect. art --- On Fri, 4/10/09, Ian Lance Taylor <i...@google.com> wrote: > From: Ian Lance Taylor <i...@google.com> > Subject: Re: operator=() issue > To: "Arthur Schwarz" <aschwarz1...@verizon.net> > Cc: gcc@gcc.gnu.org > Date: Friday, April 10, 2009, 4:48 PM > Arthur Schwarz <aschwarz1...@verizon.net> > writes: > > > operator=() is private in ios_base. Using private > inheritance of > > ios_base the program below fails in the constructor > when '=' is used > > (but not during memory initialization). I don't > understand why > > assignment is prohibited. > > Perhaps I misunderstand your question, but private > inheritance does not > grant access to private methods in the parent class. > It merely > prohibits access to the parent class by users of the > class. > > Ian >