Boost logo

Boost Users :

From: Tony Juricic (tonygeek_at_[hidden])
Date: 2005-02-06 10:13:23


Shame be where it belongs, after rading documentation, implementation,
examples and test code, I am unable to write what should be simple
signals code:

---------------------------------------------
*.h

typedef boost::function<void (void)> Callback;

struct Signal
{
  static void Connect(Callback f);
};

------------------------------------------------
*.cpp

boost::signal<void (void)> mySignal;

void Signal::Connect(Callback f)
{
// iterate over signal slots, if slot equals input f do nothing
// otherwise connect f
}

Tony


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