Boost logo

Boost :

From: Daniel Walker (daniel.j.walker_at_[hidden])
Date: 2007-06-25 00:20:26


On 6/24/07, Slawomir Lisznianski <sl_at_[hidden]> wrote:
>
> function0<void> f =
> bind(&foo::on_event, &fo); <-- doesn't compile

This does compile for me with Boost 1.34.0. But using Boost 1.33.1, I
saw the same compile error.

Since on_event is a function object you could bind it directly. You
can then avoid making a copy by using Boost.Ref.

  function0<void> f =
      bind(ref(fo.on_event));

Daniel


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk