
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