fork(8) download
#include <iostream>

struct X
{
	int a;
	friend bool operator<(const X& left, const X& right) { return left.a < right.a; }
private:
	struct safe_zero_idiom;
public:
	friend bool operator<(const X& left, safe_zero_idiom*) { return left.a < 0; }
};

int main()
{
	X x{1}, y{-2};
	//if (x < 3)
	std::cout << (y < x) << "\n";
	std::cout << (y < 0) << "\n";
}
Success #stdin #stdout 0s 3340KB
stdin
Standard input is empty
stdout
1
1