L
lnitzu
Hello everybody,
I'm not sure what I am doing wrong but can anybody explain why the
overloaded operator is never called?
Here is the sample:
#include <iostream>
using namespace std;
class CTest
{
public:
void AFunction(){cout<<"A Function\n";}
CTest* operator->()
{
cout <<"Operator ->() was accessed\n";
return this;
}
};
int main()
{
CTest *t;
t->AFunction();
return 0;
}
The result is only :
AFunction
Operator ->() was accessed is never desplayed.
Thanks a million....
I'm not sure what I am doing wrong but can anybody explain why the
overloaded operator is never called?
Here is the sample:
#include <iostream>
using namespace std;
class CTest
{
public:
void AFunction(){cout<<"A Function\n";}
CTest* operator->()
{
cout <<"Operator ->() was accessed\n";
return this;
}
};
int main()
{
CTest *t;
t->AFunction();
return 0;
}
The result is only :
AFunction
Operator ->() was accessed is never desplayed.
Thanks a million....