Boost logo

Boost :

From: Andrey Semashev (andrey.semashev_at_[hidden])
Date: 2022-02-15 10:13:33


On 2/15/22 09:56, Emil Dotchevski via Boost wrote:
> On Mon, Feb 14, 2022 at 8:32 PM Gavin Lambert via Boost <
> boost_at_[hidden]> wrote:
>>
>> On 15/02/2022 17:25, Emil Dotchevski wrote:
>>> I know it's why you did it by reference, but this handler can be useful
> for
>>> other libraries also, as well as for e.g. logging, etc. It's a chance
> to do
>>> something before a Boost library throws.
>>
>> Why would such a library call the callback without just using
>> throw_exception itself? And throw_exception guarantees that the
>> boost::exception exists.
>
> To avoid the dependency on boost::throw_exception.

The callback pointer has to live somewhere, as does the default
callback. My understanding is it's Boost.ThrowException, so the
dependency will be there anyway.


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