id summary reporter owner description type status milestone component version severity resolution keywords cc 12483 signals2 bind to member function by value fail to signal when using trackable kim.lykke.johansen@… Douglas Gregor "In my trail to learn and get comfortable with signals2 I wrote a small test program. In this program I encountered what I believe to be inconsistency in the way that signals2 connect to member functions when using bind, when using trackable aswell. {{{ #!div style=""font-size: 80%"" Test program: {{{#!c++ #include ""boost/signals2.hpp"" #include class SignalTest : public boost::signals2::trackable { public: SignalTest() {}; void printInfo(const std::string name, int num) { std::cout << ""Signal: "" << name << "" "" << num << std::endl; } }; int main() { boost::signals2::signal sig; SignalTest test1; sig.connect(boost::bind(&SignalTest::printInfo, test1, _1, _2)); sig(""Test"", 1); { SignalTest test2; sig.connect(boost::bind(&SignalTest::printInfo, test2, _1, _2)); sig(""Test"", 2); } return 0; } }}} }}} The code above compiles and running it I'd expect both signals to be printed, however nothing is printed. If however I bind the signalTest object ""test2"" by reference like the code below: {{{ #!div style=""font-size: 80%"" Bind by reference: {{{#!c++ sig.connect(boost::bind(&SignalTest::printInfo, &test2, _1, _2)); }}} }}} The following is printed: {{{ #!div style=""font-size: 80%"" test2 bind by reference print {{{#!text Signal: Test 2 }}} }}} And if I also bind signalTest object ""test1"" by reference the following is printed: {{{ #!div style=""font-size: 80%"" test1 and test2 bind by reference print {{{#!text Signal: Test 1 Signal: Test 2 Signal: Test 2 }}} }}} As I was lead to understand from the example code of section ""Automatic Connection Management"" in the tutorial at http://www.boost.org/doc/libs/1_61_0/doc/html/signals2/tutorial.html#idp394616720 I should be able to call the member function by value, however this is not the case using trackable. " Support Requests new To Be Determined signals Boost 1.61.0 Not Applicable signals2 trackable bind