Re: [eigen] exception specifications... |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] exception specifications...
- From: leon zadorin <leonleon77@xxxxxxxxx>
- Date: Mon, 15 Mar 2010 13:10:08 +1100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=Relvm6oot+GFYO95JU0YYxuiuz5sNZXvGjuVcI3SMRM=; b=C2lGA0rddAItkGpsRtr/VJKx4xwtT3VH7jUCLhwNhnUfJgpCn1hlvvVqxtS3Rzo+Zm 0A4tlfGvC3c+hQ8XEBEEPD1SE3PwMjGfLlGza0Mql6+sfalAFo0EKwJLuDmp4EPZPMpx MEss8xwVGSZ5sd7VPuLIxN1p0AYIniwL4t/rg=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=Zm44A7S9jXl89pIuwX3hOr8ZV7XzCtDZjwN9T9k051+IoN8xQmtcPYscDvwhmj4uiv iRi2CafJ4KhnMqwclL0VLbGstyAPHB7kMfQiQuu5QexjtfR7AI7Vy4E2mNowVz389tks F1FstSnbRNL9nIzHO1qwgqrSU2+PPtttPslys=
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:
http://gcc.gnu.org/gcc-4.1/changes.html
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.
"
Kind regards
Leon.