RE: [sigc] Passing variables to mem_fun();?
- From: Paul Davis <paul linuxaudiosystems com>
- To: Ulrich Eckhardt <Eckhardt satorlaser com>
- Cc: libsigc-list gnome org
- Subject: RE: [sigc] Passing variables to mem_fun();?
- Date: Fri, 23 Dec 2005 07:02:54 -0500
On Thu, 2005-12-22 at 08:59 +0100, Ulrich Eckhardt wrote:
> Philippe Gagnon wrote:
> > I am currently writing an application that uses sigc to transmit
> > events between parts of the application. So far I have been very
> > pleased by the flexibility of the library, but unfortunately I am
> > currently facing a little situation here.
> >
> > I would like to pass an argument of my function as an argument to
> > mem_fun(); and I do not know if this is possible.
>
> mem_fun only creates a uniform function wrapper around a
> memberfunction, so that functors, functions and memberfunctions get
> an equivalent interface.
> I'm not exactly sure if that's what you mean, but Ithink the thing
> you're looking for is called binding.
more illustratively:
sigc::signal<void> signalWithNoArguments;
class Foo {
void methodWithOneArgument (int);
};
....
signalWithNoArguments.connect (bind (mem_fun (aFoo,
&Foo::methodWithOneArgument), 13);
[
Date Prev][
Date Next] [
Thread Prev][Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]