
At Sun, 15 Aug 2010 11:26:30 -0700, Emil Dotchevski wrote:
and may fail to allocate the needed memory for the string and stream, thus maskign the initial exception with some bad_alloc.
This concern is not valid because the C++ standard permits the runtime code
Do you mean the runtime library?
to run out of memory while trying to throw an exception, which presumably may result in a std::bad_alloc.
If not, I don't think that invalidates the concern at all. It's application- dependent whether or not the originally-intended exception is more important information than the knowledge that memory was running short at the point of the throw. If so, I wouldn't presume that it would throw bad_alloc in that case, in real implementations. Usually this sort of thing falls under "violating implementation limits" and invokes undefined behavior. -- Dave Abrahams BoostPro Computing http://www.boostpro.com