Path: utzoo!attcan!uunet!lll-winken!ames!ucsd!rutgers!mit-eddie!bu-cs!mirror!necntc!necis!mrst!sdti!turner From: turner@sdti.SDTI.COM (Prescott K. Turner) Newsgroups: comp.lang.c++ Subject: Re: inheriting constructors Message-ID: <352@sdti.SDTI.COM> Date: 26 Jan 89 18:04:33 GMT References: <3477@tekcrl.CRL.TEK.COM> Reply-To: turner@sdti.SDTI.COM (Prescott K. Turner, Jr.) Organization: Software Development Technologies, Sudbury MA Lines: 36 In article <3477@tekcrl.CRL.TEK.COM>, soiffer@tekcrl.CRL.TEK.COM (Neil Soiffer) says: > [...] the program that I included that showed that in cfront, they > [constructors] are occasionally inherited What cfront does with your example seems very odd. I've heard it said so often that constructors are not inherited that I can't point out when Dr. Stroustrup said it. This non-inheritance is intentional. What's more, you are looking not just for constructors to be inherited, but to be accessible by the name of the derived class. Such a feature is not described in the book or in any of the other papers describing the definition of C++. > In Stroustrup's book, the only comment on the first form "D d(5)" that > I could find is on page 139, saying that the first form is an abbreviation > of the second form. Why should an abbreviation behave differently than > the full form? Indeed cfront treats them identically in the sample program you present. It's g++ which handles them differently, and it's a bug. > The *only* new behavior this class introduces is for the Press function. > Why should "MyPushButton" have to (re)introduce the six constructors that > are defined for "PushButton". Yes, good example. > Does this reference manual exist in some preliminary > form and if so, does it discuss whether constructors are inherited in a > correct implementation of c++? Yes, where I work we are lucky to be among the reviewers of the revised reference manual for C++. It is not finished, so reviewing it has its price as well as benefits. I can't comment on what it says about inheritance of constructors, but if it is silent we will mention that in our review. -- Prescott K. Turner, Jr. Software Development Technologies, Inc. 375 Dutton Rd., Sudbury, MA 01776 USA (508) 443-5779 UUCP: ...{harvard,mit-eddie}!sdti!turner Internet: turner@sdti.sdti.com