#include <type_traits>
template<typename T, typename = void>
struct is_equality_comparable : std::false_type
{ };
template<typename T>
struct is_equality_comparable<T,
typename std::enable_if<
true,
decltype((std::declval<T>() == std::declval<T>()), (void)0)
>::type
> : std::true_type
{
};
struct X { };
struct Y { };
bool operator == (X const&, X const&) { return true; }
int main()
{
static_assert(is_equality_comparable<int>::value, "!");
static_assert(is_equality_comparable<X>::value, "!");
static_assert(is_equality_comparable<Y>::value, "!");
}
ICAgICNpbmNsdWRlIDx0eXBlX3RyYWl0cz4KCiAgICB0ZW1wbGF0ZTx0eXBlbmFtZSBULCB0eXBlbmFtZSA9IHZvaWQ+CiAgICBzdHJ1Y3QgaXNfZXF1YWxpdHlfY29tcGFyYWJsZSA6IHN0ZDo6ZmFsc2VfdHlwZQogICAgeyB9OwoKICAgIHRlbXBsYXRlPHR5cGVuYW1lIFQ+CiAgICBzdHJ1Y3QgaXNfZXF1YWxpdHlfY29tcGFyYWJsZTxULAogICAgICAgIHR5cGVuYW1lIHN0ZDo6ZW5hYmxlX2lmPAogICAgICAgICAgICB0cnVlLAogICAgICAgICAgICBkZWNsdHlwZSgoc3RkOjpkZWNsdmFsPFQ+KCkgPT0gc3RkOjpkZWNsdmFsPFQ+KCkpLCAodm9pZCkwKQogICAgICAgICAgICA+Ojp0eXBlCiAgICAgICAgPiA6IHN0ZDo6dHJ1ZV90eXBlCiAgICB7CiAgICB9OwoKICAgIHN0cnVjdCBYIHsgfTsKICAgIHN0cnVjdCBZIHsgfTsKCiAgICBib29sIG9wZXJhdG9yID09IChYIGNvbnN0JiwgWCBjb25zdCYpIHsgcmV0dXJuIHRydWU7IH0KCiAgICBpbnQgbWFpbigpCiAgICB7CiAgICAgICAgc3RhdGljX2Fzc2VydChpc19lcXVhbGl0eV9jb21wYXJhYmxlPGludD46OnZhbHVlLCAiISIpOwogICAgICAgIHN0YXRpY19hc3NlcnQoaXNfZXF1YWxpdHlfY29tcGFyYWJsZTxYPjo6dmFsdWUsICIhIik7CiAgICAgICAgc3RhdGljX2Fzc2VydChpc19lcXVhbGl0eV9jb21wYXJhYmxlPFk+Ojp2YWx1ZSwgIiEiKTsKICAgIH0K