Xref: utzoo comp.lang.c++:12726 comp.std.c++:811 Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!cs.utexas.edu!uunet!tdatirv!sarima From: sarima@tdatirv.UUCP (Stanley Friesen) Newsgroups: comp.lang.c++,comp.std.c++ Subject: Re: How can I report an error when constructor parameters are wrong. Message-ID: <190@tdatirv.UUCP> Date: 7 Apr 91 17:57:52 GMT References: <1991Mar26.124326.4996@linus.mitre.org> Reply-To: sarima@tdatirv.UUCP (Stanley Friesen) Followup-To: comp.lang.c++ Organization: Teradata Corp., Irvine Lines: 17 In article an article fkuhl@maestro.mitre.org (F. S. Kuhl) writes: >Is it true that a constructor returns NULL if it fails? A quick >look thru ARM failed to settle this point. No, in fact a constructor never returns anything at all. It cannot, since it may be called in contexts other than operator new(). For instance, given the class type 'T' the following calls a default construcor: T t_obj; There is no meaningful way to return anything in this context. As far as I am concerned this is why the error handling stuff in ARM is so vital, since it is the *only* structured solution to this problem. -- --------------- uunet!tdatirv!sarima (Stanley Friesen)