#include <iostream>
#include <vector>
#include <memory>
#include <functional>
using namespace std;
template<class S> class Foo;

template<class Ret, class Arg, class... Args>
class Foo<Ret(Arg*, Args...)> 
{
public:
	template<class FUNC>
	Foo(FUNC func)
	{
		cout << "func" << endl;
	}
	Foo(Ret(Arg::*method)(Args...)) { cout << "fptr" << endl; }
};
class EMPTY {};
class Bar
{
public:
	Bar() {}
	void XD(int a) {}
};
void func1(Bar*, int)
{
	
}
void func2(int*, int)
{

}
void func3(int, int)
{

}
void func4(EMPTY*, int)
{

}
int main()
{
	//Foo<void(int*, int)> fff(bbb);    //0. 這到底是為什麼? 他始終會想先走不用推導的版本
	Foo<void(Bar*, int)> obj(&Bar::XD); //1. 因為他是pointer to member所以直接走不用推導的版本
	Foo<void(Bar*, int)> obj2(func1);   //2  因為是非pointer to member所以只能走另一個, 透過推導
	Foo<void(EMPTY*, int)> obj3(func4); //3. 原因跟2 一樣
	return 0;
}
