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