Subject: Re: [boost] [function] improvements/proposals
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2010-02-27 00:45:05
> Actually, the only reason they outperform boost::function is because
> boost::function adds in extra assembly code for a comparison check (to
> null, if true it throws an exception). If that is removed (perhaps by
> a policy, I certainly know that most of my function would never be
> empty, would even be nice if the function defaulted to an empty
> function if empty instead), then boost::function becomes even faster.
> I have actually started to take a liking to Boost.Variant for function
> callbacks (if I know what they can be), it inlines it and the function
> pointer call disappears. :)
The comparison could be removed even without a policy by using the
null object pattern.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk