
9 Aug
2008
9 Aug
'08
7:57 a.m.
If you need boost::function just to declare a function that takes a boost::function as parameter or returns it as result, with boost version 1.36 you can do:
namespace boost { template <class> class function; } void foo( boost::function<void(whatever)> const & );
A similar thing works in <= 1.35, but you have to take account of allocators, IIRC. And when you actually need the include, it is quicker to include <boost/function/functionN.hpp> than boost/function. Here N is the arity of the function you use (cannot vouch for the full portability of this but works with modernish VC and GCC).