Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ncar!boulder!ccncsu!ncr-fc!frodo From: frodo@ncr-fc.FtCollins.NCR.COM (David Fletcher) Newsgroups: comp.lang.c++ Subject: Constructors for (non-public) derived classes Message-ID: <200@ncr-fc.FtCollins.NCR.COM> Date: 4 Mar 89 17:08:51 GMT Reply-To: frodo@ncr-fc.UUCP (David Fletcher) Followup-To: comp.lang.c++ Distribution: na Organization: NCR Fort Collins, Colorado Lines: 39 I have a problem with calling a constructor for a derived class that is not publicly derived from a base class. These classes look something like: class B | class D : B // *NOT* public B { | { public: | public: B(various args); | D(various args); B(B& Ref); | D(D& Ref); void operator=(B& Ref); | void operator=(D& Ref); ~B(); | ~D(); protected: | protected: private: | private: } | } Here are the constructors for them: B::B(various args) {} B::B(B& Ref) {} // ... D::D(various args) : (other various args) {} D::D(D& Ref) : (Ref) {} <== offending line Now, using AT&T 1.2.1 I get an error from the compiler that looks like: "foo.cc", line 116: error: bad argument list for overloaded base::base() However, if I publicly derive D (i.e., class D : public B {} ) then everything is okey-dokey. Why does it matter that the class is not publicly derived? I can't find anything in the C++ documentation/book that says this is verbotten. Thanks for the help. -- David Fletcher, NCR Microelectronics 2001 Danfield Court, Ft. Collins, CO 80525 | "... Let everything else go ..." (303) 223-5100 x 241 | -- Phil Keaggy