From: Gavin Lambert (boost_at_[hidden])
Date: 2022-02-14 22:45:47


On 14/02/2022 18:49, Vinnie Falco wrote:
> I am less excited about changing the signatures of all public
> functions. I thought that BOOST_THROW_EXCEPTION attached a stack trace
> to the exception? Wouldn't that provide the same or more information
> as BOOST_CURRENT_LOCATION at the user's call site?

Not sure about gcc/clang/Linux, but with msvc/Windows it's possible to
recover a stack trace from any thrown exception regardless of type,
without any fanfare at the throw site (albeit only by relying on some
fugly compiler internals).

Although also I thought one of the main selling points of
Boost.StackTrace is that it's nearly free to capture a trace at time of
exception; it's only formatting into human-readable that's potentially
expensive, but that only happens at the other end on demand.

Personally, I find passing around source-locations to be completely
useless (and subject to binary bloat and undesirable disclosure, as
Niall pointed out). Stack traces all the way.