#include<iostream>
#include<type_traits>

namespace CHECK
{
  struct No {}; 
  template<typename T, typename Arg> No operator== (const T&, const Arg&);

  template<typename T, typename Arg = T>
  struct EqualExists
  {
    enum { value = !std::is_same<decltype(*(T*)(0) == *(Arg*)(0)), No>::value };
  };  
}

struct A 
{ 
  bool operator == (A const &);
};

struct B 
{
  short operator == (B const &); 
};

struct C {};

struct D
{
  short operator == (short);
};

int main()
{
  std::cout<< "A::operator== () exists: " << CHECK::EqualExists<A>::value << std::endl;
  std::cout<< "B::operator== () exists: " << CHECK::EqualExists<B>::value << std::endl;
  std::cout<< "C::operator== () exists: " << CHECK::EqualExists<C>::value << std::endl;
  std::cout<< "C::operator== (short) exists: " << CHECK::EqualExists<D, short>::value << std::endl;
}
