Boost logo

Boost :

Subject: Re: [boost] [exception] Incompatibility between boost::throwexception and throw prototype declarations
From: Andrey Semashev (andrey.semashev_at_[hidden])
Date: 2008-09-06 02:59:45


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.


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