Reading really long functions can be very fun!
int crazylongfun()
{
int x = -1;
foo b = -42;
//... 1000 lines below
if( b<-x)
{
std::printf("How did I get here there is no left arrow operator?\n");
}
return 0;
}
Looking at foo definition
struct foo
{
int x;
foo(int a) : x(a) {}
operator int() const
{
return x;
}
};
This compiles just fine and produces the desired output. What is the mechanism that allows this?