home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / lang / cplus / 19865 < prev    next >
Encoding:
Text File  |  1993-01-25  |  1003 b   |  29 lines

  1. Newsgroups: comp.lang.c++
  2. Path: sparky!uunet!gca!boyle
  3. From: boyle@gca.com (David Boyle)
  4. Subject: Re: Is it legal to have 'return;' in a constructor?
  5. Message-ID: <1993Jan25.162737.22568@gca.com>
  6. Organization: GCA Corporation
  7. References: <1993Jan18.233147.8573@leland.Stanford.EDU>
  8. Date: Mon, 25 Jan 1993 16:27:37 GMT
  9. Lines: 18
  10.  
  11. In article <1993Jan18.233147.8573@leland.Stanford.EDU>, kmh@leland.Stanford.EDU (khanhmy hoang) writes:
  12. >     A Microsoft C++ manual says constructor can't have the 'return;'
  13. >     statement but the Borland C++ compiler doesn't complain when I
  14. >     inserted 'return;' into a constructor definition.
  15. >     Who is correct?
  16.  
  17. From the ARM, section 6.6.3:
  18.  
  19. "A return statement without an expression can be used only in functions that do
  20. not return a value, that is, a function with return type void, a constructor,
  21. or a destructor."
  22.  
  23.  
  24. --
  25. David Boyle                            ...uunet!gca!boyle  or  boyle@gca.com
  26. GCA, a unit of General Signal          (508) 837-3869
  27. Andover, MA  01810
  28.