home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / lang / cplus / 12641 < prev    next >
Encoding:
Text File  |  1992-08-20  |  1.1 KB  |  32 lines

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