Boost logo

Boost :

Subject: Re: [boost] [exception] Incompatibility between boost::throwexception and throw prototype declarations
From: vicente.botet (vicente.botet_at_[hidden])
Date: 2008-09-06 01:16:59


----- 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

>
> On Fri, Sep 5, 2008 at 9:42 PM, vicente.botet <vicente.botet_at_[hidden]>
> 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?

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.

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.

Vicente


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