home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / lang / cplus / 18808 < prev    next >
Encoding:
Internet Message Format  |  1993-01-07  |  1.3 KB

  1. Path: sparky!uunet!spool.mu.edu!enterpoop.mit.edu!eru.mt.luth.se!hagbard!loglule!jbn
  2. From: jbn@lulea.trab.se (Johan Bengtsson)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: why `int X: :X()' ?
  5. Message-ID: <5501@miramon.lulea.trab.se>
  6. Date: 7 Jan 93 15:53:50 GMT
  7. References: <1992Dec30.172537.12477@csi.jpl.nasa.gov>
  8. Organization: Telia Research AB, Aurorum 6, 951 75 Lulea, Sweden
  9. Lines: 18
  10. X-Newsreader: TIN [version 1.1 + PL8]
  11.  
  12. Matt Wette (mwette@csi.jpl.nasa.gov) wrote:
  13.  
  14. : Why are constructor and destructor functions usually declared to return
  15. : ints when the usage typically warrents a `void' declaration.
  16.  
  17. The "default int" rule does not apply to constructors and destructors.
  18. You can't return an "int" from those functions.  You can't explicitly
  19. mark them as procedures (void) either.
  20.  
  21. I'd say that "default void" (as for constructors and destructors)
  22. makes more sense than "default int".  Having no default type at all
  23. makes the most sense, avoiding compiler and programmer confusion.
  24.  
  25. -- 
  26. --------------------------------------------------------------------------
  27. | Johan Bengtsson, Telia Research AB, Aurorum 6, S-951 75 Lulea, Sweden  |
  28. | Johan.Bengtsson@lulea.trab.se; Voice:(+46)92075471; Fax:(+46)92075490  |
  29. --------------------------------------------------------------------------
  30.