Boost logo

Boost Users :

From: David Klein (dave_chp_at_[hidden])
Date: 2007-02-20 08:50:28


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

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net