home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / lang / cplus / 16654 < prev    next >
Encoding:
Text File  |  1992-11-20  |  1.5 KB  |  36 lines

  1. Newsgroups: comp.lang.c++
  2. Path: sparky!uunet!taumet!steve
  3. From: steve@taumet.com (Steve Clamage)
  4. Subject: Re: Calling pure virtual functions in base class constructor
  5. Message-ID: <1992Nov20.184142.26362@taumet.com>
  6. Organization: TauMetric Corporation
  7. References: <721505557snx@trmphrst.demon.co.uk> <1992Nov19.170810.22728@ucc.su.OZ.AU>
  8. Date: Fri, 20 Nov 1992 18:41:42 GMT
  9. Lines: 25
  10.  
  11. maxtal@extro.ucc.su.OZ.AU (John MAX Skaller) writes:
  12.  
  13. |In article <721505557snx@trmphrst.demon.co.uk> nikki@trmphrst.demon.co.uk writes:
  14. |>
  15. |>Sorry about the length of this posting, but I really would like to 
  16. |>understand the reasons for all this :-)
  17.  
  18. |    I suspect it is a quirk. To ban or not to ban a body for
  19. |a pure virtual? Bjarne chose to allow them. I now see and accept that
  20. |apart from some unrelated meaning for the body, some 'default' behaviour
  21. |or, better, 'core' behaviour might well be a good use.
  22.  
  23. Consider this:  An abstract base class may have a pure virtual
  24. destructor.  The destructor for that base class will be called when
  25. a derived object is destroyed.  Therefore, you must provide a
  26. definition for the pure virtual destructor.
  27.  
  28. The alternative would have been for the language to forbid pure virtual
  29. destructors, or to have special rules for them.  It seems simpler to
  30. allow a definition of a pure virtual function.  It cannot cause any
  31. difficulties, and is necessary or desirable in some cases.
  32. -- 
  33.  
  34. Steve Clamage, TauMetric Corp, steve@taumet.com
  35. Vice Chair, ANSI C++ Committee, X3J16
  36.