#include #include #include "slot.h" #include "signal0.h" class ParentFoo { public: virtual bool Bar() { printf("ParentFoo::Bar!\n"); return false; } virtual ~ParentFoo() { // empty } }; class Foo: public ParentFoo { public: bool Bar() { printf("Foo::Bar!\n"); return true; } virtual ~Foo() { // empty } }; Foo f; bool somefunc() { printf("some func\n"); return true; } template slot0_method* make_slot(T_class* c, T_method m) { return new slot0_method(c,m); } int main(int argc, char** argv) { slot0* s = make_slot(&f,&Foo::Bar); slot0* t = make_slot(&f,&ParentFoo::Bar); slot0_function x( somefunc ); slot0* u = &x; if ( *s == *t ) (*s)(); (*u)(); signal0 sig; sig.connect(&f,&Foo::Bar); sig(); }