This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Question with members functions and pointers functions
- To: Pascal Francq <pfrancq at ulb dot ac dot be>
- Subject: Re: Question with members functions and pointers functions
- From: sidster <patrick at mail dot boxsoft dot com>
- Date: Tue, 15 Feb 2000 02:44:33 -0800
- Cc: "gcc list (aka egcs)" <gcc at gcc dot gnu dot org>
- References: <00021510520001.13999@mecapp97.ulb.ac.be>
Make your ASigFunc static.
* Pascal Francq (pfrancq@ulb.ac.be) [20000215 02:39]:
> 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?
patrick
--
It's a damn poor mind that can only think of one way to spell a word.
-- Andrew Jackson