home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / lang / cplus / 16005 < prev    next >
Encoding:
Text File  |  1992-11-09  |  1.3 KB  |  44 lines

  1. Path: sparky!uunet!stanford.edu!ames!pacbell.com!hoptoad!brendan
  2. From: brendan@cygnus.com (Brendan Kehoe)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Invoking template base ctor
  5. Message-ID: <38397@hoptoad.uucp>
  6. Date: 9 Nov 92 21:43:34 GMT
  7. References: <VANDER.92Nov6115633@vancouver.stars.flab.Fujitsu.co.jp>
  8. Sender: news@hoptoad.uucp
  9. Reply-To: brendan@cygnus.com
  10. Organization: Cygnus Support, Palo Alto CA; Phone +1 415 322 3811
  11. Lines: 29
  12. Nntp-Posting-Host: cygnus.com
  13. In-reply-to: vander@flab.fujitsu.co.jp's message of 6 Nov 92 02:56:33 GMT
  14.  
  15. In article <VANDER.92Nov6115633@vancouver.stars.flab.Fujitsu.co.jp> vander@flab.fujitsu.co.jp (Mike van der Velden) writes:
  16.  
  17.    I'm using g++ (2.2.2?) on a Sun Sparc S-4/1X.  I have the following
  18.    code segment.
  19.  
  20.        template <class T>
  21.        class B {
  22.        public:
  23.        B () { /*  */ }
  24.        };
  25.  
  26.  
  27.        class D : public B<D> {
  28.        public:
  29.        D() : () {}     // compiles fine
  30.        D() : B() {}    // error:  class `D' does not have any field named `B'
  31.        };
  32.  
  33.  
  34. Please try the 2.3.1 release, it says:
  35.  
  36.   foo.C:11: `D::D ()' is already defined in class D
  37.   foo.C: In method `D::D ()':
  38.   foo.C:10: warning: ANSI C++ forbids old style base class initialization
  39.  
  40. --
  41. Brendan Kehoe                                               brendan@cygnus.com
  42. Cygnus Support, Palo Alto, CA                                  +1 415 322 3811
  43.  
  44.