#include <iostream>
#include <tuple>
#include <iostream>

template<class T>
struct X {};

template<class T>
bool operator==( X<T>, X<T> ) { return true; }

template<class T>
struct Y {
	friend bool operator==( Y, Y ) { return true; }
};

struct A {
	template<class T>
	operator X<T>() const { return {}; }
};

struct B {
	template<class T>
	operator Y<T>() const { return {}; }
};


int main() {
	A a;
	X<int> x;
	B b;
	Y<int> y;
	b == y;
	a == x;
}
