Re: A solution for the allocation failures problem




"Ian Collins" <ian-news@xxxxxxxxxxx> wrote in message
As I said before, it's very hard and therefore error prone to write
exception safe code with the mechanisms C provides for all of the
reasons it's very hard to use multiple points of return. Square that
when exceptions can escape out of functions.

I'd agree here.
Exceptions simplify the callee at the expense of more work in the caller. In fact they often make the interfaces too difficult to use.
However if you have a chain of out-of-memory returns you are effectively handcoding the C++ excpetion mechanism, so you lose the syntaxtical conveneience as well.

--
Free games and programming goodies.
http://www.personal.leeds.ac.uk/~bgy1mm


.



Relevant Pages

  • Re: To assert or not to assert...
    ... assert is intended to catch ... Memory allocation faults. ... exceptions (either OS-specific, or involving a custom-made ... special handling code built on top of OS-specific mechanisms (such as Win32 ...
    (comp.lang.c)
  • Re: The Modernization of Emacs: keyboard shortcuts pain
    ... "Keyboard Shortcuts", is the more well known and standard term. ... of first understanding the mechanisms. ... Now, of course the exceptions are legion, and all the Asian people ...
    (comp.emacs)
  • Re: COM sometimes turns exceptions into HRESULTs, sometimes doesnt - why?
    ... The proxy/stub pair must try and handle exceptions, so as not to tear down the mechanisms for marshalling, which may run on a secondary thread. ... If your COM object is constrained to be used from C++, and only from the same thread (strictly speaking, apartment) in the same process, I wonder why you went to the trouble of making it a COM object in the first place. ...
    (microsoft.public.win32.programmer.ole)
  • Re: using rule creates multiple entries. How can I stop this?
    ... rules, rules with exceptions, multiple rules with multiple exceptions, all I ... She also sends me phone messages I receive. ...
    (microsoft.public.outlook.general)
  • Re: Chapter 16 of Practical Common Lisp ready for review.
    ... can be used very effectivly for error handling. ... The article _stated_ that returning multiple values can be used very ... Exceptions provide an orthogonal system for program flow ...
    (comp.lang.lisp)