#include<iostream>

class WithMethod 
{
public: int Method () const { return 1000; }
};

class NoMethod {};

template<typename Class>
class HasMember_Method
{
  typedef char (&yes)[2];
     
  template<typename> struct Exists;
     
  template<typename V>
  static yes CheckMember (Exists<decltype(&V::Method)>*);
  template<typename>
  static char CheckMember (...);
     
public: 
  static const bool value = (sizeof(CheckMember<Class>(0)) == sizeof(yes));
};

template<typename T>
void foo (const T* const p)
{
	std::cout << "HasMember_Method<T>::value = " << HasMember_Method<T>::value << "\n";
}

int main()
{
	WithMethod* pW = new WithMethod;
	NoMethod* pN = new NoMethod;

	foo(pW);
	foo(pN);

	delete pW; delete pN;
}

