Suppose I have a C++11 function:
template<class F, class... Args>
void g(F&& f, Args&&... args)
{
/* ... */
forward<F>(f)(forward<Args>(args)...);
/* ... */
}
and I have a class X:
struct X
{
void h();
}
Is there some way I can pass a call to h on a specific X instance x as parameters f, args through g?
X x = ...;
g(x.h); // WRONG
Use
std::mem_fn: