C++ - is it possible to extract class and argument types from a member function type in a template?
I would like to wrap member functions that conform to the type 'void (ClassType::Function)(ArgType)' with a templated class. Later, I want to pass an instance of ClassType to an instance of this template and have it invoke the wrapped method: class Foo { public: Foo() : f_(0.0) {} void set(double v) { f_ = v * 2.1; } double get() { return f_; } private: double f_; }; template <typename ArgType, typename ClassType, void (ClassType::*Method)(ArgType)> class Wrapper { public: explicit Wrapper(ClassType *cls) : cls_(cls) {} void do_something(ArgType value) { (cls_->*Method)(value); } private: