From: Peter Dimov (pdimov_at_[hidden])
Date: 2022-02-15 01:53:27


Gavin Lambert wrote:
> Perhaps StackTrace could be split into a capture-only component that has the
> properties you desire and a formatting component for the rest?

That's actually what I suggested during the Boost review of Stacktrace. :-)

> What's probably a more practical solution might be to have potential throw
> sites declare a context object on their stack. Any Boost-aware throw that
> occurs while these objects are on the stack would capture whatever additional
> information is requested by the context objects that are still in scope at the
> time. This might be a stack trace, a source location, a plain string, or any other
> context info (e.g. method parameters) that seems useful.

I think I like Emil's user-provided handler better, because with it the user would
control whether and what is collected.