This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Question with members functions and pointers functions
- To: gcc at gcc dot gnu dot org
- Subject: Question with members functions and pointers functions
- From: Pascal Francq <pfrancq at ulb dot ac dot be>
- Date: Tue, 15 Feb 2000 10:46:54 +0100
- Organization: Université Libre de Bruxelles
I have the following code:
type void sigFunc(unsigned int);
SigFunc *Func=0;
inline void CallFunc(unsigned int sig) { if(Func) Func(sig); }
class A:
{
public:
A(void);
void ASigFunc(unsigned int);
};
A::A(void)
{
Func=ASigFunc;
}
When I do this, the compiler gives an error in the constructor:
no matches converting function `ASigFunc' to type `void (*)(unsigned int)'
candidates are: void A::ASigFunc(unsigned int)
How can I do?
--
Ir. Pascal Francq
Researcher
Université Libre de Bruxelles
Faculty of Applied Mechanics
Avenue F.D. Roosevelt, 50
CP 165/41
B-1050 Brussels
BELGIUM
Tel. +32-2-650 47 65
Fax +32-2-650 27 10