home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / lang / cplus / 12529 < prev    next >
Encoding:
Internet Message Format  |  1992-08-18  |  1.6 KB

  1. Path: sparky!uunet!zaphod.mps.ohio-state.edu!usc!cs.utexas.edu!unisql!nandraj
  2. From: nandraj@unisql.UUCP (Nandraj Arni)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Return value for the constructors.
  5. Message-ID: <3468@unisql.UUCP>
  6. Date: 18 Aug 92 22:54:36 GMT
  7. References: <3462@unisql.UUCP> <1992Aug18.210209.15023@watson.ibm.com>
  8. Reply-To: nandraj@unisql.UUCP (Nandraj Arni)
  9. Organization: UniSQL, Inc., Austin, Texas, USA
  10. Lines: 31
  11.  
  12. > In article <3462@unisql.UUCP>, nandraj@unisql.UUCP (Nandraj Arni) writes
  13. > :
  14. > >
  15. > >    Why does C++ not let you have a return value for a constructor?
  16. > > Is there any rationale behind this?
  17. > Before we answer that question, we should ask what do you want it for?
  18. > A language can't provide every conceivable feature; unless a feature is a
  19. > significant improvement to the language, it is an unnecessary complicati
  20. > on.
  21.  
  22.  
  23.   The reason I think it is a important feature the constructor should
  24. return whether it was a success or not? Say I want there is a time
  25. class which takes in put as MM/DD/YY. If the values were out of range
  26. for an instance of this class, the user should know that it was a bad
  27. way to construct this class. OR say it could not allocate memory...
  28.  
  29.  
  30.  
  31. -- 
  32. *******************************************************************
  33. Nandraj Arni
  34.  
  35. UniSQL, Inc.                           Voice: 512 343 7372 Ext. 107
  36. 9390 Research Blvd.                              Home: 512 794 9386
  37. Kaliedo II                             FAX: 512 343 7383
  38. Austin, TX 78759
  39.  
  40. Email: unisql!nandraj@cs.utexas.edu
  41. *******************************************************************
  42.