home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: sparky!uunet!gca!boyle
- From: boyle@gca.com (David Boyle)
- Subject: Re: Is it legal to have 'return;' in a constructor?
- Message-ID: <1993Jan25.162737.22568@gca.com>
- Organization: GCA Corporation
- References: <1993Jan18.233147.8573@leland.Stanford.EDU>
- Date: Mon, 25 Jan 1993 16:27:37 GMT
- Lines: 18
-
- In article <1993Jan18.233147.8573@leland.Stanford.EDU>, kmh@leland.Stanford.EDU (khanhmy hoang) writes:
- > A Microsoft C++ manual says constructor can't have the 'return;'
- > statement but the Borland C++ compiler doesn't complain when I
- > inserted 'return;' into a constructor definition.
- > Who is correct?
- >
-
- From the ARM, section 6.6.3:
-
- "A return statement without an expression can be used only in functions that do
- not return a value, that is, a function with return type void, a constructor,
- or a destructor."
-
-
- --
- David Boyle ...uunet!gca!boyle or boyle@gca.com
- GCA, a unit of General Signal (508) 837-3869
- Andover, MA 01810
-