#include #include #include #include struct A { boost::signals2::signal Signal; }; struct B { boost::signals2::signal Signal; }; int main() { boost::shared_ptr pA = boost::make_shared(); boost::shared_ptr pB = boost::make_shared(); std::cout << "Should be 0: " << pA->Signal.num_slots() << std::endl; pA->Signal.connect(pB->Signal); std::cout << "Should be 1: " << pA->Signal.num_slots() << std::endl; pA->Signal(); pB.reset(); std::cout << "Ideally 0, but I think it will be 1 which would mean we are about to get some undefined behavior: " << pA->Signal.num_slots() << std::endl; pA->Signal(); return 0; }