"Michael N. Moran" <[EMAIL PROTECTED]> writes: | Gabriel Dos Reis wrote: | > "Michael N. Moran" <[EMAIL PROTECTED]> writes: | > | void buzz(Abc& b) | > | { | > | delete &b; | > | } | > | | void baz() | > | { | > | Abc& a = * new Abc(); | > If no memory is available, the new-expression throws an exception so | > the dereference never occurs. Check out C++ manuals. | | As a systems programmer (embedded), I frequently use "-fno-exceptions". | What behavior can I expect under these circumstances?
You have to manually check the return value of new. There is no substitute for that. At least, if you don't want to invoke that kind of undefined behaviour. -- Gaby