Boost logo

Boost Users :

Subject: Re: [Boost-users] Using boost.signals with boost.bind
From: Jeff Gray (jeffg_at_[hidden])
Date: 2008-10-13 20:09:04

Sergey Kishchenko wrote:
> I have one problem with boost.bind and boost.signals I can't understand.

I have used bind with signals in a simpler way than you have in this
example. It works well for me. I don't know if you are doing it in a
more complex way for a reason, but hopefully my simple version will be
some help.

class MyClass
  { // define the connection using bind
  boost::signal<void (bool)> mySignal;
  void MySlot(bool state)
  { // do something here to process the signal data when this is called

// later on, to call that signal
inst = MyClass();

This is all pretty straightforward. This only unusual thing (for me) is
the use of _1 as a marker for the first parameter. If you have a
function with more parameters, then the next parameter would be _2 and
so on.

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at