Boost logo

Boost :

From: Ames Andreas (Andreas.Ames_at_[hidden])
Date: 2006-07-19 08:50:09


> -----Original Message-----
> From: boost-bounces_at_[hidden]
> [mailto:boost-bounces_at_[hidden]] On Behalf Of Andreas Huber
> Sent: Tuesday, July 18, 2006 10:05 PM
> Subject: Re: [boost] Exception Visitor
>
> // Untested code
> #include <stdexcept>
>
> // Generic handler function
> void HandleException()
> {
> try
> {
> throw;
> }
> catch (const std::logic_error &)
> {
> // whatever
> }
> catch (const std::exception &)
> {
> // whatever
> }
> }
>
> int main()
> {
> try
> {
> // throwing code
> }
> catch (...)
> {
> HandleException();
> }
>
> return 0;
> }

If you forget to handle a relevant exception in HandleException, is your debugger able to show you the 'right' backtrace (i.e. where the exception really occurred)? I don't think the op's idea has that problem.

cheers,

aa

-- 
Andreas Ames | Programmer | Comergo GmbH |
Voice:  +49 69 7505 3213 | ames AT avaya DOT com

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