Boost logo

Boost :

Subject: Re: [boost] [exception] Incompatibilitybetweenboost::throwexception and throw prototype declarations
From: vicente.botet (vicente.botet_at_[hidden])
Date: 2008-09-06 05:05:30


---------------------------
Vicente Juan Botet Escriba
----- Original Message -----
From: "vicente.botet" <vicente.botet_at_[hidden]>
To: <boost_at_[hidden]>
Sent: Saturday, September 06, 2008 10:58 AM
Subject: Re: [boost] [exception] Incompatibilitybetweenboost::throwexception
and throw prototype declarations

>
> ----- Original Message -----
> From: "Andrey Semashev" <andrey.semashev_at_[hidden]>
> To: <boost_at_[hidden]>
> Sent: Saturday, September 06, 2008 8:59 AM
> Subject: Re: [boost] [exception] Incompatibility
> betweenboost::throwexception and throw prototype declarations
>
>
>>
>> On Sat, Sep 6, 2008 at 9:16 AM, vicente.botet
>> <vicente.botet_at_[hidden]>wrote:
>>
>>> ----- Original Message ----- From: "Emil Dotchevski" <
>>> emil_at_[hidden]>
>>> To: <boost_at_[hidden]>
>>> Sent: Saturday, September 06, 2008 6:52 AM
>>> Subject: Re: [boost] [exception] Incompatibility between
>>> boost::throwexception and throw prototype declarations
>>>
>>> If G throws the excp using the boost::throw(excep) on 1.15 I was able to
>>> write
>>>
>>> void F() thows (excp) {
>>> // ...
>>> G();
>>> // ...
>>> }
>>>
>>> With 1.136 this code do not compile any more because
>>> boost::throw_exception
>>> throws an unspecified exception. So what can I write instead of
>>> --unspecified--
>>>
>>> void F() thows (excp, --unspecified--) {
>>> // ...
>>> G();
>>> // ...
>>> }
>>>
>>> I hope this answer your question, let me know if it is not the case.
>>>
>>
>> If I'm not mistaken, you are safe to add base classes to the exception
>> specification list. Since the "unspecified" exception derives from the
>> "excep" (otherwise you wouldn't be able to catch it), I assume you don't
>> need to change your code.
>
> Where is specified that the --unspecified-- exception derives from "excp"?
>

Sorry forget my comment. I see "
Returns:
An object of unspecified type which derives publicly from T. That is, the
returned object can be intercepted by a catch(T &).

"

Vicente


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