#include <iostream>
using namespace std;

struct Foo
{
	void Bar(int a)
	{
		cout<<"non-const "<<a<<endl;
	}
	void BarConst(int a) const
	{
		cout<<"const "<<a<<endl;
	}
};
struct CallMe
{
	template<class This, class Return, class... Args>
	void Invoke(This *obj, Return(This::*MFPTR)(Args...), Args&&... args) const
	{
		// Do something need the Return, This, Args... types..
		(obj->*MFPTR)(std::forward<Args>(args)...);
	}
	
	template<class This, class Return, class... Args>
	void Invoke(This *obj, Return(This::*MFPTR)(Args...) const, Args&&... args) const
	{
		(obj->*MFPTR)(std::forward<Args>(args)...);
	}
};
int main() {
	CallMe call;
	Foo f;
	call.Invoke(&f, &Foo::Bar, 1);
	call.Invoke(&f, &Foo::BarConst, 1);
	// your code goes here
	return 0;
}