home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!usc!cs.utexas.edu!unisql!nandraj
- From: nandraj@unisql.UUCP (Nandraj Arni)
- Newsgroups: comp.lang.c++
- Subject: Re: Return value for the constructors.
- Message-ID: <3468@unisql.UUCP>
- Date: 18 Aug 92 22:54:36 GMT
- References: <3462@unisql.UUCP> <1992Aug18.210209.15023@watson.ibm.com>
- Reply-To: nandraj@unisql.UUCP (Nandraj Arni)
- Organization: UniSQL, Inc., Austin, Texas, USA
- Lines: 31
-
- > 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?
- >
- > Before we answer that question, we should ask what do you want it for?
- > A language can't provide every conceivable feature; unless a feature is a
- > significant improvement to the language, it is an unnecessary complicati
- > on.
-
-
- The reason I think it is a important feature the constructor should
- return whether it was a success or not? Say I want there is a time
- class which takes in put as MM/DD/YY. If the values were out of range
- for an instance of this class, the user should know that it was a bad
- way to construct this class. OR say it could not allocate memory...
-
-
-
- --
- *******************************************************************
- Nandraj Arni
-
- UniSQL, Inc. Voice: 512 343 7372 Ext. 107
- 9390 Research Blvd. Home: 512 794 9386
- Kaliedo II FAX: 512 343 7383
- Austin, TX 78759
-
- Email: unisql!nandraj@cs.utexas.edu
- *******************************************************************
-