Boost logo

Boost :

Subject: [boost] Question for C++ experts about exception allocation failure
From: Emil Dotchevski (emil_at_[hidden])
Date: 2009-05-16 22:03:39


How is failure to allocate an exception object handled in various
compilers? 15.1.4 says that "the memory for the temporary copy of the
exception being thrown is allocated in an unspecified way" but I don't
think it specifies behavior for the case when the allocation fails. I
know that some compilers allocate exceptions from the heap, so does
this mean that an attempt to throw any exception could, in theory,
result in a std::bad_alloc being thrown instead? As far as I can tell
such behavior wouldn't violate the C++ standard, but I'm not sure my
interpretation is correct. Anyone?

Emil Dotchevski
Reverge Studios, Inc.
http://www.revergestudios.com/reblog/index.php?n=ReCode


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk