home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / lang / cplus / 17815 < prev    next >
Encoding:
Text File  |  1992-12-11  |  1.1 KB  |  29 lines

  1. Newsgroups: comp.lang.c++
  2. Path: sparky!uunet!gatech!concert!decwrl!borland.com!pete
  3. From: pete@borland.com (Pete Becker)
  4. Subject: Re: Making a constructor fail
  5. Message-ID: <1992Dec11.175120.26223@borland.com>
  6. Originator: pete@genghis.borland.com
  7. Sender: news@borland.com (News Admin)
  8. Organization: Borland International
  9. References: <k801f5+@rpi.edu> <1992Dec3.222414.3781@borland.com> <vjf2w#+@rpi.edu>
  10. Distribution: usa
  11. Date: Fri, 11 Dec 1992 17:51:20 GMT
  12. Lines: 15
  13.  
  14. In article <vjf2w#+@rpi.edu> nelsonc@colossus.cs.rpi.edu (Chris Nelson) writes:
  15. >Presumably, I could also override the new operator for the class so
  16. >that IT tested the return flag from the constructor and deallocated
  17. >the object and returned NULL if the allocation in the constructor
  18. >failed?
  19. >
  20. >                                  Chris
  21. >
  22.     Isn't there some saying to the effect that "'presume' makes a 'pres'
  23. of 'u' and 'me'"?  Unfortunately, there is nothing in the language that
  24. requires that operator new get control after the
  25. constructor is executed, so you can't use it to check whether construction
  26. succeeded.
  27.     -- Pete
  28.  
  29.