hi ppl, i am new to using boost signals lib and have the following doubts: i have an event manager class which has a member function loadmap(). this class also has a signal s_ChangeMap to connect to the above function . now when i tried to do: s_ChangeMap.connect(&LoadMap); i get the following error: error C2276: '&' : illegal operation on bound member function expression the same error also occurs when i try to connect the signal to a function of a different class what should i do to get rid of this. am i missing on some understanding of the working of the signals system or is it something related to the scope of a connection?? please help me , thanx -- View this message in context: http://www.nabble.com/signals-newbie-tf3257471.html#a9056554 Sent from the Boost - Users mailing list archive at Nabble.com.
V12 wrote:
hi ppl, i am new to using boost signals lib and have the following doubts:
i have an event manager class which has a member function loadmap(). this class also has a signal s_ChangeMap to connect to the above function . now when i tried to do: s_ChangeMap.connect(&LoadMap); i get the following error: error C2276: '&' : illegal operation on bound member function expression
the same error also occurs when i try to connect the signal to a function of a different class
what should i do to get rid of this. am i missing on some understanding of the working of the signals system or is it something related to the scope of a connection??
please help me , thanx
Hi, try s_ChangeMap.connect(boost::bind(&EventManager::LoadMap, this)); Replace "this" with a pointer to your eventmanager in case you aren't in a member function when connecting to the signal. -- HTH dave
participants (2)
-
David Klein
-
V12