#include <iostream>
using namespace std;

template<typename Derived>
class Comparisons {
 public:
  template <typename T>
  friend bool operator!=(Comparisons<T> const& a, Comparisons<T> const& b);
};

template <typename Derived>
bool operator!=(const Comparisons<Derived>& lhs, const Comparisons<Derived>& rhs)
{
    const Derived& d1 = static_cast<const Derived&>(lhs);
    const Derived& d2 = static_cast<const Derived&>(rhs);

    return !(d1 == d2);
}

struct Test : Comparisons<Test>
{
    friend bool operator==(const Test& t1, const Test& t2);
};

bool operator==(const Test& t1, const Test& t2)
{
    return true;
}

int main()
{
    Test t1, t2;

    bool b = t1 != t2;
	
    return 0;
}