Boost logo

Boost :

Subject: Re: [boost] [function] function wrapping with no exceptionsafetyguarantee
From: Emil Dotchevski (emil_at_[hidden])
Date: 2010-10-30 13:55:17

On Sat, Oct 30, 2010 at 9:43 AM, Daniel Walker
<daniel.j.walker_at_[hidden]> wrote:
> Yes, if you look at the code in the benchmark, you will see that it is
> measuring the cost of a call to a non-empty boost::function. In
> optimized object code, the call is 4% faster without the check, but
> removing the check means that it is necessary to store a special,
> internal static object per instantiation to hold an "empty" function
> that must be available if boost::function becomes empty.

Do you really need a placeholder for each different boost::function signature?

Since all it does is throw an exception, it should be safe to use the
same placeholder for all signatures:

Emil Dotchevski
Reverge Studios, Inc.

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