What happens when you make a member function of a class a friend of itself!?
The code below compiles and runs. Without the friend declaration a 'too many arguments to operator' is generated (and rightly so). I realise that doing this doesn't make any sense but can anyone tell me what is happening here? Does friend force the compiler to omit the default this parameter in some way?
class Test
{
public:
friend bool operator<(Test& lhs, Test& rhs)
{
return true;
}
};
int main( int c, char** argv)
{
Test test1;
Test test2;
return test1 < test2;
}