All pastes #630054 Raw Edit

boost.signals try

public text v1 · immutable
·published 2007-07-22 21:31 UTC
rendered paste body
#include <boost/signals.hpp>
#include <iostream>

using namespace std;

class tc // testclass
{
public:
	tc() { this->data = "I'm a test class."; }
	~tc() {}

	boost::signal<void ()> s;
	void theSlot(void) { cout << this->data << endl; }

private:
	string data;
};


int main()
{
	tc t;
	t.s.connect (&tc::theSlot);
	t.s();
}