Boost logo

Boost :

Subject: Re: [boost] [Stacktrace] review
From: Nat Goodspeed (nat_at_[hidden])
Date: 2016-12-14 21:06:33


On Wed, Dec 14, 2016 at 7:53 PM, Robert Ramey <ramey_at_[hidden]> wrote:

> I think that there has been a lot of confusion about what
> BOOST_THROW_EXCEPTION is suppose to do.
>
> My understanding was that it was a macro intended to support the writing of
> portable code that could run on platforms which didn't support exceptions or
> where the user / author didn't want to use the exception mechanism so he
> could redefine the macro. Lot's of libraries used this idiom to decouple
> their libraries from the the selection of exception mechanism.

I admit that my usage of BOOST_THROW_EXCEPTION is fairly recent, but
that use case is not even mentioned:
http://www.boost.org/doc/libs/1_62_0/libs/exception/doc/BOOST_THROW_EXCEPTION.html

What I want from BOOST_THROW_EXCEPTION is to embed the current source
file, line number and function name in the thrown exception -- which
is the closest I can get to a "stack trace" with current portable
facilities.

> Now it's being suggested that BOOST_THROW_EXCEPTION be repurposed/enhanced
> yet again?

I suggested that there is potential for integration between (the
proposed) Boost.Stacktrace and Boost.Exception. I'm flexible about
exactly what form that integration will take. I rather like Emil's
suggestion of embedding the stacktrace from within
boost::throw_exception, since it can do that. It need not happen
within the BOOST_THROW_EXCEPTION macro.


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