On Feb 6, 2008 10:41 AM, Robert Dailey <rcdailey@gmail.com> wrote:
On Feb 6, 2008 11:18 AM, Rene Rivera <grafikrobot@gmail.com> wrote:
You could use the new function_traits library, but that's not in a release yet. Or recreate the type "manually" using the component typedefs in function <http://boost.org/doc/html/boost/functionN.html>.
I just created my own quick little class for this:
template< typename t_fun > class FunctionHolder { public: typedef t_fun type; };
I don't understand why boost::function can't just have the following:
typedef Signature signature_type;
It would be very useful!
If you're only using boost::function, you could do something along the lines of template<typename T> struct signature; template<typename Signature, typename Allocator> struct signature<boost::function<Signature, Allocator> > { typedef Signature type; } // is_same<signature<boost::function<void (int)> >::type, void(int)> If you're using boost::functionN classes directly, you'd have to recreate it like Rene is suggesting. Stjepan