Boost logo

Boost Users :

From: Caleb Epstein (caleb.epstein_at_[hidden])
Date: 2007-05-22 22:05:23


On 5/22/07, Nicolas Emiliani <or3st3s_at_[hidden]> wrote:

> this works fine but, i need to bind a member pointer that returns an int, so
> as i understand i need to do this :
>
> boost::bind<int>( &bla::member_that_returns_int , &b)
>
> but boost::thread won't accept it in the constructor...
>
> So... what I'm asking is.... is there a trick to do this that I'm not aware
> of?... basically what occucrred to me was
> to encapsulate de method that returns an int using the () operator... but it
> seems pretty nasty to me.

So what you want is to run that function in a thread, and collect the
result when it has finished? Sounds a bit like futures:

http://braddock.com/~braddock/future/

http://braddock.com/~braddock/future/future_20070429/README.txt

-- 
Caleb Epstein

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