|
Boost : |
Subject: Re: [boost] Boost and exceptions
From: Jeffrey Lee Hellrung, Jr. (jeffrey.hellrung_at_[hidden])
Date: 2012-06-23 06:25:02
On Sat, Jun 23, 2012 at 2:30 AM, Mathias Gaunard <
mathias.gaunard_at_[hidden]> wrote:
> On 06/22/2012 02:23 PM, Stewart, Robert wrote:
>
> In hindsight, I agree with Robert's assertion that there should have been
>> a replacement function, boost::exception::throw_**exception() or
>> similar, to introduce the new functionality. Whether the existing function
>> needed to be deprecated is a separate issue. The result is that libraries
>> could knowingly choose the new version, and a dependency on
>> Boost.Exception, or, if warranted, stick with the old.
>>
>
> That would be a terrible idea.
>
> The whole point of the system is that there is a single place where you
> enable Boost.Exception support for all libraries.
>
> If some libraries were allowed to stick to non-Boost.Exception-enabled
> boost::throw_exception, then you couldn't transfer those exceptions between
> threads.
>
Well, clearly, some libraries have been allowed their own throw_exception
implementation for some time, notably Boost.Serialization and
Boost.FileSystem.
>From what I can find in the list archives [1], Boost.FileSystem also had a
similar issue with the requirement that thrown exceptions inherit from
std::exception. However, I'm not sure if [1] prompted the FileSystem-local
hook or if it was resolved in some other way.
- Jeff
[1] http://lists.boost.org/Archives/boost/2008/05/138016.php
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk