Though below is the not right answer, it at least fixes the issue. In the code snippet, I changed 2 lines:
template<typename Class>
class HasMember_Method
{
typedef char (&yes)[2];
template<typename> struct Exists; // <--- changed
template<typename V>
static yes CheckMember (Exists<decltype(&V::Method)>*); // <--- changed (c++11)
template<typename>
static char CheckMember (...);
public:
static const bool value = (sizeof(CheckMember<Class>(0)) == sizeof(yes));
};
And this fixes the compilation issues in VS2010/12!
WAIT! That uncovers another flaw in the buggy VC++ compiler.
It always results in true. :(
The good old g++ works fine here as well.
So the correct answer is to wait for the Microsoft VC++ compiler team to fix these issues.