Boost logo

Boost Users :

Subject: [Boost-users] bind member function of a member of a class...
From: Archie14 (admin_at_[hidden])
Date: 2009-03-04 17:33:27

I cannot figure out how to use boost::bind in following scenario:

class A
  int i_;
  int test() {return i;}

class B
   A _a;
   A& getA() {return _a;}

bool testbind()
  B b;
  // here I am trying to find out if b.getA().test() equals 1
  // I understand that B::getA::test is incorrect, and that's my question-
  // how to use bind here?
  return (boost::bind (&B::getA::test, b) ==1);

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at