Hello everyone,
I have a problem with some code in C++.
when i compile it under visual studio 6 everything is ok.
but when i compile it with gcc... well....
what i do is define a function pointer the following way:
i have a class called CCollect that collects function pointers.
the following line is inside that class:
Code:
public:
typedef void (CCollect::*TFunction)()
now what i want to do is to take a funciton
Code:
void foo(CSomeClass* ptr, int nParam)
{
...
}
and i try to assign this function's address in a variable of type TFunction;
Code:
CCollect::TFunction pFunc = (CCollect::TFunction)foo
this works just fine in visual studio, but gcc simply gives me the following error:
"no matches converting function 'foo' to type 'void class CCollect::*'().
candidates are: void foo(CSomeClass* ptr, int nParam)"
any idea why that happens?
Thanks