Re: [eigen] exception specifications...

[ Thread Index | Date Index | More Archives ]

I wanted to bring up this discussion once more in order to finish it... ;)

On Mon, Mar 15, 2010 at 4:10 AM, leon zadorin <leonleon77@xxxxxxxxx> wrote:
> On 3/14/10, Hauke Heibel <hauke.heibel@xxxxxxxxxxxxxx> wrote:
>> I thought it might be a good idea to remove the throw() declarations
> For as long as you retain your lib as 'header-only' one (i.e. no
> shared lib files) -- with using extern/global functions et al, the
> explicit "throw()" qualifier allows some compilers to optimize things
> that they otherwise would/could not...
> For instance, from:
> we have:
> "
> When generating code for a shared library, GCC now recognizes that
> global functions may be replaced when the program runs. Therefore, it
> is now more conservative in deducing information from the bodies of
> functions. For example, in this example:
>    void f() {}
>    void g() {
>     try { f(); }
>     catch (...) {
>       cout << "Exception";
>     }
>    }
> G++ would previously have optimized away the catch clause, since it
> would have concluded that f cannot throw exceptions. Because users may
> replace f with another function in the main body of the program, this
> optimization is unsafe, and is no longer performed. If you wish G++ to
> continue to optimize as before, you must add a throw() clause to the
> declaration of f to make clear that it does not throw exceptions.
> "

So, does it mean we want to keep stuff or should we follow the advices
given by the boost devs and/or H. Sutter!?

In case you insist of sticking to throw(), I can finally remove the
code I have in my repository.

- Hauke

Mail converted by MHonArc 2.6.19+