[sigc] bind arguments within mem_fun()
- From: Andreas Matthias <andreas matthias tuwien ac at>
- To: libsigc-list gnome org
- Subject: [sigc] bind arguments within mem_fun()
- Date: Wed, 01 Sep 2004 15:50:51 +0200
Is it possible to bind an argument to a function that is referenced
by mem_fun()?
Actually I want to achieve the effect of
sigc::mem_fun(*this, &A::foo)(99);
but I need to bind 99 to &A::foo, since I need a nullary function
call.
Below you find an example exhibiting the problem.
Ciao
Andreas
#include <sigc++/sigc++.h>
#include <boost/bind.hpp>
struct A
{
A()
{
// sigc::mem_fun(*this, &A::foo)(99);
sigc::mem_fun(*this,
boost::bind(&A::foo, boost::ref(*this), 99))();
}
void foo(int i){}
};
int main()
{
A a;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]