
On Sun, Aug 15, 2010 at 5:22 AM, joel falcou <joel.falcou@lri.fr> wrote:
On 15/08/10 14:04, fabien wrote:
I would like to propose an "error_info_sstream" class
Well, exception are just here to gather and carry diagnostic info, not full fledged error message as it limits applciability (like localization)
This is correct, formatting an error message is always beyond the scope of the code that throws the exception.
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 to run out of memory while trying to throw an exception, which presumably may result in a std::bad_alloc. Also, in Boost Exception adding error_info has the postcondition that it has been added, meaning you may get another exception when you try to add error_info. Emil Dotchevski Reverge Studios, Inc. http://www.revergestudios.com/reblog/index.php?n=ReCode