
On Sat, Oct 30, 2010 at 9:43 AM, Daniel Walker <daniel.j.walker@gmail.com> 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: http://codepad.org/3GxiTHZA. Emil Dotchevski Reverge Studios, Inc. http://www.revergestudios.com/reblog/index.php?n=ReCode