boost::signals - member-functions as slots

Hi, I have a short question regarding the boost::signals library. Is it possible to connect a member function to a signal or must the passed slot be either static or be a function object? If yes what would be the syntax to pass the function and the associated object reference? -Dirk

Hi Dirk.
I have a short question regarding the boost::signals library. Is it possible to connect a member function to a signal or must the passed slot be either static or be a function object?
The documentation contains examples of how to do it using the boost::bind() function. (But, sorry, can't type it out from memory here and even hope for it to be correct. :-( ). Hope this helps, Jurko

Dirk Gregorius wrote:
Hi,
I have a short question regarding the boost::signals library. Is it possible to connect a member function to a signal or must the passed slot be either static or be a function object? If yes what would be the syntax to pass the function and the associated object reference?
Boost::bind lets you create a function object from a pointer to an object and a pointer to a member function of the object's class. You can pass the result of such a boost::bind to boost::signals as your slot.
participants (3)
-
Dirk Gregorius
-
Edward Diener
-
Jurko Gospodnetic