Date: prev next · Thread: first prev next last
2012 Archives by date, by thread · List index


Hi all,

On Tue, Mar 20, 2012 at 10:50:02PM +0100, Lubos Lunak wrote:
- boost, and pretty much everybody else it seems, do not consider it worth the 
hassle of specifying what a function may or may not throw, except for 
flagging a non-inline method as not throwing any exception at all as a means 
of optimization for places where such functions are called

For the most part I would agree here. C++ exceptions are broken by design.
Allowing any kind of object (not even exception) to be thrown by default in a
function adds another _untyped_ return path (as if every function would return
a void* in addition to its return code). Which is exactly what you do _not_
want in a strongly typed environment. Since we are using bazillions of external
libraries, we have no way to fix this even if we would try to.

IMHO exceptions in C++ are a failed implementation, and if there is any general
advise about them, it is: "Avoid using C++ exceptions".

Best,

Bjoern

P.S.: see also http://yosefk.com/c++fqa/exceptions.html




Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.