Boost logo

Boost :

Subject: Re: [boost] Policy proposal: All user-visible exceptions should be thrown through BOOST_THROW_EXCEPTION
From: Brian Wood (woodbrian77_at_[hidden])
Date: 2012-06-27 10:46:38

Emil Dotchevski:

> On Tue, Jun 26, 2012 at 10:24 AM, Brian Wood <woodbrian77_at_[hidden]>
>> Is there a penalty for single threaded applications here? There's
>> been discussion of the support for transferring exceptions between
>> threads; are there aspects of that support that are unneeded in a
>> single threaded context?
> There are 3 aspects of boost::throw_exception:
> 1) it enables libraries to support BOOST_NO_EXCEPTIONS configurations,
> 2) it enables boost::error_info, and
> 3) it enables boost::exception_ptr.
> 1) and 2) have nothing to do with threads; 3) implements
> std::exception_ptr, which mostly benefits multi-thread programs (until
> compilers catch up with std::exception_ptr support.)
> The cost imposed by libraries that use boost::throw_exception to programs
> that don't use boost::exception_ptr or boost::error_info is that sizeof()
> the exception object grows a little.

 I'd appreciate a way at compile time to let Boost Exception know
I'm using it in a single threaded application and it wouldn't add stuff
to the exception object that isn't needed. Also MSDN says,
"Most applications do not have to transport exceptions between threads."

Brian Wood
Ebenezer Enterprises

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