Boost logo

Boost :

Subject: Re: [boost] [function] function wrapping with no exception safetyguarantee
From: Emil Dotchevski (emil_at_[hidden])
Date: 2010-10-12 21:50:13


On Tue, Oct 12, 2010 at 6:38 PM, Dave Abrahams <dave_at_[hidden]> wrote:
> On Tue, Oct 12, 2010 at 7:59 PM, Peter Dimov <pdimov_at_[hidden]> wrote:
>> The issue is not coupling with Boost.Exception, the issue is that the user
>> has to supply a definition of boost::throw_exception when exceptions are
>> disabled. This was true before there were Boost.Exception.
>
> Okay, and could someone please explain to me what is wrong with that
> requirement?

Maybe someone else should do that but I think I understand it.

Suppose you're a subcontractor who develops a library for another
company. Internally, you use boost::function and so your library
requires the executable to define boost::throw_exception.

You could tell the other company to do that, but you'd rather not: at
best, you'd have to explain why this is needed even though the
function won't be called, at worst they'd be mad that you've used
Boost (that's common in games, for example.) Your other option is to
define boost::throw_exception in the library, but then if another
library uses Boost they'll get link errors.

So you'd rather keep everything under wraps. After all, you never,
ever call an empty boost::function.

Emil Dotchevski
Reverge Studios, Inc.
http://www.revergestudios.com/reblog/index.php?n=ReCode


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk