-----Original Message----- From: boost-users-bounces@lists.boost.org [mailto:boost-users- bounces@lists.boost.org] On Behalf Of Johannes Brunen Sent: Friday, December 01, 2006 7:10 AM To: boost-users@lists.boost.org Subject: [Boost-users] [bind,function,mem_fn] Connection to a base class
[Nat] This is top-of-the-head, no tests.
I have a base class X with two functions f and g
class X { virtual bool f() const; virtual bool g(int) const; };
and another class Y with functions f1, f2 and F
class Y { void f1(); void f2(); void F(???);
[Nat] Seems like you'd want to make F accept boost::function
};
Y::f1() { // call F so that F works on X::f F(??? X::f);
[Nat] F(boost::bind(&X::f, this))
}
Y::f2() { // call F so that F works on Y::g but with g's int parameter known and determined in Y::f2 int v = 5; F(??? X::g, v);
[Nat] F(boost::bind(&X::g, this, v))
}