Boost logo

Boost :

From: Jeremy Day (jeremy.day_at_[hidden])
Date: 2006-07-07 19:03:28

On 7/7/06, Dean Michael Berris <mikhailberis_at_[hidden]> wrote:

> So when you always get a reference to an object of type exception_info

Yes, always getting references to exception_info would be great. If that's
an issue you can just catch exception_info&, instead of some other
exception. However, I think that it is the author's (Emil? I forget now.)
intention that the exception library could be dropped into current code with
no difference. Thus if you currently catch some_exception you could still
catch it, and then test (via the dynamic_cast, which is now hidden behind
get_exception_info) for whether exception_info has been added to it.

It might count as too much voodoo to get something to return a
> reference, but the benefits outweight the costs IMO. It just makes the
> interface less "fool proof" and makes it harder to "shoot yourself in
> the foot" when using a library of this utility.

I'm all for doing whatever possible to keep library users from inadvertantly
doing stupid things, but I personally feel that in this case the benefits of
using a pointer (being able to catch old exceptions and test for the
optional exception_info) outweigh the dangers of users potentially doing
something ridiculous with the exception_info pointer.


Boost list run by bdawes at, gregod at, cpdaniel at, john at