|
Boost : |
Subject: Re: [boost] 5 Observations - My experience with the boost libraries
From: Joaquin M Lopez Munoz (joaquin_at_[hidden])
Date: 2010-03-28 13:48:14
Nicholas Howe <nicholas.howe <at> gmail.com> writes:
>
> On Thu, Mar 25, 2010 at 6:58 PM, Tom Brinkman <reportbase2007 <at>
gmail.com>wrote:
>
> > 1) Boost uses exceptions.
> >
>
> I'm a game programmer. I've worked at companies that disable exceptions.
>
> [...]
>
> #ifndef THROW_H
> #define THROW_H
>
> #include <cstdlib>
>
> struct Throw
> {
> };
>
> template< class T >
> inline void operator <<( Throw &, T const & )
> {
> std::exit( EXIT_FAILURE );
> }
>
> #define throw Throw() <<
>
> #endif
>
> [...]
There's already BOOST_THROW_EXCEPTION to allow users some
degree of adaptability when throwing an exception
inside a Boost library:
http://www.boost.org/libs/exception/doc/BOOST_THROW_EXCEPTION.html
However, BOOST_THROW_EXCEPTION does not assume that
the function throwing can return more or less normally:
the user can only specify a termination procedure. Besides,
it's not clear to me what the degree is of adoption of
this macro in place of raw throw across Boost libraries.
JoaquÃn M López Muñoz
Telefónica, Investigación y Desarrollo
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk