#include #include #include using namespace std; using namespace boost; struct Hello { Hello () { cout << "Hello::Hello () @ " << this << endl; } Hello (const Hello&) { cout << "Hello::Hello (const ref) @ " << this << endl; } ~Hello () { cout << "Hello::~Hello @ " << this << endl; } Hello& operator= (const Hello&) const { cout << "Hello::operator= @ " << this << endl; } void operator () (int i) { cout << "i = " << i << endl; } }; void copytest () { cout << "copy test:\n"; Hello hello; boost::signal sig; sig.connect (hello); sig (1968); } void reftest () { cout << "ref test:\n"; Hello hello; boost::signal sig; sig.connect (ref (hello)); sig (1968); } int main () { copytest (); reftest (); }