
Hi, I've got couple questions. Might be someone can point me in right direction. Let's say I've got this class ConcreteFunctor which should handle all kinds of functions. I want to store the function as boost::function object, thus the class has template parameter - FunctionType: template<typename FuncType> ConcreteFunctor : public AbstractFunctor { ConcreteFunctor( FuncType f ) ... {} virtual invoke( std::vector<Object*> const& args ) { // here I can use FuncType::arity and FuncType's argument types // to properly convert arguments to desired types and invoke m_f } FuncType m_f; } Now I need to implement object maker template<typename F> boost::shared_ptr<AnstractFunctor> make_functor( F f ) { typedef boost::function<???> TypeName; return boost::shared_ptr<AbstrctFunctor>( new ConcreteFunctor<FuncType>( f ) ); } I was able to work fine with free functions by just removing pointer from F. Now to the questions: 1. How do I deduce boost::function type from pointer to member functions: Essentially if F is R (A::*)(T1,T2) I need to get boost::function<T (A*,T1,T2)> 2. This is more difficult: if f is bound object, how to I intrspect it's type: Essentially in use case like this: int foo( std::string, int ) {...} make_functor( boost::bind( &foo, "abc" ) ) I want to get FuncType as boost::function<int (int)> Regards, Gennadiy