Question:
A funny C++ question was asked today – how to achieve that
(x==1 && x==2 && x==3 && x==4)
was true
?
Answer:
Like that
class X {
public:
bool operator==(int other) {
return true;
}
}
x = X();
A funny C++ question was asked today – how to achieve that
(x==1 && x==2 && x==3 && x==4)
was true
?
Like that
class X {
public:
bool operator==(int other) {
return true;
}
}
x = X();