I
Immortal Nephi
Can you please tell me what overloading operator-> is used for? My
code does not sound right. And also what is overloading operator->*
for? I am unable to find more information in the Google search.
class test
{
public:
test() : data( 0 ) { pF = &test::F1; }
~test() {}
test *operator->()
{
data++;
return this;
}
void (test::*pF)();
void Run() {}
void F1() {}
int data;
};
int main()
{
test t, *pt = &t;
t->Run();
return 0;
code does not sound right. And also what is overloading operator->*
for? I am unable to find more information in the Google search.
class test
{
public:
test() : data( 0 ) { pF = &test::F1; }
~test() {}
test *operator->()
{
data++;
return this;
}
void (test::*pF)();
void Run() {}
void F1() {}
int data;
};
int main()
{
test t, *pt = &t;
t->Run();
return 0;