I have this link http://www.codingunit.com/unary-and-binary-operator-table. It says that pointer to member operator is a binary operator.
I have this code :
class test
{
public:
int num;
test(int j)
{
num=j;
}
test* operator->()
{
this->num;
}
};
int main()
{
test T(5);
cout<<"Number is :"<<T->num;
}
As I know, non static member function of binary operator accepts one argument, but according to this program if I provide it one argument. It has an error, which says that test* operator ->(int x) should be test* operator ->(void) .