   Standalone, portable C++ signal/slots library?
  Hello,I'm looking for a standalone, portable C++ signal/slots library that I can use with GCC 4.0 on Linux or Windows. I know that Qt has signals and slots support, but that requires a preprocessor and I'm not really keen on integrating Qt into my application for the single purpose of using the signal and slots capability. I've looked at sigslot, which seems to be nice and clean, but doesn't compile very well on GCC 4.0 (and I'm not keen on editing that massive file to make it compile). Libsigc++ doesn't seem to want to compile very much on Windows.Does anyone know of any other potentially good signal/slots libraries for C++ that I could use? All I'm looking for is some very basic functionality - connecting signals to slots, with possible arguments, and then firing the signals.Thanks in advance![Edited by - fyhuang on December 6, 2005 11:42:12 AM]
  boost signals!!!We use them to emulate .net delegates!  Cant' say enough good things about them.CheersChris   ;  I would also recommend boost signals, if you don't mind the dependency on Boost. If you need something standalone, I wrote a C++ delegates library last year.#include "delegado.h"using namespace delegado; void f(int x, int y) { cout << x + y; }struct S{ void g(int m, int n) { cout <<  m*n; } };int main(){delegate<void, int, int> f_del(f);S s;delegate<void, int, int> g_del(&S::g, s);f_del(3, 4); //calls f(3, 4)g_del(5, 6); //calls s.g(5,6)event<void, int, int> e;e.bind(f);e.bind(&S::g, s);e(7, 8); //calls f(7,8) and s.g(7,8)return 0;}It's fairly simple. Just lot's of (ugly) template specializations to make the same events and delegates accept different numbers of template parameters. The performance isn't great (ends up making 4 calls per use of operator()), and it doesn't do anything fancy (like marshalling event calls), but it gets the job done. It worked under gcc 3.0 and visual c++ 7, I haven't tried it yet under gcc 4.0.Tell me if you're interested, I'll put it on sourceforge.-Alex   