C++ question

Israel Fernández israel at seg.inf.cu
Mon Aug 12 13:35:50 BST 2002


I did it with a normal function instead of using a class method and it worked
thaks a lot
Israel
El Vie 09 Ago 2002 01:58 PM, escribió:
> thaks very much, I'll test it...
> Israel
>
> El Vie 09 Ago 2002 01:33 PM, escribió:
> > On Friday 09 August 2002 17:30, you wrote:
> > > I did somthing like that, but it don't work yet. I'm getting an error
> > > messae saying:
> > > "cannot convert void (CSavdaemon::*) (int) to void (*) (int)"
> > >
> > > My task is to manage the SIGTERM signal in a daemon, CSavdaemon is
> > > main class of the application, the class has a member named void
> > > kill_all(int signal_number), I need to pass this function as a
> > > parameter to the signal function declared in <signal.h>, this is to
> > > install a new signal handler for a given signal number.
> > > What I guess the error message is clear, no posible convertion, but I
> > > dont know how to fix this problem.
> > > I'll apretiate any hint.
> >
> > short:
> >  that doesn't work
> >
> > long:
> >  a method like aclass::amethod(int) has to be called with
> > an object like x.amethod(42); the signal handler will just call
> > amethod(42) -- and that wont't work; methods have a hidden
> > parameter called this and this is missing ;-)
> >
> > some possible solutions:
> > - you have to use "normal" function as a signal handler, but that
> >   function may call x.method(...) if x is a global object
> > - maybe a static method may work, but that may not be what you want
> >
> > hth
> > Gustl

-- 
S at lu2
Israel Farnandez Cabrera

-
to unsubscribe from this list send an email to kdevelop-request at kdevelop.org with the following body:
unsubscribe »your-email-address«



More information about the KDevelop mailing list