|
Boost : |
Subject: Re: [boost] [exception] ostringstream like
From: fabien.castan_at_[hidden]
Date: 2010-08-16 08:01:46
> exception are just here to gather and carry diagnostic info, not full fledged error message
If you throw a bad_alloc, you don't need to add a full fledged error message, I agree that the localization and the exception type is sufficient.
When you throw a logic_error, more the message is clear, precise and detailed better it is.
> may fail to allocate the needed memory for the string and stream, thus maskign the initial exception with some bad_alloc.
I agree for bad_alloc exception, but as before you don't really need a message in this particular case.
If you throw a logic_error, you don't have more chance to encounter a bad_alloc than everywhere in your application.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk