home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: sparky!uunet!elroy.jpl.nasa.gov!sdd.hp.com!mips!mips!munnari.oz.au!metro!extro.ucc.su.OZ.AU!maxtal
- From: maxtal@extro.ucc.su.OZ.AU (John MAX Skaller)
- Subject: Re: Return value for the constructors.
- Message-ID: <1992Aug20.142644.10350@ucc.su.OZ.AU>
- Sender: news@ucc.su.OZ.AU
- Nntp-Posting-Host: extro.ucc.su.oz.au
- Organization: MAXTAL P/L C/- University Computing Centre, Sydney
- References: <3462@unisql.UUCP>
- Date: Thu, 20 Aug 1992 14:26:44 GMT
- Lines: 19
-
- In article <3462@unisql.UUCP> nandraj@unisql.UUCP (Nandraj Arni) writes:
- >
- > Why does C++ not let you have a return value for a constructor?
- >Is there any rationale behind this?
- >
-
- The simplest reason is
-
- Object a=Object(1,2);
-
- where the 'return value' of Object(1,2) could not be syntactically
- distingusied from its role returning an object (well, actually,
- being an object).
-
- --
- ;----------------------------------------------------------------------
- JOHN (MAX) SKALLER, maxtal@extro.ucc.su.oz.au
- Maxtal Pty Ltd, 6 MacKay St ASHFIELD, NSW 2131, AUSTRALIA
- ;--------------- SCIENTIFIC AND ENGINEERING SOFTWARE ------------------
-