Boost logo

Boost Users :

From: Pete Bartlett (pete_at_[hidden])
Date: 2008-08-09 03:57:09


>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).


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net