Boost logo

Boost :

From: Beman Dawes (beman_at_[hidden])
Date: 2000-07-18 12:40:57

Paul A. Bristow wrote:

>After all that flurry of disputation
>Should I use this sort of confusing macro to allow specification, or not?
>// Do we need to be able to switch exceptions off/on completely?
>#if _HAS_EXCEPTIONS // Used by Dinkumware/Microsoft Standard Library.
> #define _THROW0() throw ()
>#else /* no exceptions */
> #define _THROW0()
>#endif /* _HAS_EXCEPTIONS */
> #if _USES_EXCEPTION_SPECIFICATIONS_WELL // What should I call this?
> #define _THROW0() throw ()

That's essentially the question in the "Exception specifications in
smart_ptr.hpp" thread. I'm leaning toward putting a BOOST_THROW in
boost/config.hpp, coupled with a dire warning that it (and exception specs
in general) should never be used without understanding the implications.

Which I will try to get Dave Abrahams to write docs for, based on his
emails. We already say "Avoid exception specifications. Rationale: they
provide no compile-time safety and cause many (if not most) compilers to
generate poorer code. Do, however, use exceptions to report errors where
appropriate, and write code that is safe in the face of exceptions." but
that doesn't go into enough detail, apparently.


Boost list run by bdawes at, gregod at, cpdaniel at, john at