<class Host, class Arg1> class MethodFunc<typename void (Host::*)(Arg1)>: public Func<Arg1> { typedef typename Func<Arg1> Interface; typedef typename void (Host::*Method)(Arg1); virtual void operator () (Arg1 arg1){ (host->*method)(arg1); } std::auto_ptr<Host> host; Method method; }; template <class Host, class Method> std::auto_ptr<MethodFunc<Func>::Interface> wrap(Host host, Method method) { return new MethodFunc<Func>(host,method); }