Boost logo

Boost Users :

Subject: Re: [Boost-users] multiple levels of bind nesting
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2009-07-22 17:04:19


AMDG

Zachary Turner wrote:
> <snip>
>
> void client::start_work()
> {
> apply_visitor(
> bind(do_work_visitor(), _1,
> protect(bind(&client::work_finished, this, _1, _2)))
> , work_variant_);
> }
> <snip>
>
> template<class Handler>
> void async_do_work(Handler h)
> {
> //impl supports the same basic interface as worker
>
> impl->async_do_work(
> bind(&worker::intercept_handler<Handler>, this, h, _1, _2));
> }
>

Since h is a bind expression it needs to be protect'ed.

> <snip>
> However this doesn't work. I've also tried protect(bind in the
> async_do_work function and that doesn't work either. Is it supposed
> to be possible to nest binds arbitrarily deep or is this just a
> limitation? Or am I just doing it wrong?
>

In Christ,
Steven Watanabe


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