Boost logo

Boost Users :

Subject: [Boost-users] condition variable predicate and lambda
From: Christopher Pisz (cpisz_at_[hidden])
Date: 2011-10-18 15:24:47


I want to do something simple, but implementing it seems awefully complex.

All I want to do is wait for a specified amount of time for a member variable
of my class to equal a certain value.

Can someone please help me with an example?

I've tried several that came from Googling and read the documentation, but I
get compile errors no matter what I try.

Currently the compiler is complainging "term does not evaluate to a function
taking 0 arguments"

Here is the problem in all its simplicity:

class A
{
public:

   enum STATE
   {
      HAPPY = 0,
      SAD,
      ANGRY,
      NUM_STATES
   };

   Foo(boost::posix_time::millisec & timeout)
   {
      // I need to wait to return from this until the state is HAPPY

   }

private:
   STATE state_;
};


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net