vicente.botet | 6 Sep 06:41

[exception] Incompatibility between boost::throw exception and throw prototype declarations

Hi,

As boost::throw_exception can now throw un unspecified exception throgh the 
use of enable_current_exception, do it is no more possible to use throw 
declaration in the prototype of any function calling functions that directly 
or indirectly calls throw_exception. See enable_current_exception 
declaration in the documentation.

namespace
boost
    {
    template <class T>
    ---unspecified--- enable_current_exception( T const & e );
    }

Does it means that we have a interface change of the boost::throw 
function since it was implemented by the Boost.Exception library on 1.36.0?

Best,

Vicente 
_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Emil Dotchevski | 6 Sep 06:52

Re: [exception] Incompatibility between boost::throw exception and throw prototype declarations

On Fri, Sep 5, 2008 at 9:42 PM, vicente.botet <vicente.botet <at> wanadoo.fr> wrote:
> Hi,
>
> As boost::throw_exception can now throw un unspecified exception throgh the
> use of enable_current_exception, do it is no more possible to use throw
> declaration in the prototype of any function calling functions that directly
> or indirectly calls throw_exception. See enable_current_exception
> declaration in the documentation.
>
> namespace
> boost
>    {
>    template <class T>
>    ---unspecified--- enable_current_exception( T const & e );
>    }
>
> Does it means that we have a interface change of the boost::throw
> function since it was implemented by the Boost.Exception library on 1.36.0?

Umm..... Whaaaat?

Emil Dotchevski
Reverge Studios, Inc.
http://www.revergestudios.com/reblog/index.php?n=ReCode
_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

vicente.botet | 6 Sep 07:16

Re: [exception] Incompatibility between boost::throwexception and throw prototype declarations

----- Original Message ----- 
From: "Emil Dotchevski" <emil <at> revergestudios.com>
To: <boost <at> lists.boost.org>
Sent: Saturday, September 06, 2008 6:52 AM
Subject: Re: [boost] [exception] Incompatibility between 
boost::throwexception and throw prototype declarations

>
> On Fri, Sep 5, 2008 at 9:42 PM, vicente.botet <vicente.botet <at> wanadoo.fr> 
> wrote:
>> Hi,
>>
>> As boost::throw_exception can now throw un unspecified exception throgh 
>> the
>> use of enable_current_exception, do it is no more possible to use throw
>> declaration in the prototype of any function calling functions that 
>> directly
>> or indirectly calls throw_exception. See enable_current_exception
>> declaration in the documentation.
>>
>> namespace
>> boost
>>    {
>>    template <class T>
>>    ---unspecified--- enable_current_exception( T const & e );
>>    }
>>
>> Does it means that we have a interface change of the boost::throw
>> function since it was implemented by the Boost.Exception library on 
>> 1.36.0?
(Continue reading)

Andrey Semashev | 6 Sep 08:59

Re: [exception] Incompatibility between boost::throwexception and throw prototype declarations

On Sat, Sep 6, 2008 at 9:16 AM, vicente.botet <vicente.botet <at> wanadoo.fr>wrote:

> ----- Original Message ----- From: "Emil Dotchevski" <
> emil <at> revergestudios.com>
> To: <boost <at> lists.boost.org>
> 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.
>
(Continue reading)

vicente.botet | 6 Sep 10:58

Re: [exception] Incompatibility betweenboost::throwexception and throw prototype declarations

----- Original Message ----- 
From: "Andrey Semashev" <andrey.semashev <at> gmail.com>
To: <boost <at> lists.boost.org>
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> wanadoo.fr>wrote:
>
>> ----- Original Message ----- From: "Emil Dotchevski" <
>> emil <at> revergestudios.com>
>> To: <boost <at> lists.boost.org>
>> 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
(Continue reading)

vicente.botet | 6 Sep 11:05

Re: [exception] Incompatibilitybetweenboost::throwexception and throw prototype declarations


---------------------------
Vicente Juan Botet Escriba
----- Original Message ----- 
From: "vicente.botet" <vicente.botet <at> wanadoo.fr>
To: <boost <at> lists.boost.org>
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> gmail.com>
> To: <boost <at> lists.boost.org>
> 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> wanadoo.fr>wrote:
>>
>>> ----- Original Message ----- From: "Emil Dotchevski" <
>>> emil <at> revergestudios.com>
>>> To: <boost <at> lists.boost.org>
>>> Sent: Saturday, September 06, 2008 6:52 AM
>>> Subject: Re: [boost] [exception] Incompatibility between
>>> boost::throwexception and throw prototype declarations
>>>
(Continue reading)

vicente.botet | 6 Sep 11:56

Re: [exception] Incompatibility betweenboost::throwexception and throw prototype declarations

----- Original Message ----- 
From: "Andrey Semashev" <andrey.semashev <at> gmail.com>
To: <boost <at> lists.boost.org>
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> wanadoo.fr>wrote:
>
>> ----- Original Message ----- From: "Emil Dotchevski" <
>> emil <at> revergestudios.com>
>> To: <boost <at> lists.boost.org>
>> 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
(Continue reading)

David Abrahams | 7 Sep 01:30
Favicon
Gravatar

Re: [exception] Incompatibility betweenboost::throwexception and throw prototype declarations


on Sat Sep 06 2008, "vicente.botet" <vicente.botet-AT-wanadoo.fr> wrote:

> and compiled it with both versions. Everything is OK.

Just for the record, exception-specifications are not checked at compile
time except in the case of virtual functions, so you probably should
actually do some runtime tests if you're worried about it.

--

-- 
Dave Abrahams
BoostPro Computing
http://www.boostpro.com
_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Emil Dotchevski | 6 Sep 09:20

Re: [exception] Incompatibility between boost::throwexception and throw prototype declarations

On Fri, Sep 5, 2008 at 10:16 PM, vicente.botet <vicente.botet <at> wanadoo.fr> wrote:
> 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();
>   // ...
> }
>
> P.S. I don't push for exception specification in function prototypes, I'm
> just saying that when used the new boost::throw_exception implementation
> brokes the code.

Consider a function declared as:

class my_exception1;
class my_exception2;
void foo() throw(my_exception1,my_exception2);

The above declaration doesn't guarantee that the function does not
throw any other exceptions, only that if it throws something else the
runtime will call std::unexpected(), as if:
(Continue reading)


Gmane